void OSRunner::prepareForUserScriptRun(const UserScript& userScript) { m_result = OSResult(); m_measureName = userScript.name(); std::stringstream ss; ss << "openstudio.ruleset." << m_measureName; m_channel = ss.str(); }
boost::optional<OSResult> OSResult::load(const openstudio::path& p) { OptionalOSResult result; if (boost::filesystem::exists(p)) { try { // load xml file QFile file(toQString(p)); file.open(QFile::ReadOnly); QDomDocument qDomDocument; qDomDocument.setContent(&file); file.close(); // de-serialize result = OSResult(qDomDocument.documentElement()); } catch (std::exception& e) { LOG(Error,"Could not load OSResult from " << toString(p) << ", because " << e.what() << "."); } catch (...) { LOG(Error,"Could not load OSResult from " << toString(p) << "."); } } else { LOG(Error,"Cannot load OSResult from " << toString(p) << ", because that file does not exist."); } return result; }