本文整理汇总了C++中openstudio::FileLogSink方法的典型用法代码示例。如果您正苦于以下问题:C++ openstudio::FileLogSink方法的具体用法?C++ openstudio::FileLogSink怎么用?C++ openstudio::FileLogSink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openstudio
的用法示例。
在下文中一共展示了openstudio::FileLogSink方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetUpTestCase
void EnergyPlusFixture::SetUpTestCase() {
// set up logging
logFile = FileLogSink(toPath("./EnergyPlusFixture.log"));
logFile->setLogLevel(Debug);
openstudio::Logger::instance().standardOutLogger().disable();
// initialize component paths
openstudio::path basePath = resourcesPath()/openstudio::toPath("energyplus/Components/");
// idfComponents consists of .first = path to directory, .second = component type
idfComponents.push_back(std::pair<openstudio::path,std::string>(basePath/openstudio::toPath("idf_roof_1"),"roof"));
idfComponents.push_back(std::pair<openstudio::path,std::string>(basePath/openstudio::toPath("idf_roof_2"),"roof"));
idfComponents.push_back(std::pair<openstudio::path,std::string>(basePath/openstudio::toPath("idf_roof_3"),"roof"));
idfComponents.push_back(std::pair<openstudio::path,std::string>(basePath/openstudio::toPath("idf_roof_4"),"roof"));
idfComponents.push_back(std::pair<openstudio::path,std::string>(basePath/openstudio::toPath("idf_roof_5"),"roof"));
idfComponents.push_back(std::pair<openstudio::path,std::string>(basePath/openstudio::toPath("idf_designday_1"),"designday"));
idfComponents.push_back(std::pair<openstudio::path,std::string>(basePath/openstudio::toPath("idf_designday_2"),"designday"));
idfComponents.push_back(std::pair<openstudio::path,std::string>(basePath/openstudio::toPath("idf_designday_3"),"designday"));
idfComponents.push_back(std::pair<openstudio::path,std::string>(basePath/openstudio::toPath("idf_designday_4"),"designday"));
idfComponents.push_back(std::pair<openstudio::path,std::string>(basePath/openstudio::toPath("idf_designday_5"),"designday"));
// delete translated components
BOOST_FOREACH(const ComponentDirectoryAndType& idfComponent,idfComponents) {
// delete any *.osc and oscomponent.xml files in the directory
for (openstudio::directory_iterator it(idfComponent.first), itEnd; it != itEnd; ++it) {
if (boost::filesystem::is_regular_file(it->status())) {
std::string ext = openstudio::toString(boost::filesystem::extension(*it));
if (ext == ".osc") { boost::filesystem::remove(it->path()); }
if ((ext == ".xml") && (openstudio::toString(it->filename()) == "oscomponent")) {
boost::filesystem::remove(it->path());
}
}
} // for iterator over directory
} // foreach component
}
示例2: SetUpTestCase
void SqlFileFixture::SetUpTestCase()
{
logFile = FileLogSink(toPath("./SqlFileFixture.log"));
logFile->setLogLevel(Debug);
openstudio::path path;
path = resourcesPath()/toPath("energyplus/5ZoneAirCooled/eplusout.sql");
sqlFile = openstudio::SqlFile(path);
ASSERT_TRUE(sqlFile.connectionOpen());
}
示例3: SetUpTestCase
void ProjectFixture::SetUpTestCase() {
// set up logging
logFile = FileLogSink(toPath("./ProjectFixture.log"));
logFile->setLogLevel(Info);
openstudio::Logger::instance().standardOutLogger().disable();
// set up data folder
if (!boost::filesystem::exists(toPath("ProjectFixtureData"))) {
boost::filesystem::create_directory(toPath("ProjectFixtureData"));
}
}
示例4: SetUpTestCase
void DocumentFixture::SetUpTestCase() {
// set up logging
logFile = FileLogSink(toPath("./DocumentFixture.log"));
logFile->setLogLevel(Info);
// set up doc
doc.setTitle("Excerpt from 2009 Grocery TSD");
doc.addAuthor("Matthew Leach");
doc.addAuthor("Elaine Hale");
doc.addAuthor("Adam Hirsch");
doc.addAuthor("Paul Torcellini");
doc.setTopHeadingLevel(1u);
Section section = doc.appendSection("Building Economic Parameters");
Text txt;
std::stringstream ss;
ss << "Our statement of work mandates that the design recommendations be analyzed for cost "
<< "effectiveness based on a five-year analysis period, which is assumed acceptable to a "
<< "majority of developers and owners. The other basic economic parameters required for the "
<< "5-TLCC calculation were taken from RSMeans and the Office of Management and Budget "
<< "(OMB) (CITATIONS).";
txt.append(ss.str()); ss.str("");
ss << "This analysis uses the real discount rate, which accounts for the projected rate of "
<< "general inflation found in the Report of the President's Economic Advisors, Analytical "
<< "Perpectives, and is equal to 2.3% for a five-year analysis period (CITATION). By using "
<< "this rate, we do not have to explicitly account for energy and product inflation rates.";
txt.append(ss.str()); ss.str("");
ss << "Regional capital cost modifiers are used to convert national averages to regional "
<< "values. These are available from the RSMeans data sets and are applied before any of the "
<< "additional fees listed in TABLE REF, three of which are also provided by RSMeans "
<< "(CITATION).";
txt.append(ss.str()); ss.str("");
Table tbl;
tbl.setTitle("Economic Parameter Values");
std::vector<std::string> row;
row.push_back("Economic Parameter");
row.push_back("Value");
row.push_back("Data Source");
tbl.appendRow(row);
tbl.setNHead(1);
row[0] = "Analysis Period"; row[1] = "5 Years"; row[2] = "DOE"; tbl.appendRow(row);
row[0] = "Discount Rate"; row[1] = "2.3%"; row[2] = "OMB"; tbl.appendRow(row);
row[0] = "O&M Cost Inflation"; row[1] = "0%"; row[2] = "OMB"; tbl.appendRow(row);
row[0] = "Gas Cost Inflation"; row[1] = "0%"; row[2] = "OMB"; tbl.appendRow(row);
row[0] = "Electricity Cost Inflation"; row[1] = "0%"; row[2] = "OMB"; tbl.appendRow(row);
row[0] = "Bond Fee"; row[1] = "10%"; row[2] = "RSMeans"; tbl.appendRow(row);
row[0] = "Contractor Fee"; row[1] = "10%"; row[2] = "RSMeans"; tbl.appendRow(row);
row[0] = "Contingency Fee"; row[1] = "12%"; row[2] = "RSMeans"; tbl.appendRow(row);
row[0] = "Commissioning Fee"; row[1] = "0.5%"; row[2] = "Assumption"; tbl.appendRow(row);
section.append(txt);
section.append(tbl);
}
示例5: SetUpTestCase
// initialize static members
void UnitsFixture::SetUpTestCase()
{
logFile = FileLogSink(toPath("./UnitsFixture.log"));
logFile->setLogLevel(Debug);
Logger::instance().standardOutLogger().disable();
tol = 1.0E-8;
openstudio::DoubleVector vals = openstudio::toStandardVector(openstudio::randVector(0.0,1000.0,8760u));
openstudio::Unit u = openstudio::createSIPower();
for (double val : vals) {
testQuantityVector.push_back(openstudio::Quantity(val,u));
}
testOSQuantityVector = openstudio::OSQuantityVector(u,vals);
}
示例6: SetUpTestCase
void IddFixture::SetUpTestCase()
{
// set up logging
logFile = FileLogSink(toPath("./IddFixture.log"));
logFile->setLogLevel(Debug);
// load from factory and time it
openstudio::Time start = openstudio::Time::currentTime();
epIddFile = openstudio::IddFactory::instance().getIddFile(openstudio::IddFileType::EnergyPlus);
iddLoadTime = openstudio::Time::currentTime() - start;
LOG(Info, "EnergyPlus IddFile load time (from IddFactory) = " << iddLoadTime);
start = openstudio::Time::currentTime();
osIddFile = openstudio::IddFactory::instance().getIddFile(openstudio::IddFileType::OpenStudio);
iddLoadTime = openstudio::Time::currentTime() - start;
LOG(Info, "OpenStudio IddFile load time (from IddFactory) = " << iddLoadTime);
}
示例7: SetUpTestCase
// initiallize static members
void DataFixture::SetUpTestCase() {
logFile = FileLogSink(toPath("./DataFixture.log"));
logFile->setLogLevel(Info);
}
示例8: SetUpTestCase
// initialize static members
void GeometryFixture::SetUpTestCase()
{
logFile = FileLogSink(toPath("./GeometryFixture.log"));
logFile->setLogLevel(Debug);
}
示例9: SetUpTestCase
void AnalysisFixture::SetUpTestCase() {
// set up logging
logFile = FileLogSink(toPath("./AnalysisFixture.log"));
logFile->setLogLevel(Debug);
openstudio::Logger::instance().standardOutLogger().disable();
}
示例10: SetUpTestCase
void RunManagerTestFixture::SetUpTestCase() {
// set up logging
logFile = FileLogSink(toPath("./RunManagerTestFixture.log"));
logFile->setLogLevel(Trace);
openstudio::Logger::instance().standardOutLogger().disable();
}
示例11: SetUpTestCase
void CoreFixture::SetUpTestCase()
{
// set up logging
logFile = FileLogSink(toPath("./CoreFixture.log"));
logFile->setLogLevel(Info);
}