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

Method disconnectDev

core/src/deviceimpl.cpp:504–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502}
503
504void DeviceImpl::disconnectDev()
505{
506 DebugTimer pluginDisconnBm;
507 DebugTimer disconnectDevBm;
508 m_state = DEV_DISCONNECTING;
509 Q_EMIT disconnecting();
510
511 if(m_connectionLostWidget) {
512 m_connectionLostWidget->hide();
513 delete m_connectionLostWidget;
514 m_connectionLostWidget = nullptr;
515 }
516
517 unbindPing();
518 connbtn->show();
519 discbtn->hide();
520 Preferences *pref = Preferences::GetInstance();
521 for(auto &&p : m_connectedPlugins) {
522 if(pref->get("general_save_session").toBool()) {
523 QSettings s = QSettings(scopy::config::settingsFolderPath() + "/" + p->name() + ".ini",
524 QSettings::IniFormat);
525 p->saveSettings(s);
526 }
527 pluginDisconnBm.startTimer();
528 p->onDisconnect();
529 DEBUGTIMER_LOG(pluginDisconnBm, p->name() + " disconnection took:");
530 }
531 m_connectedPlugins.clear();
532 connbtn->setFocus();
533 m_state = DEV_IDLE;
534 DEBUGTIMER_LOG(disconnectDevBm, this->displayName() + " device disconnection took:");
535 Q_EMIT disconnected();
536}
537
538DeviceImpl::~DeviceImpl() { qDebug(CAT_DEVICEIMPL) << m_id << "dtor"; }
539

Callers 4

disconnectDeviceMethod · 0.80
removeDeviceByIdMethod · 0.80
disconnectAllMethod · 0.80
connectingDeviceMethod · 0.80

Calls 9

displayNameMethod · 0.95
QSettingsClass · 0.85
showMethod · 0.45
getMethod · 0.45
nameMethod · 0.45
saveSettingsMethod · 0.45
startTimerMethod · 0.45
onDisconnectMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected