MCPcopy Create free account
hub / github.com/analogdevicesinc/scopy / removeDeviceById

Method removeDeviceById

core/src/devicemanager.cpp:109–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109void DeviceManager::removeDeviceById(QString id)
110{
111 Device *d = nullptr;
112
113 if(connectedDev.contains(id)) {
114 getDevice(id)->disconnectDev();
115 }
116
117 if(!map.contains(id)) {
118 qWarning(CAT_DEVICEMANAGER) << id << "Device does not exist";
119 return;
120 }
121 d = map.take(id);
122 Q_EMIT deviceRemoveStarted(id, d);
123
124 disconnectDeviceFromManager(dynamic_cast<DeviceImpl *>(d));
125 d->unloadPlugins();
126 delete(d);
127
128 qInfo(CAT_DEVICEMANAGER) << "device" << id << "removed";
129
130 Q_EMIT deviceRemoved(id);
131}
132
133QString DeviceManager::reloadDevice(QString id, QStringList plugins)
134{

Callers

nothing calls this directly

Calls 3

disconnectDevMethod · 0.80
unloadPluginsMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected