| 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, |
nothing calls this directly
no test coverage detected