src/energyplus/ReverseTranslator/ReverseTranslateMaterialAirGap.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/AirGap.hpp" | ||
| 9 | #include "../../model/AirGap_Impl.hpp" | ||
| 10 | |||
| 11 | #include <utilities/idd/Material_AirGap_FieldEnums.hxx> | ||
| 12 | #include <utilities/idd/OS_Material_AirGap_FieldEnums.hxx> | ||
| 13 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 14 | #include <utilities/idd/IddEnums.hxx> | ||
| 15 | |||
| 16 | using namespace openstudio::model; | ||
| 17 | |||
| 18 | namespace openstudio { | ||
| 19 | |||
| 20 | namespace energyplus { | ||
| 21 | |||
| 22 | 31 | OptionalModelObject ReverseTranslator::translateMaterialAirGap(const WorkspaceObject& workspaceObject) { | |
| 23 |
4/5✓ Branch 1 taken 31 times.
✓ Branch 4 taken 31 times.
✓ Branch 7 taken 31 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 31 times.
|
31 | if (workspaceObject.iddObject().type() != IddObjectType::Material_AirGap) { |
| 24 | ✗ | LOG(Error, "WorkspaceObject is not IddObjectType: Material_AirGap"); | |
| 25 | ✗ | return boost::none; | |
| 26 | } | ||
| 27 | |||
| 28 |
1/1✓ Branch 1 taken 31 times.
|
31 | openstudio::model::AirGap airGap(m_model); |
| 29 |
1/1✓ Branch 1 taken 31 times.
|
31 | OptionalString s = workspaceObject.name(); |
| 30 |
1/2✓ Branch 0 taken 31 times.
✗ Branch 1 not taken.
|
31 | if (s) { |
| 31 |
2/2✓ Branch 1 taken 31 times.
✓ Branch 4 taken 31 times.
|
31 | airGap.setName(*s); |
| 32 | } | ||
| 33 | |||
| 34 |
1/1✓ Branch 1 taken 31 times.
|
31 | OptionalDouble d = workspaceObject.getDouble(Material_AirGapFields::ThermalResistance); |
| 35 |
1/2✓ Branch 0 taken 31 times.
✗ Branch 1 not taken.
|
31 | if (d) { |
| 36 |
2/2✓ Branch 1 taken 31 times.
✓ Branch 4 taken 31 times.
|
31 | airGap.setDouble(OS_Material_AirGapFields::ThermalResistance, *d); |
| 37 | } | ||
| 38 | |||
| 39 |
1/1✓ Branch 1 taken 31 times.
|
31 | return airGap; |
| 40 | 31 | } | |
| 41 | |||
| 42 | } // namespace energyplus | ||
| 43 | |||
| 44 | } // namespace openstudio | ||
| 45 |