MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / attributes

Method attributes

src/utilities/filetypes/WorkflowStepResult.cpp:400–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398 }
399
400 std::vector<Attribute> WorkflowStepResult_Impl::attributes() const {
401 LOG(Debug, "WorkflowStepResult::attributes is deprecated, use stepValues instead");
402 std::vector<Attribute> result;
403 for (const auto& stepValue : stepValues()) {
404 boost::optional<Attribute> attribute;
405
406 const VariantType variantType = stepValue.variantType();
407 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 case VariantType::Integer:
415 attribute = Attribute(stepValue.name(), stepValue.valueAsInteger());
416 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 if (attribute) {
425 attribute->setDisplayName(stepValue.displayName());
426 if (stepValue.units()) {
427 attribute->setUnits(stepValue.units().get());
428 }
429 result.push_back(*attribute);
430 }
431 }
432 return result;
433 }
434
435 void WorkflowStepResult_Impl::setStartedAt(const DateTime& dateTime) {
436 m_startedAt = dateTime;

Callers

nothing calls this directly

Calls 15

valueNameMethod · 0.80
AttributeClass · 0.70
variantTypeMethod · 0.45
valueMethod · 0.45
nameMethod · 0.45
valueAsBooleanMethod · 0.45
valueAsDoubleMethod · 0.45
valueAsIntegerMethod · 0.45
valueAsStringMethod · 0.45
setDisplayNameMethod · 0.45
displayNameMethod · 0.45
unitsMethod · 0.45

Tested by

no test coverage detected