Filters are now read correctly from mode messages. Filter setup menu is

still a placeholder.
merge-requests/2/head
Elliott Liggett 2021-02-13 23:42:51 -08:00
rodzic 5d3c386c87
commit 66e02a045a
4 zmienionych plików z 33 dodań i 68 usunięć

Wyświetl plik

@ -1479,60 +1479,15 @@ float rigCommander::parseFrequency(QByteArray data, unsigned char lastPosition)
void rigCommander::parseMode()
{
QString mode;
// LSB:
//"INDEX: 00 01 02 03 "
//"DATA: 01 00 02 fd "
// USB:
//"INDEX: 00 01 02 03 "
//"DATA: 01 01 02 fd "
/*
switch(payloadIn[01])
unsigned char filter;
if(payloadIn[2] != '\xFD')
{
case '\x00':
mode = "LSB";
break;
case '\x01':
mode = "USB";
break;
case '\x02':
mode = "AM";
break;
case '\x03':
mode = "CW";
break;
case '\x04':
mode = "RTTY";
break;
case '\x05':
mode = "FM";
break;
case '\x07':
mode = "CW-R";
break;
case '\x08':
mode = "RTTY-R";
break;
case '\x12':
case '\x13':
break;
case '\x17':
mode = "DV";
break;
case '\x22':
mode = "DD";
break;
default:
qDebug() << "Mode: Unknown: " << payloadIn[01];
printHex(payloadIn, false, true);
mode = QString("");
filter = payloadIn[2];
} else {
filter = 0;
}
*/
emit haveMode((unsigned char)payloadIn[01]);
emit haveMode((unsigned char)payloadIn[01], filter);
}

Wyświetl plik

@ -85,7 +85,7 @@ signals:
void haveSerialPortError(const QString port, const QString errorText);
void haveStatusUpdate(const QString text);
void haveFrequency(double frequencyMhz);
void haveMode(unsigned char mode);
void haveMode(unsigned char mode, unsigned char filter);
void haveDataMode(bool dataModeEnabled);
void haveBandStackReg(float freq, char mode, bool dataOn);
void haveSpectrumBounds();

Wyświetl plik

@ -270,7 +270,7 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
connect(this, SIGNAL(spectOutputEnable()), rig, SLOT(enableSpectOutput()));
connect(this, SIGNAL(scopeDisplayDisable()), rig, SLOT(disableSpectrumDisplay()));
connect(this, SIGNAL(scopeDisplayEnable()), rig, SLOT(enableSpectrumDisplay()));
connect(rig, SIGNAL(haveMode(unsigned char)), this, SLOT(receiveMode(unsigned char)));
connect(rig, SIGNAL(haveMode(unsigned char, unsigned char)), this, SLOT(receiveMode(unsigned char, unsigned char)));
connect(rig, SIGNAL(haveDataMode(bool)), this, SLOT(receiveDataModeStatus(bool)));
connect(rig, SIGNAL(haveSpectrumData(QByteArray, double, double)), this, SLOT(receiveSpectrumData(QByteArray, double, double)));
connect(rig, SIGNAL(haveSpectrumFixedMode(bool)), this, SLOT(receiveSpectrumFixedMode(bool)));
@ -1639,7 +1639,7 @@ void wfmain::on_stopBtn_clicked()
//emit scopeDisplayDisable();
}
void wfmain::receiveMode(unsigned char mode)
void wfmain::receiveMode(unsigned char mode, unsigned char filter)
{
qDebug() << __func__ << "Received mode " << mode << " current mode: " << currentModeIndex;
@ -1669,6 +1669,14 @@ void wfmain::receiveMode(unsigned char mode)
}
if( (filter) && (filter < 4)){
ui->modeFilterCombo->blockSignals(true);
ui->modeFilterCombo->setCurrentIndex(filter-1);
ui->modeFilterCombo->blockSignals(false);
}
(void)filter;
// Note: we need to know if the DATA mode is active to reach mode-D
// some kind of queued query:
@ -2083,15 +2091,19 @@ void wfmain::on_aboutBtn_clicked()
msgBox.setWindowIcon(QIcon(":resources/wfview.png"));
// TODO: change style of link color based on current CSS sheet.
QString copyright = QString("Copyright 2017-2020 Elliott H. Liggett. All rights reserved.");
QString ssCredit = QString("<br/>Stylesheet qdarkstyle used under MIT license, stored in /usr/share/wfview/stylesheets/.");
QString contact = QString("<br/>email the author: kilocharlie8@gmail.com or W6EL on the air!");
QString head = QString("<html><head></head><body>");
QString copyright = QString("Copyright 2017-2021 Elliott H. Liggett, W6EL. All rights reserved.");
QString nacode = QString("<br/><br/>Networking and audio code written by Phil Taylor, M0VSE");
QString doctest = QString("<br/><br/>Testing, documentation, bug fixes, and development mentorship from Roeland Jansen, PA3MET, and Jim Nijkamp, PA8E.");
QString ssCredit = QString("<br/><br/>Stylesheet qdarkstyle used under MIT license, stored in /usr/share/wfview/stylesheets/.");
QString website = QString("<br/><br/>Get the latest version from our gitlab repo: <a href='https://gitlab.com/eliggett/wfview' style='color: cyan;'>https://gitlab.com/eliggett/wfview</a>");
QString docs = QString("<br/>Also see the <a href='https://gitlab.com/eliggett/wfview/-/wikis/home' style='color: cyan;'>wiki</a> for the <a href='https://gitlab.com/eliggett/wfview/-/wikis/User-FAQ' style='color: cyan;'>FAQ</a>, <a href='https://gitlab.com/eliggett/wfview/-/wikis/Keystrokes' style='color: cyan;'>Keystrokes</a>, and more.");
QString contact = QString("<br/>email the author: kilocharlie8@gmail.com or W6EL on the air!");
QString buildInfo = QString("<br/><br/>Build " + QString(GITSHORT) + " on " + QString(__DATE__) + " at " + __TIME__ + " by " + UNAME + "@" + HOST);
QString end = QString("</body></html>");
QString aboutText = copyright + "\n" + ssCredit + "\n";
aboutText.append(contact + "\n" + website + "\n"+ docs +"\n" + buildInfo);
QString aboutText = head + copyright + "\n" + nacode + "\n" + doctest + "\n" + ssCredit + "\n";
aboutText.append(website + "\n"+ docs + contact +"\n" + buildInfo + end);
msgBox.setText(aboutText);
msgBox.exec();
@ -2426,6 +2438,11 @@ void wfmain::on_modeFilterCombo_activated(int index)
}
void wfmain::on_dataModeBtn_toggled(bool checked)
{
setDataMode(checked);
}
// --- DEBUG FUNCTION ---
void wfmain::on_debugBtn_clicked()
{
@ -2438,13 +2455,6 @@ void wfmain::on_debugBtn_clicked()
//qDebug() << "Debug: finding rigs attached. Let's see if this works. ";
//rig->findRigs();
// cal->show();
// emit getMode();
//emit getMode();
sat->show();
}
void wfmain::on_dataModeBtn_toggled(bool checked)
{
setDataMode(checked);
}

Wyświetl plik

@ -118,7 +118,7 @@ private slots:
void on_startBtn_clicked();
void receiveCommReady();
void receiveFreq(double);
void receiveMode(unsigned char);
void receiveMode(unsigned char mode, unsigned char filter);
void receiveSpectrumData(QByteArray spectrum, double startFreq, double endFreq);
void receiveSpectrumFixedMode(bool isFixed);
void receivePTTstatus(bool pttOn);