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

Method consumptionUnitDescription

src/model/UtilityBill.cpp:101–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99 }
100
101 boost::optional<std::string> UtilityBill_Impl::consumptionUnitDescription() const {
102 boost::optional<std::string> result;
103
104 FuelType fuelType = this->fuelType();
105
106 std::string consumptionUnit = this->consumptionUnit();
107
108 if (consumptionUnit == "kBtu") {
109 result = "thousand Btu";
110 } else if (consumptionUnit == "MBtu") {
111 result = "million Btu";
112 } else if (consumptionUnit == "kWh") {
113 result = "thousand Watt hours";
114 } else if (consumptionUnit == "MWh") {
115 result = "million Watt hours";
116 } else if (consumptionUnit == "therms") {
117 result = "hundred thousand Btu";
118 } else if (consumptionUnit == "RTh") {
119 result = "refrigeration ton hours";
120 } else if (consumptionUnit == "tons") {
121 result = "two thousand pounds";
122 } else if (consumptionUnit == "lbs") {
123 result = "pounds";
124 } else if (consumptionUnit == "kLbs") {
125 result = "thousand pounds";
126 } else if (consumptionUnit == "MLbs") {
127 result = "million pounds";
128 } else if (consumptionUnit == "gal") {
129 result = "gallons";
130 } else if (consumptionUnit == "L") {
131 result = "liters";
132 } else if (consumptionUnit == "cf") {
133 result = "cubic feet";
134 } else if (consumptionUnit == "m3") {
135 result = "cubic meters";
136 } else if (consumptionUnit == "Ccf") {
137 result = "hundred cubic feet";
138 } else if (consumptionUnit == "Mcf") {
139 result = "thousand cubic feet";
140 } else if (consumptionUnit == "MMcf") {
141 result = "million cubic feet";
142 }
143
144 if (!result) {
145 LOG(Error, "Unknown consumption unit '" << consumptionUnit << "' for fuel type '" << fuelType.valueDescription() << "'");
146 }
147
148 return result;
149 }
150
151 double UtilityBill_Impl::consumptionUnitConversionFactor() const {
152 boost::optional<double> value = getDouble(OS_UtilityBillFields::ConsumptionUnitConversionFactor, true);

Callers 1

TEST_FFunction · 0.80

Calls 3

fuelTypeMethod · 0.95
consumptionUnitMethod · 0.95
valueDescriptionMethod · 0.80

Tested by 1

TEST_FFunction · 0.64