kopia lustrzana https://github.com/PianetaRadio/CatRadio
Debug mode
rodzic
94a79d7ff1
commit
0689460b40
|
@ -3,6 +3,7 @@ CatRadio
|
||||||
(+ New, * Updated, - Removed)
|
(+ New, * Updated, - Removed)
|
||||||
|
|
||||||
1.4.0 - 2022-mm-dd
|
1.4.0 - 2022-mm-dd
|
||||||
|
+ Debug mode
|
||||||
* Bug fix: COM port list
|
* Bug fix: COM port list
|
||||||
* Updated to library Hamlib 4.5.4
|
* Updated to library Hamlib 4.5.4
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ DialogSetup::DialogSetup(QWidget *parent) :
|
||||||
if (guiConf.vfoDisplayMode) ui->radioButton_vfoDispMode_UD->setChecked(true);
|
if (guiConf.vfoDisplayMode) ui->radioButton_vfoDispMode_UD->setChecked(true);
|
||||||
if (guiConf.darkTheme) ui->radioButton_themeDark->setChecked(true);
|
if (guiConf.darkTheme) ui->radioButton_themeDark->setChecked(true);
|
||||||
if (guiConf.peakHold) ui->checkBox_peakHold->setChecked(true);
|
if (guiConf.peakHold) ui->checkBox_peakHold->setChecked(true);
|
||||||
|
if (guiConf.debugMode) ui->checkBox_debug->setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogSetup::~DialogSetup()
|
DialogSetup::~DialogSetup()
|
||||||
|
@ -41,10 +42,12 @@ void DialogSetup::on_buttonBox_accepted()
|
||||||
|
|
||||||
guiConf.vfoDisplayMode = ui->radioButton_vfoDispMode_UD->isChecked();
|
guiConf.vfoDisplayMode = ui->radioButton_vfoDispMode_UD->isChecked();
|
||||||
guiConf.darkTheme = ui->radioButton_themeDark->isChecked();
|
guiConf.darkTheme = ui->radioButton_themeDark->isChecked();
|
||||||
|
guiConf.debugMode = ui->checkBox_debug->isChecked();
|
||||||
|
|
||||||
//* Save settings in catradio.ini
|
//* Save settings in catradio.ini
|
||||||
QSettings configFile(QString("catradio.ini"), QSettings::IniFormat);
|
QSettings configFile(QString("catradio.ini"), QSettings::IniFormat);
|
||||||
configFile.setValue("vfoDisplayMode", guiConf.vfoDisplayMode);
|
configFile.setValue("vfoDisplayMode", guiConf.vfoDisplayMode);
|
||||||
configFile.setValue("darkTheme", guiConf.darkTheme);
|
configFile.setValue("darkTheme", guiConf.darkTheme);
|
||||||
configFile.setValue("peakHold", guiConf.peakHold);
|
configFile.setValue("peakHold", guiConf.peakHold);
|
||||||
|
configFile.setValue("debugMode", guiConf.debugMode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,19 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QFrame" name="frame">
|
<widget class="QFrame" name="frame">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
|
@ -88,20 +101,7 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="5" column="0">
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
|
@ -111,6 +111,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QCheckBox" name="checkBox_debug">
|
||||||
|
<property name="text">
|
||||||
|
<string>Debug mode (developers only)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|
|
@ -8,6 +8,7 @@ typedef struct {
|
||||||
int vfoDisplayMode; //0: use Left/Right mouse button, 1: click digit Up or Down
|
int vfoDisplayMode; //0: use Left/Right mouse button, 1: click digit Up or Down
|
||||||
bool darkTheme; //flag for Dark theme
|
bool darkTheme; //flag for Dark theme
|
||||||
bool peakHold; //meters peak hold
|
bool peakHold; //meters peak hold
|
||||||
|
bool debugMode;
|
||||||
} guiConfig;
|
} guiConfig;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -79,14 +79,6 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
|
|
||||||
timer = new QTimer(this); //timer for rigDaemon thread call
|
timer = new QTimer(this); //timer for rigDaemon thread call
|
||||||
|
|
||||||
//* Debug
|
|
||||||
rig_set_debug_level(RIG_DEBUG_WARN); //normal
|
|
||||||
//rig_set_debug_level(RIG_DEBUG_VERBOSE); //debug verbose
|
|
||||||
//rig_set_debug_level(RIG_DEBUG_TRACE); //debug trace
|
|
||||||
rig_set_debug_time_stamp(true);
|
|
||||||
if ((debugFile=fopen("catradio.log","w+")) == NULL) rig_set_debug_level(RIG_DEBUG_NONE);
|
|
||||||
else rig_set_debug_file(debugFile);
|
|
||||||
|
|
||||||
//* Signal and Slot connection for Slider and associated Label
|
//* Signal and Slot connection for Slider and associated Label
|
||||||
connect(ui->verticalSlider_RFpower, &QAbstractSlider::valueChanged, ui->label_RFpowerValue, QOverload<int>::of(&QLabel::setNum));
|
connect(ui->verticalSlider_RFpower, &QAbstractSlider::valueChanged, ui->label_RFpowerValue, QOverload<int>::of(&QLabel::setNum));
|
||||||
connect(ui->verticalSlider_RFgain, &QAbstractSlider::valueChanged, ui->label_RFgainValue, QOverload<int>::of(&QLabel::setNum));
|
connect(ui->verticalSlider_RFgain, &QAbstractSlider::valueChanged, ui->label_RFgainValue, QOverload<int>::of(&QLabel::setNum));
|
||||||
|
@ -121,10 +113,20 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
guiConf.vfoDisplayMode = configFile.value("vfoDisplayMode", 0).toInt();
|
guiConf.vfoDisplayMode = configFile.value("vfoDisplayMode", 0).toInt();
|
||||||
guiConf.darkTheme = configFile.value("darkTheme", false).toBool();
|
guiConf.darkTheme = configFile.value("darkTheme", false).toBool();
|
||||||
guiConf.peakHold = configFile.value("peakHold", true).toBool();
|
guiConf.peakHold = configFile.value("peakHold", true).toBool();
|
||||||
|
guiConf.debugMode = configFile.value("debugMode", false).toBool();
|
||||||
//Window settings
|
//Window settings
|
||||||
restoreGeometry(configFile.value("WindowSettings/geometry").toByteArray());
|
restoreGeometry(configFile.value("WindowSettings/geometry").toByteArray());
|
||||||
restoreState(configFile.value("WindowSettings/state").toByteArray());
|
restoreState(configFile.value("WindowSettings/state").toByteArray());
|
||||||
|
|
||||||
|
//* Debug
|
||||||
|
if (guiConf.debugMode) rig_set_debug_level(RIG_DEBUG_VERBOSE); //debug verbose
|
||||||
|
else rig_set_debug_level(RIG_DEBUG_WARN); //normal
|
||||||
|
//rig_set_debug_level(RIG_DEBUG_VERBOSE); //debug verbose
|
||||||
|
//rig_set_debug_level(RIG_DEBUG_TRACE); //debug trace
|
||||||
|
rig_set_debug_time_stamp(true);
|
||||||
|
if ((debugFile=fopen("catradio.log","w+")) == NULL) rig_set_debug_level(RIG_DEBUG_NONE);
|
||||||
|
else rig_set_debug_file(debugFile);
|
||||||
|
|
||||||
//* Style
|
//* Style
|
||||||
//ui->pushButton_PTT->setStyleSheet("QPushButton::checked {font: bold; color: red;}");
|
//ui->pushButton_PTT->setStyleSheet("QPushButton::checked {font: bold; color: red;}");
|
||||||
|
|
||||||
|
@ -360,7 +362,7 @@ void MainWindow::guiInit()
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//* Menu
|
//* Menu
|
||||||
//ui->action_Command->setEnabled(true);
|
ui->action_Command->setEnabled(true);
|
||||||
ui->action_RadioInfo->setEnabled(true);
|
ui->action_RadioInfo->setEnabled(true);
|
||||||
|
|
||||||
guiCmd.rangeList = 1; //update range list
|
guiCmd.rangeList = 1; //update range list
|
||||||
|
|
Ładowanie…
Reference in New Issue