GMLC-TDC / HELICS

Hierarchical Engine for Large-scale Infrastructure Co-Simulation (HELICS)
https://docs.helics.org/en/latest/
BSD 3-Clause "New" or "Revised" License
127 stars 41 forks source link

ValueFederate::registeValueInterfacesJson() get publication units #1462

Closed xcosmos6 closed 4 years ago

xcosmos6 commented 4 years ago

Hi, I am using the helics cpp98 and calling the helicscpp::ValueFederate(const std::string& configString) constructor to get an instance of the valueFedeate object. In my json config file, I have publications JSON array and I have "unit" for each of the pub elements. However, after the config file is parsed, all the units are empty string. After I step through the code, I found that function ValueFederate::registeValueInterfacesJson() is called, which is in the application_api: auto units = getOrDefault(sub, "units", emptyStr); Here "units" is used instead of "unit". I am not sure if this is a bug or intentional, but after I change the key in my config file to "units", the correct units show up instead of empty string. Thank you very much.

phlptp commented 4 years ago

json now supports both "units" and "unit" as a specify for including units