src/utilities/filetypes/ForwardTranslatorOptions.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 "ForwardTranslatorOptions.hpp" | ||
| 7 | #include "ForwardTranslatorOptions_Impl.hpp" | ||
| 8 | |||
| 9 | #include <json/json.h> | ||
| 10 | |||
| 11 | #include <memory> | ||
| 12 | #include <string> | ||
| 13 | |||
| 14 | namespace openstudio { | ||
| 15 | namespace detail { | ||
| 16 | |||
| 17 | ✗ | void ForwardTranslatorOptions_Impl::reset() { | |
| 18 | ✗ | m_runcontrolspecialdays = DEFAULT_RUNCONTROLSPECIALDAYS; | |
| 19 | ✗ | m_is_runcontrolspecialdays_defaulted = true; | |
| 20 | |||
| 21 | ✗ | m_ip_tabular_output = DEFAULT_IP_TABULAR_OUTPUT; | |
| 22 | ✗ | m_is_ip_tabular_output_defaulted = true; | |
| 23 | |||
| 24 | ✗ | m_no_lifecyclecosts = DEFAULT_NO_LIFECYCLECOSTS; | |
| 25 | ✗ | m_is_no_lifecyclecosts_defaulted = true; | |
| 26 | |||
| 27 | ✗ | m_no_sqlite_output = DEFAULT_NO_SQLITE_OUTPUT; | |
| 28 | ✗ | m_is_no_sqlite_output_defaulted = true; | |
| 29 | |||
| 30 | ✗ | m_no_html_output = DEFAULT_NO_HTML_OUTPUT; | |
| 31 | ✗ | m_is_no_html_output_defaulted = true; | |
| 32 | |||
| 33 | ✗ | m_no_variable_dictionary = DEFAULT_NO_VARIABLE_DICTIONARY; | |
| 34 | ✗ | m_is_no_variable_dictionary_defaulted = true; | |
| 35 | |||
| 36 | ✗ | m_no_space_translation = DEFAULT_NO_SPACE_TRANSLATION; | |
| 37 | ✗ | m_is_no_space_translation_defaulted = true; | |
| 38 | |||
| 39 | ✗ | m_no_space_load_instances = DEFAULT_NO_SPACE_LOAD_INSTANCES; | |
| 40 | ✗ | m_is_no_space_load_instances_defaulted = true; | |
| 41 | ✗ | } | |
| 42 | |||
| 43 | 897 | bool ForwardTranslatorOptions_Impl::keepRunControlSpecialDays() const { | |
| 44 | 897 | return m_runcontrolspecialdays; | |
| 45 | } | ||
| 46 | |||
| 47 | 7 | bool ForwardTranslatorOptions_Impl::isKeepRunControlSpecialDaysDefaulted() const { | |
| 48 | 7 | return m_is_runcontrolspecialdays_defaulted; | |
| 49 | } | ||
| 50 | |||
| 51 | 5 | void ForwardTranslatorOptions_Impl::setKeepRunControlSpecialDays(bool keepRunControlSpecialDays) { | |
| 52 | 5 | m_runcontrolspecialdays = keepRunControlSpecialDays; | |
| 53 | 5 | m_is_runcontrolspecialdays_defaulted = false; | |
| 54 | 5 | } | |
| 55 | |||
| 56 | 1 | void ForwardTranslatorOptions_Impl::resetKeepRunControlSpecialDays() { | |
| 57 | 1 | m_runcontrolspecialdays = DEFAULT_RUNCONTROLSPECIALDAYS; | |
| 58 | 1 | m_is_runcontrolspecialdays_defaulted = true; | |
| 59 | 1 | } | |
| 60 | |||
| 61 | 847 | bool ForwardTranslatorOptions_Impl::iPTabularOutput() const { | |
| 62 | 847 | return m_ip_tabular_output; | |
| 63 | } | ||
| 64 | |||
| 65 | 7 | bool ForwardTranslatorOptions_Impl::isIPTabularOutputDefaulted() const { | |
| 66 | 7 | return m_is_ip_tabular_output_defaulted; | |
| 67 | } | ||
| 68 | |||
| 69 | 7 | void ForwardTranslatorOptions_Impl::setIPTabularOutput(bool iPTabularOutput) { | |
| 70 | 7 | m_ip_tabular_output = iPTabularOutput; | |
| 71 | 7 | m_is_ip_tabular_output_defaulted = false; | |
| 72 | 7 | } | |
| 73 | |||
| 74 | 1 | void ForwardTranslatorOptions_Impl::resetIPTabularOutput() { | |
| 75 | 1 | m_ip_tabular_output = DEFAULT_IP_TABULAR_OUTPUT; | |
| 76 | 1 | m_is_ip_tabular_output_defaulted = true; | |
| 77 | 1 | } | |
| 78 | |||
| 79 | 1719 | bool ForwardTranslatorOptions_Impl::excludeLCCObjects() const { | |
| 80 | 1719 | return m_no_lifecyclecosts; | |
| 81 | } | ||
| 82 | |||
| 83 | 7 | bool ForwardTranslatorOptions_Impl::isExcludeLCCObjectsDefaulted() const { | |
| 84 | 7 | return m_is_no_lifecyclecosts_defaulted; | |
| 85 | } | ||
| 86 | |||
| 87 | 7 | void ForwardTranslatorOptions_Impl::setExcludeLCCObjects(bool excludeLCCObjects) { | |
| 88 | 7 | m_no_lifecyclecosts = excludeLCCObjects; | |
| 89 | 7 | m_is_no_lifecyclecosts_defaulted = false; | |
| 90 | 7 | } | |
| 91 | |||
| 92 | 1 | void ForwardTranslatorOptions_Impl::resetExcludeLCCObjects() { | |
| 93 | 1 | m_no_lifecyclecosts = DEFAULT_NO_LIFECYCLECOSTS; | |
| 94 | 1 | m_is_no_lifecyclecosts_defaulted = true; | |
| 95 | 1 | } | |
| 96 | |||
| 97 | 863 | bool ForwardTranslatorOptions_Impl::excludeSQliteOutputReport() const { | |
| 98 | 863 | return m_no_sqlite_output; | |
| 99 | } | ||
| 100 | |||
| 101 | 7 | bool ForwardTranslatorOptions_Impl::isExcludeSQliteOutputReportDefaulted() const { | |
| 102 | 7 | return m_is_no_sqlite_output_defaulted; | |
| 103 | } | ||
| 104 | |||
| 105 | 6 | void ForwardTranslatorOptions_Impl::setExcludeSQliteOutputReport(bool excludeSQliteOutputReport) { | |
| 106 | 6 | m_no_sqlite_output = excludeSQliteOutputReport; | |
| 107 | 6 | m_is_no_sqlite_output_defaulted = false; | |
| 108 | 6 | } | |
| 109 | |||
| 110 | 1 | void ForwardTranslatorOptions_Impl::resetExcludeSQliteOutputReport() { | |
| 111 | 1 | m_no_sqlite_output = DEFAULT_NO_SQLITE_OUTPUT; | |
| 112 | 1 | m_is_no_sqlite_output_defaulted = true; | |
| 113 | 1 | } | |
| 114 | |||
| 115 | 1719 | bool ForwardTranslatorOptions_Impl::excludeHTMLOutputReport() const { | |
| 116 | 1719 | return m_no_html_output; | |
| 117 | } | ||
| 118 | |||
| 119 | 7 | bool ForwardTranslatorOptions_Impl::isExcludeHTMLOutputReportDefaulted() const { | |
| 120 | 7 | return m_is_no_html_output_defaulted; | |
| 121 | } | ||
| 122 | |||
| 123 | 6 | void ForwardTranslatorOptions_Impl::setExcludeHTMLOutputReport(bool excludeHTMLOutputReport) { | |
| 124 | 6 | m_no_html_output = excludeHTMLOutputReport; | |
| 125 | 6 | m_is_no_html_output_defaulted = false; | |
| 126 | 6 | } | |
| 127 | |||
| 128 | 1 | void ForwardTranslatorOptions_Impl::resetExcludeHTMLOutputReport() { | |
| 129 | 1 | m_no_html_output = DEFAULT_NO_HTML_OUTPUT; | |
| 130 | 1 | m_is_no_html_output_defaulted = true; | |
| 131 | 1 | } | |
| 132 | |||
| 133 | 863 | bool ForwardTranslatorOptions_Impl::excludeVariableDictionary() const { | |
| 134 | 863 | return m_no_variable_dictionary; | |
| 135 | } | ||
| 136 | |||
| 137 | 7 | bool ForwardTranslatorOptions_Impl::isExcludeVariableDictionaryDefaulted() const { | |
| 138 | 7 | return m_is_no_variable_dictionary_defaulted; | |
| 139 | } | ||
| 140 | |||
| 141 | 5 | void ForwardTranslatorOptions_Impl::setExcludeVariableDictionary(bool excludeVariableDictionary) { | |
| 142 | 5 | m_no_variable_dictionary = excludeVariableDictionary; | |
| 143 | 5 | m_is_no_variable_dictionary_defaulted = false; | |
| 144 | 5 | } | |
| 145 | |||
| 146 | 1 | void ForwardTranslatorOptions_Impl::resetExcludeVariableDictionary() { | |
| 147 | 1 | m_no_variable_dictionary = DEFAULT_NO_VARIABLE_DICTIONARY; | |
| 148 | 1 | m_is_no_variable_dictionary_defaulted = true; | |
| 149 | 1 | } | |
| 150 | |||
| 151 | 6330 | bool ForwardTranslatorOptions_Impl::excludeSpaceTranslation() const { | |
| 152 | 6330 | return m_no_space_translation; | |
| 153 | } | ||
| 154 | |||
| 155 | 7 | bool ForwardTranslatorOptions_Impl::isExcludeSpaceTranslationDefaulted() const { | |
| 156 | 7 | return m_is_no_space_translation_defaulted; | |
| 157 | } | ||
| 158 | |||
| 159 | 123 | void ForwardTranslatorOptions_Impl::setExcludeSpaceTranslation(bool excludeSpaceTranslation) { | |
| 160 | 123 | m_no_space_translation = excludeSpaceTranslation; | |
| 161 | 123 | m_is_no_space_translation_defaulted = false; | |
| 162 | 123 | } | |
| 163 | |||
| 164 | 1 | void ForwardTranslatorOptions_Impl::resetExcludeSpaceTranslation() { | |
| 165 | 1 | m_no_space_translation = DEFAULT_NO_SPACE_TRANSLATION; | |
| 166 | 1 | m_is_no_space_translation_defaulted = true; | |
| 167 | 1 | } | |
| 168 | |||
| 169 | 706 | bool ForwardTranslatorOptions_Impl::excludeSpaceLoadInstances() const { | |
| 170 | 706 | return m_no_space_load_instances; | |
| 171 | } | ||
| 172 | |||
| 173 | 7 | bool ForwardTranslatorOptions_Impl::isExcludeSpaceLoadInstancesDefaulted() const { | |
| 174 | 7 | return m_is_no_space_load_instances_defaulted; | |
| 175 | } | ||
| 176 | |||
| 177 | 68 | void ForwardTranslatorOptions_Impl::setExcludeSpaceLoadInstances(bool excludeSpaceLoadInstances) { | |
| 178 | 68 | m_no_space_load_instances = excludeSpaceLoadInstances; | |
| 179 | 68 | m_is_no_space_load_instances_defaulted = false; | |
| 180 | 68 | } | |
| 181 | |||
| 182 | 1 | void ForwardTranslatorOptions_Impl::resetExcludeSpaceLoadInstances() { | |
| 183 | 1 | m_no_space_load_instances = DEFAULT_NO_SPACE_LOAD_INSTANCES; | |
| 184 | 1 | m_is_no_space_load_instances_defaulted = true; | |
| 185 | 1 | } | |
| 186 | |||
| 187 | 1 | void ForwardTranslatorOptions_Impl::overrideValuesWith(const ForwardTranslatorOptions& other) { | |
| 188 |
1/2✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
|
1 | if (!other.isKeepRunControlSpecialDaysDefaulted()) { |
| 189 | 1 | setKeepRunControlSpecialDays(other.keepRunControlSpecialDays()); | |
| 190 | } | ||
| 191 | |||
| 192 |
1/2✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
|
1 | if (!other.isIPTabularOutputDefaulted()) { |
| 193 | 1 | setIPTabularOutput(other.iPTabularOutput()); | |
| 194 | } | ||
| 195 | |||
| 196 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (!other.isExcludeLCCObjectsDefaulted()) { |
| 197 | ✗ | setExcludeLCCObjects(other.excludeLCCObjects()); | |
| 198 | } | ||
| 199 | |||
| 200 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (!other.isExcludeSQliteOutputReportDefaulted()) { |
| 201 | ✗ | setExcludeSQliteOutputReport(other.excludeSQliteOutputReport()); | |
| 202 | } | ||
| 203 | |||
| 204 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (!other.isExcludeHTMLOutputReportDefaulted()) { |
| 205 | ✗ | setExcludeHTMLOutputReport(other.excludeHTMLOutputReport()); | |
| 206 | } | ||
| 207 | |||
| 208 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (!other.isExcludeVariableDictionaryDefaulted()) { |
| 209 | ✗ | setExcludeVariableDictionary(other.excludeVariableDictionary()); | |
| 210 | } | ||
| 211 | |||
| 212 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (!other.isExcludeSpaceTranslationDefaulted()) { |
| 213 | ✗ | setExcludeSpaceTranslation(other.excludeSpaceTranslation()); | |
| 214 | } | ||
| 215 | |||
| 216 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (!other.isExcludeSpaceLoadInstancesDefaulted()) { |
| 217 | ✗ | setExcludeSpaceLoadInstances(other.excludeSpaceLoadInstances()); | |
| 218 | } | ||
| 219 | 1 | } | |
| 220 | |||
| 221 | 111 | Json::Value ForwardTranslatorOptions_Impl::toJSON() const { | |
| 222 | 111 | Json::Value value; | |
| 223 | |||
| 224 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 108 times.
|
111 | if (!m_is_runcontrolspecialdays_defaulted) { |
| 225 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | value["runcontrolspecialdays"] = m_runcontrolspecialdays; |
| 226 | } | ||
| 227 | |||
| 228 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 108 times.
|
111 | if (!m_is_ip_tabular_output_defaulted) { |
| 229 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | value["ip_tabular_output"] = m_ip_tabular_output; |
| 230 | } | ||
| 231 | |||
| 232 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 108 times.
|
111 | if (!m_is_no_lifecyclecosts_defaulted) { |
| 233 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | value["no_lifecyclecosts"] = m_no_lifecyclecosts; |
| 234 | } | ||
| 235 | |||
| 236 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 108 times.
|
111 | if (!m_is_no_sqlite_output_defaulted) { |
| 237 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | value["no_sqlite_output"] = m_no_sqlite_output; |
| 238 | } | ||
| 239 | |||
| 240 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 108 times.
|
111 | if (!m_is_no_html_output_defaulted) { |
| 241 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | value["no_html_output"] = m_no_html_output; |
| 242 | } | ||
| 243 | |||
| 244 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 108 times.
|
111 | if (!m_is_no_variable_dictionary_defaulted) { |
| 245 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | value["no_variable_dictionary"] = m_no_variable_dictionary; |
| 246 | } | ||
| 247 | |||
| 248 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 108 times.
|
111 | if (!m_is_no_space_translation_defaulted) { |
| 249 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | value["no_space_translation"] = m_no_space_translation; |
| 250 | } | ||
| 251 | |||
| 252 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 111 times.
|
111 | if (!m_is_no_space_load_instances_defaulted) { |
| 253 | ✗ | value["no_space_load_instances"] = m_no_space_load_instances; | |
| 254 | } | ||
| 255 | |||
| 256 | 111 | return value; | |
| 257 | ✗ | } | |
| 258 | |||
| 259 | 3 | std::string ForwardTranslatorOptions_Impl::string() const { | |
| 260 | |||
| 261 |
1/1✓ Branch 1 taken 3 times.
|
3 | const Json::Value data = this->toJSON(); |
| 262 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 2 times.
|
3 | if (data.isNull()) { |
| 263 |
1/1✓ Branch 1 taken 1 time.
|
2 | return ""; |
| 264 | } | ||
| 265 | // Write to string | ||
| 266 |
1/1✓ Branch 1 taken 2 times.
|
2 | Json::StreamWriterBuilder wbuilder; |
| 267 | // mimic the old StyledWriter behavior: | ||
| 268 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
6 | wbuilder["indentation"] = " "; |
| 269 |
1/1✓ Branch 1 taken 2 times.
|
2 | std::string result = Json::writeString(wbuilder, data); |
| 270 | |||
| 271 | 2 | return result; | |
| 272 | 3 | } | |
| 273 | |||
| 274 | } // namespace detail | ||
| 275 | |||
| 276 | 2 | ForwardTranslatorOptions::ForwardTranslatorOptions(std::shared_ptr<detail::ForwardTranslatorOptions_Impl> impl) : m_impl(std::move(impl)) {} | |
| 277 | 924 | ForwardTranslatorOptions::ForwardTranslatorOptions() : m_impl(std::make_shared<detail::ForwardTranslatorOptions_Impl>()) {} | |
| 278 | |||
| 279 | ✗ | void ForwardTranslatorOptions::reset() { | |
| 280 | ✗ | m_impl->reset(); | |
| 281 | ✗ | } | |
| 282 | |||
| 283 | 1 | boost::optional<ForwardTranslatorOptions> ForwardTranslatorOptions::fromString(const std::string& s) { | |
| 284 | |||
| 285 | // We let it fail with a warning message | ||
| 286 |
1/1✓ Branch 1 taken 1 time.
|
1 | Json::CharReaderBuilder rbuilder; |
| 287 |
1/1✓ Branch 1 taken 1 time.
|
1 | std::istringstream ss(s); |
| 288 | 1 | std::string formattedErrors; | |
| 289 |
1/1✓ Branch 1 taken 1 time.
|
1 | Json::Value value; |
| 290 |
1/1✓ Branch 1 taken 1 time.
|
1 | bool parsingSuccessful = Json::parseFromStream(rbuilder, ss, &value, &formattedErrors); |
| 291 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (!parsingSuccessful) { |
| 292 | ✗ | LOG(Warn, "Couldn't parse ForwardTranslatorOptions from string s='" << s << "'. Error: '" << formattedErrors << "'."); | |
| 293 | ✗ | return boost::none; | |
| 294 | } | ||
| 295 | |||
| 296 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | return ForwardTranslatorOptions::fromJSON(value); |
| 297 | 1 | } | |
| 298 | |||
| 299 | 2 | ForwardTranslatorOptions ForwardTranslatorOptions::fromJSON(const Json::Value& value) { | |
| 300 | |||
| 301 | 2 | ForwardTranslatorOptions result; | |
| 302 | |||
| 303 |
6/9✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 2 times.
✓ Branch 9 taken 2 times.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 14 not taken.
|
2 | if (value.isMember("runcontrolspecialdays") && value["runcontrolspecialdays"].isBool()) { |
| 304 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | result.setKeepRunControlSpecialDays(value["runcontrolspecialdays"].asBool()); |
| 305 | } | ||
| 306 |
6/9✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 2 times.
✓ Branch 9 taken 2 times.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 14 not taken.
|
2 | if (value.isMember("ip_tabular_output") && value["ip_tabular_output"].isBool()) { |
| 307 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | result.setIPTabularOutput(value["ip_tabular_output"].asBool()); |
| 308 | } | ||
| 309 |
6/9✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 2 times.
✓ Branch 9 taken 2 times.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 14 not taken.
|
2 | if (value.isMember("no_lifecyclecosts") && value["no_lifecyclecosts"].isBool()) { |
| 310 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | result.setExcludeLCCObjects(value["no_lifecyclecosts"].asBool()); |
| 311 | } | ||
| 312 |
6/9✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 2 times.
✓ Branch 9 taken 2 times.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 14 not taken.
|
2 | if (value.isMember("no_sqlite_output") && value["no_sqlite_output"].isBool()) { |
| 313 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | result.setExcludeSQliteOutputReport(value["no_sqlite_output"].asBool()); |
| 314 | } | ||
| 315 |
6/9✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 2 times.
✓ Branch 9 taken 2 times.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 14 not taken.
|
2 | if (value.isMember("no_html_output") && value["no_html_output"].isBool()) { |
| 316 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | result.setExcludeHTMLOutputReport(value["no_html_output"].asBool()); |
| 317 | } | ||
| 318 |
6/9✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 2 times.
✓ Branch 9 taken 2 times.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 14 not taken.
|
2 | if (value.isMember("no_variable_dictionary") && value["no_variable_dictionary"].isBool()) { |
| 319 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | result.setExcludeVariableDictionary(value["no_variable_dictionary"].asBool()); |
| 320 | } | ||
| 321 |
6/9✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 2 times.
✓ Branch 9 taken 2 times.
✓ Branch 11 taken 2 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 14 not taken.
|
2 | if (value.isMember("no_space_translation") && value["no_space_translation"].isBool()) { |
| 322 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | result.setExcludeSpaceTranslation(value["no_space_translation"].asBool()); |
| 323 | } | ||
| 324 |
3/9✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 6 not taken.
✗ Branch 9 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✓ Branch 14 taken 2 times.
|
2 | if (value.isMember("no_space_load_instances") && value["no_space_load_instances"].isBool()) { |
| 325 | ✗ | result.setExcludeSpaceLoadInstances(value["no_space_load_instances"].asBool()); | |
| 326 | } | ||
| 327 | |||
| 328 | 2 | return result; | |
| 329 | ✗ | } | |
| 330 | |||
| 331 | 108 | Json::Value ForwardTranslatorOptions::toJSON() const { | |
| 332 | 108 | return m_impl->toJSON(); | |
| 333 | } | ||
| 334 | |||
| 335 | 3 | std::string ForwardTranslatorOptions::string() const { | |
| 336 | 3 | return m_impl->string(); | |
| 337 | } | ||
| 338 | |||
| 339 | 7 | bool ForwardTranslatorOptions::isKeepRunControlSpecialDaysDefaulted() const { | |
| 340 | 7 | return m_impl->isKeepRunControlSpecialDaysDefaulted(); | |
| 341 | } | ||
| 342 | |||
| 343 | 897 | bool ForwardTranslatorOptions::keepRunControlSpecialDays() const { | |
| 344 | 897 | return m_impl->keepRunControlSpecialDays(); | |
| 345 | } | ||
| 346 | |||
| 347 | 4 | void ForwardTranslatorOptions::setKeepRunControlSpecialDays(bool keepRunControlSpecialDays) { | |
| 348 | 4 | m_impl->setKeepRunControlSpecialDays(keepRunControlSpecialDays); | |
| 349 | 4 | } | |
| 350 | |||
| 351 | 1 | void ForwardTranslatorOptions::resetKeepRunControlSpecialDays() { | |
| 352 | 1 | m_impl->resetKeepRunControlSpecialDays(); | |
| 353 | 1 | } | |
| 354 | |||
| 355 | 7 | bool ForwardTranslatorOptions::isIPTabularOutputDefaulted() const { | |
| 356 | 7 | return m_impl->isIPTabularOutputDefaulted(); | |
| 357 | } | ||
| 358 | |||
| 359 | 847 | bool ForwardTranslatorOptions::iPTabularOutput() const { | |
| 360 | 847 | return m_impl->iPTabularOutput(); | |
| 361 | } | ||
| 362 | |||
| 363 | 6 | void ForwardTranslatorOptions::setIPTabularOutput(bool iPTabularOutput) { | |
| 364 | 6 | m_impl->setIPTabularOutput(iPTabularOutput); | |
| 365 | 6 | } | |
| 366 | |||
| 367 | 1 | void ForwardTranslatorOptions::resetIPTabularOutput() { | |
| 368 | 1 | m_impl->resetIPTabularOutput(); | |
| 369 | 1 | } | |
| 370 | |||
| 371 | 7 | bool ForwardTranslatorOptions::isExcludeLCCObjectsDefaulted() const { | |
| 372 | 7 | return m_impl->isExcludeLCCObjectsDefaulted(); | |
| 373 | } | ||
| 374 | |||
| 375 | 1719 | bool ForwardTranslatorOptions::excludeLCCObjects() const { | |
| 376 | 1719 | return m_impl->excludeLCCObjects(); | |
| 377 | } | ||
| 378 | |||
| 379 | 7 | void ForwardTranslatorOptions::setExcludeLCCObjects(bool excludeLCCObjects) { | |
| 380 | 7 | m_impl->setExcludeLCCObjects(excludeLCCObjects); | |
| 381 | 7 | } | |
| 382 | |||
| 383 | 1 | void ForwardTranslatorOptions::resetExcludeLCCObjects() { | |
| 384 | 1 | m_impl->resetExcludeLCCObjects(); | |
| 385 | 1 | } | |
| 386 | |||
| 387 | 7 | bool ForwardTranslatorOptions::isExcludeSQliteOutputReportDefaulted() const { | |
| 388 | 7 | return m_impl->isExcludeSQliteOutputReportDefaulted(); | |
| 389 | } | ||
| 390 | |||
| 391 | 863 | bool ForwardTranslatorOptions::excludeSQliteOutputReport() const { | |
| 392 | 863 | return m_impl->excludeSQliteOutputReport(); | |
| 393 | } | ||
| 394 | |||
| 395 | 6 | void ForwardTranslatorOptions::setExcludeSQliteOutputReport(bool excludeSQliteOutputReport) { | |
| 396 | 6 | m_impl->setExcludeSQliteOutputReport(excludeSQliteOutputReport); | |
| 397 | 6 | } | |
| 398 | |||
| 399 | 1 | void ForwardTranslatorOptions::resetExcludeSQliteOutputReport() { | |
| 400 | 1 | m_impl->resetExcludeSQliteOutputReport(); | |
| 401 | 1 | } | |
| 402 | |||
| 403 | 7 | bool ForwardTranslatorOptions::isExcludeHTMLOutputReportDefaulted() const { | |
| 404 | 7 | return m_impl->isExcludeHTMLOutputReportDefaulted(); | |
| 405 | } | ||
| 406 | |||
| 407 | 1719 | bool ForwardTranslatorOptions::excludeHTMLOutputReport() const { | |
| 408 | 1719 | return m_impl->excludeHTMLOutputReport(); | |
| 409 | } | ||
| 410 | |||
| 411 | 6 | void ForwardTranslatorOptions::setExcludeHTMLOutputReport(bool excludeHTMLOutputReport) { | |
| 412 | 6 | m_impl->setExcludeHTMLOutputReport(excludeHTMLOutputReport); | |
| 413 | 6 | } | |
| 414 | |||
| 415 | 1 | void ForwardTranslatorOptions::resetExcludeHTMLOutputReport() { | |
| 416 | 1 | m_impl->resetExcludeHTMLOutputReport(); | |
| 417 | 1 | } | |
| 418 | |||
| 419 | 7 | bool ForwardTranslatorOptions::isExcludeVariableDictionaryDefaulted() const { | |
| 420 | 7 | return m_impl->isExcludeVariableDictionaryDefaulted(); | |
| 421 | } | ||
| 422 | |||
| 423 | 863 | bool ForwardTranslatorOptions::excludeVariableDictionary() const { | |
| 424 | 863 | return m_impl->excludeVariableDictionary(); | |
| 425 | } | ||
| 426 | |||
| 427 | 5 | void ForwardTranslatorOptions::setExcludeVariableDictionary(bool excludeVariableDictionary) { | |
| 428 | 5 | m_impl->setExcludeVariableDictionary(excludeVariableDictionary); | |
| 429 | 5 | } | |
| 430 | |||
| 431 | 1 | void ForwardTranslatorOptions::resetExcludeVariableDictionary() { | |
| 432 | 1 | m_impl->resetExcludeVariableDictionary(); | |
| 433 | 1 | } | |
| 434 | |||
| 435 | 7 | bool ForwardTranslatorOptions::isExcludeSpaceTranslationDefaulted() const { | |
| 436 | 7 | return m_impl->isExcludeSpaceTranslationDefaulted(); | |
| 437 | } | ||
| 438 | |||
| 439 | 6330 | bool ForwardTranslatorOptions::excludeSpaceTranslation() const { | |
| 440 | 6330 | return m_impl->excludeSpaceTranslation(); | |
| 441 | } | ||
| 442 | |||
| 443 | 123 | void ForwardTranslatorOptions::setExcludeSpaceTranslation(bool excludeSpaceTranslation) { | |
| 444 | 123 | m_impl->setExcludeSpaceTranslation(excludeSpaceTranslation); | |
| 445 | 123 | } | |
| 446 | |||
| 447 | 1 | void ForwardTranslatorOptions::resetExcludeSpaceTranslation() { | |
| 448 | 1 | m_impl->resetExcludeSpaceTranslation(); | |
| 449 | 1 | } | |
| 450 | |||
| 451 | 7 | bool ForwardTranslatorOptions::isExcludeSpaceLoadInstancesDefaulted() const { | |
| 452 | 7 | return m_impl->isExcludeSpaceLoadInstancesDefaulted(); | |
| 453 | } | ||
| 454 | |||
| 455 | 706 | bool ForwardTranslatorOptions::excludeSpaceLoadInstances() const { | |
| 456 | 706 | return m_impl->excludeSpaceLoadInstances(); | |
| 457 | } | ||
| 458 | |||
| 459 | 68 | void ForwardTranslatorOptions::setExcludeSpaceLoadInstances(bool excludeSpaceLoadInstances) { | |
| 460 | 68 | m_impl->setExcludeSpaceLoadInstances(excludeSpaceLoadInstances); | |
| 461 | 68 | } | |
| 462 | |||
| 463 | 1 | void ForwardTranslatorOptions::resetExcludeSpaceLoadInstances() { | |
| 464 | 1 | m_impl->resetExcludeSpaceLoadInstances(); | |
| 465 | 1 | } | |
| 466 | |||
| 467 | 1 | void ForwardTranslatorOptions::overrideValuesWith(const ForwardTranslatorOptions& other) { | |
| 468 | 1 | m_impl->overrideValuesWith(other); | |
| 469 | 1 | } | |
| 470 | |||
| 471 | ✗ | std::ostream& operator<<(std::ostream& os, const ForwardTranslatorOptions& forwardTranslatorOptions) { | |
| 472 | ✗ | os << forwardTranslatorOptions.string(); | |
| 473 | ✗ | return os; | |
| 474 | } | ||
| 475 | |||
| 476 | ✗ | std::vector<ForwardTranslatorOptionKeyMethod> ForwardTranslatorOptions::forwardTranslatorOptionKeyMethods() { | |
| 477 | return std::vector<ForwardTranslatorOptionKeyMethod>{{{"runcontrolspecialdays", "setKeepRunControlSpecialDays"}, | ||
| 478 | {"ip_tabular_output", "setIPTabularOutput"}, | ||
| 479 | {"no_lifecyclecosts", "setExcludeLCCObjects"}, | ||
| 480 | {"no_sqlite_output", "setExcludeSQliteOutputReport"}, | ||
| 481 | {"no_html_output", "setExcludeHTMLOutputReport"}, | ||
| 482 | {"no_variable_dictionary", "setExcludeVariableDictionary"}, | ||
| 483 | {"no_space_translation", "setExcludeSpaceTranslation"}, | ||
| 484 | ✗ | {"no_space_load_instances", "setExcludeSpaceLoadInstances"}}}; | |
| 485 | ✗ | } | |
| 486 | |||
| 487 | ✗ | std::ostream& operator<<(std::ostream& out, const ForwardTranslatorOptionKeyMethod& opt) { | |
| 488 | ✗ | out << "(" << opt.json_name << ", " << opt.ft_method_name << ")"; | |
| 489 | ✗ | return out; | |
| 490 | } | ||
| 491 | |||
| 492 | } // namespace openstudio | ||
| 493 |