src/energyplus/ReverseTranslator/ReverseTranslateFuelFactors.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 "../ReverseTranslator.hpp" | ||
| 7 | |||
| 8 | #include "../../model/FuelFactors.hpp" | ||
| 9 | |||
| 10 | #include "../../model/Schedule.hpp" | ||
| 11 | #include "../../model/Schedule_Impl.hpp" | ||
| 12 | |||
| 13 | #include <utilities/idd/FuelFactors_FieldEnums.hxx> | ||
| 14 | #include <utilities/idd/IddEnums.hxx> | ||
| 15 | |||
| 16 | using namespace openstudio::model; | ||
| 17 | |||
| 18 | namespace openstudio { | ||
| 19 | |||
| 20 | namespace energyplus { | ||
| 21 | |||
| 22 | 9 | boost::optional<ModelObject> ReverseTranslator::translateFuelFactors(const WorkspaceObject& workspaceObject) { | |
| 23 | 9 | boost::optional<WorkspaceObject> _wo; | |
| 24 | 9 | boost::optional<ModelObject> _mo; | |
| 25 | |||
| 26 | // Existing Fuel Resource Name: Optional String | ||
| 27 | 9 | std::string resourceName; | |
| 28 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<std::string> _existingFuelResourceName = workspaceObject.getString(FuelFactorsFields::ExistingFuelResourceName)) { |
| 29 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | resourceName = _existingFuelResourceName.get(); |
| 30 | } else { | ||
| 31 | ✗ | return boost::none; | |
| 32 | 9 | } | |
| 33 | |||
| 34 |
1/1✓ Branch 1 taken 9 times.
|
9 | openstudio::model::FuelFactors modelObject(m_model); |
| 35 |
1/1✓ Branch 1 taken 9 times.
|
9 | modelObject.setExistingFuelResourceName(resourceName); |
| 36 | |||
| 37 | // Source Energy Factor: Optional Double | ||
| 38 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _sourceEnergyFactor = workspaceObject.getDouble(FuelFactorsFields::SourceEnergyFactor)) { |
| 39 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setSourceEnergyFactor(_sourceEnergyFactor.get()); |
| 40 | } | ||
| 41 | |||
| 42 | // Source Energy Schedule Name: Optional Object | ||
| 43 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::SourceEnergyScheduleName))) { |
| 44 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 45 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _sourceEnergySchedule = _mo->optionalCast<Schedule>()) { |
| 46 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setSourceEnergySchedule(_sourceEnergySchedule.get()); |
| 47 | } else { | ||
| 48 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'Source Energy Schedule Name'"); | |
| 49 | 1 | } | |
| 50 | } | ||
| 51 | } | ||
| 52 | // CO2 Emission Factor: Optional Double | ||
| 53 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _cO2EmissionFactor = workspaceObject.getDouble(FuelFactorsFields::CO2EmissionFactor)) { |
| 54 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setCO2EmissionFactor(_cO2EmissionFactor.get()); |
| 55 | } | ||
| 56 | |||
| 57 | // CO2 Emission Factor Schedule Name: Optional Object | ||
| 58 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::CO2EmissionFactorScheduleName))) { |
| 59 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 60 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _cO2EmissionFactorSchedule = _mo->optionalCast<Schedule>()) { |
| 61 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setCO2EmissionFactorSchedule(_cO2EmissionFactorSchedule.get()); |
| 62 | } else { | ||
| 63 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'CO2 Emission Factor Schedule Name'"); | |
| 64 | 1 | } | |
| 65 | } | ||
| 66 | } | ||
| 67 | // CO Emission Factor: Optional Double | ||
| 68 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _cOEmissionFactor = workspaceObject.getDouble(FuelFactorsFields::COEmissionFactor)) { |
| 69 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setCOEmissionFactor(_cOEmissionFactor.get()); |
| 70 | } | ||
| 71 | |||
| 72 | // CO Emission Factor Schedule Name: Optional Object | ||
| 73 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::COEmissionFactorScheduleName))) { |
| 74 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 75 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _cOEmissionFactorSchedule = _mo->optionalCast<Schedule>()) { |
| 76 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setCOEmissionFactorSchedule(_cOEmissionFactorSchedule.get()); |
| 77 | } else { | ||
| 78 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'CO Emission Factor Schedule Name'"); | |
| 79 | 1 | } | |
| 80 | } | ||
| 81 | } | ||
| 82 | // CH4 Emission Factor: Optional Double | ||
| 83 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _cH4EmissionFactor = workspaceObject.getDouble(FuelFactorsFields::CH4EmissionFactor)) { |
| 84 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setCH4EmissionFactor(_cH4EmissionFactor.get()); |
| 85 | } | ||
| 86 | |||
| 87 | // CH4 Emission Factor Schedule Name: Optional Object | ||
| 88 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::CH4EmissionFactorScheduleName))) { |
| 89 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 90 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _cH4EmissionFactorSchedule = _mo->optionalCast<Schedule>()) { |
| 91 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setCH4EmissionFactorSchedule(_cH4EmissionFactorSchedule.get()); |
| 92 | } else { | ||
| 93 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'CH4 Emission Factor Schedule Name'"); | |
| 94 | 1 | } | |
| 95 | } | ||
| 96 | } | ||
| 97 | // NOx Emission Factor: Optional Double | ||
| 98 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _nOxEmissionFactor = workspaceObject.getDouble(FuelFactorsFields::NOxEmissionFactor)) { |
| 99 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setNOxEmissionFactor(_nOxEmissionFactor.get()); |
| 100 | } | ||
| 101 | |||
| 102 | // NOx Emission Factor Schedule Name: Optional Object | ||
| 103 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::NOxEmissionFactorScheduleName))) { |
| 104 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 105 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _nOxEmissionFactorSchedule = _mo->optionalCast<Schedule>()) { |
| 106 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setNOxEmissionFactorSchedule(_nOxEmissionFactorSchedule.get()); |
| 107 | } else { | ||
| 108 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'NOx Emission Factor Schedule Name'"); | |
| 109 | 1 | } | |
| 110 | } | ||
| 111 | } | ||
| 112 | // N2O Emission Factor: Optional Double | ||
| 113 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _n2OEmissionFactor = workspaceObject.getDouble(FuelFactorsFields::N2OEmissionFactor)) { |
| 114 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setN2OEmissionFactor(_n2OEmissionFactor.get()); |
| 115 | } | ||
| 116 | |||
| 117 | // N2O Emission Factor Schedule Name: Optional Object | ||
| 118 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::N2OEmissionFactorScheduleName))) { |
| 119 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 120 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _n2OEmissionFactorSchedule = _mo->optionalCast<Schedule>()) { |
| 121 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setN2OEmissionFactorSchedule(_n2OEmissionFactorSchedule.get()); |
| 122 | } else { | ||
| 123 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'N2O Emission Factor Schedule Name'"); | |
| 124 | 1 | } | |
| 125 | } | ||
| 126 | } | ||
| 127 | // SO2 Emission Factor: Optional Double | ||
| 128 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _sO2EmissionFactor = workspaceObject.getDouble(FuelFactorsFields::SO2EmissionFactor)) { |
| 129 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setSO2EmissionFactor(_sO2EmissionFactor.get()); |
| 130 | } | ||
| 131 | |||
| 132 | // SO2 Emission Factor Schedule Name: Optional Object | ||
| 133 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::SO2EmissionFactorScheduleName))) { |
| 134 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 135 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _sO2EmissionFactorSchedule = _mo->optionalCast<Schedule>()) { |
| 136 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setSO2EmissionFactorSchedule(_sO2EmissionFactorSchedule.get()); |
| 137 | } else { | ||
| 138 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'SO2 Emission Factor Schedule Name'"); | |
| 139 | 1 | } | |
| 140 | } | ||
| 141 | } | ||
| 142 | // PM Emission Factor: Optional Double | ||
| 143 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _pMEmissionFactor = workspaceObject.getDouble(FuelFactorsFields::PMEmissionFactor)) { |
| 144 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setPMEmissionFactor(_pMEmissionFactor.get()); |
| 145 | } | ||
| 146 | |||
| 147 | // PM Emission Factor Schedule Name: Optional Object | ||
| 148 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::PMEmissionFactorScheduleName))) { |
| 149 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 150 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _pMEmissionFactorSchedule = _mo->optionalCast<Schedule>()) { |
| 151 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setPMEmissionFactorSchedule(_pMEmissionFactorSchedule.get()); |
| 152 | } else { | ||
| 153 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'PM Emission Factor Schedule Name'"); | |
| 154 | 1 | } | |
| 155 | } | ||
| 156 | } | ||
| 157 | // PM10 Emission Factor: Optional Double | ||
| 158 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _pM10EmissionFactor = workspaceObject.getDouble(FuelFactorsFields::PM10EmissionFactor)) { |
| 159 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setPM10EmissionFactor(_pM10EmissionFactor.get()); |
| 160 | } | ||
| 161 | |||
| 162 | // PM10 Emission Factor Schedule Name: Optional Object | ||
| 163 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::PM10EmissionFactorScheduleName))) { |
| 164 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 165 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _pM10EmissionFactorSchedule = _mo->optionalCast<Schedule>()) { |
| 166 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setPM10EmissionFactorSchedule(_pM10EmissionFactorSchedule.get()); |
| 167 | } else { | ||
| 168 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'PM10 Emission Factor Schedule Name'"); | |
| 169 | 1 | } | |
| 170 | } | ||
| 171 | } | ||
| 172 | // PM2.5 Emission Factor: Optional Double | ||
| 173 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _pM25EmissionFactor = workspaceObject.getDouble(FuelFactorsFields::PM25EmissionFactor)) { |
| 174 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setPM25EmissionFactor(_pM25EmissionFactor.get()); |
| 175 | } | ||
| 176 | |||
| 177 | // PM2.5 Emission Factor Schedule Name: Optional Object | ||
| 178 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::PM25EmissionFactorScheduleName))) { |
| 179 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 180 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _pM25EmissionFactorSchedule = _mo->optionalCast<Schedule>()) { |
| 181 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setPM25EmissionFactorSchedule(_pM25EmissionFactorSchedule.get()); |
| 182 | } else { | ||
| 183 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'PM2.5 Emission Factor Schedule Name'"); | |
| 184 | 1 | } | |
| 185 | } | ||
| 186 | } | ||
| 187 | // NH3 Emission Factor: Optional Double | ||
| 188 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _nH3EmissionFactor = workspaceObject.getDouble(FuelFactorsFields::NH3EmissionFactor)) { |
| 189 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setNH3EmissionFactor(_nH3EmissionFactor.get()); |
| 190 | } | ||
| 191 | |||
| 192 | // NH3 Emission Factor Schedule Name: Optional Object | ||
| 193 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::NH3EmissionFactorScheduleName))) { |
| 194 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 195 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _nH3EmissionFactorSchedule = _mo->optionalCast<Schedule>()) { |
| 196 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setNH3EmissionFactorSchedule(_nH3EmissionFactorSchedule.get()); |
| 197 | } else { | ||
| 198 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'NH3 Emission Factor Schedule Name'"); | |
| 199 | 1 | } | |
| 200 | } | ||
| 201 | } | ||
| 202 | // NMVOC Emission Factor: Optional Double | ||
| 203 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _nMVOCEmissionFactor = workspaceObject.getDouble(FuelFactorsFields::NMVOCEmissionFactor)) { |
| 204 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setNMVOCEmissionFactor(_nMVOCEmissionFactor.get()); |
| 205 | } | ||
| 206 | |||
| 207 | // NMVOC Emission Factor Schedule Name: Optional Object | ||
| 208 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::NMVOCEmissionFactorScheduleName))) { |
| 209 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 210 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _nMVOCEmissionFactorSchedule = _mo->optionalCast<Schedule>()) { |
| 211 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setNMVOCEmissionFactorSchedule(_nMVOCEmissionFactorSchedule.get()); |
| 212 | } else { | ||
| 213 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'NMVOC Emission Factor Schedule Name'"); | |
| 214 | 1 | } | |
| 215 | } | ||
| 216 | } | ||
| 217 | // Hg Emission Factor: Optional Double | ||
| 218 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _hgEmissionFactor = workspaceObject.getDouble(FuelFactorsFields::HgEmissionFactor)) { |
| 219 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setHgEmissionFactor(_hgEmissionFactor.get()); |
| 220 | } | ||
| 221 | |||
| 222 | // Hg Emission Factor Schedule Name: Optional Object | ||
| 223 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::HgEmissionFactorScheduleName))) { |
| 224 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 225 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _hgEmissionFactorSchedule = _mo->optionalCast<Schedule>()) { |
| 226 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setHgEmissionFactorSchedule(_hgEmissionFactorSchedule.get()); |
| 227 | } else { | ||
| 228 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'Hg Emission Factor Schedule Name'"); | |
| 229 | 1 | } | |
| 230 | } | ||
| 231 | } | ||
| 232 | // Pb Emission Factor: Optional Double | ||
| 233 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _pbEmissionFactor = workspaceObject.getDouble(FuelFactorsFields::PbEmissionFactor)) { |
| 234 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setPbEmissionFactor(_pbEmissionFactor.get()); |
| 235 | } | ||
| 236 | |||
| 237 | // Pb Emission Factor Schedule Name: Optional Object | ||
| 238 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::PbEmissionFactorScheduleName))) { |
| 239 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 240 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _pbEmissionFactorSchedule = _mo->optionalCast<Schedule>()) { |
| 241 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setPbEmissionFactorSchedule(_pbEmissionFactorSchedule.get()); |
| 242 | } else { | ||
| 243 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'Pb Emission Factor Schedule Name'"); | |
| 244 | 1 | } | |
| 245 | } | ||
| 246 | } | ||
| 247 | // Water Emission Factor: Optional Double | ||
| 248 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _waterEmissionFactor = workspaceObject.getDouble(FuelFactorsFields::WaterEmissionFactor)) { |
| 249 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setWaterEmissionFactor(_waterEmissionFactor.get()); |
| 250 | } | ||
| 251 | |||
| 252 | // Water Emission Factor Schedule Name: Optional Object | ||
| 253 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::WaterEmissionFactorScheduleName))) { |
| 254 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 255 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _waterEmissionFactorSchedule = _mo->optionalCast<Schedule>()) { |
| 256 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setWaterEmissionFactorSchedule(_waterEmissionFactorSchedule.get()); |
| 257 | } else { | ||
| 258 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'Water Emission Factor Schedule Name'"); | |
| 259 | 1 | } | |
| 260 | } | ||
| 261 | } | ||
| 262 | // Nuclear High Level Emission Factor: Optional Double | ||
| 263 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _nuclearHighLevelEmissionFactor = workspaceObject.getDouble(FuelFactorsFields::NuclearHighLevelEmissionFactor)) { |
| 264 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setNuclearHighLevelEmissionFactor(_nuclearHighLevelEmissionFactor.get()); |
| 265 | } | ||
| 266 | |||
| 267 | // Nuclear High Level Emission Factor Schedule Name: Optional Object | ||
| 268 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::NuclearHighLevelEmissionFactorScheduleName))) { |
| 269 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 270 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _nuclearHighLevelEmissionFactorSchedule = _mo->optionalCast<Schedule>()) { |
| 271 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setNuclearHighLevelEmissionFactorSchedule(_nuclearHighLevelEmissionFactorSchedule.get()); |
| 272 | } else { | ||
| 273 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'Nuclear High Level Emission Factor Schedule Name'"); | |
| 274 | 1 | } | |
| 275 | } | ||
| 276 | } | ||
| 277 | // Nuclear Low Level Emission Factor: Optional Double | ||
| 278 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<double> _nuclearLowLevelEmissionFactor = workspaceObject.getDouble(FuelFactorsFields::NuclearLowLevelEmissionFactor)) { |
| 279 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | modelObject.setNuclearLowLevelEmissionFactor(_nuclearLowLevelEmissionFactor.get()); |
| 280 | } | ||
| 281 | |||
| 282 | // Nuclear Low Level Emission Factor Schedule Name: Optional Object | ||
| 283 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 8 times.
|
18 | if ((_wo = workspaceObject.getTarget(FuelFactorsFields::NuclearLowLevelEmissionFactorScheduleName))) { |
| 284 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((_mo = translateAndMapWorkspaceObject(_wo.get()))) { |
| 285 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Schedule> _nuclearLowLevelEmissionFactorSchedule = _mo->optionalCast<Schedule>()) { |
| 286 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | modelObject.setNuclearLowLevelEmissionFactorSchedule(_nuclearLowLevelEmissionFactorSchedule.get()); |
| 287 | } else { | ||
| 288 | ✗ | LOG(Warn, workspaceObject.briefDescription() << " has a wrong type for 'Nuclear Low Level Emission Factor Schedule Name'"); | |
| 289 | 1 | } | |
| 290 | } | ||
| 291 | } | ||
| 292 | |||
| 293 |
1/1✓ Branch 1 taken 9 times.
|
9 | return modelObject; |
| 294 | 9 | } // End of translate function | |
| 295 | |||
| 296 | } // end namespace energyplus | ||
| 297 | } // end namespace openstudio | ||
| 298 |