src/model/LightingSimulationControl.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 "LightingSimulationControl.hpp" | ||
| 7 | #include "LightingSimulationControl_Impl.hpp" | ||
| 8 | |||
| 9 | #include <utilities/idd/OS_LightingSimulationControl_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 | 3 | LightingSimulationControl_Impl::LightingSimulationControl_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 20 | 3 | : ModelObject_Impl(idfObject, model, keepHandle) { | |
| 21 |
4/6✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 3 times.
✗ Branch 13 not taken.
|
3 | OS_ASSERT(idfObject.iddObject().type() == LightingSimulationControl::iddObjectType()); |
| 22 | 3 | } | |
| 23 | |||
| 24 | ✗ | LightingSimulationControl_Impl::LightingSimulationControl_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, | |
| 25 | ✗ | bool keepHandle) | |
| 26 | ✗ | : ModelObject_Impl(other, model, keepHandle) { | |
| 27 | ✗ | OS_ASSERT(other.iddObject().type() == LightingSimulationControl::iddObjectType()); | |
| 28 | ✗ | } | |
| 29 | |||
| 30 | 2 | LightingSimulationControl_Impl::LightingSimulationControl_Impl(const LightingSimulationControl_Impl& other, Model_Impl* model, bool keepHandle) | |
| 31 | 2 | : ModelObject_Impl(other, model, keepHandle) {} | |
| 32 | |||
| 33 | ✗ | const std::vector<std::string>& LightingSimulationControl_Impl::outputVariableNames() const { | |
| 34 | ✗ | static const std::vector<std::string> result; | |
| 35 | ✗ | return result; | |
| 36 | } | ||
| 37 | |||
| 38 | ✗ | IddObjectType LightingSimulationControl_Impl::iddObjectType() const { | |
| 39 | ✗ | return LightingSimulationControl::iddObjectType(); | |
| 40 | } | ||
| 41 | |||
| 42 | ✗ | bool LightingSimulationControl_Impl::runSimulationforDesignDays() const { | |
| 43 | ✗ | boost::optional<std::string> value = getString(OS_LightingSimulationControlFields::RunSimulationforDesignDays, true); | |
| 44 | ✗ | OS_ASSERT(value); | |
| 45 | ✗ | return openstudio::istringEqual(value.get(), "Yes"); | |
| 46 | ✗ | } | |
| 47 | |||
| 48 | ✗ | bool LightingSimulationControl_Impl::isRunSimulationforDesignDaysDefaulted() const { | |
| 49 | ✗ | return isEmpty(OS_LightingSimulationControlFields::RunSimulationforDesignDays); | |
| 50 | } | ||
| 51 | |||
| 52 | ✗ | bool LightingSimulationControl_Impl::runSimulationforWeatherFileRunPeriods() const { | |
| 53 | ✗ | boost::optional<std::string> value = getString(OS_LightingSimulationControlFields::RunSimulationforWeatherFileRunPeriods, true); | |
| 54 | ✗ | OS_ASSERT(value); | |
| 55 | ✗ | return openstudio::istringEqual(value.get(), "Yes"); | |
| 56 | ✗ | } | |
| 57 | |||
| 58 | ✗ | bool LightingSimulationControl_Impl::isRunSimulationforWeatherFileRunPeriodsDefaulted() const { | |
| 59 | ✗ | return isEmpty(OS_LightingSimulationControlFields::RunSimulationforWeatherFileRunPeriods); | |
| 60 | } | ||
| 61 | |||
| 62 | ✗ | bool LightingSimulationControl_Impl::setRunSimulationforDesignDays(bool runSimulationforDesignDays) { | |
| 63 | ✗ | bool result = false; | |
| 64 | ✗ | if (runSimulationforDesignDays) { | |
| 65 | ✗ | result = setString(OS_LightingSimulationControlFields::RunSimulationforDesignDays, "Yes"); | |
| 66 | } else { | ||
| 67 | ✗ | result = setString(OS_LightingSimulationControlFields::RunSimulationforDesignDays, "No"); | |
| 68 | } | ||
| 69 | ✗ | OS_ASSERT(result); | |
| 70 | ✗ | return result; | |
| 71 | } | ||
| 72 | |||
| 73 | ✗ | void LightingSimulationControl_Impl::resetRunSimulationforDesignDays() { | |
| 74 | ✗ | bool result = setString(OS_LightingSimulationControlFields::RunSimulationforDesignDays, ""); | |
| 75 | ✗ | OS_ASSERT(result); | |
| 76 | ✗ | } | |
| 77 | |||
| 78 | ✗ | bool LightingSimulationControl_Impl::setRunSimulationforWeatherFileRunPeriods(bool runSimulationforWeatherFileRunPeriods) { | |
| 79 | ✗ | bool result = false; | |
| 80 | ✗ | if (runSimulationforWeatherFileRunPeriods) { | |
| 81 | ✗ | result = setString(OS_LightingSimulationControlFields::RunSimulationforWeatherFileRunPeriods, "Yes"); | |
| 82 | } else { | ||
| 83 | ✗ | result = setString(OS_LightingSimulationControlFields::RunSimulationforWeatherFileRunPeriods, "No"); | |
| 84 | } | ||
| 85 | ✗ | OS_ASSERT(result); | |
| 86 | ✗ | return result; | |
| 87 | } | ||
| 88 | |||
| 89 | ✗ | void LightingSimulationControl_Impl::resetRunSimulationforWeatherFileRunPeriods() { | |
| 90 | ✗ | bool result = setString(OS_LightingSimulationControlFields::RunSimulationforWeatherFileRunPeriods, ""); | |
| 91 | ✗ | OS_ASSERT(result); | |
| 92 | ✗ | } | |
| 93 | |||
| 94 | } // namespace detail | ||
| 95 | |||
| 96 | 7744 | IddObjectType LightingSimulationControl::iddObjectType() { | |
| 97 |
1/1✓ Branch 1 taken 7744 times.
|
7744 | IddObjectType result(IddObjectType::OS_LightingSimulationControl); |
| 98 | 7744 | return result; | |
| 99 | } | ||
| 100 | |||
| 101 | ✗ | bool LightingSimulationControl::runSimulationforDesignDays() const { | |
| 102 | ✗ | return getImpl<detail::LightingSimulationControl_Impl>()->runSimulationforDesignDays(); | |
| 103 | } | ||
| 104 | |||
| 105 | ✗ | bool LightingSimulationControl::isRunSimulationforDesignDaysDefaulted() const { | |
| 106 | ✗ | return getImpl<detail::LightingSimulationControl_Impl>()->isRunSimulationforDesignDaysDefaulted(); | |
| 107 | } | ||
| 108 | |||
| 109 | ✗ | bool LightingSimulationControl::runSimulationforWeatherFileRunPeriods() const { | |
| 110 | ✗ | return getImpl<detail::LightingSimulationControl_Impl>()->runSimulationforWeatherFileRunPeriods(); | |
| 111 | } | ||
| 112 | |||
| 113 | ✗ | bool LightingSimulationControl::isRunSimulationforWeatherFileRunPeriodsDefaulted() const { | |
| 114 | ✗ | return getImpl<detail::LightingSimulationControl_Impl>()->isRunSimulationforWeatherFileRunPeriodsDefaulted(); | |
| 115 | } | ||
| 116 | |||
| 117 | ✗ | bool LightingSimulationControl::setRunSimulationforDesignDays(bool runSimulationforDesignDays) { | |
| 118 | ✗ | return getImpl<detail::LightingSimulationControl_Impl>()->setRunSimulationforDesignDays(runSimulationforDesignDays); | |
| 119 | } | ||
| 120 | |||
| 121 | ✗ | void LightingSimulationControl::resetRunSimulationforDesignDays() { | |
| 122 | ✗ | getImpl<detail::LightingSimulationControl_Impl>()->resetRunSimulationforDesignDays(); | |
| 123 | ✗ | } | |
| 124 | |||
| 125 | ✗ | bool LightingSimulationControl::setRunSimulationforWeatherFileRunPeriods(bool runSimulationforWeatherFileRunPeriods) { | |
| 126 | ✗ | return getImpl<detail::LightingSimulationControl_Impl>()->setRunSimulationforWeatherFileRunPeriods(runSimulationforWeatherFileRunPeriods); | |
| 127 | } | ||
| 128 | |||
| 129 | ✗ | void LightingSimulationControl::resetRunSimulationforWeatherFileRunPeriods() { | |
| 130 | ✗ | getImpl<detail::LightingSimulationControl_Impl>()->resetRunSimulationforWeatherFileRunPeriods(); | |
| 131 | ✗ | } | |
| 132 | |||
| 133 | /// @cond | ||
| 134 |
1/1✓ Branch 3 taken 5 times.
|
5 | LightingSimulationControl::LightingSimulationControl(std::shared_ptr<detail::LightingSimulationControl_Impl> impl) : ModelObject(std::move(impl)) {} |
| 135 | 3 | LightingSimulationControl::LightingSimulationControl(Model& model) : ModelObject(LightingSimulationControl::iddObjectType(), model) {} | |
| 136 | |||
| 137 | /// @endcond | ||
| 138 | |||
| 139 | } // namespace model | ||
| 140 | } // namespace openstudio | ||
| 141 |