kopia lustrzana https://gitlab.com/eliggett/wfview
Preamp and attenuator are now queried on startup. Additionally, the
preamp is checked when the attenuator is changed, and the attenuator is checked with the preamp is changed. This helps the user understand if the rig allows only one or the other to be active (such as the IC-9700).merge-requests/2/head
rodzic
4f3de02482
commit
aac777eb07
|
@ -1056,6 +1056,9 @@ void rigCommander::parseCommand()
|
|||
case '\x0F':
|
||||
emit haveDuplexMode((duplexMode)(unsigned char)payloadIn[1]);
|
||||
break;
|
||||
case '\x11':
|
||||
emit haveAttenuator((unsigned char)payloadIn.at(1));
|
||||
break;
|
||||
case '\x14':
|
||||
// read levels
|
||||
parseLevels();
|
||||
|
@ -1065,7 +1068,7 @@ void rigCommander::parseCommand()
|
|||
parseLevels();
|
||||
break;
|
||||
case '\x16':
|
||||
parseRptrAccessMode();
|
||||
parseRegister16();
|
||||
break;
|
||||
case '\x19':
|
||||
// qDebug(logRig()) << "Have rig ID: " << (unsigned int)payloadIn[2];
|
||||
|
@ -1957,13 +1960,23 @@ void rigCommander::parseRegister1B()
|
|||
}
|
||||
}
|
||||
|
||||
void rigCommander::parseRptrAccessMode()
|
||||
void rigCommander::parseRegister16()
|
||||
{
|
||||
//"INDEX: 00 01 02 03 "
|
||||
//"DATA: 16 5d 00 fd "
|
||||
// ^-- mode info here
|
||||
|
||||
emit haveRptAccessMode((rptAccessTxRx)payloadIn.at(2));
|
||||
switch(payloadIn.at(1))
|
||||
{
|
||||
case '\x5d':
|
||||
emit haveRptAccessMode((rptAccessTxRx)payloadIn.at(2));
|
||||
break;
|
||||
case '\x02':
|
||||
// Preamp
|
||||
emit havePreamp((unsigned char)payloadIn.at(2));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void rigCommander::parseBandStackReg()
|
||||
|
|
|
@ -272,6 +272,9 @@ signals:
|
|||
// PTT and ATU:
|
||||
void havePTTStatus(bool pttOn);
|
||||
void haveATUStatus(unsigned char status);
|
||||
void haveAttenuator(unsigned char att);
|
||||
void havePreamp(unsigned char pre);
|
||||
void haveAntenna(unsigned char ant);
|
||||
|
||||
// Housekeeping:
|
||||
void getMoreDebug();
|
||||
|
@ -303,7 +306,7 @@ private:
|
|||
void parseRegisters1A();
|
||||
void parseRegister1B();
|
||||
void parseRegisters1C();
|
||||
void parseRptrAccessMode();
|
||||
void parseRegister16();
|
||||
void parseBandStackReg();
|
||||
void parsePTT();
|
||||
void parseATU();
|
||||
|
|
18
wfmain.cpp
18
wfmain.cpp
|
@ -455,8 +455,12 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
|
|||
connect(this, SIGNAL(setPreamp(unsigned char)), rig, SLOT(setPreamp(unsigned char)));
|
||||
connect(this, SIGNAL(setAntenna(unsigned char)), rig, SLOT(setAntenna(unsigned char)));
|
||||
connect(this, SIGNAL(getPreamp()), rig, SLOT(getPreamp()));
|
||||
connect(rig, SIGNAL(havePreamp(unsigned char)), this, SLOT(receivePreamp(unsigned char)));
|
||||
connect(this, SIGNAL(getAttenuator()), rig, SLOT(getAttenuator()));
|
||||
connect(rig, SIGNAL(haveAttenuator(unsigned char)), this, SLOT(receiveAttenuator(unsigned char)));
|
||||
connect(this, SIGNAL(getAntenna()), rig, SLOT(getAntenna));
|
||||
//connect(rig, SIGNAL(haveAntenna(unsigned char)), this, SLOT(receiveAntennaSel(unsigned char)));
|
||||
|
||||
|
||||
// Speech (emitted from rig speaker)
|
||||
connect(this, SIGNAL(sayAll()), rig, SLOT(sayAll()));
|
||||
|
@ -3657,12 +3661,14 @@ void wfmain::on_attSelCombo_activated(int index)
|
|||
{
|
||||
unsigned char att = (unsigned char)ui->attSelCombo->itemData(index).toInt();
|
||||
emit setAttenuator(att);
|
||||
issueDelayedCommand(cmdGetPreamp);
|
||||
}
|
||||
|
||||
void wfmain::on_preampSelCombo_activated(int index)
|
||||
{
|
||||
unsigned char pre = (unsigned char)ui->preampSelCombo->itemData(index).toInt();
|
||||
emit setPreamp(pre);
|
||||
issueDelayedCommand(cmdGetAttenuator);
|
||||
}
|
||||
|
||||
void wfmain::on_antennaSelCombo_activated(int index)
|
||||
|
@ -3676,6 +3682,18 @@ void wfmain::on_wfthemeCombo_activated(int index)
|
|||
colorMap->setGradient(static_cast<QCPColorGradient::GradientPreset>(ui->wfthemeCombo->itemData(index).toInt()));
|
||||
}
|
||||
|
||||
void wfmain::receivePreamp(unsigned char pre)
|
||||
{
|
||||
int preindex = ui->preampSelCombo->findData(pre);
|
||||
ui->preampSelCombo->setCurrentIndex(preindex);
|
||||
}
|
||||
|
||||
void wfmain::receiveAttenuator(unsigned char att)
|
||||
{
|
||||
int attindex = ui->attSelCombo->findData(att);
|
||||
ui->attSelCombo->setCurrentIndex(attindex);
|
||||
}
|
||||
|
||||
// --- DEBUG FUNCTION ---
|
||||
void wfmain::on_debugBtn_clicked()
|
||||
{
|
||||
|
|
3
wfmain.h
3
wfmain.h
|
@ -203,6 +203,9 @@ private slots:
|
|||
|
||||
|
||||
void receiveATUStatus(unsigned char atustatus);
|
||||
void receivePreamp(unsigned char pre);
|
||||
void receiveAttenuator(unsigned char att);
|
||||
//void receiveAntennaSel(unsigned char ant);
|
||||
void receiveRigID(rigCapabilities rigCaps);
|
||||
void receiveFoundRigID(rigCapabilities rigCaps);
|
||||
void receiveSerialPortError(QString port, QString errorText);
|
||||
|
|
Ładowanie…
Reference in New Issue