src/energyplus/ForwardTranslator/ForwardTranslateRunPeriodControlDaylightSavingTime.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/RunPeriodControlDaylightSavingTime.hpp" | ||
| 8 | |||
| 9 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 10 | #include <utilities/idd/IddEnums.hxx> | ||
| 11 | #include <utilities/idd/OS_RunPeriodControl_DaylightSavingTime_FieldEnums.hxx> | ||
| 12 | #include <utilities/idd/RunPeriodControl_DaylightSavingTime_FieldEnums.hxx> | ||
| 13 | |||
| 14 | using namespace openstudio::model; | ||
| 15 | |||
| 16 | namespace openstudio { | ||
| 17 | |||
| 18 | namespace energyplus { | ||
| 19 | |||
| 20 | 4 | boost::optional<IdfObject> ForwardTranslator::translateRunPeriodControlDaylightSavingTime(RunPeriodControlDaylightSavingTime& modelObject) { | |
| 21 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | IdfObject idfObject(openstudio::IddObjectType::RunPeriodControl_DaylightSavingTime); |
| 22 | |||
| 23 | 4 | boost::optional<std::string> s; | |
| 24 | |||
| 25 |
1/1✓ Branch 1 taken 4 times.
|
4 | s = modelObject.getString(OS_RunPeriodControl_DaylightSavingTimeFields::StartDate); |
| 26 |
1/2✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
|
4 | if (s) { |
| 27 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | std::string str = s.get(); |
| 28 | //auto index = str.find("5th", 0); | ||
| 29 | //if (index != std::string::npos){ | ||
| 30 | // str.replace(index, 3, "Last"); | ||
| 31 | //} | ||
| 32 | |||
| 33 |
1/1✓ Branch 1 taken 4 times.
|
4 | idfObject.setString(RunPeriodControl_DaylightSavingTimeFields::StartDate, str); |
| 34 | 4 | } | |
| 35 | |||
| 36 |
1/1✓ Branch 1 taken 4 times.
|
4 | s = modelObject.getString(OS_RunPeriodControl_DaylightSavingTimeFields::EndDate); |
| 37 |
1/2✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
|
4 | if (s) { |
| 38 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | std::string str = s.get(); |
| 39 | //auto index = str.find("5th", 0); | ||
| 40 | //if (index != std::string::npos){ | ||
| 41 | // str.replace(index, 3, "Last"); | ||
| 42 | //} | ||
| 43 | |||
| 44 |
1/1✓ Branch 1 taken 4 times.
|
4 | idfObject.setString(RunPeriodControl_DaylightSavingTimeFields::EndDate, str); |
| 45 | 4 | } | |
| 46 | |||
| 47 |
1/1✓ Branch 1 taken 4 times.
|
4 | m_idfObjects.push_back(idfObject); |
| 48 | |||
| 49 |
1/1✓ Branch 1 taken 4 times.
|
8 | return idfObject; |
| 50 | 4 | } | |
| 51 | |||
| 52 | } // namespace energyplus | ||
| 53 | |||
| 54 | } // namespace openstudio | ||
| 55 |