| 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 |