src/energyplus/ReverseTranslator/ReverseTranslateConvergenceLimits.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/ConvergenceLimits.hpp" | ||
| 9 | #include "../../model/ConvergenceLimits_Impl.hpp" | ||
| 10 | |||
| 11 | #include <utilities/idd/ConvergenceLimits_FieldEnums.hxx> | ||
| 12 | #include <utilities/idd/IddEnums.hxx> | ||
| 13 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 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 | 3 | boost::optional<model::ModelObject> ReverseTranslator::translateConvergenceLimits(const WorkspaceObject& workspaceObject) { | |
| 24 |
4/6✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 3 times.
✗ Branch 13 not taken.
|
3 | OS_ASSERT(workspaceObject.iddObject().type() == IddObjectType::ConvergenceLimits); |
| 25 | |||
| 26 | 3 | OptionalInt i; | |
| 27 | |||
| 28 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto convergenceLimits = m_model.getUniqueModelObject<ConvergenceLimits>(); |
| 29 | |||
| 30 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
6 | if ((i = workspaceObject.getInt(ConvergenceLimitsFields::MinimumSystemTimestep))) { |
| 31 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | convergenceLimits.setMinimumSystemTimestep(*i); |
| 32 | } | ||
| 33 | |||
| 34 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
6 | if ((i = workspaceObject.getInt(ConvergenceLimitsFields::MaximumHVACIterations))) { |
| 35 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | convergenceLimits.setMaximumHVACIterations(*i); |
| 36 | } | ||
| 37 | |||
| 38 |
2/3✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
|
6 | if ((i = workspaceObject.getInt(ConvergenceLimitsFields::MinimumPlantIterations))) { |
| 39 | ✗ | convergenceLimits.setMinimumPlantIterations(*i); | |
| 40 | } | ||
| 41 | |||
| 42 |
2/3✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
|
6 | if ((i = workspaceObject.getInt(ConvergenceLimitsFields::MaximumPlantIterations))) { |
| 43 | ✗ | convergenceLimits.setMaximumPlantIterations(*i); | |
| 44 | } | ||
| 45 | |||
| 46 |
1/1✓ Branch 1 taken 3 times.
|
6 | return convergenceLimits; |
| 47 | 3 | } | |
| 48 | |||
| 49 | } // namespace energyplus | ||
| 50 | } // namespace openstudio | ||
| 51 |