src/energyplus/ForwardTranslator/ForwardTranslateSurfaceControlMovableInsulation.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 "../ForwardTranslator.hpp" | ||
| 7 | |||
| 8 | #include "../../model/Model.hpp" | ||
| 9 | #include "../../model/SurfaceControlMovableInsulation.hpp" | ||
| 10 | #include "../../model/SurfaceControlMovableInsulation_Impl.hpp" | ||
| 11 | #include "../../model/Material.hpp" | ||
| 12 | #include "../../model/Schedule.hpp" | ||
| 13 | #include "../../model/Surface.hpp" | ||
| 14 | |||
| 15 | #include <utilities/idd/SurfaceControl_MovableInsulation_FieldEnums.hxx> | ||
| 16 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 17 | #include <utilities/idd/IddEnums.hxx> | ||
| 18 | |||
| 19 | using namespace openstudio::model; | ||
| 20 | |||
| 21 | using namespace std; | ||
| 22 | |||
| 23 | namespace openstudio { | ||
| 24 | |||
| 25 | namespace energyplus { | ||
| 26 | |||
| 27 | 1 | boost::optional<IdfObject> ForwardTranslator::translateSurfaceControlMovableInsulation(SurfaceControlMovableInsulation& modelObject) { | |
| 28 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | IdfObject idfObject(openstudio::IddObjectType::SurfaceControl_MovableInsulation); |
| 29 | |||
| 30 |
1/1✓ Branch 1 taken 1 time.
|
1 | m_idfObjects.push_back(idfObject); |
| 31 | |||
| 32 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::string insulationType = modelObject.insulationType(); |
| 33 | |||
| 34 |
1/1✓ Branch 1 taken 1 time.
|
1 | idfObject.setString(SurfaceControl_MovableInsulationFields::InsulationType, insulationType); |
| 35 | |||
| 36 |
1/1✓ Branch 1 taken 1 time.
|
1 | Surface surface = modelObject.surface(); |
| 37 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if (boost::optional<IdfObject> surf = translateAndMapModelObject(surface)) { |
| 38 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(SurfaceControl_MovableInsulationFields::SurfaceName, surf->name().get()); |
| 39 | 1 | } | |
| 40 | |||
| 41 |
1/1✓ Branch 1 taken 1 time.
|
1 | Material material = modelObject.material(); |
| 42 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if (boost::optional<IdfObject> mat = translateAndMapModelObject(material)) { |
| 43 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(SurfaceControl_MovableInsulationFields::MaterialName, mat->name().get()); |
| 44 | 1 | } | |
| 45 | |||
| 46 |
1/1✓ Branch 1 taken 1 time.
|
1 | Schedule schedule = modelObject.schedule(); |
| 47 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if (boost::optional<IdfObject> sch = translateAndMapModelObject(schedule)) { |
| 48 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(SurfaceControl_MovableInsulationFields::ScheduleName, sch->name().get()); |
| 49 | 1 | } | |
| 50 | |||
| 51 |
1/1✓ Branch 1 taken 1 time.
|
2 | return boost::optional<IdfObject>(idfObject); |
| 52 | 1 | } | |
| 53 | |||
| 54 | } // namespace energyplus | ||
| 55 | |||
| 56 | } // namespace openstudio | ||
| 57 |