src/energyplus/ReverseTranslator/ReverseTranslateOutputControlTimestamp.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/OutputControlTimestamp.hpp" | ||
| 9 | #include "../../model/OutputControlTimestamp_Impl.hpp" | ||
| 10 | |||
| 11 | #include <utilities/idd/OutputControl_Timestamp_FieldEnums.hxx> | ||
| 12 | #include <utilities/idd/IddEnums.hxx> | ||
| 13 | |||
| 14 | using namespace openstudio::model; | ||
| 15 | |||
| 16 | namespace openstudio { | ||
| 17 | |||
| 18 | namespace energyplus { | ||
| 19 | |||
| 20 | 2 | boost::optional<ModelObject> ReverseTranslator::translateOutputControlTimestamp(const WorkspaceObject& workspaceObject) { | |
| 21 | 2 | boost::optional<ModelObject> result; | |
| 22 | |||
| 23 | // This is a Unique ModelObject | ||
| 24 |
1/1✓ Branch 1 taken 2 times.
|
2 | openstudio::model::OutputControlTimestamp modelObject = m_model.getUniqueModelObject<OutputControlTimestamp>(); |
| 25 | |||
| 26 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if (boost::optional<std::string> _iso8601Format = workspaceObject.getString(OutputControl_TimestampFields::ISO8601Format, true)) { |
| 27 |
5/5✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 1 time.
✓ Branch 11 taken 1 time.
|
6 | if (istringEqual("Yes", _iso8601Format.get())) { |
| 28 |
1/1✓ Branch 1 taken 1 time.
|
1 | modelObject.setISO8601Format(true); |
| 29 | } else { | ||
| 30 |
1/1✓ Branch 1 taken 1 time.
|
1 | modelObject.setISO8601Format(false); |
| 31 | } | ||
| 32 | 2 | } | |
| 33 | |||
| 34 | 2 | if (boost::optional<std::string> _timestampAtBeginningofInterval = | |
| 35 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | workspaceObject.getString(OutputControl_TimestampFields::TimestampatBeginningofInterval, true)) { |
| 36 |
5/5✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 1 time.
✓ Branch 11 taken 1 time.
|
6 | if (istringEqual("Yes", _timestampAtBeginningofInterval.get())) { |
| 37 |
1/1✓ Branch 1 taken 1 time.
|
1 | modelObject.setTimestampAtBeginningOfInterval(true); |
| 38 | } else { | ||
| 39 |
1/1✓ Branch 1 taken 1 time.
|
1 | modelObject.setTimestampAtBeginningOfInterval(false); |
| 40 | } | ||
| 41 | 2 | } | |
| 42 | |||
| 43 |
1/1✓ Branch 1 taken 2 times.
|
2 | result = modelObject; |
| 44 | 4 | return result; | |
| 45 | |||
| 46 | 2 | } // End of translate function | |
| 47 | |||
| 48 | } // end namespace energyplus | ||
| 49 | } // end namespace openstudio | ||
| 50 |