diff --git a/ChangeLog.txt b/ChangeLog.txt
index af4ae60..7f1f7f3 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -3,6 +3,7 @@ CatRadio
(+ New, * Updated, - Removed)
1.4.0 - 2023-mm-dd
+ + Auto Power-on option
+ High SWR indicator
+ Meter peak hold indicator
+ Debug mode
diff --git a/dialogconfig.cpp b/dialogconfig.cpp
index aabd7f2..18a9443 100644
--- a/dialogconfig.cpp
+++ b/dialogconfig.cpp
@@ -108,6 +108,7 @@ DialogConfig::DialogConfig(QWidget *parent) :
}
ui->spinBox_RefreshRate->setValue(rigCom.rigRefresh);
ui->checkBox_fullPoll->setChecked(rigCom.fullPoll);
+ ui->checkBox_autoPowerOn->setChecked(rigCom.autoPowerOn);
}
DialogConfig::~DialogConfig()
@@ -172,6 +173,7 @@ void DialogConfig::on_buttonBox_accepted()
rigCom.rigRefresh = ui->spinBox_RefreshRate->value();
rigCom.fullPoll = ui->checkBox_fullPoll->isChecked();
+ rigCom.autoPowerOn = ui->checkBox_autoPowerOn->isChecked();
//* Save settings in catradio.ini
QSettings configFile(QString("catradio.ini"), QSettings::IniFormat);
@@ -182,6 +184,7 @@ void DialogConfig::on_buttonBox_accepted()
configFile.setValue("netRigctl", ui->checkBox_netRigctl->isChecked());
configFile.setValue("rigRefresh", ui->spinBox_RefreshRate->value());
configFile.setValue("fullPolling", ui->checkBox_fullPoll->isChecked());
+ configFile.setValue("autoPowerOn", ui->checkBox_autoPowerOn->isChecked());
}
int printRigList(const struct rig_caps *rigCaps, void *data) //Load rig list from hamlib and save into file rig.lst
diff --git a/dialogconfig.ui b/dialogconfig.ui
index fd7e4ff..9c24df6 100644
--- a/dialogconfig.ui
+++ b/dialogconfig.ui
@@ -158,8 +158,8 @@
Options
-
- -
+
+
-
-
@@ -202,11 +202,21 @@
- -
+
-
Full polling
+
+ true
+
+
+
+ -
+
+
+ Auto Power ON
+
@@ -230,7 +240,6 @@
comboBox_serialSpeed
lineEdit_civAddr
spinBox_RefreshRate
- checkBox_fullPoll
checkBox_netRigctl
lineEdit_ip
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 11bd71f..59f23cb 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -110,6 +110,7 @@ MainWindow::MainWindow(QWidget *parent)
rigCom.netRigctl = configFile.value("netRigctl", false).toBool();
rigCom.rigRefresh = configFile.value("rigRefresh", 100).toInt();
rigCom.fullPoll = configFile.value("fullPolling", true).toBool();
+ rigCom.autoPowerOn = configFile.value("autoPowerOn", false).toBool();
guiConf.vfoDisplayMode = configFile.value("vfoDisplayMode", 0).toInt();
guiConf.darkTheme = configFile.value("darkTheme", false).toBool();
guiConf.peakHold = configFile.value("peakHold", true).toBool();
@@ -768,8 +769,8 @@ void MainWindow::on_pushButton_Connect_toggled(bool checked)
if (rigCap.onoff == 0 || rigGet.onoff == RIG_POWER_ON || rigGet.onoff == RIG_POWER_UNKNOWN)
{
freq_t retfreq;
- retcode = rig_get_freq(my_rig, RIG_VFO_CURR, &retfreq); //double check if rig is on by getting the current frequency
- if (retcode == RIG_OK)
+ retcode = rig_get_freq(my_rig, RIG_VFO_CURR, &retfreq); //double check if rig is on, by getting the current frequency
+ if (retcode==RIG_OK && retfreq!=0)
{
rigGet.onoff = RIG_POWER_ON; //force it for rigCap.onoff = 0 || rigGet.onoff = RIG_POWER_UNKNOWN
timer->start(rigCom.rigRefresh);
diff --git a/rigdaemon.cpp b/rigdaemon.cpp
index 40bb62d..02d76d0 100644
--- a/rigdaemon.cpp
+++ b/rigdaemon.cpp
@@ -66,7 +66,6 @@ RIG *RigDaemon::rigConnect(int *retcode)
//myport.type.rig = RIG_PORT_NETWORK;
strncpy(my_rig->state.rigport.pathname, rigCom.rigPort.toLatin1(), HAMLIB_FILPATHLEN - 1);
my_rig->state.vfo_opt = 1;
- my_rig->state.auto_power_on = 1;
//strncpy(my_rig->state.rigport.pathname, RIG_FILE, HAMLIB_FILPATHLEN - 1);
}
else
@@ -86,6 +85,8 @@ RIG *RigDaemon::rigConnect(int *retcode)
}
}
+ if (rigCom.autoPowerOn) my_rig->state.auto_power_on = 1;
+
*retcode = rig_open(my_rig);
if (*retcode != RIG_OK) return nullptr; //Rig not connected
diff --git a/rigdata.h b/rigdata.h
index 7bf9e1b..3231d6a 100644
--- a/rigdata.h
+++ b/rigdata.h
@@ -35,6 +35,7 @@ typedef struct {
unsigned rigRefresh; //GUI refresh interval (ms)
int connected; //connected flag
bool fullPoll; //full polling flag
+ bool autoPowerOn; //Auto Power ON flag
} rigConnect;
typedef struct {