Stop using sub if command29 not supported

creator-widgets
Phil Taylor 2023-07-23 11:17:10 +01:00
rodzic 4b29c6d45f
commit 8579ec530f
6 zmienionych plików z 104 dodań i 29 usunięć

Wyświetl plik

@ -42,6 +42,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>2200m</string>
</property>
@ -61,6 +64,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>630m</string>
</property>
@ -80,6 +86,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>160m</string>
</property>
@ -102,6 +111,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>80m</string>
</property>
@ -128,6 +140,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>60m</string>
</property>
@ -150,6 +165,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>40m</string>
</property>
@ -172,6 +190,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>30m</string>
</property>
@ -194,6 +215,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>20m</string>
</property>
@ -220,6 +244,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>17m</string>
</property>
@ -242,6 +269,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>15m</string>
</property>
@ -264,6 +294,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>12m</string>
</property>
@ -286,6 +319,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>10m</string>
</property>
@ -312,6 +348,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>6m</string>
</property>
@ -334,6 +373,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>4m</string>
</property>
@ -356,6 +398,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>2m</string>
</property>
@ -378,6 +423,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>70cm</string>
</property>
@ -400,6 +448,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>23cm</string>
</property>
@ -426,6 +477,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>13cm</string>
</property>
@ -445,6 +499,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>6cm</string>
</property>
@ -464,6 +521,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>3cm</string>
</property>
@ -487,6 +547,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>WFM</string>
</property>
@ -509,6 +572,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Air</string>
</property>
@ -531,6 +597,9 @@
<height>128</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Gen</string>
</property>

Wyświetl plik

@ -182,10 +182,13 @@ void cachingQueue::del(funcs func, bool sub)
if (func != funcNone)
{
QMutexLocker locker(&mutex);
auto it(queue.begin());
auto it = std::find_if(queue.begin(), queue.end(), [func,sub](const queueItem& c) { return (c.command == func && c.sub == sub && c.recurring); });
//auto it(queue.begin());
if (it == queue.end())
qInfo() << "recurring command" << funcString[func] << "sub" << sub << "not found in queue";
while (it != queue.end()) {
if (it.value().command == func && it.value().sub == sub) {
qInfo() << "deleting" << funcString[it.value().command] << "sub" << it.value().sub << "recurring" << it.value().recurring;
qInfo() << "deleting" << funcString[it.value().command] << "sub" << it.value().sub << "recurring" << it.value().recurring;
it = queue.erase(it);
}
else

Wyświetl plik

@ -34,6 +34,7 @@
*/
#include <QDebug>
#include "freqctrl.h"
#include "logcategories.h"
// Manual adjustment of Font size as percent of control height
#define DIGIT_SIZE_PERCENT 90

Wyświetl plik

@ -337,6 +337,12 @@ bool rigCommander::getCommand(funcs func, QByteArray &payload, int value, bool s
// This can use cmd29 so add sub/main to the command
payload.append('\x29');
payload.append(static_cast<uchar>(sub));
} else if (!rigCaps.hasCommand29 && sub)
{
// We don't have command29 so can't select sub
qInfo(logRig()) << "Rig has no Command29, removing command:" << funcString[func] << "sub" << sub;
queue->del(func,sub);
return false;
}
payload.append(it.value().data);
return true;
@ -5504,7 +5510,14 @@ modeInfo rigCommander::parseMode(quint8 mode, quint8 filter, bool sub)
qInfo(logRig()) << QString("parseMode() Couldn't find a matching mode %0 with filter %1").arg(mode).arg(filter);
}
cacheItem item = queue->getCache(funcFilterWidth,sub);
// We cannot query sub VFO width without command29.
if (!rigCaps.hasCommand29)
sub = false;
cacheItem item;
if (mi.mk != modeFM)
queue->getCache(funcFilterWidth,sub);
if (item.value.isValid()) {
mi.pass = item.value.toInt();

Wyświetl plik

@ -1103,6 +1103,7 @@ void spectrumScope::receiveMode(modeInfo m)
// Not all rigs send data so this "might" need to be updated independantly?
if (mode.reg != m.reg || m.filter != mode.filter || m.data != mode.data)
{
qInfo(logSystem()) << __func__ << QString("Received new mode for %0: %1 (%2) filter:%3 data:%4")
.arg((sub?"Sub":"Main")).arg(QString::number(m.mk,16)).arg(m.name).arg(m.filter).arg(m.data) ;
@ -1138,45 +1139,36 @@ void spectrumScope::receiveMode(modeInfo m)
// We have changed mode so "may" need to change regular commands
passbandCenterFrequency = 0.0;
// If new mode doesn't allow bandwidth control, disable filterwidth and pbt.
if (m.bw) {
queue->addUnique(priorityHigh,funcPBTInner,true,sub);
queue->addUnique(priorityHigh,funcPBTOuter,true,sub);
queue->addUnique(priorityHigh,funcFilterWidth,true,sub);
} else{
queue->del(funcPBTInner,sub);
queue->del(funcPBTOuter,sub);
queue->del(funcFilterWidth,sub);
}
switch (m.mk) {
case modeLSB:
case modeUSB:
passbandCenterFrequency = 0.0015;
queue->addUnique(priorityHigh,funcPBTInner,true,sub);
queue->addUnique(priorityHigh,funcPBTOuter,true,sub);
queue->addUnique(priorityHigh,funcFilterWidth,true,sub);
queue->del(funcCwPitch,sub);
queue->del(funcDashRatio,sub);
queue->del(funcKeySpeed,sub);
break;
case modeRTTY:
case modeRTTY_R:
case modePSK:
case modePSK_R:
queue->addUnique(priorityHigh,funcPBTInner,true,sub);
queue->addUnique(priorityHigh,funcPBTOuter,true,sub);
queue->addUnique(priorityHigh,funcFilterWidth,true,sub);
case modeAM:
queue->del(funcCwPitch,sub);
queue->del(funcDashRatio,sub);
queue->del(funcKeySpeed,sub);
break;
case modeCW:
case modeCW_R:
queue->addUnique(priorityHigh,funcPBTInner,true,sub);
queue->addUnique(priorityHigh,funcPBTOuter,true,sub);
queue->addUnique(priorityHigh,funcFilterWidth,true,sub);
queue->addUnique(priorityLow,funcCwPitch,true,sub);
queue->addUnique(priorityLow,funcDashRatio,true,sub);
queue->addUnique(priorityLow,funcKeySpeed,true,sub);
break;
case modeAM:
queue->addUnique(priorityHigh,funcPBTInner,true,sub);
queue->addUnique(priorityHigh,funcPBTOuter,true,sub);
queue->addUnique(priorityHigh,funcFilterWidth,true,sub);
queue->del(funcCwPitch,sub);
queue->del(funcDashRatio,sub);
queue->del(funcKeySpeed,sub);
break;
default:
// FM and digital modes are fixed width, not sure about any other modes?
if (mode.filter == 1)
@ -1189,9 +1181,6 @@ void spectrumScope::receiveMode(modeInfo m)
queue->del(funcCwPitch,sub);
queue->del(funcDashRatio,sub);
queue->del(funcKeySpeed,sub);
queue->del(funcPBTInner,sub);
queue->del(funcPBTOuter,sub);
queue->del(funcFilterWidth,sub);
break;
}

Wyświetl plik

@ -4212,8 +4212,8 @@ void wfmain::initPeriodicCommands()
queue->add(priorityMedium,funcSelectedFreq,true,false);
queue->add(priorityMedium,funcSelectedMode,true,false);
//queue->add(priorityMedium,(rigCaps.commands.contains(funcSelectedMode)?funcNone:funcDataModeWithFilter),true,false);
queue->add(priorityMedium,funcUnselectedFreq,true,true);
queue->add(priorityMedium,funcUnselectedMode,true,true);
queue->add(priorityMedium,funcUnselectedFreq,true,false);
queue->add(priorityMedium,funcUnselectedMode,true,false);
if (rigCaps.hasSpectrum)
{