|
51 | 51 | #include <EnergyPlus/DataEnvironment.hh> |
52 | 52 | #include <EnergyPlus/DataGlobalConstants.hh> |
53 | 53 | #include <EnergyPlus/DataHVACGlobals.hh> |
54 | | -#include <EnergyPlus/DataIPShortCuts.hh> |
55 | 54 | #include <EnergyPlus/Fans.hh> |
56 | 55 | #include <EnergyPlus/General.hh> |
57 | 56 | #include <EnergyPlus/GeneralRoutines.hh> |
@@ -155,58 +154,51 @@ void CoilCoolingDXCurveFitPerformance::instantiateFromInputSpec(EnergyPlus::Ener |
155 | 154 | CoilCoolingDXCurveFitPerformance::CoilCoolingDXCurveFitPerformance(EnergyPlus::EnergyPlusData &state, const std::string &name_to_find) |
156 | 155 | : CoilCoolingDXPerformanceBase() |
157 | 156 | { |
158 | | - int numPerformances = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CoilCoolingDXCurveFitPerformance::object_name); |
159 | | - if (numPerformances <= 0) { |
| 157 | + std::string const objectName{CoilCoolingDXCurveFitPerformance::object_name}; |
| 158 | + auto *inputProcessor = state.dataInputProcessing->inputProcessor.get(); |
| 159 | + auto const performanceInstances = inputProcessor->epJSON.find(objectName); |
| 160 | + if (performanceInstances == inputProcessor->epJSON.end()) { |
160 | 161 | // error |
161 | 162 | } |
| 163 | + auto const &performanceSchemaProps = inputProcessor->getObjectSchemaProps(state, objectName); |
162 | 164 | bool found_it = false; |
163 | | - for (int perfNum = 1; perfNum <= numPerformances; ++perfNum) { |
164 | | - int NumAlphas; // Number of Alphas for each GetObjectItem call |
165 | | - int NumNumbers; // Number of Numbers for each GetObjectItem call |
166 | | - int IOStatus; |
167 | | - state.dataInputProcessing->inputProcessor->getObjectItem(state, |
168 | | - CoilCoolingDXCurveFitPerformance::object_name, |
169 | | - perfNum, |
170 | | - state.dataIPShortCut->cAlphaArgs, |
171 | | - NumAlphas, |
172 | | - state.dataIPShortCut->rNumericArgs, |
173 | | - NumNumbers, |
174 | | - IOStatus, |
175 | | - _, |
176 | | - state.dataIPShortCut->lAlphaFieldBlanks); |
177 | | - if (!Util::SameString(name_to_find, state.dataIPShortCut->cAlphaArgs(1))) { |
| 165 | + for (auto const &performanceInstance : performanceInstances.value().items()) { |
| 166 | + auto const performanceName = Util::makeUPPER(performanceInstance.key()); |
| 167 | + auto const &performanceFields = performanceInstance.value(); |
| 168 | + if (!Util::SameString(name_to_find, performanceName)) { |
178 | 169 | continue; |
179 | 170 | } |
180 | 171 | found_it = true; |
181 | 172 |
|
182 | 173 | CoilCoolingDXCurveFitPerformanceInputSpecification input_specs; |
183 | 174 |
|
184 | | - input_specs.name = state.dataIPShortCut->cAlphaArgs(1); |
185 | | - input_specs.crankcase_heater_capacity = state.dataIPShortCut->rNumericArgs(1); |
186 | | - input_specs.minimum_outdoor_dry_bulb_temperature_for_compressor_operation = state.dataIPShortCut->rNumericArgs(2); |
187 | | - input_specs.maximum_outdoor_dry_bulb_temperature_for_crankcase_heater_operation = state.dataIPShortCut->rNumericArgs(3); |
188 | | - if (state.dataIPShortCut->lNumericFieldBlanks(4)) { |
189 | | - input_specs.unit_internal_static_air_pressure = 0.0; |
190 | | - } else { |
191 | | - input_specs.unit_internal_static_air_pressure = state.dataIPShortCut->rNumericArgs(4); |
192 | | - } |
193 | | - if (!state.dataIPShortCut->lAlphaFieldBlanks(2)) { |
194 | | - input_specs.outdoor_temperature_dependent_crankcase_heater_capacity_curve_name = state.dataIPShortCut->cAlphaArgs(2); |
195 | | - } |
196 | | - input_specs.capacity_control = state.dataIPShortCut->cAlphaArgs(3); |
197 | | - input_specs.basin_heater_capacity = state.dataIPShortCut->rNumericArgs(5); |
198 | | - input_specs.basin_heater_setpoint_temperature = state.dataIPShortCut->rNumericArgs(6); |
199 | | - input_specs.basin_heater_operating_schedule_name = state.dataIPShortCut->cAlphaArgs(4); |
200 | | - input_specs.compressor_fuel_type = state.dataIPShortCut->cAlphaArgs(5); |
201 | | - input_specs.base_operating_mode_name = state.dataIPShortCut->cAlphaArgs(6); |
202 | | - if (!state.dataIPShortCut->lAlphaFieldBlanks(6)) { |
203 | | - input_specs.alternate_operating_mode_name = state.dataIPShortCut->cAlphaArgs(7); |
204 | | - } |
205 | | - if (!state.dataIPShortCut->lAlphaFieldBlanks(8)) { |
206 | | - input_specs.alternate_operating_mode2_name = state.dataIPShortCut->cAlphaArgs(8); |
207 | | - } |
| 175 | + input_specs.name = performanceName; |
| 176 | + input_specs.crankcase_heater_capacity = |
| 177 | + inputProcessor->getRealFieldValue(performanceFields, performanceSchemaProps, "crankcase_heater_capacity"); |
| 178 | + input_specs.minimum_outdoor_dry_bulb_temperature_for_compressor_operation = inputProcessor->getRealFieldValue( |
| 179 | + performanceFields, performanceSchemaProps, "minimum_outdoor_dry_bulb_temperature_for_compressor_operation"); |
| 180 | + input_specs.maximum_outdoor_dry_bulb_temperature_for_crankcase_heater_operation = inputProcessor->getRealFieldValue( |
| 181 | + performanceFields, performanceSchemaProps, "maximum_outdoor_dry_bulb_temperature_for_crankcase_heater_operation"); |
| 182 | + input_specs.unit_internal_static_air_pressure = |
| 183 | + inputProcessor->getRealFieldValue(performanceFields, performanceSchemaProps, "unit_internal_static_air_pressure"); |
| 184 | + input_specs.outdoor_temperature_dependent_crankcase_heater_capacity_curve_name = inputProcessor->getAlphaFieldValue( |
| 185 | + performanceFields, performanceSchemaProps, "crankcase_heater_capacity_function_of_temperature_curve_name"); |
| 186 | + input_specs.capacity_control = inputProcessor->getAlphaFieldValue(performanceFields, performanceSchemaProps, "capacity_control_method"); |
| 187 | + input_specs.basin_heater_capacity = |
| 188 | + inputProcessor->getRealFieldValue(performanceFields, performanceSchemaProps, "evaporative_condenser_basin_heater_capacity"); |
| 189 | + input_specs.basin_heater_setpoint_temperature = |
| 190 | + inputProcessor->getRealFieldValue(performanceFields, performanceSchemaProps, "evaporative_condenser_basin_heater_setpoint_temperature"); |
| 191 | + input_specs.basin_heater_operating_schedule_name = inputProcessor->getAlphaFieldValue( |
| 192 | + performanceFields, performanceSchemaProps, "evaporative_condenser_basin_heater_operating_schedule_name"); |
| 193 | + input_specs.compressor_fuel_type = inputProcessor->getAlphaFieldValue(performanceFields, performanceSchemaProps, "compressor_fuel_type"); |
| 194 | + input_specs.base_operating_mode_name = inputProcessor->getAlphaFieldValue(performanceFields, performanceSchemaProps, "base_operating_mode"); |
| 195 | + input_specs.alternate_operating_mode_name = |
| 196 | + inputProcessor->getAlphaFieldValue(performanceFields, performanceSchemaProps, "alternative_operating_mode_1"); |
| 197 | + input_specs.alternate_operating_mode2_name = |
| 198 | + inputProcessor->getAlphaFieldValue(performanceFields, performanceSchemaProps, "alternative_operating_mode_2"); |
208 | 199 |
|
209 | 200 | this->instantiateFromInputSpec(state, input_specs); |
| 201 | + inputProcessor->markObjectAsUsed(objectName, performanceInstance.key()); |
210 | 202 | break; |
211 | 203 | } |
212 | 204 |
|
|
0 commit comments