ID3TagEd icon - 1314 bytes

UnitConv

Editing the unit conversion data


The edit dialogue

Edit units data dialogueAlthough there is a wide range of different conversions supplied as default, the conversions are not exhaustive, and UnitConv now has the ability to edit, add, or delete conversions. Remember that the Special group of conversions, which is hard coded into the application and is always the last item on the menu (bottom right button of the conversion window) cannot be edited.

The edit dialogue (accessed from the iconbar menu) is shown to the right. There are writable fields for the group name, the set name, and up to nine pairs of fields for the unit name and corresponding conversion factor. When the dialogue is first opened it will show the data for the first set of conversions in the first group.

The data can be edited by simply placing the caret in the required field and typing. Moving from field to field can be achieved, either by using the mouse to place the caret, or by using the TAB key (Shift-TAB to move backward), or the up/down arrow keys. If there are blank fields then items can be added by simply typing in the appropriate data to the next available pair of fields. Data can be deleted by clearing the corresponding pair of fields, or by using the menu option (see below). When the edited data is stored, blank lines are ignored.

Note that the data displayed in the edit window and modified during editing is actually a copy of the data used by UnitConv for its conversions, so if you have a change of heart, no damage is done.

Movement through the installed sets and groups of data is accomplished using the bump buttons to the right of the group name and set name fields. Any changes made to the data on display will be remembered when changing set or group.

In addition to simple editing of the existing data, it might also be necessary to add or delete complete sets or groups of conversions. This is carried out using the menu attached to this window.


Using reciprocal conversion factors

It is now possible to deal with conversions that not only have a conversion factor, but also have a reciprocal relationship to other units in the same set. For example, to use miles/gal and gal/100 mile in the same set of conversions, requires reciprocal manipulation. This is accomplished by entering the slash / symbol as the first character in the conversion factor. This is shown in the image below for just such a set of conversions.

Edit units data dialogue

The edit window menu

Edit unit data dialogueClicking MENU over the edit dialogue produces the menu shown at the right.

The options should be self-explanatory. It is possible to add, delete, or insert complete sets or groups of conversions, up to the limits imposed by the program. It is also possible to delete or insert a single item in a set. In version 2.30 there can be nine items in a set, nine sets in any one group, and nine groups in total. There will always be the special group of conversions as well. When inserting an item, a set or a group, it is inserted immediately before the set or group that is being displayed when the action is selected.

The last option is Save data. The edited data must be saved in order for the new data to be used. In order for the new conversions to come into effect, !UnitConv must be Quit and restarted. If the data is not saved, all the changes will be discarded when the Edit data dialogue is closed. An alternative means of saving the edited data is to use the button at the foot of the edit window (see above).

Saving the new data does not overwrite the default data file. The new set of conversions is saved under a different filename (customdat). When !UnitConv starts, it looks for the file customdat first. If it finds it, then it uses it to set up the conversions. If it does not find the customdat file, then it falls back to loading the default file unitsdata. As an additional safety measure, the previous customdat file (if it exists) is kept under the filename _customdat when a save is done, so the previous version can be recovered if necessary. You will need to open the !UnitConv application directory by holding down the SHIFT key while double clicking on the application directory to find these files.

If there is ever a problem with the customdat file after an edit, then starting !UnitConv with the control key held down will force !UnitConv to load the default unitsdata file.



Larr.gif - 145
bytes Gas calculations   |   Index  |   Configuration file format Rarr.gif - 141 bytes

These pages are best viewed in a CSS compliant browser. For RISC OS, Netsurf would be the browser of choice.

UnitConv is © Chris Johnson, 2012
Email:chris@chris-johnson.org.uk