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

Method peakDemandUnitDescription

src/model/UtilityBill.cpp:368–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers 1

TEST_FFunction · 0.80

Calls 4

peakDemandUnitMethod · 0.95
fuelTypeMethod · 0.95
valueDescriptionMethod · 0.80
getMethod · 0.45

Tested by 1

TEST_FFunction · 0.64