The band stacking register now uses the newer integer frequency parsing.

We also communicate a little slower to the serial rigs, which seems more
reliable.
merge-requests/3/head
Elliott Liggett 2021-05-07 14:52:19 -07:00
rodzic 8936c733b4
commit 14b0ba2151
4 zmienionych plików z 23 dodań i 19 usunięć

Wyświetl plik

@ -2133,19 +2133,21 @@ void rigCommander::parseRegister16()
void rigCommander::parseBandStackReg()
{
// qDebug(logRig()) << "Band stacking register response received: ";
// printHex(payloadIn, false, true);
qDebug(logRig()) << "Band stacking register response received: ";
printHex(payloadIn, false, true);
// Reference output, 20 meters, regCode 01 (latest):
// "INDEX: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 "
// "DATA: 1a 01 05 01 60 03 23 14 00 00 03 10 00 08 85 00 08 85 fd "
// char band = payloadIn[2];
// char regCode = payloadIn[3];
//char band = payloadIn[2];
//char regCode = payloadIn[3];
freqt freqs = parseFrequency(payloadIn, 7);
float freq = (float)freqs.MHzDouble;
//float freq = (float)freqs.MHzDouble;
bool dataOn = (payloadIn[11] & 0x10) >> 4; // not sure...
char mode = payloadIn[9];
char filter = payloadIn[10];
// 09, 10 mode
// 11 digit RH: data mode on (1) or off (0)
// 11 digit LH: CTCSS 0 = off, 1 = TONE, 2 = TSQL
@ -2154,9 +2156,11 @@ void rigCommander::parseBandStackReg()
// 14, 15 tone squelch freq setting
// if more, memory name (label) ascii
// qDebug(logRig()) << "band: " << QString("%1").arg(band) << " regCode: " << (QString)regCode << " freq: " << freq;
// qDebug(logRig()) << "mode: " << (QString)mode << " dataOn: " << dataOn;
emit haveBandStackReg(freq, mode, dataOn);
//qDebug(logRig()) << "band: " << QString("%1").arg(band) << " regCode: " << (QString)regCode << " freq float: " << freq;
//qDebug(logRig()) << "mode: " << (QString)mode << " dataOn: " << dataOn;
//qDebug(logRig()) << "Freq Hz: " << freqs.Hz;
emit haveBandStackReg(freqs, mode, filter, dataOn);
}
void rigCommander::parseDetailedRegisters1A05()

Wyświetl plik

@ -249,7 +249,7 @@ signals:
void haveFrequency(freqt freqStruct);
void haveMode(unsigned char mode, unsigned char filter);
void haveDataMode(bool dataModeEnabled);
void haveBandStackReg(float freq, char mode, bool dataOn);
void haveBandStackReg(freqt f, char mode, char filter, bool dataOn);
void haveRitEnabled(bool ritEnabled);
void haveRitFrequency(int ritHz);

Wyświetl plik

@ -334,7 +334,7 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
rigName->setFixedWidth(50);
delayedCmdIntervalLAN_ms = 10; // interval for regular delayed commands, including initial rig/UI state queries
delayedCmdIntervalSerial_ms = 50; // 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.
@ -371,7 +371,7 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
connect(rig, SIGNAL(havePTTStatus(bool)), this, SLOT(receivePTTstatus(bool)));
connect(this, SIGNAL(setPTT(bool)), rig, SLOT(setPTT(bool)));
connect(this, SIGNAL(getPTT()), rig, SLOT(getPTT()));
connect(rig, SIGNAL(haveBandStackReg(float,char,bool)), this, SLOT(receiveBandStackReg(float,char,bool)));
connect(rig, SIGNAL(haveBandStackReg(freqt,char,char,bool)), this, SLOT(receiveBandStackReg(freqt,char,char,bool)));
connect(this, SIGNAL(setRitEnable(bool)), rig, SLOT(setRitEnable(bool)));
connect(this, SIGNAL(setRitValue(int)), rig, SLOT(setRitValue(int)));
connect(rig, SIGNAL(haveRitEnabled(bool)), this, SLOT(receiveRITStatus(bool)));
@ -2899,15 +2899,15 @@ void wfmain::on_freqDial_valueChanged(int value)
}
}
void wfmain::receiveBandStackReg(float freq, char mode, bool dataOn)
void wfmain::receiveBandStackReg(freqt freq, char mode, char filter, bool dataOn)
{
// read the band stack and apply by sending out commands
freqt f;
f.Hz = freq * 1E6;
setFrequency(f);
int filterSelection = ui->modeFilterCombo->currentData().toInt();
setMode(mode, (unsigned char)filterSelection); // make sure this is what you think it is
//freqt f;
//f.Hz = freq * 1E6;
setFrequency(freq);
//int filterSelection = ui->modeFilterCombo->currentData().toInt();
setMode((unsigned char)mode, (unsigned char)filter); // make sure this is what you think it is
// setDataMode(dataOn); // signal out
if(dataOn)

Wyświetl plik

@ -184,7 +184,7 @@ private slots:
void receiveSpectrumSpan(freqt freqspan, bool isSub);
void receivePTTstatus(bool pttOn);
void receiveDataModeStatus(bool dataOn);
void receiveBandStackReg(float freq, char mode, bool dataOn); // freq, mode, (filter,) datamode
void receiveBandStackReg(freqt f, char mode, char filter, bool dataOn); // freq, mode, (filter,) datamode
void receiveRITStatus(bool ritEnabled);
void receiveRITValue(int ritValHz);
void receiveModInput(rigInput input, bool dataOn);