src/model/EnergyManagementSystemOutputVariable.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 "EnergyManagementSystemOutputVariable.hpp" | ||
| 7 | #include "EnergyManagementSystemOutputVariable_Impl.hpp" | ||
| 8 | #include "EnergyManagementSystemProgram.hpp" | ||
| 9 | #include "EnergyManagementSystemProgram_Impl.hpp" | ||
| 10 | #include "EnergyManagementSystemSubroutine.hpp" | ||
| 11 | #include "EnergyManagementSystemSubroutine_Impl.hpp" | ||
| 12 | #include "EnergyManagementSystemSensor.hpp" | ||
| 13 | #include "EnergyManagementSystemSensor_Impl.hpp" | ||
| 14 | #include "EnergyManagementSystemActuator.hpp" | ||
| 15 | #include "EnergyManagementSystemGlobalVariable.hpp" | ||
| 16 | #include "EnergyManagementSystemTrendVariable.hpp" | ||
| 17 | #include "EnergyManagementSystemInternalVariable.hpp" | ||
| 18 | #include "EnergyManagementSystemCurveOrTableIndexVariable.hpp" | ||
| 19 | #include "EnergyManagementSystemConstructionIndexVariable.hpp" | ||
| 20 | #include "EnergyManagementSystemActuator_Impl.hpp" | ||
| 21 | #include "EnergyManagementSystemGlobalVariable_Impl.hpp" | ||
| 22 | #include "EnergyManagementSystemTrendVariable_Impl.hpp" | ||
| 23 | #include "EnergyManagementSystemInternalVariable_Impl.hpp" | ||
| 24 | #include "EnergyManagementSystemCurveOrTableIndexVariable_Impl.hpp" | ||
| 25 | #include "EnergyManagementSystemConstructionIndexVariable_Impl.hpp" | ||
| 26 | |||
| 27 | #include "Model.hpp" | ||
| 28 | |||
| 29 | #include <utilities/idd/IddFactory.hxx> | ||
| 30 | #include <utilities/idd/IddEnums.hxx> | ||
| 31 | #include <utilities/idd/OS_EnergyManagementSystem_OutputVariable_FieldEnums.hxx> | ||
| 32 | |||
| 33 | #include "../utilities/core/Assert.hpp" | ||
| 34 | |||
| 35 | namespace openstudio { | ||
| 36 | namespace model { | ||
| 37 | |||
| 38 | namespace detail { | ||
| 39 | |||
| 40 | 15 | EnergyManagementSystemOutputVariable_Impl::EnergyManagementSystemOutputVariable_Impl(const IdfObject& idfObject, Model_Impl* model, | |
| 41 | 15 | bool keepHandle) | |
| 42 | 15 | : ModelObject_Impl(idfObject, model, keepHandle) { | |
| 43 |
4/6✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 15 times.
✗ Branch 13 not taken.
|
15 | OS_ASSERT(idfObject.iddObject().type() == EnergyManagementSystemOutputVariable::iddObjectType()); |
| 44 | 15 | } | |
| 45 | |||
| 46 | ✗ | EnergyManagementSystemOutputVariable_Impl::EnergyManagementSystemOutputVariable_Impl(const openstudio::detail::WorkspaceObject_Impl& other, | |
| 47 | ✗ | Model_Impl* model, bool keepHandle) | |
| 48 | ✗ | : ModelObject_Impl(other, model, keepHandle) { | |
| 49 | ✗ | OS_ASSERT(other.iddObject().type() == EnergyManagementSystemOutputVariable::iddObjectType()); | |
| 50 | ✗ | } | |
| 51 | |||
| 52 | 9 | EnergyManagementSystemOutputVariable_Impl::EnergyManagementSystemOutputVariable_Impl(const EnergyManagementSystemOutputVariable_Impl& other, | |
| 53 | 9 | Model_Impl* model, bool keepHandle) | |
| 54 | 9 | : ModelObject_Impl(other, model, keepHandle) {} | |
| 55 | |||
| 56 | ✗ | const std::vector<std::string>& EnergyManagementSystemOutputVariable_Impl::outputVariableNames() const { | |
| 57 | ✗ | static const std::vector<std::string> result; | |
| 58 | ✗ | return result; | |
| 59 | } | ||
| 60 | |||
| 61 | ✗ | IddObjectType EnergyManagementSystemOutputVariable_Impl::iddObjectType() const { | |
| 62 | ✗ | return EnergyManagementSystemOutputVariable::iddObjectType(); | |
| 63 | } | ||
| 64 | |||
| 65 | 12 | std::string EnergyManagementSystemOutputVariable_Impl::emsVariableName() const { | |
| 66 |
1/1✓ Branch 1 taken 12 times.
|
12 | boost::optional<std::string> value = getString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, true); |
| 67 |
2/2✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
|
24 | return value.get(); |
| 68 | 12 | } | |
| 69 | |||
| 70 | 9 | std::string EnergyManagementSystemOutputVariable_Impl::typeOfDataInVariable() const { | |
| 71 |
1/1✓ Branch 1 taken 9 times.
|
9 | boost::optional<std::string> value = getString(OS_EnergyManagementSystem_OutputVariableFields::TypeofDatainVariable, true); |
| 72 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
18 | return value.get(); |
| 73 | 9 | } | |
| 74 | |||
| 75 | 9 | std::string EnergyManagementSystemOutputVariable_Impl::updateFrequency() const { | |
| 76 |
1/1✓ Branch 1 taken 9 times.
|
9 | boost::optional<std::string> value = getString(OS_EnergyManagementSystem_OutputVariableFields::UpdateFrequency, true); |
| 77 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
18 | return value.get(); |
| 78 | 9 | } | |
| 79 | |||
| 80 | 9 | std::string EnergyManagementSystemOutputVariable_Impl::emsProgramOrSubroutineName() const { | |
| 81 | //return getString(OS_EnergyManagementSystem_OutputVariableFields::EMSProgramorSubroutineName,true); | ||
| 82 |
1/1✓ Branch 1 taken 9 times.
|
9 | boost::optional<WorkspaceObject> object = getTarget(OS_EnergyManagementSystem_OutputVariableFields::EMSProgramorSubroutineName); |
| 83 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 8 times.
|
9 | if (object) { |
| 84 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | return object.get().nameString(); |
| 85 | } | ||
| 86 |
1/1✓ Branch 1 taken 8 times.
|
16 | return ""; |
| 87 | 9 | } | |
| 88 | |||
| 89 | 1 | boost::optional<EnergyManagementSystemProgram> EnergyManagementSystemOutputVariable_Impl::emsProgram() const { | |
| 90 | 1 | boost::optional<EnergyManagementSystemProgram> result; | |
| 91 |
1/1✓ Branch 1 taken 1 time.
|
1 | OptionalWorkspaceObject object = getTarget(OS_EnergyManagementSystem_OutputVariableFields::EMSProgramorSubroutineName); |
| 92 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (object) { |
| 93 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | result = object->optionalCast<EnergyManagementSystemProgram>(); |
| 94 | } | ||
| 95 | 2 | return result; | |
| 96 | 1 | } | |
| 97 | |||
| 98 | ✗ | boost::optional<EnergyManagementSystemSubroutine> EnergyManagementSystemOutputVariable_Impl::emsSubroutine() const { | |
| 99 | ✗ | boost::optional<EnergyManagementSystemSubroutine> result; | |
| 100 | ✗ | OptionalWorkspaceObject object = getTarget(OS_EnergyManagementSystem_OutputVariableFields::EMSProgramorSubroutineName); | |
| 101 | ✗ | if (object) { | |
| 102 | ✗ | result = object->optionalCast<EnergyManagementSystemSubroutine>(); | |
| 103 | } | ||
| 104 | ✗ | return result; | |
| 105 | ✗ | } | |
| 106 | |||
| 107 | 7 | std::string EnergyManagementSystemOutputVariable_Impl::units() const { | |
| 108 |
1/1✓ Branch 1 taken 7 times.
|
7 | OptionalString results = getString(OS_EnergyManagementSystem_OutputVariableFields::Units, true); |
| 109 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 7 times.
|
7 | if (results) { |
| 110 | ✗ | return results.get(); | |
| 111 | } | ||
| 112 |
1/1✓ Branch 1 taken 7 times.
|
14 | return ""; |
| 113 | 7 | } | |
| 114 | |||
| 115 | 11 | bool EnergyManagementSystemOutputVariable_Impl::setEMSVariableName(const std::string& eMSVariableName) { | |
| 116 | 11 | bool result = setString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, eMSVariableName); | |
| 117 | 11 | return result; | |
| 118 | } | ||
| 119 | |||
| 120 | 1 | bool EnergyManagementSystemOutputVariable_Impl::setEMSVariableName(const EnergyManagementSystemActuator& object) { | |
| 121 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | bool result = setString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, toString(object.handle())); |
| 122 | 1 | return result; | |
| 123 | } | ||
| 124 | |||
| 125 | 1 | bool EnergyManagementSystemOutputVariable_Impl::setEMSVariableName(const EnergyManagementSystemSensor& object) { | |
| 126 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | bool result = setString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, toString(object.handle())); |
| 127 | 1 | return result; | |
| 128 | } | ||
| 129 | |||
| 130 | 4 | bool EnergyManagementSystemOutputVariable_Impl::setEMSVariableName(const EnergyManagementSystemGlobalVariable& object) { | |
| 131 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
|
4 | bool result = setString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, toString(object.handle())); |
| 132 | 4 | return result; | |
| 133 | } | ||
| 134 | |||
| 135 | ✗ | bool EnergyManagementSystemOutputVariable_Impl::setEMSVariableName(const EnergyManagementSystemTrendVariable& object) { | |
| 136 | ✗ | bool result = setString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, toString(object.handle())); | |
| 137 | ✗ | return result; | |
| 138 | } | ||
| 139 | |||
| 140 | ✗ | bool EnergyManagementSystemOutputVariable_Impl::setEMSVariableName(const EnergyManagementSystemInternalVariable& object) { | |
| 141 | ✗ | bool result = setString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, toString(object.handle())); | |
| 142 | ✗ | return result; | |
| 143 | } | ||
| 144 | |||
| 145 | ✗ | bool EnergyManagementSystemOutputVariable_Impl::setEMSVariableName(const EnergyManagementSystemCurveOrTableIndexVariable& object) { | |
| 146 | ✗ | bool result = setString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, toString(object.handle())); | |
| 147 | ✗ | return result; | |
| 148 | } | ||
| 149 | |||
| 150 | ✗ | bool EnergyManagementSystemOutputVariable_Impl::setEMSVariableName(const EnergyManagementSystemConstructionIndexVariable& object) { | |
| 151 | ✗ | bool result = setString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, toString(object.handle())); | |
| 152 | ✗ | return result; | |
| 153 | } | ||
| 154 | |||
| 155 | 20 | bool EnergyManagementSystemOutputVariable_Impl::setTypeOfDataInVariable(const std::string& typeofDatainVariable) { | |
| 156 | 20 | bool result = setString(OS_EnergyManagementSystem_OutputVariableFields::TypeofDatainVariable, typeofDatainVariable); | |
| 157 | 20 | return result; | |
| 158 | } | ||
| 159 | |||
| 160 | 20 | bool EnergyManagementSystemOutputVariable_Impl::setUpdateFrequency(const std::string& updateFrequency) { | |
| 161 | 20 | bool result = setString(OS_EnergyManagementSystem_OutputVariableFields::UpdateFrequency, updateFrequency); | |
| 162 | 20 | return result; | |
| 163 | } | ||
| 164 | |||
| 165 | 1 | bool EnergyManagementSystemOutputVariable_Impl::setEMSProgramOrSubroutineName(const EnergyManagementSystemProgram& program) { | |
| 166 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | bool result = setPointer(OS_EnergyManagementSystem_OutputVariableFields::EMSProgramorSubroutineName, program.handle()); |
| 167 | 1 | return result; | |
| 168 | } | ||
| 169 | |||
| 170 | ✗ | bool EnergyManagementSystemOutputVariable_Impl::setEMSProgramOrSubroutineName(const EnergyManagementSystemSubroutine& subroutine) { | |
| 171 | ✗ | bool result = setPointer(OS_EnergyManagementSystem_OutputVariableFields::EMSProgramorSubroutineName, subroutine.handle()); | |
| 172 | ✗ | return result; | |
| 173 | } | ||
| 174 | |||
| 175 | ✗ | void EnergyManagementSystemOutputVariable_Impl::resetEMSProgramOrSubroutineName() { | |
| 176 | ✗ | bool result = setString(OS_EnergyManagementSystem_OutputVariableFields::EMSProgramorSubroutineName, ""); | |
| 177 | //bool result = setPointer(OS_EnergyManagementSystem_OutputVariableFields::EMSProgramorSubroutineName, NULL); | ||
| 178 | ✗ | OS_ASSERT(result); | |
| 179 | ✗ | } | |
| 180 | |||
| 181 | 2 | bool EnergyManagementSystemOutputVariable_Impl::setUnits(const std::string& units) { | |
| 182 | 2 | bool result = setString(OS_EnergyManagementSystem_OutputVariableFields::Units, units); | |
| 183 | 2 | return result; | |
| 184 | } | ||
| 185 | |||
| 186 | ✗ | void EnergyManagementSystemOutputVariable_Impl::resetUnits() { | |
| 187 | ✗ | bool result = setString(OS_EnergyManagementSystem_OutputVariableFields::Units, ""); | |
| 188 | ✗ | OS_ASSERT(result); | |
| 189 | ✗ | } | |
| 190 | |||
| 191 | 2 | boost::optional<ModelObject> EnergyManagementSystemOutputVariable_Impl::emsVariableObject() const { | |
| 192 | 2 | boost::optional<ModelObject> value; | |
| 193 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<std::string> handle = getString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, true); |
| 194 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
2 | if (handle) { |
| 195 |
1/1✓ Branch 1 taken 2 times.
|
2 | const Model m = this->model(); |
| 196 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | value = m.getModelObject<ModelObject>(toUUID(handle.get())); |
| 197 | 2 | } | |
| 198 | 4 | return value; | |
| 199 | 2 | } | |
| 200 | |||
| 201 | ✗ | boost::optional<EnergyManagementSystemActuator> EnergyManagementSystemOutputVariable_Impl::emsActuator() const { | |
| 202 | ✗ | boost::optional<EnergyManagementSystemActuator> value; | |
| 203 | ✗ | boost::optional<std::string> handle = getString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, true); | |
| 204 | ✗ | if (handle) { | |
| 205 | ✗ | const Model m = this->model(); | |
| 206 | ✗ | value = m.getModelObject<EnergyManagementSystemActuator>(toUUID(handle.get())); | |
| 207 | ✗ | } | |
| 208 | ✗ | return value; | |
| 209 | ✗ | } | |
| 210 | |||
| 211 | 2 | boost::optional<EnergyManagementSystemSensor> EnergyManagementSystemOutputVariable_Impl::emsSensor() const { | |
| 212 | 2 | boost::optional<EnergyManagementSystemSensor> value; | |
| 213 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<std::string> handle = getString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, true); |
| 214 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
2 | if (handle) { |
| 215 |
1/1✓ Branch 1 taken 2 times.
|
2 | const Model m = this->model(); |
| 216 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | value = m.getModelObject<EnergyManagementSystemSensor>(toUUID(handle.get())); |
| 217 | 2 | } | |
| 218 | 4 | return value; | |
| 219 | 2 | } | |
| 220 | |||
| 221 | ✗ | boost::optional<EnergyManagementSystemGlobalVariable> EnergyManagementSystemOutputVariable_Impl::emsGlobalVariable() const { | |
| 222 | ✗ | boost::optional<EnergyManagementSystemGlobalVariable> value; | |
| 223 | ✗ | boost::optional<std::string> handle = getString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, true); | |
| 224 | ✗ | if (handle) { | |
| 225 | ✗ | const Model m = this->model(); | |
| 226 | ✗ | value = m.getModelObject<EnergyManagementSystemGlobalVariable>(toUUID(handle.get())); | |
| 227 | ✗ | } | |
| 228 | ✗ | return value; | |
| 229 | ✗ | } | |
| 230 | |||
| 231 | ✗ | boost::optional<EnergyManagementSystemTrendVariable> EnergyManagementSystemOutputVariable_Impl::emsTrendVariable() const { | |
| 232 | ✗ | boost::optional<EnergyManagementSystemTrendVariable> value; | |
| 233 | ✗ | boost::optional<std::string> handle = getString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, true); | |
| 234 | ✗ | if (handle) { | |
| 235 | ✗ | const Model m = this->model(); | |
| 236 | ✗ | value = m.getModelObject<EnergyManagementSystemTrendVariable>(toUUID(handle.get())); | |
| 237 | ✗ | } | |
| 238 | ✗ | return value; | |
| 239 | ✗ | } | |
| 240 | |||
| 241 | ✗ | boost::optional<EnergyManagementSystemInternalVariable> EnergyManagementSystemOutputVariable_Impl::emsInternalVariable() const { | |
| 242 | ✗ | boost::optional<EnergyManagementSystemInternalVariable> value; | |
| 243 | ✗ | boost::optional<std::string> handle = getString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, true); | |
| 244 | ✗ | if (handle) { | |
| 245 | ✗ | const Model m = this->model(); | |
| 246 | ✗ | value = m.getModelObject<EnergyManagementSystemInternalVariable>(toUUID(handle.get())); | |
| 247 | ✗ | } | |
| 248 | ✗ | return value; | |
| 249 | ✗ | } | |
| 250 | |||
| 251 | ✗ | boost::optional<EnergyManagementSystemCurveOrTableIndexVariable> EnergyManagementSystemOutputVariable_Impl::emsCurveOrTableIndexVariable() const { | |
| 252 | ✗ | boost::optional<EnergyManagementSystemCurveOrTableIndexVariable> value; | |
| 253 | ✗ | boost::optional<std::string> handle = getString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, true); | |
| 254 | ✗ | if (handle) { | |
| 255 | ✗ | const Model m = this->model(); | |
| 256 | ✗ | value = m.getModelObject<EnergyManagementSystemCurveOrTableIndexVariable>(toUUID(handle.get())); | |
| 257 | ✗ | } | |
| 258 | ✗ | return value; | |
| 259 | ✗ | } | |
| 260 | |||
| 261 | ✗ | boost::optional<EnergyManagementSystemConstructionIndexVariable> EnergyManagementSystemOutputVariable_Impl::emsConstructionIndexVariable() const { | |
| 262 | ✗ | boost::optional<EnergyManagementSystemConstructionIndexVariable> value; | |
| 263 | ✗ | boost::optional<std::string> handle = getString(OS_EnergyManagementSystem_OutputVariableFields::EMSVariableName, true); | |
| 264 | ✗ | if (handle) { | |
| 265 | ✗ | const Model m = this->model(); | |
| 266 | ✗ | value = m.getModelObject<EnergyManagementSystemConstructionIndexVariable>(toUUID(handle.get())); | |
| 267 | ✗ | } | |
| 268 | ✗ | return value; | |
| 269 | ✗ | } | |
| 270 | |||
| 271 | 3 | bool EnergyManagementSystemOutputVariable_Impl::exportToBCVTB() const { | |
| 272 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> value = getString(OS_EnergyManagementSystem_OutputVariableFields::ExportToBCVTB, true); |
| 273 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
|
3 | OS_ASSERT(value); |
| 274 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
|
6 | return openstudio::istringEqual(value.get(), "True"); |
| 275 | 3 | } | |
| 276 | |||
| 277 | 1 | bool EnergyManagementSystemOutputVariable_Impl::isExportToBCVTBDefaulted() const { | |
| 278 | 1 | return isEmpty(OS_EnergyManagementSystem_OutputVariableFields::ExportToBCVTB); | |
| 279 | } | ||
| 280 | |||
| 281 | 1 | bool EnergyManagementSystemOutputVariable_Impl::setExportToBCVTB(bool exportToBCVTB) { | |
| 282 | 1 | bool result = false; | |
| 283 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (exportToBCVTB) { |
| 284 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
3 | result = setString(OS_EnergyManagementSystem_OutputVariableFields::ExportToBCVTB, "True"); |
| 285 | } else { | ||
| 286 | ✗ | result = setString(OS_EnergyManagementSystem_OutputVariableFields::ExportToBCVTB, "False"); | |
| 287 | } | ||
| 288 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 289 | 1 | return result; | |
| 290 | } | ||
| 291 | |||
| 292 | 1 | void EnergyManagementSystemOutputVariable_Impl::resetExportToBCVTB() { | |
| 293 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_EnergyManagementSystem_OutputVariableFields::ExportToBCVTB, ""); |
| 294 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 295 | 1 | } | |
| 296 | |||
| 297 | } // namespace detail | ||
| 298 | |||
| 299 | 7 | EnergyManagementSystemOutputVariable::EnergyManagementSystemOutputVariable(const Model& model, const std::string eMSVariableName) | |
| 300 | 7 | : ModelObject(EnergyManagementSystemOutputVariable::iddObjectType(), model) { | |
| 301 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 7 times.
✗ Branch 5 not taken.
|
7 | OS_ASSERT(getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()); |
| 302 |
1/1✓ Branch 1 taken 7 times.
|
7 | bool ok = setEMSVariableName(eMSVariableName); |
| 303 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 7 times.
|
7 | if (!ok) { |
| 304 | ✗ | remove(); | |
| 305 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s eMSVariableName to " << eMSVariableName << "."); | |
| 306 | } | ||
| 307 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
14 | setUpdateFrequency("ZoneTimestep"); |
| 308 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | setTypeOfDataInVariable("Averaged"); |
| 309 | 7 | } | |
| 310 | |||
| 311 | 1 | EnergyManagementSystemOutputVariable::EnergyManagementSystemOutputVariable(const Model& model, const EnergyManagementSystemActuator& object) | |
| 312 | 1 | : ModelObject(EnergyManagementSystemOutputVariable::iddObjectType(), model) { | |
| 313 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 5 not taken.
|
1 | OS_ASSERT(getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()); |
| 314 |
1/1✓ Branch 1 taken 1 time.
|
1 | bool ok = setEMSVariableName(object); |
| 315 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (!ok) { |
| 316 | ✗ | remove(); | |
| 317 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s eMSVariableName to " << object.briefDescription() << "."); | |
| 318 | } | ||
| 319 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | setUpdateFrequency("ZoneTimestep"); |
| 320 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | setTypeOfDataInVariable("Averaged"); |
| 321 | 1 | } | |
| 322 | |||
| 323 | 1 | EnergyManagementSystemOutputVariable::EnergyManagementSystemOutputVariable(const Model& model, const EnergyManagementSystemSensor& object) | |
| 324 | 1 | : ModelObject(EnergyManagementSystemOutputVariable::iddObjectType(), model) { | |
| 325 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 5 not taken.
|
1 | OS_ASSERT(getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()); |
| 326 |
1/1✓ Branch 1 taken 1 time.
|
1 | bool ok = setEMSVariableName(object); |
| 327 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (!ok) { |
| 328 | ✗ | remove(); | |
| 329 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s eMSVariableName to " << object.briefDescription() << "."); | |
| 330 | } | ||
| 331 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | setUpdateFrequency("ZoneTimestep"); |
| 332 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | setTypeOfDataInVariable("Averaged"); |
| 333 | 1 | } | |
| 334 | |||
| 335 | 4 | EnergyManagementSystemOutputVariable::EnergyManagementSystemOutputVariable(const Model& model, const EnergyManagementSystemGlobalVariable& object) | |
| 336 | 4 | : ModelObject(EnergyManagementSystemOutputVariable::iddObjectType(), model) { | |
| 337 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 4 times.
✗ Branch 5 not taken.
|
4 | OS_ASSERT(getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()); |
| 338 |
1/1✓ Branch 1 taken 4 times.
|
4 | bool ok = setEMSVariableName(object); |
| 339 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
4 | if (!ok) { |
| 340 | ✗ | remove(); | |
| 341 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s eMSVariableName to " << object.briefDescription() << "."); | |
| 342 | } | ||
| 343 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
8 | setUpdateFrequency("ZoneTimestep"); |
| 344 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | setTypeOfDataInVariable("Averaged"); |
| 345 | 4 | } | |
| 346 | |||
| 347 | ✗ | EnergyManagementSystemOutputVariable::EnergyManagementSystemOutputVariable(const Model& model, const EnergyManagementSystemTrendVariable& object) | |
| 348 | ✗ | : ModelObject(EnergyManagementSystemOutputVariable::iddObjectType(), model) { | |
| 349 | ✗ | OS_ASSERT(getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()); | |
| 350 | ✗ | bool ok = setEMSVariableName(object); | |
| 351 | ✗ | if (!ok) { | |
| 352 | ✗ | remove(); | |
| 353 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s eMSVariableName to " << object.briefDescription() << "."); | |
| 354 | } | ||
| 355 | ✗ | setUpdateFrequency("ZoneTimestep"); | |
| 356 | ✗ | setTypeOfDataInVariable("Averaged"); | |
| 357 | ✗ | } | |
| 358 | |||
| 359 | ✗ | EnergyManagementSystemOutputVariable::EnergyManagementSystemOutputVariable(const Model& model, const EnergyManagementSystemInternalVariable& object) | |
| 360 | ✗ | : ModelObject(EnergyManagementSystemOutputVariable::iddObjectType(), model) { | |
| 361 | ✗ | OS_ASSERT(getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()); | |
| 362 | ✗ | bool ok = setEMSVariableName(object); | |
| 363 | ✗ | if (!ok) { | |
| 364 | ✗ | remove(); | |
| 365 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s eMSVariableName to " << object.briefDescription() << "."); | |
| 366 | } | ||
| 367 | ✗ | setUpdateFrequency("ZoneTimestep"); | |
| 368 | ✗ | setTypeOfDataInVariable("Averaged"); | |
| 369 | ✗ | } | |
| 370 | |||
| 371 | ✗ | EnergyManagementSystemOutputVariable::EnergyManagementSystemOutputVariable(const Model& model, | |
| 372 | ✗ | const EnergyManagementSystemCurveOrTableIndexVariable& object) | |
| 373 | ✗ | : ModelObject(EnergyManagementSystemOutputVariable::iddObjectType(), model) { | |
| 374 | ✗ | OS_ASSERT(getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()); | |
| 375 | ✗ | bool ok = setEMSVariableName(object); | |
| 376 | ✗ | if (!ok) { | |
| 377 | ✗ | remove(); | |
| 378 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s eMSVariableName to " << object.briefDescription() << "."); | |
| 379 | } | ||
| 380 | ✗ | setUpdateFrequency("ZoneTimestep"); | |
| 381 | ✗ | setTypeOfDataInVariable("Averaged"); | |
| 382 | ✗ | } | |
| 383 | |||
| 384 | ✗ | EnergyManagementSystemOutputVariable::EnergyManagementSystemOutputVariable(const Model& model, | |
| 385 | ✗ | const EnergyManagementSystemConstructionIndexVariable& object) | |
| 386 | ✗ | : ModelObject(EnergyManagementSystemOutputVariable::iddObjectType(), model) { | |
| 387 | ✗ | OS_ASSERT(getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()); | |
| 388 | ✗ | bool ok = setEMSVariableName(object); | |
| 389 | ✗ | if (!ok) { | |
| 390 | ✗ | remove(); | |
| 391 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s eMSVariableName to " << object.briefDescription() << "."); | |
| 392 | } | ||
| 393 | ✗ | setUpdateFrequency("ZoneTimestep"); | |
| 394 | ✗ | setTypeOfDataInVariable("Averaged"); | |
| 395 | ✗ | } | |
| 396 | |||
| 397 | 2 | EnergyManagementSystemOutputVariable::EnergyManagementSystemOutputVariable(const Model& model) | |
| 398 | 2 | : ModelObject(EnergyManagementSystemOutputVariable::iddObjectType(), model) { | |
| 399 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✗ Branch 5 not taken.
|
2 | OS_ASSERT(getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()); |
| 400 | //TODO setEMSVariableName to a valid default | ||
| 401 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | setUpdateFrequency("ZoneTimestep"); |
| 402 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | setTypeOfDataInVariable("Averaged"); |
| 403 | 2 | } | |
| 404 | |||
| 405 | 7628 | IddObjectType EnergyManagementSystemOutputVariable::iddObjectType() { | |
| 406 |
1/1✓ Branch 1 taken 7628 times.
|
7628 | return {IddObjectType::OS_EnergyManagementSystem_OutputVariable}; |
| 407 | } | ||
| 408 | |||
| 409 | ✗ | std::vector<std::string> EnergyManagementSystemOutputVariable::typeOfDataInVariableValues() { | |
| 410 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), | |
| 411 | ✗ | OS_EnergyManagementSystem_OutputVariableFields::TypeofDatainVariable); | |
| 412 | } | ||
| 413 | |||
| 414 | ✗ | std::vector<std::string> EnergyManagementSystemOutputVariable::updateFrequencyValues() { | |
| 415 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_EnergyManagementSystem_OutputVariableFields::UpdateFrequency); | |
| 416 | } | ||
| 417 | |||
| 418 | 12 | std::string EnergyManagementSystemOutputVariable::emsVariableName() const { | |
| 419 |
1/1✓ Branch 3 taken 12 times.
|
12 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->emsVariableName(); |
| 420 | } | ||
| 421 | |||
| 422 | 9 | std::string EnergyManagementSystemOutputVariable::typeOfDataInVariable() const { | |
| 423 |
1/1✓ Branch 3 taken 9 times.
|
9 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->typeOfDataInVariable(); |
| 424 | } | ||
| 425 | |||
| 426 | 9 | std::string EnergyManagementSystemOutputVariable::updateFrequency() const { | |
| 427 |
1/1✓ Branch 3 taken 9 times.
|
9 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->updateFrequency(); |
| 428 | } | ||
| 429 | |||
| 430 | 9 | std::string EnergyManagementSystemOutputVariable::emsProgramOrSubroutineName() const { | |
| 431 |
1/1✓ Branch 3 taken 9 times.
|
9 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->emsProgramOrSubroutineName(); |
| 432 | } | ||
| 433 | |||
| 434 | 1 | boost::optional<EnergyManagementSystemProgram> EnergyManagementSystemOutputVariable::emsProgram() const { | |
| 435 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->emsProgram(); |
| 436 | } | ||
| 437 | |||
| 438 | ✗ | boost::optional<EnergyManagementSystemSubroutine> EnergyManagementSystemOutputVariable::emsSubroutine() const { | |
| 439 | ✗ | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->emsSubroutine(); | |
| 440 | } | ||
| 441 | |||
| 442 | 7 | std::string EnergyManagementSystemOutputVariable::units() const { | |
| 443 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->units(); |
| 444 | } | ||
| 445 | |||
| 446 | 2 | boost::optional<ModelObject> EnergyManagementSystemOutputVariable::emsVariableObject() const { | |
| 447 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->emsVariableObject(); |
| 448 | } | ||
| 449 | |||
| 450 | ✗ | boost::optional<EnergyManagementSystemActuator> EnergyManagementSystemOutputVariable::emsActuator() const { | |
| 451 | ✗ | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->emsActuator(); | |
| 452 | } | ||
| 453 | |||
| 454 | 2 | boost::optional<EnergyManagementSystemSensor> EnergyManagementSystemOutputVariable::emsSensor() const { | |
| 455 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->emsSensor(); |
| 456 | } | ||
| 457 | |||
| 458 | ✗ | boost::optional<EnergyManagementSystemGlobalVariable> EnergyManagementSystemOutputVariable::emsGlobalVariable() const { | |
| 459 | ✗ | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->emsGlobalVariable(); | |
| 460 | } | ||
| 461 | |||
| 462 | ✗ | boost::optional<EnergyManagementSystemTrendVariable> EnergyManagementSystemOutputVariable::emsTrendVariable() const { | |
| 463 | ✗ | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->emsTrendVariable(); | |
| 464 | } | ||
| 465 | |||
| 466 | ✗ | boost::optional<EnergyManagementSystemInternalVariable> EnergyManagementSystemOutputVariable::emsInternalVariable() const { | |
| 467 | ✗ | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->emsInternalVariable(); | |
| 468 | } | ||
| 469 | |||
| 470 | ✗ | boost::optional<EnergyManagementSystemCurveOrTableIndexVariable> EnergyManagementSystemOutputVariable::emsCurveOrTableIndexVariable() const { | |
| 471 | ✗ | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->emsCurveOrTableIndexVariable(); | |
| 472 | } | ||
| 473 | |||
| 474 | ✗ | boost::optional<EnergyManagementSystemConstructionIndexVariable> EnergyManagementSystemOutputVariable::emsConstructionIndexVariable() const { | |
| 475 | ✗ | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->emsConstructionIndexVariable(); | |
| 476 | } | ||
| 477 | |||
| 478 | 20 | bool EnergyManagementSystemOutputVariable::setTypeOfDataInVariable(const std::string& typeofDatainVariable) { | |
| 479 |
1/1✓ Branch 3 taken 20 times.
|
20 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->setTypeOfDataInVariable(typeofDatainVariable); |
| 480 | } | ||
| 481 | |||
| 482 | 20 | bool EnergyManagementSystemOutputVariable::setUpdateFrequency(const std::string& updateFrequency) { | |
| 483 |
1/1✓ Branch 3 taken 20 times.
|
20 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->setUpdateFrequency(updateFrequency); |
| 484 | } | ||
| 485 | |||
| 486 | 1 | bool EnergyManagementSystemOutputVariable::setEMSProgramOrSubroutineName(const EnergyManagementSystemProgram& program) { | |
| 487 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->setEMSProgramOrSubroutineName(program); |
| 488 | } | ||
| 489 | |||
| 490 | ✗ | bool EnergyManagementSystemOutputVariable::setEMSProgramOrSubroutineName(const EnergyManagementSystemSubroutine& subroutine) { | |
| 491 | ✗ | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->setEMSProgramOrSubroutineName(subroutine); | |
| 492 | } | ||
| 493 | |||
| 494 | ✗ | void EnergyManagementSystemOutputVariable::resetEMSProgramOrSubroutineName() { | |
| 495 | ✗ | getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->resetEMSProgramOrSubroutineName(); | |
| 496 | ✗ | } | |
| 497 | |||
| 498 | 2 | bool EnergyManagementSystemOutputVariable::setUnits(const std::string& units) { | |
| 499 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->setUnits(units); |
| 500 | } | ||
| 501 | |||
| 502 | ✗ | void EnergyManagementSystemOutputVariable::resetUnits() { | |
| 503 | ✗ | getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->resetUnits(); | |
| 504 | ✗ | } | |
| 505 | |||
| 506 | 11 | bool EnergyManagementSystemOutputVariable::setEMSVariableName(const std::string& eMSVariableName) { | |
| 507 |
1/1✓ Branch 3 taken 11 times.
|
11 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->setEMSVariableName(eMSVariableName); |
| 508 | } | ||
| 509 | |||
| 510 | 1 | bool EnergyManagementSystemOutputVariable::setEMSVariableName(const EnergyManagementSystemActuator& object) { | |
| 511 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->setEMSVariableName(object); |
| 512 | } | ||
| 513 | |||
| 514 | 1 | bool EnergyManagementSystemOutputVariable::setEMSVariableName(const EnergyManagementSystemSensor& object) { | |
| 515 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->setEMSVariableName(object); |
| 516 | } | ||
| 517 | |||
| 518 | 4 | bool EnergyManagementSystemOutputVariable::setEMSVariableName(const EnergyManagementSystemGlobalVariable& object) { | |
| 519 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->setEMSVariableName(object); |
| 520 | } | ||
| 521 | |||
| 522 | ✗ | bool EnergyManagementSystemOutputVariable::setEMSVariableName(const EnergyManagementSystemTrendVariable& object) { | |
| 523 | ✗ | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->setEMSVariableName(object); | |
| 524 | } | ||
| 525 | |||
| 526 | ✗ | bool EnergyManagementSystemOutputVariable::setEMSVariableName(const EnergyManagementSystemInternalVariable& object) { | |
| 527 | ✗ | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->setEMSVariableName(object); | |
| 528 | } | ||
| 529 | |||
| 530 | ✗ | bool EnergyManagementSystemOutputVariable::setEMSVariableName(const EnergyManagementSystemCurveOrTableIndexVariable& object) { | |
| 531 | ✗ | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->setEMSVariableName(object); | |
| 532 | } | ||
| 533 | |||
| 534 | ✗ | bool EnergyManagementSystemOutputVariable::setEMSVariableName(const EnergyManagementSystemConstructionIndexVariable& object) { | |
| 535 | ✗ | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->setEMSVariableName(object); | |
| 536 | } | ||
| 537 | |||
| 538 | 3 | bool EnergyManagementSystemOutputVariable::exportToBCVTB() const { | |
| 539 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->exportToBCVTB(); |
| 540 | } | ||
| 541 | |||
| 542 | 1 | bool EnergyManagementSystemOutputVariable::isExportToBCVTBDefaulted() const { | |
| 543 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->isExportToBCVTBDefaulted(); |
| 544 | } | ||
| 545 | |||
| 546 | 1 | bool EnergyManagementSystemOutputVariable::setExportToBCVTB(bool exportToBCVTB) { | |
| 547 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->setExportToBCVTB(exportToBCVTB); |
| 548 | } | ||
| 549 | |||
| 550 | 1 | void EnergyManagementSystemOutputVariable::resetExportToBCVTB() { | |
| 551 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::EnergyManagementSystemOutputVariable_Impl>()->resetExportToBCVTB(); |
| 552 | 1 | } | |
| 553 | |||
| 554 | /// @cond | ||
| 555 | 8 | EnergyManagementSystemOutputVariable::EnergyManagementSystemOutputVariable(std::shared_ptr<detail::EnergyManagementSystemOutputVariable_Impl> impl) | |
| 556 |
1/1✓ Branch 3 taken 8 times.
|
8 | : ModelObject(std::move(impl)) {} |
| 557 | /// @endcond | ||
| 558 | |||
| 559 | } // namespace model | ||
| 560 | } // namespace openstudio | ||
| 561 |