///////////////////////////////////////////////////////////////////// // makeKanBeWin ///////////////////////////////////////////////////////////////////// void kanBeApp::makeKanBeWin(void) { BFont aFont; font_height h_info; float h, w; char basepath[B_FILE_NAME_LENGTH]; ReadSetting(basepath, &aFont); setBasePath(basepath); w = aFont.StringWidth(B_UTF8_HIROSHI); // kanji width aFont.GetHeight(&h_info); h = h_info.ascent + h_info.descent + h_info.leading; mWindow = new BWindow(InitFrame(w, h), "kanBe ver. 0.52", B_TITLED_WINDOW, B_NOT_RESIZABLE|B_NOT_CLOSABLE|B_NOT_MINIMIZABLE|B_NOT_ZOOMABLE); mWindow->Lock(); mView = new FEPView(mWindow->Bounds()); mView->SetFont(&aFont); mWindow->AddChild(mView); mWindow->Unlock(); mWindow->Show(); }
Settings::Settings(QString basePath): //QSettings("Logviewer.xml", xmlFormat) QSettings(_organisation, _application) { setBasePath(basePath); //qDebug() << fileName(); ColorList cl; QVariant v; v.setValue(cl); ColorList clr = qvariant_cast<ColorList>(v); //QSettings::Format XmlFormat = QSettings::registerFormat("xml", readXmlFile, writeXmlFile); //QSettings settings(XmlFormat, QSettings::UserScope, "Organisation", "Name"); }
AssimpSimpleModelLoader::AssimpSimpleModelLoader(std::string resourceDir,std::string modelDir,std::string textureDir,std::string modelName){//nel caso mi serva in futuro std::string modelPath; setBasePath(resourceDir); setModelPath(modelDir); setTexturePath(textureDir); modelPath = resourceDir + modelDir + modelName; loadasset(modelPath.c_str()); LoadGLTextures(this->getScene()); }
Loader::params &Loader::params::operator= (const Loader::params &other) { if (this != &other) { // protect against invalid self-assignment if (Input != nullptr) delete Input; if (Header != nullptr) delete Header; Input = other.getInput()->clone(); Header = other.getHeader()->clone(); setBasePath(other.getBasePath()); setFactory(other.getFactory()); setInsertOnly(other.getInsertOnly()); setReturnsMutableVerticalTable(other.getReturnsMutableVerticalTable()); setModifiableMutableVerticalTable(other.getModifiableMutableVerticalTable()); setCompressed(other.getCompressed()); setReferenceTable(other.getReferenceTable()); } // by convention, always return *this return *this; }
eVisConfiguration::eVisConfiguration( ) { QSettings myQSettings; setApplyPathRulesToDocs( myQSettings.value( "/eVis/applypathrulestodocs", false ).toBool( ) ); setEventImagePathField( myQSettings.value( "/eVis/eventimagepathfield", "" ).toString( ) ); setEventImagePathRelative( myQSettings.value( "/eVis/eventimagepathrelative", false ).toBool( ) ); setDisplayCompassBearing( myQSettings.value( "/eVis/displaycompassbearing", false ).toBool( ) ); setCompassBearingField( myQSettings.value( "/eVis/compassbearingfield", "" ).toString( ) ); setManualCompassOffset( myQSettings.value( "/eVis/manualcompassoffset", false ).toBool( ) ); setCompassOffset( myQSettings.value( "/eVis/compassoffset", "0.0" ).toDouble( ) ); setAttributeCompassOffset( myQSettings.value( "/eVis/attributecompassoffset", false ).toBool( ) ); setCompassOffsetField( myQSettings.value( "/eVis/compassoffsetfield", "" ).toString( ) ); setBasePath( myQSettings.value( "/eVis/basepath", "" ).toString( ) ); mUseOnlyFilename = myQSettings.value( "/eVis/useonlyfilename", false ).toBool( ); }
void startRunManager(openstudio::runmanager::RunManager& rm, const openstudio::path& osmPath, const openstudio::path& modelTempDir, std::vector <double> useRadianceForDaylightingCalculations, bool requireCalibrationReports, QWidget* parent) { // openstudio::path rmdbPath = modelTempDir / toPath("resources/run.db"); openstudio::path simulationDir = toPath("run"); try { // disconnect signals from current jobs before clearing jobs std::vector<openstudio::runmanager::Job> jobs = rm.getJobs(); for (auto itr = jobs.begin(); itr != jobs.end(); ++itr) { itr->disconnect(); } rm.setPaused(true); // clear current jobs rm.clearJobs(); if (boost::filesystem::exists(modelTempDir / toPath("resources") / simulationDir)) { boost::filesystem::remove_all(modelTempDir / toPath("resources") / simulationDir); } boost::optional<analysisdriver::SimpleProject> p = OSAppBase::instance()->project(); if (p) { openstudio::runmanager::ConfigOptions co(true); analysis::Problem prob = p->analysis().problem(); analysisdriver::AnalysisRunOptions runOptions = standardRunOptions(*p); std::vector<runmanager::WorkItem> workitems(prob.createWorkflow(p->baselineDataPoint(), runOptions.rubyIncludeDirectory()).toWorkItems()); openstudio::BCLMeasure reportRequestMeasure = openstudio::BCLMeasure::reportRequestMeasure(); openstudio::BCLMeasure standardReportsMeasure = openstudio::BCLMeasure::standardReportMeasure(); openstudio::BCLMeasure calibrationReportsMeasure = openstudio::BCLMeasure::calibrationReportMeasure(); // DLM: always add this measure even if the user has their own copy, this is more clear //bool standardReportsFound = findBCLMeasureWorkItem(workitems, standardReportsMeasure.uuid()); //if (!standardReportsFound){ bool test = addReportingMeasureWorkItem(workitems, standardReportsMeasure); OS_ASSERT(test); //} // DLM: always add this measure even if the user has their own copy, this is more clear //bool calibrationReportsFound = findBCLMeasureWorkItem(workitems, calibrationReportsMeasure.uuid()); //if (requireCalibrationReports && !calibrationReportsFound){ if (requireCalibrationReports){ bool test = addReportingMeasureWorkItem(workitems, calibrationReportsMeasure); OS_ASSERT(test); } /* // check if we need to use radiance if (useRadianceForDaylightingCalculations) { std::vector<openstudio::runmanager::ToolInfo> rad = co.getTools().getAllByName("rad").tools(); if (!rad.empty()) { openstudio::path radiancePath = rad.back().localBinPath.parent_path(); bool modeltoidffound(false); for (auto itr = workitems.begin(); itr != workitems.end(); ++itr) { if (itr->type == openstudio::runmanager::JobType::ModelToIdf) { workitems.insert(itr, runmanager::Workflow::radianceDaylightCalculations(runOptions.rubyIncludeDirectory(), radiancePath)); modeltoidffound = true; break; } } OS_ASSERT(modeltoidffound); } else { QMessageBox::information(parent, "Error with initiating simulation.", "Radiance simulation requested but radiance was not found.\nRadiance simulation will be skipped.", QMessageBox::Ok); } } */ // add the report request measure before energyplus but after any other energyplus measures test = addReportRequestMeasureWorkItem(workitems, reportRequestMeasure); OS_ASSERT(test); runmanager::Workflow wf(workitems); wf.add(co.getTools()); //openstudio::runmanager::JobParams params; //params.append("cleanoutfiles", "none"); //wf.add(params); runmanager::Job j = wf.create(modelTempDir / toPath("resources") / simulationDir, modelTempDir / openstudio::toPath("in.osm")); runmanager::JobFactory::optimizeJobTree(j); rm.enqueue(j, true); } // connect signals to new jobs jobs = rm.getJobs(); for (auto itr = jobs.begin(); itr != jobs.end(); ++itr) { if (parent){ bool isConnected = itr->connect(SIGNAL(outputDataAdded(const openstudio::UUID &, const std::string &)), parent, SLOT(outputDataAdded(const openstudio::UUID &, const std::string &))); OS_ASSERT(isConnected); } if (!itr->parent()) { // need to reset the base path of the top level job so it can find its osm in the saved // location // run in model dir //itr->setBasePath(osmPath.parent_path() / osmPath.stem()); // run in temp dir itr->setBasePath(modelTempDir / toPath("resources")); if (parent){ bool isConnected = itr->connect(SIGNAL(treeChanged(const openstudio::UUID &)), parent, SLOT(treeChanged(const openstudio::UUID &))); OS_ASSERT(isConnected); } std::shared_ptr<OSDocument> currentDocument = OSAppBase::instance()->currentDocument(); if (currentDocument){ bool isConnected = itr->connect(SIGNAL(treeChanged(const openstudio::UUID &)), currentDocument.get(), SIGNAL(treeChanged(const openstudio::UUID &))); OS_ASSERT(isConnected); } } } rm.setPaused(false); } catch (const std::exception &e) {