Add RX antenna selection for rigs that support it

audioplugins
Phil Taylor 2021-07-16 17:08:55 +01:00
rodzic f191775acb
commit e40545cf77
6 zmienionych plików z 34 dodań i 8 usunięć

Wyświetl plik

@ -2801,6 +2801,7 @@ void rigCommander::determineRigCaps()
rigCaps.preamps.push_back('\x00');
rigCaps.hasAntennaSel = false;
rigCaps.hasRXAntenna = false;
rigCaps.hasTransmit = true;
rigCaps.hasPTTCommand = true;
@ -2988,6 +2989,7 @@ void rigCommander::determineRigCaps()
rigCaps.bands.push_back(band630m);
rigCaps.bands.push_back(band2200m);
rigCaps.modes = commonModes;
rigCaps.hasRXAntenna = true;
break;
case model7850:
rigCaps.modelName = QString("IC-785x");
@ -3018,6 +3020,7 @@ void rigCommander::determineRigCaps()
rigCaps.modes = commonModes;
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modePSK, 0x12, "PSK"),
createMode(modePSK_R, 0x13, "PSK-R")});
rigCaps.hasRXAntenna = true;
break;
case model705:
rigCaps.modelName = QString("IC-705");
@ -3283,6 +3286,7 @@ void rigCommander::determineRigCaps()
break;
}
haveRigCaps = true;
if(lookingForRig)
{
lookingForRig = false;
@ -3709,11 +3713,11 @@ void rigCommander::setPreamp(unsigned char pre)
prepDataAndSend(payload);
}
void rigCommander::setAntenna(unsigned char ant)
void rigCommander::setAntenna(unsigned char ant, bool rx)
{
QByteArray payload("\x12");
payload.append(ant);
payload.append("\x00"); // 0x00 = use for TX and RX
payload.append((unsigned char)rx); // 0x00 = use for TX and RX
prepDataAndSend(payload);
}

Wyświetl plik

@ -152,7 +152,7 @@ public slots:
void getAntenna();
void setAttenuator(unsigned char att);
void setPreamp(unsigned char pre);
void setAntenna(unsigned char ant);
void setAntenna(unsigned char ant, bool rx);
// Repeater:
void setDuplexMode(duplexMode dm);

Wyświetl plik

@ -122,6 +122,8 @@ struct rigCapabilities {
bool hasAntennaSel;
bool hasDataModes;
bool hasRXAntenna;
std::vector <unsigned char> attenuators;
std::vector <unsigned char> preamps;
std::vector <unsigned char> antennas;

Wyświetl plik

@ -339,7 +339,7 @@ void wfmain::rigConnections()
connect(rig, SIGNAL(haveRigID(rigCapabilities)), this, SLOT(receiveRigID(rigCapabilities)));
connect(this, SIGNAL(setAttenuator(unsigned char)), rig, SLOT(setAttenuator(unsigned char)));
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(setAntenna(unsigned char, bool)), rig, SLOT(setAntenna(unsigned char, bool)));
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()));
@ -2899,6 +2899,9 @@ void wfmain::receiveRigID(rigCapabilities rigCaps)
ui->antennaSelCombo->setDisabled(true);
}
ui->rxAntennaCheck->setEnabled(rigCaps.hasRXAntenna);
ui->rxAntennaCheck->setChecked(false);
ui->scopeBWCombo->blockSignals(true);
ui->scopeBWCombo->clear();
if(rigCaps.hasSpectrum)
@ -4722,9 +4725,14 @@ void wfmain::on_preampSelCombo_activated(int index)
void wfmain::on_antennaSelCombo_activated(int index)
{
unsigned char ant = (unsigned char)ui->antennaSelCombo->itemData(index).toInt();
emit setAntenna(ant);
emit setAntenna(ant,ui->rxAntennaCheck->isChecked());
}
void wfmain::on_rxAntennaCheck_clicked(bool value)
{
unsigned char ant = (unsigned char)ui->antennaSelCombo->itemData(ui->antennaSelCombo->currentIndex()).toInt();
emit setAntenna(ant, value);
}
void wfmain::on_wfthemeCombo_activated(int index)
{
colorMap->setGradient(static_cast<QCPColorGradient::GradientPreset>(ui->wfthemeCombo->itemData(index).toInt()));

Wyświetl plik

@ -120,7 +120,7 @@ signals:
void getAntenna();
void setAttenuator(unsigned char att);
void setPreamp(unsigned char pre);
void setAntenna(unsigned char ant);
void setAntenna(unsigned char ant, bool rx);
void startATU();
void setATU(bool atuEnabled);
void getATUStatus();
@ -428,6 +428,8 @@ private slots:
void on_antennaSelCombo_activated(int index);
void on_rxAntennaCheck_clicked(bool value);
void on_wfthemeCombo_activated(int index);
void on_rigPowerOnBtn_clicked();

Wyświetl plik

@ -18,7 +18,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="mainTab">
<attribute name="title">
@ -990,6 +990,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="rxAntennaCheck">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>RX</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
@ -2744,7 +2754,7 @@
<x>0</x>
<y>0</y>
<width>934</width>
<height>22</height>
<height>21</height>
</rect>
</property>
</widget>