src/model/CurveQuadLinear.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 "CurveQuadLinear.hpp" | ||
| 7 | #include "CurveQuadLinear_Impl.hpp" | ||
| 8 | |||
| 9 | #include <utilities/idd/IddFactory.hxx> | ||
| 10 | #include <utilities/idd/IddEnums.hxx> | ||
| 11 | #include <utilities/idd/OS_Curve_QuadLinear_FieldEnums.hxx> | ||
| 12 | |||
| 13 | #include "../utilities/units/Unit.hpp" | ||
| 14 | |||
| 15 | #include "../utilities/core/Assert.hpp" | ||
| 16 | |||
| 17 | namespace openstudio { | ||
| 18 | namespace model { | ||
| 19 | |||
| 20 | namespace detail { | ||
| 21 | |||
| 22 | 125 | CurveQuadLinear_Impl::CurveQuadLinear_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 23 | 125 | : Curve_Impl(idfObject, model, keepHandle) { | |
| 24 |
4/6✓ Branch 1 taken 125 times.
✓ Branch 4 taken 125 times.
✓ Branch 7 taken 125 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 125 times.
✗ Branch 13 not taken.
|
125 | OS_ASSERT(idfObject.iddObject().type() == CurveQuadLinear::iddObjectType()); |
| 25 | 125 | } | |
| 26 | |||
| 27 | 40 | CurveQuadLinear_Impl::CurveQuadLinear_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 28 | 40 | : Curve_Impl(other, model, keepHandle) { | |
| 29 |
4/6✓ Branch 1 taken 40 times.
✓ Branch 4 taken 40 times.
✓ Branch 7 taken 40 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 40 times.
✗ Branch 13 not taken.
|
40 | OS_ASSERT(other.iddObject().type() == CurveQuadLinear::iddObjectType()); |
| 30 | 40 | } | |
| 31 | |||
| 32 | 37 | CurveQuadLinear_Impl::CurveQuadLinear_Impl(const CurveQuadLinear_Impl& other, Model_Impl* model, bool keepHandle) | |
| 33 | 37 | : Curve_Impl(other, model, keepHandle) {} | |
| 34 | |||
| 35 | ✗ | const std::vector<std::string>& CurveQuadLinear_Impl::outputVariableNames() const { | |
| 36 | ✗ | static std::vector<std::string> result; | |
| 37 | ✗ | if (result.empty()) { | |
| 38 | } | ||
| 39 | ✗ | return result; | |
| 40 | } | ||
| 41 | |||
| 42 | ✗ | IddObjectType CurveQuadLinear_Impl::iddObjectType() const { | |
| 43 | ✗ | return CurveQuadLinear::iddObjectType(); | |
| 44 | } | ||
| 45 | |||
| 46 | ✗ | int CurveQuadLinear_Impl::numVariables() const { | |
| 47 | ✗ | return 4; | |
| 48 | } | ||
| 49 | |||
| 50 | 1 | double CurveQuadLinear_Impl::evaluate(const std::vector<double>& independentVariables) const { | |
| 51 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | OS_ASSERT(independentVariables.size() == 4u); |
| 52 | |||
| 53 | 1 | double w = independentVariables[0]; | |
| 54 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (w < minimumValueofw()) { |
| 55 | ✗ | LOG(Warn, "Supplied w is below the minimumValueofw, resetting it."); | |
| 56 | ✗ | w = minimumValueofw(); | |
| 57 | } | ||
| 58 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (w > maximumValueofw()) { |
| 59 | ✗ | LOG(Warn, "Supplied w is above the maximumValueofw, resetting it."); | |
| 60 | ✗ | w = maximumValueofw(); | |
| 61 | } | ||
| 62 | |||
| 63 | 1 | double x = independentVariables[1]; | |
| 64 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (x < minimumValueofx()) { |
| 65 | ✗ | LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); | |
| 66 | ✗ | x = minimumValueofx(); | |
| 67 | } | ||
| 68 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (x > maximumValueofx()) { |
| 69 | ✗ | LOG(Warn, "Supplied x is above the maximumValueofx, resetting it."); | |
| 70 | ✗ | x = maximumValueofx(); | |
| 71 | } | ||
| 72 | |||
| 73 | 1 | double y = independentVariables[2]; | |
| 74 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (y < minimumValueofy()) { |
| 75 | ✗ | LOG(Warn, "Supplied y is below the minimumValueofy, resetting it."); | |
| 76 | ✗ | y = minimumValueofy(); | |
| 77 | } | ||
| 78 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (y > maximumValueofy()) { |
| 79 | ✗ | LOG(Warn, "Supplied y is above the maximumValueofy, resetting it."); | |
| 80 | ✗ | y = maximumValueofy(); | |
| 81 | } | ||
| 82 | |||
| 83 | 1 | double z = independentVariables[3]; | |
| 84 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (z < minimumValueofz()) { |
| 85 | ✗ | LOG(Warn, "Supplied z is below the minimumValueofz, resetting it."); | |
| 86 | ✗ | z = minimumValueofz(); | |
| 87 | } | ||
| 88 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (z > maximumValueofz()) { |
| 89 | ✗ | LOG(Warn, "Supplied z is above the maximumValueofz, resetting it."); | |
| 90 | ✗ | z = maximumValueofz(); | |
| 91 | } | ||
| 92 | |||
| 93 | // C1 + C2*w + C3*x + C4*y + C5*z | ||
| 94 | 1 | double result = coefficient1Constant(); | |
| 95 | 1 | result += coefficient2w() * w; | |
| 96 | 1 | result += coefficient3x() * x; | |
| 97 | 1 | result += coefficient4y() * y; | |
| 98 | 1 | result += coefficient5z() * z; | |
| 99 | |||
| 100 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | if (boost::optional<double> _minVal = minimumCurveOutput()) { |
| 101 | ✗ | double minVal = _minVal.get(); | |
| 102 | ✗ | if (result < minVal) { | |
| 103 | ✗ | LOG(Warn, "Calculated curve output is below minimumCurveOutput, resetting it."); | |
| 104 | ✗ | result = minVal; | |
| 105 | } | ||
| 106 | } | ||
| 107 | |||
| 108 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | if (boost::optional<double> _maxVal = maximumCurveOutput()) { |
| 109 | ✗ | double maxVal = _maxVal.get(); | |
| 110 | ✗ | if (result > maxVal) { | |
| 111 | ✗ | LOG(Warn, "Calculated curve output is above maximumCurveOutput, resetting it."); | |
| 112 | ✗ | result = maxVal; | |
| 113 | } | ||
| 114 | } | ||
| 115 | |||
| 116 | 1 | return result; | |
| 117 | } | ||
| 118 | |||
| 119 | 36 | double CurveQuadLinear_Impl::coefficient1Constant() const { | |
| 120 |
1/1✓ Branch 1 taken 36 times.
|
36 | boost::optional<double> value = getDouble(OS_Curve_QuadLinearFields::Coefficient1Constant, true); |
| 121 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 36 times.
✗ Branch 4 not taken.
|
36 | OS_ASSERT(value); |
| 122 |
1/1✓ Branch 1 taken 36 times.
|
72 | return value.get(); |
| 123 | } | ||
| 124 | |||
| 125 | 36 | double CurveQuadLinear_Impl::coefficient2w() const { | |
| 126 |
1/1✓ Branch 1 taken 36 times.
|
36 | boost::optional<double> value = getDouble(OS_Curve_QuadLinearFields::Coefficient2w, true); |
| 127 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 36 times.
✗ Branch 4 not taken.
|
36 | OS_ASSERT(value); |
| 128 |
1/1✓ Branch 1 taken 36 times.
|
72 | return value.get(); |
| 129 | } | ||
| 130 | |||
| 131 | 36 | double CurveQuadLinear_Impl::coefficient3x() const { | |
| 132 |
1/1✓ Branch 1 taken 36 times.
|
36 | boost::optional<double> value = getDouble(OS_Curve_QuadLinearFields::Coefficient3x, true); |
| 133 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 36 times.
✗ Branch 4 not taken.
|
36 | OS_ASSERT(value); |
| 134 |
1/1✓ Branch 1 taken 36 times.
|
72 | return value.get(); |
| 135 | } | ||
| 136 | |||
| 137 | 36 | double CurveQuadLinear_Impl::coefficient4y() const { | |
| 138 |
1/1✓ Branch 1 taken 36 times.
|
36 | boost::optional<double> value = getDouble(OS_Curve_QuadLinearFields::Coefficient4y, true); |
| 139 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 36 times.
✗ Branch 4 not taken.
|
36 | OS_ASSERT(value); |
| 140 |
1/1✓ Branch 1 taken 36 times.
|
72 | return value.get(); |
| 141 | } | ||
| 142 | |||
| 143 | 36 | double CurveQuadLinear_Impl::coefficient5z() const { | |
| 144 |
1/1✓ Branch 1 taken 36 times.
|
36 | boost::optional<double> value = getDouble(OS_Curve_QuadLinearFields::Coefficient5z, true); |
| 145 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 36 times.
✗ Branch 4 not taken.
|
36 | OS_ASSERT(value); |
| 146 |
1/1✓ Branch 1 taken 36 times.
|
72 | return value.get(); |
| 147 | } | ||
| 148 | |||
| 149 | 34 | double CurveQuadLinear_Impl::minimumValueofw() const { | |
| 150 |
1/1✓ Branch 1 taken 34 times.
|
34 | boost::optional<double> value = getDouble(OS_Curve_QuadLinearFields::MinimumValueofw, true); |
| 151 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✗ Branch 4 not taken.
|
34 | OS_ASSERT(value); |
| 152 |
1/1✓ Branch 1 taken 34 times.
|
68 | return value.get(); |
| 153 | } | ||
| 154 | |||
| 155 | 34 | double CurveQuadLinear_Impl::maximumValueofw() const { | |
| 156 |
1/1✓ Branch 1 taken 34 times.
|
34 | boost::optional<double> value = getDouble(OS_Curve_QuadLinearFields::MaximumValueofw, true); |
| 157 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✗ Branch 4 not taken.
|
34 | OS_ASSERT(value); |
| 158 |
1/1✓ Branch 1 taken 34 times.
|
68 | return value.get(); |
| 159 | } | ||
| 160 | |||
| 161 | 34 | double CurveQuadLinear_Impl::minimumValueofx() const { | |
| 162 |
1/1✓ Branch 1 taken 34 times.
|
34 | boost::optional<double> value = getDouble(OS_Curve_QuadLinearFields::MinimumValueofx, true); |
| 163 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✗ Branch 4 not taken.
|
34 | OS_ASSERT(value); |
| 164 |
1/1✓ Branch 1 taken 34 times.
|
68 | return value.get(); |
| 165 | } | ||
| 166 | |||
| 167 | 34 | double CurveQuadLinear_Impl::maximumValueofx() const { | |
| 168 |
1/1✓ Branch 1 taken 34 times.
|
34 | boost::optional<double> value = getDouble(OS_Curve_QuadLinearFields::MaximumValueofx, true); |
| 169 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✗ Branch 4 not taken.
|
34 | OS_ASSERT(value); |
| 170 |
1/1✓ Branch 1 taken 34 times.
|
68 | return value.get(); |
| 171 | } | ||
| 172 | |||
| 173 | 34 | double CurveQuadLinear_Impl::minimumValueofy() const { | |
| 174 |
1/1✓ Branch 1 taken 34 times.
|
34 | boost::optional<double> value = getDouble(OS_Curve_QuadLinearFields::MinimumValueofy, true); |
| 175 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✗ Branch 4 not taken.
|
34 | OS_ASSERT(value); |
| 176 |
1/1✓ Branch 1 taken 34 times.
|
68 | return value.get(); |
| 177 | } | ||
| 178 | |||
| 179 | 34 | double CurveQuadLinear_Impl::maximumValueofy() const { | |
| 180 |
1/1✓ Branch 1 taken 34 times.
|
34 | boost::optional<double> value = getDouble(OS_Curve_QuadLinearFields::MaximumValueofy, true); |
| 181 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✗ Branch 4 not taken.
|
34 | OS_ASSERT(value); |
| 182 |
1/1✓ Branch 1 taken 34 times.
|
68 | return value.get(); |
| 183 | } | ||
| 184 | |||
| 185 | 34 | double CurveQuadLinear_Impl::minimumValueofz() const { | |
| 186 |
1/1✓ Branch 1 taken 34 times.
|
34 | boost::optional<double> value = getDouble(OS_Curve_QuadLinearFields::MinimumValueofz, true); |
| 187 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✗ Branch 4 not taken.
|
34 | OS_ASSERT(value); |
| 188 |
1/1✓ Branch 1 taken 34 times.
|
68 | return value.get(); |
| 189 | } | ||
| 190 | |||
| 191 | 34 | double CurveQuadLinear_Impl::maximumValueofz() const { | |
| 192 |
1/1✓ Branch 1 taken 34 times.
|
34 | boost::optional<double> value = getDouble(OS_Curve_QuadLinearFields::MaximumValueofz, true); |
| 193 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✗ Branch 4 not taken.
|
34 | OS_ASSERT(value); |
| 194 |
1/1✓ Branch 1 taken 34 times.
|
68 | return value.get(); |
| 195 | } | ||
| 196 | |||
| 197 | 36 | boost::optional<double> CurveQuadLinear_Impl::minimumCurveOutput() const { | |
| 198 | 36 | return getDouble(OS_Curve_QuadLinearFields::MinimumCurveOutput, true); | |
| 199 | } | ||
| 200 | |||
| 201 | 36 | boost::optional<double> CurveQuadLinear_Impl::maximumCurveOutput() const { | |
| 202 | 36 | return getDouble(OS_Curve_QuadLinearFields::MaximumCurveOutput, true); | |
| 203 | } | ||
| 204 | |||
| 205 | 34 | std::string CurveQuadLinear_Impl::inputUnitTypeforw() const { | |
| 206 |
1/1✓ Branch 1 taken 34 times.
|
34 | boost::optional<std::string> value = getString(OS_Curve_QuadLinearFields::InputUnitTypeforw, true); |
| 207 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✗ Branch 4 not taken.
|
34 | OS_ASSERT(value); |
| 208 |
2/2✓ Branch 1 taken 34 times.
✓ Branch 4 taken 34 times.
|
68 | return value.get(); |
| 209 | 34 | } | |
| 210 | |||
| 211 | ✗ | bool CurveQuadLinear_Impl::isInputUnitTypeforwDefaulted() const { | |
| 212 | ✗ | return isEmpty(OS_Curve_QuadLinearFields::InputUnitTypeforw); | |
| 213 | } | ||
| 214 | |||
| 215 | 34 | std::string CurveQuadLinear_Impl::inputUnitTypeforx() const { | |
| 216 |
1/1✓ Branch 1 taken 34 times.
|
34 | boost::optional<std::string> value = getString(OS_Curve_QuadLinearFields::InputUnitTypeforx, true); |
| 217 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✗ Branch 4 not taken.
|
34 | OS_ASSERT(value); |
| 218 |
2/2✓ Branch 1 taken 34 times.
✓ Branch 4 taken 34 times.
|
68 | return value.get(); |
| 219 | 34 | } | |
| 220 | |||
| 221 | ✗ | bool CurveQuadLinear_Impl::isInputUnitTypeforxDefaulted() const { | |
| 222 | ✗ | return isEmpty(OS_Curve_QuadLinearFields::InputUnitTypeforx); | |
| 223 | } | ||
| 224 | |||
| 225 | 34 | std::string CurveQuadLinear_Impl::inputUnitTypefory() const { | |
| 226 |
1/1✓ Branch 1 taken 34 times.
|
34 | boost::optional<std::string> value = getString(OS_Curve_QuadLinearFields::InputUnitTypefory, true); |
| 227 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✗ Branch 4 not taken.
|
34 | OS_ASSERT(value); |
| 228 |
2/2✓ Branch 1 taken 34 times.
✓ Branch 4 taken 34 times.
|
68 | return value.get(); |
| 229 | 34 | } | |
| 230 | |||
| 231 | ✗ | bool CurveQuadLinear_Impl::isInputUnitTypeforyDefaulted() const { | |
| 232 | ✗ | return isEmpty(OS_Curve_QuadLinearFields::InputUnitTypefory); | |
| 233 | } | ||
| 234 | |||
| 235 | 34 | std::string CurveQuadLinear_Impl::inputUnitTypeforz() const { | |
| 236 |
1/1✓ Branch 1 taken 34 times.
|
34 | boost::optional<std::string> value = getString(OS_Curve_QuadLinearFields::InputUnitTypeforz, true); |
| 237 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✗ Branch 4 not taken.
|
34 | OS_ASSERT(value); |
| 238 |
2/2✓ Branch 1 taken 34 times.
✓ Branch 4 taken 34 times.
|
68 | return value.get(); |
| 239 | 34 | } | |
| 240 | |||
| 241 | ✗ | bool CurveQuadLinear_Impl::isInputUnitTypeforzDefaulted() const { | |
| 242 | ✗ | return isEmpty(OS_Curve_QuadLinearFields::InputUnitTypeforz); | |
| 243 | } | ||
| 244 | |||
| 245 | 162 | bool CurveQuadLinear_Impl::setCoefficient1Constant(double coefficient1Constant) { | |
| 246 | 162 | bool result = setDouble(OS_Curve_QuadLinearFields::Coefficient1Constant, coefficient1Constant); | |
| 247 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 162 times.
|
162 | OS_ASSERT(result); |
| 248 | 162 | return result; | |
| 249 | } | ||
| 250 | |||
| 251 | 162 | bool CurveQuadLinear_Impl::setCoefficient2w(double coefficient2w) { | |
| 252 | 162 | bool result = setDouble(OS_Curve_QuadLinearFields::Coefficient2w, coefficient2w); | |
| 253 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 162 times.
|
162 | OS_ASSERT(result); |
| 254 | 162 | return result; | |
| 255 | } | ||
| 256 | |||
| 257 | 162 | bool CurveQuadLinear_Impl::setCoefficient3x(double coefficient3x) { | |
| 258 | 162 | bool result = setDouble(OS_Curve_QuadLinearFields::Coefficient3x, coefficient3x); | |
| 259 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 162 times.
|
162 | OS_ASSERT(result); |
| 260 | 162 | return result; | |
| 261 | } | ||
| 262 | |||
| 263 | 162 | bool CurveQuadLinear_Impl::setCoefficient4y(double coefficient4y) { | |
| 264 | 162 | bool result = setDouble(OS_Curve_QuadLinearFields::Coefficient4y, coefficient4y); | |
| 265 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 162 times.
|
162 | OS_ASSERT(result); |
| 266 | 162 | return result; | |
| 267 | } | ||
| 268 | |||
| 269 | 162 | bool CurveQuadLinear_Impl::setCoefficient5z(double coefficient5z) { | |
| 270 | 162 | bool result = setDouble(OS_Curve_QuadLinearFields::Coefficient5z, coefficient5z); | |
| 271 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 162 times.
|
162 | OS_ASSERT(result); |
| 272 | 162 | return result; | |
| 273 | } | ||
| 274 | |||
| 275 | 89 | bool CurveQuadLinear_Impl::setMinimumValueofw(double minimumValueofw) { | |
| 276 | 89 | bool result = setDouble(OS_Curve_QuadLinearFields::MinimumValueofw, minimumValueofw); | |
| 277 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 89 times.
|
89 | OS_ASSERT(result); |
| 278 | 89 | return result; | |
| 279 | } | ||
| 280 | |||
| 281 | 89 | bool CurveQuadLinear_Impl::setMaximumValueofw(double maximumValueofw) { | |
| 282 | 89 | bool result = setDouble(OS_Curve_QuadLinearFields::MaximumValueofw, maximumValueofw); | |
| 283 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 89 times.
|
89 | OS_ASSERT(result); |
| 284 | 89 | return result; | |
| 285 | } | ||
| 286 | |||
| 287 | 89 | bool CurveQuadLinear_Impl::setMinimumValueofx(double minimumValueofx) { | |
| 288 | 89 | bool result = setDouble(OS_Curve_QuadLinearFields::MinimumValueofx, minimumValueofx); | |
| 289 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 89 times.
|
89 | OS_ASSERT(result); |
| 290 | 89 | return result; | |
| 291 | } | ||
| 292 | |||
| 293 | 89 | bool CurveQuadLinear_Impl::setMaximumValueofx(double maximumValueofx) { | |
| 294 | 89 | bool result = setDouble(OS_Curve_QuadLinearFields::MaximumValueofx, maximumValueofx); | |
| 295 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 89 times.
|
89 | OS_ASSERT(result); |
| 296 | 89 | return result; | |
| 297 | } | ||
| 298 | |||
| 299 | 90 | bool CurveQuadLinear_Impl::setMinimumValueofy(double minimumValueofy) { | |
| 300 | 90 | bool result = setDouble(OS_Curve_QuadLinearFields::MinimumValueofy, minimumValueofy); | |
| 301 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 90 times.
|
90 | OS_ASSERT(result); |
| 302 | 90 | return result; | |
| 303 | } | ||
| 304 | |||
| 305 | 90 | bool CurveQuadLinear_Impl::setMaximumValueofy(double maximumValueofy) { | |
| 306 | 90 | bool result = setDouble(OS_Curve_QuadLinearFields::MaximumValueofy, maximumValueofy); | |
| 307 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 90 times.
|
90 | OS_ASSERT(result); |
| 308 | 90 | return result; | |
| 309 | } | ||
| 310 | |||
| 311 | 88 | bool CurveQuadLinear_Impl::setMinimumValueofz(double minimumValueofz) { | |
| 312 | 88 | bool result = setDouble(OS_Curve_QuadLinearFields::MinimumValueofz, minimumValueofz); | |
| 313 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 88 times.
|
88 | OS_ASSERT(result); |
| 314 | 88 | return result; | |
| 315 | } | ||
| 316 | |||
| 317 | 88 | bool CurveQuadLinear_Impl::setMaximumValueofz(double maximumValueofz) { | |
| 318 | 88 | bool result = setDouble(OS_Curve_QuadLinearFields::MaximumValueofz, maximumValueofz); | |
| 319 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 88 times.
|
88 | OS_ASSERT(result); |
| 320 | 88 | return result; | |
| 321 | } | ||
| 322 | |||
| 323 | 4 | bool CurveQuadLinear_Impl::setMinimumCurveOutput(double minimumCurveOutput) { | |
| 324 | 4 | bool result = setDouble(OS_Curve_QuadLinearFields::MinimumCurveOutput, minimumCurveOutput); | |
| 325 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
4 | OS_ASSERT(result); |
| 326 | 4 | return result; | |
| 327 | } | ||
| 328 | |||
| 329 | ✗ | void CurveQuadLinear_Impl::resetMinimumCurveOutput() { | |
| 330 | ✗ | bool result = setString(OS_Curve_QuadLinearFields::MinimumCurveOutput, ""); | |
| 331 | ✗ | OS_ASSERT(result); | |
| 332 | ✗ | } | |
| 333 | |||
| 334 | 4 | bool CurveQuadLinear_Impl::setMaximumCurveOutput(double maximumCurveOutput) { | |
| 335 | 4 | bool result = setDouble(OS_Curve_QuadLinearFields::MaximumCurveOutput, maximumCurveOutput); | |
| 336 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
4 | OS_ASSERT(result); |
| 337 | 4 | return result; | |
| 338 | } | ||
| 339 | |||
| 340 | ✗ | void CurveQuadLinear_Impl::resetMaximumCurveOutput() { | |
| 341 | ✗ | bool result = setString(OS_Curve_QuadLinearFields::MaximumCurveOutput, ""); | |
| 342 | ✗ | OS_ASSERT(result); | |
| 343 | ✗ | } | |
| 344 | |||
| 345 | 5 | bool CurveQuadLinear_Impl::setInputUnitTypeforw(const std::string& inputUnitTypeforw) { | |
| 346 | 5 | bool result = setString(OS_Curve_QuadLinearFields::InputUnitTypeforw, inputUnitTypeforw); | |
| 347 | 5 | return result; | |
| 348 | } | ||
| 349 | |||
| 350 | ✗ | void CurveQuadLinear_Impl::resetInputUnitTypeforw() { | |
| 351 | ✗ | bool result = setString(OS_Curve_QuadLinearFields::InputUnitTypeforw, ""); | |
| 352 | ✗ | OS_ASSERT(result); | |
| 353 | ✗ | } | |
| 354 | |||
| 355 | 5 | bool CurveQuadLinear_Impl::setInputUnitTypeforx(const std::string& inputUnitTypeforx) { | |
| 356 | 5 | bool result = setString(OS_Curve_QuadLinearFields::InputUnitTypeforx, inputUnitTypeforx); | |
| 357 | 5 | return result; | |
| 358 | } | ||
| 359 | |||
| 360 | ✗ | void CurveQuadLinear_Impl::resetInputUnitTypeforx() { | |
| 361 | ✗ | bool result = setString(OS_Curve_QuadLinearFields::InputUnitTypeforx, ""); | |
| 362 | ✗ | OS_ASSERT(result); | |
| 363 | ✗ | } | |
| 364 | |||
| 365 | 5 | bool CurveQuadLinear_Impl::setInputUnitTypefory(const std::string& inputUnitTypefory) { | |
| 366 | 5 | bool result = setString(OS_Curve_QuadLinearFields::InputUnitTypefory, inputUnitTypefory); | |
| 367 | 5 | return result; | |
| 368 | } | ||
| 369 | |||
| 370 | ✗ | void CurveQuadLinear_Impl::resetInputUnitTypefory() { | |
| 371 | ✗ | bool result = setString(OS_Curve_QuadLinearFields::InputUnitTypefory, ""); | |
| 372 | ✗ | OS_ASSERT(result); | |
| 373 | ✗ | } | |
| 374 | |||
| 375 | 5 | bool CurveQuadLinear_Impl::setInputUnitTypeforz(const std::string& inputUnitTypeforz) { | |
| 376 | 5 | bool result = setString(OS_Curve_QuadLinearFields::InputUnitTypeforz, inputUnitTypeforz); | |
| 377 | 5 | return result; | |
| 378 | } | ||
| 379 | |||
| 380 | ✗ | void CurveQuadLinear_Impl::resetInputUnitTypeforz() { | |
| 381 | ✗ | bool result = setString(OS_Curve_QuadLinearFields::InputUnitTypeforz, ""); | |
| 382 | ✗ | OS_ASSERT(result); | |
| 383 | ✗ | } | |
| 384 | |||
| 385 | } // namespace detail | ||
| 386 | |||
| 387 | 85 | CurveQuadLinear::CurveQuadLinear(const Model& model) : Curve(CurveQuadLinear::iddObjectType(), model) { | |
| 388 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 85 times.
✗ Branch 5 not taken.
|
85 | OS_ASSERT(getImpl<detail::CurveQuadLinear_Impl>()); |
| 389 | |||
| 390 |
1/1✓ Branch 1 taken 85 times.
|
85 | setCoefficient1Constant(0.0); |
| 391 |
1/1✓ Branch 1 taken 85 times.
|
85 | setCoefficient2w(1.0); |
| 392 |
1/1✓ Branch 1 taken 85 times.
|
85 | setCoefficient3x(1.0); |
| 393 |
1/1✓ Branch 1 taken 85 times.
|
85 | setCoefficient4y(1.0); |
| 394 |
1/1✓ Branch 1 taken 85 times.
|
85 | setCoefficient5z(1.0); |
| 395 |
1/1✓ Branch 1 taken 85 times.
|
85 | setMinimumValueofw(-100.0); |
| 396 |
1/1✓ Branch 1 taken 85 times.
|
85 | setMaximumValueofw(100.0); |
| 397 |
1/1✓ Branch 1 taken 85 times.
|
85 | setMinimumValueofx(-100.0); |
| 398 |
1/1✓ Branch 1 taken 85 times.
|
85 | setMaximumValueofx(100.0); |
| 399 |
1/1✓ Branch 1 taken 85 times.
|
85 | setMinimumValueofy(0.0); |
| 400 |
1/1✓ Branch 1 taken 85 times.
|
85 | setMaximumValueofy(100.0); |
| 401 |
1/1✓ Branch 1 taken 85 times.
|
85 | setMinimumValueofz(0.0); |
| 402 |
1/1✓ Branch 1 taken 85 times.
|
85 | setMaximumValueofz(100.0); |
| 403 | 85 | } | |
| 404 | |||
| 405 | 7849 | IddObjectType CurveQuadLinear::iddObjectType() { | |
| 406 |
1/1✓ Branch 1 taken 7849 times.
|
7849 | return {IddObjectType::OS_Curve_QuadLinear}; |
| 407 | } | ||
| 408 | |||
| 409 | ✗ | std::vector<std::string> CurveQuadLinear::inputUnitTypeforwValues() { | |
| 410 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_Curve_QuadLinearFields::InputUnitTypeforw); | |
| 411 | } | ||
| 412 | |||
| 413 | ✗ | std::vector<std::string> CurveQuadLinear::inputUnitTypeforxValues() { | |
| 414 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_Curve_QuadLinearFields::InputUnitTypeforx); | |
| 415 | } | ||
| 416 | |||
| 417 | ✗ | std::vector<std::string> CurveQuadLinear::inputUnitTypeforyValues() { | |
| 418 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_Curve_QuadLinearFields::InputUnitTypefory); | |
| 419 | } | ||
| 420 | |||
| 421 | ✗ | std::vector<std::string> CurveQuadLinear::inputUnitTypeforzValues() { | |
| 422 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_Curve_QuadLinearFields::InputUnitTypeforz); | |
| 423 | } | ||
| 424 | |||
| 425 | 35 | double CurveQuadLinear::coefficient1Constant() const { | |
| 426 |
1/1✓ Branch 3 taken 35 times.
|
35 | return getImpl<detail::CurveQuadLinear_Impl>()->coefficient1Constant(); |
| 427 | } | ||
| 428 | |||
| 429 | 35 | double CurveQuadLinear::coefficient2w() const { | |
| 430 |
1/1✓ Branch 3 taken 35 times.
|
35 | return getImpl<detail::CurveQuadLinear_Impl>()->coefficient2w(); |
| 431 | } | ||
| 432 | |||
| 433 | 35 | double CurveQuadLinear::coefficient3x() const { | |
| 434 |
1/1✓ Branch 3 taken 35 times.
|
35 | return getImpl<detail::CurveQuadLinear_Impl>()->coefficient3x(); |
| 435 | } | ||
| 436 | |||
| 437 | 35 | double CurveQuadLinear::coefficient4y() const { | |
| 438 |
1/1✓ Branch 3 taken 35 times.
|
35 | return getImpl<detail::CurveQuadLinear_Impl>()->coefficient4y(); |
| 439 | } | ||
| 440 | |||
| 441 | 35 | double CurveQuadLinear::coefficient5z() const { | |
| 442 |
1/1✓ Branch 3 taken 35 times.
|
35 | return getImpl<detail::CurveQuadLinear_Impl>()->coefficient5z(); |
| 443 | } | ||
| 444 | |||
| 445 | 33 | double CurveQuadLinear::minimumValueofw() const { | |
| 446 |
1/1✓ Branch 3 taken 33 times.
|
33 | return getImpl<detail::CurveQuadLinear_Impl>()->minimumValueofw(); |
| 447 | } | ||
| 448 | |||
| 449 | 33 | double CurveQuadLinear::maximumValueofw() const { | |
| 450 |
1/1✓ Branch 3 taken 33 times.
|
33 | return getImpl<detail::CurveQuadLinear_Impl>()->maximumValueofw(); |
| 451 | } | ||
| 452 | |||
| 453 | 33 | double CurveQuadLinear::minimumValueofx() const { | |
| 454 |
1/1✓ Branch 3 taken 33 times.
|
33 | return getImpl<detail::CurveQuadLinear_Impl>()->minimumValueofx(); |
| 455 | } | ||
| 456 | |||
| 457 | 33 | double CurveQuadLinear::maximumValueofx() const { | |
| 458 |
1/1✓ Branch 3 taken 33 times.
|
33 | return getImpl<detail::CurveQuadLinear_Impl>()->maximumValueofx(); |
| 459 | } | ||
| 460 | |||
| 461 | 33 | double CurveQuadLinear::minimumValueofy() const { | |
| 462 |
1/1✓ Branch 3 taken 33 times.
|
33 | return getImpl<detail::CurveQuadLinear_Impl>()->minimumValueofy(); |
| 463 | } | ||
| 464 | |||
| 465 | 33 | double CurveQuadLinear::maximumValueofy() const { | |
| 466 |
1/1✓ Branch 3 taken 33 times.
|
33 | return getImpl<detail::CurveQuadLinear_Impl>()->maximumValueofy(); |
| 467 | } | ||
| 468 | |||
| 469 | 33 | double CurveQuadLinear::minimumValueofz() const { | |
| 470 |
1/1✓ Branch 3 taken 33 times.
|
33 | return getImpl<detail::CurveQuadLinear_Impl>()->minimumValueofz(); |
| 471 | } | ||
| 472 | |||
| 473 | 33 | double CurveQuadLinear::maximumValueofz() const { | |
| 474 |
1/1✓ Branch 3 taken 33 times.
|
33 | return getImpl<detail::CurveQuadLinear_Impl>()->maximumValueofz(); |
| 475 | } | ||
| 476 | |||
| 477 | 35 | boost::optional<double> CurveQuadLinear::minimumCurveOutput() const { | |
| 478 |
1/1✓ Branch 3 taken 35 times.
|
35 | return getImpl<detail::CurveQuadLinear_Impl>()->minimumCurveOutput(); |
| 479 | } | ||
| 480 | |||
| 481 | 35 | boost::optional<double> CurveQuadLinear::maximumCurveOutput() const { | |
| 482 |
1/1✓ Branch 3 taken 35 times.
|
35 | return getImpl<detail::CurveQuadLinear_Impl>()->maximumCurveOutput(); |
| 483 | } | ||
| 484 | |||
| 485 | 34 | std::string CurveQuadLinear::inputUnitTypeforw() const { | |
| 486 |
1/1✓ Branch 3 taken 34 times.
|
34 | return getImpl<detail::CurveQuadLinear_Impl>()->inputUnitTypeforw(); |
| 487 | } | ||
| 488 | |||
| 489 | ✗ | bool CurveQuadLinear::isInputUnitTypeforwDefaulted() const { | |
| 490 | ✗ | return getImpl<detail::CurveQuadLinear_Impl>()->isInputUnitTypeforwDefaulted(); | |
| 491 | } | ||
| 492 | |||
| 493 | 34 | std::string CurveQuadLinear::inputUnitTypeforx() const { | |
| 494 |
1/1✓ Branch 3 taken 34 times.
|
34 | return getImpl<detail::CurveQuadLinear_Impl>()->inputUnitTypeforx(); |
| 495 | } | ||
| 496 | |||
| 497 | ✗ | bool CurveQuadLinear::isInputUnitTypeforxDefaulted() const { | |
| 498 | ✗ | return getImpl<detail::CurveQuadLinear_Impl>()->isInputUnitTypeforxDefaulted(); | |
| 499 | } | ||
| 500 | |||
| 501 | 34 | std::string CurveQuadLinear::inputUnitTypefory() const { | |
| 502 |
1/1✓ Branch 3 taken 34 times.
|
34 | return getImpl<detail::CurveQuadLinear_Impl>()->inputUnitTypefory(); |
| 503 | } | ||
| 504 | |||
| 505 | ✗ | bool CurveQuadLinear::isInputUnitTypeforyDefaulted() const { | |
| 506 | ✗ | return getImpl<detail::CurveQuadLinear_Impl>()->isInputUnitTypeforyDefaulted(); | |
| 507 | } | ||
| 508 | |||
| 509 | 34 | std::string CurveQuadLinear::inputUnitTypeforz() const { | |
| 510 |
1/1✓ Branch 3 taken 34 times.
|
34 | return getImpl<detail::CurveQuadLinear_Impl>()->inputUnitTypeforz(); |
| 511 | } | ||
| 512 | |||
| 513 | ✗ | bool CurveQuadLinear::isInputUnitTypeforzDefaulted() const { | |
| 514 | ✗ | return getImpl<detail::CurveQuadLinear_Impl>()->isInputUnitTypeforzDefaulted(); | |
| 515 | } | ||
| 516 | |||
| 517 | 162 | bool CurveQuadLinear::setCoefficient1Constant(double coefficient1Constant) { | |
| 518 |
1/1✓ Branch 3 taken 162 times.
|
162 | return getImpl<detail::CurveQuadLinear_Impl>()->setCoefficient1Constant(coefficient1Constant); |
| 519 | } | ||
| 520 | |||
| 521 | 162 | bool CurveQuadLinear::setCoefficient2w(double coefficient2w) { | |
| 522 |
1/1✓ Branch 3 taken 162 times.
|
162 | return getImpl<detail::CurveQuadLinear_Impl>()->setCoefficient2w(coefficient2w); |
| 523 | } | ||
| 524 | |||
| 525 | 162 | bool CurveQuadLinear::setCoefficient3x(double coefficient3x) { | |
| 526 |
1/1✓ Branch 3 taken 162 times.
|
162 | return getImpl<detail::CurveQuadLinear_Impl>()->setCoefficient3x(coefficient3x); |
| 527 | } | ||
| 528 | |||
| 529 | 162 | bool CurveQuadLinear::setCoefficient4y(double coefficient4y) { | |
| 530 |
1/1✓ Branch 3 taken 162 times.
|
162 | return getImpl<detail::CurveQuadLinear_Impl>()->setCoefficient4y(coefficient4y); |
| 531 | } | ||
| 532 | |||
| 533 | 162 | bool CurveQuadLinear::setCoefficient5z(double coefficient5z) { | |
| 534 |
1/1✓ Branch 3 taken 162 times.
|
162 | return getImpl<detail::CurveQuadLinear_Impl>()->setCoefficient5z(coefficient5z); |
| 535 | } | ||
| 536 | |||
| 537 | 89 | bool CurveQuadLinear::setMinimumValueofw(double minimumValueofw) { | |
| 538 |
1/1✓ Branch 3 taken 89 times.
|
89 | return getImpl<detail::CurveQuadLinear_Impl>()->setMinimumValueofw(minimumValueofw); |
| 539 | } | ||
| 540 | |||
| 541 | 89 | bool CurveQuadLinear::setMaximumValueofw(double maximumValueofw) { | |
| 542 |
1/1✓ Branch 3 taken 89 times.
|
89 | return getImpl<detail::CurveQuadLinear_Impl>()->setMaximumValueofw(maximumValueofw); |
| 543 | } | ||
| 544 | |||
| 545 | 89 | bool CurveQuadLinear::setMinimumValueofx(double minimumValueofx) { | |
| 546 |
1/1✓ Branch 3 taken 89 times.
|
89 | return getImpl<detail::CurveQuadLinear_Impl>()->setMinimumValueofx(minimumValueofx); |
| 547 | } | ||
| 548 | |||
| 549 | 89 | bool CurveQuadLinear::setMaximumValueofx(double maximumValueofx) { | |
| 550 |
1/1✓ Branch 3 taken 89 times.
|
89 | return getImpl<detail::CurveQuadLinear_Impl>()->setMaximumValueofx(maximumValueofx); |
| 551 | } | ||
| 552 | |||
| 553 | 90 | bool CurveQuadLinear::setMinimumValueofy(double minimumValueofy) { | |
| 554 |
1/1✓ Branch 3 taken 90 times.
|
90 | return getImpl<detail::CurveQuadLinear_Impl>()->setMinimumValueofy(minimumValueofy); |
| 555 | } | ||
| 556 | |||
| 557 | 90 | bool CurveQuadLinear::setMaximumValueofy(double maximumValueofy) { | |
| 558 |
1/1✓ Branch 3 taken 90 times.
|
90 | return getImpl<detail::CurveQuadLinear_Impl>()->setMaximumValueofy(maximumValueofy); |
| 559 | } | ||
| 560 | |||
| 561 | 88 | bool CurveQuadLinear::setMinimumValueofz(double minimumValueofz) { | |
| 562 |
1/1✓ Branch 3 taken 88 times.
|
88 | return getImpl<detail::CurveQuadLinear_Impl>()->setMinimumValueofz(minimumValueofz); |
| 563 | } | ||
| 564 | |||
| 565 | 88 | bool CurveQuadLinear::setMaximumValueofz(double maximumValueofz) { | |
| 566 |
1/1✓ Branch 3 taken 88 times.
|
88 | return getImpl<detail::CurveQuadLinear_Impl>()->setMaximumValueofz(maximumValueofz); |
| 567 | } | ||
| 568 | |||
| 569 | 4 | bool CurveQuadLinear::setMinimumCurveOutput(double minimumCurveOutput) { | |
| 570 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::CurveQuadLinear_Impl>()->setMinimumCurveOutput(minimumCurveOutput); |
| 571 | } | ||
| 572 | |||
| 573 | ✗ | void CurveQuadLinear::resetMinimumCurveOutput() { | |
| 574 | ✗ | return getImpl<detail::CurveQuadLinear_Impl>()->resetMinimumCurveOutput(); | |
| 575 | } | ||
| 576 | |||
| 577 | 4 | bool CurveQuadLinear::setMaximumCurveOutput(double maximumCurveOutput) { | |
| 578 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::CurveQuadLinear_Impl>()->setMaximumCurveOutput(maximumCurveOutput); |
| 579 | } | ||
| 580 | |||
| 581 | ✗ | void CurveQuadLinear::resetMaximumCurveOutput() { | |
| 582 | ✗ | getImpl<detail::CurveQuadLinear_Impl>()->resetMaximumCurveOutput(); | |
| 583 | ✗ | } | |
| 584 | |||
| 585 | 5 | bool CurveQuadLinear::setInputUnitTypeforw(const std::string& inputUnitTypeforw) { | |
| 586 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::CurveQuadLinear_Impl>()->setInputUnitTypeforw(inputUnitTypeforw); |
| 587 | } | ||
| 588 | |||
| 589 | ✗ | void CurveQuadLinear::resetInputUnitTypeforw() { | |
| 590 | ✗ | getImpl<detail::CurveQuadLinear_Impl>()->resetInputUnitTypeforw(); | |
| 591 | ✗ | } | |
| 592 | |||
| 593 | 5 | bool CurveQuadLinear::setInputUnitTypeforx(const std::string& inputUnitTypeforx) { | |
| 594 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::CurveQuadLinear_Impl>()->setInputUnitTypeforx(inputUnitTypeforx); |
| 595 | } | ||
| 596 | |||
| 597 | ✗ | void CurveQuadLinear::resetInputUnitTypeforx() { | |
| 598 | ✗ | getImpl<detail::CurveQuadLinear_Impl>()->resetInputUnitTypeforx(); | |
| 599 | ✗ | } | |
| 600 | |||
| 601 | 5 | bool CurveQuadLinear::setInputUnitTypefory(const std::string& inputUnitTypefory) { | |
| 602 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::CurveQuadLinear_Impl>()->setInputUnitTypefory(inputUnitTypefory); |
| 603 | } | ||
| 604 | |||
| 605 | ✗ | void CurveQuadLinear::resetInputUnitTypefory() { | |
| 606 | ✗ | getImpl<detail::CurveQuadLinear_Impl>()->resetInputUnitTypefory(); | |
| 607 | ✗ | } | |
| 608 | |||
| 609 | 5 | bool CurveQuadLinear::setInputUnitTypeforz(const std::string& inputUnitTypeforz) { | |
| 610 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::CurveQuadLinear_Impl>()->setInputUnitTypeforz(inputUnitTypeforz); |
| 611 | } | ||
| 612 | |||
| 613 | ✗ | void CurveQuadLinear::resetInputUnitTypeforz() { | |
| 614 | ✗ | getImpl<detail::CurveQuadLinear_Impl>()->resetInputUnitTypeforz(); | |
| 615 | ✗ | } | |
| 616 | |||
| 617 | /// @cond | ||
| 618 |
1/1✓ Branch 2 taken 68 times.
|
68 | CurveQuadLinear::CurveQuadLinear(std::shared_ptr<detail::CurveQuadLinear_Impl> impl) : Curve(impl) {} |
| 619 | /// @endcond | ||
| 620 | |||
| 621 | } // namespace model | ||
| 622 | } // namespace openstudio | ||
| 623 |