Log in

View Full Version : Constants from a text file


orangelight
01-02-2014, 20:51
What are the advantages of getting constants from a text file?

joelg236
01-02-2014, 21:09
Off the top of my head


No redeploying every change
Easy to change settings from non-programming computer
Less buggy than Smartdashboard or Preferences
Easy to delete, reset, change

orangelight
01-02-2014, 21:35
Off the top of my head


No redeploying every change
Easy to change settings from non-programming computer
Less buggy than Smartdashboard or Preferences
Easy to delete, reset, change


How do you move your changes to the cRIO without redeploying?

Domenic Rodriguez
01-02-2014, 23:09
How do you move your changes to the cRIO without redeploying?

If you use an FTP client like FileZilla, you can easily edit the constants file from the driver station and upload it to the cRIO. Then you have a method in your code that reads the new values from the file and updates your program accordingly. No recompiling necessary.

eddie12390
03-02-2014, 11:15
Also, if you're interested, I made a tool in C# for managing a Constants file fairly easily. It has the ability to parse a Constants file using the Cheesy Poofs format (each key and value on a new line delimited by an =) and can upload to the robot via FTP.

JohnGilb
03-02-2014, 16:46
Also, Windows has built-in support for FTP network locations.

You can add a ftp location (like ftp://10.xx.yy.2, your team's cRio) to the Computer (the location that comes up when you press WinKey+E, then just right click in empty space and select "Add a network location") so you can just browse and edit files through the standard explorer interface, no special client needed.

joelg236
03-02-2014, 17:07
Also, Windows has built-in support for FTP network locations.

You can add a ftp location (like ftp://10.xx.yy.2, your team's cRio) to the Computer (the location that comes up when you press WinKey+E, then just right click in empty space and select "Add a network location") so you can just browse and edit files through the standard explorer interface, no special client needed.

Was not aware of this. Thanks for the tip!