src/model/Duct.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 "Duct.hpp" | ||
| 7 | #include "Duct_Impl.hpp" | ||
| 8 | #include "Node.hpp" | ||
| 9 | #include "Node_Impl.hpp" | ||
| 10 | #include "AirLoopHVACOutdoorAirSystem.hpp" | ||
| 11 | #include "AirLoopHVACOutdoorAirSystem_Impl.hpp" | ||
| 12 | |||
| 13 | #include "../utilities/core/Assert.hpp" | ||
| 14 | #include "../utilities/data/DataEnums.hpp" | ||
| 15 | |||
| 16 | #include <utilities/idd/IddEnums.hxx> | ||
| 17 | #include <utilities/idd/OS_Duct_FieldEnums.hxx> | ||
| 18 | |||
| 19 | namespace openstudio { | ||
| 20 | namespace model { | ||
| 21 | |||
| 22 | namespace detail { | ||
| 23 | |||
| 24 | 1 | Duct_Impl::Duct_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) : StraightComponent_Impl(idfObject, model, keepHandle) { | |
| 25 |
4/6✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 10 not taken.
✓ Branch 11 taken 1 time.
✗ Branch 13 not taken.
|
1 | OS_ASSERT(idfObject.iddObject().type() == Duct::iddObjectType()); |
| 26 | 1 | } | |
| 27 | |||
| 28 | ✗ | Duct_Impl::Duct_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 29 | ✗ | : StraightComponent_Impl(other, model, keepHandle) { | |
| 30 | ✗ | OS_ASSERT(other.iddObject().type() == Duct::iddObjectType()); | |
| 31 | ✗ | } | |
| 32 | |||
| 33 | ✗ | Duct_Impl::Duct_Impl(const Duct_Impl& other, Model_Impl* model, bool keepHandle) : StraightComponent_Impl(other, model, keepHandle) {} | |
| 34 | |||
| 35 | ✗ | const std::vector<std::string>& Duct_Impl::outputVariableNames() const { | |
| 36 | ✗ | static const std::vector<std::string> result; | |
| 37 | // Not appropriate: no specific output variables | ||
| 38 | ✗ | return result; | |
| 39 | } | ||
| 40 | |||
| 41 | ✗ | IddObjectType Duct_Impl::iddObjectType() const { | |
| 42 | ✗ | return Duct::iddObjectType(); | |
| 43 | } | ||
| 44 | |||
| 45 | ✗ | unsigned Duct_Impl::inletPort() const { | |
| 46 | ✗ | return OS_DuctFields::InletNode; | |
| 47 | } | ||
| 48 | |||
| 49 | ✗ | unsigned Duct_Impl::outletPort() const { | |
| 50 | ✗ | return OS_DuctFields::OutletNode; | |
| 51 | } | ||
| 52 | |||
| 53 | ✗ | bool Duct_Impl::addToNode(Node& node) { | |
| 54 | ✗ | if (node.airLoopHVAC()) { | |
| 55 | ✗ | return StraightComponent_Impl::addToNode(node); | |
| 56 | } | ||
| 57 | |||
| 58 | ✗ | if (node.airLoopHVACOutdoorAirSystem()) { | |
| 59 | ✗ | return StraightComponent_Impl::addToNode(node); | |
| 60 | } | ||
| 61 | |||
| 62 | ✗ | return false; | |
| 63 | } | ||
| 64 | |||
| 65 | ✗ | ComponentType Duct_Impl::componentType() const { | |
| 66 | ✗ | return ComponentType::None; | |
| 67 | } | ||
| 68 | |||
| 69 | ✗ | std::vector<FuelType> Duct_Impl::coolingFuelTypes() const { | |
| 70 | ✗ | return {}; | |
| 71 | } | ||
| 72 | |||
| 73 | ✗ | std::vector<FuelType> Duct_Impl::heatingFuelTypes() const { | |
| 74 | ✗ | return {}; | |
| 75 | } | ||
| 76 | |||
| 77 | ✗ | std::vector<AppGFuelType> Duct_Impl::appGHeatingFuelTypes() const { | |
| 78 | ✗ | return {}; | |
| 79 | } | ||
| 80 | } // namespace detail | ||
| 81 | |||
| 82 | 1 | Duct::Duct(const Model& model) : StraightComponent(Duct::iddObjectType(), model) { | |
| 83 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 5 not taken.
|
1 | OS_ASSERT(getImpl<detail::Duct_Impl>()); |
| 84 | |||
| 85 | 1 | bool ok = true; | |
| 86 | // ok = setHandle(); | ||
| 87 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
|
1 | OS_ASSERT(ok); |
| 88 | 1 | } | |
| 89 | |||
| 90 | 7600 | IddObjectType Duct::iddObjectType() { | |
| 91 |
1/1✓ Branch 1 taken 7600 times.
|
7600 | return {IddObjectType::OS_Duct}; |
| 92 | } | ||
| 93 | |||
| 94 | /// @cond | ||
| 95 | ✗ | Duct::Duct(std::shared_ptr<detail::Duct_Impl> impl) : StraightComponent(std::move(impl)) {} | |
| 96 | /// @endcond | ||
| 97 | |||
| 98 | } // namespace model | ||
| 99 | } // namespace openstudio | ||
| 100 |