src/energyplus/ForwardTranslator/ForwardTranslateLoadProfilePlant.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 | #include "../../model/Model.hpp" | ||
| 8 | #include "../../model/LoadProfilePlant.hpp" | ||
| 9 | #include "../../model/LoadProfilePlant_Impl.hpp" | ||
| 10 | #include "../../model/Schedule.hpp" | ||
| 11 | #include "../../model/Node.hpp" | ||
| 12 | #include "../../utilities/core/Logger.hpp" | ||
| 13 | #include <utilities/idd/LoadProfile_Plant_FieldEnums.hxx> | ||
| 14 | #include <utilities/idd/IddEnums.hxx> | ||
| 15 | |||
| 16 | using namespace openstudio::model; | ||
| 17 | |||
| 18 | namespace openstudio { | ||
| 19 | |||
| 20 | namespace energyplus { | ||
| 21 | |||
| 22 | 1 | boost::optional<IdfObject> ForwardTranslator::translateLoadProfilePlant(LoadProfilePlant& modelObject) { | |
| 23 | 1 | OptionalString s; | |
| 24 | 1 | OptionalDouble value; | |
| 25 | 1 | OptionalModelObject temp; | |
| 26 | |||
| 27 | //Name | ||
| 28 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::LoadProfile_Plant, modelObject); |
| 29 | |||
| 30 | // InletNodeName | ||
| 31 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if (auto node = modelObject.inletModelObject()) { |
| 32 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(LoadProfile_PlantFields::InletNodeName, node->name().get()); |
| 33 | 1 | } | |
| 34 | |||
| 35 | // OutletNodeName | ||
| 36 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if (auto node = modelObject.outletModelObject()) { |
| 37 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(LoadProfile_PlantFields::OutletNodeName, node->name().get()); |
| 38 | 1 | } | |
| 39 | |||
| 40 | // LoadScheduleName | ||
| 41 | { | ||
| 42 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto schedule = modelObject.loadSchedule(); |
| 43 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if (auto _schedule = translateAndMapModelObject(schedule)) { |
| 44 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(LoadProfile_PlantFields::LoadScheduleName, _schedule->name().get()); |
| 45 | 1 | } | |
| 46 | 1 | } | |
| 47 | |||
| 48 | // PeakFlowRate | ||
| 49 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | if ((value = modelObject.peakFlowRate())) { |
| 50 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(LoadProfile_PlantFields::PeakFlowRate, value.get()); |
| 51 | } | ||
| 52 | |||
| 53 | // FlowRateFractionScheduleName | ||
| 54 | { | ||
| 55 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto schedule = modelObject.flowRateFractionSchedule(); |
| 56 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if (auto _schedule = translateAndMapModelObject(schedule)) { |
| 57 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(LoadProfile_PlantFields::FlowRateFractionScheduleName, _schedule->name().get()); |
| 58 | 1 | } | |
| 59 | 1 | } | |
| 60 | |||
| 61 | // PlantLoopFluidType | ||
| 62 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setString(LoadProfile_PlantFields::PlantLoopFluidType, modelObject.plantLoopFluidType()); |
| 63 | |||
| 64 | // DegreeofSubCooling | ||
| 65 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(LoadProfile_PlantFields::DegreeofSubCooling, modelObject.degreeofSubCooling()); |
| 66 | |||
| 67 | // DegreeofLoopSubCooling | ||
| 68 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(LoadProfile_PlantFields::DegreeofLoopSubCooling, modelObject.degreeofLoopSubCooling()); |
| 69 | |||
| 70 |
1/1✓ Branch 1 taken 1 time.
|
2 | return idfObject; |
| 71 | 1 | } | |
| 72 | |||
| 73 | } // namespace energyplus | ||
| 74 | |||
| 75 | } // namespace openstudio | ||
| 76 |