src/energyplus/ReverseTranslator/ReverseTranslateHeatBalanceAlgorithm.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #include "../ReverseTranslator.hpp" | ||
| 7 | |||
| 8 | #include "../../model/HeatBalanceAlgorithm.hpp" | ||
| 9 | #include "../../model/HeatBalanceAlgorithm_Impl.hpp" | ||
| 10 | |||
| 11 | #include <utilities/idd/HeatBalanceAlgorithm_FieldEnums.hxx> | ||
| 12 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 13 | #include <utilities/idd/IddEnums.hxx> | ||
| 14 | |||
| 15 | #include "../../utilities/core/Assert.hpp" | ||
| 16 | #include "../../utilities/core/Optional.hpp" | ||
| 17 | |||
| 18 | using namespace openstudio::model; | ||
| 19 | |||
| 20 | namespace openstudio { | ||
| 21 | namespace energyplus { | ||
| 22 | |||
| 23 | 5 | boost::optional<model::ModelObject> ReverseTranslator::translateHeatBalanceAlgorithm(const WorkspaceObject& workspaceObject) { | |
| 24 |
4/6✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 5 times.
✗ Branch 13 not taken.
|
5 | OS_ASSERT(workspaceObject.iddObject().type() == IddObjectType::HeatBalanceAlgorithm); |
| 25 | |||
| 26 |
1/1✓ Branch 1 taken 5 times.
|
5 | auto heatBalanceAlgorithm = m_model.getUniqueModelObject<HeatBalanceAlgorithm>(); |
| 27 | |||
| 28 |
1/1✓ Branch 1 taken 5 times.
|
5 | OptionalString s = workspaceObject.getString(HeatBalanceAlgorithmFields::Algorithm, false, true); |
| 29 |
1/2✓ Branch 0 taken 5 times.
✗ Branch 1 not taken.
|
5 | if (s) { |
| 30 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | heatBalanceAlgorithm.setAlgorithm(*s); |
| 31 | } | ||
| 32 | |||
| 33 |
1/1✓ Branch 1 taken 5 times.
|
5 | OptionalDouble d = workspaceObject.getDouble(HeatBalanceAlgorithmFields::SurfaceTemperatureUpperLimit); |
| 34 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 2 times.
|
5 | if (d) { |
| 35 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | heatBalanceAlgorithm.setSurfaceTemperatureUpperLimit(*d); |
| 36 | } | ||
| 37 | |||
| 38 |
1/1✓ Branch 1 taken 5 times.
|
5 | d = workspaceObject.getDouble(HeatBalanceAlgorithmFields::MinimumSurfaceConvectionHeatTransferCoefficientValue); |
| 39 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
|
5 | if (d) { |
| 40 | ✗ | heatBalanceAlgorithm.setMinimumSurfaceConvectionHeatTransferCoefficientValue(*d); | |
| 41 | } | ||
| 42 | |||
| 43 |
1/1✓ Branch 1 taken 5 times.
|
5 | d = workspaceObject.getDouble(HeatBalanceAlgorithmFields::MaximumSurfaceConvectionHeatTransferCoefficientValue); |
| 44 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
|
5 | if (d) { |
| 45 | ✗ | heatBalanceAlgorithm.setMaximumSurfaceConvectionHeatTransferCoefficientValue(*d); | |
| 46 | } | ||
| 47 | |||
| 48 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
10 | return heatBalanceAlgorithm.cast<ModelObject>(); |
| 49 | 5 | } | |
| 50 | |||
| 51 | } // namespace energyplus | ||
| 52 | } // namespace openstudio | ||
| 53 |