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

Method getOptionalWorkspaceObjectChoiceValue

src/measure/OSRunner.cpp:788–807  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

786 }
787
788 boost::optional<openstudio::WorkspaceObject>
789 OSRunner::getOptionalWorkspaceObjectChoiceValue(const std::string& argument_name, const std::map<std::string, OSArgument>& user_arguments,
790 const openstudio::Workspace& workspace)
791
792 {
793 auto it = user_arguments.find(argument_name);
794 std::string handleString;
795 if (it != user_arguments.end()) {
796 if (it->second.hasValue()) {
797 handleString = it->second.valueAsString();
798 } else if (it->second.hasDefaultValue()) {
799 handleString = it->second.defaultValueAsString();
800 }
801 }
802
803 Handle handle = toUUID(handleString);
804 boost::optional<WorkspaceObject> result = workspace.getObject(handle);
805
806 return result;
807 }
808
809 Json::Value OSRunner::getArgumentValues(std::vector<OSArgument>& script_arguments, const std::map<std::string, OSArgument>& user_arguments) {
810 // This function aims to replace OsLib_HelperMethods.createRunVariables

Callers 1

TEST_FFunction · 0.80

Calls 8

toUUIDFunction · 0.85
hasDefaultValueMethod · 0.80
defaultValueAsStringMethod · 0.80
findMethod · 0.45
endMethod · 0.45
hasValueMethod · 0.45
valueAsStringMethod · 0.45
getObjectMethod · 0.45

Tested by 1

TEST_FFunction · 0.64