| 419 | } |
| 420 | |
| 421 | std::string OutputMeter::getName(const boost::optional<std::string>& specificEndUseType, const boost::optional<EndUseType>& endUseType, |
| 422 | const boost::optional<FuelType>& fuelType, const boost::optional<InstallLocationType>& installLocationType, |
| 423 | const boost::optional<std::string>& specificInstallLocation) { |
| 424 | std::string result; |
| 425 | |
| 426 | if (specificEndUseType && !specificEndUseType->empty()) { |
| 427 | result += *specificEndUseType; |
| 428 | } |
| 429 | if (endUseType) { |
| 430 | if (!result.empty()) { |
| 431 | result += ":"; |
| 432 | } |
| 433 | result += endUseType->valueName(); |
| 434 | } |
| 435 | if (fuelType) { |
| 436 | if (!result.empty()) { |
| 437 | result += ":"; |
| 438 | } |
| 439 | result += |
| 440 | fuelType->valueDescription(); // same as valueName for all, except for FuelType::Gas where it returns "NaturalGas" which is what we want |
| 441 | } |
| 442 | if (installLocationType) { |
| 443 | // there is a weird corner case to handle 'InteriorLights:Electricity:Facility' -> 'InteriorLights:Electricity' |
| 444 | // this might not catch all cases |
| 445 | if (installLocationType.get() != InstallLocationType::Facility || !endUseType) { |
| 446 | if (!result.empty()) { |
| 447 | result += ":"; |
| 448 | } |
| 449 | result += installLocationType->valueName(); |
| 450 | } |
| 451 | } |
| 452 | if (specificInstallLocation && !specificInstallLocation->empty()) { |
| 453 | if (!result.empty()) { |
| 454 | result += ":"; |
| 455 | } |
| 456 | result += *specificInstallLocation; |
| 457 | } |
| 458 | LOG(Debug, "getName result = '" << result << "'"); |
| 459 | return result; |
| 460 | } |
| 461 | |
| 462 | std::string OutputMeter::name() const { |
| 463 | return getImpl<detail::OutputMeter_Impl>()->name(); |