本文整理汇总了C++中ProjectDatabase::runManager方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectDatabase::runManager方法的具体用法?C++ ProjectDatabase::runManager怎么用?C++ ProjectDatabase::runManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectDatabase
的用法示例。
在下文中一共展示了ProjectDatabase::runManager方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updatePathData
void ProjectDatabaseRecord_Impl::updatePathData(const openstudio::path& originalBase,
const openstudio::path& newBase)
{
// don't use arguments -- go to the source
ProjectDatabase database = projectDatabase();
setName(toString(database.path()));
setRunManagerDBPath(completeAndNormalize(database.runManager().dbPath()));
}
示例2: catch
openstudio::runmanager::Workflow WorkflowRecord_Impl::workflow() const {
ProjectDatabase projectDatabase = this->projectDatabase();
openstudio::runmanager::Workflow result;
openstudio::runmanager::RunManager runManager = projectDatabase.runManager();
try {
result = runManager.loadWorkflow(m_runManagerWorkflowKey);
result.setUUID(handle());
}
catch (...) {
LOG(Error,"Unable to load workflow from RunManager using key "
<< m_runManagerWorkflowKey << ". Returning empty Workflow.");
}
return result;
}
示例3: rubyMeasure
TEST_F(ProjectFixture, MeasureGroupRecord)
{
return;
ProjectDatabase database = getCleanDatabase("MeasureGroupRecord");
openstudio::path rubyPath = resourcesPath() / openstudio::toPath("project/rubyscripts/*.rb");
openstudio::path perturbScript = rubyPath/openstudio::toPath("openstudio/runmanager/rubyscripts/PerturbObject.rb");
RubyMeasure rubyMeasure(perturbScript,FileReferenceType::OSM,FileReferenceType::OSM);
std::vector<Variable> variables;
std::string name("name");
Problem problem(name,variables,database.runManager().loadWorkflows().at(0));
ProblemRecord problemRecord = ProblemRecord::factoryFromProblem(problem,database);
MeasureVector measures;
MeasureGroup measureGroup("Wall Construction",measures);
MeasureGroupRecord measureGroupRecord(measureGroup, problemRecord,0);
EXPECT_EQ(static_cast<unsigned>(0), measureGroupRecord.numMeasures(true));
EXPECT_EQ(static_cast<unsigned>(0), measureGroupRecord.measureRecordIds(true).size());
EXPECT_EQ(static_cast<unsigned>(0), measureGroupRecord.measureRecords(true).size());
// can't do this yet, would like to on construction eventually
//EXPECT_EQ(static_cast<unsigned>(0), measureGroupRecord.discoverArguments().size());
//EXPECT_EQ(static_cast<unsigned>(0), measureGroupRecord.arguments().size());
// create a real measure
//RubyMeasureRecord rubyMeasureRecord1("Test Measure 1", rubyPath, measureGroupRecord);
RubyMeasureRecord rubyMeasureRecord1(rubyMeasure,measureGroupRecord,0);
// TODO EXPECT_EQ(measureGroupRecord.id(), rubyMeasureRecord1.variableRecord().id());
// TODO EXPECT_EQ(measureGroupRecord.handle(), rubyMeasureRecord1.variableRecord().handle());
EXPECT_EQ(static_cast<unsigned>(1), measureGroupRecord.numMeasures(true));
ASSERT_EQ(static_cast<unsigned>(1), measureGroupRecord.measureRecordIds(true).size());
EXPECT_EQ(rubyMeasureRecord1.id(), measureGroupRecord.measureRecordIds(true)[0]);
ASSERT_EQ(static_cast<unsigned>(1), measureGroupRecord.measureRecords(true).size());
EXPECT_EQ(rubyMeasureRecord1.handle(), measureGroupRecord.measureRecords(true)[0].handle());
// create another real measure
//RubyMeasureRecord rubyMeasureRecord2("Test Measure 2", rubyPath, measureGroupRecord);
RubyMeasureRecord rubyMeasureRecord2(rubyMeasure,measureGroupRecord,0);
// TODO EXPECT_EQ(measureGroupRecord.id(), rubyMeasureRecord2.variableRecord().id());
// TODO EXPECT_EQ(measureGroupRecord.handle(), rubyMeasureRecord2.variableRecord().handle());
EXPECT_EQ(static_cast<unsigned>(2), measureGroupRecord.numMeasures(true));
ASSERT_EQ(static_cast<unsigned>(2), measureGroupRecord.measureRecordIds(true).size());
EXPECT_EQ(rubyMeasureRecord1.id(), measureGroupRecord.measureRecordIds(true)[0]);
EXPECT_EQ(rubyMeasureRecord2.id(), measureGroupRecord.measureRecordIds(true)[1]);
ASSERT_EQ(static_cast<unsigned>(2), measureGroupRecord.measureRecords(true).size());
EXPECT_EQ(rubyMeasureRecord1.handle(), measureGroupRecord.measureRecords(true)[0].handle());
EXPECT_EQ(rubyMeasureRecord2.handle(), measureGroupRecord.measureRecords(true)[1].handle());
// create a null measure
UUID uuid;
UUID versionUUID;
NullMeasure nullMeasure(uuid,versionUUID,"","","",true);
NullMeasureRecord nullMeasureRecord(nullMeasure,measureGroupRecord,0);
// TODO EXPECT_EQ(measureGroupRecord.id(), nullMeasureRecord.variableRecord().id());
// TODO EXPECT_EQ(measureGroupRecord.handle(), nullMeasureRecord.variableRecord().handle());
EXPECT_EQ(static_cast<unsigned>(3), measureGroupRecord.numMeasures(true));
ASSERT_EQ(static_cast<unsigned>(3), measureGroupRecord.measureRecordIds(true).size());
EXPECT_EQ(rubyMeasureRecord1.id(), measureGroupRecord.measureRecordIds(true)[0]);
EXPECT_EQ(rubyMeasureRecord2.id(), measureGroupRecord.measureRecordIds(true)[1]);
EXPECT_EQ(nullMeasureRecord.id(), measureGroupRecord.measureRecordIds(true)[2]);
ASSERT_EQ(static_cast<unsigned>(3), measureGroupRecord.measureRecords(true).size());
EXPECT_EQ(rubyMeasureRecord1.handle(), measureGroupRecord.measureRecords(true)[0].handle());
EXPECT_EQ(rubyMeasureRecord2.handle(), measureGroupRecord.measureRecords(true)[1].handle());
EXPECT_EQ(nullMeasureRecord.handle(), measureGroupRecord.measureRecords(true)[2].handle());
EXPECT_TRUE(rubyMeasureRecord2.setIsSelected(false));
EXPECT_EQ(static_cast<unsigned>(2), measureGroupRecord.numMeasures(true));
ASSERT_EQ(static_cast<unsigned>(2), measureGroupRecord.measureRecordIds(true).size());
EXPECT_EQ(static_cast<unsigned>(3), measureGroupRecord.numMeasures(false));
ASSERT_EQ(static_cast<unsigned>(3), measureGroupRecord.measureRecordIds(false).size());
EXPECT_EQ(rubyMeasureRecord1.id(), measureGroupRecord.measureRecordIds(true)[0]);
EXPECT_EQ(nullMeasureRecord.id(), measureGroupRecord.measureRecordIds(true)[1]);
EXPECT_EQ(rubyMeasureRecord1.id(), measureGroupRecord.measureRecordIds(false)[0]);
EXPECT_EQ(rubyMeasureRecord2.id(), measureGroupRecord.measureRecordIds(false)[1]);
EXPECT_EQ(nullMeasureRecord.id(), measureGroupRecord.measureRecordIds(false)[2]);
ASSERT_EQ(static_cast<unsigned>(2), measureGroupRecord.measureRecords(true).size());
EXPECT_EQ(rubyMeasureRecord1.handle(), measureGroupRecord.measureRecords(true)[0].handle());
EXPECT_EQ(nullMeasureRecord.handle(), measureGroupRecord.measureRecords(true)[1].handle());
ASSERT_EQ(static_cast<unsigned>(3), measureGroupRecord.measureRecords(false).size());
EXPECT_EQ(rubyMeasureRecord1.handle(), measureGroupRecord.measureRecords(false)[0].handle());
EXPECT_EQ(rubyMeasureRecord2.handle(), measureGroupRecord.measureRecords(false)[1].handle());
EXPECT_EQ(nullMeasureRecord.handle(), measureGroupRecord.measureRecords(false)[2].handle());
}