MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / remove

Method remove

src/model/OutputMeter.cpp:76–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 4

nameMethod · 0.95
outputMeterMethod · 0.80
modelMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected