src/model/CurveBiquadratic.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 "CurveBiquadratic.hpp" | ||
| 7 | #include "CurveBiquadratic_Impl.hpp" | ||
| 8 | |||
| 9 | #include <utilities/idd/IddFactory.hxx> | ||
| 10 | |||
| 11 | #include <utilities/idd/OS_Curve_Biquadratic_FieldEnums.hxx> | ||
| 12 | #include <utilities/idd/IddEnums.hxx> | ||
| 13 | |||
| 14 | #include "../utilities/core/Assert.hpp" | ||
| 15 | |||
| 16 | #include <cmath> | ||
| 17 | |||
| 18 | using namespace std; | ||
| 19 | |||
| 20 | namespace openstudio { | ||
| 21 | namespace model { | ||
| 22 | |||
| 23 | namespace detail { | ||
| 24 | |||
| 25 | 2538 | CurveBiquadratic_Impl::CurveBiquadratic_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 26 | 2538 | : Curve_Impl(idfObject, model, keepHandle) { | |
| 27 |
4/6✓ Branch 1 taken 2538 times.
✓ Branch 4 taken 2538 times.
✓ Branch 7 taken 2538 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 2538 times.
✗ Branch 13 not taken.
|
2538 | OS_ASSERT(idfObject.iddObject().type() == CurveBiquadratic::iddObjectType()); |
| 28 | 2538 | } | |
| 29 | |||
| 30 | 302 | CurveBiquadratic_Impl::CurveBiquadratic_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 31 | 302 | : Curve_Impl(other, model, keepHandle) { | |
| 32 |
4/6✓ Branch 1 taken 302 times.
✓ Branch 4 taken 302 times.
✓ Branch 7 taken 302 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 302 times.
✗ Branch 13 not taken.
|
302 | OS_ASSERT(other.iddObject().type() == CurveBiquadratic::iddObjectType()); |
| 33 | 302 | } | |
| 34 | |||
| 35 | 1702 | CurveBiquadratic_Impl::CurveBiquadratic_Impl(const CurveBiquadratic_Impl& other, Model_Impl* model, bool keepHandle) | |
| 36 | 1702 | : Curve_Impl(other, model, keepHandle) {} | |
| 37 | |||
| 38 | 2 | const std::vector<std::string>& CurveBiquadratic_Impl::outputVariableNames() const { | |
| 39 | static const std::vector<std::string> result{"Performance Curve Output Value", "Performance Curve Input Variable 1 Value", | ||
| 40 |
6/11✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 time.
✓ Branch 10 taken 3 times.
✓ Branch 11 taken 1 time.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
|
7 | "Performance Curve Input Variable 2 Value"}; |
| 41 | 2 | return result; | |
| 42 | 3 | } | |
| 43 | |||
| 44 | 2 | IddObjectType CurveBiquadratic_Impl::iddObjectType() const { | |
| 45 | 2 | return CurveBiquadratic::iddObjectType(); | |
| 46 | } | ||
| 47 | |||
| 48 | 2 | int CurveBiquadratic_Impl::numVariables() const { | |
| 49 | 2 | return 2u; | |
| 50 | } | ||
| 51 | |||
| 52 | 16 | double CurveBiquadratic_Impl::evaluate(const std::vector<double>& independentVariables) const { | |
| 53 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 16 times.
|
16 | OS_ASSERT(independentVariables.size() == 2u); |
| 54 | |||
| 55 | 16 | double x = independentVariables[0]; | |
| 56 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 2 taken 12 times.
|
16 | if (x < minimumValueofx()) { |
| 57 |
5/5✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
|
4 | LOG(Warn, "Supplied x is below the minimumValueofx, resetting it."); |
| 58 | 4 | x = minimumValueofx(); | |
| 59 | } | ||
| 60 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 2 taken 12 times.
|
16 | if (x > maximumValueofx()) { |
| 61 |
5/5✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
|
4 | LOG(Warn, "Supplied x is above the maximumValueofx, resetting it."); |
| 62 | 4 | x = maximumValueofx(); | |
| 63 | } | ||
| 64 | |||
| 65 | 16 | double y = independentVariables[1]; | |
| 66 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 2 taken 12 times.
|
16 | if (y < minimumValueofy()) { |
| 67 |
5/5✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
|
4 | LOG(Warn, "Supplied y is below the minimumValueofy, resetting it."); |
| 68 | 4 | y = minimumValueofy(); | |
| 69 | } | ||
| 70 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 2 taken 12 times.
|
16 | if (y > maximumValueofy()) { |
| 71 |
5/5✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
|
4 | LOG(Warn, "Supplied y is above the maximumValueofy, resetting it."); |
| 72 | 4 | y = maximumValueofy(); | |
| 73 | } | ||
| 74 | |||
| 75 | 16 | double result = coefficient1Constant(); | |
| 76 | 16 | result += coefficient2x() * x; | |
| 77 | 16 | result += coefficient3xPOW2() * std::pow(x, 2); | |
| 78 | 16 | result += coefficient4y() * y; | |
| 79 | 16 | result += coefficient5yPOW2() * std::pow(y, 2); | |
| 80 | 16 | result += coefficient6xTIMESY() * x * y; | |
| 81 | |||
| 82 |
3/3✓ Branch 1 taken 16 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 14 times.
|
32 | if (boost::optional<double> _minVal = minimumCurveOutput()) { |
| 83 |
1/1✓ Branch 1 taken 2 times.
|
2 | double minVal = _minVal.get(); |
| 84 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
|
2 | if (result < minVal) { |
| 85 |
5/5✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
|
1 | LOG(Warn, "Calculated curve output is below minimumCurveOutput, resetting it."); |
| 86 | 1 | result = minVal; | |
| 87 | } | ||
| 88 | } | ||
| 89 | |||
| 90 |
3/3✓ Branch 1 taken 16 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 14 times.
|
32 | if (boost::optional<double> _maxVal = maximumCurveOutput()) { |
| 91 |
1/1✓ Branch 1 taken 2 times.
|
2 | double maxVal = _maxVal.get(); |
| 92 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
|
2 | if (result > maxVal) { |
| 93 |
5/5✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
|
1 | LOG(Warn, "Calculated curve output is above maximumCurveOutput, resetting it."); |
| 94 | 1 | result = maxVal; | |
| 95 | } | ||
| 96 | } | ||
| 97 | |||
| 98 | 16 | return result; | |
| 99 | } | ||
| 100 | |||
| 101 | 1087 | double CurveBiquadratic_Impl::coefficient1Constant() const { | |
| 102 |
1/1✓ Branch 1 taken 1087 times.
|
1087 | boost::optional<double> value = getDouble(OS_Curve_BiquadraticFields::Coefficient1Constant, true); |
| 103 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 1087 times.
✗ Branch 4 not taken.
|
1087 | OS_ASSERT(value); |
| 104 |
1/1✓ Branch 1 taken 1087 times.
|
2174 | return value.get(); |
| 105 | } | ||
| 106 | |||
| 107 | 1074 | double CurveBiquadratic_Impl::coefficient2x() const { | |
| 108 |
1/1✓ Branch 1 taken 1074 times.
|
1074 | boost::optional<double> value = getDouble(OS_Curve_BiquadraticFields::Coefficient2x, true); |
| 109 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 1074 times.
✗ Branch 4 not taken.
|
1074 | OS_ASSERT(value); |
| 110 |
1/1✓ Branch 1 taken 1074 times.
|
2148 | return value.get(); |
| 111 | } | ||
| 112 | |||
| 113 | 1074 | double CurveBiquadratic_Impl::coefficient3xPOW2() const { | |
| 114 |
1/1✓ Branch 1 taken 1074 times.
|
1074 | boost::optional<double> value = getDouble(OS_Curve_BiquadraticFields::Coefficient3x_POW_2, true); |
| 115 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 1074 times.
✗ Branch 4 not taken.
|
1074 | OS_ASSERT(value); |
| 116 |
1/1✓ Branch 1 taken 1074 times.
|
2148 | return value.get(); |
| 117 | } | ||
| 118 | |||
| 119 | 1074 | double CurveBiquadratic_Impl::coefficient4y() const { | |
| 120 |
1/1✓ Branch 1 taken 1074 times.
|
1074 | boost::optional<double> value = getDouble(OS_Curve_BiquadraticFields::Coefficient4y, true); |
| 121 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 1074 times.
✗ Branch 4 not taken.
|
1074 | OS_ASSERT(value); |
| 122 |
1/1✓ Branch 1 taken 1074 times.
|
2148 | return value.get(); |
| 123 | } | ||
| 124 | |||
| 125 | 1074 | double CurveBiquadratic_Impl::coefficient5yPOW2() const { | |
| 126 |
1/1✓ Branch 1 taken 1074 times.
|
1074 | boost::optional<double> value = getDouble(OS_Curve_BiquadraticFields::Coefficient5y_POW_2, true); |
| 127 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 1074 times.
✗ Branch 4 not taken.
|
1074 | OS_ASSERT(value); |
| 128 |
1/1✓ Branch 1 taken 1074 times.
|
2148 | return value.get(); |
| 129 | } | ||
| 130 | |||
| 131 | 1075 | double CurveBiquadratic_Impl::coefficient6xTIMESY() const { | |
| 132 |
1/1✓ Branch 1 taken 1075 times.
|
1075 | boost::optional<double> value = getDouble(OS_Curve_BiquadraticFields::Coefficient6x_TIMES_y, true); |
| 133 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 1075 times.
✗ Branch 4 not taken.
|
1075 | OS_ASSERT(value); |
| 134 |
1/1✓ Branch 1 taken 1075 times.
|
2150 | return value.get(); |
| 135 | } | ||
| 136 | |||
| 137 | 1078 | double CurveBiquadratic_Impl::minimumValueofx() const { | |
| 138 |
1/1✓ Branch 1 taken 1078 times.
|
1078 | boost::optional<double> value = getDouble(OS_Curve_BiquadraticFields::MinimumValueofx, true); |
| 139 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 1078 times.
✗ Branch 4 not taken.
|
1078 | OS_ASSERT(value); |
| 140 |
1/1✓ Branch 1 taken 1078 times.
|
2156 | return value.get(); |
| 141 | } | ||
| 142 | |||
| 143 | 1078 | double CurveBiquadratic_Impl::maximumValueofx() const { | |
| 144 |
1/1✓ Branch 1 taken 1078 times.
|
1078 | boost::optional<double> value = getDouble(OS_Curve_BiquadraticFields::MaximumValueofx, true); |
| 145 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 1078 times.
✗ Branch 4 not taken.
|
1078 | OS_ASSERT(value); |
| 146 |
1/1✓ Branch 1 taken 1078 times.
|
2156 | return value.get(); |
| 147 | } | ||
| 148 | |||
| 149 | 1078 | double CurveBiquadratic_Impl::minimumValueofy() const { | |
| 150 |
1/1✓ Branch 1 taken 1078 times.
|
1078 | boost::optional<double> value = getDouble(OS_Curve_BiquadraticFields::MinimumValueofy, true); |
| 151 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 1078 times.
✗ Branch 4 not taken.
|
1078 | OS_ASSERT(value); |
| 152 |
1/1✓ Branch 1 taken 1078 times.
|
2156 | return value.get(); |
| 153 | } | ||
| 154 | |||
| 155 | 1078 | double CurveBiquadratic_Impl::maximumValueofy() const { | |
| 156 |
1/1✓ Branch 1 taken 1078 times.
|
1078 | boost::optional<double> value = getDouble(OS_Curve_BiquadraticFields::MaximumValueofy, true); |
| 157 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 1078 times.
✗ Branch 4 not taken.
|
1078 | OS_ASSERT(value); |
| 158 |
1/1✓ Branch 1 taken 1078 times.
|
2156 | return value.get(); |
| 159 | } | ||
| 160 | |||
| 161 | 1075 | boost::optional<double> CurveBiquadratic_Impl::minimumCurveOutput() const { | |
| 162 | 1075 | return getDouble(OS_Curve_BiquadraticFields::MinimumCurveOutput, true); | |
| 163 | } | ||
| 164 | |||
| 165 | 1075 | boost::optional<double> CurveBiquadratic_Impl::maximumCurveOutput() const { | |
| 166 | 1075 | return getDouble(OS_Curve_BiquadraticFields::MaximumCurveOutput, true); | |
| 167 | } | ||
| 168 | |||
| 169 | 148 | std::string CurveBiquadratic_Impl::inputUnitTypeforX() const { | |
| 170 |
1/1✓ Branch 1 taken 148 times.
|
148 | boost::optional<std::string> value = getString(OS_Curve_BiquadraticFields::InputUnitTypeforX, true); |
| 171 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 148 times.
✗ Branch 4 not taken.
|
148 | OS_ASSERT(value); |
| 172 |
2/2✓ Branch 1 taken 148 times.
✓ Branch 4 taken 148 times.
|
296 | return value.get(); |
| 173 | 148 | } | |
| 174 | |||
| 175 | 1056 | bool CurveBiquadratic_Impl::isInputUnitTypeforXDefaulted() const { | |
| 176 | 1056 | return isEmpty(OS_Curve_BiquadraticFields::InputUnitTypeforX); | |
| 177 | } | ||
| 178 | |||
| 179 | 148 | std::string CurveBiquadratic_Impl::inputUnitTypeforY() const { | |
| 180 |
1/1✓ Branch 1 taken 148 times.
|
148 | boost::optional<std::string> value = getString(OS_Curve_BiquadraticFields::InputUnitTypeforY, true); |
| 181 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 148 times.
✗ Branch 4 not taken.
|
148 | OS_ASSERT(value); |
| 182 |
2/2✓ Branch 1 taken 148 times.
✓ Branch 4 taken 148 times.
|
296 | return value.get(); |
| 183 | 148 | } | |
| 184 | |||
| 185 | 1056 | bool CurveBiquadratic_Impl::isInputUnitTypeforYDefaulted() const { | |
| 186 | 1056 | return isEmpty(OS_Curve_BiquadraticFields::InputUnitTypeforY); | |
| 187 | } | ||
| 188 | |||
| 189 | 120 | std::string CurveBiquadratic_Impl::outputUnitType() const { | |
| 190 |
1/1✓ Branch 1 taken 120 times.
|
120 | boost::optional<std::string> value = getString(OS_Curve_BiquadraticFields::OutputUnitType, true); |
| 191 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 120 times.
✗ Branch 4 not taken.
|
120 | OS_ASSERT(value); |
| 192 |
2/2✓ Branch 1 taken 120 times.
✓ Branch 4 taken 120 times.
|
240 | return value.get(); |
| 193 | 120 | } | |
| 194 | |||
| 195 | 1056 | bool CurveBiquadratic_Impl::isOutputUnitTypeDefaulted() const { | |
| 196 | 1056 | return isEmpty(OS_Curve_BiquadraticFields::OutputUnitType); | |
| 197 | } | ||
| 198 | |||
| 199 | 1962 | bool CurveBiquadratic_Impl::setCoefficient1Constant(double coefficient1Constant) { | |
| 200 | 1962 | bool result = setDouble(OS_Curve_BiquadraticFields::Coefficient1Constant, coefficient1Constant); | |
| 201 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1962 times.
|
1962 | OS_ASSERT(result); |
| 202 | 1962 | return result; | |
| 203 | } | ||
| 204 | |||
| 205 | 1954 | bool CurveBiquadratic_Impl::setCoefficient2x(double coefficient2x) { | |
| 206 | 1954 | bool result = setDouble(OS_Curve_BiquadraticFields::Coefficient2x, coefficient2x); | |
| 207 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1954 times.
|
1954 | OS_ASSERT(result); |
| 208 | 1954 | return result; | |
| 209 | } | ||
| 210 | |||
| 211 | 1955 | bool CurveBiquadratic_Impl::setCoefficient3xPOW2(double coefficient3xPOW2) { | |
| 212 | 1955 | bool result = setDouble(OS_Curve_BiquadraticFields::Coefficient3x_POW_2, coefficient3xPOW2); | |
| 213 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1955 times.
|
1955 | OS_ASSERT(result); |
| 214 | 1955 | return result; | |
| 215 | } | ||
| 216 | |||
| 217 | 1949 | bool CurveBiquadratic_Impl::setCoefficient4y(double coefficient4y) { | |
| 218 | 1949 | bool result = setDouble(OS_Curve_BiquadraticFields::Coefficient4y, coefficient4y); | |
| 219 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1949 times.
|
1949 | OS_ASSERT(result); |
| 220 | 1949 | return result; | |
| 221 | } | ||
| 222 | |||
| 223 | 1947 | bool CurveBiquadratic_Impl::setCoefficient5yPOW2(double coefficient5yPOW2) { | |
| 224 | 1947 | bool result = setDouble(OS_Curve_BiquadraticFields::Coefficient5y_POW_2, coefficient5yPOW2); | |
| 225 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1947 times.
|
1947 | OS_ASSERT(result); |
| 226 | 1947 | return result; | |
| 227 | } | ||
| 228 | |||
| 229 | 1947 | bool CurveBiquadratic_Impl::setCoefficient6xTIMESY(double coefficient6xTIMESY) { | |
| 230 | 1947 | bool result = setDouble(OS_Curve_BiquadraticFields::Coefficient6x_TIMES_y, coefficient6xTIMESY); | |
| 231 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1947 times.
|
1947 | OS_ASSERT(result); |
| 232 | 1947 | return result; | |
| 233 | } | ||
| 234 | |||
| 235 | 1946 | bool CurveBiquadratic_Impl::setMinimumValueofx(double minimumValueofx) { | |
| 236 | 1946 | bool result = setDouble(OS_Curve_BiquadraticFields::MinimumValueofx, minimumValueofx); | |
| 237 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1946 times.
|
1946 | OS_ASSERT(result); |
| 238 | 1946 | return result; | |
| 239 | } | ||
| 240 | |||
| 241 | 1946 | bool CurveBiquadratic_Impl::setMaximumValueofx(double maximumValueofx) { | |
| 242 | 1946 | bool result = setDouble(OS_Curve_BiquadraticFields::MaximumValueofx, maximumValueofx); | |
| 243 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1946 times.
|
1946 | OS_ASSERT(result); |
| 244 | 1946 | return result; | |
| 245 | } | ||
| 246 | |||
| 247 | 1757 | bool CurveBiquadratic_Impl::setMinimumValueofy(double minimumValueofy) { | |
| 248 | 1757 | bool result = setDouble(OS_Curve_BiquadraticFields::MinimumValueofy, minimumValueofy); | |
| 249 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1757 times.
|
1757 | OS_ASSERT(result); |
| 250 | 1757 | return result; | |
| 251 | } | ||
| 252 | |||
| 253 | 2093 | bool CurveBiquadratic_Impl::setMaximumValueofy(double maximumValueofy) { | |
| 254 | 2093 | bool result = setDouble(OS_Curve_BiquadraticFields::MaximumValueofy, maximumValueofy); | |
| 255 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2093 times.
|
2093 | OS_ASSERT(result); |
| 256 | 2093 | return result; | |
| 257 | } | ||
| 258 | |||
| 259 | 667 | bool CurveBiquadratic_Impl::setMinimumCurveOutput(boost::optional<double> minimumCurveOutput) { | |
| 260 | 667 | bool result = false; | |
| 261 |
1/2✓ Branch 0 taken 667 times.
✗ Branch 1 not taken.
|
667 | if (minimumCurveOutput) { |
| 262 | 667 | result = setDouble(OS_Curve_BiquadraticFields::MinimumCurveOutput, minimumCurveOutput.get()); | |
| 263 | } else { | ||
| 264 | ✗ | result = setString(OS_Curve_BiquadraticFields::MinimumCurveOutput, ""); | |
| 265 | } | ||
| 266 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 667 times.
|
667 | OS_ASSERT(result); |
| 267 | 667 | return result; | |
| 268 | } | ||
| 269 | |||
| 270 | ✗ | void CurveBiquadratic_Impl::resetMinimumCurveOutput() { | |
| 271 | ✗ | bool result = setString(OS_Curve_BiquadraticFields::MinimumCurveOutput, ""); | |
| 272 | ✗ | OS_ASSERT(result); | |
| 273 | ✗ | } | |
| 274 | |||
| 275 | 656 | bool CurveBiquadratic_Impl::setMaximumCurveOutput(boost::optional<double> maximumCurveOutput) { | |
| 276 | 656 | bool result = false; | |
| 277 |
1/2✓ Branch 0 taken 656 times.
✗ Branch 1 not taken.
|
656 | if (maximumCurveOutput) { |
| 278 | 656 | result = setDouble(OS_Curve_BiquadraticFields::MaximumCurveOutput, maximumCurveOutput.get()); | |
| 279 | } else { | ||
| 280 | ✗ | result = setString(OS_Curve_BiquadraticFields::MaximumCurveOutput, ""); | |
| 281 | } | ||
| 282 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 656 times.
|
656 | OS_ASSERT(result); |
| 283 | 656 | return result; | |
| 284 | } | ||
| 285 | |||
| 286 | ✗ | void CurveBiquadratic_Impl::resetMaximumCurveOutput() { | |
| 287 | ✗ | bool result = setString(OS_Curve_BiquadraticFields::MaximumCurveOutput, ""); | |
| 288 | ✗ | OS_ASSERT(result); | |
| 289 | ✗ | } | |
| 290 | |||
| 291 | 443 | bool CurveBiquadratic_Impl::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { | |
| 292 | 443 | bool result = setString(OS_Curve_BiquadraticFields::InputUnitTypeforX, inputUnitTypeforX); | |
| 293 | 443 | return result; | |
| 294 | } | ||
| 295 | |||
| 296 | ✗ | void CurveBiquadratic_Impl::resetInputUnitTypeforX() { | |
| 297 | ✗ | bool result = setString(OS_Curve_BiquadraticFields::InputUnitTypeforX, ""); | |
| 298 | ✗ | OS_ASSERT(result); | |
| 299 | ✗ | } | |
| 300 | |||
| 301 | 443 | bool CurveBiquadratic_Impl::setInputUnitTypeforY(const std::string& inputUnitTypeforY) { | |
| 302 | 443 | bool result = setString(OS_Curve_BiquadraticFields::InputUnitTypeforY, inputUnitTypeforY); | |
| 303 | 443 | return result; | |
| 304 | } | ||
| 305 | |||
| 306 | ✗ | void CurveBiquadratic_Impl::resetInputUnitTypeforY() { | |
| 307 | ✗ | bool result = setString(OS_Curve_BiquadraticFields::InputUnitTypeforY, ""); | |
| 308 | ✗ | OS_ASSERT(result); | |
| 309 | ✗ | } | |
| 310 | |||
| 311 | 331 | bool CurveBiquadratic_Impl::setOutputUnitType(const std::string& outputUnitType) { | |
| 312 | 331 | bool result = setString(OS_Curve_BiquadraticFields::OutputUnitType, outputUnitType); | |
| 313 | 331 | return result; | |
| 314 | } | ||
| 315 | |||
| 316 | ✗ | void CurveBiquadratic_Impl::resetOutputUnitType() { | |
| 317 | ✗ | bool result = setString(OS_Curve_BiquadraticFields::OutputUnitType, ""); | |
| 318 | ✗ | OS_ASSERT(result); | |
| 319 | ✗ | } | |
| 320 | |||
| 321 | } // namespace detail | ||
| 322 | |||
| 323 | 2234 | CurveBiquadratic::CurveBiquadratic(const Model& model) : Curve(CurveBiquadratic::iddObjectType(), model) { | |
| 324 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 2234 times.
✗ Branch 5 not taken.
|
2234 | OS_ASSERT(getImpl<detail::CurveBiquadratic_Impl>()); |
| 325 |
1/1✓ Branch 1 taken 2234 times.
|
2234 | setDouble(OS_Curve_BiquadraticFields::Coefficient1Constant, 0.0); |
| 326 |
1/1✓ Branch 1 taken 2234 times.
|
2234 | setDouble(OS_Curve_BiquadraticFields::Coefficient2x, 0.0); |
| 327 |
1/1✓ Branch 1 taken 2234 times.
|
2234 | setDouble(OS_Curve_BiquadraticFields::Coefficient3x_POW_2, 0.0); |
| 328 |
1/1✓ Branch 1 taken 2234 times.
|
2234 | setDouble(OS_Curve_BiquadraticFields::Coefficient4y, 0.0); |
| 329 |
1/1✓ Branch 1 taken 2234 times.
|
2234 | setDouble(OS_Curve_BiquadraticFields::Coefficient5y_POW_2, 0.0); |
| 330 |
1/1✓ Branch 1 taken 2234 times.
|
2234 | setDouble(OS_Curve_BiquadraticFields::Coefficient6x_TIMES_y, 0.0); |
| 331 |
1/1✓ Branch 1 taken 2234 times.
|
2234 | setDouble(OS_Curve_BiquadraticFields::MinimumValueofx, 0.0); |
| 332 |
1/1✓ Branch 1 taken 2234 times.
|
2234 | setDouble(OS_Curve_BiquadraticFields::MaximumValueofx, 1.0); |
| 333 |
1/1✓ Branch 1 taken 2234 times.
|
2234 | setDouble(OS_Curve_BiquadraticFields::MinimumValueofy, 0.0); |
| 334 |
1/1✓ Branch 1 taken 2234 times.
|
2234 | setDouble(OS_Curve_BiquadraticFields::MaximumValueofy, 1.0); |
| 335 | 2234 | } | |
| 336 | |||
| 337 | 12896 | IddObjectType CurveBiquadratic::iddObjectType() { | |
| 338 |
1/1✓ Branch 1 taken 12896 times.
|
12896 | IddObjectType result(IddObjectType::OS_Curve_Biquadratic); |
| 339 | 12896 | return result; | |
| 340 | } | ||
| 341 | |||
| 342 | ✗ | std::vector<std::string> CurveBiquadratic::validInputUnitTypeforXValues() { | |
| 343 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_Curve_BiquadraticFields::InputUnitTypeforX); | |
| 344 | } | ||
| 345 | |||
| 346 | ✗ | std::vector<std::string> CurveBiquadratic::validInputUnitTypeforYValues() { | |
| 347 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_Curve_BiquadraticFields::InputUnitTypeforY); | |
| 348 | } | ||
| 349 | |||
| 350 | ✗ | std::vector<std::string> CurveBiquadratic::validOutputUnitTypeValues() { | |
| 351 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_Curve_BiquadraticFields::OutputUnitType); | |
| 352 | } | ||
| 353 | |||
| 354 | 1071 | double CurveBiquadratic::coefficient1Constant() const { | |
| 355 |
1/1✓ Branch 3 taken 1071 times.
|
1071 | return getImpl<detail::CurveBiquadratic_Impl>()->coefficient1Constant(); |
| 356 | } | ||
| 357 | |||
| 358 | 1058 | double CurveBiquadratic::coefficient2x() const { | |
| 359 |
1/1✓ Branch 3 taken 1058 times.
|
1058 | return getImpl<detail::CurveBiquadratic_Impl>()->coefficient2x(); |
| 360 | } | ||
| 361 | |||
| 362 | 1058 | double CurveBiquadratic::coefficient3xPOW2() const { | |
| 363 |
1/1✓ Branch 3 taken 1058 times.
|
1058 | return getImpl<detail::CurveBiquadratic_Impl>()->coefficient3xPOW2(); |
| 364 | } | ||
| 365 | |||
| 366 | 1058 | double CurveBiquadratic::coefficient4y() const { | |
| 367 |
1/1✓ Branch 3 taken 1058 times.
|
1058 | return getImpl<detail::CurveBiquadratic_Impl>()->coefficient4y(); |
| 368 | } | ||
| 369 | |||
| 370 | 1058 | double CurveBiquadratic::coefficient5yPOW2() const { | |
| 371 |
1/1✓ Branch 3 taken 1058 times.
|
1058 | return getImpl<detail::CurveBiquadratic_Impl>()->coefficient5yPOW2(); |
| 372 | } | ||
| 373 | |||
| 374 | 1059 | double CurveBiquadratic::coefficient6xTIMESY() const { | |
| 375 |
1/1✓ Branch 3 taken 1059 times.
|
1059 | return getImpl<detail::CurveBiquadratic_Impl>()->coefficient6xTIMESY(); |
| 376 | } | ||
| 377 | |||
| 378 | 1058 | double CurveBiquadratic::minimumValueofx() const { | |
| 379 |
1/1✓ Branch 3 taken 1058 times.
|
1058 | return getImpl<detail::CurveBiquadratic_Impl>()->minimumValueofx(); |
| 380 | } | ||
| 381 | |||
| 382 | 1058 | double CurveBiquadratic::maximumValueofx() const { | |
| 383 |
1/1✓ Branch 3 taken 1058 times.
|
1058 | return getImpl<detail::CurveBiquadratic_Impl>()->maximumValueofx(); |
| 384 | } | ||
| 385 | |||
| 386 | 1058 | double CurveBiquadratic::minimumValueofy() const { | |
| 387 |
1/1✓ Branch 3 taken 1058 times.
|
1058 | return getImpl<detail::CurveBiquadratic_Impl>()->minimumValueofy(); |
| 388 | } | ||
| 389 | |||
| 390 | 1058 | double CurveBiquadratic::maximumValueofy() const { | |
| 391 |
1/1✓ Branch 3 taken 1058 times.
|
1058 | return getImpl<detail::CurveBiquadratic_Impl>()->maximumValueofy(); |
| 392 | } | ||
| 393 | |||
| 394 | 1059 | boost::optional<double> CurveBiquadratic::minimumCurveOutput() const { | |
| 395 |
1/1✓ Branch 3 taken 1059 times.
|
1059 | return getImpl<detail::CurveBiquadratic_Impl>()->minimumCurveOutput(); |
| 396 | } | ||
| 397 | |||
| 398 | 1059 | boost::optional<double> CurveBiquadratic::maximumCurveOutput() const { | |
| 399 |
1/1✓ Branch 3 taken 1059 times.
|
1059 | return getImpl<detail::CurveBiquadratic_Impl>()->maximumCurveOutput(); |
| 400 | } | ||
| 401 | |||
| 402 | 148 | std::string CurveBiquadratic::inputUnitTypeforX() const { | |
| 403 |
1/1✓ Branch 3 taken 148 times.
|
148 | return getImpl<detail::CurveBiquadratic_Impl>()->inputUnitTypeforX(); |
| 404 | } | ||
| 405 | |||
| 406 | 1056 | bool CurveBiquadratic::isInputUnitTypeforXDefaulted() const { | |
| 407 |
1/1✓ Branch 3 taken 1056 times.
|
1056 | return getImpl<detail::CurveBiquadratic_Impl>()->isInputUnitTypeforXDefaulted(); |
| 408 | } | ||
| 409 | |||
| 410 | 148 | std::string CurveBiquadratic::inputUnitTypeforY() const { | |
| 411 |
1/1✓ Branch 3 taken 148 times.
|
148 | return getImpl<detail::CurveBiquadratic_Impl>()->inputUnitTypeforY(); |
| 412 | } | ||
| 413 | |||
| 414 | 1056 | bool CurveBiquadratic::isInputUnitTypeforYDefaulted() const { | |
| 415 |
1/1✓ Branch 3 taken 1056 times.
|
1056 | return getImpl<detail::CurveBiquadratic_Impl>()->isInputUnitTypeforYDefaulted(); |
| 416 | } | ||
| 417 | |||
| 418 | 120 | std::string CurveBiquadratic::outputUnitType() const { | |
| 419 |
1/1✓ Branch 3 taken 120 times.
|
120 | return getImpl<detail::CurveBiquadratic_Impl>()->outputUnitType(); |
| 420 | } | ||
| 421 | |||
| 422 | 1056 | bool CurveBiquadratic::isOutputUnitTypeDefaulted() const { | |
| 423 |
1/1✓ Branch 3 taken 1056 times.
|
1056 | return getImpl<detail::CurveBiquadratic_Impl>()->isOutputUnitTypeDefaulted(); |
| 424 | } | ||
| 425 | |||
| 426 | 1962 | bool CurveBiquadratic::setCoefficient1Constant(double coefficient1Constant) { | |
| 427 |
1/1✓ Branch 3 taken 1962 times.
|
1962 | return getImpl<detail::CurveBiquadratic_Impl>()->setCoefficient1Constant(coefficient1Constant); |
| 428 | } | ||
| 429 | |||
| 430 | 1954 | bool CurveBiquadratic::setCoefficient2x(double coefficient2x) { | |
| 431 |
1/1✓ Branch 3 taken 1954 times.
|
1954 | return getImpl<detail::CurveBiquadratic_Impl>()->setCoefficient2x(coefficient2x); |
| 432 | } | ||
| 433 | |||
| 434 | 1955 | bool CurveBiquadratic::setCoefficient3xPOW2(double coefficient3xPOW2) { | |
| 435 |
1/1✓ Branch 3 taken 1955 times.
|
1955 | return getImpl<detail::CurveBiquadratic_Impl>()->setCoefficient3xPOW2(coefficient3xPOW2); |
| 436 | } | ||
| 437 | |||
| 438 | 1949 | bool CurveBiquadratic::setCoefficient4y(double coefficient4y) { | |
| 439 |
1/1✓ Branch 3 taken 1949 times.
|
1949 | return getImpl<detail::CurveBiquadratic_Impl>()->setCoefficient4y(coefficient4y); |
| 440 | } | ||
| 441 | |||
| 442 | 1947 | bool CurveBiquadratic::setCoefficient5yPOW2(double coefficient5yPOW2) { | |
| 443 |
1/1✓ Branch 3 taken 1947 times.
|
1947 | return getImpl<detail::CurveBiquadratic_Impl>()->setCoefficient5yPOW2(coefficient5yPOW2); |
| 444 | } | ||
| 445 | |||
| 446 | 1947 | bool CurveBiquadratic::setCoefficient6xTIMESY(double coefficient6xTIMESY) { | |
| 447 |
1/1✓ Branch 3 taken 1947 times.
|
1947 | return getImpl<detail::CurveBiquadratic_Impl>()->setCoefficient6xTIMESY(coefficient6xTIMESY); |
| 448 | } | ||
| 449 | |||
| 450 | 1946 | bool CurveBiquadratic::setMinimumValueofx(double minimumValueofx) { | |
| 451 |
1/1✓ Branch 3 taken 1946 times.
|
1946 | return getImpl<detail::CurveBiquadratic_Impl>()->setMinimumValueofx(minimumValueofx); |
| 452 | } | ||
| 453 | |||
| 454 | 1946 | bool CurveBiquadratic::setMaximumValueofx(double maximumValueofx) { | |
| 455 |
1/1✓ Branch 3 taken 1946 times.
|
1946 | return getImpl<detail::CurveBiquadratic_Impl>()->setMaximumValueofx(maximumValueofx); |
| 456 | } | ||
| 457 | |||
| 458 | 1757 | bool CurveBiquadratic::setMinimumValueofy(double minimumValueofy) { | |
| 459 |
1/1✓ Branch 3 taken 1757 times.
|
1757 | return getImpl<detail::CurveBiquadratic_Impl>()->setMinimumValueofy(minimumValueofy); |
| 460 | } | ||
| 461 | |||
| 462 | 2093 | bool CurveBiquadratic::setMaximumValueofy(double maximumValueofy) { | |
| 463 |
1/1✓ Branch 3 taken 2093 times.
|
2093 | return getImpl<detail::CurveBiquadratic_Impl>()->setMaximumValueofy(maximumValueofy); |
| 464 | } | ||
| 465 | |||
| 466 | 667 | bool CurveBiquadratic::setMinimumCurveOutput(double minimumCurveOutput) { | |
| 467 |
2/2✓ Branch 3 taken 667 times.
✓ Branch 6 taken 667 times.
|
667 | return getImpl<detail::CurveBiquadratic_Impl>()->setMinimumCurveOutput(minimumCurveOutput); |
| 468 | } | ||
| 469 | |||
| 470 | ✗ | void CurveBiquadratic::resetMinimumCurveOutput() { | |
| 471 | ✗ | getImpl<detail::CurveBiquadratic_Impl>()->resetMinimumCurveOutput(); | |
| 472 | ✗ | } | |
| 473 | |||
| 474 | 656 | bool CurveBiquadratic::setMaximumCurveOutput(double maximumCurveOutput) { | |
| 475 |
2/2✓ Branch 3 taken 656 times.
✓ Branch 6 taken 656 times.
|
656 | return getImpl<detail::CurveBiquadratic_Impl>()->setMaximumCurveOutput(maximumCurveOutput); |
| 476 | } | ||
| 477 | |||
| 478 | ✗ | void CurveBiquadratic::resetMaximumCurveOutput() { | |
| 479 | ✗ | getImpl<detail::CurveBiquadratic_Impl>()->resetMaximumCurveOutput(); | |
| 480 | ✗ | } | |
| 481 | |||
| 482 | 443 | bool CurveBiquadratic::setInputUnitTypeforX(const std::string& inputUnitTypeforX) { | |
| 483 |
1/1✓ Branch 3 taken 443 times.
|
443 | return getImpl<detail::CurveBiquadratic_Impl>()->setInputUnitTypeforX(inputUnitTypeforX); |
| 484 | } | ||
| 485 | |||
| 486 | ✗ | void CurveBiquadratic::resetInputUnitTypeforX() { | |
| 487 | ✗ | getImpl<detail::CurveBiquadratic_Impl>()->resetInputUnitTypeforX(); | |
| 488 | ✗ | } | |
| 489 | |||
| 490 | 443 | bool CurveBiquadratic::setInputUnitTypeforY(const std::string& inputUnitTypeforY) { | |
| 491 |
1/1✓ Branch 3 taken 443 times.
|
443 | return getImpl<detail::CurveBiquadratic_Impl>()->setInputUnitTypeforY(inputUnitTypeforY); |
| 492 | } | ||
| 493 | |||
| 494 | ✗ | void CurveBiquadratic::resetInputUnitTypeforY() { | |
| 495 | ✗ | getImpl<detail::CurveBiquadratic_Impl>()->resetInputUnitTypeforY(); | |
| 496 | ✗ | } | |
| 497 | |||
| 498 | 331 | bool CurveBiquadratic::setOutputUnitType(const std::string& outputUnitType) { | |
| 499 |
1/1✓ Branch 3 taken 331 times.
|
331 | return getImpl<detail::CurveBiquadratic_Impl>()->setOutputUnitType(outputUnitType); |
| 500 | } | ||
| 501 | |||
| 502 | ✗ | void CurveBiquadratic::resetOutputUnitType() { | |
| 503 | ✗ | getImpl<detail::CurveBiquadratic_Impl>()->resetOutputUnitType(); | |
| 504 | ✗ | } | |
| 505 | |||
| 506 | /// @cond | ||
| 507 |
1/1✓ Branch 3 taken 1324 times.
|
1324 | CurveBiquadratic::CurveBiquadratic(std::shared_ptr<detail::CurveBiquadratic_Impl> impl) : Curve(std::move(impl)) {} |
| 508 | /// @endcond | ||
| 509 | |||
| 510 | } // namespace model | ||
| 511 | } // namespace openstudio | ||
| 512 |