src/energyplus/ForwardTranslator/ForwardTranslateGeneratorFuelCellElectricalStorage.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #include "../ForwardTranslator.hpp" | ||
| 7 | |||
| 8 | #include "../../model/Model.hpp" | ||
| 9 | #include "../../model/GeneratorFuelCellElectricalStorage.hpp" | ||
| 10 | #include "../../model/GeneratorFuelCellElectricalStorage_Impl.hpp" | ||
| 11 | |||
| 12 | #include "../../utilities/idf/IdfExtensibleGroup.hpp" | ||
| 13 | |||
| 14 | #include <utilities/idd/Generator_FuelCell_ElectricalStorage_FieldEnums.hxx> | ||
| 15 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 16 | #include <utilities/idd/IddEnums.hxx> | ||
| 17 | #include <utilities/idd/IddFactory.hxx> | ||
| 18 | |||
| 19 | using namespace openstudio::model; | ||
| 20 | |||
| 21 | using namespace std; | ||
| 22 | |||
| 23 | namespace openstudio { | ||
| 24 | |||
| 25 | namespace energyplus { | ||
| 26 | |||
| 27 | 3 | boost::optional<IdfObject> ForwardTranslator::translateGeneratorFuelCellElectricalStorage(GeneratorFuelCellElectricalStorage& modelObject) { | |
| 28 | 3 | boost::optional<std::string> s; | |
| 29 | 3 | boost::optional<double> d; | |
| 30 | |||
| 31 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | IdfObject pcm = createAndRegisterIdfObject(openstudio::IddObjectType::Generator_FuelCell_ElectricalStorage, modelObject); |
| 32 | //Name | ||
| 33 |
1/1✓ Branch 1 taken 3 times.
|
3 | s = modelObject.name(); |
| 34 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (s) { |
| 35 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | pcm.setName(*s); |
| 36 | } | ||
| 37 | |||
| 38 | //ChoiceofModel | ||
| 39 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | s = modelObject.choiceofModel(); |
| 40 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (s) { |
| 41 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | pcm.setString(Generator_FuelCell_ElectricalStorageFields::ChoiceofModel, s.get()); |
| 42 | } | ||
| 43 | |||
| 44 | //NominalChargingEnergeticEfficiency | ||
| 45 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | d = modelObject.nominalChargingEnergeticEfficiency(); |
| 46 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 47 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | pcm.setDouble(Generator_FuelCell_ElectricalStorageFields::NominalChargingEnergeticEfficiency, d.get()); |
| 48 | } | ||
| 49 | |||
| 50 | //NominalDischargingEnergeticEfficiency | ||
| 51 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | d = modelObject.nominalDischargingEnergeticEfficiency(); |
| 52 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 53 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | pcm.setDouble(Generator_FuelCell_ElectricalStorageFields::NominalDischargingEnergeticEfficiency, d.get()); |
| 54 | } | ||
| 55 | |||
| 56 | //SimpleMaximumCapacity | ||
| 57 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | d = modelObject.simpleMaximumCapacity(); |
| 58 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 59 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | pcm.setDouble(Generator_FuelCell_ElectricalStorageFields::SimpleMaximumCapacity, d.get()); |
| 60 | } | ||
| 61 | |||
| 62 | //SimpleMaximumPowerDraw | ||
| 63 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | d = modelObject.simpleMaximumPowerDraw(); |
| 64 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 65 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | pcm.setDouble(Generator_FuelCell_ElectricalStorageFields::SimpleMaximumPowerDraw, d.get()); |
| 66 | } | ||
| 67 | |||
| 68 | //SimpleMaximumPowerStore | ||
| 69 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | d = modelObject.simpleMaximumPowerStore(); |
| 70 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 71 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | pcm.setDouble(Generator_FuelCell_ElectricalStorageFields::SimpleMaximumPowerStore, d.get()); |
| 72 | } | ||
| 73 | |||
| 74 | //InitialChargeState | ||
| 75 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | d = modelObject.initialChargeState(); |
| 76 |
1/2✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
|
3 | if (d) { |
| 77 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | pcm.setDouble(Generator_FuelCell_ElectricalStorageFields::InitialChargeState, d.get()); |
| 78 | } | ||
| 79 | |||
| 80 |
1/1✓ Branch 1 taken 3 times.
|
6 | return pcm; |
| 81 | 3 | } | |
| 82 | |||
| 83 | } // namespace energyplus | ||
| 84 | |||
| 85 | } // namespace openstudio | ||
| 86 |