Merge pull request #689 from nasa/unitless-no-convert

#687 do not warn or convert unit --
This commit is contained in:
Scott Fennell 2018-10-30 10:59:40 -05:00 committed by GitHub
commit b23fda4e2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,7 +124,8 @@ int Trick::VariableServerThread::var_units(std::string var_name, std::string uni
oss << "Variable Server: " << message << std::endl;
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) ;
if ( units_name.compare(new_units) ) {
std::ostringstream oss;
@ -170,6 +171,7 @@ int Trick::VariableServerThread::var_units(std::string var_name, std::string uni
free(variable->ref->units);
variable->ref->units = strdup(new_units.c_str());
}
}
return(0) ;
}