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

}
Example #2
0
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());
}
Example #3
0
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"));
  }

}
Example #4
0
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);
}
Example #5
0
// 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);
}
Example #6
0
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);
}
Example #7
0
// initiallize static members
void DataFixture::SetUpTestCase() {
    logFile = FileLogSink(toPath("./DataFixture.log"));
    logFile->setLogLevel(Info);
}
Example #8
0
// initialize static members
void GeometryFixture::SetUpTestCase()
{
  logFile = FileLogSink(toPath("./GeometryFixture.log"));
  logFile->setLogLevel(Debug);
}
Example #9
0
void AnalysisFixture::SetUpTestCase() {
  // set up logging
  logFile = FileLogSink(toPath("./AnalysisFixture.log"));
  logFile->setLogLevel(Debug);  
  openstudio::Logger::instance().standardOutLogger().disable();
}
void RunManagerTestFixture::SetUpTestCase() {
  // set up logging
  logFile = FileLogSink(toPath("./RunManagerTestFixture.log"));
  logFile->setLogLevel(Trace);
  openstudio::Logger::instance().standardOutLogger().disable();
}
Example #11
0
void CoreFixture::SetUpTestCase()
{
  // set up logging
  logFile = FileLogSink(toPath("./CoreFixture.log"));
  logFile->setLogLevel(Info);
}