Preamp code is in. Can't read the current preamp state yet but we can

set it. Nicer names for preamp and attenuator menu items.
audioplugins
Elliott Liggett 2021-04-09 10:04:20 -07:00
rodzic 39d6fe0bab
commit aff2e281e8
3 zmienionych plików z 21 dodań i 3 usunięć

Wyświetl plik

@ -852,7 +852,6 @@ void rigCommander::setPTT(bool pttOn)
}
}
void rigCommander::setCIVAddr(unsigned char civAddr)
{
// Note: This is the radio's CIV address
@ -2387,7 +2386,6 @@ void rigCommander::determineRigCaps()
rigCaps.hasDTCS = true;
rigCaps.attenuators.push_back('\x10');
rigCaps.preamps.push_back('\x01');
rigCaps.preamps.push_back('\x02'); // also 3 and 4, but these are external preamp control
break;
case model7610:
rigCaps.modelName = QString("IC-7610");
@ -2487,6 +2485,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasEthernet = false;
rigCaps.hasWiFi = false;
rigCaps.attenuators.push_back('\x10');
rigCaps.attenuators.push_back('\x12');
rigCaps.attenuators.push_back('\x20');
qDebug(logRig()) << "Found unknown rig: " << rigCaps.modelName;
break;

Wyświetl plik

@ -482,6 +482,8 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
connect(rig, SIGNAL(haveATUStatus(unsigned char)), this, SLOT(receiveATUStatus(unsigned char)));
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)));
// Speech (emitted from rig speaker)
connect(this, SIGNAL(sayAll()), rig, SLOT(sayAll()));
@ -2054,10 +2056,18 @@ void wfmain::receiveRigID(rigCapabilities rigCaps)
ui->attSelCombo->clear();
for(unsigned int i=0; i < rigCaps.attenuators.size(); i++)
{
inName = QString("%1").arg(rigCaps.attenuators.at(i), 0, 16);
inName = (i==0)?QString("0dB"):QString("-%1 dB").arg(rigCaps.attenuators.at(i), 0, 16);
ui->attSelCombo->addItem(inName, rigCaps.attenuators.at(i));
}
for(unsigned int i=0; i < rigCaps.preamps.size(); i++)
{
inName = (i==0)?QString("Disabled"):QString("Pre #%1").arg(rigCaps.preamps.at(i), 0, 16);
ui->preampSelCombo->addItem(inName, rigCaps.preamps.at(i));
}
ui->tuneEnableChk->setEnabled(rigCaps.hasATU);
ui->tuneNowBtn->setEnabled(rigCaps.hasATU);
@ -3656,6 +3666,12 @@ void wfmain::on_attSelCombo_activated(int index)
emit setAttenuator(att);
}
void wfmain::on_preampSelCombo_activated(int index)
{
unsigned char pre = (unsigned char)ui->preampSelCombo->itemData(index).toInt();
emit setPreamp(pre);
}
// --- DEBUG FUNCTION ---
void wfmain::on_debugBtn_clicked()
{
@ -3674,3 +3690,4 @@ void wfmain::on_debugBtn_clicked()
emit getScopeMode();
}

Wyświetl plik

@ -389,6 +389,8 @@ private slots:
void on_attSelCombo_activated(int index);
void on_preampSelCombo_activated(int index);
private:
Ui::wfmain *ui;
QSettings settings;