src/energyplus/ReverseTranslator/ReverseTranslateOutputMeterCumulative.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 "../ReverseTranslator.hpp" | ||
| 7 | |||
| 8 | #include "../../model/OutputMeter.hpp" | ||
| 9 | #include "../../model/OutputMeter_Impl.hpp" | ||
| 10 | |||
| 11 | #include <utilities/idd/Output_Meter_Cumulative_FieldEnums.hxx> | ||
| 12 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 13 | |||
| 14 | using namespace openstudio::model; | ||
| 15 | |||
| 16 | namespace openstudio { | ||
| 17 | |||
| 18 | namespace energyplus { | ||
| 19 | |||
| 20 | 1 | OptionalModelObject ReverseTranslator::translateOutputMeterCumulative(const WorkspaceObject& workspaceObject) { | |
| 21 |
1/1✓ Branch 1 taken 1 time.
|
1 | openstudio::model::OutputMeter meter(m_model); |
| 22 | |||
| 23 |
1/1✓ Branch 1 taken 1 time.
|
1 | OptionalString s = workspaceObject.getString(Output_Meter_CumulativeFields::KeyName); |
| 24 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (s) { |
| 25 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setName(*s); |
| 26 | } | ||
| 27 | |||
| 28 |
1/1✓ Branch 1 taken 1 time.
|
1 | s = workspaceObject.getString(Output_Meter_CumulativeFields::ReportingFrequency); |
| 29 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (s) { |
| 30 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | meter.setReportingFrequency(*s); |
| 31 | } | ||
| 32 | |||
| 33 |
1/1✓ Branch 1 taken 1 time.
|
1 | meter.setMeterFileOnly(false); |
| 34 | |||
| 35 |
1/1✓ Branch 1 taken 1 time.
|
1 | meter.setCumulative(true); |
| 36 | |||
| 37 |
1/1✓ Branch 1 taken 1 time.
|
2 | return meter; |
| 38 | 1 | } | |
| 39 | |||
| 40 | } // namespace energyplus | ||
| 41 | |||
| 42 | } // namespace openstudio | ||
| 43 |