kopia lustrzana https://gitlab.com/eliggett/wfview
Added local af gain and wf length to the preferences.
rodzic
df233d5257
commit
9799e4f745
|
@ -67,6 +67,7 @@ struct audioSetup {
|
|||
QAudioDeviceInfo port;
|
||||
#endif
|
||||
quint8 resampleQuality;
|
||||
unsigned char localAFgain;
|
||||
};
|
||||
|
||||
// For QtMultimedia, use a native QIODevice
|
||||
|
|
|
@ -133,7 +133,8 @@ void rigCommander::commSetup(unsigned char rigCivAddr, udpPreferences prefs, aud
|
|||
|
||||
connect(ptty, SIGNAL(haveSerialPortError(QString, QString)), this, SLOT(handleSerialPortError(QString, QString)));
|
||||
connect(this, SIGNAL(getMoreDebug()), ptty, SLOT(debugThis()));
|
||||
emit haveAfGain(255);
|
||||
|
||||
emit haveAfGain(rxSetup.localAFgain);
|
||||
}
|
||||
|
||||
// data from the comm port to the program:
|
||||
|
|
24
wfmain.cpp
24
wfmain.cpp
|
@ -877,6 +877,9 @@ void wfmain::setUIToPrefs()
|
|||
ui->drawPeakChk->setChecked(prefs.drawPeaks);
|
||||
on_drawPeakChk_clicked(prefs.drawPeaks);
|
||||
drawPeaks = prefs.drawPeaks;
|
||||
|
||||
ui->wfLengthSlider->setValue(prefs.wflength);
|
||||
prepareWf(prefs.wflength);
|
||||
}
|
||||
|
||||
void wfmain::setAudioDevicesUI()
|
||||
|
@ -1148,6 +1151,8 @@ void wfmain::setDefPrefs()
|
|||
defPrefs.enableRigCtlD = false;
|
||||
defPrefs.rigCtlPort = 4533;
|
||||
defPrefs.virtualSerialPort = QString("none");
|
||||
defPrefs.localAFgain = 255;
|
||||
defPrefs.wflength = 160;
|
||||
|
||||
udpDefPrefs.ipAddress = QString("");
|
||||
udpDefPrefs.controlLANPort = 50001;
|
||||
|
@ -1170,6 +1175,7 @@ void wfmain::loadSettings()
|
|||
prefs.useDarkMode = settings->value("UseDarkMode", defPrefs.useDarkMode).toBool();
|
||||
prefs.useSystemTheme = settings->value("UseSystemTheme", defPrefs.useSystemTheme).toBool();
|
||||
prefs.drawPeaks = settings->value("DrawPeaks", defPrefs.drawPeaks).toBool();
|
||||
prefs.wflength = (unsigned int) settings->value("WFLength", defPrefs.wflength).toInt();
|
||||
prefs.stylesheetPath = settings->value("StylesheetPath", defPrefs.stylesheetPath).toString();
|
||||
ui->splitter->restoreState(settings->value("splitter").toByteArray());
|
||||
|
||||
|
@ -1253,7 +1259,8 @@ void wfmain::loadSettings()
|
|||
ui->vspCombo->setCurrentIndex(ui->vspCombo->count()-1);
|
||||
}
|
||||
|
||||
|
||||
prefs.localAFgain = (unsigned char) settings->value("localAFgain", defPrefs.localAFgain).toUInt();
|
||||
rxSetup.localAFgain = prefs.localAFgain;
|
||||
settings->endGroup();
|
||||
|
||||
// Misc. user settings (enable PTT, draw peaks, etc)
|
||||
|
@ -1462,6 +1469,7 @@ void wfmain::saveSettings()
|
|||
settings->setValue("splitter", ui->splitter->saveState());
|
||||
settings->setValue("windowGeometry", saveGeometry());
|
||||
settings->setValue("windowState", saveState());
|
||||
settings->setValue("WFLength", prefs.wflength);
|
||||
settings->endGroup();
|
||||
|
||||
// Radio and Comms: C-IV addr, port to use
|
||||
|
@ -1470,6 +1478,7 @@ void wfmain::saveSettings()
|
|||
settings->setValue("SerialPortRadio", prefs.serialPortRadio);
|
||||
settings->setValue("SerialPortBaud", prefs.serialPortBaud);
|
||||
settings->setValue("VirtualSerialPort", prefs.virtualSerialPort);
|
||||
settings->setValue("localAFgain", prefs.localAFgain);
|
||||
settings->endGroup();
|
||||
|
||||
// Misc. user settings (enable PTT, draw peaks, etc)
|
||||
|
@ -2820,14 +2829,17 @@ void wfmain::receiveRigID(rigCapabilities rigCaps)
|
|||
}
|
||||
ui->scopeBWCombo->blockSignals(false);
|
||||
|
||||
|
||||
setBandButtons();
|
||||
|
||||
ui->tuneEnableChk->setEnabled(rigCaps.hasATU);
|
||||
ui->tuneNowBtn->setEnabled(rigCaps.hasATU);
|
||||
|
||||
ui->connectBtn->setText("Disconnect"); // We must be connected now.
|
||||
prepareWf();
|
||||
prepareWf(ui->wfLengthSlider->value());
|
||||
if(usingLAN)
|
||||
{
|
||||
ui->afGainSlider->setValue(prefs.localAFgain);
|
||||
}
|
||||
// Adding these here because clearly at this point we have valid
|
||||
// rig comms. In the future, we should establish comms and then
|
||||
// do all the initial grabs. For now, this hack of adding them here and there:
|
||||
|
@ -3853,6 +3865,11 @@ void wfmain::on_rfGainSlider_valueChanged(int value)
|
|||
void wfmain::on_afGainSlider_valueChanged(int value)
|
||||
{
|
||||
issueCmdUniquePriority(cmdSetAfGain, (unsigned char)value);
|
||||
if(usingLAN)
|
||||
{
|
||||
rxSetup.localAFgain = (unsigned char)(value);
|
||||
prefs.localAFgain = (unsigned char)(value);
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::receiveRfGain(unsigned char level)
|
||||
|
@ -4946,6 +4963,7 @@ void wfmain::on_baudRateCombo_activated(int index)
|
|||
|
||||
void wfmain::on_wfLengthSlider_valueChanged(int value)
|
||||
{
|
||||
prefs.wflength = (unsigned int)(value);
|
||||
prepareWf(value);
|
||||
}
|
||||
|
||||
|
|
3
wfmain.h
3
wfmain.h
|
@ -666,6 +666,9 @@ private:
|
|||
quint16 rigCtlPort;
|
||||
colors colorScheme;
|
||||
QString virtualSerialPort;
|
||||
unsigned char localAFgain;
|
||||
unsigned int wflength;
|
||||
// plot scheme
|
||||
} prefs;
|
||||
|
||||
preferences defPrefs;
|
||||
|
|
Ładowanie…
Reference in New Issue