Go to Post I've never been one for the "you did your best" and other "everyone's a winner" sayings, they don't push you, they don't get you to analyze what went wrong and figure out where to improve. - Aren_Hill [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-02-2010, 01:28
Thomas4019 Thomas4019 is offline
Registered User
FRC #3006
Team Role: Programmer
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Salt Lake City
Posts: 7
Thomas4019 is an unknown quantity at this point
Smile Java Dynamic Settings

Our teams have found the deployment times with Java+Netbeans can take quite a while. We have found it to take a long time to fine-tune certain settings. To solve this problem our team has developed a specialized Java class called Settings.

It allows us to store settings on a text file (settings.txt) on the root of the cRIO. Then, we can change the file, upload it through FTP, and the values are instantly changed. This has proved invaluable to our development process. I thought I would share this to help other teams that may be having similar problems.

For example, in our code we use Settings.getDouble("Min Radius") so that the minimum radius required for vision tracking can be changed at run time. This has saved us hours of debugging time!

Our Settings.java file can be found on our team's site here

Here's our settings.txt file which can be used as an example for the syntax of the file. Basically, it's just "key = value" for each line.

We have been able to configure Textpad to upload the current file to the robot by only pressing Control + 4. If you want help configuring Textpad to do this, I can post a guide here.

If you attempt to retrieve a setting that does not exist in the file it will throw a NullPointerException. Also, any lines in the settings.txt file that don't have an "=" character are simply ignored. Finally, you must have a setting with a key of "Autoupdate Delay" which specifies the number of milliseconds before the settings.txt file will be read again.

Hope this helps,
Thomas Hansen
Team 3006
Reply With Quote
  #2   Spotlight this post!  
Unread 09-02-2010, 01:42
MattD's Avatar
MattD MattD is offline
Registered User
AKA: Matthew Douglas
FRC #0228 (GUS Robotics)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Indianapolis, IN
Posts: 185
MattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to behold
Send a message via AIM to MattD
Re: Java Dynamic Settings

Thanks for sharing this! Coincidentally, I was just about to try and write something like this tonight. All this is missing is a way to save a setting back to the file.
__________________
GUS Robotics Team 228

2010 WPI Engineering Inspiration Award
2010 WPI Regional Champions (Thanks 230 & 20!)
2010 CT VEX Champions
2010 CT VEX Innovate Award
2009 QCC VEX Champions
2009 CT Motorola Quality Award
2007 CT J&J Sportsmanship Award
2006 CT Best Website Award
Reply With Quote
  #3   Spotlight this post!  
Unread 09-02-2010, 11:34
Delian Delian is offline
Registered User
FRC #3006
 
Join Date: Dec 2008
Location: Salt Lake City
Posts: 16
Delian is on a distinguished road
Re: Java Dynamic Settings

As Thomas mentioned, the way our team FTP's the settings.txt onto the robot is with Textpad since the ftp.config file is already created in the Netbeans project, all you have to do is install the FTP add-on onto Textpad. This makes the change time less than 3 seconds, all you have to do is switch windows and press Ctrl 4 and it will be updated live onto the code.

We will be posting a tutorial on how to use settings onto our website within the next few days.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
**FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION*** Pjohn1959 Programming 37 31-08-2009 15:55
Wireless settings IndySam FRC Control System 2 24-11-2008 15:19
Optimal Tracking settings bush Programming 2 31-01-2006 11:38
Setting Autonomous Settings from OI Tom Saxton Programming 15 27-03-2005 11:45
Pneumatic settings Raz Pneumatics 8 03-02-2003 20:38


All times are GMT -5. The time now is 12:35.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi