-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add records as json strings functions to list available methods, properties when the reaction equation is given the reactants are added to the record.
- Loading branch information
Showing
25 changed files
with
60,711 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#include "GlobalVariables.h" | ||
#include "Batch/ThermoBatch.h" | ||
|
||
namespace ThermoFun { | ||
|
||
auto availableSubstanceTPMethods() -> const std::string | ||
{ | ||
std::string r; | ||
for (auto a : enum_method_substance) | ||
{ | ||
r += "{\"method\": {\"" + to_string(a.first) + "\": \"" + a.second + "\"}"; | ||
auto type = (SubstanceTPMethodType) a.first; | ||
if (substance_method_parameters.at(type).size() == 1 && substance_method_parameters.at(type)[0] !="") | ||
{ | ||
r += ", \"" + substance_method_parameters.at(type)[0] +"\" : { \"values\": []}}\n"; | ||
} else | ||
r += "}\n"; | ||
} | ||
return r; | ||
} | ||
|
||
auto scanProperties(const std::string& what) -> const std::string | ||
{ | ||
std::string r = "property (unit)\n---------------\n"; | ||
for (auto a: defaultPropertyNames) | ||
{ | ||
if (a.second == what) | ||
{ | ||
r += a.first + " ("; | ||
r += defaultPropertyUnits.at(a.first)+ ")\n"; | ||
} | ||
} | ||
return r; | ||
} | ||
|
||
auto availablePropertiesSubstance() -> const std::string | ||
{ | ||
return scanProperties("substance"); | ||
} | ||
|
||
auto availablePropertiesReaction() -> const std::string | ||
{ | ||
return scanProperties("reaction"); | ||
} | ||
|
||
auto availableReactionTPMethods() -> const std::string | ||
{ | ||
std::string r; | ||
for (auto a : enum_method_reaction) | ||
{ | ||
r += "{\"method\": {\"" + to_string(a.first) + "\": \"" + a.second + "\"}"; | ||
auto type = (ReactionTPMethodType) a.first; | ||
if (reaction_method_parameters.at(type).size() == 1 && reaction_method_parameters.at(type)[0] !="") | ||
{ | ||
r += ", \"" + reaction_method_parameters.at(type)[0] +"\" : { \"values\": []}}\n"; | ||
} else | ||
r += "}\n"; | ||
} | ||
return r; | ||
} | ||
} // namespace ThermoFun |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.