src/model/OutputConstructions.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 "OutputConstructions.hpp" | ||
| 7 | #include "OutputConstructions_Impl.hpp" | ||
| 8 | |||
| 9 | #include "Model.hpp" | ||
| 10 | #include "Model_Impl.hpp" | ||
| 11 | |||
| 12 | #include <utilities/idd/IddFactory.hxx> | ||
| 13 | #include <utilities/idd/IddEnums.hxx> | ||
| 14 | #include <utilities/idd/OS_Output_Constructions_FieldEnums.hxx> | ||
| 15 | |||
| 16 | #include "../utilities/idf/WorkspaceExtensibleGroup.hpp" | ||
| 17 | #include "../utilities/core/Assert.hpp" | ||
| 18 | |||
| 19 | namespace openstudio { | ||
| 20 | namespace model { | ||
| 21 | |||
| 22 | namespace detail { | ||
| 23 | |||
| 24 | 9 | OutputConstructions_Impl::OutputConstructions_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 25 | 9 | : ModelObject_Impl(idfObject, model, keepHandle) { | |
| 26 |
4/6✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 9 times.
✗ Branch 13 not taken.
|
9 | OS_ASSERT(idfObject.iddObject().type() == OutputConstructions::iddObjectType()); |
| 27 | 9 | } | |
| 28 | |||
| 29 | ✗ | OutputConstructions_Impl::OutputConstructions_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 30 | ✗ | : ModelObject_Impl(other, model, keepHandle) { | |
| 31 | ✗ | OS_ASSERT(other.iddObject().type() == OutputConstructions::iddObjectType()); | |
| 32 | ✗ | } | |
| 33 | |||
| 34 | 7 | OutputConstructions_Impl::OutputConstructions_Impl(const OutputConstructions_Impl& other, Model_Impl* model, bool keepHandle) | |
| 35 | 7 | : ModelObject_Impl(other, model, keepHandle) {} | |
| 36 | |||
| 37 | ✗ | const std::vector<std::string>& OutputConstructions_Impl::outputVariableNames() const { | |
| 38 | ✗ | static const std::vector<std::string> result; | |
| 39 | ✗ | return result; | |
| 40 | } | ||
| 41 | |||
| 42 | ✗ | IddObjectType OutputConstructions_Impl::iddObjectType() const { | |
| 43 | ✗ | return OutputConstructions::iddObjectType(); | |
| 44 | } | ||
| 45 | |||
| 46 | 9 | bool OutputConstructions_Impl::reportConstructions() const { | |
| 47 | 9 | return getBooleanFieldValue(OS_Output_ConstructionsFields::ReportConstructions); | |
| 48 | } | ||
| 49 | |||
| 50 | 9 | bool OutputConstructions_Impl::reportMaterials() const { | |
| 51 | 9 | return getBooleanFieldValue(OS_Output_ConstructionsFields::ReportMaterials); | |
| 52 | } | ||
| 53 | |||
| 54 | 18 | bool OutputConstructions_Impl::setReportConstructions(bool reportConstructions) { | |
| 55 | 18 | return setBooleanFieldValue(OS_Output_ConstructionsFields::ReportConstructions, reportConstructions); | |
| 56 | } | ||
| 57 | |||
| 58 | 17 | bool OutputConstructions_Impl::setReportMaterials(bool reportMaterials) { | |
| 59 | 17 | return setBooleanFieldValue(OS_Output_ConstructionsFields::ReportMaterials, reportMaterials); | |
| 60 | } | ||
| 61 | |||
| 62 | } // namespace detail | ||
| 63 | |||
| 64 | 7635 | IddObjectType OutputConstructions::iddObjectType() { | |
| 65 |
1/1✓ Branch 1 taken 7635 times.
|
7635 | return {IddObjectType::OS_Output_Constructions}; |
| 66 | } | ||
| 67 | |||
| 68 | 9 | bool OutputConstructions::reportConstructions() const { | |
| 69 |
1/1✓ Branch 3 taken 9 times.
|
9 | return getImpl<detail::OutputConstructions_Impl>()->reportConstructions(); |
| 70 | } | ||
| 71 | |||
| 72 | 9 | bool OutputConstructions::reportMaterials() const { | |
| 73 |
1/1✓ Branch 3 taken 9 times.
|
9 | return getImpl<detail::OutputConstructions_Impl>()->reportMaterials(); |
| 74 | } | ||
| 75 | |||
| 76 | 18 | bool OutputConstructions::setReportConstructions(bool reportConstructions) { | |
| 77 |
1/1✓ Branch 3 taken 18 times.
|
18 | return getImpl<detail::OutputConstructions_Impl>()->setReportConstructions(reportConstructions); |
| 78 | } | ||
| 79 | |||
| 80 | 17 | bool OutputConstructions::setReportMaterials(bool reportMaterials) { | |
| 81 |
1/1✓ Branch 3 taken 17 times.
|
17 | return getImpl<detail::OutputConstructions_Impl>()->setReportMaterials(reportMaterials); |
| 82 | } | ||
| 83 | |||
| 84 | /// @cond | ||
| 85 |
1/1✓ Branch 3 taken 13 times.
|
13 | OutputConstructions::OutputConstructions(std::shared_ptr<detail::OutputConstructions_Impl> impl) : ModelObject(std::move(impl)) {} |
| 86 | 9 | OutputConstructions::OutputConstructions(Model& model) : ModelObject(OutputConstructions::iddObjectType(), model) { | |
| 87 |
1/1✓ Branch 1 taken 9 times.
|
9 | bool ok = setReportConstructions(true); |
| 88 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 9 times.
✗ Branch 3 not taken.
|
9 | OS_ASSERT(ok); |
| 89 |
1/1✓ Branch 1 taken 9 times.
|
9 | ok = setReportMaterials(false); |
| 90 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 9 times.
✗ Branch 3 not taken.
|
9 | OS_ASSERT(ok); |
| 91 | 9 | } | |
| 92 | |||
| 93 | /// @endcond | ||
| 94 | |||
| 95 | } // namespace model | ||
| 96 | } // namespace openstudio | ||
| 97 |