Skip to content

ENH: UI Updates for dimensional units

John Tourtellott requested to merge john.tourtellott/smtk:units-ui/onbobs into master

This branch updates Qt user interface for dimensional units. The default line editor for double items specified with units was changed to now include units in the text input, e.g., "3.14159 ft" or "2.71828 m/sec". The new editor includes a dropdown completer listing the compatible units for the item. The list of compatible units are obtained from the unit system stored in the attribute resource. Double items specified without units use the same editor field as before. The new editor is only used for numerical input, i.e., items with discrete or expression options also use the same editor as before.

Note: this branch is being merged with known issues:

  • The popup completer does not display if the numerical value ends in the decimal point optionally followed by 1 or more zeroes.
  • The current logic treats unrecognized units as valid/custom. This will be changed -- in the near future, SMTK will ignore units (strings) not recognized by the units system. A warning message will be output for each unrecognized unit.
  • The "Restore Default" logic should use the definition's default string. (The current behavior is valid but unexpected.)
  • Certain input strings are not detected and handled as invalid, e.g. "2 ftxx".

An example template file can be found at data/attribute/attribute_collection/unitsExample.sbt.

UnitsUI

Todo

  • Review handling of invalid entries
  • Append default units if none entered by user
  • Release note
Edited by John Tourtellott

Merge request reports