Closed fabienbaron closed 9 years ago
To do this you will need to modify a bunch of bits within SIMTOI. For example you will start in CGLWidget::RebuildTree
. Add an extra column to the header (you'll see the row in this function), then modify CGLWidget::RebuildTree
to query the CParameterItem
for some aptly named function (i.e. getUnits
). Add the getUnits
function to CParameterItem
(or is it CParameterMap
... I forget, it'll be obvious though) and propagate the change all the way down to CParameter. I don't want users editing the units (parsing units is a horrible pain), so whoever implements this needs to ensure the item is marked as not editable.
Then you'll have a place where the units can be displayed, but there is a lot more to do.
Then modify the CParameter::addParameter
function to take a unit argument. (I suppose you could just add an extra constructor that takes units and leave the others as-is, but I'd rather have everything supporting such a critical part of the program).
After this the save and restore functions need to be modified to write and read (but ignore/override) the unit flag (we don't want to support arbitrary units... that'll be a nightmare). I suppose we could just not write the units to the file, but I would rather have the data stored there. Lets discuss this.
Ultimately, what I would like to see added to the model tree is the "help" field in the parameter array, i.e. for "g_pole" -> "Gravity at the pole (units: m/s^2)". Are you saying that adding this as a column will require the work stated above? This is will not only give the user the units, but provide a needed definition for what the parameter represents. For example, what are the definitions of phi and theta in the spot feature.
@therob762 My next job in the gui_overhaul
branch will be to re-implement the GUI for the parameters. I intend to have the help
field show up as a tool tip when the user hovers over a row (rather than have it be permanently displayed). I would refrain from doing the work to add tool tips in the current master/develop branch as I will be implementing these features this weekend in gui_overhaul
Tooltips are very 1990s... Next, drop-down menus... :P We should just modify the column "name" to be more informative. This will take barely more space (none of the units should be more than a few characters long) and can be done in 20 minutes tops for all the models.
The tooltip now displays units as specified in the model.
Users can (will !) be confused by the lack of units. We should add a column with the units.