From f4ea50026991c129eda3e5c4c7f6e9aa48e05e3e Mon Sep 17 00:00:00 2001 From: PianetaRadio <78976006+PianetaRadio@users.noreply.github.com> Date: Mon, 26 Feb 2024 19:30:25 +0100 Subject: [PATCH] Auto connect #41 --- ChangeLog.txt | 3 ++- dialogconfig.cpp | 5 ++++- dialogconfig.ui | 19 ++++++++++++++++--- mainwindow.cpp | 3 +++ rigdata.h | 3 ++- 5 files changed, 27 insertions(+), 6 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 2e24ab0..438e922 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -2,7 +2,8 @@ CatRadio (+ New, * Updated, - Removed) -1.4.0 - 2023-mm-dd +1.4.0 - 2024-mm-dd + + Auto Connect option + Auto Power-on option + High SWR indicator + Meter peak hold indicator diff --git a/dialogconfig.cpp b/dialogconfig.cpp index 70329c4..dc0dbf2 100644 --- a/dialogconfig.cpp +++ b/dialogconfig.cpp @@ -1,6 +1,6 @@ /** ** This file is part of the CatRadio project. - ** Copyright 2022 Gianfranco Sordetti IZ8EWD . + ** Copyright 2022-2024 Gianfranco Sordetti IZ8EWD . ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -108,6 +108,7 @@ DialogConfig::DialogConfig(QWidget *parent) : } ui->spinBox_RefreshRate->setValue(rigCom.rigRefresh); ui->checkBox_fullPoll->setChecked(rigCom.fullPoll); + ui->checkBox_autoConnect->setChecked(rigCom.autoConnect); ui->checkBox_autoPowerOn->setChecked(rigCom.autoPowerOn); } @@ -173,6 +174,7 @@ void DialogConfig::on_buttonBox_accepted() rigCom.rigRefresh = ui->spinBox_RefreshRate->value(); rigCom.fullPoll = ui->checkBox_fullPoll->isChecked(); + rigCom.autoConnect = ui->checkBox_autoConnect->isChecked(); rigCom.autoPowerOn = ui->checkBox_autoPowerOn->isChecked(); //* Save settings in catradio.ini @@ -184,6 +186,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("autoConnect", ui->checkBox_autoConnect->isChecked()); configFile.setValue("autoPowerOn", ui->checkBox_autoPowerOn->isChecked()); } diff --git a/dialogconfig.ui b/dialogconfig.ui index 6c78e58..ae5ffe5 100644 --- a/dialogconfig.ui +++ b/dialogconfig.ui @@ -6,7 +6,7 @@ 0 0 - 385 + 390 378 @@ -215,10 +215,23 @@ - + + + Auto power-on on startup + - Auto Power ON + Auto power ON + + + + + + + Auto connect on startup + + + Auto connect diff --git a/mainwindow.cpp b/mainwindow.cpp index 272e15f..a9d6da1 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -113,6 +113,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.autoConnect = configFile.value("autoConnect", false).toBool(); rigCom.autoPowerOn = configFile.value("autoPowerOn", false).toBool(); guiConf.vfoDisplayMode = configFile.value("vfoDisplayMode", 0).toInt(); guiConf.darkTheme = configFile.value("darkTheme", false).toBool(); @@ -184,6 +185,8 @@ MainWindow::MainWindow(QWidget *parent) //VFO ui->lineEdit_vfoMain->setValue(0); ui->lineEdit_vfoSub->setValue(0); + + if (rigCom.autoConnect) ui->pushButton_Connect->toggle(); //Auto connect } MainWindow::~MainWindow() diff --git a/rigdata.h b/rigdata.h index e412e98..4a2f792 100644 --- a/rigdata.h +++ b/rigdata.h @@ -1,6 +1,6 @@ /** ** This file is part of the CatRadio project. - ** Copyright 2022 Gianfranco Sordetti IZ8EWD . + ** Copyright 2022-2024 Gianfranco Sordetti IZ8EWD . ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -35,6 +35,7 @@ typedef struct { unsigned rigRefresh; //GUI refresh interval (ms) int connected; //connected flag bool fullPoll; //full polling flag + bool autoConnect; //Auto-connect flag bool autoPowerOn; //Auto Power ON flag } rigConnect;