| 550 | } |
| 551 | |
| 552 | Json::Value outputAttributesToJSON(const std::map<std::string, std::map<std::string, openstudio::Variant>>& output_attributes, |
| 553 | bool sanitize = false) { |
| 554 | Json::Value root(Json::objectValue); |
| 555 | for (const auto& [oriMeasureName, argMap] : output_attributes) { |
| 556 | const std::string measureName = sanitize ? openstudio::workflow::util::sanitizeKey(oriMeasureName) : oriMeasureName; |
| 557 | Json::Value measureValues(Json::objectValue); |
| 558 | for (const auto& [oriArgName, variantValue] : argMap) { |
| 559 | const std::string argName = sanitize ? openstudio::workflow::util::sanitizeKey(oriArgName) : oriArgName; |
| 560 | if (variantValue.variantType() == VariantType::String) { |
| 561 | measureValues[argName] = variantValue.valueAsString(); |
| 562 | } else if (variantValue.variantType() == VariantType::Double) { |
| 563 | measureValues[argName] = variantValue.valueAsDouble(); |
| 564 | } else if (variantValue.variantType() == VariantType::Integer) { |
| 565 | measureValues[argName] = variantValue.valueAsInteger(); |
| 566 | } else if (variantValue.variantType() == VariantType::Boolean) { |
| 567 | measureValues[argName] = variantValue.valueAsBoolean(); |
| 568 | } |
| 569 | } |
| 570 | |
| 571 | root[measureName] = measureValues; |
| 572 | } |
| 573 | return root; |
| 574 | } |
| 575 | |
| 576 | void OSWorkflow::communicateMeasureAttributes() const { |
| 577 |
no test coverage detected