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

Method UtilityBill

src/model/UtilityBill.cpp:1242–1261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1240 BillingPeriod::BillingPeriod(std::shared_ptr<detail::UtilityBill_Impl> impl, unsigned index) : ModelExtensibleGroup(impl, index) {}
1241
1242 UtilityBill::UtilityBill(const FuelType& fuelType, const Model& model) : ModelObject(UtilityBill::iddObjectType(), model) {
1243 OS_ASSERT(getImpl<detail::UtilityBill_Impl>());
1244
1245 bool test = setString(OS_UtilityBillFields::FuelType, fuelType.valueDescription());
1246 if (!test) {
1247 remove();
1248 LOG_AND_THROW("Unable to create UtilityBill for FuelType " << fuelType.valueDescription() << ".");
1249 }
1250
1251 std::vector<std::string> consumptionUnitValues = this->consumptionUnitValues();
1252 OS_ASSERT(!consumptionUnitValues.empty());
1253 test = setConsumptionUnit(consumptionUnitValues[0]);
1254 OS_ASSERT(test);
1255
1256 std::vector<std::string> peakDemandUnitValues = this->peakDemandUnitValues();
1257 if (!peakDemandUnitValues.empty()) {
1258 test = setPeakDemandUnit(peakDemandUnitValues[0]);
1259 OS_ASSERT(test);
1260 }
1261 }
1262
1263 IddObjectType UtilityBill::iddObjectType() {
1264 return {IddObjectType::OS_UtilityBill};

Callers

nothing calls this directly

Calls 5

valueDescriptionMethod · 0.80
consumptionUnitValuesMethod · 0.80
peakDemandUnitValuesMethod · 0.80
iddObjectTypeFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected