kopia lustrzana https://github.com/PianetaRadio/CatRadio
rodzic
2e7641f8f4
commit
ac85aefff8
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 6.0.2, 2022-04-08T17:56:59. -->
|
||||
<!-- Written by QtCreator 6.0.2, 2022-04-11T19:09:53. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
|
|
@ -7,7 +7,8 @@ CatRadio
|
|||
+ Up/Down VFO buttons
|
||||
+ Repeater shift offset
|
||||
+ DCS code and squelch
|
||||
+ COM port list in the communication config dialog
|
||||
+ COM port list in the Radio Config Dialog
|
||||
* Improved Radio Config Dialog
|
||||
* Bug fix: address the proper VFO red during Tx
|
||||
* Bug correction: IF shift slider now correctly updated
|
||||
* Bug fix: CW/FM tab autofocus freeze
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QSerialPortInfo>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "rigdata.h"
|
||||
|
||||
|
@ -85,15 +86,14 @@ DialogConfig::DialogConfig(QWidget *parent) :
|
|||
ui->comboBox_serialSpeed->addItem("115200");
|
||||
|
||||
//* Update values in the GUI
|
||||
ui->comboBox_rigModel->setCurrentIndex(ui->comboBox_rigModel->findText(QString::number(rigCom.rigModel),Qt::MatchStartsWith));
|
||||
if (rigCom.netRigctl)
|
||||
{
|
||||
ui->checkBox_netRigctl->setChecked(rigCom.netRigctl);
|
||||
ui->lineEdit_ip->setText(rigCom.rigPort);
|
||||
ui->comboBox_rigModel->setCurrentIndex(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->comboBox_rigModel->setCurrentIndex(ui->comboBox_rigModel->findText(QString::number(rigCom.rigModel),Qt::MatchStartsWith));
|
||||
ui->comboBox_comPort->setCurrentText(rigCom.rigPort);
|
||||
ui->comboBox_serialSpeed->setCurrentText(QString::number(rigCom.serialSpeed));
|
||||
if (rigCom.civAddr) ui->lineEdit_civAddr->setText(QString::number(rigCom.civAddr,16));
|
||||
|
@ -112,23 +112,56 @@ void DialogConfig::on_buttonBox_accepted()
|
|||
bool civAddrConv;
|
||||
|
||||
//* Read settings from GUI
|
||||
if (ui->checkBox_netRigctl->isChecked())
|
||||
if (ui->comboBox_rigModel->currentText() == "") //No backend selected
|
||||
{
|
||||
rigCom.rigModel = 2;
|
||||
rigCom.netRigctl = true;
|
||||
rigCom.rigPort = ui->lineEdit_ip->text();
|
||||
QMessageBox msgBox; //Show error MessageBox
|
||||
msgBox.setWindowTitle("Warning");
|
||||
msgBox.setText("Rig model not selected");
|
||||
msgBox.setIcon(QMessageBox::Warning);
|
||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||
msgBox.exec();
|
||||
}
|
||||
else
|
||||
{
|
||||
QString rigModel = ui->comboBox_rigModel->currentText();
|
||||
QRegularExpression regexp("[0-9]+");
|
||||
QRegularExpressionMatch rigNumber = regexp.match(rigModel);
|
||||
rigCom.rigModel = rigNumber.captured(0).toInt();
|
||||
QString rigModel = ui->comboBox_rigModel->currentText();
|
||||
QRegularExpression regexp("[0-9]+");
|
||||
QRegularExpressionMatch rigNumber = regexp.match(rigModel);
|
||||
rigCom.rigModel = rigNumber.captured(0).toInt();
|
||||
|
||||
rigCom.rigPort = ui->comboBox_comPort->currentText();
|
||||
rigCom.serialSpeed = ui->comboBox_serialSpeed->currentText().toInt();
|
||||
rigCom.civAddr = ui->lineEdit_civAddr->text().toInt(&civAddrConv,16);
|
||||
if (ui->checkBox_netRigctl->isChecked()) //TCP port
|
||||
{
|
||||
rigCom.netRigctl = true;
|
||||
rigCom.rigPort = ui->lineEdit_ip->text();
|
||||
|
||||
if (rigCom.rigPort == "")
|
||||
{
|
||||
QMessageBox msgBox; //Show error MessageBox
|
||||
msgBox.setWindowTitle("Warning");
|
||||
msgBox.setText(rigModel + "\nIP address not valid");
|
||||
msgBox.setIcon(QMessageBox::Warning);
|
||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||
msgBox.exec();
|
||||
}
|
||||
}
|
||||
else //COM port
|
||||
{
|
||||
rigCom.netRigctl = false;
|
||||
rigCom.rigPort = ui->comboBox_comPort->currentText();
|
||||
rigCom.serialSpeed = ui->comboBox_serialSpeed->currentText().toInt();
|
||||
rigCom.civAddr = ui->lineEdit_civAddr->text().toInt(&civAddrConv,16);
|
||||
|
||||
if (rigCom.rigPort == "" && rigCom.rigModel != 1 && rigCom.rigModel != 6)
|
||||
{
|
||||
QMessageBox msgBox; //Show error MessageBox
|
||||
msgBox.setWindowTitle("Warning");
|
||||
msgBox.setText(rigModel + "\nCOM port not valid");
|
||||
msgBox.setIcon(QMessageBox::Warning);
|
||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||
msgBox.exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rigCom.rigRefresh = ui->spinBox_RefreshRate->value();
|
||||
rigCom.fullPoll = ui->checkBox_fullPoll->isChecked();
|
||||
|
||||
|
@ -153,14 +186,26 @@ int printRigList(const struct rig_caps *rigCaps, void *data) //Load rig list
|
|||
|
||||
void DialogConfig::on_checkBox_netRigctl_toggled(bool checked)
|
||||
{
|
||||
if (checked)
|
||||
if (checked) //TCP port
|
||||
{
|
||||
ui->comboBox_rigModel->setCurrentIndex(2); //set NET rigctl
|
||||
ui->comboBox_comPort->setCurrentText("");
|
||||
ui->comboBox_comPort->setCurrentText(""); //clear COM port
|
||||
}
|
||||
else
|
||||
else //COM port
|
||||
{
|
||||
ui->comboBox_rigModel->setCurrentIndex(0); //set void
|
||||
ui->lineEdit_ip->setText(""); //clear IP address
|
||||
}
|
||||
}
|
||||
|
||||
void DialogConfig::on_comboBox_rigModel_currentIndexChanged(int index)
|
||||
{
|
||||
if (index == 2 || index == 3 || index == 4)
|
||||
{
|
||||
ui->checkBox_netRigctl->setChecked(true);
|
||||
ui->tabWidget_Config->setCurrentIndex(1);
|
||||
}
|
||||
}
|
||||
|
||||
void DialogConfig::on_comboBox_comPort_currentIndexChanged(int index)
|
||||
{
|
||||
if (index) ui->checkBox_netRigctl->setChecked(false); //uncheck TCP
|
||||
}
|
||||
|
|
|
@ -39,6 +39,10 @@ private slots:
|
|||
|
||||
void on_checkBox_netRigctl_toggled(bool checked);
|
||||
|
||||
void on_comboBox_rigModel_currentIndexChanged(int index);
|
||||
|
||||
void on_comboBox_comPort_currentIndexChanged(int index);
|
||||
|
||||
private:
|
||||
Ui::DialogConfig *ui;
|
||||
};
|
||||
|
|
|
@ -7,13 +7,30 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>385</width>
|
||||
<height>336</height>
|
||||
<height>338</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Config</string>
|
||||
<string>Radio Config</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="0,1">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_RigModel">
|
||||
<property name="text">
|
||||
<string>Model</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>comboBox_rigModel</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox_rigModel"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget_Config">
|
||||
<property name="currentIndex">
|
||||
|
@ -25,19 +42,6 @@
|
|||
</attribute>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_RigModel">
|
||||
<property name="text">
|
||||
<string>Model</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>comboBox_rigModel</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="comboBox_rigModel"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_comPort">
|
||||
<property name="text">
|
||||
<string>COM Port</string>
|
||||
|
@ -47,10 +51,10 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="comboBox_comPort"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_serialSpeed">
|
||||
<property name="text">
|
||||
<string>Speed</string>
|
||||
|
@ -60,10 +64,10 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="comboBox_serialSpeed"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_civAddr">
|
||||
<property name="cursor">
|
||||
<cursorShape>ArrowCursor</cursorShape>
|
||||
|
@ -76,7 +80,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="2" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_civAddr">
|
||||
|
@ -218,7 +222,6 @@
|
|||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>tabWidget_Config</tabstop>
|
||||
<tabstop>comboBox_rigModel</tabstop>
|
||||
<tabstop>comboBox_comPort</tabstop>
|
||||
<tabstop>comboBox_serialSpeed</tabstop>
|
||||
<tabstop>lineEdit_civAddr</tabstop>
|
||||
|
|
|
@ -1723,7 +1723,7 @@
|
|||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<action name="action_Connection">
|
||||
<property name="text">
|
||||
<string>Connection</string>
|
||||
<string>Radio</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_AboutCatRadio">
|
||||
|
|
Ładowanie…
Reference in New Issue