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

Method setPeakDemandUnit

src/model/UtilityBill.cpp:489–501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

487 }
488
489 bool UtilityBill_Impl::setPeakDemandUnit(const std::string& peakDemandUnit) {
490 bool result = false;
491 std::vector<std::string> peakDemandUnitValues = this->peakDemandUnitValues();
492 if (peakDemandUnitValues.empty() && peakDemandUnit.empty()) {
493 result = setString(OS_UtilityBillFields::PeakDemandUnit, peakDemandUnit);
494 } else {
495 auto it = std::find(peakDemandUnitValues.begin(), peakDemandUnitValues.end(), peakDemandUnit);
496 if (it != peakDemandUnitValues.end()) {
497 result = setString(OS_UtilityBillFields::PeakDemandUnit, peakDemandUnit);
498 }
499 }
500 return result;
501 }
502
503 bool UtilityBill_Impl::setTimestepsInPeakDemandWindow(unsigned timestepsInPeakDemandWindow) {
504 if (this->fuelType() == FuelType::Electricity) {

Callers 1

TEST_FFunction · 0.80

Calls 4

peakDemandUnitValuesMethod · 0.95
beginMethod · 0.80
emptyMethod · 0.45
endMethod · 0.45

Tested by 1

TEST_FFunction · 0.64