diff --git a/rigcommander.cpp b/rigcommander.cpp index 628e2f9..d2741c0 100644 --- a/rigcommander.cpp +++ b/rigcommander.cpp @@ -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); } diff --git a/rigcommander.h b/rigcommander.h index f9dbc8a..730bcd9 100644 --- a/rigcommander.h +++ b/rigcommander.h @@ -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); diff --git a/rigidentities.h b/rigidentities.h index 4563f8f..117cfec 100644 --- a/rigidentities.h +++ b/rigidentities.h @@ -122,6 +122,8 @@ struct rigCapabilities { bool hasAntennaSel; bool hasDataModes; + bool hasRXAntenna; + std::vector attenuators; std::vector preamps; std::vector antennas; diff --git a/wfmain.cpp b/wfmain.cpp index 0bd5090..8467db3 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -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(ui->wfthemeCombo->itemData(index).toInt())); diff --git a/wfmain.h b/wfmain.h index 81783ea..a1ae809 100644 --- a/wfmain.h +++ b/wfmain.h @@ -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(); diff --git a/wfmain.ui b/wfmain.ui index fff8ba8..342aad3 100644 --- a/wfmain.ui +++ b/wfmain.ui @@ -18,7 +18,7 @@ - 3 + 0 @@ -990,6 +990,16 @@ + + + + false + + + RX + + + @@ -2744,7 +2754,7 @@ 0 0 934 - 22 + 21