src/utilities/filetypes/WorkflowStepResult.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 "WorkflowStepResult.hpp" | ||
| 7 | #include "WorkflowStepResult_Impl.hpp" | ||
| 8 | |||
| 9 | #include "../../utilities/core/Assert.hpp" | ||
| 10 | #include "../../utilities/core/Path.hpp" | ||
| 11 | |||
| 12 | #include <json/json.h> | ||
| 13 | #include <fmt/core.h> | ||
| 14 | #include <fmt/ranges.h> | ||
| 15 | |||
| 16 | #include <string> | ||
| 17 | #include <ranges> | ||
| 18 | #include <utility> | ||
| 19 | #include <vector> | ||
| 20 | |||
| 21 | namespace openstudio { | ||
| 22 | namespace detail { | ||
| 23 | |||
| 24 |
1/1✓ Branch 2 taken 238 times.
|
238 | WorkflowStepValue_Impl::WorkflowStepValue_Impl(const std::string& name, const Variant& value) : m_name(name), m_value(value) {} |
| 25 | |||
| 26 | 421 | Json::Value WorkflowStepValue_Impl::toJSON() const { | |
| 27 | 421 | Json::Value root(Json::objectValue); | |
| 28 |
2/2✓ Branch 1 taken 421 times.
✓ Branch 4 taken 421 times.
|
421 | root["name"] = m_name; |
| 29 | |||
| 30 |
2/2✓ Branch 1 taken 94 times.
✓ Branch 2 taken 327 times.
|
842 | if (m_displayName) { |
| 31 |
3/3✓ Branch 1 taken 94 times.
✓ Branch 4 taken 94 times.
✓ Branch 7 taken 94 times.
|
94 | root["display_name"] = *m_displayName; |
| 32 | } | ||
| 33 | |||
| 34 |
2/2✓ Branch 1 taken 94 times.
✓ Branch 2 taken 327 times.
|
842 | if (m_units) { |
| 35 |
3/3✓ Branch 1 taken 94 times.
✓ Branch 4 taken 94 times.
✓ Branch 7 taken 94 times.
|
94 | root["units"] = *m_units; |
| 36 | } | ||
| 37 | |||
| 38 |
2/2✓ Branch 1 taken 421 times.
✓ Branch 4 taken 421 times.
|
421 | root["value"] = m_value.valueAsJSON(); |
| 39 | |||
| 40 | 421 | return root; | |
| 41 | ✗ | } | |
| 42 | |||
| 43 | ✗ | std::string WorkflowStepValue_Impl::string() const { | |
| 44 | // Write to string | ||
| 45 | ✗ | Json::StreamWriterBuilder wbuilder; | |
| 46 | // mimic the old StyledWriter behavior: | ||
| 47 | ✗ | wbuilder["indentation"] = " "; | |
| 48 | ✗ | std::string result = Json::writeString(wbuilder, toJSON()); | |
| 49 | |||
| 50 | ✗ | return result; | |
| 51 | ✗ | } | |
| 52 | |||
| 53 | 736 | std::string WorkflowStepValue_Impl::name() const { | |
| 54 | 736 | return m_name; | |
| 55 | } | ||
| 56 | |||
| 57 | 8 | std::string WorkflowStepValue_Impl::displayName() const { | |
| 58 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 8 times.
|
16 | if (m_displayName) { |
| 59 | ✗ | return *m_displayName; | |
| 60 | } | ||
| 61 | 8 | return m_name; | |
| 62 | } | ||
| 63 | |||
| 64 | 8 | boost::optional<std::string> WorkflowStepValue_Impl::units() const { | |
| 65 | 8 | return m_units; | |
| 66 | } | ||
| 67 | |||
| 68 | 63 | VariantType WorkflowStepValue_Impl::variantType() const { | |
| 69 | 63 | return m_value.variantType(); | |
| 70 | } | ||
| 71 | |||
| 72 | 41 | Variant WorkflowStepValue_Impl::valueAsVariant() const { | |
| 73 | 41 | return m_value; | |
| 74 | } | ||
| 75 | |||
| 76 | 9 | bool WorkflowStepValue_Impl::valueAsBoolean() const { | |
| 77 | 9 | return m_value.valueAsBoolean(); | |
| 78 | } | ||
| 79 | |||
| 80 | 15 | int WorkflowStepValue_Impl::valueAsInteger() const { | |
| 81 | 15 | return m_value.valueAsInteger(); | |
| 82 | } | ||
| 83 | |||
| 84 | 27 | double WorkflowStepValue_Impl::valueAsDouble() const { | |
| 85 | 27 | return m_value.valueAsDouble(); | |
| 86 | } | ||
| 87 | |||
| 88 | 3 | std::string WorkflowStepValue_Impl::valueAsString() const { | |
| 89 | 3 | return m_value.valueAsString(); | |
| 90 | } | ||
| 91 | |||
| 92 | 3 | Json::Value WorkflowStepValue_Impl::valueAsJSON() const { | |
| 93 | 3 | return m_value.valueAsJSON(); | |
| 94 | } | ||
| 95 | |||
| 96 | ✗ | void WorkflowStepValue_Impl::setName(const std::string& name) { | |
| 97 | ✗ | m_name = name; | |
| 98 | ✗ | } | |
| 99 | |||
| 100 | 38 | void WorkflowStepValue_Impl::setDisplayName(const std::string& displayName) { | |
| 101 | 38 | m_displayName = displayName; | |
| 102 | 38 | } | |
| 103 | |||
| 104 | ✗ | void WorkflowStepValue_Impl::resetDisplayName() { | |
| 105 | ✗ | m_displayName.reset(); | |
| 106 | ✗ | } | |
| 107 | |||
| 108 | 38 | void WorkflowStepValue_Impl::setUnits(const std::string& units) { | |
| 109 | 38 | m_units = units; | |
| 110 | 38 | } | |
| 111 | |||
| 112 | ✗ | void WorkflowStepValue_Impl::resetUnits() { | |
| 113 | ✗ | m_units.reset(); | |
| 114 | ✗ | } | |
| 115 | |||
| 116 | 240 | WorkflowStepResult_Impl::WorkflowStepResult_Impl() = default; | |
| 117 | |||
| 118 | 231 | Json::Value WorkflowStepResult_Impl::toJSON() const { | |
| 119 | |||
| 120 | 231 | Json::Value root(Json::objectValue); | |
| 121 | 231 | bool complete = false; | |
| 122 | |||
| 123 |
3/3✓ Branch 1 taken 231 times.
✓ Branch 4 taken 198 times.
✓ Branch 5 taken 33 times.
|
462 | if (startedAt()) { |
| 124 |
5/5✓ Branch 1 taken 198 times.
✓ Branch 4 taken 198 times.
✓ Branch 7 taken 198 times.
✓ Branch 10 taken 198 times.
✓ Branch 13 taken 198 times.
|
198 | root["started_at"] = startedAt()->toISO8601(); |
| 125 | } | ||
| 126 | |||
| 127 |
3/3✓ Branch 1 taken 231 times.
✓ Branch 4 taken 227 times.
✓ Branch 5 taken 4 times.
|
462 | if (completedAt()) { |
| 128 | 227 | complete = true; | |
| 129 |
5/5✓ Branch 1 taken 227 times.
✓ Branch 4 taken 227 times.
✓ Branch 7 taken 227 times.
✓ Branch 10 taken 227 times.
✓ Branch 13 taken 227 times.
|
227 | root["completed_at"] = completedAt()->toISO8601(); |
| 130 | } | ||
| 131 | |||
| 132 |
2/2✓ Branch 1 taken 183 times.
✓ Branch 2 taken 48 times.
|
462 | if (m_measureType) { |
| 133 |
4/4✓ Branch 1 taken 183 times.
✓ Branch 4 taken 183 times.
✓ Branch 7 taken 183 times.
✓ Branch 10 taken 183 times.
|
183 | root["measure_type"] = m_measureType->valueName(); |
| 134 | } | ||
| 135 | |||
| 136 |
2/2✓ Branch 1 taken 212 times.
✓ Branch 2 taken 19 times.
|
462 | if (m_measureName) { |
| 137 |
3/3✓ Branch 1 taken 212 times.
✓ Branch 4 taken 212 times.
✓ Branch 7 taken 212 times.
|
212 | root["measure_name"] = m_measureName.get(); |
| 138 | } | ||
| 139 | |||
| 140 |
2/2✓ Branch 1 taken 183 times.
✓ Branch 2 taken 48 times.
|
462 | if (m_measureId) { |
| 141 |
3/3✓ Branch 1 taken 183 times.
✓ Branch 4 taken 183 times.
✓ Branch 7 taken 183 times.
|
183 | root["measure_uid"] = m_measureId.get(); |
| 142 | } | ||
| 143 | |||
| 144 |
2/2✓ Branch 1 taken 183 times.
✓ Branch 2 taken 48 times.
|
462 | if (m_measureVersionId) { |
| 145 |
3/3✓ Branch 1 taken 183 times.
✓ Branch 4 taken 183 times.
✓ Branch 7 taken 183 times.
|
183 | root["measure_version_id"] = m_measureVersionId.get(); |
| 146 | } | ||
| 147 | |||
| 148 |
2/2✓ Branch 1 taken 183 times.
✓ Branch 2 taken 48 times.
|
462 | if (m_measureVersionModified) { |
| 149 |
3/3✓ Branch 1 taken 183 times.
✓ Branch 4 taken 183 times.
✓ Branch 7 taken 183 times.
|
183 | root["measure_version_modified"] = m_measureVersionModified.get(); |
| 150 | } | ||
| 151 | |||
| 152 |
2/2✓ Branch 1 taken 183 times.
✓ Branch 2 taken 48 times.
|
462 | if (m_measureXmlChecksum) { |
| 153 |
3/3✓ Branch 1 taken 183 times.
✓ Branch 4 taken 183 times.
✓ Branch 7 taken 183 times.
|
183 | root["measure_xml_checksum"] = m_measureXmlChecksum.get(); |
| 154 | } | ||
| 155 | |||
| 156 |
2/2✓ Branch 1 taken 183 times.
✓ Branch 2 taken 48 times.
|
462 | if (m_measureClassName) { |
| 157 |
3/3✓ Branch 1 taken 183 times.
✓ Branch 4 taken 183 times.
✓ Branch 7 taken 183 times.
|
183 | root["measure_class_name"] = m_measureClassName.get(); |
| 158 | } | ||
| 159 | |||
| 160 |
2/2✓ Branch 1 taken 183 times.
✓ Branch 2 taken 48 times.
|
462 | if (m_measureDisplayName) { |
| 161 |
3/3✓ Branch 1 taken 183 times.
✓ Branch 4 taken 183 times.
✓ Branch 7 taken 183 times.
|
183 | root["measure_display_name"] = m_measureDisplayName.get(); |
| 162 | } | ||
| 163 | |||
| 164 |
2/2✓ Branch 1 taken 171 times.
✓ Branch 2 taken 60 times.
|
462 | if (m_measureTaxonomy) { |
| 165 |
3/3✓ Branch 1 taken 171 times.
✓ Branch 4 taken 171 times.
✓ Branch 7 taken 171 times.
|
171 | root["measure_taxonomy"] = m_measureTaxonomy.get(); |
| 166 | } | ||
| 167 | |||
| 168 |
2/2✓ Branch 0 taken 227 times.
✓ Branch 1 taken 4 times.
|
231 | if (complete) { |
| 169 |
2/3✓ Branch 1 taken 227 times.
✓ Branch 4 taken 227 times.
✗ Branch 5 not taken.
|
454 | if (stepResult()) { |
| 170 |
5/5✓ Branch 1 taken 227 times.
✓ Branch 4 taken 227 times.
✓ Branch 7 taken 227 times.
✓ Branch 10 taken 227 times.
✓ Branch 13 taken 227 times.
|
227 | root["step_result"] = stepResult()->valueName(); |
| 171 | } else { | ||
| 172 | // error | ||
| 173 | } | ||
| 174 | } | ||
| 175 | |||
| 176 |
3/3✓ Branch 1 taken 231 times.
✓ Branch 4 taken 97 times.
✓ Branch 5 taken 134 times.
|
462 | if (stepInitialCondition()) { |
| 177 |
4/4✓ Branch 1 taken 97 times.
✓ Branch 4 taken 97 times.
✓ Branch 7 taken 97 times.
✓ Branch 10 taken 97 times.
|
97 | root["step_initial_condition"] = stepInitialCondition().get(); |
| 178 | } | ||
| 179 | |||
| 180 |
3/3✓ Branch 1 taken 231 times.
✓ Branch 4 taken 135 times.
✓ Branch 5 taken 96 times.
|
462 | if (stepFinalCondition()) { |
| 181 |
4/4✓ Branch 1 taken 135 times.
✓ Branch 4 taken 135 times.
✓ Branch 7 taken 135 times.
✓ Branch 10 taken 135 times.
|
135 | root["step_final_condition"] = stepFinalCondition().get(); |
| 182 | } | ||
| 183 | |||
| 184 |
7/11✓ Branch 0 taken 4 times.
✓ Branch 1 taken 227 times.
✓ Branch 3 taken 4 times.
✓ Branch 6 taken 4 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 4 times.
✓ Branch 9 taken 227 times.
✓ Branch 11 taken 231 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
|
231 | if (complete || (!stepErrors().empty())) { |
| 185 |
1/1✓ Branch 1 taken 231 times.
|
231 | Json::Value errors(Json::arrayValue); |
| 186 |
3/3✓ Branch 1 taken 231 times.
✓ Branch 7 taken 93 times.
✓ Branch 8 taken 231 times.
|
324 | for (const auto& stepError : stepErrors()) { |
| 187 |
2/2✓ Branch 1 taken 93 times.
✓ Branch 4 taken 93 times.
|
93 | errors.append(stepError); |
| 188 | 231 | } | |
| 189 |
2/2✓ Branch 1 taken 231 times.
✓ Branch 4 taken 231 times.
|
231 | root["step_errors"] = errors; |
| 190 | 231 | } | |
| 191 | |||
| 192 |
7/11✓ Branch 0 taken 4 times.
✓ Branch 1 taken 227 times.
✓ Branch 3 taken 4 times.
✓ Branch 6 taken 4 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 4 times.
✓ Branch 9 taken 227 times.
✓ Branch 11 taken 231 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
|
231 | if (complete || (!stepWarnings().empty())) { |
| 193 |
1/1✓ Branch 1 taken 231 times.
|
231 | Json::Value warnings(Json::arrayValue); |
| 194 |
3/3✓ Branch 1 taken 231 times.
✓ Branch 7 taken 129 times.
✓ Branch 8 taken 231 times.
|
360 | for (const auto& stepWarning : stepWarnings()) { |
| 195 |
2/2✓ Branch 1 taken 129 times.
✓ Branch 4 taken 129 times.
|
129 | warnings.append(stepWarning); |
| 196 | 231 | } | |
| 197 |
2/2✓ Branch 1 taken 231 times.
✓ Branch 4 taken 231 times.
|
231 | root["step_warnings"] = warnings; |
| 198 | 231 | } | |
| 199 | |||
| 200 |
7/11✓ Branch 0 taken 4 times.
✓ Branch 1 taken 227 times.
✓ Branch 3 taken 4 times.
✓ Branch 6 taken 4 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 4 times.
✓ Branch 9 taken 227 times.
✓ Branch 11 taken 231 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
|
231 | if (complete || (!stepInfo().empty())) { |
| 201 |
1/1✓ Branch 1 taken 231 times.
|
231 | Json::Value info(Json::arrayValue); |
| 202 |
3/3✓ Branch 1 taken 231 times.
✓ Branch 7 taken 276 times.
✓ Branch 8 taken 231 times.
|
507 | for (const auto& stepI : stepInfo()) { |
| 203 |
2/2✓ Branch 1 taken 276 times.
✓ Branch 4 taken 276 times.
|
276 | info.append(stepI); |
| 204 | 231 | } | |
| 205 |
2/2✓ Branch 1 taken 231 times.
✓ Branch 4 taken 231 times.
|
231 | root["step_info"] = info; |
| 206 | 231 | } | |
| 207 | |||
| 208 |
7/11✓ Branch 0 taken 4 times.
✓ Branch 1 taken 227 times.
✓ Branch 3 taken 4 times.
✓ Branch 6 taken 4 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 4 times.
✓ Branch 9 taken 227 times.
✓ Branch 11 taken 231 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
|
231 | if (complete || (!stepValues().empty())) { |
| 209 |
1/1✓ Branch 1 taken 231 times.
|
231 | Json::Value values(Json::arrayValue); |
| 210 |
3/3✓ Branch 1 taken 231 times.
✓ Branch 7 taken 404 times.
✓ Branch 8 taken 231 times.
|
635 | for (const auto& stepValue : stepValues()) { |
| 211 |
2/2✓ Branch 1 taken 404 times.
✓ Branch 4 taken 404 times.
|
404 | values.append(stepValue.toJSON()); |
| 212 | 231 | } | |
| 213 |
2/2✓ Branch 1 taken 231 times.
✓ Branch 4 taken 231 times.
|
231 | root["step_values"] = values; |
| 214 | 231 | } | |
| 215 | |||
| 216 |
8/11✓ Branch 0 taken 4 times.
✓ Branch 1 taken 227 times.
✓ Branch 3 taken 4 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 4 times.
✓ Branch 8 taken 4 times.
✓ Branch 9 taken 227 times.
✓ Branch 11 taken 227 times.
✓ Branch 12 taken 4 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
|
231 | if (complete || (!stepFiles().empty())) { |
| 217 |
1/1✓ Branch 1 taken 227 times.
|
227 | Json::Value files(Json::arrayValue); |
| 218 |
3/3✓ Branch 1 taken 227 times.
✓ Branch 7 taken 97 times.
✓ Branch 8 taken 227 times.
|
324 | for (const auto& stepFile : stepFiles()) { |
| 219 |
3/3✓ Branch 1 taken 97 times.
✓ Branch 4 taken 97 times.
✓ Branch 7 taken 97 times.
|
97 | files.append(toString(stepFile)); |
| 220 | 227 | } | |
| 221 |
2/2✓ Branch 1 taken 227 times.
✓ Branch 4 taken 227 times.
|
227 | root["step_files"] = files; |
| 222 | 227 | } | |
| 223 | |||
| 224 |
3/3✓ Branch 1 taken 231 times.
✓ Branch 4 taken 202 times.
✓ Branch 5 taken 29 times.
|
462 | if (stdOut()) { |
| 225 |
4/4✓ Branch 1 taken 202 times.
✓ Branch 4 taken 202 times.
✓ Branch 7 taken 202 times.
✓ Branch 10 taken 202 times.
|
202 | root["stdout"] = stdOut().get(); |
| 226 | } | ||
| 227 | |||
| 228 |
3/3✓ Branch 1 taken 231 times.
✓ Branch 4 taken 202 times.
✓ Branch 5 taken 29 times.
|
462 | if (stdErr()) { |
| 229 |
4/4✓ Branch 1 taken 202 times.
✓ Branch 4 taken 202 times.
✓ Branch 7 taken 202 times.
✓ Branch 10 taken 202 times.
|
202 | root["stderr"] = stdErr().get(); |
| 230 | } | ||
| 231 | |||
| 232 | 231 | return root; | |
| 233 | ✗ | } | |
| 234 | |||
| 235 | 6 | std::string WorkflowStepResult_Impl::string() const { | |
| 236 | // Write to string | ||
| 237 |
1/1✓ Branch 1 taken 6 times.
|
6 | Json::StreamWriterBuilder wbuilder; |
| 238 | // mimic the old StyledWriter behavior: | ||
| 239 |
3/3✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
|
18 | wbuilder["indentation"] = " "; |
| 240 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | std::string result = Json::writeString(wbuilder, toJSON()); |
| 241 | |||
| 242 | 12 | return result; | |
| 243 | 6 | } | |
| 244 | |||
| 245 | 447 | boost::optional<DateTime> WorkflowStepResult_Impl::startedAt() const { | |
| 246 | 447 | return m_startedAt; | |
| 247 | } | ||
| 248 | |||
| 249 | 476 | boost::optional<DateTime> WorkflowStepResult_Impl::completedAt() const { | |
| 250 | 476 | return m_completedAt; | |
| 251 | } | ||
| 252 | |||
| 253 | 6 | boost::optional<MeasureType> WorkflowStepResult_Impl::measureType() const { | |
| 254 | 6 | return m_measureType; | |
| 255 | } | ||
| 256 | |||
| 257 | 19 | boost::optional<std::string> WorkflowStepResult_Impl::measureName() const { | |
| 258 | 19 | return m_measureName; | |
| 259 | } | ||
| 260 | |||
| 261 | 6 | boost::optional<std::string> WorkflowStepResult_Impl::measureId() const { | |
| 262 | 6 | return m_measureId; | |
| 263 | } | ||
| 264 | |||
| 265 | 3 | boost::optional<UUID> WorkflowStepResult_Impl::measureUUID() const { | |
| 266 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
|
3 | if (!m_measureId) { |
| 267 | ✗ | return boost::none; | |
| 268 | } | ||
| 269 |
5/5✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 13 taken 3 times.
|
3 | return toUUID("{" + m_measureId.get() + "}"); |
| 270 | } | ||
| 271 | |||
| 272 | 6 | boost::optional<std::string> WorkflowStepResult_Impl::measureVersionId() const { | |
| 273 | 6 | return m_measureVersionId; | |
| 274 | } | ||
| 275 | |||
| 276 | 3 | boost::optional<UUID> WorkflowStepResult_Impl::measureVersionUUID() const { | |
| 277 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
|
3 | if (!m_measureVersionId) { |
| 278 | ✗ | return boost::none; | |
| 279 | } | ||
| 280 |
5/5✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 13 taken 3 times.
|
3 | return toUUID("{" + m_measureVersionId.get() + "}"); |
| 281 | } | ||
| 282 | |||
| 283 | 6 | boost::optional<DateTime> WorkflowStepResult_Impl::measureVersionModified() const { | |
| 284 |
1/2✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
|
12 | if (m_measureVersionModified) { |
| 285 | 6 | return DateTime::fromISO8601(*m_measureVersionModified); | |
| 286 | } | ||
| 287 | ✗ | return boost::none; | |
| 288 | } | ||
| 289 | |||
| 290 | 6 | boost::optional<std::string> WorkflowStepResult_Impl::measureXmlChecksum() const { | |
| 291 | 6 | return m_measureXmlChecksum; | |
| 292 | } | ||
| 293 | |||
| 294 | 6 | boost::optional<std::string> WorkflowStepResult_Impl::measureClassName() const { | |
| 295 | 6 | return m_measureClassName; | |
| 296 | } | ||
| 297 | |||
| 298 | 6 | boost::optional<std::string> WorkflowStepResult_Impl::measureDisplayName() const { | |
| 299 | 6 | return m_measureDisplayName; | |
| 300 | } | ||
| 301 | |||
| 302 | ✗ | boost::optional<std::string> WorkflowStepResult_Impl::measureTaxonomy() const { | |
| 303 | ✗ | return m_measureTaxonomy; | |
| 304 | } | ||
| 305 | |||
| 306 | 640 | boost::optional<StepResult> WorkflowStepResult_Impl::stepResult() const { | |
| 307 | 640 | return m_stepResult; | |
| 308 | } | ||
| 309 | |||
| 310 | 345 | boost::optional<std::string> WorkflowStepResult_Impl::stepInitialCondition() const { | |
| 311 | 345 | return m_stepInitialCondition; | |
| 312 | } | ||
| 313 | |||
| 314 | 383 | boost::optional<std::string> WorkflowStepResult_Impl::stepFinalCondition() const { | |
| 315 | 383 | return m_stepFinalCondition; | |
| 316 | } | ||
| 317 | |||
| 318 | 330 | std::vector<std::string> WorkflowStepResult_Impl::stepErrors() const { | |
| 319 | 330 | return m_stepErrors; | |
| 320 | } | ||
| 321 | |||
| 322 | 274 | std::vector<std::string> WorkflowStepResult_Impl::stepWarnings() const { | |
| 323 | 274 | return m_stepWarnings; | |
| 324 | } | ||
| 325 | |||
| 326 | 267 | std::vector<std::string> WorkflowStepResult_Impl::stepInfo() const { | |
| 327 | 267 | return m_stepInfo; | |
| 328 | } | ||
| 329 | |||
| 330 | 383 | std::vector<WorkflowStepValue> WorkflowStepResult_Impl::stepValues() const { | |
| 331 | 383 | return m_stepValues; | |
| 332 | } | ||
| 333 | |||
| 334 | 253 | std::vector<openstudio::path> WorkflowStepResult_Impl::stepFiles() const { | |
| 335 | 253 | return m_stepFiles; | |
| 336 | } | ||
| 337 | |||
| 338 | 451 | boost::optional<std::string> WorkflowStepResult_Impl::stdOut() const { | |
| 339 | 451 | return m_stdOut; | |
| 340 | } | ||
| 341 | |||
| 342 | 451 | boost::optional<std::string> WorkflowStepResult_Impl::stdErr() const { | |
| 343 | 451 | return m_stdErr; | |
| 344 | } | ||
| 345 | |||
| 346 | 10 | StepResult WorkflowStepResult_Impl::value() const { | |
| 347 |
5/5✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 10 times.
✓ Branch 10 taken 10 times.
✓ Branch 13 taken 10 times.
|
10 | LOG(Debug, "WorkflowStepResult::value is deprecated, use stepResult instead"); |
| 348 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 2 taken 7 times.
|
20 | if (m_stepResult) { |
| 349 | 3 | return m_stepResult.get(); | |
| 350 | } | ||
| 351 |
5/5✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 7 times.
✓ Branch 10 taken 7 times.
✓ Branch 13 taken 7 times.
|
7 | LOG(Warn, "WorkflowStepResult value called with undefined stepResult, returning 'Success'"); |
| 352 |
1/1✓ Branch 1 taken 7 times.
|
7 | return StepResult::Success; |
| 353 | } | ||
| 354 | |||
| 355 | ✗ | std::vector<LogMessage> WorkflowStepResult_Impl::errors() const { | |
| 356 | ✗ | LOG(Debug, "WorkflowStepResult::errors is deprecated, use stepErrors instead"); | |
| 357 | ✗ | std::vector<LogMessage> result; | |
| 358 | ✗ | for (const auto& stepError : stepErrors()) { | |
| 359 | ✗ | result.emplace_back(Error, "", stepError); | |
| 360 | ✗ | } | |
| 361 | ✗ | return result; | |
| 362 | ✗ | } | |
| 363 | |||
| 364 | ✗ | std::vector<LogMessage> WorkflowStepResult_Impl::warnings() const { | |
| 365 | ✗ | LOG(Debug, "WorkflowStepResult::warnings is deprecated, use stepWarnings instead"); | |
| 366 | ✗ | std::vector<LogMessage> result; | |
| 367 | ✗ | for (const auto& stepWarning : stepWarnings()) { | |
| 368 | ✗ | result.emplace_back(Warn, "", stepWarning); | |
| 369 | ✗ | } | |
| 370 | ✗ | return result; | |
| 371 | ✗ | } | |
| 372 | |||
| 373 | ✗ | std::vector<LogMessage> WorkflowStepResult_Impl::info() const { | |
| 374 | ✗ | LOG(Debug, "WorkflowStepResult::info is deprecated, use stepInfo instead"); | |
| 375 | ✗ | std::vector<LogMessage> result; | |
| 376 | ✗ | for (const auto& info : stepInfo()) { | |
| 377 | ✗ | result.emplace_back(Info, "", info); | |
| 378 | ✗ | } | |
| 379 | ✗ | return result; | |
| 380 | ✗ | } | |
| 381 | |||
| 382 | 10 | boost::optional<LogMessage> WorkflowStepResult_Impl::initialCondition() const { | |
| 383 |
5/5✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 10 times.
✓ Branch 10 taken 10 times.
✓ Branch 13 taken 10 times.
|
10 | LOG(Debug, "WorkflowStepResult::initialCondition is deprecated, use stepInitialCondition instead"); |
| 384 | 10 | boost::optional<LogMessage> result; | |
| 385 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 2 taken 3 times.
|
20 | if (m_stepInitialCondition) { |
| 386 |
4/4✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 7 times.
✓ Branch 10 taken 7 times.
|
21 | result = LogMessage(Info, "", *m_stepInitialCondition); |
| 387 | } | ||
| 388 | 10 | return result; | |
| 389 | ✗ | } | |
| 390 | |||
| 391 | 10 | boost::optional<LogMessage> WorkflowStepResult_Impl::finalCondition() const { | |
| 392 |
5/5✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 10 times.
✓ Branch 10 taken 10 times.
✓ Branch 13 taken 10 times.
|
10 | LOG(Debug, "WorkflowStepResult::finalCondition is deprecated, use stepFinalCondition instead"); |
| 393 | 10 | boost::optional<LogMessage> result; | |
| 394 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 2 taken 3 times.
|
20 | if (m_stepFinalCondition) { |
| 395 |
4/4✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 7 times.
✓ Branch 10 taken 7 times.
|
21 | result = LogMessage(Info, "", *m_stepFinalCondition); |
| 396 | } | ||
| 397 | 10 | return result; | |
| 398 | ✗ | } | |
| 399 | |||
| 400 | 1 | std::vector<Attribute> WorkflowStepResult_Impl::attributes() const { | |
| 401 |
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(Debug, "WorkflowStepResult::attributes is deprecated, use stepValues instead"); |
| 402 | 1 | std::vector<Attribute> result; | |
| 403 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 8 taken 8 times.
✓ Branch 9 taken 1 time.
|
9 | for (const auto& stepValue : stepValues()) { |
| 404 | 8 | boost::optional<Attribute> attribute; | |
| 405 | |||
| 406 |
1/1✓ Branch 1 taken 8 times.
|
8 | const VariantType variantType = stepValue.variantType(); |
| 407 |
2/6✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
|
8 | switch (variantType.value()) { |
| 408 | ✗ | case VariantType::Boolean: | |
| 409 | ✗ | attribute = Attribute(stepValue.name(), stepValue.valueAsBoolean()); | |
| 410 | ✗ | break; | |
| 411 | ✗ | case VariantType::Double: | |
| 412 | ✗ | attribute = Attribute(stepValue.name(), stepValue.valueAsDouble()); | |
| 413 | ✗ | break; | |
| 414 | 8 | case VariantType::Integer: | |
| 415 |
4/4✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
✓ Branch 10 taken 8 times.
|
8 | attribute = Attribute(stepValue.name(), stepValue.valueAsInteger()); |
| 416 | 8 | break; | |
| 417 | ✗ | case VariantType::String: | |
| 418 | ✗ | attribute = Attribute(stepValue.name(), stepValue.valueAsString()); | |
| 419 | ✗ | break; | |
| 420 | ✗ | default: | |
| 421 | ✗ | LOG(Warn, "Unknown Variant Type " << variantType.valueName()); | |
| 422 | } | ||
| 423 | |||
| 424 |
1/2✓ Branch 0 taken 8 times.
✗ Branch 1 not taken.
|
8 | if (attribute) { |
| 425 |
3/3✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
|
8 | attribute->setDisplayName(stepValue.displayName()); |
| 426 |
2/3✓ Branch 1 taken 8 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 8 times.
|
16 | if (stepValue.units()) { |
| 427 | ✗ | attribute->setUnits(stepValue.units().get()); | |
| 428 | } | ||
| 429 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | result.push_back(*attribute); |
| 430 | } | ||
| 431 | 9 | } | |
| 432 | 1 | return result; | |
| 433 | ✗ | } | |
| 434 | |||
| 435 | 85 | void WorkflowStepResult_Impl::setStartedAt(const DateTime& dateTime) { | |
| 436 | 85 | m_startedAt = dateTime; | |
| 437 | 85 | } | |
| 438 | |||
| 439 | ✗ | void WorkflowStepResult_Impl::resetStartedAt() { | |
| 440 | ✗ | m_startedAt.reset(); | |
| 441 | ✗ | } | |
| 442 | |||
| 443 | 83 | void WorkflowStepResult_Impl::setCompletedAt(const DateTime& dateTime) { | |
| 444 | 83 | m_completedAt = dateTime; | |
| 445 | 83 | } | |
| 446 | |||
| 447 | ✗ | void WorkflowStepResult_Impl::resetCompletedAt() { | |
| 448 | ✗ | m_completedAt.reset(); | |
| 449 | ✗ | } | |
| 450 | |||
| 451 | 63 | bool WorkflowStepResult_Impl::setMeasureType(const MeasureType& measureType) { | |
| 452 | 63 | m_measureType = measureType; | |
| 453 | 63 | return true; | |
| 454 | } | ||
| 455 | |||
| 456 | ✗ | void WorkflowStepResult_Impl::resetMeasureType() { | |
| 457 | ✗ | m_measureType.reset(); | |
| 458 | ✗ | } | |
| 459 | |||
| 460 | 73 | bool WorkflowStepResult_Impl::setMeasureName(const std::string& name) { | |
| 461 | 73 | m_measureName = name; | |
| 462 | 73 | return true; | |
| 463 | } | ||
| 464 | |||
| 465 | ✗ | void WorkflowStepResult_Impl::resetMeasureName() { | |
| 466 | ✗ | m_measureName.reset(); | |
| 467 | ✗ | } | |
| 468 | |||
| 469 | 63 | bool WorkflowStepResult_Impl::setMeasureId(const std::string& id) { | |
| 470 | 63 | m_measureId = id; | |
| 471 | 63 | return true; | |
| 472 | } | ||
| 473 | |||
| 474 | ✗ | void WorkflowStepResult_Impl::resetMeasureId() { | |
| 475 | ✗ | m_measureId.reset(); | |
| 476 | ✗ | } | |
| 477 | |||
| 478 | ✗ | bool WorkflowStepResult_Impl::setMeasureUUID(const UUID& uuid) { | |
| 479 | ✗ | m_measureId = removeBraces(uuid); | |
| 480 | ✗ | return true; | |
| 481 | } | ||
| 482 | |||
| 483 | ✗ | void WorkflowStepResult_Impl::resetMeasureUUID() { | |
| 484 | ✗ | m_measureId.reset(); | |
| 485 | ✗ | } | |
| 486 | |||
| 487 | 63 | bool WorkflowStepResult_Impl::setMeasureVersionId(const std::string& id) { | |
| 488 | 63 | m_measureVersionId = id; | |
| 489 | 63 | return true; | |
| 490 | } | ||
| 491 | |||
| 492 | ✗ | void WorkflowStepResult_Impl::resetMeasureVersionId() { | |
| 493 | ✗ | m_measureVersionId.reset(); | |
| 494 | ✗ | } | |
| 495 | |||
| 496 | ✗ | bool WorkflowStepResult_Impl::setMeasureVersionUUID(const UUID& uuid) { | |
| 497 | ✗ | m_measureVersionId = removeBraces(uuid); | |
| 498 | ✗ | return true; | |
| 499 | } | ||
| 500 | |||
| 501 | ✗ | void WorkflowStepResult_Impl::resetMeasureVersionUUID() { | |
| 502 | ✗ | m_measureVersionId.reset(); | |
| 503 | ✗ | } | |
| 504 | |||
| 505 | 63 | bool WorkflowStepResult_Impl::setMeasureVersionModified(const DateTime& versionModified) { | |
| 506 |
2/2✓ Branch 1 taken 63 times.
✓ Branch 4 taken 63 times.
|
63 | m_measureVersionModified = versionModified.toISO8601(); |
| 507 | 63 | return true; | |
| 508 | } | ||
| 509 | |||
| 510 | ✗ | void WorkflowStepResult_Impl::resetMeasureVersionModified() { | |
| 511 | ✗ | m_measureVersionModified.reset(); | |
| 512 | ✗ | } | |
| 513 | |||
| 514 | 63 | bool WorkflowStepResult_Impl::setMeasureXmlChecksum(const std::string& checksum) { | |
| 515 | 63 | m_measureXmlChecksum = checksum; | |
| 516 | 63 | return true; | |
| 517 | } | ||
| 518 | |||
| 519 | ✗ | void WorkflowStepResult_Impl::resetMeasureXmlChecksum() { | |
| 520 | ✗ | m_measureXmlChecksum.reset(); | |
| 521 | ✗ | } | |
| 522 | |||
| 523 | 63 | bool WorkflowStepResult_Impl::setMeasureClassName(const std::string& className) { | |
| 524 | 63 | m_measureClassName = className; | |
| 525 | 63 | return true; | |
| 526 | } | ||
| 527 | |||
| 528 | ✗ | void WorkflowStepResult_Impl::resetMeasureClassName() { | |
| 529 | ✗ | m_measureClassName.reset(); | |
| 530 | ✗ | } | |
| 531 | |||
| 532 | 63 | bool WorkflowStepResult_Impl::setMeasureDisplayName(const std::string& displayName) { | |
| 533 | 63 | m_measureDisplayName = displayName; | |
| 534 | 63 | return true; | |
| 535 | } | ||
| 536 | |||
| 537 | ✗ | void WorkflowStepResult_Impl::resetMeasureDisplayName() { | |
| 538 | ✗ | m_measureDisplayName.reset(); | |
| 539 | ✗ | } | |
| 540 | |||
| 541 | 54 | bool WorkflowStepResult_Impl::setMeasureTaxonomy(const std::string& taxonomy) { | |
| 542 | 54 | m_measureTaxonomy = taxonomy; | |
| 543 | 54 | return true; | |
| 544 | } | ||
| 545 | |||
| 546 | ✗ | void WorkflowStepResult_Impl::resetMeasureTaxonomy() { | |
| 547 | ✗ | m_measureTaxonomy.reset(); | |
| 548 | ✗ | } | |
| 549 | |||
| 550 | 110 | void WorkflowStepResult_Impl::setStepResult(const StepResult& result) { | |
| 551 | 110 | m_stepResult = result; | |
| 552 | 110 | } | |
| 553 | |||
| 554 | ✗ | void WorkflowStepResult_Impl::resetStepResult() { | |
| 555 | ✗ | m_stepResult.reset(); | |
| 556 | ✗ | } | |
| 557 | |||
| 558 | 50 | void WorkflowStepResult_Impl::setStepInitialCondition(const std::string& initialCondition) { | |
| 559 | 50 | m_stepInitialCondition = initialCondition; | |
| 560 | 50 | } | |
| 561 | |||
| 562 | ✗ | void WorkflowStepResult_Impl::resetStepInitialCondition() { | |
| 563 | ✗ | m_stepInitialCondition.reset(); | |
| 564 | ✗ | } | |
| 565 | |||
| 566 | 62 | void WorkflowStepResult_Impl::setStepFinalCondition(const std::string& finalCondition) { | |
| 567 | 62 | m_stepFinalCondition = finalCondition; | |
| 568 | 62 | } | |
| 569 | |||
| 570 | ✗ | void WorkflowStepResult_Impl::resetStepFinalCondition() { | |
| 571 | ✗ | m_stepFinalCondition.reset(); | |
| 572 | ✗ | } | |
| 573 | |||
| 574 | 68 | void WorkflowStepResult_Impl::addStepError(const std::string& error) { | |
| 575 | 68 | m_stepErrors.push_back(error); | |
| 576 | 68 | } | |
| 577 | |||
| 578 | ✗ | void WorkflowStepResult_Impl::resetStepErrors() { | |
| 579 | ✗ | m_stepErrors.clear(); | |
| 580 | ✗ | } | |
| 581 | |||
| 582 | 72 | void WorkflowStepResult_Impl::addStepWarning(const std::string& warning) { | |
| 583 | 72 | m_stepWarnings.push_back(warning); | |
| 584 | 72 | } | |
| 585 | |||
| 586 | ✗ | void WorkflowStepResult_Impl::resetStepWarnings() { | |
| 587 | ✗ | m_stepWarnings.clear(); | |
| 588 | ✗ | } | |
| 589 | |||
| 590 | 125 | void WorkflowStepResult_Impl::addStepInfo(const std::string& info) { | |
| 591 | 125 | m_stepInfo.push_back(info); | |
| 592 | 125 | } | |
| 593 | |||
| 594 | ✗ | void WorkflowStepResult_Impl::resetStepInfo() { | |
| 595 | ✗ | m_stepInfo.clear(); | |
| 596 | ✗ | } | |
| 597 | |||
| 598 | 236 | void WorkflowStepResult_Impl::addStepValue(const WorkflowStepValue& value) { | |
| 599 | // remove any values with the same name | ||
| 600 |
1/1✓ Branch 3 taken 236 times.
|
472 | m_stepValues.erase( |
| 601 |
3/3✓ Branch 3 taken 236 times.
✓ Branch 6 taken 302 times.
✓ Branch 9 taken 302 times.
|
538 | std::remove_if(m_stepValues.begin(), m_stepValues.end(), [&value](const WorkflowStepValue& x) { return x.name() == value.name(); }), |
| 602 | 236 | m_stepValues.end()); | |
| 603 | |||
| 604 | 236 | m_stepValues.push_back(value); | |
| 605 | 236 | } | |
| 606 | |||
| 607 | ✗ | void WorkflowStepResult_Impl::resetStepValues() { | |
| 608 | ✗ | m_stepValues.clear(); | |
| 609 | ✗ | } | |
| 610 | |||
| 611 | 49 | void WorkflowStepResult_Impl::addStepFile(const openstudio::path& path) { | |
| 612 | // remove any values with the same path | ||
| 613 |
2/2✓ Branch 4 taken 49 times.
✓ Branch 8 taken 49 times.
|
85 | m_stepFiles.erase(std::remove_if(m_stepFiles.begin(), m_stepFiles.end(), [&path](const openstudio::path& x) { return x == path; }), |
| 614 | 49 | m_stepFiles.end()); | |
| 615 | |||
| 616 | 49 | m_stepFiles.push_back(path); | |
| 617 | 49 | } | |
| 618 | |||
| 619 | ✗ | void WorkflowStepResult_Impl::resetStepFiles() { | |
| 620 | ✗ | m_stepFiles.clear(); | |
| 621 | ✗ | } | |
| 622 | |||
| 623 | 77 | void WorkflowStepResult_Impl::setStdOut(const std::string& stdOut) { | |
| 624 | 77 | m_stdOut = stdOut; | |
| 625 | 77 | } | |
| 626 | |||
| 627 | ✗ | void WorkflowStepResult_Impl::resetStdOut() { | |
| 628 | ✗ | m_stdOut.reset(); | |
| 629 | ✗ | } | |
| 630 | |||
| 631 | 77 | void WorkflowStepResult_Impl::setStdErr(const std::string& stdErr) { | |
| 632 | 77 | m_stdErr = stdErr; | |
| 633 | 77 | } | |
| 634 | |||
| 635 | ✗ | void WorkflowStepResult_Impl::resetStdErr() { | |
| 636 | ✗ | m_stdErr.reset(); | |
| 637 | ✗ | } | |
| 638 | |||
| 639 | 4 | void WorkflowStepResult_Impl::showOutput() const { | |
| 640 |
1/1✓ Branch 1 taken 4 times.
|
4 | fmt::print("**MEASURE APPLICABILITY**\n"); |
| 641 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | const int applicability = this->value().value(); |
| 642 |
2/5✗ Branch 0 not taken.
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
4 | switch (applicability) { |
| 643 | ✗ | case StepResult::Skip: | |
| 644 | ✗ | fmt::print("{} = Skipped\n", applicability); | |
| 645 | ✗ | break; | |
| 646 | ✗ | case StepResult::NA: | |
| 647 | ✗ | fmt::print("{} = Not Applicable\n", applicability); | |
| 648 | ✗ | break; | |
| 649 | 3 | case StepResult::Success: | |
| 650 |
1/1✓ Branch 1 taken 3 times.
|
3 | fmt::print("{} = Success\n", applicability); |
| 651 | 3 | break; | |
| 652 | 1 | case StepResult::Fail: | |
| 653 |
1/1✓ Branch 1 taken 1 time.
|
1 | fmt::print("{} = Fail\n", applicability); |
| 654 | 1 | break; | |
| 655 | ✗ | default: | |
| 656 | ✗ | throw std::runtime_error(fmt::format("{} = Unknown Status", applicability)); | |
| 657 | } | ||
| 658 | |||
| 659 |
1/1✓ Branch 1 taken 4 times.
|
4 | fmt::print("**INITIAL CONDITION**\n"); |
| 660 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 2 taken 3 times.
|
8 | if (m_stepInitialCondition) { |
| 661 |
1/1✓ Branch 1 taken 1 time.
|
2 | fmt::print("{}\n", *m_stepInitialCondition); |
| 662 | } | ||
| 663 | |||
| 664 |
1/1✓ Branch 1 taken 4 times.
|
4 | fmt::print("**FINAL CONDITION**\n"); |
| 665 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 2 taken 3 times.
|
8 | if (m_stepFinalCondition) { |
| 666 |
1/1✓ Branch 1 taken 1 time.
|
2 | fmt::print("{}\n", *m_stepFinalCondition); |
| 667 | } | ||
| 668 | |||
| 669 |
1/1✓ Branch 1 taken 4 times.
|
4 | fmt::print("**INFO MESSAGES**\n"); |
| 670 |
2/2✓ Branch 4 taken 2 times.
✓ Branch 5 taken 4 times.
|
6 | for (const auto& msg : m_stepInfo) { |
| 671 | 4 | fmt::print("{}\n", msg); | |
| 672 | } | ||
| 673 | |||
| 674 |
1/1✓ Branch 1 taken 4 times.
|
4 | fmt::print("**WARNING MESSAGES**\n"); |
| 675 |
1/2✗ Branch 4 not taken.
✓ Branch 5 taken 4 times.
|
4 | for (const auto& msg : m_stepWarnings) { |
| 676 | ✗ | fmt::print("{}\n", msg); | |
| 677 | } | ||
| 678 | |||
| 679 |
1/1✓ Branch 1 taken 4 times.
|
4 | fmt::print("**ERROR MESSAGES**\n"); |
| 680 |
2/2✓ Branch 4 taken 1 time.
✓ Branch 5 taken 4 times.
|
5 | for (const auto& msg : m_stepErrors) { |
| 681 | 2 | fmt::print("{}\n", msg); | |
| 682 | } | ||
| 683 | |||
| 684 |
1/1✓ Branch 1 taken 4 times.
|
4 | fmt::print("***Machine-Readable Attributes**\n"); |
| 685 |
1/1✓ Branch 1 taken 4 times.
|
8 | Json::Value top_root(Json::arrayValue); |
| 686 |
2/2✓ Branch 4 taken 6 times.
✓ Branch 5 taken 4 times.
|
10 | for (const auto& stepValue : m_stepValues) { |
| 687 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | top_root.append(stepValue.toJSON()); // This moves, calls `Value & append (Value &&value)` |
| 688 | } | ||
| 689 |
1/1✓ Branch 1 taken 4 times.
|
4 | Json::StreamWriterBuilder wbuilder; |
| 690 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
|
12 | wbuilder["indentation"] = " "; |
| 691 |
1/1✓ Branch 1 taken 4 times.
|
8 | fmt::print("{}\n", Json::writeString(wbuilder, top_root)); |
| 692 | |||
| 693 |
1/1✓ Branch 1 taken 4 times.
|
4 | fmt::print("***Files Generated**\n"); |
| 694 |
2/3✓ Branch 1 taken 4 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 4 times.
|
4 | for (const auto& file_path : this->stepFiles()) { |
| 695 | ✗ | fmt::print("{}\n", openstudio::toString(file_path)); | |
| 696 | 4 | } | |
| 697 | |||
| 698 |
1/1✓ Branch 1 taken 4 times.
|
4 | fmt::print("\n\n"); |
| 699 | 4 | } | |
| 700 | |||
| 701 | } // namespace detail | ||
| 702 | |||
| 703 | ✗ | WorkflowStepValue::WorkflowStepValue(const std::string& name, const Variant& value) | |
| 704 | ✗ | : m_impl(std::shared_ptr<detail::WorkflowStepValue_Impl>(new detail::WorkflowStepValue_Impl(name, value))) {} | |
| 705 | |||
| 706 | 30 | WorkflowStepValue::WorkflowStepValue(const std::string& name, const std::string& value) | |
| 707 |
3/5✓ Branch 2 taken 30 times.
✓ Branch 5 taken 30 times.
✓ Branch 8 taken 30 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
|
30 | : m_impl(std::shared_ptr<detail::WorkflowStepValue_Impl>(new detail::WorkflowStepValue_Impl(name, Variant(value)))) {} |
| 708 | |||
| 709 | 6 | WorkflowStepValue::WorkflowStepValue(const std::string& name, const char* value) | |
| 710 |
4/6✓ Branch 2 taken 6 times.
✓ Branch 5 taken 6 times.
✓ Branch 8 taken 6 times.
✓ Branch 11 taken 6 times.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
|
18 | : m_impl(std::shared_ptr<detail::WorkflowStepValue_Impl>(new detail::WorkflowStepValue_Impl(name, Variant(std::string(value))))) {} |
| 711 | |||
| 712 | 85 | WorkflowStepValue::WorkflowStepValue(const std::string& name, double value) | |
| 713 |
3/5✓ Branch 2 taken 85 times.
✓ Branch 5 taken 85 times.
✓ Branch 8 taken 85 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
|
85 | : m_impl(std::shared_ptr<detail::WorkflowStepValue_Impl>(new detail::WorkflowStepValue_Impl(name, Variant(value)))) {} |
| 714 | |||
| 715 | 51 | WorkflowStepValue::WorkflowStepValue(const std::string& name, int value) | |
| 716 |
3/5✓ Branch 2 taken 51 times.
✓ Branch 5 taken 51 times.
✓ Branch 8 taken 51 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
|
51 | : m_impl(std::shared_ptr<detail::WorkflowStepValue_Impl>(new detail::WorkflowStepValue_Impl(name, Variant(value)))) {} |
| 717 | |||
| 718 | 66 | WorkflowStepValue::WorkflowStepValue(const std::string& name, bool value) | |
| 719 |
3/5✓ Branch 2 taken 66 times.
✓ Branch 5 taken 66 times.
✓ Branch 8 taken 66 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
|
66 | : m_impl(std::shared_ptr<detail::WorkflowStepValue_Impl>(new detail::WorkflowStepValue_Impl(name, Variant(value)))) {} |
| 720 | |||
| 721 | 56 | boost::optional<WorkflowStepValue> WorkflowStepValue::fromString(const std::string& s) { | |
| 722 | // We let it fail with a warning message | ||
| 723 |
1/1✓ Branch 1 taken 56 times.
|
56 | const Json::CharReaderBuilder rbuilder; |
| 724 |
1/1✓ Branch 1 taken 56 times.
|
56 | std::istringstream ss(s); |
| 725 | 56 | std::string formattedErrors; | |
| 726 |
1/1✓ Branch 1 taken 56 times.
|
56 | Json::Value value; |
| 727 |
1/1✓ Branch 1 taken 56 times.
|
56 | const bool parsingSuccessful = Json::parseFromStream(rbuilder, ss, &value, &formattedErrors); |
| 728 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 56 times.
|
56 | if (!parsingSuccessful) { |
| 729 | ✗ | LOG(Warn, "Couldn't parse WorkflowStepValue from string s='" << s << "'. Error: '" << formattedErrors << "'."); | |
| 730 | ✗ | return boost::none; | |
| 731 | } | ||
| 732 | |||
| 733 | 56 | boost::optional<WorkflowStepValue> result; | |
| 734 | |||
| 735 | try { | ||
| 736 |
2/2✓ Branch 1 taken 56 times.
✓ Branch 4 taken 56 times.
|
56 | const std::string name = value["name"].asString(); |
| 737 |
2/2✓ Branch 1 taken 56 times.
✓ Branch 4 taken 56 times.
|
56 | const Json::Value v = value["value"]; |
| 738 |
3/3✓ Branch 1 taken 56 times.
✓ Branch 3 taken 12 times.
✓ Branch 4 taken 44 times.
|
56 | if (v.isString()) { |
| 739 |
3/3✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
✓ Branch 7 taken 12 times.
|
12 | result = WorkflowStepValue(name, v.asString()); |
| 740 |
3/3✓ Branch 1 taken 44 times.
✓ Branch 3 taken 14 times.
✓ Branch 4 taken 30 times.
|
44 | } else if (v.isIntegral()) { |
| 741 |
3/3✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
✓ Branch 7 taken 14 times.
|
14 | result = WorkflowStepValue(name, v.asInt()); |
| 742 |
3/3✓ Branch 1 taken 30 times.
✓ Branch 3 taken 15 times.
✓ Branch 4 taken 15 times.
|
30 | } else if (v.isDouble()) { |
| 743 |
3/3✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
|
15 | result = WorkflowStepValue(name, v.asDouble()); |
| 744 |
2/3✓ Branch 1 taken 15 times.
✓ Branch 3 taken 15 times.
✗ Branch 4 not taken.
|
15 | } else if (v.isBool()) { |
| 745 |
3/3✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
|
15 | result = WorkflowStepValue(name, v.asBool()); |
| 746 | } else { | ||
| 747 | //error | ||
| 748 | } | ||
| 749 | |||
| 750 |
0/2✗ Branch 4 not taken.
✗ Branch 5 not taken.
|
56 | } catch (const std::exception&) { |
| 751 | ✗ | return boost::none; | |
| 752 | ✗ | } | |
| 753 | |||
| 754 | 56 | return result; | |
| 755 | 56 | } | |
| 756 | |||
| 757 | ✗ | std::string WorkflowStepValue::string() const { | |
| 758 | ✗ | return getImpl<detail::WorkflowStepValue_Impl>()->string(); | |
| 759 | } | ||
| 760 | |||
| 761 | 421 | Json::Value WorkflowStepValue::toJSON() const { | |
| 762 |
1/1✓ Branch 3 taken 421 times.
|
421 | return getImpl<detail::WorkflowStepValue_Impl>()->toJSON(); |
| 763 | } | ||
| 764 | |||
| 765 | 736 | std::string WorkflowStepValue::name() const { | |
| 766 |
1/1✓ Branch 3 taken 736 times.
|
736 | return getImpl<detail::WorkflowStepValue_Impl>()->name(); |
| 767 | } | ||
| 768 | |||
| 769 | 8 | std::string WorkflowStepValue::displayName() const { | |
| 770 |
1/1✓ Branch 3 taken 8 times.
|
8 | return getImpl<detail::WorkflowStepValue_Impl>()->displayName(); |
| 771 | } | ||
| 772 | |||
| 773 | 8 | boost::optional<std::string> WorkflowStepValue::units() const { | |
| 774 |
1/1✓ Branch 3 taken 8 times.
|
8 | return getImpl<detail::WorkflowStepValue_Impl>()->units(); |
| 775 | } | ||
| 776 | |||
| 777 | 63 | VariantType WorkflowStepValue::variantType() const { | |
| 778 |
1/1✓ Branch 3 taken 63 times.
|
63 | return getImpl<detail::WorkflowStepValue_Impl>()->variantType(); |
| 779 | } | ||
| 780 | |||
| 781 | 41 | Variant WorkflowStepValue::valueAsVariant() const { | |
| 782 |
1/1✓ Branch 3 taken 41 times.
|
41 | return getImpl<detail::WorkflowStepValue_Impl>()->valueAsVariant(); |
| 783 | } | ||
| 784 | |||
| 785 | 9 | bool WorkflowStepValue::valueAsBoolean() const { | |
| 786 |
1/1✓ Branch 3 taken 9 times.
|
9 | return getImpl<detail::WorkflowStepValue_Impl>()->valueAsBoolean(); |
| 787 | } | ||
| 788 | |||
| 789 | 15 | int WorkflowStepValue::valueAsInteger() const { | |
| 790 |
1/1✓ Branch 3 taken 15 times.
|
15 | return getImpl<detail::WorkflowStepValue_Impl>()->valueAsInteger(); |
| 791 | } | ||
| 792 | |||
| 793 | 27 | double WorkflowStepValue::valueAsDouble() const { | |
| 794 |
1/1✓ Branch 3 taken 27 times.
|
27 | return getImpl<detail::WorkflowStepValue_Impl>()->valueAsDouble(); |
| 795 | } | ||
| 796 | |||
| 797 | 3 | std::string WorkflowStepValue::valueAsString() const { | |
| 798 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::WorkflowStepValue_Impl>()->valueAsString(); |
| 799 | } | ||
| 800 | |||
| 801 | 3 | Json::Value WorkflowStepValue::valueAsJSON() const { | |
| 802 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::WorkflowStepValue_Impl>()->valueAsJSON(); |
| 803 | } | ||
| 804 | |||
| 805 | ✗ | void WorkflowStepValue::setName(const std::string& name) { | |
| 806 | ✗ | getImpl<detail::WorkflowStepValue_Impl>()->setName(name); | |
| 807 | ✗ | } | |
| 808 | |||
| 809 | 38 | void WorkflowStepValue::setDisplayName(const std::string& displayName) { | |
| 810 |
1/1✓ Branch 3 taken 38 times.
|
38 | getImpl<detail::WorkflowStepValue_Impl>()->setDisplayName(displayName); |
| 811 | 38 | } | |
| 812 | |||
| 813 | ✗ | void WorkflowStepValue::resetDisplayName() { | |
| 814 | ✗ | getImpl<detail::WorkflowStepValue_Impl>()->resetDisplayName(); | |
| 815 | ✗ | } | |
| 816 | |||
| 817 | 38 | void WorkflowStepValue::setUnits(const std::string& units) { | |
| 818 |
1/1✓ Branch 3 taken 38 times.
|
38 | getImpl<detail::WorkflowStepValue_Impl>()->setUnits(units); |
| 819 | 38 | } | |
| 820 | |||
| 821 | ✗ | void WorkflowStepValue::resetUnits() { | |
| 822 | ✗ | getImpl<detail::WorkflowStepValue_Impl>()->resetUnits(); | |
| 823 | ✗ | } | |
| 824 | |||
| 825 |
2/4✓ Branch 2 taken 240 times.
✓ Branch 5 taken 240 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
|
240 | WorkflowStepResult::WorkflowStepResult() : m_impl(std::shared_ptr<detail::WorkflowStepResult_Impl>(new detail::WorkflowStepResult_Impl)) { |
| 826 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 240 times.
✗ Branch 5 not taken.
|
240 | OS_ASSERT(getImpl<detail::WorkflowStepResult_Impl>()); |
| 827 | 240 | } | |
| 828 | |||
| 829 | 475 | WorkflowStepResult::WorkflowStepResult(const WorkflowStepResult& other) = default; | |
| 830 | |||
| 831 | ✗ | WorkflowStepResult::WorkflowStepResult(std::shared_ptr<detail::WorkflowStepResult_Impl> impl) : m_impl(std::move(impl)) {} | |
| 832 | |||
| 833 | 17 | boost::optional<WorkflowStepResult> WorkflowStepResult::fromString(const std::string& s) { | |
| 834 | // We let it fail with a warning message | ||
| 835 |
1/1✓ Branch 1 taken 17 times.
|
17 | const Json::CharReaderBuilder rbuilder; |
| 836 |
1/1✓ Branch 1 taken 17 times.
|
17 | std::istringstream ss(s); |
| 837 | 17 | std::string formattedErrors; | |
| 838 |
1/1✓ Branch 1 taken 17 times.
|
17 | Json::Value value; |
| 839 |
1/1✓ Branch 1 taken 17 times.
|
17 | const bool parsingSuccessful = Json::parseFromStream(rbuilder, ss, &value, &formattedErrors); |
| 840 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
|
17 | if (!parsingSuccessful) { |
| 841 | ✗ | LOG(Warn, "Couldn't parse WorkflowStepResult from string s='" << s << "'. Error: '" << formattedErrors << "'."); | |
| 842 | ✗ | return boost::none; | |
| 843 | } | ||
| 844 | |||
| 845 |
1/1✓ Branch 1 taken 17 times.
|
17 | WorkflowStepResult result; |
| 846 | |||
| 847 | try { | ||
| 848 | |||
| 849 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 3 taken 12 times.
✓ Branch 4 taken 5 times.
|
17 | if (value.isMember("started_at")) { |
| 850 |
3/3✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
✓ Branch 7 taken 12 times.
|
12 | boost::optional<DateTime> dateTime = DateTime::fromISO8601(value["started_at"].asString()); |
| 851 |
1/2✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
|
12 | if (dateTime) { |
| 852 |
2/2✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
|
12 | result.setStartedAt(*dateTime); |
| 853 | } | ||
| 854 | 12 | } | |
| 855 | |||
| 856 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 3 taken 15 times.
✓ Branch 4 taken 2 times.
|
17 | if (value.isMember("completed_at")) { |
| 857 |
3/3✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
|
15 | boost::optional<DateTime> dateTime = DateTime::fromISO8601(value["completed_at"].asString()); |
| 858 |
1/2✓ Branch 0 taken 15 times.
✗ Branch 1 not taken.
|
15 | if (dateTime) { |
| 859 |
2/2✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
|
15 | result.setCompletedAt(*dateTime); |
| 860 | } | ||
| 861 | 15 | } | |
| 862 | |||
| 863 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 3 taken 6 times.
✓ Branch 4 taken 11 times.
|
17 | if (value.isMember("measure_type")) { |
| 864 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | const Json::Value measureType = value["measure_type"]; |
| 865 | try { | ||
| 866 |
3/3✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
|
6 | result.setMeasureType(MeasureType(measureType.asString())); |
| 867 | ✗ | } catch (const std::exception&) { | |
| 868 | ✗ | LOG(Error, measureType.asString() << " is not a valid MeasureType.") | |
| 869 | ✗ | } | |
| 870 | 6 | } | |
| 871 | |||
| 872 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 3 taken 9 times.
✓ Branch 4 taken 8 times.
|
17 | if (value.isMember("measure_name")) { |
| 873 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | const Json::Value measureName = value["measure_name"]; |
| 874 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | result.setMeasureName(measureName.asString()); |
| 875 | 9 | } | |
| 876 | |||
| 877 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 3 taken 6 times.
✓ Branch 4 taken 11 times.
|
17 | if (value.isMember("measure_uid")) { |
| 878 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | const Json::Value measureId = value["measure_uid"]; |
| 879 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | result.setMeasureId(measureId.asString()); |
| 880 | 6 | } | |
| 881 | |||
| 882 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 3 taken 6 times.
✓ Branch 4 taken 11 times.
|
17 | if (value.isMember("measure_version_id")) { |
| 883 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | const Json::Value versionId = value["measure_version_id"]; |
| 884 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | result.setMeasureVersionId(versionId.asString()); |
| 885 | 6 | } | |
| 886 | |||
| 887 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 3 taken 6 times.
✓ Branch 4 taken 11 times.
|
17 | if (value.isMember("measure_version_modified")) { |
| 888 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | const Json::Value versionModified = value["measure_version_modified"]; |
| 889 |
1/1✓ Branch 1 taken 6 times.
|
6 | const std::string str = versionModified.asString(); |
| 890 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | boost::optional<DateTime> dateTime = DateTime::fromISO8601(versionModified.asString()); |
| 891 |
1/2✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
|
6 | if (dateTime) { |
| 892 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | result.setMeasureVersionModified(dateTime.get()); |
| 893 | } | ||
| 894 | 6 | } | |
| 895 | |||
| 896 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 3 taken 6 times.
✓ Branch 4 taken 11 times.
|
17 | if (value.isMember("measure_xml_checksum")) { |
| 897 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | const Json::Value checksum = value["measure_xml_checksum"]; |
| 898 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | result.setMeasureXmlChecksum(checksum.asString()); |
| 899 | 6 | } | |
| 900 | |||
| 901 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 3 taken 6 times.
✓ Branch 4 taken 11 times.
|
17 | if (value.isMember("measure_class_name")) { |
| 902 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | const Json::Value className = value["measure_class_name"]; |
| 903 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | result.setMeasureClassName(className.asString()); |
| 904 | 6 | } | |
| 905 | |||
| 906 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 3 taken 6 times.
✓ Branch 4 taken 11 times.
|
17 | if (value.isMember("measure_display_name")) { |
| 907 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | const Json::Value displayName = value["measure_display_name"]; |
| 908 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | result.setMeasureDisplayName(displayName.asString()); |
| 909 | 6 | } | |
| 910 | |||
| 911 |
2/3✓ Branch 1 taken 17 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 17 times.
|
17 | if (value.isMember("measure_taxonomy")) { |
| 912 | ✗ | const Json::Value taxonomy = value["measure_taxonomy"]; | |
| 913 | ✗ | result.setMeasureTaxonomy(taxonomy.asString()); | |
| 914 | ✗ | } | |
| 915 | |||
| 916 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 3 taken 15 times.
✓ Branch 4 taken 2 times.
|
17 | if (value.isMember("step_result")) { |
| 917 |
3/3✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
|
15 | const StepResult stepResult(value["step_result"].asString()); |
| 918 |
1/1✓ Branch 1 taken 15 times.
|
15 | result.setStepResult(stepResult); |
| 919 | } | ||
| 920 | |||
| 921 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 3 taken 14 times.
✓ Branch 4 taken 3 times.
|
17 | if (value.isMember("step_initial_condition")) { |
| 922 |
3/3✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
✓ Branch 7 taken 14 times.
|
14 | result.setStepInitialCondition(value["step_initial_condition"].asString()); |
| 923 | } | ||
| 924 | |||
| 925 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 3 taken 14 times.
✓ Branch 4 taken 3 times.
|
17 | if (value.isMember("step_final_condition")) { |
| 926 |
3/3✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
✓ Branch 7 taken 14 times.
|
14 | result.setStepFinalCondition(value["step_final_condition"].asString()); |
| 927 | } | ||
| 928 | |||
| 929 |
1/1✓ Branch 1 taken 17 times.
|
17 | const Json::Value defaultArrayValue(Json::arrayValue); |
| 930 | |||
| 931 |
1/1✓ Branch 1 taken 17 times.
|
17 | Json::Value errors = value.get("step_errors", defaultArrayValue); |
| 932 |
1/1✓ Branch 1 taken 17 times.
|
17 | Json::ArrayIndex n = errors.size(); |
| 933 |
2/2✓ Branch 0 taken 38 times.
✓ Branch 1 taken 17 times.
|
55 | for (Json::ArrayIndex i = 0; i < n; ++i) { |
| 934 |
3/3✓ Branch 1 taken 38 times.
✓ Branch 4 taken 38 times.
✓ Branch 7 taken 38 times.
|
38 | result.addStepError(errors[i].asString()); |
| 935 | } | ||
| 936 | |||
| 937 |
1/1✓ Branch 1 taken 17 times.
|
17 | Json::Value warnings = value.get("step_warnings", defaultArrayValue); |
| 938 |
1/1✓ Branch 1 taken 17 times.
|
17 | n = warnings.size(); |
| 939 |
2/2✓ Branch 0 taken 38 times.
✓ Branch 1 taken 17 times.
|
55 | for (Json::ArrayIndex i = 0; i < n; ++i) { |
| 940 |
3/3✓ Branch 1 taken 38 times.
✓ Branch 4 taken 38 times.
✓ Branch 7 taken 38 times.
|
38 | result.addStepWarning(warnings[i].asString()); |
| 941 | } | ||
| 942 | |||
| 943 |
1/1✓ Branch 1 taken 17 times.
|
17 | Json::Value info = value.get("step_info", defaultArrayValue); |
| 944 |
1/1✓ Branch 1 taken 17 times.
|
17 | n = info.size(); |
| 945 |
2/2✓ Branch 0 taken 38 times.
✓ Branch 1 taken 17 times.
|
55 | for (Json::ArrayIndex i = 0; i < n; ++i) { |
| 946 |
3/3✓ Branch 1 taken 38 times.
✓ Branch 4 taken 38 times.
✓ Branch 7 taken 38 times.
|
38 | result.addStepInfo(info[i].asString()); |
| 947 | } | ||
| 948 | |||
| 949 |
1/1✓ Branch 1 taken 17 times.
|
17 | Json::Value stepValues = value.get("step_values", defaultArrayValue); |
| 950 |
1/1✓ Branch 1 taken 17 times.
|
17 | n = stepValues.size(); |
| 951 | |||
| 952 |
1/2✓ Branch 0 taken 17 times.
✗ Branch 1 not taken.
|
17 | if (n > 0) { |
| 953 |
1/1✓ Branch 1 taken 17 times.
|
17 | Json::StreamWriterBuilder wbuilder; |
| 954 | // mimic the old StyledWriter behavior: | ||
| 955 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
✓ Branch 7 taken 17 times.
|
51 | wbuilder["indentation"] = " "; |
| 956 |
2/2✓ Branch 0 taken 56 times.
✓ Branch 1 taken 17 times.
|
73 | for (Json::ArrayIndex i = 0; i < n; ++i) { |
| 957 |
2/2✓ Branch 1 taken 56 times.
✓ Branch 4 taken 56 times.
|
56 | const std::string stepval_str = Json::writeString(wbuilder, stepValues[i]); |
| 958 |
1/1✓ Branch 1 taken 56 times.
|
56 | boost::optional<WorkflowStepValue> workflowStepValue = WorkflowStepValue::fromString(stepval_str); |
| 959 |
1/2✓ Branch 0 taken 56 times.
✗ Branch 1 not taken.
|
56 | if (workflowStepValue) { |
| 960 |
2/2✓ Branch 1 taken 56 times.
✓ Branch 4 taken 56 times.
|
56 | result.addStepValue(*workflowStepValue); |
| 961 | } | ||
| 962 | 56 | } | |
| 963 | 17 | } | |
| 964 | |||
| 965 |
1/1✓ Branch 1 taken 17 times.
|
17 | Json::Value files = value.get("step_files", defaultArrayValue); |
| 966 |
1/1✓ Branch 1 taken 17 times.
|
17 | n = files.size(); |
| 967 |
2/2✓ Branch 0 taken 24 times.
✓ Branch 1 taken 17 times.
|
41 | for (Json::ArrayIndex i = 0; i < n; ++i) { |
| 968 |
4/4✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
✓ Branch 10 taken 24 times.
|
24 | result.addStepFile(toPath(files[i].asString())); |
| 969 | } | ||
| 970 | |||
| 971 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 3 taken 14 times.
✓ Branch 4 taken 3 times.
|
17 | if (value.isMember("stdout")) { |
| 972 |
3/3✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
✓ Branch 7 taken 14 times.
|
14 | result.setStdOut(value["stdout"].asString()); |
| 973 | } | ||
| 974 | |||
| 975 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 3 taken 14 times.
✓ Branch 4 taken 3 times.
|
17 | if (value.isMember("stderr")) { |
| 976 |
3/3✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
✓ Branch 7 taken 14 times.
|
14 | result.setStdErr(value["stderr"].asString()); |
| 977 | } | ||
| 978 | |||
| 979 |
0/2✗ Branch 12 not taken.
✗ Branch 13 not taken.
|
17 | } catch (const std::exception&) { |
| 980 | ✗ | return boost::none; | |
| 981 | ✗ | } | |
| 982 | |||
| 983 |
1/1✓ Branch 1 taken 17 times.
|
17 | return result; |
| 984 | 17 | } | |
| 985 | |||
| 986 | 6 | std::string WorkflowStepResult::string() const { | |
| 987 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::WorkflowStepResult_Impl>()->string(); |
| 988 | } | ||
| 989 | |||
| 990 | 225 | Json::Value WorkflowStepResult::toJSON() const { | |
| 991 |
1/1✓ Branch 3 taken 225 times.
|
225 | return getImpl<detail::WorkflowStepResult_Impl>()->toJSON(); |
| 992 | } | ||
| 993 | |||
| 994 | 18 | boost::optional<DateTime> WorkflowStepResult::startedAt() const { | |
| 995 |
1/1✓ Branch 3 taken 18 times.
|
18 | return getImpl<detail::WorkflowStepResult_Impl>()->startedAt(); |
| 996 | } | ||
| 997 | |||
| 998 | 18 | boost::optional<DateTime> WorkflowStepResult::completedAt() const { | |
| 999 |
1/1✓ Branch 3 taken 18 times.
|
18 | return getImpl<detail::WorkflowStepResult_Impl>()->completedAt(); |
| 1000 | } | ||
| 1001 | |||
| 1002 | 6 | boost::optional<MeasureType> WorkflowStepResult::measureType() const { | |
| 1003 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::WorkflowStepResult_Impl>()->measureType(); |
| 1004 | } | ||
| 1005 | |||
| 1006 | 19 | boost::optional<std::string> WorkflowStepResult::measureName() const { | |
| 1007 |
1/1✓ Branch 3 taken 19 times.
|
19 | return getImpl<detail::WorkflowStepResult_Impl>()->measureName(); |
| 1008 | } | ||
| 1009 | |||
| 1010 | 6 | boost::optional<std::string> WorkflowStepResult::measureId() const { | |
| 1011 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::WorkflowStepResult_Impl>()->measureId(); |
| 1012 | } | ||
| 1013 | |||
| 1014 | 3 | boost::optional<UUID> WorkflowStepResult::measureUUID() const { | |
| 1015 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::WorkflowStepResult_Impl>()->measureUUID(); |
| 1016 | } | ||
| 1017 | |||
| 1018 | 6 | boost::optional<std::string> WorkflowStepResult::measureVersionId() const { | |
| 1019 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::WorkflowStepResult_Impl>()->measureVersionId(); |
| 1020 | } | ||
| 1021 | |||
| 1022 | 3 | boost::optional<UUID> WorkflowStepResult::measureVersionUUID() const { | |
| 1023 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::WorkflowStepResult_Impl>()->measureVersionUUID(); |
| 1024 | } | ||
| 1025 | |||
| 1026 | 6 | boost::optional<DateTime> WorkflowStepResult::measureVersionModified() const { | |
| 1027 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::WorkflowStepResult_Impl>()->measureVersionModified(); |
| 1028 | } | ||
| 1029 | |||
| 1030 | 6 | boost::optional<std::string> WorkflowStepResult::measureXmlChecksum() const { | |
| 1031 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::WorkflowStepResult_Impl>()->measureXmlChecksum(); |
| 1032 | } | ||
| 1033 | |||
| 1034 | 6 | boost::optional<std::string> WorkflowStepResult::measureClassName() const { | |
| 1035 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::WorkflowStepResult_Impl>()->measureClassName(); |
| 1036 | } | ||
| 1037 | |||
| 1038 | 6 | boost::optional<std::string> WorkflowStepResult::measureDisplayName() const { | |
| 1039 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::WorkflowStepResult_Impl>()->measureDisplayName(); |
| 1040 | } | ||
| 1041 | |||
| 1042 | ✗ | boost::optional<std::string> WorkflowStepResult::measureTaxonomy() const { | |
| 1043 | ✗ | return getImpl<detail::WorkflowStepResult_Impl>()->measureTaxonomy(); | |
| 1044 | } | ||
| 1045 | |||
| 1046 | 186 | boost::optional<StepResult> WorkflowStepResult::stepResult() const { | |
| 1047 |
1/1✓ Branch 3 taken 186 times.
|
186 | return getImpl<detail::WorkflowStepResult_Impl>()->stepResult(); |
| 1048 | } | ||
| 1049 | |||
| 1050 | 17 | boost::optional<std::string> WorkflowStepResult::stepInitialCondition() const { | |
| 1051 |
1/1✓ Branch 3 taken 17 times.
|
17 | return getImpl<detail::WorkflowStepResult_Impl>()->stepInitialCondition(); |
| 1052 | } | ||
| 1053 | |||
| 1054 | 17 | boost::optional<std::string> WorkflowStepResult::stepFinalCondition() const { | |
| 1055 |
1/1✓ Branch 3 taken 17 times.
|
17 | return getImpl<detail::WorkflowStepResult_Impl>()->stepFinalCondition(); |
| 1056 | } | ||
| 1057 | |||
| 1058 | 95 | std::vector<std::string> WorkflowStepResult::stepErrors() const { | |
| 1059 |
1/1✓ Branch 3 taken 95 times.
|
95 | return getImpl<detail::WorkflowStepResult_Impl>()->stepErrors(); |
| 1060 | } | ||
| 1061 | |||
| 1062 | 39 | std::vector<std::string> WorkflowStepResult::stepWarnings() const { | |
| 1063 |
1/1✓ Branch 3 taken 39 times.
|
39 | return getImpl<detail::WorkflowStepResult_Impl>()->stepWarnings(); |
| 1064 | } | ||
| 1065 | |||
| 1066 | 32 | std::vector<std::string> WorkflowStepResult::stepInfo() const { | |
| 1067 |
1/1✓ Branch 3 taken 32 times.
|
32 | return getImpl<detail::WorkflowStepResult_Impl>()->stepInfo(); |
| 1068 | } | ||
| 1069 | |||
| 1070 | 147 | std::vector<WorkflowStepValue> WorkflowStepResult::stepValues() const { | |
| 1071 |
1/1✓ Branch 3 taken 147 times.
|
147 | return getImpl<detail::WorkflowStepResult_Impl>()->stepValues(); |
| 1072 | } | ||
| 1073 | |||
| 1074 | 18 | std::vector<openstudio::path> WorkflowStepResult::stepFiles() const { | |
| 1075 |
1/1✓ Branch 3 taken 18 times.
|
18 | return getImpl<detail::WorkflowStepResult_Impl>()->stepFiles(); |
| 1076 | } | ||
| 1077 | |||
| 1078 | 18 | boost::optional<std::string> WorkflowStepResult::stdOut() const { | |
| 1079 |
1/1✓ Branch 3 taken 18 times.
|
18 | return getImpl<detail::WorkflowStepResult_Impl>()->stdOut(); |
| 1080 | } | ||
| 1081 | |||
| 1082 | 18 | boost::optional<std::string> WorkflowStepResult::stdErr() const { | |
| 1083 |
1/1✓ Branch 3 taken 18 times.
|
18 | return getImpl<detail::WorkflowStepResult_Impl>()->stdErr(); |
| 1084 | } | ||
| 1085 | |||
| 1086 | 6 | StepResult WorkflowStepResult::value() const { | |
| 1087 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::WorkflowStepResult_Impl>()->value(); |
| 1088 | } | ||
| 1089 | |||
| 1090 | ✗ | std::vector<LogMessage> WorkflowStepResult::errors() const { | |
| 1091 | ✗ | return getImpl<detail::WorkflowStepResult_Impl>()->errors(); | |
| 1092 | } | ||
| 1093 | |||
| 1094 | ✗ | std::vector<LogMessage> WorkflowStepResult::warnings() const { | |
| 1095 | ✗ | return getImpl<detail::WorkflowStepResult_Impl>()->warnings(); | |
| 1096 | } | ||
| 1097 | |||
| 1098 | ✗ | std::vector<LogMessage> WorkflowStepResult::info() const { | |
| 1099 | ✗ | return getImpl<detail::WorkflowStepResult_Impl>()->info(); | |
| 1100 | } | ||
| 1101 | |||
| 1102 | 10 | boost::optional<LogMessage> WorkflowStepResult::initialCondition() const { | |
| 1103 |
1/1✓ Branch 3 taken 10 times.
|
10 | return getImpl<detail::WorkflowStepResult_Impl>()->initialCondition(); |
| 1104 | } | ||
| 1105 | |||
| 1106 | 10 | boost::optional<LogMessage> WorkflowStepResult::finalCondition() const { | |
| 1107 |
1/1✓ Branch 3 taken 10 times.
|
10 | return getImpl<detail::WorkflowStepResult_Impl>()->finalCondition(); |
| 1108 | } | ||
| 1109 | |||
| 1110 | 1 | std::vector<Attribute> WorkflowStepResult::attributes() const { | |
| 1111 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::WorkflowStepResult_Impl>()->attributes(); |
| 1112 | } | ||
| 1113 | |||
| 1114 | 85 | void WorkflowStepResult::setStartedAt(const DateTime& dateTime) { | |
| 1115 |
1/1✓ Branch 3 taken 85 times.
|
85 | getImpl<detail::WorkflowStepResult_Impl>()->setStartedAt(dateTime); |
| 1116 | 85 | } | |
| 1117 | |||
| 1118 | ✗ | void WorkflowStepResult::resetStartedAt() { | |
| 1119 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetStartedAt(); | |
| 1120 | ✗ | } | |
| 1121 | |||
| 1122 | 83 | void WorkflowStepResult::setCompletedAt(const DateTime& dateTime) { | |
| 1123 |
1/1✓ Branch 3 taken 83 times.
|
83 | getImpl<detail::WorkflowStepResult_Impl>()->setCompletedAt(dateTime); |
| 1124 | 83 | } | |
| 1125 | |||
| 1126 | ✗ | void WorkflowStepResult::resetCompletedAt() { | |
| 1127 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetCompletedAt(); | |
| 1128 | ✗ | } | |
| 1129 | |||
| 1130 | 63 | bool WorkflowStepResult::setMeasureType(const MeasureType& measureType) { | |
| 1131 |
1/1✓ Branch 3 taken 63 times.
|
63 | return getImpl<detail::WorkflowStepResult_Impl>()->setMeasureType(measureType); |
| 1132 | } | ||
| 1133 | |||
| 1134 | ✗ | void WorkflowStepResult::resetMeasureType() { | |
| 1135 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetMeasureType(); | |
| 1136 | ✗ | } | |
| 1137 | |||
| 1138 | 73 | bool WorkflowStepResult::setMeasureName(const std::string& name) { | |
| 1139 |
1/1✓ Branch 3 taken 73 times.
|
73 | return getImpl<detail::WorkflowStepResult_Impl>()->setMeasureName(name); |
| 1140 | } | ||
| 1141 | |||
| 1142 | ✗ | void WorkflowStepResult::resetMeasureName() { | |
| 1143 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetMeasureName(); | |
| 1144 | ✗ | } | |
| 1145 | |||
| 1146 | 63 | bool WorkflowStepResult::setMeasureId(const std::string& id) { | |
| 1147 |
1/1✓ Branch 3 taken 63 times.
|
63 | return getImpl<detail::WorkflowStepResult_Impl>()->setMeasureId(id); |
| 1148 | } | ||
| 1149 | |||
| 1150 | ✗ | void WorkflowStepResult::resetMeasureId() { | |
| 1151 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetMeasureId(); | |
| 1152 | ✗ | } | |
| 1153 | |||
| 1154 | ✗ | bool WorkflowStepResult::setMeasureUUID(const UUID& uuid) { | |
| 1155 | ✗ | return getImpl<detail::WorkflowStepResult_Impl>()->setMeasureUUID(uuid); | |
| 1156 | } | ||
| 1157 | |||
| 1158 | ✗ | void WorkflowStepResult::resetMeasureUUID() { | |
| 1159 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetMeasureUUID(); | |
| 1160 | ✗ | } | |
| 1161 | |||
| 1162 | 63 | bool WorkflowStepResult::setMeasureVersionId(const std::string& id) { | |
| 1163 |
1/1✓ Branch 3 taken 63 times.
|
63 | return getImpl<detail::WorkflowStepResult_Impl>()->setMeasureVersionId(id); |
| 1164 | } | ||
| 1165 | |||
| 1166 | ✗ | void WorkflowStepResult::resetMeasureVersionId() { | |
| 1167 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetMeasureVersionId(); | |
| 1168 | ✗ | } | |
| 1169 | |||
| 1170 | ✗ | bool WorkflowStepResult::setMeasureVersionUUID(const UUID& uuid) { | |
| 1171 | ✗ | return getImpl<detail::WorkflowStepResult_Impl>()->setMeasureVersionUUID(uuid); | |
| 1172 | } | ||
| 1173 | |||
| 1174 | ✗ | void WorkflowStepResult::resetMeasureVersionUUID() { | |
| 1175 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetMeasureVersionUUID(); | |
| 1176 | ✗ | } | |
| 1177 | |||
| 1178 | 63 | bool WorkflowStepResult::setMeasureVersionModified(const DateTime& versionModified) { | |
| 1179 |
1/1✓ Branch 3 taken 63 times.
|
63 | return getImpl<detail::WorkflowStepResult_Impl>()->setMeasureVersionModified(versionModified); |
| 1180 | } | ||
| 1181 | |||
| 1182 | ✗ | void WorkflowStepResult::resetMeasureVersionModified() { | |
| 1183 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetMeasureVersionModified(); | |
| 1184 | ✗ | } | |
| 1185 | |||
| 1186 | 63 | bool WorkflowStepResult::setMeasureXmlChecksum(const std::string& checksum) { | |
| 1187 |
1/1✓ Branch 3 taken 63 times.
|
63 | return getImpl<detail::WorkflowStepResult_Impl>()->setMeasureXmlChecksum(checksum); |
| 1188 | } | ||
| 1189 | |||
| 1190 | ✗ | void WorkflowStepResult::resetMeasureXmlChecksum() { | |
| 1191 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetMeasureXmlChecksum(); | |
| 1192 | ✗ | } | |
| 1193 | |||
| 1194 | 63 | bool WorkflowStepResult::setMeasureClassName(const std::string& className) { | |
| 1195 |
1/1✓ Branch 3 taken 63 times.
|
63 | return getImpl<detail::WorkflowStepResult_Impl>()->setMeasureClassName(className); |
| 1196 | } | ||
| 1197 | |||
| 1198 | ✗ | void WorkflowStepResult::resetMeasureClassName() { | |
| 1199 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetMeasureClassName(); | |
| 1200 | ✗ | } | |
| 1201 | |||
| 1202 | 63 | bool WorkflowStepResult::setMeasureDisplayName(const std::string& displayName) { | |
| 1203 |
1/1✓ Branch 3 taken 63 times.
|
63 | return getImpl<detail::WorkflowStepResult_Impl>()->setMeasureDisplayName(displayName); |
| 1204 | } | ||
| 1205 | |||
| 1206 | ✗ | void WorkflowStepResult::resetMeasureDisplayName() { | |
| 1207 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetMeasureDisplayName(); | |
| 1208 | ✗ | } | |
| 1209 | |||
| 1210 | 54 | bool WorkflowStepResult::setMeasureTaxonomy(const std::string& taxonomy) { | |
| 1211 |
1/1✓ Branch 3 taken 54 times.
|
54 | return getImpl<detail::WorkflowStepResult_Impl>()->setMeasureTaxonomy(taxonomy); |
| 1212 | } | ||
| 1213 | |||
| 1214 | ✗ | void WorkflowStepResult::resetMeasureTaxonomy() { | |
| 1215 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetMeasureTaxonomy(); | |
| 1216 | ✗ | } | |
| 1217 | |||
| 1218 | 110 | void WorkflowStepResult::setStepResult(const StepResult& result) { | |
| 1219 |
1/1✓ Branch 3 taken 110 times.
|
110 | getImpl<detail::WorkflowStepResult_Impl>()->setStepResult(result); |
| 1220 | 110 | } | |
| 1221 | |||
| 1222 | ✗ | void WorkflowStepResult::resetStepResult() { | |
| 1223 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetStepResult(); | |
| 1224 | ✗ | } | |
| 1225 | |||
| 1226 | 50 | void WorkflowStepResult::setStepInitialCondition(const std::string& initialCondition) { | |
| 1227 |
1/1✓ Branch 3 taken 50 times.
|
50 | getImpl<detail::WorkflowStepResult_Impl>()->setStepInitialCondition(initialCondition); |
| 1228 | 50 | } | |
| 1229 | |||
| 1230 | ✗ | void WorkflowStepResult::resetStepInitialCondition() { | |
| 1231 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetStepInitialCondition(); | |
| 1232 | ✗ | } | |
| 1233 | |||
| 1234 | 62 | void WorkflowStepResult::setStepFinalCondition(const std::string& finalCondition) { | |
| 1235 |
1/1✓ Branch 3 taken 62 times.
|
62 | getImpl<detail::WorkflowStepResult_Impl>()->setStepFinalCondition(finalCondition); |
| 1236 | 62 | } | |
| 1237 | |||
| 1238 | ✗ | void WorkflowStepResult::resetStepFinalCondition() { | |
| 1239 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetStepFinalCondition(); | |
| 1240 | ✗ | } | |
| 1241 | |||
| 1242 | 68 | void WorkflowStepResult::addStepError(const std::string& error) { | |
| 1243 |
1/1✓ Branch 3 taken 68 times.
|
68 | getImpl<detail::WorkflowStepResult_Impl>()->addStepError(error); |
| 1244 | 68 | } | |
| 1245 | |||
| 1246 | ✗ | void WorkflowStepResult::resetStepErrors() { | |
| 1247 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetStepErrors(); | |
| 1248 | ✗ | } | |
| 1249 | |||
| 1250 | 72 | void WorkflowStepResult::addStepWarning(const std::string& warning) { | |
| 1251 |
1/1✓ Branch 3 taken 72 times.
|
72 | getImpl<detail::WorkflowStepResult_Impl>()->addStepWarning(warning); |
| 1252 | 72 | } | |
| 1253 | |||
| 1254 | ✗ | void WorkflowStepResult::resetStepWarnings() { | |
| 1255 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetStepWarnings(); | |
| 1256 | ✗ | } | |
| 1257 | |||
| 1258 | 125 | void WorkflowStepResult::addStepInfo(const std::string& info) { | |
| 1259 |
1/1✓ Branch 3 taken 125 times.
|
125 | getImpl<detail::WorkflowStepResult_Impl>()->addStepInfo(info); |
| 1260 | 125 | } | |
| 1261 | |||
| 1262 | ✗ | void WorkflowStepResult::resetStepInfo() { | |
| 1263 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetStepInfo(); | |
| 1264 | ✗ | } | |
| 1265 | |||
| 1266 | 236 | void WorkflowStepResult::addStepValue(const WorkflowStepValue& value) { | |
| 1267 |
1/1✓ Branch 3 taken 236 times.
|
236 | getImpl<detail::WorkflowStepResult_Impl>()->addStepValue(value); |
| 1268 | 236 | } | |
| 1269 | |||
| 1270 | ✗ | void WorkflowStepResult::resetStepValues() { | |
| 1271 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetStepValues(); | |
| 1272 | ✗ | } | |
| 1273 | |||
| 1274 | 49 | void WorkflowStepResult::addStepFile(const openstudio::path& path) { | |
| 1275 |
1/1✓ Branch 3 taken 49 times.
|
49 | getImpl<detail::WorkflowStepResult_Impl>()->addStepFile(path); |
| 1276 | 49 | } | |
| 1277 | |||
| 1278 | ✗ | void WorkflowStepResult::resetStepFiles() { | |
| 1279 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetStepFiles(); | |
| 1280 | ✗ | } | |
| 1281 | |||
| 1282 | 77 | void WorkflowStepResult::setStdOut(const std::string& stdOut) { | |
| 1283 |
1/1✓ Branch 3 taken 77 times.
|
77 | getImpl<detail::WorkflowStepResult_Impl>()->setStdOut(stdOut); |
| 1284 | 77 | } | |
| 1285 | |||
| 1286 | ✗ | void WorkflowStepResult::resetStdOut() { | |
| 1287 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetStdOut(); | |
| 1288 | ✗ | } | |
| 1289 | |||
| 1290 | 77 | void WorkflowStepResult::setStdErr(const std::string& stdErr) { | |
| 1291 |
1/1✓ Branch 3 taken 77 times.
|
77 | getImpl<detail::WorkflowStepResult_Impl>()->setStdErr(stdErr); |
| 1292 | 77 | } | |
| 1293 | |||
| 1294 | ✗ | void WorkflowStepResult::resetStdErr() { | |
| 1295 | ✗ | getImpl<detail::WorkflowStepResult_Impl>()->resetStdErr(); | |
| 1296 | ✗ | } | |
| 1297 | |||
| 1298 | 4 | void WorkflowStepResult::showOutput() const { | |
| 1299 |
1/1✓ Branch 3 taken 4 times.
|
4 | getImpl<detail::WorkflowStepResult_Impl>()->showOutput(); |
| 1300 | 4 | } | |
| 1301 | |||
| 1302 | ✗ | std::ostream& operator<<(std::ostream& os, const WorkflowStepResult& workflowStepResult) { | |
| 1303 | ✗ | os << workflowStepResult.string(); | |
| 1304 | ✗ | return os; | |
| 1305 | } | ||
| 1306 | |||
| 1307 | } // namespace openstudio | ||
| 1308 |