| 1259 | } |
| 1260 | |
| 1261 | boost::optional<EndUses> SqlFile_Impl::endUses() const { |
| 1262 | EndUses result; |
| 1263 | |
| 1264 | for (EndUseFuelType fuelType : result.fuelTypes()) { |
| 1265 | std::string units = result.getUnitsForFuelType(fuelType); |
| 1266 | for (EndUseCategoryType category : result.categories()) { |
| 1267 | |
| 1268 | std::string query = "SELECT Value from TabularDataWithStrings where (reportname = 'AnnualBuildingUtilityPerformanceSummary') and " |
| 1269 | "(ReportForString = 'Entire Facility') and (TableName = 'End Uses' ) and (ColumnName ='" |
| 1270 | + fuelType.valueDescription() + "') and (RowName ='" + category.valueDescription() + "') and (Units = '" + units + "')"; |
| 1271 | |
| 1272 | boost::optional<double> value = execAndReturnFirstDouble(query); |
| 1273 | OS_ASSERT(value); |
| 1274 | |
| 1275 | if (*value != 0.0) { |
| 1276 | result.addEndUse(*value, fuelType, category); |
| 1277 | } |
| 1278 | } |
| 1279 | } |
| 1280 | |
| 1281 | return result; |
| 1282 | } |
| 1283 | |
| 1284 | OptionalDouble SqlFile_Impl::electricityHeating() const { |
| 1285 | return execAndReturnFirstDouble( |
nothing calls this directly
no test coverage detected