Skip to content

Commit

Permalink
Merge pull request #117 from rest-for-physics/no_units_fix
Browse files Browse the repository at this point in the history
TRestMetadata. if datamember does not support units, the value is ret…
  • Loading branch information
jgalan authored Jan 13, 2022
2 parents ff90bb6 + 418c52f commit a225aeb
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions source/framework/core/src/TRestMetadata.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ using namespace REST_Physics;
map<string, string> TRestMetadata_UpdatedConfigFile;

ClassImp(TRestMetadata);
///////////////////////////////////////////////
///////////////////////////////////////////////
/// \brief TRestMetadata default constructor
///
TRestMetadata::TRestMetadata() : endl(this) {
Expand Down Expand Up @@ -1121,8 +1121,9 @@ void TRestMetadata::ExpandIncludeFile(TiXmlElement* e) {
if ((string)e->Value() == "include") {
localele = (TiXmlElement*)e->Parent();
if (localele == nullptr) return;
if (localele->Attribute("expanded") == nullptr ? false : ((string)localele->Attribute("expanded") ==
"true")) {
if (localele->Attribute("expanded") == nullptr
? false
: ((string)localele->Attribute("expanded") == "true")) {
debug << "----already expanded----" << endl;
return;
}
Expand Down Expand Up @@ -1157,8 +1158,9 @@ void TRestMetadata::ExpandIncludeFile(TiXmlElement* e) {
// overwrites "type"
else {
localele = e;
if (localele->Attribute("expanded") == nullptr ? false : ((string)localele->Attribute("expanded") ==
"true")) {
if (localele->Attribute("expanded") == nullptr
? false
: ((string)localele->Attribute("expanded") == "true")) {
debug << "----already expanded----" << endl;
return;
}
Expand Down Expand Up @@ -2361,7 +2363,7 @@ void TRestMetadata::ReadOneParameter(string name, string value) {
<< this->ClassName() << " find unit definition in parameter: " << name
<< ", but the corresponding data member doesn't support it. Data member type: "
<< datamember.type << endl;
datamember.ParseString(val);
datamember.ParseString(value);
}
} else {
datamember.ParseString(value);
Expand Down Expand Up @@ -2456,8 +2458,7 @@ void TRestMetadata::SetWarning(string message, bool print) {
if (message != "") {
fWarningMessage += message + "\n";
if (print) {
if (fVerboseLevel>=REST_Warning)
cout << message << endl;
if (fVerboseLevel >= REST_Warning) cout << message << endl;
}
}
}
Expand All @@ -2474,4 +2475,4 @@ TString TRestMetadata::GetWarningMessage() {
return fWarningMessage;
else
return "No warning!";
}
}

0 comments on commit a225aeb

Please sign in to comment.