LRAUV  revA
Universal Data Values and Units

As described in requirement Use "Universal" Data Values, the system will be capable of handling data values in an abstract, "universal" manner, providing for example, the best available value for pressure when "pressure" is requested.

Universal data value names are defined in the UniversalURI class. The logic for handling universal data elements is contained in UniversalDataElement. Essentially, for each UniversalURI actually used by the system, a UniversalDataElement is created, which contains a list of each DataElement that writes the "universal" value. Each time one of the DataElements in the list change their accuracy or change their state (to/from failed or to/from orphaned) the "best" element in the list is recalculated.

Also important to the concept of universal data values are Units. They are mentioned in several system requirements including:

The Unit class represents an engineering unit and allows engineering units to be converted to/from the SI units used internally. A useful operator overload within the Unit class is Unit::operator()(), which returns a pointer to a new DataValue with the specified value. The Units class contains a collection of static constant instances of Unit.

When a value is written (via DataWriter::write), a unit must be specified. If the unit is not a base SI unit, the value will be converted to base SI units before being written to the Slate.

Likewise, when values are read (via DataReader::read or DataReader::asDouble), a unit must be specified. If the unit is not a base SI unit, the value will be converted to the specified unit when it is read from the Slate.