#687 do not warn or convert unit --

This commit is contained in:
Scott Fennell 2018-10-30 10:40:46 -05:00
parent 2a059719ba
commit d2e81257c2

View File

@ -124,7 +124,8 @@ int Trick::VariableServerThread::var_units(std::string var_name, std::string uni
oss << "Variable Server: " << message << std::endl; oss << "Variable Server: " << message << std::endl;
message_publish(type, oss.str().c_str()); message_publish(type, oss.str().c_str());
}; };
/* if unitless ('--') then do not convert to udunits*/
if(units_name.compare("--")){
std::string new_units = map_trick_units_to_udunits(units_name) ; std::string new_units = map_trick_units_to_udunits(units_name) ;
if ( units_name.compare(new_units) ) { if ( units_name.compare(new_units) ) {
std::ostringstream oss; std::ostringstream oss;
@ -170,6 +171,7 @@ int Trick::VariableServerThread::var_units(std::string var_name, std::string uni
free(variable->ref->units); free(variable->ref->units);
variable->ref->units = strdup(new_units.c_str()); variable->ref->units = strdup(new_units.c_str());
} }
}
return(0) ; return(0) ;
} }