MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / energyConsumptionByMonth

Method energyConsumptionByMonth

src/utilities/sql/SqlFile_Impl.cpp:880–900  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

878 }
879
880 boost::optional<double> SqlFile_Impl::energyConsumptionByMonth(const openstudio::EndUseFuelType& t_fuelType,
881 const openstudio::EndUseCategoryType& t_categoryType,
882 const openstudio::MonthOfYear& t_monthOfYear) const {
883 // For backward compatibilty, we had to preserve enum valueNames (first param in enum, ((valueName)(valueDescription))
884 // You need to be careful about what you are passing here... valueName or valueDescription
885 const std::string reportName = "BUILDING ENERGY PERFORMANCE - " + boost::algorithm::to_upper_copy(t_fuelType.valueDescription());
886 // So this gets tricky, but we have ((Gas)(Natural Gas)). We didn't want to change to ((NaturalGas)(Natural Gas))
887 // So here we take valueDescription ('Natural Gas', then remove the spaces to be NaturalGas)
888 const std::string columnName = boost::algorithm::to_upper_copy(t_categoryType.valueName()) + ":"
889 + boost::algorithm::to_upper_copy(boost::algorithm::erase_all_copy(t_fuelType.valueDescription(), " "));
890 const std::string rowName = t_monthOfYear.valueDescription();
891
892 const std::string& s = R"(SELECT Value FROM TabularDataWithStrings
893 WHERE ReportName=?
894 AND ReportForString='Meter'
895 AND RowName=?
896 AND ColumnName=?
897 AND Units='J')";
898
899 return execAndReturnFirstDouble(s, reportName, rowName, columnName);
900 }
901
902 boost::optional<double> SqlFile_Impl::peakEnergyDemandByMonth(const openstudio::EndUseFuelType& t_fuelType,
903 const openstudio::EndUseCategoryType& t_categoryType,

Callers

nothing calls this directly

Calls 3

valueDescriptionMethod · 0.80
valueNameMethod · 0.80
execAndReturnFirstDoubleFunction · 0.70

Tested by

no test coverage detected