| 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}; |
nothing calls this directly
no test coverage detected