src/modelica/main.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include <fmt/core.h> | ||
| 2 | #include <iostream> | ||
| 3 | #include <antlr4-runtime.h> | ||
| 4 | #include "../utilities/core/ApplicationPathHelpers.hpp" | ||
| 5 | #include "ModelicaFile.hpp" | ||
| 6 | |||
| 7 | ✗ | int main() { | |
| 8 | ✗ | const auto moPath = openstudio::getApplicationSourceDirectory() / "resources/Examples/compact_osw/modelica/OpenStudioExample/SeedBuilding.mo"; | |
| 9 | |||
| 10 | ✗ | openstudio::modelica::ModelicaFile moFile(moPath); | |
| 11 | |||
| 12 | ✗ | auto classDefinitions = moFile.getClassDefinitions(); | |
| 13 | |||
| 14 | ✗ | for (const auto& classDef : classDefinitions) { | |
| 15 | ✗ | std::cout << "Found class name: " << classDef.longClassSpecifier() << std::endl; // NOLINT | |
| 16 | } | ||
| 17 | |||
| 18 | ✗ | const auto& class1 = classDefinitions.front(); | |
| 19 | ✗ | class1.addComponentClause("Buildings.ThermalZones.EnergyPlus_24_2_0.ThermalZone zon2(redeclare package Medium = Medium, zoneName = \"MyZone2\");"); | |
| 20 | |||
| 21 | ✗ | std::cout << moFile.getText() << std::endl; // NOLINT | |
| 22 | |||
| 23 | ✗ | return 0; | |
| 24 | ✗ | } | |
| 25 |