|
LRAUV
revA
|
Code that represents an engineering unit. More...
#include <Unit.h>


Public Member Functions | |
| Unit (const char *name, const char *abbreviation, const BaseUnit &baseUnit, const double toSiMultiplier=1.0, const double toSiAddend=0.0) | |
| General unit constructor. More... | |
| Unit (const char *name, const char *abbreviation, const BinaryDataType defaultDataType=NO_TYPE) | |
| Base unit constructor. More... | |
| virtual | ~Unit () |
| const double | getScaled (const double &siValue) const |
| const int | getScaled (const int siValue) const |
| const double | getSI (const double &scaledValue) const |
| const int | getSI (const int scaledValue) const |
| void | toScaled (double &siValue) const |
| void | toScaled (int &siValue) const |
| void | toSI (double &scaledValue) const |
| void | toSI (int &scaledValue) const |
| DataValue * | dataValue (const BinaryDataType dataType=NO_TYPE) const |
| DataValue * | dataValue (const bool &assignFrom, const BinaryDataType dataType=NO_TYPE) const |
| DataValue * | dataValue (const unsigned char &assignFrom, const BinaryDataType dataType=NO_TYPE) const |
| DataValue * | dataValue (const int &assignFrom, const BinaryDataType dataType=NO_TYPE) const |
| DataValue * | dataValue (const float &assignFrom, const BinaryDataType dataType=NO_TYPE) const |
| DataValue * | dataValue (const double &assignFrom, const BinaryDataType dataType=NO_TYPE) const |
| bool | operator== (const Unit &unit) const |
| bool | operator!= (const Unit &unit) const |
| DataValue * | operator() (const BinaryDataType dataType=NO_TYPE) const |
| DataValue * | operator() (const bool &assignFrom, const BinaryDataType dataType=NO_TYPE) const |
| DataValue * | operator() (const unsigned char &assignFrom, const BinaryDataType dataType=NO_TYPE) const |
| DataValue * | operator() (const int &assignFrom, const BinaryDataType dataType=NO_TYPE) const |
| DataValue * | operator() (const float &assignFrom, const BinaryDataType dataType=NO_TYPE) const |
| DataValue * | operator() (const double &assignFrom, const BinaryDataType dataType=NO_TYPE) const |
| const char * | getAbbreviation (void) const |
| const char * | getName (void) const |
| const Unit & | getBaseUnit (void) const |
| const BinaryDataType | getDefaultDataType () const |
Protected Attributes | |
| const char * | name_ |
| const char * | abbreviation_ |
| const Unit & | baseUnit_ |
| const BinaryDataType | defaultDataType_ |
| double | toSiAddend_ |
| double | toSiMultiplier_ |
| double | fromSiAddend_ |
| double | fromSiMultiplier_ |
| bool | needSiAddend_ |
| bool | needSiMultiplier_ |
Private Member Functions | |
| Unit (const Unit &old) | |
Code that represents an engineering unit.
Allows engineering units to be converted to/from the SI units used internally
| Unit::Unit | ( | const char * | name, |
| const char * | abbreviation, | ||
| const BaseUnit & | baseUnit, | ||
| const double | toSiMultiplier = 1.0, |
||
| const double | toSiAddend = 0.0 |
||
| ) |
General unit constructor.
References UnitRegistry::AddUnit().
| Unit::Unit | ( | const char * | name, |
| const char * | abbreviation, | ||
| const BinaryDataType | defaultDataType = NO_TYPE |
||
| ) |
Base unit constructor.
References UnitRegistry::AddUnit().
|
virtual |
|
private |
| DataValue * Unit::dataValue | ( | const BinaryDataType | dataType = NO_TYPE | ) | const |
References defaultDataType_, DOUBLE4, DOUBLE6, DOUBLE8, FLOAT2, FLOAT3, FLOAT4, INT4, MULTIVALUE, NAN, NANF, NO_TYPE, SHORT2, UCHAR1, and USHORT2.
Referenced by Component::newConfigReader(), Slate::NewDataElement(), Behavior::newSettingReader(), Slate::NewUniversalElement(), operator()(), and Config::ParseLine().
| DataValue * Unit::dataValue | ( | const bool & | assignFrom, |
| const BinaryDataType | dataType = NO_TYPE |
||
| ) | const |
| DataValue * Unit::dataValue | ( | const unsigned char & | assignFrom, |
| const BinaryDataType | dataType = NO_TYPE |
||
| ) | const |
| DataValue * Unit::dataValue | ( | const int & | assignFrom, |
| const BinaryDataType | dataType = NO_TYPE |
||
| ) | const |
| DataValue * Unit::dataValue | ( | const float & | assignFrom, |
| const BinaryDataType | dataType = NO_TYPE |
||
| ) | const |
| DataValue * Unit::dataValue | ( | const double & | assignFrom, |
| const BinaryDataType | dataType = NO_TYPE |
||
| ) | const |
|
inline |
|
inline |
|
inline |
References defaultDataType_.
Referenced by ElementURI::getBinaryType().
|
inline |
References name_.
Referenced by UnitRegistry::AddUnit(), DataAccess::asString(), CommandLine::commandShowVariable(), MissionItem::initialize(), Slate::NewUniversalElement(), Config::ParseLine(), ValueClause::ReadDataValue(), Unserialize::Run(), LinearApproximationLogWriter::sendOutput(), NetCdfTableLogWriter::setAttValue(), DataAccess_Test::testRead(), BlobValue::toString(), ParsedCommand::toString(), MultiLogWriter::write(), and DataAccess::write().
| const double Unit::getScaled | ( | const double & | siValue | ) | const |
References toScaled().
Referenced by Int::copyTo(), Double::copyTo(), Float::copyTo(), BlobValue::get(), Location::getLat(), Location::getLon(), getScaled(), DataElement::getWrittenAccuracy(), BlobValue::set(), toScaled(), Int::toString(), Float::toString(), Double::toString(), and Location::toString().
| const int Unit::getScaled | ( | const int | siValue | ) | const |
References getScaled().
| const double Unit::getSI | ( | const double & | scaledValue | ) | const |
References toSI().
Referenced by Int::compare(), Double::compare(), Float::compare(), Int::equals(), Float::equals(), Double::equals(), BlobValue::get(), getSI(), Location::Location(), BlobValue::set(), SimpleDataElement::setAccuracy(), DataElement::setAccuracy(), Int::setFrom(), Float::setFrom(), Double::setFrom(), Location::setLat(), Location::setLon(), and toSI().
| const int Unit::getSI | ( | const int | scaledValue | ) | const |
References getSI().
| bool Unit::operator!= | ( | const Unit & | unit | ) | const |
|
inline |
References dataValue().
|
inline |
References dataValue().
|
inline |
References dataValue().
|
inline |
References dataValue().
|
inline |
References dataValue().
|
inline |
References dataValue().
| bool Unit::operator== | ( | const Unit & | unit | ) | const |
References baseUnit_, toSiAddend_, and toSiMultiplier_.
| void Unit::toScaled | ( | double & | siValue | ) | const |
References fromSiAddend_, fromSiMultiplier_, needSiAddend_, and needSiMultiplier_.
Referenced by getScaled().
| void Unit::toScaled | ( | int & | siValue | ) | const |
References getScaled().
| void Unit::toSI | ( | double & | scaledValue | ) | const |
References needSiAddend_, needSiMultiplier_, toSiAddend_, and toSiMultiplier_.
Referenced by getSI().
| void Unit::toSI | ( | int & | scaledValue | ) | const |
References getSI().
|
protected |
Referenced by getAbbreviation().
|
protected |
Referenced by getBaseUnit(), and operator==().
|
protected |
Referenced by dataValue(), and getDefaultDataType().
|
protected |
Referenced by toScaled().
|
protected |
Referenced by toScaled().
|
protected |
Referenced by getName().
|
protected |
Referenced by toScaled(), and toSI().
|
protected |
Referenced by toScaled(), and toSI().
|
protected |
Referenced by operator==(), and toSI().
|
protected |
Referenced by operator==(), and toSI().