src/energyplus/ReverseTranslator/ReverseTranslateComfortViewFactorAngles.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/ComfortViewFactorAngles.hpp" | ||
| 9 | #include "../../model/ComfortViewFactorAngles_Impl.hpp" | ||
| 10 | #include "../../model/Surface.hpp" | ||
| 11 | #include "../../model/Surface_Impl.hpp" | ||
| 12 | |||
| 13 | #include "../../utilities/idf/WorkspaceExtensibleGroup.hpp" | ||
| 14 | |||
| 15 | #include <utilities/idd/ComfortViewFactorAngles_FieldEnums.hxx> | ||
| 16 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 17 | #include <utilities/idd/IddEnums.hxx> | ||
| 18 | |||
| 19 | #include "../../utilities/core/Assert.hpp" | ||
| 20 | |||
| 21 | using namespace openstudio::model; | ||
| 22 | |||
| 23 | namespace openstudio { | ||
| 24 | namespace energyplus { | ||
| 25 | |||
| 26 | 2 | OptionalModelObject ReverseTranslator::translateComfortViewFactorAngles(const WorkspaceObject& workspaceObject) { | |
| 27 |
4/5✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 2 times.
|
2 | if (workspaceObject.iddObject().type() != IddObjectType::ComfortViewFactorAngles) { |
| 28 | ✗ | LOG(Error, "WorkspaceObject is not IddObjectType: ComfortViewFactorAngles"); | |
| 29 | ✗ | return boost::none; | |
| 30 | } | ||
| 31 | |||
| 32 |
1/1✓ Branch 1 taken 2 times.
|
2 | ComfortViewFactorAngles comfortViewFactorAngles(m_model); |
| 33 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if (auto name = workspaceObject.name()) { |
| 34 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | comfortViewFactorAngles.setName(*name); |
| 35 | 2 | } | |
| 36 | |||
| 37 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 8 taken 1 time.
✓ Branch 9 taken 2 times.
|
3 | for (const auto& idfGroup : workspaceObject.extensibleGroups()) { |
| 38 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto group = idfGroup.cast<WorkspaceExtensibleGroup>(); |
| 39 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto surfaceTarget = group.getTarget(ComfortViewFactorAnglesExtensibleFields::SurfaceName); |
| 40 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto angleFactor = group.getDouble(ComfortViewFactorAnglesExtensibleFields::AngleFactor); |
| 41 |
3/6✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 time.
|
1 | if (!surfaceTarget || !angleFactor) { |
| 42 | ✗ | continue; | |
| 43 | } | ||
| 44 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (auto modelObject = translateAndMapWorkspaceObject(*surfaceTarget)) { |
| 45 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | comfortViewFactorAngles.addAngleFactor(*modelObject, *angleFactor); |
| 46 | 1 | } | |
| 47 | 3 | } | |
| 48 | |||
| 49 |
1/1✓ Branch 1 taken 2 times.
|
2 | return comfortViewFactorAngles; |
| 50 | 2 | } | |
| 51 | |||
| 52 | } // namespace energyplus | ||
| 53 | } // namespace openstudio | ||
| 54 |