Allow user to configure auto power on

master
Phil Taylor 2025-05-06 18:29:08 +01:00
rodzic 3571151843
commit 801f7b11f5
5 zmienionych plików z 33 dodań i 6 usunięć

Wyświetl plik

@ -36,7 +36,8 @@ enum prefIfItem {
if_showBands = 1 << 23,
if_separators = 1 << 24,
if_forceVfoMode = 1 << 25,
if_all = 1 << 26
if_autoPowerOn = 1 << 26,
if_all = 1 << 27
};
enum prefColItem {
@ -268,7 +269,7 @@ struct preferences {
QChar decimalSeparator;
QChar groupSeparator;
bool forceVfoMode;
bool autoPowerOn;
};
#endif // PREFS_H

Wyświetl plik

@ -586,6 +586,9 @@ void settingswidget::updateIfPref(prefIfItem pif)
case if_forceVfoMode:
quietlyUpdateCheckbox(ui->forceVfoModeChk,prefs->forceVfoMode);
break;
case if_autoPowerOn:
quietlyUpdateCheckbox(ui->autoPowerOnChk,prefs->autoPowerOn);
break;
default:
qWarning(logGui()) << "Did not understand if pref update item " << (int)pif;
break;
@ -2366,6 +2369,12 @@ void settingswidget::on_forceVfoModeChk_clicked(bool checked)
emit changedIfPref(if_forceVfoMode);
}
void settingswidget::on_autoPowerOnChk_clicked(bool checked)
{
prefs->autoPowerOn = checked;
emit changedIfPref(if_autoPowerOn);
}
/* End of radio specific settings */

Wyświetl plik

@ -289,6 +289,7 @@ private slots:
void on_groupSeparatorsCombo_currentIndexChanged(int index);
void on_forceVfoModeChk_clicked(bool checked);
void on_autoPowerOnChk_clicked(bool checked);
void on_networkConnectionTypeCombo_currentIndexChanged(int index);

Wyświetl plik

@ -1082,7 +1082,17 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
<item>
<widget class="QCheckBox" name="forceVfoModeChk">
<property name="text">
<string>Force VFO Mode (if disabled, we will not know current mode)</string>
<string>Force VFO Mode</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="autoPowerOnChk">
<property name="text">
<string>Auto Power-on radio</string>
</property>
<property name="checked">
<bool>true</bool>

Wyświetl plik

@ -706,9 +706,12 @@ void wfmain::receiveCommReady()
}
}
// After 2s send powerOn command
QTimer::singleShot(2000, rig, SLOT(powerOn()));
//emit sendPowerOn();
if (prefs.autoPowerOn)
{
// After 2s send powerOn command
QTimer::singleShot(2000, rig, SLOT(powerOn()));
}
}
void wfmain::receivePortError(errorType err)
@ -1706,6 +1709,7 @@ void wfmain::setDefPrefs()
defPrefs.useUTC = false;
defPrefs.setRadioTime = false;
defPrefs.forceVfoMode = true;
defPrefs.autoPowerOn=true;
defPrefs.tcpPort = 0;
defPrefs.tciPort = 50001;
@ -1795,6 +1799,7 @@ void wfmain::loadSettings()
prefs.decimalSeparator = settings->value("DecimalSeparator", defPrefs.decimalSeparator).toChar();
prefs.groupSeparator = settings->value("GroupSeparator", defPrefs.groupSeparator).toChar();
prefs.forceVfoMode = settings->value("ForceVfoMode", defPrefs.groupSeparator).toBool();
prefs.autoPowerOn = settings->value("AutoPowerOn", defPrefs.autoPowerOn).toBool();
prefs.drawPeaks = settings->value("DrawPeaks", defPrefs.drawPeaks).toBool();
prefs.underlayBufferSize = settings->value("underlayBufferSize", defPrefs.underlayBufferSize).toInt();
@ -3188,6 +3193,7 @@ void wfmain::saveSettings()
settings->setValue("GroupSeparator",prefs.groupSeparator);
settings->setValue("DecimalSeparator",prefs.decimalSeparator);
settings->setValue("ForceVfoMode",prefs.forceVfoMode);
settings->setValue("AutoPowerOn",prefs.autoPowerOn);
settings->endGroup();