| 74 | } |
| 75 | |
| 76 | std::vector<openstudio::IdfObject> OutputMeter_Impl::remove() { |
| 77 | //Note: Cant do /object-list implementation for EMS Sensor since Auto Naming of Objects causes issues. |
| 78 | // Instead, doing an /alpha getString implementation so we need to manually remove any referring Sensors |
| 79 | const Model m = this->model(); |
| 80 | |
| 81 | std::vector<EnergyManagementSystemSensor> objects = m.getConcreteModelObjects<EnergyManagementSystemSensor>(); |
| 82 | for (auto& sensor : objects) { |
| 83 | if (sensor.outputMeter()) { |
| 84 | if (sensor.outputMeter().get().name() == this->name()) { |
| 85 | sensor.remove(); |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | return ModelObject_Impl::remove(); |
| 90 | } |
| 91 | |
| 92 | std::string OutputMeter_Impl::name() const { |
| 93 | boost::optional<std::string> value = getString(OS_Output_MeterFields::Name, true); |
nothing calls this directly
no test coverage detected