src/energyplus/ForwardTranslator/ForwardTranslateExternalInterfaceFunctionalMockupUnitImport.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/ModelObject.hpp" | ||
| 10 | #include "../../model/ExternalInterfaceFunctionalMockupUnitImport.hpp" | ||
| 11 | #include "../../model/ExternalInterfaceFunctionalMockupUnitImport_Impl.hpp" | ||
| 12 | |||
| 13 | #include <utilities/idd/ExternalInterface_FunctionalMockupUnitImport_FieldEnums.hxx> | ||
| 14 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 15 | #include <utilities/idd/IddEnums.hxx> | ||
| 16 | |||
| 17 | using namespace openstudio::model; | ||
| 18 | |||
| 19 | using namespace std; | ||
| 20 | |||
| 21 | namespace openstudio { | ||
| 22 | |||
| 23 | namespace energyplus { | ||
| 24 | |||
| 25 | boost::optional<IdfObject> | ||
| 26 | 5 | ForwardTranslator::translateExternalInterfaceFunctionalMockupUnitImport(ExternalInterfaceFunctionalMockupUnitImport& modelObject) { | |
| 27 | 5 | boost::optional<std::string> s; | |
| 28 | 5 | boost::optional<double> d; | |
| 29 | |||
| 30 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | IdfObject idfObject(openstudio::IddObjectType::ExternalInterface_FunctionalMockupUnitImport); |
| 31 |
1/1✓ Branch 1 taken 5 times.
|
5 | m_idfObjects.push_back(idfObject); |
| 32 | //Name | ||
| 33 |
1/1✓ Branch 1 taken 5 times.
|
5 | s = modelObject.name(); |
| 34 |
1/2✓ Branch 0 taken 5 times.
✗ Branch 1 not taken.
|
5 | if (s) { |
| 35 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | idfObject.setName(*s); |
| 36 | } | ||
| 37 | |||
| 38 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | s = modelObject.fMUFileName(); |
| 39 |
1/2✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
|
5 | if (s.is_initialized()) { |
| 40 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | idfObject.setString(ExternalInterface_FunctionalMockupUnitImportFields::FMUFileName, s.get()); |
| 41 | } | ||
| 42 | |||
| 43 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | d = modelObject.fMUTimeout(); |
| 44 |
1/2✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
|
5 | if (d.is_initialized()) { |
| 45 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | idfObject.setDouble(ExternalInterface_FunctionalMockupUnitImportFields::FMUTimeout, d.get()); |
| 46 | } | ||
| 47 | |||
| 48 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | d = modelObject.fMULoggingOn(); |
| 49 |
1/2✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
|
5 | if (d.is_initialized()) { |
| 50 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | idfObject.setDouble(ExternalInterface_FunctionalMockupUnitImportFields::FMULoggingOn, d.get()); |
| 51 | } | ||
| 52 | |||
| 53 |
1/1✓ Branch 1 taken 5 times.
|
10 | return idfObject; |
| 54 | 5 | } | |
| 55 | |||
| 56 | } // namespace energyplus | ||
| 57 | |||
| 58 | } // namespace openstudio | ||
| 59 |