src/model/PipeAdiabatic.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 "PipeAdiabatic.hpp" | ||
| 7 | #include "PipeAdiabatic_Impl.hpp" | ||
| 8 | #include "Node.hpp" | ||
| 9 | #include "Node_Impl.hpp" | ||
| 10 | #include "AirLoopHVAC.hpp" | ||
| 11 | #include "AirLoopHVAC_Impl.hpp" | ||
| 12 | #include "Model.hpp" | ||
| 13 | |||
| 14 | #include "../utilities/core/Assert.hpp" | ||
| 15 | #include "../utilities/core/Compare.hpp" | ||
| 16 | #include "../utilities/data/DataEnums.hpp" | ||
| 17 | |||
| 18 | #include <utilities/idd/OS_Pipe_Adiabatic_FieldEnums.hxx> | ||
| 19 | #include <utilities/idd/IddEnums.hxx> | ||
| 20 | |||
| 21 | namespace openstudio { | ||
| 22 | |||
| 23 | namespace model { | ||
| 24 | |||
| 25 | namespace detail { | ||
| 26 | |||
| 27 | 42 | PipeAdiabatic_Impl::PipeAdiabatic_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 28 | 42 | : StraightComponent_Impl(idfObject, model, keepHandle) { | |
| 29 |
4/6✓ Branch 1 taken 42 times.
✓ Branch 4 taken 42 times.
✓ Branch 7 taken 42 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 42 times.
✗ Branch 13 not taken.
|
42 | OS_ASSERT(idfObject.iddObject().type() == PipeAdiabatic::iddObjectType()); |
| 30 | 42 | } | |
| 31 | |||
| 32 | 4 | PipeAdiabatic_Impl::PipeAdiabatic_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 33 | 4 | : StraightComponent_Impl(other, model, keepHandle) { | |
| 34 |
4/6✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 4 times.
✗ Branch 13 not taken.
|
4 | OS_ASSERT(other.iddObject().type() == PipeAdiabatic::iddObjectType()); |
| 35 | 4 | } | |
| 36 | |||
| 37 | 12 | PipeAdiabatic_Impl::PipeAdiabatic_Impl(const PipeAdiabatic_Impl& other, Model_Impl* model, bool keepHandle) | |
| 38 | 12 | : StraightComponent_Impl(other, model, keepHandle) {} | |
| 39 | |||
| 40 | ✗ | const std::vector<std::string>& PipeAdiabatic_Impl::outputVariableNames() const { | |
| 41 | ✗ | static const std::vector<std::string> result; | |
| 42 | // Not appropriate: no specific output | ||
| 43 | ✗ | return result; | |
| 44 | } | ||
| 45 | |||
| 46 | 6 | IddObjectType PipeAdiabatic_Impl::iddObjectType() const { | |
| 47 | 6 | return PipeAdiabatic::iddObjectType(); | |
| 48 | } | ||
| 49 | |||
| 50 | 79 | unsigned PipeAdiabatic_Impl::inletPort() const { | |
| 51 | 79 | return OS_Pipe_AdiabaticFields::InletNodeName; | |
| 52 | } | ||
| 53 | |||
| 54 | 1497 | unsigned PipeAdiabatic_Impl::outletPort() const { | |
| 55 | 1497 | return OS_Pipe_AdiabaticFields::OutletNodeName; | |
| 56 | } | ||
| 57 | |||
| 58 | 42 | bool PipeAdiabatic_Impl::addToNode(Node& node) { | |
| 59 |
3/3✓ Branch 1 taken 42 times.
✓ Branch 3 taken 40 times.
✓ Branch 4 taken 2 times.
|
84 | if (boost::optional<PlantLoop> plant = node.plantLoop()) { |
| 60 |
1/1✓ Branch 1 taken 40 times.
|
40 | return StraightComponent_Impl::addToNode(node); |
| 61 | 42 | } | |
| 62 | |||
| 63 | 2 | return false; | |
| 64 | } | ||
| 65 | |||
| 66 | 24 | ComponentType PipeAdiabatic_Impl::componentType() const { | |
| 67 |
1/1✓ Branch 1 taken 24 times.
|
24 | return ComponentType::None; |
| 68 | } | ||
| 69 | |||
| 70 | ✗ | std::vector<FuelType> PipeAdiabatic_Impl::coolingFuelTypes() const { | |
| 71 | ✗ | return {}; | |
| 72 | } | ||
| 73 | |||
| 74 | ✗ | std::vector<FuelType> PipeAdiabatic_Impl::heatingFuelTypes() const { | |
| 75 | ✗ | return {}; | |
| 76 | } | ||
| 77 | |||
| 78 | ✗ | std::vector<AppGFuelType> PipeAdiabatic_Impl::appGHeatingFuelTypes() const { | |
| 79 | ✗ | return {}; | |
| 80 | } | ||
| 81 | |||
| 82 | } // namespace detail | ||
| 83 | |||
| 84 | // create a new PipeAdiabatic object in the model's workspace | ||
| 85 | 38 | PipeAdiabatic::PipeAdiabatic(const Model& model) : StraightComponent(PipeAdiabatic::iddObjectType(), model) { | |
| 86 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 38 times.
✗ Branch 5 not taken.
|
38 | OS_ASSERT(getImpl<detail::PipeAdiabatic_Impl>()); |
| 87 | 38 | } | |
| 88 | |||
| 89 | ✗ | unsigned PipeAdiabatic::inletPort() const { | |
| 90 | ✗ | return getImpl<detail::PipeAdiabatic_Impl>()->inletPort(); | |
| 91 | } | ||
| 92 | |||
| 93 | ✗ | unsigned PipeAdiabatic::outletPort() const { | |
| 94 | ✗ | return getImpl<detail::PipeAdiabatic_Impl>()->outletPort(); | |
| 95 | } | ||
| 96 | |||
| 97 |
1/1✓ Branch 3 taken 11 times.
|
11 | PipeAdiabatic::PipeAdiabatic(std::shared_ptr<detail::PipeAdiabatic_Impl> p) : StraightComponent(std::move(p)) {} |
| 98 | |||
| 99 | 7688 | IddObjectType PipeAdiabatic::iddObjectType() { | |
| 100 |
1/1✓ Branch 1 taken 7688 times.
|
7688 | IddObjectType result(IddObjectType::OS_Pipe_Adiabatic); |
| 101 | 7688 | return result; | |
| 102 | } | ||
| 103 | |||
| 104 | } // namespace model | ||
| 105 | } // namespace openstudio | ||
| 106 |