src/model/ExteriorWaterEquipmentDefinition.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 "ExteriorWaterEquipmentDefinition.hpp" | ||
| 7 | #include "ExteriorWaterEquipmentDefinition_Impl.hpp" | ||
| 8 | |||
| 9 | #include <utilities/idd/OS_Exterior_WaterEquipment_Definition_FieldEnums.hxx> | ||
| 10 | #include <utilities/idd/IddEnums.hxx> | ||
| 11 | |||
| 12 | #include "../utilities/core/Assert.hpp" | ||
| 13 | |||
| 14 | namespace openstudio { | ||
| 15 | namespace model { | ||
| 16 | |||
| 17 | namespace detail { | ||
| 18 | |||
| 19 | 10 | ExteriorWaterEquipmentDefinition_Impl::ExteriorWaterEquipmentDefinition_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 20 | 10 | : ExteriorLoadDefinition_Impl(idfObject, model, keepHandle) { | |
| 21 |
4/6✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 10 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 10 times.
✗ Branch 13 not taken.
|
10 | OS_ASSERT(idfObject.iddObject().type() == ExteriorWaterEquipmentDefinition::iddObjectType()); |
| 22 | 10 | } | |
| 23 | |||
| 24 | ✗ | ExteriorWaterEquipmentDefinition_Impl::ExteriorWaterEquipmentDefinition_Impl(const openstudio::detail::WorkspaceObject_Impl& other, | |
| 25 | ✗ | Model_Impl* model, bool keepHandle) | |
| 26 | ✗ | : ExteriorLoadDefinition_Impl(other, model, keepHandle) { | |
| 27 | ✗ | OS_ASSERT(other.iddObject().type() == ExteriorWaterEquipmentDefinition::iddObjectType()); | |
| 28 | ✗ | } | |
| 29 | |||
| 30 | 5 | ExteriorWaterEquipmentDefinition_Impl::ExteriorWaterEquipmentDefinition_Impl(const ExteriorWaterEquipmentDefinition_Impl& other, | |
| 31 | 5 | Model_Impl* model, bool keepHandle) | |
| 32 | 5 | : ExteriorLoadDefinition_Impl(other, model, keepHandle) {} | |
| 33 | |||
| 34 | // TODO: remove | ||
| 35 | ✗ | const std::vector<std::string>& ExteriorWaterEquipmentDefinition_Impl::outputVariableNames() const { | |
| 36 | ✗ | static const std::vector<std::string> result; | |
| 37 | ✗ | return result; | |
| 38 | } | ||
| 39 | |||
| 40 | ✗ | IddObjectType ExteriorWaterEquipmentDefinition_Impl::iddObjectType() const { | |
| 41 | ✗ | return ExteriorWaterEquipmentDefinition::iddObjectType(); | |
| 42 | } | ||
| 43 | |||
| 44 | 4 | double ExteriorWaterEquipmentDefinition_Impl::designLevel() const { | |
| 45 |
1/1✓ Branch 1 taken 4 times.
|
4 | boost::optional<double> value = getDouble(OS_Exterior_WaterEquipment_DefinitionFields::DesignLevel, true); |
| 46 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
|
4 | OS_ASSERT(value); |
| 47 |
1/1✓ Branch 1 taken 4 times.
|
8 | return value.get(); |
| 48 | } | ||
| 49 | |||
| 50 | 13 | bool ExteriorWaterEquipmentDefinition_Impl::setDesignLevel(double designLevel) { | |
| 51 | 13 | bool result = setDouble(OS_Exterior_WaterEquipment_DefinitionFields::DesignLevel, designLevel); | |
| 52 | 13 | return result; | |
| 53 | } | ||
| 54 | |||
| 55 | } // namespace detail | ||
| 56 | |||
| 57 | 10 | ExteriorWaterEquipmentDefinition::ExteriorWaterEquipmentDefinition(const Model& model) | |
| 58 | 10 | : ExteriorLoadDefinition(ExteriorWaterEquipmentDefinition::iddObjectType(), model) { | |
| 59 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 10 times.
✗ Branch 5 not taken.
|
10 | OS_ASSERT(getImpl<detail::ExteriorWaterEquipmentDefinition_Impl>()); |
| 60 | |||
| 61 |
1/1✓ Branch 1 taken 10 times.
|
10 | bool ok = setDesignLevel(0.0); |
| 62 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
|
10 | OS_ASSERT(ok); |
| 63 | 10 | } | |
| 64 | |||
| 65 | 7757 | IddObjectType ExteriorWaterEquipmentDefinition::iddObjectType() { | |
| 66 |
1/1✓ Branch 1 taken 7757 times.
|
7757 | IddObjectType result(IddObjectType::OS_Exterior_WaterEquipment_Definition); |
| 67 | 7757 | return result; | |
| 68 | } | ||
| 69 | |||
| 70 | 4 | double ExteriorWaterEquipmentDefinition::designLevel() const { | |
| 71 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::ExteriorWaterEquipmentDefinition_Impl>()->designLevel(); |
| 72 | } | ||
| 73 | |||
| 74 | 13 | bool ExteriorWaterEquipmentDefinition::setDesignLevel(double designLevel) { | |
| 75 |
1/1✓ Branch 3 taken 13 times.
|
13 | return getImpl<detail::ExteriorWaterEquipmentDefinition_Impl>()->setDesignLevel(designLevel); |
| 76 | } | ||
| 77 | |||
| 78 | /// @cond | ||
| 79 | 10 | ExteriorWaterEquipmentDefinition::ExteriorWaterEquipmentDefinition(std::shared_ptr<detail::ExteriorWaterEquipmentDefinition_Impl> impl) | |
| 80 |
1/1✓ Branch 3 taken 10 times.
|
10 | : ExteriorLoadDefinition(std::move(impl)) {} |
| 81 | /// @endcond | ||
| 82 | |||
| 83 | } // namespace model | ||
| 84 | } // namespace openstudio | ||
| 85 |