MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / automationConnectLocalSerial

Method automationConnectLocalSerial

src/gui/ConnectionPanel.cpp:766–791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

764}
765
766bool ConnectionPanel::automationConnectLocalSerial(const QString& serial, QString* error)
767{
768 const QString wanted = serial.trimmed();
769 if (wanted.isEmpty()) {
770 setAutomationError(error, QStringLiteral("local serial selector is empty"));
771 return false;
772 }
773 if (m_connected) {
774 setAutomationError(error, QStringLiteral("already connected to a radio"));
775 return false;
776 }
777
778 for (int i = 0; i < m_radios.size(); ++i) {
779 if (m_radios[i].serial.compare(wanted, Qt::CaseInsensitive) == 0) {
780 setCurrentMode(LocalMode);
781 m_radioList->setCurrentRow(i);
782 onLocalConnectClicked();
783 return true;
784 }
785 }
786
787 setAutomationError(
788 error,
789 QStringLiteral("no discovered local radio has serial '%1'").arg(wanted));
790 return false;
791}
792
793bool ConnectionPanel::automationConnectByIp(const QString& hostOrIp, QString* error)
794{

Callers 1

doConnectMethod · 0.80

Calls 3

setAutomationErrorFunction · 0.85
isEmptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected