diff --git a/main.cpp b/main.cpp index 5d7c804..f0dcf72 100644 --- a/main.cpp +++ b/main.cpp @@ -155,7 +155,7 @@ int main(int argc, char *argv[]) signal(SIGTERM, cleanup); signal(SIGKILL, cleanup); #endif - w = new servermain(logFilename, settingsFile); + w = new servermain(settingsFile, logFilename); #else a.setWheelScrollLines(1); // one line per wheel click wfmain w(settingsFile, logFilename, debugMode); diff --git a/servermain.cpp b/servermain.cpp index 3257bfa..791d8fd 100644 --- a/servermain.cpp +++ b/servermain.cpp @@ -87,7 +87,7 @@ void servermain::openRig() { //qInfo(logSystem()) << "Got rig"; QMetaObject::invokeMethod(radio->rig, [=]() { - radio->rig->commSetup(radio->civAddr, radio->serialPort, radio->baudRate, QString("none"),prefs.tcpPort,radio->waterfallFormat); + radio->rig->commSetup(radio->civAddr, radio->serialPort, radio->baudRate, QString("none"),0 ,radio->waterfallFormat); }, Qt::QueuedConnection); } } @@ -485,7 +485,7 @@ void servermain::loadSettings() numRadios = settings->beginReadArray("Radios"); int tempNum = numRadios; - + for (int i = 0; i < numRadios; i++) { settings->setArrayIndex(i); RIGCONFIG* tempPrefs = new RIGCONFIG(); @@ -500,23 +500,16 @@ void servermain::loadSettings() tempPrefs->rxAudioSetup.type = prefs.audioSystem; tempPrefs->txAudioSetup.type = prefs.audioSystem; - QString tempPort = "auto"; - if (tempPrefs->rigName=="") - { + if (tempPrefs->serialPort == "auto") { foreach(const QSerialPortInfo & serialPortInfo, QSerialPortInfo::availablePorts()) { qDebug(logSystem()) << "Serial Port found: " << serialPortInfo.portName() << "Manufacturer:" << serialPortInfo.manufacturer() << "Product ID" << serialPortInfo.description() << "S/N" << serialPortInfo.serialNumber(); - if ((serialPortInfo.portName() == tempPrefs->serialPort || tempPrefs->serialPort == "auto") && !serialPortInfo.serialNumber().isEmpty()) - { - if (serialPortInfo.serialNumber().startsWith("IC-")) { - tempPrefs->rigName = serialPortInfo.serialNumber(); - tempPort = serialPortInfo.portName(); - } + if (serialPortInfo.serialNumber().startsWith("IC-") && tempPrefs->serialPort == "auto") { + tempPrefs->rigName = serialPortInfo.serialNumber(); + tempPrefs->serialPort = serialPortInfo.portName(); } } } - tempPrefs->serialPort = tempPort; - QString guid = settings->value("GUID", "").toString(); if (guid.isEmpty()) { guid = QUuid::createUuid().toString();