...I was actually writing code to do this not too long ago...
My plan was to save an array of constant/name pairs. I currently use something like this to lookup non-setpoint constants for the elevator (such as gains, limits, sensor calibrations, etc.) on a per-robot basis. What it basically does is stores an array of name/comp/pratice values, and finds the right one each time the variable is requested. I have no speed issues doing this, although I am only using it for about 20 constants.
I use a scripted autonomous system (Beescript) that allows me to write an auto script that looks something like this:
Code:
#Go To Score HI
ELEV_SET_STATE score_hi
# Drive Straight 167" 6ft/sec
DRIVE_STRAIGHT 167 6
#Score (no arguments)
ELEV_SCORE
But due to the modular design of the interpreter, the list of possible commands (and the functions for these commands) is separate from the interpreter itself (I actually debugged all of the Beescript code using a function that popped up with message boxes in a blocking way). And I was thinking of just adding a command to set constant, then running the same interpreter to read the file. Writing the files would be even simpler - Just print a new line for each constant in storage, plus a few comments here and there.
Realistically, the LV interface is good enough for fine-tuning work. It gives me a UI to change variables and I don't have to write any code at all (always a good thing). What the script gives you is the ability to change constants rapidly, without re-downloading. The benefits are HUGE - seriously. This is awesome.
@ajlapp, feel free to use Beescript (get it
here).