src/utilities/filetypes/RunOptions_Impl.hpp
| 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 | #ifndef UTILITIES_FILETYPES_RUNOPTIONS_IMPL_HPP | ||
| 7 | #define UTILITIES_FILETYPES_RUNOPTIONS_IMPL_HPP | ||
| 8 | |||
| 9 | #include "ForwardTranslatorOptions.hpp" | ||
| 10 | |||
| 11 | #include "../UtilitiesAPI.hpp" | ||
| 12 | |||
| 13 | #include "../core/Logger.hpp" | ||
| 14 | #include "../core/Path.hpp" | ||
| 15 | #include "../data/Variant.hpp" | ||
| 16 | |||
| 17 | #include <json/json.h> | ||
| 18 | |||
| 19 | #include <nano/nano_signal_slot.hpp> | ||
| 20 | |||
| 21 | namespace openstudio { | ||
| 22 | class CustomOutputAdapter; | ||
| 23 | |||
| 24 | namespace detail { | ||
| 25 | |||
| 26 | class UTILITIES_API RunOptions_Impl | ||
| 27 | { | ||
| 28 | public: | ||
| 29 |
1/1✓ Branch 2 taken 289 times.
|
289 | RunOptions_Impl() = default; |
| 30 | |||
| 31 | Json::Value toJSON() const; | ||
| 32 | std::string string() const; | ||
| 33 | |||
| 34 | bool debug() const; | ||
| 35 | bool isDebugDefaulted() const; | ||
| 36 | bool setDebug(bool debug); | ||
| 37 | void resetDebug(); | ||
| 38 | |||
| 39 | bool epjson() const; | ||
| 40 | bool isEpjsonDefaulted() const; | ||
| 41 | bool setEpjson(bool epjson); | ||
| 42 | void resetEpjson(); | ||
| 43 | |||
| 44 | bool fast() const; | ||
| 45 | bool isFastDefaulted() const; | ||
| 46 | bool setFast(bool fast); | ||
| 47 | void resetFast(); | ||
| 48 | |||
| 49 | bool preserveRunDir() const; | ||
| 50 | bool isPreserveRunDirDefaulted() const; | ||
| 51 | bool setPreserveRunDir(bool preserveRunDir); | ||
| 52 | void resetPreserveRunDir(); | ||
| 53 | |||
| 54 | bool skipExpandObjects() const; | ||
| 55 | bool isSkipExpandObjectsDefaulted() const; | ||
| 56 | bool setSkipExpandObjects(bool skipExpandObjects); | ||
| 57 | void resetSkipExpandObjects(); | ||
| 58 | |||
| 59 | bool skipEnergyPlusPreprocess() const; | ||
| 60 | bool isSkipEnergyPlusPreprocessDefaulted() const; | ||
| 61 | bool setSkipEnergyPlusPreprocess(bool skipEnergyPlusPreprocess); | ||
| 62 | void resetSkipEnergyPlusPreprocess(); | ||
| 63 | |||
| 64 | bool cleanup() const; | ||
| 65 | bool isCleanupDefaulted() const; | ||
| 66 | bool setCleanup(bool cleanup); | ||
| 67 | void resetCleanup(); | ||
| 68 | |||
| 69 | bool skipZipResults() const; | ||
| 70 | bool isSkipZipResultsDefaulted() const; | ||
| 71 | bool setSkipZipResults(bool skipZipResults); | ||
| 72 | void resetSkipZipResults(); | ||
| 73 | |||
| 74 | boost::optional<CustomOutputAdapter> customOutputAdapter() const; | ||
| 75 | bool setCustomOutputAdapter(const CustomOutputAdapter& adapter); | ||
| 76 | void resetCustomOutputAdapter(); | ||
| 77 | |||
| 78 | ForwardTranslatorOptions forwardTranslatorOptions() const; | ||
| 79 | bool setForwardTranslatorOptions(const ForwardTranslatorOptions& forwardTranslatorOptions); | ||
| 80 | void resetForwardTranslatorOptions(); | ||
| 81 | |||
| 82 | /* Any non-defaulted value from other is brought over */ | ||
| 83 | void overrideValuesWith(const RunOptions& other); | ||
| 84 | |||
| 85 | // Emitted on any change | ||
| 86 | Nano::Signal<void()> onChange; | ||
| 87 | |||
| 88 | protected: | ||
| 89 | void onUpdate(); | ||
| 90 | |||
| 91 | private: | ||
| 92 | // configure logging | ||
| 93 | REGISTER_LOGGER("openstudio.RunOptions"); | ||
| 94 | |||
| 95 | static constexpr bool DEFAULT_DEBUG = false; | ||
| 96 | static constexpr bool DEFAULT_EPJSON = false; | ||
| 97 | static constexpr bool DEFAULT_FAST = false; | ||
| 98 | static constexpr bool DEFAULT_PRESERVERUNDIR = false; | ||
| 99 | static constexpr bool DEFAULT_SKIPEXPANDOBJECTS = false; | ||
| 100 | static constexpr bool DEFAULT_SKIPENERGYPLUSPREPROCESS = false; | ||
| 101 | static constexpr bool DEFAULT_CLEANUP = true; | ||
| 102 | static constexpr bool DEFAULT_SKIPZIPRESULTS = false; | ||
| 103 | |||
| 104 | bool m_debug = DEFAULT_DEBUG; | ||
| 105 | bool m_is_debug_defaulted = true; | ||
| 106 | |||
| 107 | bool m_epjson = DEFAULT_EPJSON; | ||
| 108 | bool m_is_epjson_defaulted = true; | ||
| 109 | |||
| 110 | bool m_fast = DEFAULT_FAST; | ||
| 111 | bool m_is_fast_defaulted = true; | ||
| 112 | |||
| 113 | bool m_preserveRunDir = DEFAULT_PRESERVERUNDIR; | ||
| 114 | bool m_is_preserveRunDir_defaulted = true; | ||
| 115 | |||
| 116 | bool m_skipExpandObjects = DEFAULT_SKIPEXPANDOBJECTS; | ||
| 117 | bool m_is_skipExpandObjects_defaulted = true; | ||
| 118 | |||
| 119 | bool m_skipEnergyPlusPreprocess = DEFAULT_SKIPENERGYPLUSPREPROCESS; | ||
| 120 | bool m_is_skipEnergyPlusPreprocess_defaulted = true; | ||
| 121 | |||
| 122 | // TODO this does absolutely nothing in the workflow-gem currently | ||
| 123 | bool m_cleanup = DEFAULT_CLEANUP; | ||
| 124 | bool m_is_cleanup_defaulted = true; | ||
| 125 | |||
| 126 | bool m_skipZipResults = DEFAULT_SKIPZIPRESULTS; | ||
| 127 | bool m_is_skipZipResults_defaulted = true; | ||
| 128 | |||
| 129 | ForwardTranslatorOptions m_forwardTranslatorOptions; | ||
| 130 | boost::optional<CustomOutputAdapter> m_customOutputAdapter; | ||
| 131 | }; | ||
| 132 | |||
| 133 | } // namespace detail | ||
| 134 | } // namespace openstudio | ||
| 135 | |||
| 136 | #endif //UTILITIES_FILETYPES_RUNOPTIONS_IMPL_HPP | ||
| 137 |