void EnergyPlusJob::startHandlerImpl() { getFiles(allInputFiles(), params()); if (!m_idf) { throw std::runtime_error("No IDF file found in input files"); } if (!m_idf->hasRequiredFile(toPath("Energy+.idd"))) { // We did not have an idd set, so we should find one m_idf->addRequiredFile( toPath("Energy+.idd"), toPath("Energy+.idd")); } if (!m_idf->hasRequiredFile(toPath("in.epw"))) { openstudio::path epw = WeatherFileFinder::find(allParams(), m_filelocationname, m_weatherfilename); if (!epw.empty()) { m_idf->addRequiredFile(epw, toPath("in.epw")); } } // And add the now fully outfited idf with required idd and such addRequiredFile(*m_idf, toPath("in.idf")); }
void PreviewIESJob::startHandlerImpl() { LOG(Debug, "Starting job"); getFiles(allInputFiles()); openstudio::path theoutdir = boost::filesystem::complete(outdir(true)); boost::filesystem::create_directories(theoutdir); addParameter("ies2rad", "-o"); addParameter("ies2rad", "ov"); addParameter("ies2rad", toString(theoutdir/toPath("in.ies"))); addParameter("rad", toString(theoutdir/toPath("ov.rif"))); addParameter("ra_image", "-z"); addParameter("ra_image", "-b"); addParameter("ra_image", "ov_y.hdr"); #ifdef Q_OS_WIN addParameter("ra_image", "out.bmp"); #else addParameter("ra_image", "out.tiff"); #endif // copy ies to "in.ies" addRequiredFile(*m_ies, toPath("in.ies")); writeSurfFile(theoutdir/toPath("surf.rad"), 24); writeRifFile(theoutdir/toPath("ov.rif"), theoutdir/toPath("ov.rad"), theoutdir/toPath("surf.rad"), "Z", "y", theoutdir/toPath("ov.oct"), "-ab 1 -ds .15"); }
void ExpandObjectsJob::startHandlerImpl() { addExpectedOutputFile(openstudio::toPath("expanded.idf")); getFiles(allInputFiles()); // copy idf to "in.idf" copyRequiredFiles(*m_idf, "idf", toPath("in.epw")); addRequiredFile(*m_idf, toPath("in.idf")); }
void ReadVarsJob::startHandlerImpl() { getFiles(allInputFiles()); if (m_eso) { // copy m_eso to "eplusout.eso" addRequiredFile(*m_eso, toPath("eplusout.eso")); // if have an rvi file if (m_rvi){ // how can I add a parameter now? //m_params.append(JobParams("in.rvi")); // DLM@20100909: I would rather this just be named whatever it was... addRequiredFile(*m_rvi, toPath("in.rvi")); } } }
void BasementJob::startHandlerImpl() { addExpectedOutputFile(openstudio::toPath("basementmerged.idf")); getFiles(allInputFiles()); if (!m_idf) { throw std::runtime_error("No IDF file found in input files"); } if (!m_expandedidf) { throw std::runtime_error("No expanded IDF file found in input files"); } try { m_idf->getRequiredFile(toPath("BasementGHT.idd")); } catch (const std::runtime_error &) { // We did not have an idd set, so we should find one m_idf->addRequiredFile( toPath("BasementGHT.idd"), toPath("BasementGHT.idd")); } copyRequiredFiles(*m_idf, "idf", toPath("in.epw")); try { m_idf->getRequiredFile(toPath("in.epw")); } catch (const std::runtime_error &) { openstudio::path epw = WeatherFileFinder::find(allParams(), m_filelocationname, m_weatherfilename); if (!epw.empty()) { m_idf->addRequiredFile(epw, toPath("in.epw")); } } // And add the now fully outfited idf with required idd and such addRequiredFile(*m_idf, toPath("BasementGHTIn.idf")); }
void DakotaJob::startHandlerImpl() { getFiles(allInputFiles(), params()); if (!m_inFile) { throw std::runtime_error("No .in file found in input files"); } LOG(Debug,"Starting DakotaJob with in file '" << toString(m_inFile->fullPath) << "'."); addRequiredFile(*m_inFile, toPath("dakota.in")); addParameter("dakota","-i"); addParameter("dakota","dakota.in"); // add additional parameters for (const JobParam& param : params().params()) { std::string val = param.value; if (val.find("-",0) == 0) { unsigned pos = val.find(" ",0); if (pos < val.size()) { std::string::iterator it = val.begin(); for (unsigned i = 0; i < pos; ++i,++it); std::string temp(val.begin(),it); LOG(Debug,"Adding dakota parameter: " << temp); addParameter("dakota",temp); ++it; temp = std::string(it,val.end()); LOG(Debug,"Adding dakota parameter: " << temp); addParameter("dakota",temp); } else { LOG(Debug,"Adding dakota parameter: " << val); addParameter("dakota",val); } } } }
void FileInfo::addRequiredFile(const openstudio::path &t_location) { addRequiredFile(QUrl::fromLocalFile(toQString(t_location.native_file_string()))); }
void FileInfo::addRequiredFile(const QUrl &t_url) { addRequiredFile(t_url, toPath(toPath(t_url.toLocalFile()).filename())); }
void XMLPreprocessorJob::startHandlerImpl() { getFiles(allInputFiles()); addRequiredFile(*m_xml, toPath("in.xml")); copyRequiredFiles(*m_xml, "idf", toPath("in.epw")); }