From ad73a3e9d28df3eeeb6d5176ffa13c044e9118ba Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Tue, 8 Jun 2021 09:58:30 -0700 Subject: [PATCH 01/43] Adjustable waterfall length is now non-destructive. --- wfmain.cpp | 18 +++++++++++------- wfmain.h | 1 + 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index a20bf11..df8ab9a 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -1494,6 +1494,8 @@ void wfmain::prepareWf(unsigned int wfLength) spectrumDrawLock = true; spectWidth = rigCaps.spectLenMax; + wfLengthMax = 1024; + this->wfLength = wfLength; // fixed for now, time-length of waterfall // Initialize before use! @@ -1501,17 +1503,21 @@ void wfmain::prepareWf(unsigned int wfLength) QByteArray empty((int)spectWidth, '\x01'); spectrumPeaks = QByteArray( (int)spectWidth, '\x01' ); - if((unsigned int)wfimage.size() < wfLength) + //wfimage.resize(wfLengthMax); + + if((unsigned int)wfimage.size() < wfLengthMax) { unsigned int i=0; unsigned int oldSize = wfimage.size(); - for(i=oldSize; i<(wfLength); i++) + for(i=oldSize; i<(wfLengthMax); i++) { wfimage.append(empty); } } else { - wfimage.remove(wfLength, wfimage.size()-wfLength); + // Keep wfimage, do not trim, no performance impact. + //wfimage.remove(wfLength, wfimage.size()-wfLength); } + wfimage.squeeze(); //colorMap->clearData(); colorMap->data()->clear(); @@ -2675,10 +2681,8 @@ void wfmain::receiveSpectrumData(QByteArray spectrum, double startFreq, double e if(specLen == spectWidth) { wfimage.prepend(spectrum); - if(wfimage.length() > wfLength) - { - wfimage.remove(wfLength); - } + wfimage.resize(wfLengthMax); + wfimage.squeeze(); // Waterfall: for(int row = 0; row < wfLength; row++) diff --git a/wfmain.h b/wfmain.h index a5a1db8..9439ba7 100644 --- a/wfmain.h +++ b/wfmain.h @@ -557,6 +557,7 @@ private: int smeterPos=0; QVector wfimage; + unsigned int wfLengthMax; bool onFullscreen; bool drawPeaks; From 9664238917c3bb64a2f4de43fa1bc141b42dce4b Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Tue, 8 Jun 2021 14:42:19 -0700 Subject: [PATCH 02/43] Preliminary IC-718 support. Very basic. --- rigcommander.cpp | 19 +++++++++++++++++++ rigidentities.h | 1 + 2 files changed, 20 insertions(+) diff --git a/rigcommander.cpp b/rigcommander.cpp index c201393..2fd19c9 100644 --- a/rigcommander.cpp +++ b/rigcommander.cpp @@ -2947,6 +2947,25 @@ void rigCommander::determineRigCaps() rigCaps.modes = commonModes; rigCaps.modes.insert(rigCaps.modes.end(), createMode(modeWFM, 0x06, "WFM")); break; + case model718: + rigCaps.modelName = QString("IC-718"); + rigCaps.hasSpectrum = false; + rigCaps.inputs.clear(); + rigCaps.hasLan = false; + rigCaps.hasEthernet = false; + rigCaps.hasWiFi = false; + rigCaps.hasATU = false; + rigCaps.attenuators.push_back('\x20'); + rigCaps.preamps.push_back('\x01'); + rigCaps.bands = {band10m, band10m, band12m, + band15m, band17m, band20m, band30m, + band40m, band60m, band80m, band160m, bandGen}; + rigCaps.modes = { createMode(modeLSB, 0x00, "LSB"), createMode(modeUSB, 0x01, "USB"), + createMode(modeAM, 0x02, "AM"), + createMode(modeCW, 0x03, "CW"), createMode(modeCW_R, 0x07, "CW-R"), + createMode(modeRTTY, 0x04, "RTTY"), createMode(modeRTTY_R, 0x08, "RTTY-R") + }; + break; case model756pro: rigCaps.modelName = QString("IC-756 Pro"); rigCaps.hasSpectrum = false; diff --git a/rigidentities.h b/rigidentities.h index 9ad2630..5869136 100644 --- a/rigidentities.h +++ b/rigidentities.h @@ -28,6 +28,7 @@ enum model_kind { model9700 = 0xA2, model705 = 0xA4, model706 = 0x58, + model718 = 0x5E, model756pro = 0x5C, model756proii = 0x64, model756proiii = 0x6E, From 65744cc9347366a16e61b1bffb836545733c324a Mon Sep 17 00:00:00 2001 From: Roeland Jansen Date: Fri, 11 Jun 2021 19:28:53 +0200 Subject: [PATCH 03/43] changelog and added WHATSNEW --- CHANGELOG | 287 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ WHATSNEW | 10 ++ 2 files changed, 297 insertions(+) create mode 100644 WHATSNEW diff --git a/CHANGELOG b/CHANGELOG index 3b8d085..6ba44d8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,292 @@ # CHANGELOG + +- 20210611 + + Update udpserver.cpp + + Use global watchdog rather than per-connection + + Report when users are disconnected by the watchdog + + Use watchdog to cleanup lost server connections + + Fix crash on disconnect + + Make status update after disconnection + + More server disconnection cleanup + + Improve server disconnection/cleanup + +- 20210610 + + remove spaces when adding extra server users + + Update udpserver.cpp + + Allow both encoded and plain text passwords + + Lots of fixes to server setup table + + Hopefully fix the occasional 0xe1 packet from hitting the pty + + Add more info for server connections + + Make sure that user is authenticated before allowing CIV/Audio + + Use correct location for statusupdate! + + Indicate when TX is not available + + Show server connection status in taskbar (only for USB connected rigs) + +- 20210609 + + Allow sender or receiver to be 0xe1 in server + + Always forward wfview traffic to wfview clients + +- 20210608 + + Truncate wfview.log on open + + Detect radio baudrate in server mode + + Comment out rtaudio if not being used + + Baud rate calculations are now only happening when baud rate is received + and reasonable. + +- 20210607 + + Check that we have at least 1 audio channel available. + + Improve audio cleanup + + Add extra debugging for UDP server CIV + + Make only MacOS use buffered audio + + Improve mac audio + +- 20210606 + + Fix TX Audio on Linux + + Various fixes to udpserver + + Make QTMultimedia default + + Fix to allow rtaudio to compile again + +- 20210605 + + Add latency check to TX audio + + Fix incorrect use of latency setting + +- 20210604 + + Stop silly compile warning + + Change udpserver to use new audiosetup struct properly. + + Fix audio device selection + + Fix for txaudio + + Add QtMultimedia as default audio + +- 20210603 + + Hopefully fix hang on exit when trying to close audio thread. + +- 20210602 + + Use heap based rtaudio for enumeration + + Catch possible exception when closing non-existent stream + + Fix mac audio + + Fix mac crash on closing audio + + Make sure audio is deleted in destructor + + Force specific rtaudio API depending on platform. + + Linux now uses librtuadio-dev where available + + Removing local rtaudio code and using library instead. + + revert to ALSA for now + + Tell rtaudio not to hog device + + Update audiohandler.cpp + + Select chunksize based on native sample rate + + Force 48K sample rate when 44100 is detected. + + change linux compiler directive to allow new-aligned + + Tidy up server mutexes + + Fix server high CPU on disconnect + +- 20210601 + + Stop deleting audio after last client disconects + + Change udpserver packet handling to be similar to udphandler + + Update udpserver.cpp + + Let buffer keep filling. + + Change to 10ms poll time for server rx audio + + Mutex work in udpserver + + Fix for crash when remote requests tone. + +- 20210531 + + IC-7700 support + + Open pty non-blocking + + Fix for crashing pty on mac + + Fix compile issue after merge + +- 20210530 + + Keep the theme during resize. TODO: preference for wf theme + + Removing my own uninformed sidenote. + + Waterfal length may now be adjusted. Let's see what range of length + seems good and limit the control accordingly. Also there may be a memory + leak in the prepareWf() function where the colormap is created when the + image is resized. + + CIV may now be changed as-needed while running. + + Remove various compiler warnings and tidy up. + + add silence if audio has stopped + +- 20210529 + + fix for mac/linux compiler + + Detect number of device channels and convert accordingly + + Lots more changes for rtaudio compatibility + + Small change to show default audio devices + +- 20210528 + + More chair movements. + + More arranging of the chairs. Also fixed a minor bug that prevented the + "Manual" serial device entry on my system. + + Cleaning up the main constructor for wfmain. + + Add some startup logging + + Update audiohandler.cpp + + Update udphandler.cpp + + Change toolbar display formatting + + Use preferred sample rate rather than force 48000 + +- 20210527 + + Allow higher latency + + udpserver fixes + + Update udpserver.cpp + + Fix for tx audio channels + + Add tx audio + + add asound lib to linux build + + fix qmake file + + Use ring buffer with rtaudio to eliminate mutexes + +- 20210525 + + Update INSTALL_PREBUILT_BINARY.md + + move ulaw to dedicated header + + add rtaudio as submodule + + add opus-tools as submodule + + Add mutex for audio buffer + +- 20210523 + + Fixes for linux build + + First working rtaudio (output only) + + Link can now be clicked. + + Added helpful text to settings tab. + + Allow entry to Server Setup for either radio connection type. + + Minor change to clarify roll of Server Setup + +- 20210522 + + Add debugging and fix silly error in audiooutput combobox + + reenable audio buffers + + Attempt to fix crash + + Make only first client have TX audio + + Stop audiohandler re-enumerating devices on connect. + + Stop preamps/attenuators lists growing every time we reconnect. + + Try increasing audio device buffer size + +- 20210521 + + Changed method for adding modes to rigs and populating the rig menu. + This should be easier to maintain and better in the long run. + + "Hopefully" fix annoying UDP server crash on client disconnect! + + Fix for TX audio in udp server + + Fix for stuttering audio on mac + + Fixed missing break in switchs. + + Typo in message about CI-V + + Dynamic timing update for all baud rates and connection types. + + Fixed support for 9600 baud and lower speeds. + - 20210521 Add baud rate detection for remote rigs diff --git a/WHATSNEW b/WHATSNEW new file mode 100644 index 0000000..b09dff6 --- /dev/null +++ b/WHATSNEW @@ -0,0 +1,10 @@ + +The following highlights are in this dot-release: + + added IC7700 + fixes and improvements to audio + ability to choose between rtaudio and qtmultimedia (default) as compile time option + fixes and lots of improvements at the usb-server end + waterfall length can be adjusted now + no need to restart to change CIV address + From 561a1d951be4dabfa3de01e77f0ee229475500a4 Mon Sep 17 00:00:00 2001 From: Roeland Jansen Date: Fri, 11 Jun 2021 19:37:52 +0200 Subject: [PATCH 04/43] adding a second path/way for the qcustomplot link if the first fails --- INSTALL_PREBUILT_BINARY.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/INSTALL_PREBUILT_BINARY.md b/INSTALL_PREBUILT_BINARY.md index c8ecdff..2dc2791 100644 --- a/INSTALL_PREBUILT_BINARY.md +++ b/INSTALL_PREBUILT_BINARY.md @@ -21,11 +21,11 @@ redhat7 -- no qt support Debian 11 (Debian 10 is outdated) Fedora 33 Fedora 34 -mint 20.1 +mint 20.1 (and up?) openSUSE 15.x openSUSE Tumbleweed SLES 15.x -Ubuntu 20.04.2 +Ubuntu 20.04.2 and up (?) ~~~ @@ -63,6 +63,10 @@ wfview sudo apt install libqcustomplot2.0 libqt5multimedia5 libqt5serialport5 sudo ln -s /usr/lib64/libqcustomplot-qt5.so.2 /usr/lib64/libqcustomplot.so.2 wfview + +note: if the above symlink fails, use the following line to fix the library link: + +sudo ln -s /lib/x86_64-linux-gnu/libqcustomplot.so.2.0.1 /lib/x86_64-linux-gnu/libqcustomplot.so.2 ~~~ ### openSUSE/Tumbleweed/SLES: @@ -76,6 +80,11 @@ wfview sudo apt install libqcustomplot2.0 libqt5multimedia5 libqt5serialport5 sudo ln -s /usr/lib/x86_64-linux-gnu/libqcustomplot.so.2.0.1 /usr/lib/x86_64-linux-gnu/libqcustomplot.so.2 wfview + + +note: if the above symlink fails, use the following line to fix the library link: + +sudo ln -s /lib/x86_64-linux-gnu/libqcustomplot.so.2.0.1 /lib/x86_64-linux-gnu/libqcustomplot.so.2 ~~~ From 297478ffca9f2847968985d9636a332c404664bb Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Mon, 14 Jun 2021 20:22:15 -0700 Subject: [PATCH 05/43] We now calculate polling rates immediately upon receiveCommReady for serial connections. For network connections, we assume sane values and modify once we receive the baud rate from the server. --- rigidentities.cpp | 3 +++ wfmain.cpp | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/rigidentities.cpp b/rigidentities.cpp index 15f62ac..c2322fd 100644 --- a/rigidentities.cpp +++ b/rigidentities.cpp @@ -52,6 +52,9 @@ model_kind determineRadioModel(unsigned char rigID) case model705: rig = model705; break; + case model718: + rig = model718; + break; case model756proiii: rig = model756proiii; break; diff --git a/wfmain.cpp b/wfmain.cpp index 1a3ccb1..f8fec6e 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -160,6 +160,7 @@ void wfmain::openRig() if (prefs.enableLAN) { ui->lanEnableBtn->setChecked(true); + usingLAN = true; // We need to setup the tx/rx audio: emit sendCommSetup(prefs.radioCIVAddr, udpPrefs, rxSetup, txSetup, prefs.virtualSerialPort); } else { @@ -176,10 +177,7 @@ void wfmain::openRig() serialPortRig = serialPortCL; } } - - // Here, the radioCIVAddr is being set from a default preference, which is for the 7300. - // However, we will not use it initially. OTOH, if it is set explicitedly to a value in the prefs, - // then we skip auto detection. + usingLAN = false; emit sendCommSetup(prefs.radioCIVAddr, serialPortRig, prefs.serialPortBaud,prefs.virtualSerialPort); } @@ -455,7 +453,13 @@ void wfmain::findSerialPort() void wfmain::receiveCommReady() { qInfo(logSystem()) << "Received CommReady!! "; - // taken from above: + if(!usingLAN) + { + // usingLAN gets set when we emit the sendCommSetup signal. + // If we're not using the LAN, then we're on serial, and + // we already know the baud rate and can calculate the timing parameters. + calculateTimingParameters(); + } if(prefs.radioCIVAddr == 0) { // tell rigCommander to broadcast a request for all rig IDs. @@ -484,7 +488,6 @@ void wfmain::receiveFoundRigID(rigCapabilities rigCaps) if(rig->usingLAN()) { usingLAN = true; - //delayedCommand->setInterval(delayedCmdIntervalLAN_ms); } else { usingLAN = false; } @@ -724,7 +727,7 @@ void wfmain::getSettingsFilePath(QString settingsFile) void wfmain::setInitialTiming() { - delayedCmdIntervalLAN_ms = 10; // interval for regular delayed commands, including initial rig/UI state queries + delayedCmdIntervalLAN_ms = 70; // interval for regular delayed commands, including initial rig/UI state queries delayedCmdIntervalSerial_ms = 100; // interval for regular delayed commands, including initial rig/UI state queries delayedCmdStartupInterval_ms = 250; // interval for rigID polling delayedCommand = new QTimer(this); @@ -4609,6 +4612,6 @@ void wfmain::on_wfLengthSlider_valueChanged(int value) void wfmain::on_debugBtn_clicked() { qInfo(logSystem()) << "Debug button pressed."; - prepareWf(160); + emit getTxPower(); } From 43d281cda71b9b608281f708c1340a106d7aa53d Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Mon, 14 Jun 2021 20:36:13 -0700 Subject: [PATCH 06/43] Added collision detection for serial commands. Collisions are aparently frequent for true 1-wire CI-V radios. --- commhandler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/commhandler.cpp b/commhandler.cpp index 5f83e14..735d0a4 100644 --- a/commhandler.cpp +++ b/commhandler.cpp @@ -117,6 +117,12 @@ void commHandler::receiveDataIn() return; } } + if(inPortData.contains("\xFC")) + { + //qInfo(logSerial()) << "Transaction contains collision data. Dumping."; + port->commitTransaction(); + return; + } if(inPortData.startsWith("\xFE\xFE")) { From 815591f07d4d9055c61065416e8f187160be0318 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Mon, 14 Jun 2021 20:55:28 -0700 Subject: [PATCH 07/43] Changed collision detection code so that we can more easily see what message was missed. --- commhandler.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/commhandler.cpp b/commhandler.cpp index 735d0a4..7a48d87 100644 --- a/commhandler.cpp +++ b/commhandler.cpp @@ -117,15 +117,17 @@ void commHandler::receiveDataIn() return; } } - if(inPortData.contains("\xFC")) - { - //qInfo(logSerial()) << "Transaction contains collision data. Dumping."; - port->commitTransaction(); - return; - } + if(inPortData.startsWith("\xFE\xFE")) { + if(inPortData.contains("\xFC")) + { + //qInfo(logSerial()) << "Transaction contains collision data. Dumping."; + //printHex(inPortData, false, true); + port->commitTransaction(); + return; + } if(inPortData.endsWith("\xFD")) { // good! From 2392bdd932a1faf8681bdc0fdad69fb217eb373b Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Tue, 15 Jun 2021 10:28:20 -0700 Subject: [PATCH 08/43] Additional data corruption checking. --- rigcommander.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/rigcommander.cpp b/rigcommander.cpp index 2fd19c9..18558b3 100644 --- a/rigcommander.cpp +++ b/rigcommander.cpp @@ -1090,6 +1090,12 @@ void rigCommander::parseData(QByteArray dataInput) // payload = getpayload(data); // or something // parse (payload); // recursive ok? payloadIn = data.right(data.length() - 4); + if(payloadIn.contains("\xFE")) + { + //qDebug(logRig()) << "Corrupted data contains FE within message body: "; + //printHex(payloadIn); + break; + } parseCommand(); break; case '\x00': @@ -1100,9 +1106,15 @@ void rigCommander::parseData(QByteArray dataInput) // This is an echo of our own broadcast request. // The data are "to 00" and "from E1" // Don't use it! - qDebug(logRig()) << "Caught it! Found the echo'd broadcast request from us!"; + qDebug(logRig()) << "Caught it! Found the echo'd broadcast request from us! Rig has not responded to broadcast query yet."; } else { - payloadIn = data.right(data.length() - 4); + payloadIn = data.right(data.length() - 4); // Removes FE FE E0 94 part + if(payloadIn.contains("\xFE")) + { + //qDebug(logRig()) << "Corrupted data contains FE within message body: "; + //printHex(payloadIn); + break; + } parseCommand(); } break; @@ -1320,9 +1332,9 @@ void rigCommander::parseLevels() break; default: - qInfo(logRig()) << "Unknown control level (0x14) received at register " << payloadIn[1] << " with level " << level; + qInfo(logRig()) << "Unknown control level (0x14) received at register " << QString("0x%1").arg((int)payloadIn[1],2,16) << " with level " << QString("0x%1").arg((int)level,2,16) << ", int=" << (int)level; + printHex(payloadIn); break; - } return; } From d3d59b2a94880c582c5532ac1cf4a143232bb37d Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Tue, 15 Jun 2021 11:27:45 -0700 Subject: [PATCH 09/43] Dynamic show/hide spectrum for rigs without this feature. --- wfmain.cpp | 43 +++++++++++++++++++++++++++++++++++++++++-- wfmain.h | 1 + wfmain.ui | 14 +++++++------- 3 files changed, 49 insertions(+), 9 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index f8fec6e..ccf89b5 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -1494,6 +1494,40 @@ void wfmain::saveSettings() } +void wfmain::showHideSpectrum(bool show) +{ + + if(show) + { + wf->show(); + plot->show(); + } else { + wf->hide(); + plot->hide(); + } + + // Controls: + ui->spectrumGroupBox->setVisible(show); + ui->spectrumModeCombo->setVisible(show); + ui->scopeBWCombo->setVisible(show); + ui->scopeEdgeCombo->setVisible(show); + ui->scopeEnableWFBtn->setVisible(show); + ui->scopeRefLevelSlider->setEnabled(show); + ui->wfLengthSlider->setEnabled(show); + ui->wfthemeCombo->setVisible(show); + ui->toFixedBtn->setVisible(show); + ui->clearPeakBtn->setVisible(show); + + // And the labels: + ui->specEdgeLabel->setVisible(show); + ui->specModeLabel->setVisible(show); + ui->specSpanLabel->setVisible(show); + ui->specThemeLabel->setVisible(show); + + ui->specControlsHorizLayout->setEnabled(show); + +} + void wfmain::prepareWf() { prepareWf(160); @@ -1505,6 +1539,11 @@ void wfmain::prepareWf(unsigned int wfLength) if(haveRigCaps) { + showHideSpectrum(rigCaps.hasSpectrum); + if(!rigCaps.hasSpectrum) + { + return; + } // TODO: Lock the function that draws on the spectrum while we are updating. spectrumDrawLock = true; @@ -4357,7 +4396,7 @@ void wfmain::calculateTimingParameters() msMinTiming = 35; delayedCommand->setInterval( msMinTiming * 2); // 20 byte message - periodicPollingTimer->setInterval( msMinTiming ); // slower for s-meter poll + periodicPollingTimer->setInterval( msMinTiming *5); // slower for s-meter poll qInfo(logSystem()) << "Delay command interval timing: " << msMinTiming * 2 << "ms"; qInfo(logSystem()) << "Periodic polling timer: " << msMinTiming << "ms"; @@ -4612,6 +4651,6 @@ void wfmain::on_wfLengthSlider_valueChanged(int value) void wfmain::on_debugBtn_clicked() { qInfo(logSystem()) << "Debug button pressed."; - emit getTxPower(); + emit getFrequency(); } diff --git a/wfmain.h b/wfmain.h index 9439ba7..0f4317e 100644 --- a/wfmain.h +++ b/wfmain.h @@ -462,6 +462,7 @@ private: void setPlotTheme(QCustomPlot *plot, bool isDark); void prepareWf(); void prepareWf(unsigned int wfLength); + void showHideSpectrum(bool show); void getInitialRigState(); void setBandButtons(); void showButton(QPushButton *btn); diff --git a/wfmain.ui b/wfmain.ui index d2a6ade..e9b4a27 100644 --- a/wfmain.ui +++ b/wfmain.ui @@ -26,7 +26,7 @@ - + Spectrum @@ -44,12 +44,12 @@ - + 0 - + Spectrum Mode: @@ -66,7 +66,7 @@ - + Span: @@ -86,7 +86,7 @@ - + Edge @@ -133,7 +133,7 @@ - + Theme: @@ -150,7 +150,7 @@ - + Qt::Horizontal From 542376124b542719f5a2e0a6a718d78596d9166a Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Tue, 15 Jun 2021 13:38:16 -0700 Subject: [PATCH 10/43] Additional code to hide/show spectrum and correcting an issue with the rig name not populating for non-spectrum radios. --- wfmain.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index ccf89b5..20595a3 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -1524,8 +1524,12 @@ void wfmain::showHideSpectrum(bool show) ui->specSpanLabel->setVisible(show); ui->specThemeLabel->setVisible(show); + // And the layout for space: ui->specControlsHorizLayout->setEnabled(show); - + ui->splitter->setVisible(show); + ui->plot->setVisible(show); + ui->waterfall->setVisible(show); + ui->spectrumGroupBox->setEnabled(show); } void wfmain::prepareWf() @@ -1592,7 +1596,6 @@ void wfmain::prepareWf(unsigned int wfLength) wf->yAxis->setRangeReversed(true); wf->xAxis->setVisible(false); - rigName->setText(rigCaps.modelName); spectrumDrawLock = false; } else { @@ -2477,6 +2480,7 @@ void wfmain::receiveRigID(rigCapabilities rigCaps) qDebug(logSystem()) << "Rig ID received into wfmain: hasSpectrum: " << rigCaps.hasSpectrum; this->rigCaps = rigCaps; + rigName->setText(rigCaps.modelName); this->spectWidth = rigCaps.spectLenMax; // used once haveRigCaps is true. haveRigCaps = true; // Added so that server receives rig capabilities. From 7a2e8560cfccf13d52f20f3af455da644d59c16e Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Thu, 17 Jun 2021 23:14:28 -0700 Subject: [PATCH 11/43] Radios without spectrum do not show spectrum, and, the window properly resizes for those controls. Also, a new key command, control-shift-d has been added to run debug functions from any tab in the program. --- wfmain.cpp | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ wfmain.h | 3 +++ 2 files changed, 60 insertions(+) diff --git a/wfmain.cpp b/wfmain.cpp index 20595a3..db3fbee 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -696,6 +696,54 @@ void wfmain::setupMainUI() ui->tuneLockChk->setChecked(false); freqLock = false; + + connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateSizes(int))); +} + +void wfmain::updateSizes(int tabIndex) +{ + // This function does nothing unless you are using a rig without spectrum. + // This is a hack. It is not great, but it seems to work ok. + if(!rigCaps.hasSpectrum) + { + // Set "ignore" size policy for non-selected tabs: + for(int i=0;itabWidget->count();i++) + if((i!=tabIndex) && tabIndex != 0) + ui->tabWidget->widget(i)->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); // allows size to be any size that fits the tab bar + + if(tabIndex==0 && !rigCaps.hasSpectrum) + { + + ui->tabWidget->widget(0)->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + ui->tabWidget->widget(0)->setMaximumSize(ui->tabWidget->widget(0)->minimumSizeHint()); + ui->tabWidget->widget(0)->adjustSize(); // tab + this->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + this->setMaximumSize(QSize(929, 270)); + this->setMinimumSize(QSize(929, 270)); + + resize(minimumSize()); + adjustSize(); // main window + adjustSize(); + + } else if(tabIndex==0 && rigCaps.hasSpectrum) { + // At main tab (0) and we have spectrum: + ui->tabWidget->widget(0)->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + + resize(minimumSizeHint()); + adjustSize(); // Without this call, the window retains the size of the previous tab. + } else { + // At some other tab, with or without spectrum: + ui->tabWidget->widget(tabIndex)->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + this->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + this->setMinimumSize(QSize(994, 455)); // not large enough for settings tab + this->setMaximumSize(QSize(65535,65535)); + } + } else { + ui->tabWidget->widget(tabIndex)->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + ui->tabWidget->widget(tabIndex)->setMaximumSize(65535,65535); + //ui->tabWidget->widget(0)->setMinimumSize(); + } + } void wfmain::getSettingsFilePath(QString settingsFile) @@ -1039,6 +1087,10 @@ void wfmain::setupKeyShortcuts() keyM = new QShortcut(this); keyM->setKey(Qt::Key_M); connect(keyM, SIGNAL(activated()), this, SLOT(shortcutM())); + + keyDebug = new QShortcut(this); + keyDebug->setKey(Qt::CTRL + Qt::SHIFT + Qt::Key_D); + connect(keyDebug, SIGNAL(activated()), this, SLOT(on_debugBtn_clicked())); } void wfmain::setDefPrefs() @@ -1530,6 +1582,10 @@ void wfmain::showHideSpectrum(bool show) ui->plot->setVisible(show); ui->waterfall->setVisible(show); ui->spectrumGroupBox->setEnabled(show); + + // Window resize: + updateSizes(ui->tabWidget->currentIndex()); + } void wfmain::prepareWf() @@ -3833,6 +3889,7 @@ void wfmain::on_connectBtn_clicked() emit sendCloseComm(); ui->connectBtn->setText("Connect"); haveRigCaps = false; + rigName->setText("NONE"); } else { diff --git a/wfmain.h b/wfmain.h index 0f4317e..1071b89 100644 --- a/wfmain.h +++ b/wfmain.h @@ -144,6 +144,7 @@ signals: void sendRigCaps(rigCapabilities caps); private slots: + void updateSizes(int tabIndex); void shortcutF1(); void shortcutF2(); void shortcutF3(); @@ -510,6 +511,8 @@ private: QShortcut *keyF; QShortcut *keyM; + QShortcut *keyDebug; + rigCommander * rig=Q_NULLPTR; QThread* rigThread = Q_NULLPTR; From bd1b6fc1de8dc117e51c3007c7ab663e977b9ddf Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Fri, 18 Jun 2021 00:58:02 -0700 Subject: [PATCH 12/43] Fixed accidental s-meter timing parameter change. --- wfmain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wfmain.cpp b/wfmain.cpp index db3fbee..d85b7a1 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -4457,7 +4457,7 @@ void wfmain::calculateTimingParameters() msMinTiming = 35; delayedCommand->setInterval( msMinTiming * 2); // 20 byte message - periodicPollingTimer->setInterval( msMinTiming *5); // slower for s-meter poll + periodicPollingTimer->setInterval( msMinTiming ); // quicker for s-meter poll qInfo(logSystem()) << "Delay command interval timing: " << msMinTiming * 2 << "ms"; qInfo(logSystem()) << "Periodic polling timer: " << msMinTiming << "ms"; From cc92aa1b5cf932cb437cc37c4cb825cb2666abdb Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Fri, 18 Jun 2021 12:41:56 -0700 Subject: [PATCH 13/43] Added full duplex comms parameter to rigCaps. We assume half-duplex until we receive a reply to rigID. --- rigcommander.cpp | 12 ++++++++++++ rigidentities.h | 1 + wfmain.cpp | 19 ++++++++++++++----- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/rigcommander.cpp b/rigcommander.cpp index 18558b3..b83e87a 100644 --- a/rigcommander.cpp +++ b/rigcommander.cpp @@ -2598,6 +2598,7 @@ void rigCommander::determineRigCaps() rigCaps.spectAmpMax = 0; rigCaps.spectLenMax = 0; + rigCaps.hasFDcomms = true; // false for older radios // Clear inputs/preamps/attenuators lists in case we have re-connected. rigCaps.preamps.clear(); @@ -2729,6 +2730,7 @@ void rigCommander::determineRigCaps() rigCaps.hasLan = false; rigCaps.hasEthernet = false; rigCaps.hasWiFi = false; + rigCaps.hasFDcomms = false; rigCaps.hasDD = false; rigCaps.hasDV = false; rigCaps.hasCTCSS = true; @@ -2844,6 +2846,7 @@ void rigCommander::determineRigCaps() rigCaps.hasLan = false; rigCaps.hasEthernet = false; rigCaps.hasWiFi = false; + rigCaps.hasFDcomms = false; rigCaps.hasATU = true; rigCaps.hasCTCSS = true; rigCaps.hasDTCS = true; @@ -2864,6 +2867,7 @@ void rigCommander::determineRigCaps() rigCaps.hasLan = false; rigCaps.hasEthernet = false; rigCaps.hasWiFi = false; + rigCaps.hasFDcomms = true; rigCaps.hasATU = true; rigCaps.hasCTCSS = true; rigCaps.hasDTCS = true; @@ -2884,6 +2888,7 @@ void rigCommander::determineRigCaps() rigCaps.hasLan = false; rigCaps.hasEthernet = false; rigCaps.hasWiFi = false; + rigCaps.hasFDcomms = false; rigCaps.hasATU = true; rigCaps.hasCTCSS = true; rigCaps.hasDTCS = true; @@ -2909,6 +2914,7 @@ void rigCommander::determineRigCaps() rigCaps.hasLan = false; rigCaps.hasEthernet = false; rigCaps.hasWiFi = false; + rigCaps.hasFDcomms = false; rigCaps.hasATU = true; rigCaps.hasCTCSS = true; rigCaps.hasDTCS = true; @@ -2951,6 +2957,7 @@ void rigCommander::determineRigCaps() rigCaps.hasLan = false; rigCaps.hasEthernet = false; rigCaps.hasWiFi = false; + rigCaps.hasFDcomms = false; rigCaps.hasATU = true; rigCaps.attenuators.push_back('\x20'); rigCaps.bands = standardHF; @@ -2966,6 +2973,7 @@ void rigCommander::determineRigCaps() rigCaps.hasLan = false; rigCaps.hasEthernet = false; rigCaps.hasWiFi = false; + rigCaps.hasFDcomms = false; rigCaps.hasATU = false; rigCaps.attenuators.push_back('\x20'); rigCaps.preamps.push_back('\x01'); @@ -2985,6 +2993,7 @@ void rigCommander::determineRigCaps() rigCaps.hasLan = false; rigCaps.hasEthernet = false; rigCaps.hasWiFi = false; + rigCaps.hasFDcomms = false; rigCaps.hasATU = true; rigCaps.preamps.push_back('\x01'); rigCaps.preamps.push_back('\x02'); @@ -3002,6 +3011,7 @@ void rigCommander::determineRigCaps() rigCaps.hasLan = false; rigCaps.hasEthernet = false; rigCaps.hasWiFi = false; + rigCaps.hasFDcomms = false; rigCaps.hasATU = true; rigCaps.preamps.push_back('\x01'); rigCaps.preamps.push_back('\x02'); @@ -3019,6 +3029,7 @@ void rigCommander::determineRigCaps() rigCaps.hasLan = false; rigCaps.hasEthernet = false; rigCaps.hasWiFi = false; + rigCaps.hasFDcomms = false; rigCaps.hasATU = true; rigCaps.preamps.push_back('\x01'); rigCaps.preamps.push_back('\x02'); @@ -3039,6 +3050,7 @@ void rigCommander::determineRigCaps() rigCaps.hasLan = false; rigCaps.hasEthernet = false; rigCaps.hasWiFi = false; + rigCaps.hasFDcomms = false; rigCaps.hasPreamp = false; rigCaps.hasAntennaSel = false; rigCaps.attenuators.push_back('\x10'); diff --git a/rigidentities.h b/rigidentities.h index 5869136..8e5f1c8 100644 --- a/rigidentities.h +++ b/rigidentities.h @@ -81,6 +81,7 @@ struct rigCapabilities { bool hasLan; // OEM ethernet or wifi connection bool hasEthernet; bool hasWiFi; + bool hasFDcomms; QVector inputs; diff --git a/wfmain.cpp b/wfmain.cpp index d85b7a1..b22a855 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -2656,6 +2656,8 @@ void wfmain::receiveRigID(rigCapabilities rigCaps) // do all the initial grabs. For now, this hack of adding them here and there: cmdOutQue.append(cmdGetFreq); cmdOutQue.append(cmdGetMode); + // recalculate command timing now that we know the rig better: + calculateTimingParameters(); initPeriodicCommands(); } } @@ -4453,14 +4455,21 @@ void wfmain::calculateTimingParameters() unsigned int usPerByte = 9600*1000 / prefs.serialPortBaud; unsigned int msMinTiming=usPerByte * 10*2/1000; - if(msMinTiming < 35) - msMinTiming = 35; + if(msMinTiming < 25) + msMinTiming = 25; delayedCommand->setInterval( msMinTiming * 2); // 20 byte message - periodicPollingTimer->setInterval( msMinTiming ); // quicker for s-meter poll - qInfo(logSystem()) << "Delay command interval timing: " << msMinTiming * 2 << "ms"; - qInfo(logSystem()) << "Periodic polling timer: " << msMinTiming << "ms"; + if(haveRigCaps && rigCaps.hasFDcomms) + { + periodicPollingTimer->setInterval( msMinTiming ); // quicker for s-meter poll + } else { + periodicPollingTimer->setInterval( msMinTiming * 5); // slower for s-meter poll + } + + + qInfo(logSystem()) << "Delay command interval timing: " << delayedCommand->interval() << "ms"; + qInfo(logSystem()) << "Periodic polling timer: " << periodicPollingTimer->interval() << "ms"; // Normal: delayedCmdIntervalLAN_ms = msMinTiming * 2; From 8024893a62483e06f5d0945e2c60aa67710a01ac Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Fri, 18 Jun 2021 15:57:21 -0700 Subject: [PATCH 14/43] If no rig caps, then don't mess with the window! --- wfmain.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wfmain.cpp b/wfmain.cpp index b22a855..0346266 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -702,6 +702,8 @@ void wfmain::setupMainUI() void wfmain::updateSizes(int tabIndex) { + if(!haveRigCaps) + return; // This function does nothing unless you are using a rig without spectrum. // This is a hack. It is not great, but it seems to work ok. if(!rigCaps.hasSpectrum) From ee54e76c5f7454bea9f5a332f9e01eefebb069ee Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Fri, 18 Jun 2021 21:56:11 -0700 Subject: [PATCH 15/43] Minor change to remove some old debug code that snuck in. --- wfmain.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index 0346266..ab565d5 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -407,9 +407,6 @@ void wfmain::findSerialPort() QDirIterator it705("/dev/serial", QStringList() << "*IC-705*A", QDir::Files, QDirIterator::Subdirectories); QDirIterator it7610("/dev/serial", QStringList() << "*IC-7610*A", QDir::Files, QDirIterator::Subdirectories); QDirIterator itR8600("/dev/serial", QStringList() << "*IC-R8600*A", QDir::Files, QDirIterator::Subdirectories); - QDirIterator itTest("/tmp/test", QStringList() << "*radio*", QDir::NoFilter, QDirIterator::Subdirectories); - - qDebug() << "test iterator isEmpty: " << itTest.filePath().isEmpty(); if(!it73.filePath().isEmpty()) { From 2508b4d71cd45041538637657f7913ceee012902 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Fri, 18 Jun 2021 22:45:12 -0700 Subject: [PATCH 16/43] Additional support for the IC-R8600, including wider scope spans. --- rigcommander.cpp | 27 ++++++++++++++++++++++++++- rigcommander.h | 1 + rigidentities.cpp | 7 +++++-- rigidentities.h | 19 +++++++++++++++++++ wfmain.cpp | 15 +++++++++++++++ 5 files changed, 66 insertions(+), 3 deletions(-) diff --git a/rigcommander.cpp b/rigcommander.cpp index b83e87a..81c160a 100644 --- a/rigcommander.cpp +++ b/rigcommander.cpp @@ -362,6 +362,10 @@ void rigCommander::setSpectrumBounds(double startFreq, double endFreq, unsigned if(startFreq > 400.0) freqRange++; break; + case modelR8600: + freqRange = 1; + edgeNumber = 1; + break; default: return; break; @@ -429,7 +433,7 @@ void rigCommander::setScopeSpan(char span) // See ICD, page 165, "19-12". // 2.5k = 0 // 5k = 2, etc. - if((span <0 ) || (span >7)) + if((span <0 ) || (span >9)) return; QByteArray payload; @@ -464,6 +468,12 @@ void rigCommander::setScopeSpan(char span) case 7: freq = 500.0E-3; break; + case 8: + freq = 1000.0E-3; + break; + case 9: + freq = 2500.0E-3; + break; default: return; break; @@ -2561,6 +2571,14 @@ mode_info rigCommander::createMode(mode_kind m, unsigned char reg, QString name) return mode; } +centerSpanData rigCommander::createScopeCenter(centerSpansType s, QString name) +{ + centerSpanData csd; + csd.cstype = s; + csd.name = name; + return csd; +} + void rigCommander::determineRigCaps() { //TODO: Determine available bands (low priority, rig will reject out of band requests anyway) @@ -2597,6 +2615,12 @@ void rigCommander::determineRigCaps() rigCaps.spectSeqMax = 0; rigCaps.spectAmpMax = 0; rigCaps.spectLenMax = 0; + rigCaps.scopeCenterSpans = { createScopeCenter(cs2p5k, "±2.5k"), createScopeCenter(cs5k, "±5k"), + createScopeCenter(cs10k, "±10k"), createScopeCenter(cs25k, "±25k"), + createScopeCenter(cs50k, "±50k"), createScopeCenter(cs100k, "±100k"), + createScopeCenter(cs250k, "±250k"), createScopeCenter(cs500k, "±500k") + }; + rigCaps.hasFDcomms = true; // false for older radios @@ -2696,6 +2720,7 @@ void rigCommander::determineRigCaps() createMode(modeP25, 0x16, "P25"), createMode(modedPMR, 0x18, "dPMR"), createMode(modeNXDN_VN, 0x19, "NXDN-VN"), createMode(modeNXDN_N, 0x20, "NXDN-N"), createMode(modeDCR, 0x21, "DCR")}); + rigCaps.scopeCenterSpans.insert(rigCaps.scopeCenterSpans.end(), {createScopeCenter(cs1M, "±1M"), createScopeCenter(cs2p5M, "±2.5M")}); break; case model9700: rigCaps.modelName = QString("IC-9700"); diff --git a/rigcommander.h b/rigcommander.h index c3c292c..ef01a54 100644 --- a/rigcommander.h +++ b/rigcommander.h @@ -377,6 +377,7 @@ private: void printHex(const QByteArray &pdata); void printHex(const QByteArray &pdata, bool printVert, bool printHoriz); mode_info createMode(mode_kind m, unsigned char reg, QString name); + centerSpanData createScopeCenter(centerSpansType s, QString name); commHandler* comm = Q_NULLPTR; pttyHandler* ptty = Q_NULLPTR; diff --git a/rigidentities.cpp b/rigidentities.cpp index c2322fd..7b113f7 100644 --- a/rigidentities.cpp +++ b/rigidentities.cpp @@ -55,8 +55,8 @@ model_kind determineRadioModel(unsigned char rigID) case model718: rig = model718; break; - case model756proiii: - rig = model756proiii; + case model910h: + rig = model910h; break; case model756pro: rig = model756pro; @@ -64,6 +64,9 @@ model_kind determineRadioModel(unsigned char rigID) case model756proii: rig = model756proii; break; + case model756proiii: + rig = model756proiii; + break; default: rig = modelUnknown; break; diff --git a/rigidentities.h b/rigidentities.h index 8e5f1c8..bffe842 100644 --- a/rigidentities.h +++ b/rigidentities.h @@ -68,6 +68,24 @@ enum bandType { band23cm=0, bandGen }; +enum centerSpansType { + cs2p5k = 0, + cs5k = 1, + cs10k = 2, + cs25k = 3, + cs50k = 4, + cs100k = 5, + cs250k = 6, + cs500k = 7, + cs1M = 8, + cs2p5M = 9 +}; + +struct centerSpanData { + centerSpansType cstype; + QString name; +}; + model_kind determineRadioModel(unsigned char rigID); struct rigCapabilities { @@ -105,6 +123,7 @@ struct rigCapabilities { std::vector attenuators; std::vector preamps; std::vector antennas; + std::vector scopeCenterSpans; std::vector bands; unsigned char bsr[20] = {0}; diff --git a/wfmain.cpp b/wfmain.cpp index ab565d5..da3722e 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -2643,6 +2643,21 @@ void wfmain::receiveRigID(rigCapabilities rigCaps) ui->antennaSelCombo->setDisabled(true); } + ui->scopeBWCombo->blockSignals(true); + ui->scopeBWCombo->clear(); + if(rigCaps.hasSpectrum) + { + ui->scopeBWCombo->setHidden(false); + for(unsigned int i=0; i < rigCaps.scopeCenterSpans.size(); i++) + { + ui->scopeBWCombo->addItem(rigCaps.scopeCenterSpans.at(i).name, (int)rigCaps.scopeCenterSpans.at(i).cstype); + } + } else { + ui->scopeBWCombo->setHidden(true); + } + ui->scopeBWCombo->blockSignals(false); + + setBandButtons(); ui->tuneEnableChk->setEnabled(rigCaps.hasATU); From 72ca86f1bd534ce8eb357f83f3530947fa5daf51 Mon Sep 17 00:00:00 2001 From: Roeland Jansen Date: Sat, 19 Jun 2021 15:07:29 +0200 Subject: [PATCH 17/43] WHATSNEW etc --- WHATSNEW | 4 +++- opus-tools | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) create mode 160000 opus-tools diff --git a/WHATSNEW b/WHATSNEW index b09dff6..f1a0260 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -7,4 +7,6 @@ The following highlights are in this dot-release: fixes and lots of improvements at the usb-server end waterfall length can be adjusted now no need to restart to change CIV address - + seamless changing rigs without restart + started support for older rigs like the 718 + wf display disappears when there is no wf capable rig diff --git a/opus-tools b/opus-tools new file mode 160000 index 0000000..ae5d6d5 --- /dev/null +++ b/opus-tools @@ -0,0 +1 @@ +Subproject commit ae5d6d59e82ef40300a4dece7897499685f87184 From 4b267830713afb35ce4e39e362f68ff503904986 Mon Sep 17 00:00:00 2001 From: Roeland Jansen Date: Sat, 19 Jun 2021 21:37:30 +0200 Subject: [PATCH 18/43] whatsnew: improbed IC r8600 --- WHATSNEW | 1 + 1 file changed, 1 insertion(+) diff --git a/WHATSNEW b/WHATSNEW index f1a0260..232b9e9 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -10,3 +10,4 @@ The following highlights are in this dot-release: seamless changing rigs without restart started support for older rigs like the 718 wf display disappears when there is no wf capable rig + IC R8600 support improved From 8eb00fa38976d3db79e0bf9087fb0d07446e0185 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Sat, 19 Jun 2021 12:39:11 -0700 Subject: [PATCH 19/43] No more negative frequencies! --- wfmain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wfmain.cpp b/wfmain.cpp index da3722e..4fe6465 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -1836,7 +1836,7 @@ quint64 wfmain::roundFrequencyWithStep(quint64 frequency, int steps, unsigned in { frequency = frequency + (quint64)(steps*tsHz); } else { - frequency = frequency - (quint64)(abs(steps)*tsHz); + frequency = frequency - std::min((quint64)(abs(steps)*tsHz), frequency); } if(ui->tuningFloorZerosChk->isChecked()) From b5c7eaf95abdd4bdfaa04dcd22d2800024782c1c Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Sat, 19 Jun 2021 16:16:07 -0700 Subject: [PATCH 20/43] Preliminary slider to status work. --- wfmain.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ wfmain.h | 2 ++ 2 files changed, 43 insertions(+) diff --git a/wfmain.cpp b/wfmain.cpp index 4fe6465..5fcc3d0 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -695,6 +695,37 @@ void wfmain::setupMainUI() freqLock = false; connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateSizes(int))); + //connect(ui->txPowerSlider, SIGNAL(actionTriggered(int)), this, [=](func int) { statusFromSliderRaw(QString("hi"), int);}) + connect( + ui->txPowerSlider, &QSlider::valueChanged, + [=](const int &newValue) { statusFromSliderPercent("Tx Power", newValue);} + ); + + connect( + ui->rfGainSlider, &QSlider::valueChanged, + [=](const int &newValue) { statusFromSliderPercent("RF Gain", newValue);} + ); + + connect( + ui->afGainSlider, &QSlider::valueChanged, + [=](const int &newValue) { statusFromSliderPercent("AF Gain", newValue);} + ); + + connect( + ui->micGainSlider, &QSlider::valueChanged, + [=](const int &newValue) { statusFromSliderPercent("TX Audio Gain", newValue);} + ); + + connect( + ui->sqlSlider, &QSlider::valueChanged, + [=](const int &newValue) { statusFromSliderPercent("Squelch", newValue);} + ); + + // -200 0 +200.. take log? + connect( + ui->scopeRefLevelSlider, &QSlider::valueChanged, + [=](const int &newValue) { statusFromSliderRaw("Scope Ref Level", newValue);} + ); } void wfmain::updateSizes(int tabIndex) @@ -4005,6 +4036,16 @@ void wfmain::changeSliderQuietly(QSlider *slider, int value) slider->blockSignals(false); } +void wfmain::statusFromSliderRaw(QString name, int rawValue) +{ + showStatusBarText(name + QString(": %1").arg(rawValue)); +} + +void wfmain::statusFromSliderPercent(QString name, int rawValue) +{ + showStatusBarText(name + QString(": %1\%").arg((int)(100*rawValue/255.0))); +} + void wfmain::receiveTxPower(unsigned char power) { changeSliderQuietly(ui->txPowerSlider, power); diff --git a/wfmain.h b/wfmain.h index 1071b89..6201ea8 100644 --- a/wfmain.h +++ b/wfmain.h @@ -665,6 +665,8 @@ private: void issueDelayedCommandPriority(cmds cmd); void issueDelayedCommandUnique(cmds cmd); void changeSliderQuietly(QSlider *slider, int value); + void statusFromSliderPercent(QString name, int percentValue); + void statusFromSliderRaw(QString name, int rawValue); void processModLevel(rigInput source, unsigned char level); From 53957466bb94c76cedf0ce12a61b02d345a0b18b Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Sat, 19 Jun 2021 16:18:00 -0700 Subject: [PATCH 21/43] Added a few more slider things --- wfmain.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wfmain.cpp b/wfmain.cpp index 5fcc3d0..8b665bd 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -695,7 +695,7 @@ void wfmain::setupMainUI() freqLock = false; connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateSizes(int))); - //connect(ui->txPowerSlider, SIGNAL(actionTriggered(int)), this, [=](func int) { statusFromSliderRaw(QString("hi"), int);}) + connect( ui->txPowerSlider, &QSlider::valueChanged, [=](const int &newValue) { statusFromSliderPercent("Tx Power", newValue);} @@ -726,6 +726,12 @@ void wfmain::setupMainUI() ui->scopeRefLevelSlider, &QSlider::valueChanged, [=](const int &newValue) { statusFromSliderRaw("Scope Ref Level", newValue);} ); + + connect( + ui->wfLengthSlider, &QSlider::valueChanged, + [=](const int &newValue) { statusFromSliderRaw("Waterfall Length", newValue);} + ); + } void wfmain::updateSizes(int tabIndex) From 761dbd18a03fe33c927d72e5fbc951f19f3b7697 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Sun, 20 Jun 2021 13:34:32 -0700 Subject: [PATCH 22/43] New unified outgoing command queue. Tested on IC-9700 and IC-718 (to remote wfview server). CPU usage seems higher but please check your system. Timing seems to be acceptable but could probably use some tweaks. S- meter polling is 25ms for fast radios, and slower rates for slower radios. Half-duplex serial radios receive 3x slower polling to make room for replies. For Freq, Mode, etc "regular" constant polling (new feature): IC-9700 polling is 5 per second, IC-718 is 1-2 per second. Just helps keep the UI in sync with changes taking place at the rig. The polling is slow enough that it doesn't impact anything. But quick enough that it catches discrepencies pretty quickly. --- rigcommander.cpp | 8 +- rigidentities.h | 2 + wfmain.cpp | 648 ++++++++++++++++++++--------------------------- wfmain.h | 12 +- 4 files changed, 298 insertions(+), 372 deletions(-) diff --git a/rigcommander.cpp b/rigcommander.cpp index 81c160a..9e8efca 100644 --- a/rigcommander.cpp +++ b/rigcommander.cpp @@ -2496,7 +2496,6 @@ void rigCommander::parseDetailedRegisters1A05() default: break; } - } void rigCommander::parseWFData() @@ -2607,6 +2606,7 @@ void rigCommander::determineRigCaps() rigCaps.hasDD = false; rigCaps.hasDV = false; + rigCaps.hasDataModes = true; // USB-D, LSB-D, etc rigCaps.hasATU = false; rigCaps.hasCTCSS = false; @@ -2638,6 +2638,7 @@ void rigCommander::determineRigCaps() rigCaps.hasAntennaSel = false; rigCaps.hasTransmit = true; + rigCaps.hasPTTCommand = true; // Common, reasonable defaults for most supported HF rigs: rigCaps.bsr[band160m] = 0x01; @@ -2700,6 +2701,7 @@ void rigCommander::determineRigCaps() rigCaps.hasEthernet = true; rigCaps.hasWiFi = false; rigCaps.hasTransmit = false; + rigCaps.hasPTTCommand = false; rigCaps.hasCTCSS = true; rigCaps.hasDTCS = true; rigCaps.hasDV = true; @@ -2984,6 +2986,8 @@ void rigCommander::determineRigCaps() rigCaps.hasWiFi = false; rigCaps.hasFDcomms = false; rigCaps.hasATU = true; + rigCaps.hasPTTCommand = false; + rigCaps.hasDataModes = false; rigCaps.attenuators.push_back('\x20'); rigCaps.bands = standardHF; rigCaps.bands.insert(rigCaps.bands.end(), standardVU.begin(), standardVU.end()); @@ -3000,6 +3004,8 @@ void rigCommander::determineRigCaps() rigCaps.hasWiFi = false; rigCaps.hasFDcomms = false; rigCaps.hasATU = false; + rigCaps.hasPTTCommand = false; + rigCaps.hasDataModes = false; rigCaps.attenuators.push_back('\x20'); rigCaps.preamps.push_back('\x01'); rigCaps.bands = {band10m, band10m, band12m, diff --git a/rigidentities.h b/rigidentities.h index bffe842..4563f8f 100644 --- a/rigidentities.h +++ b/rigidentities.h @@ -116,9 +116,11 @@ struct rigCapabilities { bool hasDTCS; bool hasTransmit; + bool hasPTTCommand; bool hasAttenuator; bool hasPreamp; bool hasAntennaSel; + bool hasDataModes; std::vector attenuators; std::vector preamps; diff --git a/wfmain.cpp b/wfmain.cpp index 8b665bd..5e0999a 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -463,7 +463,7 @@ void wfmain::receiveCommReady() // qInfo(logSystem()) << "Beginning search from wfview for rigCIV (auto-detection broadcast)"; ui->statusBar->showMessage(QString("Searching CI-V bus for connected radios."), 1000); emit getRigCIV(); - cmdOutQue.append(cmdGetRigCIV); + issueDelayedCommand(cmdGetRigCIV); delayedCommand->start(); } else { // don't bother, they told us the CIV they want, stick with it. @@ -811,18 +811,20 @@ void wfmain::getSettingsFilePath(QString settingsFile) void wfmain::setInitialTiming() { + loopTickCounter = 0; delayedCmdIntervalLAN_ms = 70; // interval for regular delayed commands, including initial rig/UI state queries delayedCmdIntervalSerial_ms = 100; // interval for regular delayed commands, including initial rig/UI state queries delayedCmdStartupInterval_ms = 250; // interval for rigID polling delayedCommand = new QTimer(this); delayedCommand->setInterval(delayedCmdStartupInterval_ms); // 250ms until we find rig civ and id, then 100ms. - delayedCommand->setSingleShot(true); - connect(delayedCommand, SIGNAL(timeout()), this, SLOT(runDelayedCommand())); + delayedCommand->setSingleShot(false); + connect(delayedCommand, SIGNAL(timeout()), this, SLOT(sendRadioCommandLoop())); - periodicPollingTimer = new QTimer(this); - periodicPollingTimer->setInterval(10); - periodicPollingTimer->setSingleShot(false); - connect(periodicPollingTimer, SIGNAL(timeout()), this, SLOT(runPeriodicCommands())); + // TODO: Remove this: +// periodicPollingTimer = new QTimer(this); +// periodicPollingTimer->setInterval(10); +// periodicPollingTimer->setSingleShot(false); + //connect(periodicPollingTimer, SIGNAL(timeout()), this, SLOT(sendRadioCommandLoop())); pttTimer = new QTimer(this); pttTimer->setInterval(180*1000); // 3 minute max transmit time in ms @@ -2021,75 +2023,75 @@ void wfmain:: getInitialRigState() // the polling interval is set at 200ms. Faster is possible but slower // computers will glitch occassionally. - cmdOutQue.append(cmdGetFreq); - cmdOutQue.append(cmdGetMode); + issueDelayedCommand(cmdGetFreq); + issueDelayedCommand(cmdGetMode); - cmdOutQue.append(cmdNone); + issueDelayedCommand(cmdNone); - cmdOutQue.append(cmdGetFreq); - cmdOutQue.append(cmdGetMode); + issueDelayedCommand(cmdGetFreq); + issueDelayedCommand(cmdGetMode); // From left to right in the UI: - cmdOutQue.append(cmdGetDataMode); - cmdOutQue.append(cmdGetModInput); - cmdOutQue.append(cmdGetModDataInput); - cmdOutQue.append(cmdGetRxGain); - cmdOutQue.append(cmdGetAfGain); - cmdOutQue.append(cmdGetSql); - cmdOutQue.append(cmdGetTxPower); - cmdOutQue.append(cmdGetCurrentModLevel); // level for currently selected mod sources - cmdOutQue.append(cmdGetSpectrumRefLevel); - cmdOutQue.append(cmdGetDuplexMode); + issueDelayedCommand(cmdGetDataMode); + issueDelayedCommand(cmdGetModInput); + issueDelayedCommand(cmdGetModDataInput); + issueDelayedCommand(cmdGetRxGain); + issueDelayedCommand(cmdGetAfGain); + issueDelayedCommand(cmdGetSql); + issueDelayedCommand(cmdGetTxPower); + issueDelayedCommand(cmdGetCurrentModLevel); // level for currently selected mod sources + issueDelayedCommand(cmdGetSpectrumRefLevel); + issueDelayedCommand(cmdGetDuplexMode); if(rigCaps.hasSpectrum) { - cmdOutQue.append(cmdDispEnable); - cmdOutQue.append(cmdSpecOn); + issueDelayedCommand(cmdDispEnable); + issueDelayedCommand(cmdSpecOn); } - cmdOutQue.append(cmdGetModInput); - cmdOutQue.append(cmdGetModDataInput); + issueDelayedCommand(cmdGetModInput); + issueDelayedCommand(cmdGetModDataInput); if(rigCaps.hasCTCSS) { - cmdOutQue.append(cmdGetTone); - cmdOutQue.append(cmdGetTSQL); + issueDelayedCommand(cmdGetTone); + issueDelayedCommand(cmdGetTSQL); } if(rigCaps.hasDTCS) { - cmdOutQue.append(cmdGetDTCS); + issueDelayedCommand(cmdGetDTCS); } - cmdOutQue.append(cmdGetRptAccessMode); + issueDelayedCommand(cmdGetRptAccessMode); if(rigCaps.hasAntennaSel) { - cmdOutQue.append(cmdGetAntenna); + issueDelayedCommand(cmdGetAntenna); } if(rigCaps.hasAttenuator) { - cmdOutQue.append(cmdGetAttenuator); + issueDelayedCommand(cmdGetAttenuator); } if(rigCaps.hasPreamp) { - cmdOutQue.append(cmdGetPreamp); + issueDelayedCommand(cmdGetPreamp); } - cmdOutQue.append(cmdGetRitEnabled); - cmdOutQue.append(cmdGetRitValue); + issueDelayedCommand(cmdGetRitEnabled); + issueDelayedCommand(cmdGetRitValue); if(rigCaps.hasSpectrum) { - cmdOutQue.append(cmdGetSpectrumMode); - cmdOutQue.append(cmdGetSpectrumSpan); + issueDelayedCommand(cmdGetSpectrumMode); + issueDelayedCommand(cmdGetSpectrumSpan); } - cmdOutQue.append(cmdNone); - cmdOutQue.append(cmdStartRegularPolling); + issueDelayedCommand(cmdNone); + issueDelayedCommand(cmdStartRegularPolling); if(rigCaps.hasATU) { - cmdOutQue.append(cmdGetATUStatus); + issueDelayedCommand(cmdGetATUStatus); } - cmdOut = cmdNone; + delayedCommand->start(); } @@ -2212,325 +2214,222 @@ void wfmain::setPlotTheme(QCustomPlot *plot, bool isDark) } } -void wfmain::runPeriodicCommands() +void wfmain::doCmd(cmds cmd) { - // These commands are run at a regular interval. They are to be used sparingly. - // For general radio state queries, use the runDelayedCommand() queue, - // accessed by the insertPeriodicCommands() function. - - // To insert commands to this queue, uset the insertPeriodicCommands() function. - - // TODO: Queue should not remove items, just hit a different item each time. - int nCmds = periodicCmdQueue.length(); - - cmds pcmd; - - if(!periodicCmdQueue.isEmpty()) - { - pcmd = periodicCmdQueue.at( (pCmdNum++)%nCmds ); - switch(pcmd) - { - case cmdNone: - break; - - // Metering commands: - case cmdGetSMeter: - if(!amTransmitting) - emit getMeters(meterS); - break; - case cmdGetPowerMeter: - if(amTransmitting) - emit getMeters(meterPower); - break; - case cmdGetIdMeter: - emit getMeters(meterCurrent); - break; - case cmdGetVdMeter: - emit getMeters(meterVoltage); - break; - case cmdGetALCMeter: - if(amTransmitting) - emit getMeters(meterALC); - break; - case cmdGetCompMeter: - if(amTransmitting) - emit getMeters(meterComp); - break; - - - // Standard commands we are already checking: - - case cmdGetRigID: - emit getRigID(); - break; - case cmdGetRigCIV: - // if(!know rig civ already) - if(!haveRigCaps) - { - emit getRigCIV(); - cmdOutQue.append(cmdGetRigCIV); // This way, we stay here until we get an answer. - } - break; - case cmdGetFreq: - emit getFrequency(); - break; - case cmdGetMode: - emit getMode(); - break; - case cmdGetDataMode: - // qInfo(logSystem()) << "Sending query for data mode"; - emit getDataMode(); - break; - case cmdSetDataModeOff: - emit setDataMode(false, (unsigned char) ui->modeFilterCombo->currentData().toInt()); - break; - case cmdSetDataModeOn: - emit setDataMode(true, (unsigned char) ui->modeFilterCombo->currentData().toInt()); - break; - case cmdGetModInput: - emit getModInput(false); - break; - case cmdGetModDataInput: - emit getModInput(true); - break; - case cmdGetCurrentModLevel: - emit getModInputLevel(currentModSrc); - emit getModInputLevel(currentModDataSrc); - break; - case cmdGetDuplexMode: - emit getDuplexMode(); - break; - case cmdDispEnable: - emit scopeDisplayEnable(); - break; - case cmdDispDisable: - emit scopeDisplayDisable(); - break; - case cmdSpecOn: - emit spectOutputEnable(); - break; - case cmdSpecOff: - emit spectOutputDisable(); - break; - case cmdGetRxGain: - emit getRfGain(); - break; - case cmdGetAfGain: - emit getAfGain(); - break; - case cmdGetSql: - emit getSql(); - break; - case cmdGetTxPower: - emit getTxPower(); - break; - case cmdGetMicGain: - emit getMicGain(); - break; - case cmdGetSpectrumRefLevel: - emit getSpectrumRefLevel(); - break; - case cmdGetATUStatus: - emit getATUStatus(); - break; - case cmdScopeCenterMode: - emit setScopeMode(spectModeCenter); - break; - case cmdScopeFixedMode: - emit setScopeMode(spectModeFixed); - break; - case cmdGetPTT: - emit getPTT(); - break; - case cmdStartRegularPolling: - periodicPollingTimer->start(); - break; - case cmdStopRegularPolling: - periodicPollingTimer->stop(); - break; - default: - break; - } - } -} - -void wfmain::runDelayedCommand() -{ - cmds qdCmd; - // Note: This cmdOut queue will be removed entirely soon and only the cmdOutQue will be available. - switch (cmdOut) + // Use this function to take action upon a command. + switch(cmd) { + case cmdNone: + //qInfo(logSystem()) << "NOOP"; + break; + case cmdGetRigID: + emit getRigID(); + break; + case cmdGetRigCIV: + // if(!know rig civ already) + if(!haveRigCaps) + { + emit getRigCIV(); + issueDelayedCommand(cmdGetRigCIV); // This way, we stay here until we get an answer. + } + break; case cmdGetFreq: emit getFrequency(); break; case cmdGetMode: emit getMode(); break; + case cmdGetDataMode: + if(rigCaps.hasDataModes) + emit getDataMode(); + break; + case cmdSetModeFilter: + emit setMode(setModeVal, setFilterVal); + break; + case cmdSetDataModeOff: + emit setDataMode(false, (unsigned char)ui->modeFilterCombo->currentData().toInt()); + break; + case cmdSetDataModeOn: + emit setDataMode(true, (unsigned char)ui->modeFilterCombo->currentData().toInt()); + break; + case cmdGetRitEnabled: + emit getRitEnabled(); + break; + case cmdGetRitValue: + emit getRitValue(); + break; + case cmdGetModInput: + emit getModInput(false); + break; + case cmdGetModDataInput: + emit getModInput(true); + break; + case cmdGetCurrentModLevel: + // TODO: Add delay between these queries + emit getModInputLevel(currentModSrc); + emit getModInputLevel(currentModDataSrc); + break; + case cmdGetDuplexMode: + emit getDuplexMode(); + break; + case cmdGetTone: + emit getTone(); + break; + case cmdGetTSQL: + emit getTSQL(); + break; + case cmdGetDTCS: + emit getDTCS(); + break; + case cmdGetRptAccessMode: + emit getRptAccessMode(); + break; + case cmdDispEnable: + emit scopeDisplayEnable(); + break; + case cmdDispDisable: + emit scopeDisplayDisable(); + break; + case cmdGetSpectrumMode: + emit getScopeMode(); + break; + case cmdGetSpectrumSpan: + emit getScopeSpan(); + break; + case cmdSpecOn: + emit spectOutputEnable(); + break; + case cmdSpecOff: + emit spectOutputDisable(); + break; + case cmdGetRxGain: + emit getRfGain(); + break; + case cmdGetAfGain: + emit getAfGain(); + break; + case cmdGetSql: + emit getSql(); + break; + case cmdGetTxPower: + emit getTxPower(); + break; + case cmdGetMicGain: + emit getMicGain(); + break; + case cmdGetSpectrumRefLevel: + emit getSpectrumRefLevel(); + break; + case cmdGetATUStatus: + emit getATUStatus(); + break; + case cmdGetAttenuator: + emit getAttenuator(); + break; + case cmdGetPreamp: + emit getPreamp(); + break; + case cmdGetAntenna: + emit getAntenna(); + break; + case cmdScopeCenterMode: + emit setScopeMode(spectModeCenter); + break; + case cmdScopeFixedMode: + emit setScopeMode(spectModeFixed); + break; + case cmdGetPTT: + if(rigCaps.hasPTTCommand) + { + emit getPTT(); + } + break; + case cmdGetTxRxMeter: + if(amTransmitting) + emit getMeters(meterPower); + else + emit getMeters(meterS); + break; + case cmdGetSMeter: + if(!amTransmitting) + emit getMeters(meterS); + break; + case cmdGetPowerMeter: + if(amTransmitting) + emit getMeters(meterPower); + break; + case cmdGetIdMeter: + emit getMeters(meterCurrent); + break; + case cmdGetVdMeter: + emit getMeters(meterVoltage); + break; + case cmdGetALCMeter: + if(amTransmitting) + emit getMeters(meterALC); + break; + case cmdGetCompMeter: + if(amTransmitting) + emit getMeters(meterComp); + break; + case cmdStartRegularPolling: + runPeriodicCommands = true; + break; + case cmdStopRegularPolling: + runPeriodicCommands = false; + break; + case cmdQueNormalSpeed: + if(usingLAN) + { + delayedCommand->setInterval(delayedCmdIntervalLAN_ms); + } else { + delayedCommand->setInterval(delayedCmdIntervalSerial_ms); + } + break; default: break; } - cmdOut = cmdNone; // yep. Hope this wasn't called twice in a row rapidly. +} - // Note: All command should use this queue. There is no need to use the above system. - if(!cmdOutQue.isEmpty()) +void wfmain::sendRadioCommandLoop() +{ + // Called by the periodicPollingTimer, see setInitialTiming() + + if(!(loopTickCounter % 2)) { - qdCmd = cmdOutQue.takeFirst(); - switch(qdCmd) + // if ther's a command waiting, run it. + if(!cmdOutQue.isEmpty()) { - case cmdNone: - //qInfo(logSystem()) << "NOOP"; - break; - case cmdGetRigID: - emit getRigID(); - break; - case cmdGetRigCIV: - // if(!know rig civ already) - if(!haveRigCaps) - { - emit getRigCIV(); - cmdOutQue.append(cmdGetRigCIV); // This way, we stay here until we get an answer. - } - break; - case cmdGetFreq: - emit getFrequency(); - break; - case cmdGetMode: - emit getMode(); - break; - case cmdGetDataMode: - emit getDataMode(); - break; - case cmdSetModeFilter: - emit setMode(setModeVal, setFilterVal); - break; - case cmdSetDataModeOff: - emit setDataMode(false, (unsigned char)ui->modeFilterCombo->currentData().toInt()); - break; - case cmdSetDataModeOn: - emit setDataMode(true, (unsigned char)ui->modeFilterCombo->currentData().toInt()); - break; - case cmdGetRitEnabled: - emit getRitEnabled(); - break; - case cmdGetRitValue: - emit getRitValue(); - break; - case cmdGetModInput: - emit getModInput(false); - break; - case cmdGetModDataInput: - emit getModInput(true); - break; - case cmdGetCurrentModLevel: - emit getModInputLevel(currentModSrc); - emit getModInputLevel(currentModDataSrc); - break; - case cmdGetDuplexMode: - emit getDuplexMode(); - break; - case cmdGetTone: - emit getTone(); - break; - case cmdGetTSQL: - emit getTSQL(); - break; - case cmdGetDTCS: - emit getDTCS(); - break; - case cmdGetRptAccessMode: - emit getRptAccessMode(); - break; - case cmdDispEnable: - emit scopeDisplayEnable(); - break; - case cmdDispDisable: - emit scopeDisplayDisable(); - break; - case cmdGetSpectrumMode: - emit getScopeMode(); - break; - case cmdGetSpectrumSpan: - emit getScopeSpan(); - break; - case cmdSpecOn: - emit spectOutputEnable(); - break; - case cmdSpecOff: - emit spectOutputDisable(); - break; - case cmdGetRxGain: - emit getRfGain(); - break; - case cmdGetAfGain: - emit getAfGain(); - break; - case cmdGetSql: - emit getSql(); - break; - case cmdGetTxPower: - emit getTxPower(); - break; - case cmdGetMicGain: - emit getMicGain(); - break; - case cmdGetSpectrumRefLevel: - emit getSpectrumRefLevel(); - break; - case cmdGetATUStatus: - emit getATUStatus(); - break; - case cmdGetAttenuator: - emit getAttenuator(); - break; - case cmdGetPreamp: - emit getPreamp(); - break; - case cmdGetAntenna: - emit getAntenna(); - break; - case cmdScopeCenterMode: - emit setScopeMode(spectModeCenter); - break; - case cmdScopeFixedMode: - emit setScopeMode(spectModeFixed); - break; - case cmdGetPTT: - emit getPTT(); - break; - case cmdStartRegularPolling: - periodicPollingTimer->start(); - break; - case cmdStopRegularPolling: - periodicPollingTimer->stop(); - break; - case cmdQueNormalSpeed: - if(usingLAN) - { - delayedCommand->setInterval(delayedCmdIntervalLAN_ms); - } else { - delayedCommand->setInterval(delayedCmdIntervalSerial_ms); - } - break; - default: - break; + cmds cmd = cmdOutQue.takeFirst(); + doCmd(cmd); + } else if(!(loopTickCounter % 10)) + { + // pick from useful queries to make now and then + if(haveRigCaps) + { + int nCmds = slowPollCmdQueue.length(); + cmds sCmd = slowPollCmdQueue.at( (slowCmdNum++)%nCmds); + doCmd(sCmd); + } + } + } else { + // odd-number ticks: + // s-meter or other metering + if(haveRigCaps) + { + int nCmds = periodicCmdQueue.length(); + cmds pcmd = periodicCmdQueue.at( (pCmdNum++)%nCmds ); + doCmd(pcmd); } } - if(cmdOutQue.isEmpty()) - { - // done - } else { - // next - // TODO: If we always do ->start, then it will not be necessary for - // every command insertion to include a ->start.... probably worth doing. - delayedCommand->start(); - } + loopTickCounter++; } void wfmain::issueDelayedCommand(cmds cmd) { + // Append to end of command queue cmdOutQue.append(cmd); - delayedCommand->start(); } void wfmain::issueDelayedCommandPriority(cmds cmd) @@ -2538,7 +2437,6 @@ void wfmain::issueDelayedCommandPriority(cmds cmd) // Places the new command at the top of the queue // Use only when needed. cmdOutQue.prepend(cmd); - delayedCommand->start(); } void wfmain::issueDelayedCommandUnique(cmds cmd) @@ -2548,11 +2446,9 @@ void wfmain::issueDelayedCommandUnique(cmds cmd) if(!cmdOutQue.contains(cmd)) { cmdOutQue.prepend(cmd); - delayedCommand->start(); } } - void wfmain::receiveRigID(rigCapabilities rigCaps) { // Note: We intentionally request rigID several times @@ -2705,8 +2601,8 @@ void wfmain::receiveRigID(rigCapabilities rigCaps) // Adding these here because clearly at this point we have valid // rig comms. In the future, we should establish comms and then // do all the initial grabs. For now, this hack of adding them here and there: - cmdOutQue.append(cmdGetFreq); - cmdOutQue.append(cmdGetMode); + issueDelayedCommand(cmdGetFreq); + issueDelayedCommand(cmdGetMode); // recalculate command timing now that we know the rig better: calculateTimingParameters(); initPeriodicCommands(); @@ -2719,13 +2615,23 @@ void wfmain::initPeriodicCommands() // The commands are run using a timer, // and the timer is started by the delayed command cmdStartPeriodicTimer. - insertPeriodicCommand(cmdGetSMeter, 128); - insertPeriodicCommand(cmdGetPowerMeter, 128); + insertPeriodicCommand(cmdGetTxRxMeter, 128); + + insertSlowPeriodicCommand(cmdGetFreq, 128); + insertSlowPeriodicCommand(cmdGetMode, 128); + insertSlowPeriodicCommand(cmdGetPTT, 128); + insertSlowPeriodicCommand(cmdGetTxPower, 128); + insertSlowPeriodicCommand(cmdGetRxGain, 128); + insertSlowPeriodicCommand(cmdGetAttenuator, 128); + insertSlowPeriodicCommand(cmdGetPTT, 128); + insertSlowPeriodicCommand(cmdGetPreamp, 128); } void wfmain::insertPeriodicCommand(cmds cmd, unsigned char priority) { // TODO: meaningful priority + // These commands get run at the fastest pace possible + // Typically just metering. if(priority < 10) { periodicCmdQueue.prepend(cmd); @@ -2734,6 +2640,19 @@ void wfmain::insertPeriodicCommand(cmds cmd, unsigned char priority) } } +void wfmain::insertSlowPeriodicCommand(cmds cmd, unsigned char priority) +{ + // TODO: meaningful priority + // These commands are run every 20 "ticks" of the primary radio command loop + // Basically 20 times less often than the standard peridic command + if(priority < 10) + { + slowPollCmdQueue.prepend(cmd); + } else { + slowPollCmdQueue.append(cmd); + } +} + void wfmain::receiveFreq(freqt freqStruct) { @@ -3031,8 +2950,8 @@ void wfmain::receiveMode(unsigned char mode, unsigned char filter) // Note: we need to know if the DATA mode is active to reach mode-D // some kind of queued query: - cmdOutQue.append(cmdGetDataMode); - delayedCommand->start(); // why was that commented out? + if(rigCaps.hasDataModes) + issueDelayedCommand(cmdGetDataMode); } void wfmain::receiveDataModeStatus(bool dataEnabled) @@ -3701,8 +3620,7 @@ void wfmain::on_tuneNowBtn_clicked() { emit startATU(); showStatusBarText("Starting ATU tuning cycle..."); - cmdOutQue.append(cmdGetATUStatus); - delayedCommand->start(); + issueDelayedCommand(cmdGetATUStatus); } void wfmain::on_tuneEnableChk_clicked(bool checked) @@ -3789,9 +3707,8 @@ void wfmain::receiveATUStatus(unsigned char atustatus) // Add command queue to check again and update status bar // qInfo(logSystem()) << "Received ATU status update that *tuning* is taking place"; showStatusBarText("ATU is Tuning..."); - cmdOutQue.append(cmdGetATUStatus); // Sometimes the first hit seems to be missed. - cmdOutQue.append(cmdGetATUStatus); - delayedCommand->start(); + issueDelayedCommand(cmdGetATUStatus); // Sometimes the first hit seems to be missed. + issueDelayedCommand(cmdGetATUStatus); break; default: qInfo(logSystem()) << "Did not understand ATU status: " << (unsigned int) atustatus; @@ -4014,14 +3931,14 @@ void wfmain::on_transmitBtn_clicked() // send PTT // Start 3 minute timer pttTimer->start(); - issueDelayedCommand(cmdGetPTT); + issueDelayedCommandPriority(cmdGetPTT); //changeTxBtn(); } else { // Currently transmitting emit setPTT(false); pttTimer->stop(); - issueDelayedCommand(cmdGetPTT); + issueDelayedCommandPriority(cmdGetPTT); } } @@ -4519,25 +4436,22 @@ void wfmain::calculateTimingParameters() if(msMinTiming < 25) msMinTiming = 25; - delayedCommand->setInterval( msMinTiming * 2); // 20 byte message - if(haveRigCaps && rigCaps.hasFDcomms) { - periodicPollingTimer->setInterval( msMinTiming ); // quicker for s-meter poll + delayedCommand->setInterval( msMinTiming); // 20 byte message } else { - periodicPollingTimer->setInterval( msMinTiming * 5); // slower for s-meter poll + delayedCommand->setInterval( msMinTiming * 3); // 20 byte message } qInfo(logSystem()) << "Delay command interval timing: " << delayedCommand->interval() << "ms"; - qInfo(logSystem()) << "Periodic polling timer: " << periodicPollingTimer->interval() << "ms"; // Normal: - delayedCmdIntervalLAN_ms = msMinTiming * 2; - delayedCmdIntervalSerial_ms = msMinTiming * 2; + delayedCmdIntervalLAN_ms = delayedCommand->interval(); + delayedCmdIntervalSerial_ms = delayedCommand->interval(); // startup initial state: - delayedCmdStartupInterval_ms = msMinTiming * 2; + delayedCmdStartupInterval_ms = delayedCommand->interval() * 3; } void wfmain::receiveBaudRate(quint32 baud) @@ -4569,19 +4483,19 @@ void wfmain::powerRigOn() delayedCommand->setInterval(3000); // 3 seconds if(ui->scopeEnableWFBtn->isChecked()) { - issueDelayedCommand(cmdDispEnable); - issueDelayedCommand(cmdQueNormalSpeed); - issueDelayedCommand(cmdSpecOn); - issueDelayedCommand(cmdStartRegularPolling); // s-meter, etc + issueDelayedCommand(cmdDispEnable); + issueDelayedCommand(cmdQueNormalSpeed); + issueDelayedCommand(cmdSpecOn); + issueDelayedCommand(cmdStartRegularPolling); // s-meter, etc } else { issueDelayedCommand(cmdQueNormalSpeed); + issueDelayedCommand(cmdStartRegularPolling); // s-meter, etc } delayedCommand->start(); } void wfmain::powerRigOff() { - periodicPollingTimer->stop(); delayedCommand->stop(); cmdOutQue.clear(); diff --git a/wfmain.h b/wfmain.h index 6201ea8..c63129e 100644 --- a/wfmain.h +++ b/wfmain.h @@ -234,8 +234,7 @@ private slots: void handleWFDoubleClick(QMouseEvent *); void handleWFScroll(QWheelEvent *); void handlePlotScroll(QWheelEvent *); - void runDelayedCommand(); - void runPeriodicCommands(); + void sendRadioCommandLoop(); void showStatusBarText(QString text); void serverConfigRequested(SERVERCONFIG conf, bool store); void receiveBaudRate(quint32 baudrate); @@ -520,8 +519,9 @@ private: QCPColorMapData * colorMapData; QCPColorScale * colorScale; QTimer * delayedCommand; - QTimer * periodicPollingTimer; QTimer * pttTimer; + uint16_t loopTickCounter; + uint16_t slowCmdNum; void setupPlots(); void makeRig(); @@ -582,16 +582,19 @@ private: cmdGetSql, cmdGetATUStatus, cmdGetSpectrumMode, cmdGetSpectrumSpan, cmdScopeCenterMode, cmdScopeFixedMode, cmdGetPTT, cmdGetTxPower, cmdGetMicGain, cmdGetSpectrumRefLevel, cmdGetDuplexMode, cmdGetModInput, cmdGetModDataInput, cmdGetCurrentModLevel, cmdStartRegularPolling, cmdStopRegularPolling, cmdQueNormalSpeed, - cmdGetVdMeter, cmdGetIdMeter, cmdGetSMeter, cmdGetPowerMeter, cmdGetALCMeter, cmdGetCompMeter, + cmdGetVdMeter, cmdGetIdMeter, cmdGetSMeter, cmdGetPowerMeter, cmdGetALCMeter, cmdGetCompMeter, cmdGetTxRxMeter, cmdGetTone, cmdGetTSQL, cmdGetDTCS, cmdGetRptAccessMode, cmdGetPreamp, cmdGetAttenuator, cmdGetAntenna}; cmds cmdOut; QVector cmdOutQue; QVector periodicCmdQueue; + QVector slowPollCmdQueue; + void doCmd(cmds cmd); int pCmdNum = 0; int delayedCmdIntervalLAN_ms = 100; int delayedCmdIntervalSerial_ms = 100; int delayedCmdStartupInterval_ms = 100; + bool runPeriodicCommands; bool usingLAN = false; freqMemory mem; @@ -679,6 +682,7 @@ private: void initPeriodicCommands(); void insertPeriodicCommand(cmds cmd, unsigned char priority); + void insertSlowPeriodicCommand(cmds cmd, unsigned char priority); void calculateTimingParameters(); void changeMode(mode_kind mode); From 849ddfe8d47f8db8463426adcf8aed590fe1e033 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Sun, 20 Jun 2021 23:44:24 -0700 Subject: [PATCH 23/43] debug (control-shift-d) lets the user input timing parameters. Just something for development for now. --- wfmain.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wfmain.cpp b/wfmain.cpp index 5e0999a..a615b75 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -4697,5 +4697,13 @@ void wfmain::on_debugBtn_clicked() { qInfo(logSystem()) << "Debug button pressed."; emit getFrequency(); + bool ok; + int timing = 0; + timing = QInputDialog::getInt(this, "Title", "Poll Timing Interval (ms)", delayedCommand->interval(), 5, 100, 1, &ok ); + if(ok && timing) + { + delayedCommand->setInterval( timing ); + qInfo(logSystem()) << "Setting delayed command timing to: " << timing << "ms."; + } } From e7d07ed7f81e12811b9d37093fb58ee907482af9 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Sun, 20 Jun 2021 23:46:26 -0700 Subject: [PATCH 24/43] IC-R8600 span is now received into the UI correctly. --- wfmain.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wfmain.cpp b/wfmain.cpp index a615b75..d8fe271 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -4407,6 +4407,12 @@ void wfmain::receiveSpectrumSpan(freqt freqspan, bool isSub) case(500000): ui->scopeBWCombo->setCurrentIndex(7); break; + case(1000000): + ui->scopeBWCombo->setCurrentIndex(8); + break; + case(2500000): + ui->scopeBWCombo->setCurrentIndex(9); + break; default: qInfo(logSystem()) << __func__ << "Could not match: " << freqspan.MHzDouble << " to anything like: " << (int)(freqspan.MHzDouble*1E6); break; From ac76696b440525f8e40205f63acb0655ace08088 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Mon, 21 Jun 2021 00:36:57 -0700 Subject: [PATCH 25/43] Moving to std::deque (double-ended que). --- wfmain.cpp | 48 +++++++++++++++++++++++++++++------------------- wfmain.h | 8 +++++--- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index d8fe271..360e0d6 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -2399,27 +2399,31 @@ void wfmain::sendRadioCommandLoop() if(!(loopTickCounter % 2)) { // if ther's a command waiting, run it. - if(!cmdOutQue.isEmpty()) + //if(!cmdOutQue.isEmpty()) + if(!delayedCmdQue.empty()) { - cmds cmd = cmdOutQue.takeFirst(); + //cmds cmd = cmdOutQue.takeFirst(); + cmds cmd = delayedCmdQue.front(); + delayedCmdQue.pop_front(); doCmd(cmd); } else if(!(loopTickCounter % 10)) { // pick from useful queries to make now and then - if(haveRigCaps) + if(haveRigCaps && !slowPollCmdQueue.empty()) { - int nCmds = slowPollCmdQueue.length(); - cmds sCmd = slowPollCmdQueue.at( (slowCmdNum++)%nCmds); + + int nCmds = slowPollCmdQueue.size(); + cmds sCmd = slowPollCmdQueue[(slowCmdNum++)%nCmds]; doCmd(sCmd); } } } else { // odd-number ticks: // s-meter or other metering - if(haveRigCaps) + if(haveRigCaps && !periodicCmdQueue.empty()) { - int nCmds = periodicCmdQueue.length(); - cmds pcmd = periodicCmdQueue.at( (pCmdNum++)%nCmds ); + int nCmds = periodicCmdQueue.size(); + cmds pcmd = periodicCmdQueue[ (pCmdNum++)%nCmds ]; doCmd(pcmd); } } @@ -2429,24 +2433,30 @@ void wfmain::sendRadioCommandLoop() void wfmain::issueDelayedCommand(cmds cmd) { // Append to end of command queue - cmdOutQue.append(cmd); + //cmdOutQue.append(cmd); + delayedCmdQue.push_back(cmd); } void wfmain::issueDelayedCommandPriority(cmds cmd) { // Places the new command at the top of the queue // Use only when needed. - cmdOutQue.prepend(cmd); + //cmdOutQue.prepend(cmd); + delayedCmdQue.push_front(cmd); } void wfmain::issueDelayedCommandUnique(cmds cmd) { // Use this function to insert commands where // multiple (redundant) commands don't make sense. - if(!cmdOutQue.contains(cmd)) - { - cmdOutQue.prepend(cmd); - } +// if(!cmdOutQue.contains(cmd)) +// { +// cmdOutQue.prepend(cmd); + if( std::find(delayedCmdQue.begin(), delayedCmdQue.end(), cmd ) == delayedCmdQue.end()) + { + delayedCmdQue.push_front(cmd); + } + //} } void wfmain::receiveRigID(rigCapabilities rigCaps) @@ -2634,9 +2644,9 @@ void wfmain::insertPeriodicCommand(cmds cmd, unsigned char priority) // Typically just metering. if(priority < 10) { - periodicCmdQueue.prepend(cmd); + periodicCmdQueue.push_front(cmd); } else { - periodicCmdQueue.append(cmd); + periodicCmdQueue.push_back(cmd); } } @@ -2647,9 +2657,9 @@ void wfmain::insertSlowPeriodicCommand(cmds cmd, unsigned char priority) // Basically 20 times less often than the standard peridic command if(priority < 10) { - slowPollCmdQueue.prepend(cmd); + slowPollCmdQueue.push_front(cmd); } else { - slowPollCmdQueue.append(cmd); + slowPollCmdQueue.push_back(cmd); } } @@ -4503,7 +4513,7 @@ void wfmain::powerRigOn() void wfmain::powerRigOff() { delayedCommand->stop(); - cmdOutQue.clear(); + delayedCmdQue.clear(); emit sendPowerOff(); } diff --git a/wfmain.h b/wfmain.h index c63129e..198a176 100644 --- a/wfmain.h +++ b/wfmain.h @@ -29,6 +29,8 @@ #include #include +#include + namespace Ui { class wfmain; } @@ -586,9 +588,9 @@ private: cmdGetTone, cmdGetTSQL, cmdGetDTCS, cmdGetRptAccessMode, cmdGetPreamp, cmdGetAttenuator, cmdGetAntenna}; cmds cmdOut; - QVector cmdOutQue; - QVector periodicCmdQueue; - QVector slowPollCmdQueue; + std::deque delayedCmdQue; + std::deque periodicCmdQueue; + std::deque slowPollCmdQueue; void doCmd(cmds cmd); int pCmdNum = 0; int delayedCmdIntervalLAN_ms = 100; From 5ef6afe58c0de8933b3b9ada2eac279c31fad3cc Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Mon, 21 Jun 2021 00:41:10 -0700 Subject: [PATCH 26/43] Removed unused variable and related comments. --- wfmain.cpp | 18 ++++++------------ wfmain.h | 1 - 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index 360e0d6..d820b4d 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -2399,10 +2399,8 @@ void wfmain::sendRadioCommandLoop() if(!(loopTickCounter % 2)) { // if ther's a command waiting, run it. - //if(!cmdOutQue.isEmpty()) if(!delayedCmdQue.empty()) { - //cmds cmd = cmdOutQue.takeFirst(); cmds cmd = delayedCmdQue.front(); delayedCmdQue.pop_front(); doCmd(cmd); @@ -2433,7 +2431,6 @@ void wfmain::sendRadioCommandLoop() void wfmain::issueDelayedCommand(cmds cmd) { // Append to end of command queue - //cmdOutQue.append(cmd); delayedCmdQue.push_back(cmd); } @@ -2441,7 +2438,6 @@ void wfmain::issueDelayedCommandPriority(cmds cmd) { // Places the new command at the top of the queue // Use only when needed. - //cmdOutQue.prepend(cmd); delayedCmdQue.push_front(cmd); } @@ -2449,14 +2445,12 @@ void wfmain::issueDelayedCommandUnique(cmds cmd) { // Use this function to insert commands where // multiple (redundant) commands don't make sense. -// if(!cmdOutQue.contains(cmd)) -// { -// cmdOutQue.prepend(cmd); - if( std::find(delayedCmdQue.begin(), delayedCmdQue.end(), cmd ) == delayedCmdQue.end()) - { - delayedCmdQue.push_front(cmd); - } - //} + + if( std::find(delayedCmdQue.begin(), delayedCmdQue.end(), cmd ) == delayedCmdQue.end()) + { + delayedCmdQue.push_front(cmd); + } + } void wfmain::receiveRigID(rigCapabilities rigCaps) diff --git a/wfmain.h b/wfmain.h index 198a176..5be229f 100644 --- a/wfmain.h +++ b/wfmain.h @@ -587,7 +587,6 @@ private: cmdGetVdMeter, cmdGetIdMeter, cmdGetSMeter, cmdGetPowerMeter, cmdGetALCMeter, cmdGetCompMeter, cmdGetTxRxMeter, cmdGetTone, cmdGetTSQL, cmdGetDTCS, cmdGetRptAccessMode, cmdGetPreamp, cmdGetAttenuator, cmdGetAntenna}; - cmds cmdOut; std::deque delayedCmdQue; std::deque periodicCmdQueue; std::deque slowPollCmdQueue; From d819c6c93119e654a4c82ec1d756cfef7ae04447 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Mon, 21 Jun 2021 10:49:22 -0700 Subject: [PATCH 27/43] Added polling button --- wfmain.cpp | 24 +++++++++++++++--------- wfmain.h | 2 ++ wfmain.ui | 18 +++++++++++++++++- 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index d820b4d..4fac1aa 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -4702,18 +4702,24 @@ void wfmain::on_wfLengthSlider_valueChanged(int value) prepareWf(value); } +void wfmain::on_pollingBtn_clicked() +{ + bool ok; + int timing = 0; + timing = QInputDialog::getInt(this, "wfview Radio Polling Setup", "Poll Timing Interval (ms)", delayedCommand->interval(), 1, 200, 1, &ok ); + + if(ok && timing) + { + delayedCommand->setInterval( timing ); + qInfo(logSystem()) << "User changed radio polling interval to " << timing << "ms."; + showStatusBarText("User changed radio polling interval to " + QString("%1").arg(timing) + "ms."); + } +} + // --- DEBUG FUNCTION --- void wfmain::on_debugBtn_clicked() { qInfo(logSystem()) << "Debug button pressed."; emit getFrequency(); - bool ok; - int timing = 0; - timing = QInputDialog::getInt(this, "Title", "Poll Timing Interval (ms)", delayedCommand->interval(), 5, 100, 1, &ok ); - - if(ok && timing) - { - delayedCommand->setInterval( timing ); - qInfo(logSystem()) << "Setting delayed command timing to: " << timing << "ms."; - } } + diff --git a/wfmain.h b/wfmain.h index 5be229f..3c50f73 100644 --- a/wfmain.h +++ b/wfmain.h @@ -450,6 +450,8 @@ private slots: void on_wfLengthSlider_valueChanged(int value); + void on_pollingBtn_clicked(); + private: Ui::wfmain *ui; void closeEvent(QCloseEvent *event); diff --git a/wfmain.ui b/wfmain.ui index e9b4a27..5a81b1b 100644 --- a/wfmain.ui +++ b/wfmain.ui @@ -18,7 +18,7 @@ - 0 + 3 @@ -2612,6 +2612,22 @@ + + + + Set up radio polling. The radio's meter is polled every-other interval. + + + Polling + + + + + + Polling + + + From d4335e100285193fe1a0ddc0dc7a7a4563098abb Mon Sep 17 00:00:00 2001 From: Roeland Jansen Date: Tue, 22 Jun 2021 16:16:15 +0200 Subject: [PATCH 28/43] WHATSNEW --- WHATSNEW | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WHATSNEW b/WHATSNEW index 232b9e9..898e8c1 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -10,4 +10,5 @@ The following highlights are in this dot-release: seamless changing rigs without restart started support for older rigs like the 718 wf display disappears when there is no wf capable rig - IC R8600 support improved + IC R8600 support improved + for older rigs added a polling timing box to keep stuff keeping smooth From 241f0db2c3969d9863d466f20a7f967110f8d644 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Thu, 24 Jun 2021 12:40:23 -0700 Subject: [PATCH 29/43] Quick hack for WFM --- rigcommander.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rigcommander.cpp b/rigcommander.cpp index 9e8efca..896a227 100644 --- a/rigcommander.cpp +++ b/rigcommander.cpp @@ -683,7 +683,12 @@ void rigCommander::setMode(unsigned char mode, unsigned char modeFilter) { payload.append("\x01"); // "normal" on IC-706 } else { - payload.append(modeFilter); + if(mode == 0x06) + { + payload.append(0x01); + } else { + payload.append(modeFilter); + } } prepDataAndSend(payload); From 301b48cb0264f7a63640f71180ec42d7af451175 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Fri, 25 Jun 2021 01:24:21 -0700 Subject: [PATCH 30/43] Initial queued "set" command commit. Only the frequency set command is used so far, and only for the "Frequency" tab and the tuning knob. --- freqmemory.h | 1 + wfmain.cpp | 91 ++++++++++++++++++++++++++++++++++++++++++++++------ wfmain.h | 18 ++++++++--- 3 files changed, 96 insertions(+), 14 deletions(-) diff --git a/freqmemory.h b/freqmemory.h index b803f4a..96d3c6b 100644 --- a/freqmemory.h +++ b/freqmemory.h @@ -37,6 +37,7 @@ enum mode_kind { struct mode_info { mode_kind mk; unsigned char reg; + unsigned char filter; QString name; }; diff --git a/wfmain.cpp b/wfmain.cpp index 4fac1aa..498edaa 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -2214,6 +2214,33 @@ void wfmain::setPlotTheme(QCustomPlot *plot, bool isDark) } } +void wfmain::doCmd(commandtype cmddata) +{ + cmds cmd = cmddata.cmd; + std::shared_ptr data = cmddata.data; + + switch (cmd) + { + case cmdSetFreq: + { + freqt f = (*std::static_pointer_cast(data)); + emit setFrequency(f); + break; + } + case cmdSetMode: + { + mode_info m = (*std::static_pointer_cast(data)); + emit setMode(m); + break; + } + default: + doCmd(cmd); + break; + } + +} + + void wfmain::doCmd(cmds cmd) { // Use this function to take action upon a command. @@ -2401,9 +2428,9 @@ void wfmain::sendRadioCommandLoop() // if ther's a command waiting, run it. if(!delayedCmdQue.empty()) { - cmds cmd = delayedCmdQue.front(); + commandtype cmddata = delayedCmdQue.front(); delayedCmdQue.pop_front(); - doCmd(cmd); + doCmd(cmddata); } else if(!(loopTickCounter % 10)) { // pick from useful queries to make now and then @@ -2431,14 +2458,20 @@ void wfmain::sendRadioCommandLoop() void wfmain::issueDelayedCommand(cmds cmd) { // Append to end of command queue - delayedCmdQue.push_back(cmd); + commandtype cmddata; + cmddata.cmd = cmd; + cmddata.data = NULL; + delayedCmdQue.push_back(cmddata); } void wfmain::issueDelayedCommandPriority(cmds cmd) { // Places the new command at the top of the queue // Use only when needed. - delayedCmdQue.push_front(cmd); + commandtype cmddata; + cmddata.cmd = cmd; + cmddata.data = NULL; + delayedCmdQue.push_front(cmddata); } void wfmain::issueDelayedCommandUnique(cmds cmd) @@ -2446,13 +2479,46 @@ void wfmain::issueDelayedCommandUnique(cmds cmd) // Use this function to insert commands where // multiple (redundant) commands don't make sense. - if( std::find(delayedCmdQue.begin(), delayedCmdQue.end(), cmd ) == delayedCmdQue.end()) + commandtype cmddata; + cmddata.cmd = cmd; + cmddata.data = NULL; + + // The following is both expensive and not that great, + // since it does not check if the arguments are the same. + bool found = false; + for(unsigned int i=0; i < delayedCmdQue.size(); i++) { - delayedCmdQue.push_front(cmd); + if(delayedCmdQue.at(i).cmd == cmd) + { + found = true; + break; + } } + if(!found) + { + delayedCmdQue.push_front(cmddata); + } + +// if( std::find(delayedCmdQue.begin(), delayedCmdQue.end(), cmddata ) == delayedCmdQue.end()) +// { +// delayedCmdQue.push_front(cmddata); +// } + } +void wfmain::cmdGoToFreq(freqt f) +{ + commandtype cmddata; + cmddata.cmd = cmdSetFreq; + cmddata.data = std::shared_ptr(new freqt()); + *static_cast(cmddata.data.get()) = f; + //static_cast(cmddata.data.get())->Hz = f.Hz; + //static_cast(cmddata.data.get())->MHzDouble = f.MHzDouble; + delayedCmdQue.push_back(cmddata); +} + + void wfmain::receiveRigID(rigCapabilities rigCaps) { // Note: We intentionally request rigID several times @@ -3023,7 +3089,8 @@ void wfmain::on_goFreqBtn_clicked() if(ok) { f.Hz = freq*1E6; - emit setFrequency(f); + //emit setFrequency(f); + cmdGoToFreq(f); issueDelayedCommand(cmdGetFreq); } } else { @@ -3031,7 +3098,8 @@ void wfmain::on_goFreqBtn_clicked() if(ok) { f.Hz = KHz*1E3; - emit setFrequency(f); + cmdGoToFreq(f); + //emit setFrequency(f); issueDelayedCommand(cmdGetFreq); } } @@ -3286,7 +3354,8 @@ void wfmain::on_freqDial_valueChanged(int value) ui->freqLabel->setText(QString("%1").arg(f.MHzDouble, 0, 'f')); - emit setFrequency(f); + //emit setFrequency(f); + cmdGoToFreq(f); } else { ui->freqDial->blockSignals(true); ui->freqDial->setValue(oldFreqDialVal); @@ -4720,6 +4789,8 @@ void wfmain::on_pollingBtn_clicked() void wfmain::on_debugBtn_clicked() { qInfo(logSystem()) << "Debug button pressed."; - emit getFrequency(); + freqt f; + f.Hz = 14290000; + cmdGoToFreq(f); } diff --git a/wfmain.h b/wfmain.h index 3c50f73..dbeb95c 100644 --- a/wfmain.h +++ b/wfmain.h @@ -30,6 +30,7 @@ #include #include +#include namespace Ui { class wfmain; @@ -58,6 +59,7 @@ signals: void setFrequency(freqt freq); void getMode(); void setMode(unsigned char modeIndex, unsigned char modeFilter); + void setMode(mode_info); void setDataMode(bool dataOn, unsigned char filter); void getDataMode(); void getModInput(bool dataOn); @@ -580,7 +582,7 @@ private: unsigned char setModeVal=0; unsigned char setFilterVal=0; - enum cmds {cmdNone, cmdGetRigID, cmdGetRigCIV, cmdGetFreq, cmdGetMode, cmdGetDataMode, cmdSetModeFilter, + enum cmds {cmdNone, cmdGetRigID, cmdGetRigCIV, cmdGetFreq, cmdSetFreq, cmdGetMode, cmdSetMode, cmdGetDataMode, cmdSetModeFilter, cmdSetDataModeOn, cmdSetDataModeOff, cmdGetRitEnabled, cmdGetRitValue, cmdSpecOn, cmdSpecOff, cmdDispEnable, cmdDispDisable, cmdGetRxGain, cmdGetAfGain, cmdGetSql, cmdGetATUStatus, cmdGetSpectrumMode, cmdGetSpectrumSpan, cmdScopeCenterMode, cmdScopeFixedMode, cmdGetPTT, @@ -589,10 +591,18 @@ private: cmdGetVdMeter, cmdGetIdMeter, cmdGetSMeter, cmdGetPowerMeter, cmdGetALCMeter, cmdGetCompMeter, cmdGetTxRxMeter, cmdGetTone, cmdGetTSQL, cmdGetDTCS, cmdGetRptAccessMode, cmdGetPreamp, cmdGetAttenuator, cmdGetAntenna}; - std::deque delayedCmdQue; - std::deque periodicCmdQueue; - std::deque slowPollCmdQueue; + struct commandtype { + cmds cmd; + std::shared_ptr data; + }; + + std::deque delayedCmdQue; // rapid que for commands to the radio + std::deque periodicCmdQueue; // rapid que for metering + std::deque slowPollCmdQueue; // slow, regular checking for UI sync void doCmd(cmds cmd); + void doCmd(commandtype cmddata); + void cmdGoToFreq(freqt f); + int pCmdNum = 0; int delayedCmdIntervalLAN_ms = 100; int delayedCmdIntervalSerial_ms = 100; From 3553f3cc64ee3e8fbe18726d897be4ee583f7493 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Fri, 25 Jun 2021 02:31:18 -0700 Subject: [PATCH 31/43] Changed how commands with parameter data are added. --- wfmain.cpp | 58 ++++++++++++++++++++++++++++++++++++++++++++---------- wfmain.h | 9 +++++++-- 2 files changed, 55 insertions(+), 12 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index 498edaa..3805a62 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -2233,6 +2233,12 @@ void wfmain::doCmd(commandtype cmddata) emit setMode(m); break; } + case cmdSetTxPower: + { + unsigned char txpower = (*std::static_pointer_cast(data)); + emit setTxPower(txpower); + break; + } default: doCmd(cmd); break; @@ -2507,17 +2513,47 @@ void wfmain::issueDelayedCommandUnique(cmds cmd) } -void wfmain::cmdGoToFreq(freqt f) +void wfmain::issueCmd(cmds cmd, mode_info m) { commandtype cmddata; - cmddata.cmd = cmdSetFreq; - cmddata.data = std::shared_ptr(new freqt()); - *static_cast(cmddata.data.get()) = f; - //static_cast(cmddata.data.get())->Hz = f.Hz; - //static_cast(cmddata.data.get())->MHzDouble = f.MHzDouble; + cmddata.cmd = cmd; + cmddata.data = std::shared_ptr(new mode_info(m)); + //*static_cast(cmddata.data.get()) = mode; delayedCmdQue.push_back(cmddata); } +void wfmain::issueCmd(cmds cmd, char c) +{ + commandtype cmddata; + cmddata.cmd = cmd; + cmddata.data = std::shared_ptr(new char(c)); + delayedCmdQue.push_back(cmddata); +} + +void wfmain::issueCmd(cmds cmd, bool b) +{ + commandtype cmddata; + cmddata.cmd = cmd; + cmddata.data = std::shared_ptr(new bool(b)); + delayedCmdQue.push_back(cmddata); +} + +void wfmain::issueCmd(cmds cmd, unsigned char c) +{ + commandtype cmddata; + cmddata.cmd = cmd; + cmddata.data = std::shared_ptr(new unsigned char(c)); + delayedCmdQue.push_back(cmddata); +} + +void wfmain::issueCmd(cmds cmd, freqt f) +{ + commandtype cmddata; + cmddata.cmd = cmd; + cmddata.data = std::shared_ptr(new freqt(f)); + //*static_cast(cmddata.data.get()) = f; + delayedCmdQue.push_back(cmddata); +} void wfmain::receiveRigID(rigCapabilities rigCaps) { @@ -3090,7 +3126,8 @@ void wfmain::on_goFreqBtn_clicked() { f.Hz = freq*1E6; //emit setFrequency(f); - cmdGoToFreq(f); + issueCmd(cmdSetFreq, f); + //issueCmdSetFreq(f); issueDelayedCommand(cmdGetFreq); } } else { @@ -3098,8 +3135,9 @@ void wfmain::on_goFreqBtn_clicked() if(ok) { f.Hz = KHz*1E3; - cmdGoToFreq(f); + //issueCmdSetFreq(f); //emit setFrequency(f); + issueCmd(cmdSetFreq, f); issueDelayedCommand(cmdGetFreq); } } @@ -3355,7 +3393,7 @@ void wfmain::on_freqDial_valueChanged(int value) ui->freqLabel->setText(QString("%1").arg(f.MHzDouble, 0, 'f')); //emit setFrequency(f); - cmdGoToFreq(f); + issueCmd(cmdSetFreq, f); } else { ui->freqDial->blockSignals(true); ui->freqDial->setValue(oldFreqDialVal); @@ -4791,6 +4829,6 @@ void wfmain::on_debugBtn_clicked() qInfo(logSystem()) << "Debug button pressed."; freqt f; f.Hz = 14290000; - cmdGoToFreq(f); + issueCmd(cmdSetFreq, f); } diff --git a/wfmain.h b/wfmain.h index dbeb95c..890411b 100644 --- a/wfmain.h +++ b/wfmain.h @@ -586,7 +586,7 @@ private: cmdSetDataModeOn, cmdSetDataModeOff, cmdGetRitEnabled, cmdGetRitValue, cmdSpecOn, cmdSpecOff, cmdDispEnable, cmdDispDisable, cmdGetRxGain, cmdGetAfGain, cmdGetSql, cmdGetATUStatus, cmdGetSpectrumMode, cmdGetSpectrumSpan, cmdScopeCenterMode, cmdScopeFixedMode, cmdGetPTT, - cmdGetTxPower, cmdGetMicGain, cmdGetSpectrumRefLevel, cmdGetDuplexMode, cmdGetModInput, cmdGetModDataInput, + cmdGetTxPower, cmdSetTxPower, cmdGetMicGain, cmdGetSpectrumRefLevel, cmdGetDuplexMode, cmdGetModInput, cmdGetModDataInput, cmdGetCurrentModLevel, cmdStartRegularPolling, cmdStopRegularPolling, cmdQueNormalSpeed, cmdGetVdMeter, cmdGetIdMeter, cmdGetSMeter, cmdGetPowerMeter, cmdGetALCMeter, cmdGetCompMeter, cmdGetTxRxMeter, cmdGetTone, cmdGetTSQL, cmdGetDTCS, cmdGetRptAccessMode, cmdGetPreamp, cmdGetAttenuator, cmdGetAntenna}; @@ -601,7 +601,12 @@ private: std::deque slowPollCmdQueue; // slow, regular checking for UI sync void doCmd(cmds cmd); void doCmd(commandtype cmddata); - void cmdGoToFreq(freqt f); + + void issueCmd(cmds cmd, freqt f); + void issueCmd(cmds cmd, mode_info m); + void issueCmd(cmds cmd, unsigned char c); + void issueCmd(cmds cmd, char c); + void issueCmd(cmds cmd, bool b); int pCmdNum = 0; int delayedCmdIntervalLAN_ms = 100; From 7df82fc7b709993b93afaae1f9e44320daab536c Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Fri, 25 Jun 2021 15:43:53 -0700 Subject: [PATCH 32/43] Added unique priority insertion methods. --- wfmain.cpp | 168 ++++++++++++++++++++++++++++++++++++++++++----------- wfmain.h | 12 +++- 2 files changed, 144 insertions(+), 36 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index 3805a62..02a2a84 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -1896,7 +1896,8 @@ void wfmain::shortcutMinus() f.MHzDouble = f.Hz / (double)1E6; setUIFreq(); - emit setFrequency(f); + //emit setFrequency(f); + issueCmd(cmdSetFreq, f); issueDelayedCommandUnique(cmdGetFreq); } @@ -1909,7 +1910,8 @@ void wfmain::shortcutPlus() f.MHzDouble = f.Hz / (double)1E6; setUIFreq(); - emit setFrequency(f); + //emit setFrequency(f); + issueCmd(cmdSetFreq, f); issueDelayedCommandUnique(cmdGetFreq); } @@ -1922,7 +1924,8 @@ void wfmain::shortcutShiftMinus() f.MHzDouble = f.Hz / (double)1E6; setUIFreq(); - emit setFrequency(f); + //emit setFrequency(f); + issueCmd(cmdSetFreq, f); issueDelayedCommandUnique(cmdGetFreq); } @@ -1935,7 +1938,8 @@ void wfmain::shortcutShiftPlus() f.MHzDouble = f.Hz / (double)1E6; setUIFreq(); - emit setFrequency(f); + //emit setFrequency(f); + issueCmd(cmdSetFreq, f); issueDelayedCommandUnique(cmdGetFreq); } @@ -1948,7 +1952,8 @@ void wfmain::shortcutControlMinus() f.MHzDouble = f.Hz / (double)1E6; setUIFreq(); - emit setFrequency(f); + //emit setFrequency(f); + issueCmd(cmdSetFreq, f); issueDelayedCommandUnique(cmdGetFreq); } @@ -1961,7 +1966,8 @@ void wfmain::shortcutControlPlus() f.MHzDouble = f.Hz / (double)1E6; setUIFreq(); - emit setFrequency(f); + //emit setFrequency(f); + issueCmd(cmdSetFreq, f); issueDelayedCommandUnique(cmdGetFreq); } @@ -1974,7 +1980,8 @@ void wfmain::shortcutPageUp() f.MHzDouble = f.Hz / (double)1E6; setUIFreq(); - emit setFrequency(f); + //emit setFrequency(f); + issueCmd(cmdSetFreq, f); issueDelayedCommandUnique(cmdGetFreq); } @@ -1987,7 +1994,8 @@ void wfmain::shortcutPageDown() f.MHzDouble = f.Hz / (double)1E6; setUIFreq(); - emit setFrequency(f); + //emit setFrequency(f); + issueCmd(cmdSetFreq, f); issueDelayedCommandUnique(cmdGetFreq); } @@ -2219,6 +2227,8 @@ void wfmain::doCmd(commandtype cmddata) cmds cmd = cmddata.cmd; std::shared_ptr data = cmddata.data; + // This switch is for commands with parameters. + // the "default" for non-parameter commands is to call doCmd(cmd). switch (cmd) { case cmdSetFreq: @@ -2233,12 +2243,49 @@ void wfmain::doCmd(commandtype cmddata) emit setMode(m); break; } + case cmdSetModeFilter: + { + mode_info m = (*std::static_pointer_cast(data)); + emit setMode(m); + break; + } case cmdSetTxPower: { unsigned char txpower = (*std::static_pointer_cast(data)); emit setTxPower(txpower); break; } + case cmdSetMicGain: + { + unsigned char micgain = (*std::static_pointer_cast(data)); + emit setTxPower(micgain); + break; + } + case cmdSetModLevel: + { + unsigned char modlevel = (*std::static_pointer_cast(data)); + rigInput currentIn; + if(usingDataMode) + { + currentIn = currentModDataSrc; + } else { + currentIn = currentModSrc; + } + emit setModLevel(currentIn, modlevel); + break; + } + case cmdSetSql: + { + unsigned char sqlLevel = (*std::static_pointer_cast(data)); + emit setSql(sqlLevel); + break; + } + case cmdSetPTT: + { + bool pttrequest = (*std::static_pointer_cast(data)); + emit setPTT(pttrequest); + break; + } default: doCmd(cmd); break; @@ -2420,6 +2467,7 @@ void wfmain::doCmd(cmds cmd) } break; default: + qInfo(logSystem()) << __PRETTY_FUNCTION__ << "WARNING: Command fell through of type: " << (unsigned int)cmd; break; } } @@ -2522,6 +2570,23 @@ void wfmain::issueCmd(cmds cmd, mode_info m) delayedCmdQue.push_back(cmddata); } +void wfmain::issueCmd(cmds cmd, freqt f) +{ + commandtype cmddata; + cmddata.cmd = cmd; + cmddata.data = std::shared_ptr(new freqt(f)); + //*static_cast(cmddata.data.get()) = f; + delayedCmdQue.push_back(cmddata); +} + +void wfmain::issueCmd(cmds cmd, int i) +{ + commandtype cmddata; + cmddata.cmd = cmd; + cmddata.data = std::shared_ptr(new int(i)); + delayedCmdQue.push_back(cmddata); +} + void wfmain::issueCmd(cmds cmd, char c) { commandtype cmddata; @@ -2546,13 +2611,47 @@ void wfmain::issueCmd(cmds cmd, unsigned char c) delayedCmdQue.push_back(cmddata); } -void wfmain::issueCmd(cmds cmd, freqt f) +void wfmain::issueCmdUniquePriority(cmds cmd, unsigned char c) +{ + commandtype cmddata; + cmddata.cmd = cmd; + cmddata.data = std::shared_ptr(new unsigned char(c)); + delayedCmdQue.push_front(cmddata); + removeSimilarCommand(cmd); +} + +void wfmain::issueCmdUniquePriority(cmds cmd, char c) +{ + commandtype cmddata; + cmddata.cmd = cmd; + cmddata.data = std::shared_ptr(new char(c)); + delayedCmdQue.push_front(cmddata); + removeSimilarCommand(cmd); +} + +void wfmain::issueCmdUniquePriority(cmds cmd, freqt f) { commandtype cmddata; cmddata.cmd = cmd; cmddata.data = std::shared_ptr(new freqt(f)); - //*static_cast(cmddata.data.get()) = f; - delayedCmdQue.push_back(cmddata); + delayedCmdQue.push_front(cmddata); + removeSimilarCommand(cmd); +} + +void wfmain::removeSimilarCommand(cmds cmd) +{ + // pop anything out that is of the same kind of command: + // pop anything out that is of the same kind of command: + // Start at 1 since we put one in at zero that we want to keep. + for(unsigned int i=1; i < delayedCmdQue.size(); i++) + { + if(delayedCmdQue.at(i).cmd == cmd) + { + //delayedCmdQue[i].cmd = cmdNone; + delayedCmdQue.erase(delayedCmdQue.begin()+i); + // i -= 1; + } + } } void wfmain::receiveRigID(rigCapabilities rigCaps) @@ -2920,7 +3019,8 @@ void wfmain::handlePlotDoubleClick(QMouseEvent *me) freq.Hz = roundFrequency(freq.Hz, tsWfScrollHz); - emit setFrequency(freq); + //emit setFrequency(freq); + issueCmd(cmdSetFreq, freq); issueDelayedCommand(cmdGetFreq); showStatusBarText(QString("Going to %1 MHz").arg(x)); } @@ -2941,7 +3041,8 @@ void wfmain::handleWFDoubleClick(QMouseEvent *me) freq.Hz = roundFrequency(freq.Hz, tsWfScrollHz); - emit setFrequency(freq); + //emit setFrequency(freq); + issueCmd(cmdSetFreq, freq); issueDelayedCommand(cmdGetFreq); showStatusBarText(QString("Going to %1 MHz").arg(x)); } @@ -2994,7 +3095,8 @@ void wfmain::handleWFScroll(QWheelEvent *we) f.MHzDouble = f.Hz / (double)1E6; freq = f; - emit setFrequency(f); + //emit setFrequency(f); + issueCmdUniquePriority(cmdSetFreq, f); ui->freqLabel->setText(QString("%1").arg(f.MHzDouble, 0, 'f')); issueDelayedCommandUnique(cmdGetFreq); } @@ -3393,7 +3495,7 @@ void wfmain::on_freqDial_valueChanged(int value) ui->freqLabel->setText(QString("%1").arg(f.MHzDouble, 0, 'f')); //emit setFrequency(f); - issueCmd(cmdSetFreq, f); + issueCmdUniquePriority(cmdSetFreq, f); } else { ui->freqDial->blockSignals(true); ui->freqDial->setValue(oldFreqDialVal); @@ -3407,7 +3509,8 @@ void wfmain::receiveBandStackReg(freqt freq, char mode, char filter, bool dataOn // read the band stack and apply by sending out commands qInfo(logSystem()) << __func__ << "BSR received into main: Freq: " << freq.Hz << ", mode: " << (unsigned int)mode << ", filter: " << (unsigned int)filter << ", data mode: " << dataOn; - emit setFrequency(freq); + //emit setFrequency(freq); + issueCmd(cmdSetFreq, freq); setModeVal = (unsigned char) mode; setFilterVal = (unsigned char) filter; @@ -3473,9 +3576,10 @@ void wfmain::on_band4mbtn_clicked() } else { f.Hz = (70.200) * 1E6; } - emit setFrequency(f); - issueDelayedCommandUnique(cmdGetFreq); - ui->tabWidget->setCurrentIndex(0); + issueCmd(cmdSetFreq, f); + //emit setFrequency(f); + issueDelayedCommandUnique(cmdGetFreq); + ui->tabWidget->setCurrentIndex(0); } void wfmain::on_band6mbtn_clicked() @@ -3539,7 +3643,8 @@ void wfmain::on_band60mbtn_clicked() // clutter the UI with 60M channel buttons... freqt f; f.Hz = (5.3305) * 1E6; - emit setFrequency(f); + issueCmd(cmdSetFreq, f); + //emit setFrequency(f); issueDelayedCommandUnique(cmdGetFreq); ui->tabWidget->setCurrentIndex(0); } @@ -3560,7 +3665,8 @@ void wfmain::on_band630mbtn_clicked() { freqt f; f.Hz = 475 * 1E3; - emit setFrequency(f); + //emit setFrequency(f); + issueCmd(cmdSetFreq, f); issueDelayedCommandUnique(cmdGetFreq); ui->tabWidget->setCurrentIndex(0); } @@ -3569,7 +3675,8 @@ void wfmain::on_band2200mbtn_clicked() { freqt f; f.Hz = 136 * 1E3; - emit setFrequency(f); + //emit setFrequency(f); + issueCmd(cmdSetFreq, f); issueDelayedCommandUnique(cmdGetFreq); ui->tabWidget->setCurrentIndex(0); } @@ -3985,7 +4092,8 @@ void wfmain::on_udpServerSetupBtn_clicked() } void wfmain::on_sqlSlider_valueChanged(int value) { - emit setSql((unsigned char)value); + issueCmd(cmdSetSql, (unsigned char)value); + //emit setSql((unsigned char)value); } void wfmain::on_modeFilterCombo_activated(int index) @@ -4276,7 +4384,8 @@ void wfmain::receiveAntiVoxGain(unsigned char antiVoxGain) void wfmain::on_txPowerSlider_valueChanged(int value) { - emit setTxPower(value); + issueCmdUniquePriority(cmdSetTxPower, (unsigned char)value); + //emit setTxPower(value); } void wfmain::on_micGainSlider_valueChanged(int value) @@ -4393,16 +4502,7 @@ void wfmain::changeModLabel(rigInput input, bool updateLevel) void wfmain::processChangingCurrentModLevel(unsigned char level) { // slider moved, so find the current mod and issue the level set command. - rigInput currentIn; - if(usingDataMode) - { - currentIn = currentModDataSrc; - } else { - currentIn = currentModSrc; - } - //qInfo(logSystem()) << __func__ << ": setting current level: " << level; - - emit setModLevel(currentIn, level); + issueCmd(cmdSetModLevel, level); } void wfmain::on_tuneLockChk_clicked(bool checked) diff --git a/wfmain.h b/wfmain.h index 890411b..356a94a 100644 --- a/wfmain.h +++ b/wfmain.h @@ -585,8 +585,8 @@ private: enum cmds {cmdNone, cmdGetRigID, cmdGetRigCIV, cmdGetFreq, cmdSetFreq, cmdGetMode, cmdSetMode, cmdGetDataMode, cmdSetModeFilter, cmdSetDataModeOn, cmdSetDataModeOff, cmdGetRitEnabled, cmdGetRitValue, cmdSpecOn, cmdSpecOff, cmdDispEnable, cmdDispDisable, cmdGetRxGain, cmdGetAfGain, - cmdGetSql, cmdGetATUStatus, cmdGetSpectrumMode, cmdGetSpectrumSpan, cmdScopeCenterMode, cmdScopeFixedMode, cmdGetPTT, - cmdGetTxPower, cmdSetTxPower, cmdGetMicGain, cmdGetSpectrumRefLevel, cmdGetDuplexMode, cmdGetModInput, cmdGetModDataInput, + cmdGetSql, cmdSetSql, cmdGetATUStatus, cmdGetSpectrumMode, cmdGetSpectrumSpan, cmdScopeCenterMode, cmdScopeFixedMode, cmdGetPTT, cmdSetPTT, + cmdGetTxPower, cmdSetTxPower, cmdGetMicGain, cmdSetMicGain, cmdSetModLevel, cmdGetSpectrumRefLevel, cmdGetDuplexMode, cmdGetModInput, cmdGetModDataInput, cmdGetCurrentModLevel, cmdStartRegularPolling, cmdStopRegularPolling, cmdQueNormalSpeed, cmdGetVdMeter, cmdGetIdMeter, cmdGetSMeter, cmdGetPowerMeter, cmdGetALCMeter, cmdGetCompMeter, cmdGetTxRxMeter, cmdGetTone, cmdGetTSQL, cmdGetDTCS, cmdGetRptAccessMode, cmdGetPreamp, cmdGetAttenuator, cmdGetAntenna}; @@ -604,10 +604,18 @@ private: void issueCmd(cmds cmd, freqt f); void issueCmd(cmds cmd, mode_info m); + void issueCmd(cmds cmd, int i); void issueCmd(cmds cmd, unsigned char c); void issueCmd(cmds cmd, char c); void issueCmd(cmds cmd, bool b); + // These commands pop_front and remove similar commands: + void issueCmdUniquePriority(cmds cmd, unsigned char c); + void issueCmdUniquePriority(cmds cmd, char c); + void issueCmdUniquePriority(cmds cmd, freqt f); + + void removeSimilarCommand(cmds cmd); + int pCmdNum = 0; int delayedCmdIntervalLAN_ms = 100; int delayedCmdIntervalSerial_ms = 100; From 5ec9a595c9ac7689c30467a2cd1f158ac4dcc902 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Fri, 25 Jun 2021 16:26:13 -0700 Subject: [PATCH 33/43] Added PTT to the queue. --- wfmain.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index 02a2a84..e159fb1 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -3870,7 +3870,7 @@ void wfmain::on_pttOnBtn_clicked() // Are we already PTT? Not a big deal, just send again anyway. showStatusBarText("Sending PTT ON command. Use Control-R to receive."); - emit setPTT(true); + issueCmd(cmdSetPTT, true); // send PTT // Start 3 minute timer pttTimer->start(); @@ -3881,7 +3881,7 @@ void wfmain::on_pttOffBtn_clicked() { // Send the PTT OFF command (more than once?) showStatusBarText("Sending PTT OFF command"); - emit setPTT(false); + issueCmd(cmdSetPTT, false); // Stop the 3 min timer pttTimer->stop(); @@ -3892,7 +3892,7 @@ void wfmain::handlePttLimit() { // transmission time exceeded! showStatusBarText("Transmit timeout at 3 minutes. Sending PTT OFF command now."); - emit setPTT(false); + issueCmd(cmdSetPTT, false); issueDelayedCommand(cmdGetPTT); } @@ -4146,7 +4146,7 @@ void wfmain::on_transmitBtn_clicked() // Are we already PTT? Not a big deal, just send again anyway. showStatusBarText("Sending PTT ON command. Use Control-R to receive."); - emit setPTT(true); + issueCmd(cmdSetPTT, true); // send PTT // Start 3 minute timer pttTimer->start(); @@ -4155,7 +4155,7 @@ void wfmain::on_transmitBtn_clicked() } else { // Currently transmitting - emit setPTT(false); + issueCmd(cmdSetPTT, false); pttTimer->stop(); issueDelayedCommandPriority(cmdGetPTT); } From 95b31104f5c37227168f31dc67581d9611f4c1aa Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Fri, 25 Jun 2021 19:47:40 -0700 Subject: [PATCH 34/43] Faster PTT --- wfmain.cpp | 53 +++++++++++++++++++++++++++++++++++++++++------------ wfmain.h | 5 +++-- 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index e159fb1..44cec2e 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -2261,6 +2261,12 @@ void wfmain::doCmd(commandtype cmddata) emit setTxPower(micgain); break; } + case cmdSetRxRfGain: + { + unsigned char rfgain = (*std::static_pointer_cast(data)); + emit setRfGain(rfgain); + break; + } case cmdSetModLevel: { unsigned char modlevel = (*std::static_pointer_cast(data)); @@ -2274,6 +2280,12 @@ void wfmain::doCmd(commandtype cmddata) emit setModLevel(currentIn, modlevel); break; } + case cmdSetAfGain: + { + unsigned char afgain = (*std::static_pointer_cast(data)); + emit setAfGain(afgain); + break; + } case cmdSetSql: { unsigned char sqlLevel = (*std::static_pointer_cast(data)); @@ -2286,6 +2298,12 @@ void wfmain::doCmd(commandtype cmddata) emit setPTT(pttrequest); break; } + case cmdSetATU: + { + bool atuOn = (*std::static_pointer_cast(data)); + emit setATU(atuOn); + break; + } default: doCmd(cmd); break; @@ -2403,6 +2421,9 @@ void wfmain::doCmd(cmds cmd) case cmdGetATUStatus: emit getATUStatus(); break; + case cmdStartATU: + emit startATU(); + break; case cmdGetAttenuator: emit getAttenuator(); break; @@ -2611,6 +2632,15 @@ void wfmain::issueCmd(cmds cmd, unsigned char c) delayedCmdQue.push_back(cmddata); } +void wfmain::issueCmdUniquePriority(cmds cmd, bool b) +{ + commandtype cmddata; + cmddata.cmd = cmd; + cmddata.data = std::shared_ptr(new bool(b)); + delayedCmdQue.push_front(cmddata); + removeSimilarCommand(cmd); +} + void wfmain::issueCmdUniquePriority(cmds cmd, unsigned char c) { commandtype cmddata; @@ -3804,13 +3834,12 @@ void wfmain::on_fRclBtn_clicked() void wfmain::on_rfGainSlider_valueChanged(int value) { - emit setRfGain((unsigned char) value); + issueCmdUniquePriority(cmdSetRxRfGain, (unsigned char) value); } void wfmain::on_afGainSlider_valueChanged(int value) { - // qInfo(logSystem()) << "Setting AF gain to " << value; - emit setAfGain((unsigned char)value); + issueCmdUniquePriority(cmdSetAfGain, (unsigned char)value); } void wfmain::receiveRfGain(unsigned char level) @@ -3836,14 +3865,14 @@ void wfmain::receiveSql(unsigned char level) void wfmain::on_tuneNowBtn_clicked() { - emit startATU(); + issueDelayedCommand(cmdStartATU); showStatusBarText("Starting ATU tuning cycle..."); issueDelayedCommand(cmdGetATUStatus); } void wfmain::on_tuneEnableChk_clicked(bool checked) { - emit setATU(checked); + issueCmd(cmdSetATU, checked); if(checked) { showStatusBarText("Turning on ATU"); @@ -3870,7 +3899,7 @@ void wfmain::on_pttOnBtn_clicked() // Are we already PTT? Not a big deal, just send again anyway. showStatusBarText("Sending PTT ON command. Use Control-R to receive."); - issueCmd(cmdSetPTT, true); + issueCmdUniquePriority(cmdSetPTT, true); // send PTT // Start 3 minute timer pttTimer->start(); @@ -3881,7 +3910,7 @@ void wfmain::on_pttOffBtn_clicked() { // Send the PTT OFF command (more than once?) showStatusBarText("Sending PTT OFF command"); - issueCmd(cmdSetPTT, false); + issueCmdUniquePriority(cmdSetPTT, false); // Stop the 3 min timer pttTimer->stop(); @@ -3892,7 +3921,7 @@ void wfmain::handlePttLimit() { // transmission time exceeded! showStatusBarText("Transmit timeout at 3 minutes. Sending PTT OFF command now."); - issueCmd(cmdSetPTT, false); + issueCmdUniquePriority(cmdSetPTT, false); issueDelayedCommand(cmdGetPTT); } @@ -4146,18 +4175,18 @@ void wfmain::on_transmitBtn_clicked() // Are we already PTT? Not a big deal, just send again anyway. showStatusBarText("Sending PTT ON command. Use Control-R to receive."); - issueCmd(cmdSetPTT, true); + issueCmdUniquePriority(cmdSetPTT, true); // send PTT // Start 3 minute timer pttTimer->start(); - issueDelayedCommandPriority(cmdGetPTT); + issueDelayedCommand(cmdGetPTT); //changeTxBtn(); } else { // Currently transmitting - issueCmd(cmdSetPTT, false); + issueCmdUniquePriority(cmdSetPTT, false); pttTimer->stop(); - issueDelayedCommandPriority(cmdGetPTT); + issueDelayedCommand(cmdGetPTT); } } diff --git a/wfmain.h b/wfmain.h index 356a94a..cd5fbce 100644 --- a/wfmain.h +++ b/wfmain.h @@ -584,8 +584,8 @@ private: enum cmds {cmdNone, cmdGetRigID, cmdGetRigCIV, cmdGetFreq, cmdSetFreq, cmdGetMode, cmdSetMode, cmdGetDataMode, cmdSetModeFilter, cmdSetDataModeOn, cmdSetDataModeOff, cmdGetRitEnabled, cmdGetRitValue, - cmdSpecOn, cmdSpecOff, cmdDispEnable, cmdDispDisable, cmdGetRxGain, cmdGetAfGain, - cmdGetSql, cmdSetSql, cmdGetATUStatus, cmdGetSpectrumMode, cmdGetSpectrumSpan, cmdScopeCenterMode, cmdScopeFixedMode, cmdGetPTT, cmdSetPTT, + cmdSpecOn, cmdSpecOff, cmdDispEnable, cmdDispDisable, cmdGetRxGain, cmdSetRxRfGain, cmdGetAfGain, cmdSetAfGain, + cmdGetSql, cmdSetSql, cmdGetATUStatus, cmdSetATU, cmdStartATU, cmdGetSpectrumMode, cmdGetSpectrumSpan, cmdScopeCenterMode, cmdScopeFixedMode, cmdGetPTT, cmdSetPTT, cmdGetTxPower, cmdSetTxPower, cmdGetMicGain, cmdSetMicGain, cmdSetModLevel, cmdGetSpectrumRefLevel, cmdGetDuplexMode, cmdGetModInput, cmdGetModDataInput, cmdGetCurrentModLevel, cmdStartRegularPolling, cmdStopRegularPolling, cmdQueNormalSpeed, cmdGetVdMeter, cmdGetIdMeter, cmdGetSMeter, cmdGetPowerMeter, cmdGetALCMeter, cmdGetCompMeter, cmdGetTxRxMeter, @@ -610,6 +610,7 @@ private: void issueCmd(cmds cmd, bool b); // These commands pop_front and remove similar commands: + void issueCmdUniquePriority(cmds cmd, bool b); void issueCmdUniquePriority(cmds cmd, unsigned char c); void issueCmdUniquePriority(cmds cmd, char c); void issueCmdUniquePriority(cmds cmd, freqt f); From df6a0fbc33180dc755a528a39a5c524183288d1f Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Fri, 25 Jun 2021 23:56:19 -0700 Subject: [PATCH 35/43] Mode changes from the combo box now use the que. There are still other methods to change mode which will transition shortly. --- rigcommander.cpp | 22 ++++++++++++++++++++++ rigcommander.h | 1 + wfmain.cpp | 25 +++++++++++++++++++++---- wfmain.h | 2 ++ 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/rigcommander.cpp b/rigcommander.cpp index 896a227..ec2acf9 100644 --- a/rigcommander.cpp +++ b/rigcommander.cpp @@ -665,6 +665,28 @@ void rigCommander::setRitValue(int ritValue) prepDataAndSend(payload); } +void rigCommander::setMode(mode_info m) +{ + QByteArray payload; + + if(rigCaps.model==model706) + { + m.filter = '\x01'; + } + if(m.mk == modeWFM) + { + m.filter = '\x01'; + } + + payload.setRawData("\x06", 1); + payload.append(m.reg); + payload.append(m.filter); + + prepDataAndSend(payload); + rigState.mode = m.reg; + rigState.filter = m.filter; +} + void rigCommander::setMode(unsigned char mode, unsigned char modeFilter) { QByteArray payload; diff --git a/rigcommander.h b/rigcommander.h index ef01a54..d073484 100644 --- a/rigcommander.h +++ b/rigcommander.h @@ -119,6 +119,7 @@ public slots: void setFrequency(freqt freq); void getFrequency(); void setMode(unsigned char mode, unsigned char modeFilter); + void setMode(mode_info); void getMode(); void setDataMode(bool dataOn, unsigned char filter); void getDataMode(); diff --git a/wfmain.cpp b/wfmain.cpp index 44cec2e..49fa115 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -39,6 +39,7 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, const QString s qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); + qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType (); @@ -262,6 +263,7 @@ void wfmain::rigConnections() connect(this, SIGNAL(setScopeFixedEdge(double,double,unsigned char)), rig, SLOT(setSpectrumBounds(double,double,unsigned char))); connect(this, SIGNAL(setMode(unsigned char, unsigned char)), rig, SLOT(setMode(unsigned char, unsigned char))); + connect(this, SIGNAL(setMode(mode_info)), rig, SLOT(setMode(mode_info))); // Levels (read and write) // Levels: Query: @@ -2587,7 +2589,6 @@ void wfmain::issueCmd(cmds cmd, mode_info m) commandtype cmddata; cmddata.cmd = cmd; cmddata.data = std::shared_ptr(new mode_info(m)); - //*static_cast(cmddata.data.get()) = mode; delayedCmdQue.push_back(cmddata); } @@ -3429,17 +3430,35 @@ void wfmain::on_modeSelectCombo_activated(int index) // The "acticvated" signal means the user initiated a mode change. // This function is not called if code initated the change. + mode_info mode; unsigned char newMode = static_cast(ui->modeSelectCombo->itemData(index).toUInt()); currentModeIndex = newMode; + mode.reg = newMode; + int filterSelection = ui->modeFilterCombo->currentData().toInt(); if(filterSelection == 99) { // oops, we forgot to reset the combo box + return; } else { //qInfo(logSystem()) << __func__ << " at index " << index << " has newMode: " << newMode; currentMode = (mode_kind)newMode; - emit setMode(newMode, filterSelection); + mode.filter = filterSelection; + mode.name = ui->modeSelectCombo->currentText(); // for debug + + for(unsigned int i=0; i < rigCaps.modes.size(); i++) + { + if(rigCaps.modes.at(i).reg == newMode) + { + mode.mk = rigCaps.modes.at(i).mk; + break; + } + } + + issueCmd(cmdSetMode, mode); + currentModeInfo = mode; + //emit setMode(newMode, filterSelection); } } @@ -4473,7 +4492,6 @@ void wfmain::on_modInputDataCombo_activated(int index) (void)index; } - void wfmain::changeModLabelAndSlider(rigInput source) { changeModLabel(source, true); @@ -4484,7 +4502,6 @@ void wfmain::changeModLabel(rigInput input) changeModLabel(input, false); } - void wfmain::changeModLabel(rigInput input, bool updateLevel) { QString inputName; diff --git a/wfmain.h b/wfmain.h index cd5fbce..3c3af1e 100644 --- a/wfmain.h +++ b/wfmain.h @@ -721,6 +721,7 @@ private: rigInput currentModSrc = inputUnknown; rigInput currentModDataSrc = inputUnknown; mode_kind currentMode = modeUSB; + mode_info currentModeInfo; bool haveRigCaps; bool amTransmitting; @@ -770,6 +771,7 @@ private: Q_DECLARE_METATYPE(struct rigCapabilities) Q_DECLARE_METATYPE(struct freqt) +Q_DECLARE_METATYPE(struct mode_info) Q_DECLARE_METATYPE(struct udpPreferences) Q_DECLARE_METATYPE(struct rigStateStruct) Q_DECLARE_METATYPE(struct audioPacket) From 74d38e5a8f54d6ad6d7b9d85aa9b8610a268abe8 Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sat, 26 Jun 2021 10:05:00 +0100 Subject: [PATCH 36/43] Add __PRETTY_FUNCTION__ for compilers that don't have it. --- logcategories.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/logcategories.h b/logcategories.h index a76de51..7e7f461 100644 --- a/logcategories.h +++ b/logcategories.h @@ -12,4 +12,8 @@ Q_DECLARE_LOGGING_CATEGORY(logUdp) Q_DECLARE_LOGGING_CATEGORY(logUdpServer) Q_DECLARE_LOGGING_CATEGORY(logRigCtlD) +#if !defined(__PRETTY_FUNCTION__) +#define __PRETTY_FUNCTION__ __FUNCSIG__ +#endif + #endif // LOGCATEGORIES_H From 83f782cf1096c5a7949f608869db968d621a686f Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sat, 26 Jun 2021 10:12:39 +0100 Subject: [PATCH 37/43] Fix for fix of missing __PRETTY_FUNCTION__ --- logcategories.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logcategories.h b/logcategories.h index 7e7f461..172cca1 100644 --- a/logcategories.h +++ b/logcategories.h @@ -12,7 +12,7 @@ Q_DECLARE_LOGGING_CATEGORY(logUdp) Q_DECLARE_LOGGING_CATEGORY(logUdpServer) Q_DECLARE_LOGGING_CATEGORY(logRigCtlD) -#if !defined(__PRETTY_FUNCTION__) +#if defined(Q_OS_WIN) && !defined(__PRETTY_FUNCTION__) #define __PRETTY_FUNCTION__ __FUNCSIG__ #endif From 298a6594433801e5312ba24deb7372242d97270b Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Sat, 26 Jun 2021 10:13:35 +0100 Subject: [PATCH 38/43] Remove unnecessary escape sequence --- wfmain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wfmain.cpp b/wfmain.cpp index 49fa115..543116d 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -4233,7 +4233,7 @@ void wfmain::statusFromSliderRaw(QString name, int rawValue) void wfmain::statusFromSliderPercent(QString name, int rawValue) { - showStatusBarText(name + QString(": %1\%").arg((int)(100*rawValue/255.0))); + showStatusBarText(name + QString(": %1%").arg((int)(100*rawValue/255.0))); } void wfmain::receiveTxPower(unsigned char power) From 3803229b9098a5bb3c0c1a83ee76286d61f0d89e Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Sat, 26 Jun 2021 09:24:58 -0700 Subject: [PATCH 39/43] Duplicate of existing command. --- wfmain.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index 49fa115..d906ea2 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -2245,12 +2245,6 @@ void wfmain::doCmd(commandtype cmddata) emit setMode(m); break; } - case cmdSetModeFilter: - { - mode_info m = (*std::static_pointer_cast(data)); - emit setMode(m); - break; - } case cmdSetTxPower: { unsigned char txpower = (*std::static_pointer_cast(data)); From ff4b945699f20a4ccbda185a4a7ee00df1e474b7 Mon Sep 17 00:00:00 2001 From: Roeland Jansen Date: Tue, 29 Jun 2021 09:36:30 +0200 Subject: [PATCH 40/43] updated changelog --- CHANGELOG | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 6ba44d8..33fdf44 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,8 +1,123 @@ # CHANGELOG +- 20210626 + + Merge branch 'sequence' of gitlab.com:eliggett/wfview into sequence + + Duplicate of existing command. + + Remove unnecessary escape sequence + + Fix for fix of missing __PRETTY_FUNCTION__ + + Add __PRETTY_FUNCTION__ for compilers that don't have it. + +- 20210625 + + Mode changes from the combo box now use the que. There are still other + methods to change mode which will transition shortly. + + Faster PTT + + Added PTT to the queue. + + Added unique priority insertion methods. + + Changed how commands with parameter data are added. + + Initial queued "set" command commit. Only the frequency set command is + used so far, and only for the "Frequency" tab and the tuning knob. + +- 20210624 + + Quick hack for WFM forcing FIL1 always + +- 20210621 + + Added polling button + + Moving to std::deque (double-ended que). + +- 20210620 + + IC-R8600 span is now received into the UI correctly. + + New unified outgoing command queue. Tested on IC-9700 and IC-718 (to + remote wfview server). CPU usage seems higher but please check your + system. + + Timing seems to be acceptable but could probably use some tweaks. + S-meter polling is 25ms for fast radios, and slower rates for slower + radios. Half-duplex serial radios receive 3x slower polling to make room + for replies. + + For Freq, Mode, etc "regular" constant polling (new feature): + + IC-9700 polling is 5 per second, IC-718 is 1-2 per second. + + Just helps keep the UI in sync with changes taking place at the rig. The + polling is slow enough that it doesn't impact anything. But quick enough + that it catches discrepencies pretty quickly. + +- 20210619 + + Added a few more slider things + + whatsnew: improved IC-R8600 + +- 20210618 + + Additional support for the IC-R8600, including wider scope spans. + + Minor change to remove some old debug code that snuck in. + + If no rig caps, then don't mess with the window! + + Added full duplex comms parameter to rigCaps. We assume half-duplex + until we receive a reply to rigID. + + Fixed accidental s-meter timing parameter change. + +- 20210617 + + Radios without spectrum do not show spectrum, and, the window properly + resizes for those controls. Also, a new key command, control-shift-d has + been added to run debug functions from any tab in the program. + +- 20210615 + + Additional code to hide/show spectrum and correcting an issue with the + rig name not populating for non-spectrum radios. + + Dynamic show/hide spectrum for rigs without this feature. + + Additional data corruption checking. + +- 20210614 + + Changed collision detection code so that we can more easily see what + message was missed. + + Added collision detection for serial commands. Collisions are aparently + frequent for true 1-wire CI-V radios. + + We now calculate polling rates immediately upon receiveCommReady for + serial connections. For network connections, we assume sane values and + modify once we receive the baud rate from the server. + + Add Neon (ARM) support to resampler + + Revert to using resampler directory rather than opus-tools submodule + +- 20210612 + + Add tooltip showing percentage of TX power when slider is moved + - 20210611 + adding a second path/way for the qcustomplot link if the first fails + Update udpserver.cpp Use global watchdog rather than per-connection From 82d4862e217b669cb1a824ba6d0ac61bc6b462f0 Mon Sep 17 00:00:00 2001 From: Roeland Jansen Date: Tue, 29 Jun 2021 09:43:51 +0200 Subject: [PATCH 41/43] WHATSNEW - added 718/7100 --- WHATSNEW | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WHATSNEW b/WHATSNEW index 898e8c1..b1fee7e 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -1,7 +1,7 @@ The following highlights are in this dot-release: - added IC7700 + added IC7700, 718, 7100. (more testing needed) fixes and improvements to audio ability to choose between rtaudio and qtmultimedia (default) as compile time option fixes and lots of improvements at the usb-server end From 1563fccf54b3a1995390879c5fd2e69dc2e5f716 Mon Sep 17 00:00:00 2001 From: Roeland Jansen Date: Fri, 2 Jul 2021 13:19:53 +0200 Subject: [PATCH 42/43] fixed small error where the tx latency was not copied in the UI --- wfmain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wfmain.cpp b/wfmain.cpp index 427021a..fca3152 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -1309,7 +1309,7 @@ void wfmain::loadSettings() txSetup.latency = settings->value("AudioTXLatency", "150").toInt(); ui->txLatencySlider->setEnabled(ui->lanEnableBtn->isChecked()); - ui->txLatencySlider->setValue(rxSetup.latency); + ui->txLatencySlider->setValue(txSetup.latency); ui->txLatencySlider->setTracking(false); // Stop it sending value on every change. ui->audioSampleRateCombo->blockSignals(true); From df233d525798b4136aa9f3208c28ab0f4dd9c5db Mon Sep 17 00:00:00 2001 From: Roeland Jansen Date: Fri, 2 Jul 2021 19:30:29 +0200 Subject: [PATCH 43/43] changelog --- CHANGELOG | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 33fdf44..d5f9425 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,8 +1,10 @@ # CHANGELOG +- 20210702 + fixed small error where the tx latency was not copied in the UI + - 20210626 - Merge branch 'sequence' of gitlab.com:eliggett/wfview into sequence Duplicate of existing command. @@ -14,7 +16,6 @@ Add __PRETTY_FUNCTION__ for compilers that don't have it. - 20210625 - Mode changes from the combo box now use the que. There are still other methods to change mode which will transition shortly. @@ -30,11 +31,9 @@ used so far, and only for the "Frequency" tab and the tuning knob. - 20210624 - Quick hack for WFM forcing FIL1 always - 20210621 - Added polling button Moving to std::deque (double-ended que).