mirror of
https://github.com/nasa/trick.git
synced 2025-06-21 08:29:39 +00:00
Output "--" if that was specified in the header file.
Used the mods field in the attributes to indicate of "--" was specified in the header file. We still save the units as "1" to keep it compatible with udunits. When outputting the variable in data recording or variable server we check to see if the mods field for "--" is set. We output "--" if the mods field is set. Also allowed "--" to persist in data products. refs #254
This commit is contained in:
@ -41,6 +41,7 @@ FieldDescription::FieldDescription(
|
||||
field_width(0) ,
|
||||
inherited(false) ,
|
||||
units("1") ,
|
||||
is_dashdash(false) ,
|
||||
line_no(0) ,
|
||||
io(3) ,
|
||||
type_enum_string("TRICK_VOID") ,
|
||||
@ -233,6 +234,7 @@ void FieldDescription::parseComment(std::string comment) {
|
||||
units.erase(remove_if(units.begin(), units.end(), isspace), units.end());
|
||||
if ( !units.compare("--") ) {
|
||||
units = "1" ;
|
||||
is_dashdash = true ;
|
||||
} else {
|
||||
// map old unit names to new names
|
||||
std::string new_units = map_trick_units_to_udunits(units) ;
|
||||
@ -367,6 +369,10 @@ std::string FieldDescription::getUnits() {
|
||||
return units ;
|
||||
}
|
||||
|
||||
bool FieldDescription::isDashDashUnits() {
|
||||
return is_dashdash ;
|
||||
}
|
||||
|
||||
void FieldDescription::setIO(unsigned int in_io) {
|
||||
io = in_io ;
|
||||
}
|
||||
|
Reference in New Issue
Block a user