From d23ff352ca1a41c68b2ba2379181e3a21f97ae2d Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Fri, 26 Feb 2021 17:11:41 -0800 Subject: [PATCH 1/8] Increased average and peak integration windows to sort of match DIN IEC 60268-10 Type I. --- wfmain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index a284ce4..0ed1eab 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -426,8 +426,8 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent drawPeaks = false; - SMeterReadings.fill(0,10); - powerMeterReadings.fill(0,10); + SMeterReadings.fill(0,30); + powerMeterReadings.fill(0,30); ui->freqMhzLineEdit->setValidator( new QDoubleValidator(0, 100, 6, this)); From c1dc6d3eb7435ed9c37edf9e76f4efea1cc328d2 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Fri, 26 Feb 2021 17:32:06 -0800 Subject: [PATCH 2/8] Fixed issue with tuning steps and scrolling. Note: there are two modifiers for the scrolling steps. By default, scrolling on the WF or plot produces 100 Hz steps. Hold down shift for 10 Hz steps, or hold down control for 1 khz steps. This works well for me tuning in stations I have clicked on but perhaps not clicked accurately. --- wfmain.cpp | 36 +++++++++++++++++++++++++++++------- wfmain.h | 1 + 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index 7fe1f0b..c982be6 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -440,6 +440,9 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent pttTimer->setSingleShot(true); connect(pttTimer, SIGNAL(timeout()), this, SLOT(handlePttLimit())); amTransmitting = false; + ui->tuneLockChk->setChecked(false); + freqLock = false; + // Not needed since we automate this now. /* @@ -1191,6 +1194,7 @@ void wfmain::setTuningSteps() tsPlusShift = 0.0001f; tsPage = 1.0f; tsPageShift = 0.5f; // TODO, unbind this keystroke from the dial + tsWfScroll = 0.0001f; } double wfmain::roundFrequency(double frequency) @@ -2053,36 +2057,54 @@ void wfmain::handleWFScroll(QWheelEvent *we) // We will click the dial once for every 120 received. //QPoint delta = we->angleDelta(); - // TODO: Use other method, knob has too few positions to be useful for large steps. + if(freqLock) + return; + + int clicks = we->angleDelta().y() / 120; + + float steps = tsWfScroll * clicks; - int steps = we->angleDelta().y() / 120; Qt::KeyboardModifiers key= we->modifiers(); if (key == Qt::ShiftModifier) { - steps *=20; + steps /= 10; } else if (key == Qt::ControlModifier) { steps *=10; } - ui->freqDial->setValue( ui->freqDial->value() + (steps)*ui->freqDial->singleStep() ); + freqMhz = roundFrequency(freqMhz - steps); + knobFreqMhz = freqMhz; + emit setFrequency(freqMhz); + ui->freqLabel->setText(QString("%1").arg(freqMhz, 0, 'f')); + issueDelayedCommand(cmdGetFreq); } void wfmain::handlePlotScroll(QWheelEvent *we) { - int steps = we->angleDelta().y() / 120; + if(freqLock) + return; + + int clicks = we->angleDelta().y() / 120; + + float steps = tsWfScroll * clicks; + Qt::KeyboardModifiers key= we->modifiers(); if (key == Qt::ShiftModifier) { - // TODO: Zoom + steps /= 10; } else if (key == Qt::ControlModifier) { steps *=10; } - ui->freqDial->setValue( ui->freqDial->value() + (steps)*ui->freqDial->singleStep() ); + freqMhz = roundFrequency(freqMhz - steps); + knobFreqMhz = freqMhz; + emit setFrequency(freqMhz); + ui->freqLabel->setText(QString("%1").arg(freqMhz, 0, 'f')); + issueDelayedCommand(cmdGetFreq); } void wfmain::on_scopeEnableWFBtn_clicked(bool checked) diff --git a/wfmain.h b/wfmain.h index 0a14587..82108c3 100644 --- a/wfmain.h +++ b/wfmain.h @@ -603,6 +603,7 @@ private: float tsPlusControl; float tsPage; float tsPageShift; + float tsWfScroll; From 0b22ef27ab87729d7baa0224c6bdca5ed8d5613f Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Fri, 26 Feb 2021 20:12:17 -0800 Subject: [PATCH 3/8] Added support for 4 fixed scope edges. Untested. --- rigcommander.cpp | 2 +- wfmain.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rigcommander.cpp b/rigcommander.cpp index d2b7e00..3830be9 100644 --- a/rigcommander.cpp +++ b/rigcommander.cpp @@ -341,7 +341,7 @@ void rigCommander::setScopeEdge(char edge) { // 1 2 or 3 // 27 16 00 0X - if((edge <1) || (edge >3)) + if((edge <1) || (edge >4)) return; QByteArray payload; payload.setRawData("\x27\x16\x00", 3); diff --git a/wfmain.cpp b/wfmain.cpp index c982be6..1d72074 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -255,7 +255,7 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent spans << "50k" << "100k" << "250k" << "500k"; ui->scopeBWCombo->insertItems(0, spans); - edges << "1" << "2" << "3"; // yep + edges << "1" << "2" << "3" << "4"; // yep ui->scopeEdgeCombo->insertItems(0, edges); ui->splitter->setHandleWidth(5); From 8dcda65d1c87650a01d3a8eb645e483c61c8e0d8 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Sat, 27 Feb 2021 00:05:06 -0800 Subject: [PATCH 4/8] More changes for Edge 4 with regards to updated firmware. --- rigcommander.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rigcommander.cpp b/rigcommander.cpp index 3830be9..4d09f4e 100644 --- a/rigcommander.cpp +++ b/rigcommander.cpp @@ -241,7 +241,7 @@ void rigCommander::disableSpectrumDisplay() void rigCommander::setSpectrumBounds(double startFreq, double endFreq, unsigned char edgeNumber) { - if((edgeNumber > 3) || (!edgeNumber)) + if((edgeNumber > 4) || (!edgeNumber)) { return; } @@ -306,7 +306,7 @@ void rigCommander::setSpectrumBounds(double startFreq, double endFreq, unsigned } - QByteArray lowerEdge = makeFreqPayload(startFreq); + QByteArray lowerEdge = makeFreqPayload(startFreq); QByteArray higherEdge = makeFreqPayload(endFreq); From 005b25a63562a04b508ced663d80709f735db379 Mon Sep 17 00:00:00 2001 From: Roeland Jansen Date: Sat, 27 Feb 2021 21:18:26 +0100 Subject: [PATCH 5/8] added 0 to model number in reference command to 7300 --- rigcommander.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rigcommander.cpp b/rigcommander.cpp index 4d09f4e..4ae8bab 100644 --- a/rigcommander.cpp +++ b/rigcommander.cpp @@ -16,7 +16,7 @@ // The IC-7300 "full" manual also contains a command reference. // How to make spectrum display stop using rigctl: -// echo "w \0xFE\0xFE\0x94\0xE0\0x27\0x11\0x00\0xFD" | rigctl -m 373 -r /dev/ttyUSB0 -s 115200 -vvvvv +// echo "w \0xFE\0xFE\0x94\0xE0\0x27\0x11\0x00\0xFD" | rigctl -m 3073 -r /dev/ttyUSB0 -s 115200 -vvvvv // Note: When sending \x00, must use QByteArray.setRawData() From 2bd6231009549bf9083ba142224a9074524d1ffe Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Sat, 27 Feb 2021 13:35:19 -0800 Subject: [PATCH 6/8] Minor fix for combo box resize. This is needed since we dynamically update the combo boxes and don't want to see scroll arrows in the combo box. --- wfmain.ui | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/wfmain.ui b/wfmain.ui index 2307656..0b895b2 100644 --- a/wfmain.ui +++ b/wfmain.ui @@ -18,7 +18,7 @@ - 3 + 0 @@ -63,7 +63,11 @@ - + + + QComboBox::AdjustToContents + + @@ -73,7 +77,11 @@ - + + + QComboBox::AdjustToContents + + @@ -247,6 +255,9 @@ Tuning Step Selection possibly. Or not... + + QComboBox::AdjustToContents + @@ -277,7 +288,11 @@ - + + + QComboBox::AdjustToContents + + @@ -297,7 +312,11 @@ - + + + QComboBox::AdjustToContents + + @@ -1978,7 +1997,7 @@ 0 0 810 - 21 + 22 From c49c4d687bcdaf47b61574e2e166c6df869e7f37 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Sat, 27 Feb 2021 23:47:09 -0800 Subject: [PATCH 7/8] Fixed go to frequency button that didn't properly check results. --- wfmain.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index 1d72074..fc112ee 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -2221,9 +2221,7 @@ void wfmain::on_goFreqBtn_clicked() if(ok) { emit setFrequency(freq); - // TODO: change to cmdQueue - cmdOut = cmdGetFreq; - delayedCommand->start(); + issueDelayedCommand(cmdGetFreq); } ui->freqMhzLineEdit->selectAll(); freqTextSelected = true; From c74d5d448dcdf8b8cc11576f4203de5b0ce3d0ce Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Sun, 28 Feb 2021 00:54:37 -0800 Subject: [PATCH 8/8] Removed some older methods of command que. --- wfmain.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index fc112ee..0d4c247 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -2015,8 +2015,7 @@ void wfmain::handlePlotDoubleClick(QMouseEvent *me) //y = plot->yAxis->pixelToCoord(me->pos().y()); x = plot->xAxis->pixelToCoord(me->pos().x()); emit setFrequency(x); - cmdOut = cmdGetFreq; - delayedCommand->start(); + issueDelayedCommand(cmdGetFreq); showStatusBarText(QString("Going to %1 MHz").arg(x)); } } @@ -2032,8 +2031,7 @@ void wfmain::handleWFDoubleClick(QMouseEvent *me) { x = plot->xAxis->pixelToCoord(me->pos().x()); emit setFrequency(x); - cmdOut = cmdGetFreq; - delayedCommand->start(); + issueDelayedCommand(cmdGetFreq); showStatusBarText(QString("Going to %1 MHz").arg(x)); } }