| 366 | } |
| 367 | |
| 368 | boost::optional<std::string> UtilityBill_Impl::peakDemandUnitDescription() const { |
| 369 | boost::optional<std::string> result; |
| 370 | boost::optional<std::string> peakDemandUnit = this->peakDemandUnit(); |
| 371 | if (peakDemandUnit) { |
| 372 | if (peakDemandUnit.get() == "kW") { |
| 373 | result = "thousand Watts"; |
| 374 | } else if (peakDemandUnit.get() == "MW") { |
| 375 | result = "million Watts"; |
| 376 | } else if (peakDemandUnit.get() == "W") { |
| 377 | result = "Watts"; |
| 378 | } else { |
| 379 | LOG(Error, "Unknown peak demand unit '" << peakDemandUnit.get() << "' for fuel type '" << this->fuelType().valueDescription() << "'"); |
| 380 | } |
| 381 | } |
| 382 | return result; |
| 383 | } |
| 384 | |
| 385 | boost::optional<double> UtilityBill_Impl::peakDemandUnitConversionFactor() const { |
| 386 | boost::optional<double> result; |