kopia lustrzana https://gitlab.com/eliggett/wfview
Porównaj commity
13 Commity
c9c129ffe3
...
f710913950
Autor | SHA1 | Data |
---|---|---|
Phil Taylor | f710913950 | |
Phil Taylor | de5e00dfcb | |
Phil Taylor | c3a908d4c3 | |
Phil Taylor | f4cad49aee | |
Phil Taylor | 3a63f6ba52 | |
Phil Taylor | 75ba003f1d | |
Phil Taylor | f5ee932500 | |
Phil Taylor | 3ecc0080e6 | |
Phil Taylor | 35c97be0e0 | |
Phil Taylor | ea43618591 | |
Phil Taylor | 291a88d880 | |
Phil Taylor | d643dd036e | |
Phil Taylor | 374affe0d2 |
|
@ -294,6 +294,7 @@ void dxClusterClient::updateSpots()
|
|||
spots.append(s);
|
||||
}
|
||||
#else
|
||||
// Iterate through all available VFO frequency ranges and send all relevant spots.
|
||||
QMap<uchar, rangeValues>::iterator range = freqRanges.begin();
|
||||
while (range != freqRanges.end())
|
||||
{
|
||||
|
|
|
@ -141,7 +141,7 @@ QString debugWindow::getValue(QVariant val)
|
|||
else if(!strcmp(val.typeName(),"scopeData"))
|
||||
{
|
||||
scopeData s = val.value<scopeData>();
|
||||
value = QString("(V:%0) %1").arg(s.mainSub).arg((s.valid?"Valid":"Invalid"));
|
||||
value = QString("(V:%0) %1").arg(s.vfo).arg((s.valid?"Valid":"Invalid"));
|
||||
}
|
||||
else if (!strcmp(val.typeName(),"antennaInfo"))
|
||||
{
|
||||
|
|
|
@ -78,7 +78,7 @@ void loggingWindow::acceptLogText(QPair<QtMsgType,QString> text)
|
|||
{
|
||||
colour = "green";
|
||||
}
|
||||
ui->logTextDisplay->appendHtml(QString("<p><span style='color:%0'>%1</span></p>").arg(colour).arg(text.second));
|
||||
ui->logTextDisplay->appendHtml(QString("<p><span style='color:%0'>%1</span></p>").arg(colour,text.second));
|
||||
if(vertLogScroll->value() == vertLogScroll->maximum())
|
||||
{
|
||||
horizLogScroll->setValue(horizLogScroll->minimum());
|
||||
|
|
|
@ -320,7 +320,7 @@ void rigCommander::prepDataAndSend(QByteArray data)
|
|||
emit dataForComm(data);
|
||||
}
|
||||
|
||||
bool rigCommander::getCommand(funcs func, QByteArray &payload, int value, bool sub)
|
||||
bool rigCommander::getCommand(funcs func, QByteArray &payload, int value, uchar vfo)
|
||||
{
|
||||
// Value is set to INT_MIN by default as this should be outside any "real" values
|
||||
auto it = rigCaps.commands.find(func);
|
||||
|
@ -336,12 +336,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)
|
||||
payload.append(static_cast<uchar>(vfo));
|
||||
} else if (!rigCaps.hasCommand29 && vfo)
|
||||
{
|
||||
// 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);
|
||||
qInfo(logRig()) << "Rig has no Command29, removing command:" << funcString[func] << "VFO" << vfo;
|
||||
queue->del(func,vfo);
|
||||
return false;
|
||||
}
|
||||
payload.append(it.value().data);
|
||||
|
@ -353,8 +353,8 @@ bool rigCommander::getCommand(funcs func, QByteArray &payload, int value, bool s
|
|||
}
|
||||
} else {
|
||||
// Don't try this command again as the rig doesn't support it!
|
||||
qInfo(logRig()) << "Removing unsupported command from queue" << funcString[func] << "sub" << sub;
|
||||
queue->del(func,sub);
|
||||
qInfo(logRig()) << "Removing unsupported command from queue" << funcString[func] << "VFO" << vfo;
|
||||
queue->del(func,vfo);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -704,7 +704,7 @@ void rigCommander::parseCommand()
|
|||
#endif
|
||||
|
||||
funcs func = funcNone;
|
||||
bool sub = false;
|
||||
uchar vfo = 0;
|
||||
|
||||
if (payloadIn.endsWith((char)0xfd))
|
||||
{
|
||||
|
@ -713,7 +713,7 @@ void rigCommander::parseCommand()
|
|||
|
||||
if (rigCaps.hasCommand29 && payloadIn[0] == '\x29')
|
||||
{
|
||||
sub = static_cast<bool>(payloadIn[1]);
|
||||
vfo = static_cast<uchar>(payloadIn[1]);
|
||||
payloadIn.remove(0,2);
|
||||
}
|
||||
|
||||
|
@ -754,7 +754,7 @@ void rigCommander::parseCommand()
|
|||
case funcFreqTR:
|
||||
case funcReadTXFreq:
|
||||
{
|
||||
value.setValue(parseFreqData(payloadIn,sub));
|
||||
value.setValue(parseFreqData(payloadIn,vfo));
|
||||
break;
|
||||
}
|
||||
case funcVFODualWatch:
|
||||
|
@ -765,18 +765,18 @@ void rigCommander::parseCommand()
|
|||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
||||
#endif
|
||||
case funcUnselectedFreq:
|
||||
sub = true;
|
||||
vfo = 1;
|
||||
case funcSelectedFreq:
|
||||
{
|
||||
//qInfo(logRig()) << "Freq len:" << payloadIn.size() << "sub=" << sub << "data:" << payloadIn.toHex(' ');
|
||||
value.setValue(parseFreqData(payloadIn,sub));
|
||||
//qInfo(logRig()) << "Freq len:" << payloadIn.size() << "VFO=" << vfo << "data:" << payloadIn.toHex(' ');
|
||||
value.setValue(parseFreqData(payloadIn,vfo));
|
||||
break;
|
||||
}
|
||||
case funcModeGet:
|
||||
case funcModeTR:
|
||||
{
|
||||
modeInfo m;
|
||||
m = parseMode(payloadIn[0], m.filter,sub);
|
||||
m = parseMode(payloadIn[0], m.filter,vfo);
|
||||
|
||||
if(payloadIn.size() > 1)
|
||||
{
|
||||
|
@ -788,14 +788,14 @@ void rigCommander::parseCommand()
|
|||
break;
|
||||
}
|
||||
case funcUnselectedMode:
|
||||
sub = true;
|
||||
vfo = 1;
|
||||
case funcSelectedMode:
|
||||
{
|
||||
modeInfo m;
|
||||
// New format payload with mode+datamode+filter
|
||||
m = parseMode(bcdHexToUChar(payloadIn[0]), bcdHexToUChar(payloadIn[2]),sub);
|
||||
m = parseMode(bcdHexToUChar(payloadIn[0]), bcdHexToUChar(payloadIn[2]),vfo);
|
||||
m.data = bcdHexToUChar(payloadIn[1]);
|
||||
m.VFO = selVFO_t(sub);
|
||||
m.VFO = selVFO_t(vfo);
|
||||
value.setValue(m);
|
||||
break;
|
||||
}
|
||||
|
@ -831,7 +831,7 @@ void rigCommander::parseCommand()
|
|||
case funcScanning:
|
||||
break;
|
||||
case funcReadFreqOffset:
|
||||
value.setValue(parseFreqData(payloadIn,sub));
|
||||
value.setValue(parseFreqData(payloadIn,vfo));
|
||||
break;
|
||||
// These return a single byte that we convert to a uchar (0-99)
|
||||
case funcTuningStep:
|
||||
|
@ -967,7 +967,7 @@ void rigCommander::parseCommand()
|
|||
if (rigCaps.modelID == 0xAC && bsr.band == 6) {
|
||||
freqLen = 6;
|
||||
}
|
||||
bsr.freq = parseFreqData(payloadIn.mid(2,freqLen),sub);
|
||||
bsr.freq = parseFreqData(payloadIn.mid(2,freqLen),vfo);
|
||||
// The Band Stacking command returns the regCode in the position that VFO is expected.
|
||||
// As BSR is always on the active VFO, just set that.
|
||||
bsr.freq.VFO = selVFO_t::activeVFO;
|
||||
|
@ -984,7 +984,7 @@ void rigCommander::parseCommand()
|
|||
quint16 calc;
|
||||
quint8 pass = bcdHexToUChar((quint8)payloadIn[0]);
|
||||
modeInfo m;
|
||||
m = queue->getCache((sub?funcUnselectedMode:funcSelectedMode),sub).value.value<modeInfo>();
|
||||
m = queue->getCache((vfo?funcUnselectedMode:funcSelectedMode),vfo).value.value<modeInfo>();
|
||||
|
||||
if (m.mk == modeAM)
|
||||
{
|
||||
|
@ -998,16 +998,16 @@ void rigCommander::parseCommand()
|
|||
calc = 600 + ((pass - 10) * 100);
|
||||
}
|
||||
value.setValue(calc);
|
||||
//qInfo() << "Got filter width" << calc << "sub" << sub;
|
||||
//qInfo() << "Got filter width" << calc << "VFO" << vfo;
|
||||
break;
|
||||
}
|
||||
case funcDataModeWithFilter:
|
||||
{
|
||||
modeInfo m;
|
||||
// New format payload with mode+datamode+filter
|
||||
m = parseMode(uchar(payloadIn[0]), uchar(payloadIn[2]),sub);
|
||||
m = parseMode(uchar(payloadIn[0]), uchar(payloadIn[2]),vfo);
|
||||
m.data = uchar(payloadIn[1]);
|
||||
m.VFO = selVFO_t(sub & 0x01);
|
||||
m.VFO = selVFO_t(vfo & 0x01);
|
||||
value.setValue(m);
|
||||
break;
|
||||
}
|
||||
|
@ -1080,7 +1080,7 @@ void rigCommander::parseCommand()
|
|||
case funcScopeMainWaveData:
|
||||
{
|
||||
scopeData d;
|
||||
if (parseSpectrum(d,sub))
|
||||
if (parseSpectrum(d,vfo))
|
||||
value.setValue(d);
|
||||
break;
|
||||
}
|
||||
|
@ -1092,6 +1092,7 @@ void rigCommander::parseCommand()
|
|||
// This tells us whether we are receiving main or sub data
|
||||
case funcScopeSingleDual:
|
||||
// This tells us whether we are receiving single or dual scopes
|
||||
qInfo(logRig()) << "funcScopeSingleDual" << static_cast<bool>(payloadIn[0]);
|
||||
value.setValue(static_cast<bool>(payloadIn[0]));
|
||||
break;
|
||||
#if defined __GNUC__
|
||||
|
@ -1099,7 +1100,7 @@ void rigCommander::parseCommand()
|
|||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
||||
#endif
|
||||
case funcScopeSubMode:
|
||||
sub=true;
|
||||
vfo=1;
|
||||
case funcScopeMainMode:
|
||||
// fixed or center
|
||||
// [1] 0x14
|
||||
|
@ -1108,7 +1109,7 @@ void rigCommander::parseCommand()
|
|||
value.setValue(static_cast<spectrumMode_t>(uchar(payloadIn[0])));
|
||||
break;
|
||||
case funcScopeSubSpan:
|
||||
sub=true;
|
||||
vfo=1;
|
||||
case funcScopeMainSpan:
|
||||
{
|
||||
freqt f = parseFrequency(payloadIn, 3);
|
||||
|
@ -1122,7 +1123,7 @@ void rigCommander::parseCommand()
|
|||
break;
|
||||
}
|
||||
case funcScopeSubEdge:
|
||||
sub=true;
|
||||
vfo=1;
|
||||
case funcScopeMainEdge:
|
||||
// read edge mode center in edge mode
|
||||
// [1] 0x16
|
||||
|
@ -1131,12 +1132,12 @@ void rigCommander::parseCommand()
|
|||
//emit haveScopeEdge((char)payloadIn[2]);
|
||||
break;
|
||||
case funcScopeSubHold:
|
||||
sub=true;
|
||||
vfo=1;
|
||||
case funcScopeMainHold:
|
||||
value.setValue(static_cast<bool>(payloadIn[0]));
|
||||
break;
|
||||
case funcScopeSubRef:
|
||||
sub=true;
|
||||
vfo=1;
|
||||
case funcScopeMainRef:
|
||||
{
|
||||
// scope reference level
|
||||
|
@ -1155,16 +1156,16 @@ void rigCommander::parseCommand()
|
|||
break;
|
||||
}
|
||||
case funcScopeSubSpeed:
|
||||
sub=true;
|
||||
vfo=1;
|
||||
case funcScopeMainSpeed:
|
||||
value.setValue(static_cast<uchar>(payloadIn[0]));
|
||||
break;
|
||||
case funcScopeSubVBW:
|
||||
sub=true;
|
||||
vfo=1;
|
||||
case funcScopeMainVBW:
|
||||
break;
|
||||
case funcScopeSubRBW:
|
||||
sub=true;
|
||||
vfo=1;
|
||||
case funcScopeMainRBW:
|
||||
break;
|
||||
#if defined __GNUC__
|
||||
|
@ -1230,7 +1231,7 @@ void rigCommander::parseCommand()
|
|||
#endif
|
||||
|
||||
if (value.isValid() && queue != Q_NULLPTR) {
|
||||
queue->receiveValue(func,value,sub);
|
||||
queue->receiveValue(func,value,vfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1534,7 +1535,7 @@ void rigCommander::determineRigCaps()
|
|||
}
|
||||
}
|
||||
|
||||
bool rigCommander::parseSpectrum(scopeData& d, bool sub)
|
||||
bool rigCommander::parseSpectrum(scopeData& d, uchar vfo)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
|
@ -1550,7 +1551,7 @@ bool rigCommander::parseSpectrum(scopeData& d, bool sub)
|
|||
return ret;
|
||||
}
|
||||
|
||||
if (sub)
|
||||
if (vfo)
|
||||
d = subScopeData;
|
||||
else
|
||||
d = mainScopeData;
|
||||
|
@ -1590,7 +1591,7 @@ bool rigCommander::parseSpectrum(scopeData& d, bool sub)
|
|||
freqt fStart;
|
||||
freqt fEnd;
|
||||
|
||||
d.mainSub = sub;
|
||||
d.vfo = vfo;
|
||||
unsigned char sequence = bcdHexToUChar(payloadIn[0]);
|
||||
unsigned char sequenceMax = bcdHexToUChar(payloadIn[1]);
|
||||
|
||||
|
@ -1652,9 +1653,9 @@ bool rigCommander::parseSpectrum(scopeData& d, bool sub)
|
|||
d.data.clear();
|
||||
|
||||
// For Fixed, and both scroll modes, the following produces correct information:
|
||||
fStart = parseFreqData(payloadIn.mid(3,freqLen),sub);
|
||||
fStart = parseFreqData(payloadIn.mid(3,freqLen),vfo);
|
||||
d.startFreq = fStart.MHzDouble;
|
||||
fEnd = parseFreqData(payloadIn.mid(3+freqLen,freqLen),sub);
|
||||
fEnd = parseFreqData(payloadIn.mid(3+freqLen,freqLen),vfo);
|
||||
d.endFreq = fEnd.MHzDouble;
|
||||
|
||||
if(d.mode == spectModeCenter)
|
||||
|
@ -1690,7 +1691,7 @@ bool rigCommander::parseSpectrum(scopeData& d, bool sub)
|
|||
|
||||
if (!ret) {
|
||||
// We need to temporarilly store the scope data somewhere.
|
||||
if (sub)
|
||||
if (vfo)
|
||||
subScopeData = d;
|
||||
else
|
||||
mainScopeData = d;
|
||||
|
@ -1925,12 +1926,12 @@ freqt rigCommander::parseFrequency(QByteArray data, unsigned char lastPosition)
|
|||
}
|
||||
|
||||
|
||||
freqt rigCommander::parseFreqData(QByteArray data, bool sub)
|
||||
freqt rigCommander::parseFreqData(QByteArray data, uchar vfo)
|
||||
{
|
||||
freqt freq;
|
||||
freq.Hz = parseFreqDataToInt(data);
|
||||
freq.MHzDouble = freq.Hz/1000000.0;
|
||||
freq.VFO = selVFO_t(sub);
|
||||
freq.VFO = selVFO_t(vfo);
|
||||
return freq;
|
||||
}
|
||||
|
||||
|
@ -1950,7 +1951,7 @@ quint64 rigCommander::parseFreqDataToInt(QByteArray data)
|
|||
}
|
||||
|
||||
|
||||
modeInfo rigCommander::parseMode(quint8 mode, quint8 filter, bool sub)
|
||||
modeInfo rigCommander::parseMode(quint8 mode, quint8 filter, uchar vfo)
|
||||
{
|
||||
modeInfo mi;
|
||||
bool found=false;
|
||||
|
@ -1971,13 +1972,13 @@ modeInfo rigCommander::parseMode(quint8 mode, quint8 filter, bool sub)
|
|||
|
||||
// We cannot query sub VFO width without command29.
|
||||
if (!rigCaps.hasCommand29)
|
||||
sub = false;
|
||||
vfo = 0;
|
||||
|
||||
cacheItem item;
|
||||
|
||||
// Does the current mode support filterwidth?
|
||||
if (mi.bwMin >0 && mi.bwMax > 0) {
|
||||
queue->getCache(funcFilterWidth,sub);
|
||||
queue->getCache(funcFilterWidth,vfo);
|
||||
}
|
||||
|
||||
if (item.value.isValid()) {
|
||||
|
@ -2362,10 +2363,10 @@ quint8* rigCommander::getGUID() {
|
|||
return guid;
|
||||
}
|
||||
|
||||
uchar rigCommander::makeFilterWidth(ushort pass,bool sub)
|
||||
uchar rigCommander::makeFilterWidth(ushort pass,uchar vfo)
|
||||
{
|
||||
unsigned char calc;
|
||||
modeInfo mi = queue->getCache((sub?funcUnselectedMode:funcSelectedMode),sub).value.value<modeInfo>();
|
||||
modeInfo mi = queue->getCache((vfo==1?funcUnselectedMode:funcSelectedMode),vfo).value.value<modeInfo>();
|
||||
if (mi.mk == modeAM) { // AM 0-49
|
||||
|
||||
calc = quint16((pass / 200) - 1);
|
||||
|
@ -2439,8 +2440,8 @@ void rigCommander::receiveCommand(funcs func, QVariant value, uchar vfo)
|
|||
func = funcModeGet;
|
||||
} else if (func == funcSelectVFO) {
|
||||
// Special command
|
||||
vfo_t vfo = value.value<vfo_t>();
|
||||
func = (vfo == vfoA)?funcVFOASelect:(vfo == vfoB)?funcVFOBSelect:(vfo == vfoMain)?funcVFOMainSelect:funcVFOSubSelect;
|
||||
vfo_t v = value.value<vfo_t>();
|
||||
func = (v == vfoA)?funcVFOASelect:(v == vfoB)?funcVFOBSelect:(v == vfoMain)?funcVFOMainSelect:funcVFOSubSelect;
|
||||
value.clear();
|
||||
val = INT_MIN;
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ private:
|
|||
freqt parseFrequency();
|
||||
freqt parseFrequency(QByteArray data, unsigned char lastPosition); // supply index where Mhz is found
|
||||
|
||||
freqt parseFreqData(QByteArray data, bool sub);
|
||||
freqt parseFreqData(QByteArray data, uchar vfo);
|
||||
quint64 parseFreqDataToInt(QByteArray data);
|
||||
freqt parseFrequencyRptOffset(QByteArray data);
|
||||
bool parseMemory(QVector<memParserFormat>* memParser, memoryType* mem);
|
||||
|
@ -151,7 +151,7 @@ private:
|
|||
|
||||
toneInfo decodeTone(QByteArray eTone);
|
||||
//quint16 decodeTone(QByteArray eTone, bool &tinv, bool &rinv);
|
||||
uchar makeFilterWidth(ushort width, bool sub);
|
||||
uchar makeFilterWidth(ushort width, uchar vfo);
|
||||
|
||||
|
||||
unsigned char audioLevelRxMean[50];
|
||||
|
@ -159,9 +159,9 @@ private:
|
|||
unsigned char audioLevelTxMean[50];
|
||||
unsigned char audioLevelTxPeak[50];
|
||||
|
||||
modeInfo parseMode(quint8 mode, quint8 filter, bool sub);
|
||||
bool parseSpectrum(scopeData& d, bool sub);
|
||||
bool getCommand(funcs func, QByteArray& payload, int value=INT_MIN, bool sub=false);
|
||||
modeInfo parseMode(quint8 mode, quint8 filter, uchar vfo);
|
||||
bool parseSpectrum(scopeData& d, uchar vfo);
|
||||
bool getCommand(funcs func, QByteArray& payload, int value=INT_MIN, uchar vfo=0);
|
||||
|
||||
QByteArray getLANAddr();
|
||||
QByteArray getUSBAddr();
|
||||
|
|
376
wfmain.cpp
376
wfmain.cpp
|
@ -967,7 +967,13 @@ void wfmain::setServerToPrefs()
|
|||
|
||||
void wfmain::configureVFOs()
|
||||
{
|
||||
qCritical(logSystem()) << "Running configureVFOs()";
|
||||
qInfo(logSystem()) << "Running configureVFOs()";
|
||||
|
||||
if (QThread::currentThread() != QCoreApplication::instance()->thread())
|
||||
{
|
||||
qCritical(logSystem()) << "Thread is NOT the main UI thread, cannot create VFO";
|
||||
return;
|
||||
}
|
||||
|
||||
if (vfos.size()) {
|
||||
foreach (spectrumScope* vfo, vfos)
|
||||
|
@ -980,38 +986,39 @@ void wfmain::configureVFOs()
|
|||
|
||||
for(uchar i=0;i<rigCaps.numVFO;i++)
|
||||
{
|
||||
qCritical(logSystem()) << "Creating VFO" << i;
|
||||
vfos.append(new spectrumScope(this));
|
||||
vfos.last()->setUnderlayMode(prefs.underlayMode);
|
||||
vfos.last()->wfAntiAliased(prefs.wfAntiAlias);
|
||||
vfos.last()->wfInterpolate(prefs.wfInterpolate);
|
||||
vfos.last()->setScrollSpeedXY(prefs.scopeScrollX, prefs.scopeScrollY);
|
||||
vfos.last()->prepareWf(i==0?prefs.mainWflength:prefs.subWflength);
|
||||
vfos.last()->preparePlasma();
|
||||
vfos.last()->setRange(i==0?prefs.mainPlotFloor:prefs.subPlotFloor,i==0?prefs.mainPlotCeiling:prefs.subPlotCeiling);
|
||||
vfos.last()->wfTheme(i==0?prefs.mainWfTheme:prefs.subWfTheme);
|
||||
vfos.last()->setClickDragTuning(prefs.clickDragTuningEnable);
|
||||
vfos.last()->setTuningFloorZeros(prefs.niceTS);
|
||||
vfos.last()->resizePlasmaBuffer(prefs.underlayBufferSize);
|
||||
vfos.last()->setUnit((FctlUnit)prefs.frequencyUnits);
|
||||
vfos.last()->colorPreset(this->colorPrefs);
|
||||
spectrumScope* vfo = new spectrumScope;
|
||||
|
||||
vfo->setUnderlayMode(prefs.underlayMode);
|
||||
vfo->wfAntiAliased(prefs.wfAntiAlias);
|
||||
vfo->wfInterpolate(prefs.wfInterpolate);
|
||||
vfo->setScrollSpeedXY(prefs.scopeScrollX, prefs.scopeScrollY);
|
||||
vfo->prepareWf(i==0?prefs.mainWflength:prefs.subWflength);
|
||||
vfo->preparePlasma();
|
||||
vfo->setRange(i==0?prefs.mainPlotFloor:prefs.subPlotFloor,i==0?prefs.mainPlotCeiling:prefs.subPlotCeiling);
|
||||
vfo->wfTheme(i==0?prefs.mainWfTheme:prefs.subWfTheme);
|
||||
vfo->setClickDragTuning(prefs.clickDragTuningEnable);
|
||||
vfo->setTuningFloorZeros(prefs.niceTS);
|
||||
vfo->resizePlasmaBuffer(prefs.underlayBufferSize);
|
||||
vfo->setUnit((FctlUnit)prefs.frequencyUnits);
|
||||
vfo->colorPreset(this->colorPrefs);
|
||||
vfo->setIdentity(i==0?"Main Band":"Sub Band",i);
|
||||
ui->vfoLayout->addWidget(vfo);
|
||||
|
||||
// Hide any secondary VFOs until we need them!
|
||||
if (i>0){
|
||||
vfos.last()->setVisible(false);
|
||||
vfo->setVisible(false);
|
||||
}
|
||||
ui->vfoLayout->addWidget(vfos.last());
|
||||
|
||||
connect(vfos.last(), SIGNAL(frequencyRange(uchar, double, double)), cluster, SLOT(freqRange(uchar, double, double)));
|
||||
connect(vfo, SIGNAL(frequencyRange(uchar, double, double)), cluster, SLOT(freqRange(uchar, double, double)));
|
||||
|
||||
connect(cluster, SIGNAL(sendSpots(uchar, QList<spotData>)), vfos.last(), SLOT(receiveSpots(uchar, QList<spotData>)));
|
||||
connect(cluster, SIGNAL(sendSpots(uchar, QList<spotData>)), vfo, SLOT(receiveSpots(uchar, QList<spotData>)));
|
||||
connect(cluster, SIGNAL(sendOutput(QString)), this, SLOT(receiveClusterOutput(QString)));
|
||||
connect(vfos.last(), SIGNAL(updateSettings(uchar,int,quint16,int,int)), this, SLOT(receiveScopeSettings(uchar,int,quint16,int,int)));
|
||||
connect(vfo, SIGNAL(updateSettings(uchar,int,quint16,int,int)), this, SLOT(receiveScopeSettings(uchar,int,quint16,int,int)));
|
||||
|
||||
connect(vfos.last(), SIGNAL(dataChanged(modeInfo)), this, SLOT(dataModeChanged(modeInfo)));
|
||||
vfos.last()->setIdentity(i==0?"Main Band":"Sub Band",i);
|
||||
connect(vfo, SIGNAL(dataChanged(modeInfo)), this, SLOT(dataModeChanged(modeInfo)));
|
||||
|
||||
connect(vfos.last(),SIGNAL(showStatusBarText(QString)),this,SLOT(showStatusBarText(QString)));
|
||||
connect(vfo,SIGNAL(showStatusBarText(QString)),this,SLOT(showStatusBarText(QString)));
|
||||
vfos.append(vfo);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1199,11 +1206,12 @@ void wfmain::setupKeyShortcuts()
|
|||
[=]() {
|
||||
if (freqLock) return;
|
||||
|
||||
freqt f;
|
||||
if (vfos.size())
|
||||
f.Hz = roundFrequencyWithStep(vfos.first()->getFrequency().Hz, -1, tsKnobHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f)));
|
||||
if (vfos.size()) {
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos.first()->getFrequency().Hz, -1, tsKnobHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f)));
|
||||
}
|
||||
});
|
||||
|
||||
// L = Up
|
||||
|
@ -1214,10 +1222,11 @@ void wfmain::setupKeyShortcuts()
|
|||
if (freqLock) return;
|
||||
|
||||
freqt f;
|
||||
if (vfos.size())
|
||||
if (vfos.size()) {
|
||||
f.Hz = roundFrequencyWithStep(vfos.first()->getFrequency().Hz, 1, tsKnobHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f)));
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f)));
|
||||
}
|
||||
});
|
||||
|
||||
keyDebug = new QShortcut(this);
|
||||
|
@ -1461,10 +1470,13 @@ void wfmain::stepDown()
|
|||
void wfmain::changeFrequency(int value) {
|
||||
if (freqLock) return;
|
||||
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, value, tsWfScrollHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
if (vfos.size())
|
||||
{
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, value, tsWfScrollHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::setDefPrefs()
|
||||
|
@ -3221,104 +3233,116 @@ quint64 wfmain::roundFrequencyWithStep(quint64 frequency, int steps, unsigned in
|
|||
void wfmain::shortcutMinus()
|
||||
{
|
||||
if (freqLock) return;
|
||||
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, -1, tsPlusHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
if (vfos.size()) {
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, -1, tsPlusHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::shortcutPlus()
|
||||
{
|
||||
if (freqLock) return;
|
||||
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, 1, tsPlusHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
if (vfos.size()) {
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, 1, tsPlusHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::shortcutStepMinus()
|
||||
{
|
||||
if (freqLock) return;
|
||||
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, -1, ui->tuningStepCombo->currentData().toInt());
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
|
||||
if (vfos.size())
|
||||
{
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, -1, ui->tuningStepCombo->currentData().toInt());
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::shortcutStepPlus()
|
||||
{
|
||||
if (freqLock) return;
|
||||
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, 1, ui->tuningStepCombo->currentData().toInt());
|
||||
if (vfos.size()) {
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, 1, ui->tuningStepCombo->currentData().toInt());
|
||||
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::shortcutShiftMinus()
|
||||
{
|
||||
if(freqLock) return;
|
||||
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, -1, tsPlusShiftHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
if (vfos.size()) {
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, -1, tsPlusShiftHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::shortcutShiftPlus()
|
||||
{
|
||||
if(freqLock) return;
|
||||
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, 1, tsPlusShiftHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
|
||||
if (vfos.size()) {
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, 1, tsPlusShiftHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::shortcutControlMinus()
|
||||
{
|
||||
if(freqLock) return;
|
||||
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, -1, tsPlusControlHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
if (vfos.size()) {
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, -1, tsPlusControlHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::shortcutControlPlus()
|
||||
{
|
||||
if(freqLock) return;
|
||||
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, 1, tsPlusControlHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
if (vfos.size()) {
|
||||
freqt f;
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, 1, tsPlusControlHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::shortcutPageUp()
|
||||
{
|
||||
if(freqLock) return;
|
||||
|
||||
freqt f;
|
||||
f.Hz = vfos[0]->getFrequency().Hz + tsPageHz;
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
if (vfos.size()) {
|
||||
freqt f;
|
||||
f.Hz = vfos[0]->getFrequency().Hz + tsPageHz;
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::shortcutPageDown()
|
||||
{
|
||||
if(freqLock) return;
|
||||
|
||||
freqt f;
|
||||
f.Hz = vfos[0]->getFrequency().Hz - tsPageHz;
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
if (vfos.size()) {
|
||||
freqt f;
|
||||
f.Hz = vfos[0]->getFrequency().Hz - tsPageHz;
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::shortcutF()
|
||||
|
@ -3417,7 +3441,7 @@ void wfmain:: getInitialRigState()
|
|||
queue->add(priorityImmediate,funcMonitorGain,false);
|
||||
|
||||
*/
|
||||
if(rigCaps.hasSpectrum)
|
||||
if(rigCaps.hasSpectrum && vfos.size())
|
||||
{
|
||||
queue->add(priorityImmediate,queueItem(funcScopeOnOff,QVariant::fromValue(quint8(1)),false));
|
||||
queue->add(priorityImmediate,queueItem(funcScopeDataOutput,QVariant::fromValue(quint8(1)),false));
|
||||
|
@ -4061,19 +4085,20 @@ void wfmain::on_freqDial_valueChanged(int value)
|
|||
|
||||
// With the number of steps and direction of steps established,
|
||||
// we can now adjust the frequency:
|
||||
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, delta, tsKnobHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
if (f.Hz > 0)
|
||||
{
|
||||
oldFreqDialVal = value;
|
||||
vfos[0]->setFrequency(f);
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
} else {
|
||||
ui->freqDial->blockSignals(true);
|
||||
ui->freqDial->setValue(oldFreqDialVal);
|
||||
ui->freqDial->blockSignals(false);
|
||||
return;
|
||||
if (vfos.size()) {
|
||||
f.Hz = roundFrequencyWithStep(vfos[0]->getFrequency().Hz, delta, tsKnobHz);
|
||||
f.MHzDouble = f.Hz / (double)1E6;
|
||||
if (f.Hz > 0)
|
||||
{
|
||||
oldFreqDialVal = value;
|
||||
vfos[0]->setFrequency(f);
|
||||
queue->add(priorityImmediate,queueItem(funcSelectedFreq,QVariant::fromValue<freqt>(f),false));
|
||||
} else {
|
||||
ui->freqDial->blockSignals(true);
|
||||
ui->freqDial->setValue(oldFreqDialVal);
|
||||
ui->freqDial->blockSignals(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4106,7 +4131,8 @@ void wfmain::gotoMemoryPreset(int presetNumber)
|
|||
//issueDelayedCommand(cmdSetModeFilter); // goes to setModeVal
|
||||
//issueCmd(cmdSetMode, m);
|
||||
memFreq.MHzDouble = memFreq.Hz / 1.0E6;
|
||||
vfos[0]->setFrequency(memFreq);
|
||||
if (vfos.size())
|
||||
vfos[0]->setFrequency(memFreq);
|
||||
qDebug(logGui()) << "Recalling preset number " << presetNumber << " as frequency " << temp.frequency << "MHz";
|
||||
}
|
||||
|
||||
|
@ -4114,15 +4140,17 @@ void wfmain::saveMemoryPreset(int presetNumber)
|
|||
{
|
||||
// int, double, rigMode_t
|
||||
double frequency;
|
||||
if(vfos[0]->getFrequency().Hz == 0)
|
||||
{
|
||||
frequency = vfos[0]->getFrequency().MHzDouble;
|
||||
} else {
|
||||
frequency = vfos[0]->getFrequency().Hz / 1.0E6;
|
||||
if (vfos.size()) {
|
||||
if(vfos[0]->getFrequency().Hz == 0)
|
||||
{
|
||||
frequency = vfos[0]->getFrequency().MHzDouble;
|
||||
} else {
|
||||
frequency = vfos[0]->getFrequency().Hz / 1.0E6;
|
||||
}
|
||||
rigMode_t mode = currentMode;
|
||||
qDebug(logGui()) << "Saving preset number " << presetNumber << " to frequency " << frequency << " MHz";
|
||||
mem.setPreset(presetNumber, frequency, mode);
|
||||
}
|
||||
rigMode_t mode = currentMode;
|
||||
qDebug(logGui()) << "Saving preset number " << presetNumber << " to frequency " << frequency << " MHz";
|
||||
mem.setPreset(presetNumber, frequency, mode);
|
||||
}
|
||||
|
||||
void wfmain::on_rfGainSlider_valueChanged(int value)
|
||||
|
@ -4418,21 +4446,22 @@ void wfmain::statusFromSliderPercent(QString name, int rawValue)
|
|||
|
||||
void wfmain::processModLevel(inputTypes source, unsigned char level)
|
||||
{
|
||||
unsigned char data = vfos[0]->getDataMode();
|
||||
if (vfos.size()) {
|
||||
unsigned char data = vfos[0]->getDataMode();
|
||||
|
||||
if(prefs.inputSource[data].type == source)
|
||||
{
|
||||
prefs.inputSource[data].level = level;
|
||||
changeSliderQuietly(ui->micGainSlider, level);
|
||||
emit sendLevel(funcLANModLevel,level);
|
||||
if(prefs.inputSource[data].type == source)
|
||||
{
|
||||
prefs.inputSource[data].level = level;
|
||||
changeSliderQuietly(ui->micGainSlider, level);
|
||||
emit sendLevel(funcLANModLevel,level);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void wfmain::receiveModInput(rigInput input, unsigned char data)
|
||||
{
|
||||
// This will ONLY fire if the input type is different to the current one
|
||||
if (currentModSrc[data].type != input.type)
|
||||
if (currentModSrc[data].type != input.type && vfos.size())
|
||||
{
|
||||
qInfo() << QString("Data: %0 Input: %1 current: %2").arg(data).arg(input.name).arg(prefs.inputSource[data].name);
|
||||
queue->del(getInputTypeCommand(prefs.inputSource[data].type),false);
|
||||
|
@ -4463,7 +4492,7 @@ void wfmain::receiveModInput(rigInput input, unsigned char data)
|
|||
void wfmain::receivePassband(quint16 pass)
|
||||
{
|
||||
double pb = (double)(pass / 1000000.0);
|
||||
if (vfos[0]->getPassbandWidth() != pb) {
|
||||
if (vfos.size() && vfos[0]->getPassbandWidth() != pb) {
|
||||
vfos[0]->setPassbandWidth(pb);
|
||||
|
||||
qInfo(logSystem()) << QString("Received new IF Filter/Passband %0 Hz").arg(pass);
|
||||
|
@ -4601,10 +4630,13 @@ void wfmain::processChangingCurrentModLevel(unsigned char level)
|
|||
// slider moved, so find the current mod and issue the level set command.
|
||||
|
||||
funcs f = funcNone;
|
||||
unsigned char d = vfos[0]->getDataMode();
|
||||
f = getInputTypeCommand(prefs.inputSource[d].type);
|
||||
if (vfos.size()) {
|
||||
unsigned char d = vfos[0]->getDataMode();
|
||||
f = getInputTypeCommand(prefs.inputSource[d].type);
|
||||
|
||||
queue->addUnique(priorityImmediate,queueItem(f,QVariant::fromValue<ushort>(level),false));
|
||||
queue->addUnique(priorityImmediate,queueItem(f,QVariant::fromValue<ushort>(level),false));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::on_tuneLockChk_clicked(bool checked)
|
||||
|
@ -5252,6 +5284,11 @@ void wfmain::on_rigCreatorBtn_clicked()
|
|||
void wfmain::receiveValue(cacheItem val){
|
||||
|
||||
|
||||
if (val.vfo >= vfos.size())
|
||||
{
|
||||
qCritical(logSystem()) << "Data received for VFO that doesn't exist!" << val.vfo;
|
||||
return;
|
||||
}
|
||||
switch (val.command)
|
||||
{
|
||||
#if defined __GNUC__
|
||||
|
@ -5259,8 +5296,7 @@ void wfmain::receiveValue(cacheItem val){
|
|||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
||||
#endif
|
||||
case funcUnselectedFreq:
|
||||
if (vfos.size() > 1)
|
||||
val.vfo=1;
|
||||
val.vfo=1;
|
||||
case funcFreqGet:
|
||||
case funcFreqTR:
|
||||
case funcSelectedFreq:
|
||||
|
@ -5280,12 +5316,13 @@ void wfmain::receiveValue(cacheItem val){
|
|||
case funcModeGet:
|
||||
case funcModeTR:
|
||||
case funcSelectedMode:
|
||||
if (vfos.size())
|
||||
if (vfos.size()) {
|
||||
vfos[0]->receiveMode(val.value.value<modeInfo>());
|
||||
finputbtns->updateCurrentMode(val.value.value<modeInfo>().mk);
|
||||
finputbtns->updateFilterSelection(val.value.value<modeInfo>().filter);
|
||||
rpt->handleUpdateCurrentMainMode(val.value.value<modeInfo>());
|
||||
cw->handleCurrentModeUpdate(val.value.value<modeInfo>().mk);
|
||||
finputbtns->updateCurrentMode(val.value.value<modeInfo>().mk);
|
||||
finputbtns->updateFilterSelection(val.value.value<modeInfo>().filter);
|
||||
rpt->handleUpdateCurrentMainMode(val.value.value<modeInfo>());
|
||||
cw->handleCurrentModeUpdate(val.value.value<modeInfo>().mk);
|
||||
}
|
||||
break;
|
||||
case funcUnselectedMode:
|
||||
val.vfo=1;
|
||||
|
@ -5610,22 +5647,28 @@ void wfmain::receiveValue(cacheItem val){
|
|||
{
|
||||
if (vfos.size()>1)
|
||||
{
|
||||
// This tells us whether we are receiving main or sub data
|
||||
subScope = val.value.value<bool>();
|
||||
if (!subScope && !vfos[0]->isVisible()) {
|
||||
vfos[1]->setVisible(false);
|
||||
vfos[0]->setVisible(true);
|
||||
} else if (subScope && !vfos[1]->isVisible()) {
|
||||
vfos[0]->setVisible(false);
|
||||
vfos[1]->setVisible(true);
|
||||
}
|
||||
|
||||
if (ui->scopeDualBtn->isChecked()) {
|
||||
vfos[0]->selected(!subScope);
|
||||
vfos[1]->selected(subScope);
|
||||
if (QThread::currentThread() != QCoreApplication::instance()->thread())
|
||||
{
|
||||
qCritical(logSystem()) << "Thread is NOT the main UI thread, cannot hide/unhide VFO";
|
||||
} else {
|
||||
vfos[0]->selected(false);
|
||||
vfos[1]->selected(false);
|
||||
|
||||
// This tells us whether we are receiving main or sub data
|
||||
subScope = val.value.value<bool>();
|
||||
if (!subScope && !vfos[0]->isVisible()) {
|
||||
vfos[1]->setVisible(false);
|
||||
vfos[0]->setVisible(true);
|
||||
} else if (subScope && !vfos[1]->isVisible()) {
|
||||
vfos[0]->setVisible(false);
|
||||
vfos[1]->setVisible(true);
|
||||
}
|
||||
|
||||
if (ui->scopeDualBtn->isChecked()) {
|
||||
vfos[0]->selected(!subScope);
|
||||
vfos[1]->selected(subScope);
|
||||
} else {
|
||||
vfos[0]->selected(false);
|
||||
vfos[1]->selected(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -5634,25 +5677,30 @@ void wfmain::receiveValue(cacheItem val){
|
|||
{
|
||||
if (vfos.size()>1)
|
||||
{
|
||||
// This tells us whether we are receiving single or dual scopes
|
||||
ui->scopeDualBtn->setChecked(val.value.value<bool>());
|
||||
if (val.value.value<bool>()) {
|
||||
if (!vfos[1]->isVisible())
|
||||
{
|
||||
vfos[1]->setVisible(true);
|
||||
}
|
||||
else if (!vfos[0]->isVisible())
|
||||
{
|
||||
vfos[0]->setVisible(true);
|
||||
}
|
||||
if (QThread::currentThread() != QCoreApplication::instance()->thread())
|
||||
{
|
||||
qCritical(logSystem()) << "Thread is NOT the main UI thread, cannot hide/unhide VFO";
|
||||
} else {
|
||||
if (vfos[0]->isVisible())
|
||||
{
|
||||
vfos[1]->setVisible(false);
|
||||
}
|
||||
else if (vfos[1]->isVisible())
|
||||
{
|
||||
vfos[0]->setVisible(false);
|
||||
// This tells us whether we are receiving single or dual scopes
|
||||
ui->scopeDualBtn->setChecked(val.value.value<bool>());
|
||||
if (val.value.value<bool>()) {
|
||||
if (!vfos[1]->isVisible())
|
||||
{
|
||||
vfos[1]->setVisible(true);
|
||||
}
|
||||
else if (!vfos[0]->isVisible())
|
||||
{
|
||||
vfos[0]->setVisible(true);
|
||||
}
|
||||
} else {
|
||||
if (vfos[0]->isVisible())
|
||||
{
|
||||
vfos[1]->setVisible(false);
|
||||
}
|
||||
else if (vfos[1]->isVisible())
|
||||
{
|
||||
vfos[0]->setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5741,19 +5789,19 @@ void wfmain::on_showSettingsBtn_clicked()
|
|||
void wfmain::on_scopeMainSubBtn_clicked()
|
||||
{
|
||||
subScope = !subScope;
|
||||
queue->add(priorityImmediate,queueItem(funcScopeMainSub,QVariant::fromValue(subScope),false,false));
|
||||
queue->add(priorityImmediate,queueItem(funcScopeMainSub,QVariant::fromValue(subScope),false));
|
||||
}
|
||||
|
||||
void wfmain::on_scopeDualBtn_toggled(bool en)
|
||||
{
|
||||
queue->add(priorityImmediate,queueItem(funcScopeSingleDual,QVariant::fromValue(en),false,false));
|
||||
queue->add(priorityImmediate,queueItem(funcScopeSingleDual,QVariant::fromValue(en),false));
|
||||
if (en)
|
||||
queue->add(priorityImmediate,queueItem(funcScopeMainSub,QVariant::fromValue(false),false,false)); // Set main scope
|
||||
queue->add(priorityImmediate,queueItem(funcScopeMainSub,QVariant::fromValue(false),false)); // Set main scope
|
||||
}
|
||||
|
||||
void wfmain::on_dualWatchBtn_toggled(bool en)
|
||||
{
|
||||
queue->add(priorityImmediate,queueItem(funcVFODualWatch,QVariant::fromValue(en),false,false));
|
||||
queue->add(priorityImmediate,queueItem(funcVFODualWatch,QVariant::fromValue(en),false));
|
||||
}
|
||||
|
||||
void wfmain::dataModeChanged(modeInfo m)
|
||||
|
|
2
wfmain.h
2
wfmain.h
|
@ -497,7 +497,7 @@ private slots:
|
|||
|
||||
private:
|
||||
Ui::wfmain *ui; // Main UI
|
||||
QList<spectrumScope*>vfos; // Spectrum Scope/VFO item.
|
||||
QVector<spectrumScope*>vfos; // Spectrum Scope/VFO item.
|
||||
void closeEvent(QCloseEvent *event);
|
||||
QString logFilename;
|
||||
bool debugMode;
|
||||
|
|
|
@ -136,7 +136,7 @@ struct antennaInfo {
|
|||
struct scopeData {
|
||||
bool valid=false;
|
||||
QByteArray data;
|
||||
bool mainSub;
|
||||
uchar vfo;
|
||||
spectrumMode_t mode;
|
||||
bool oor;
|
||||
double startFreq;
|
||||
|
|
Ładowanie…
Reference in New Issue