Porównaj commity

...

7 Commity
v1.4.0 ... main

Autor SHA1 Wiadomość Data
PianetaRadio 8fb790c1eb
CW 2024-04-16 20:34:52 +02:00
PianetaRadio 8fa52c8273
Bug fix IF shift 2024-04-16 19:55:41 +02:00
PianetaRadio f51d68fc0e
FM 2024-04-16 19:50:59 +02:00
PianetaRadio 29682cbad5
CW 2024-04-16 19:46:23 +02:00
PianetaRadio 882558b523
CW memory keyer
Yaesu only
2024-04-13 00:46:59 +02:00
PianetaRadio 0fdc71f98d
Check hamlib version on startup 2024-04-02 21:16:54 +02:00
PianetaRadio 146207cd98
Version 1.4.1 2024-03-17 18:13:15 +01:00
9 zmienionych plików z 211 dodań i 42 usunięć

Wyświetl plik

@ -57,7 +57,7 @@ INCLUDEPATH += $$PWD/hamlib
RESOURCES += qdarkstyle/dark/darkstyle.qrc
# RESOURCES += qdarkstyle/light/lightstyle.qrc
VERSION = 1.4.0
VERSION = 1.4.1
RC_ICONS = catradio.ico

Wyświetl plik

@ -2,6 +2,11 @@ CatRadio
(+ New, * Updated, - Removed)
1.4.1 - 2024-xx-xx
+ CW memory keyer
+ Check hamlib version on startup
* Bug fix: IF shift
1.4.0 - 2024-03-17
+ Auto Connect option
+ Auto Power-on option

Wyświetl plik

@ -193,7 +193,19 @@ MainWindow::MainWindow(QWidget *parent)
ui->lineEdit_vfoMain->setValue(0);
ui->lineEdit_vfoSub->setValue(0);
if (rigCom.autoConnect) ui->pushButton_Connect->toggle(); //Auto connect
//Check Hamlib version
if (!checkHamlibVersion(4, 6, 0))
{
QMessageBox msgBox;
msgBox.setWindowTitle("Hamlib");
msgBox.setText("Please, update Hamlib libraries to version 4.6 or higher.");
msgBox.setIcon(QMessageBox::Warning);
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.exec();
}
//Auto connect
if (rigCom.autoConnect) ui->pushButton_Connect->toggle();
}
MainWindow::~MainWindow()
@ -802,6 +814,32 @@ void MainWindow::setSubMeter()
}
bool MainWindow::checkHamlibVersion(int major, int minor, int revision)
{
QString hamlibVer = rig_version();
QRegularExpression hamlibVerExp("(?P<major>\\d)\\.(?P<minor>\\d)\\.?(?P<revision>\\d)?");
QRegularExpressionMatch hamlibVerMatch = hamlibVerExp.match(hamlibVer);
if (hamlibVerMatch.hasMatch())
{
int majorVer = hamlibVerMatch.captured("major").toInt();
int minorVer = hamlibVerMatch.captured("minor").toInt();
int revisionVer = hamlibVerMatch.captured("revision").toInt();
//qDebug()<<majorVer<<minorVer<<revisionVer;
if (majorVer > major) return true;
else if (majorVer < major) return false;
else if (minorVer > minor) return true; //& majorVer=major
else if (minorVer < minor) return false; //& majorVer=major
else if (revisionVer < revision) return false; //& majorVer=major, minorVer=minor
else return true; //revisionVer>=revision & majorVer=major, minorVer=minor
}
else return false;
}
//***** PushButton *****
void MainWindow::on_pushButton_Connect_toggled(bool checked)
@ -1040,6 +1078,32 @@ void MainWindow::on_pushButton_BandUp_clicked()
rigCmd.bandUp = 1;
}
void MainWindow::on_pushButton_CW1_clicked()
{
send_cw_mem(1);
}
void MainWindow::on_pushButton_CW2_clicked()
{
send_cw_mem(2);
}
void MainWindow::on_pushButton_CW3_clicked()
{
send_cw_mem(3);
}
void MainWindow::on_pushButton_CW4_clicked()
{
send_cw_mem(4);
}
void MainWindow::on_pushButton_CW5_clicked()
{
send_cw_mem(5);
}
//***** CheckBox *****
void MainWindow::on_checkBox_micCompressor_toggled(bool checked)
{
@ -1649,7 +1713,7 @@ void MainWindow::on_action_AboutCatRadio_triggered()
msgBox.setTextFormat(Qt::RichText);
QString version = QString::number(VERSION_MAJ)+"."+QString::number(VERSION_MIN)+"."+QString::number(VERSION_MIC);
msgBox.setText("<b>CatRadio</b> <i>Radio control software</i><br/>version "+version+" "+RELEASE_DATE);
msgBox.setInformativeText("<p>Copyright (C) 2022-2023 Gianfranco Sordetti IZ8EWD<br/>"
msgBox.setInformativeText("<p>Copyright (C) 2022-2024 Gianfranco Sordetti IZ8EWD<br/>"
"<a href='https://www.pianetaradio.it' style='color: #668fb8'>www.pianetaradio.it</a></p>"
"<p>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 the Free Software Foundation, either version 3 of the License, or (at your option) any later version.<br/>"
"This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.<br/>"

Wyświetl plik

@ -1,6 +1,6 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
** Copyright 2022-2024 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** 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
@ -28,7 +28,7 @@
#define RELEASE_DATE __DATE__
#define VERSION_MAJ 1
#define VERSION_MIN 4
#define VERSION_MIC 0
#define VERSION_MIC 1
QT_BEGIN_NAMESPACE
@ -212,6 +212,16 @@ private slots:
void on_action_AboutDarkTheme_triggered();
void on_pushButton_CW1_clicked();
void on_pushButton_CW2_clicked();
void on_pushButton_CW3_clicked();
void on_pushButton_CW4_clicked();
void on_pushButton_CW5_clicked();
private:
Ui::MainWindow *ui;
QTimer *timer;
@ -220,6 +230,8 @@ private:
void guiInit();
void setSubMeter();
bool checkHamlibVersion(int major, int minor, int revision);
};
#endif // MAINWINDOW_H

Wyświetl plik

@ -1765,7 +1765,7 @@
</rect>
</property>
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab_clar">
<property name="autoFillBackground">
@ -1887,6 +1887,49 @@
<string>CW</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="1">
<widget class="QPushButton" name="pushButton_CW2">
<property name="text">
<string>2</string>
</property>
<property name="shortcut">
<string>2</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QSpinBox" name="spinBox_WPM">
<property name="minimum">
<number>4</number>
</property>
<property name="maximum">
<number>60</number>
</property>
<property name="value">
<number>20</number>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QPushButton" name="pushButton_CW4">
<property name="text">
<string>4</string>
</property>
<property name="shortcut">
<string>4</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="pushButton_CW3">
<property name="text">
<string>3</string>
</property>
<property name="shortcut">
<string>3</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="checkBox_BKIN">
<property name="toolTip">
@ -1898,30 +1941,36 @@
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_WPM">
<property name="text">
<string>WPM</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_WPM">
<property name="minimum">
<number>4</number>
</property>
<property name="maximum">
<number>60</number>
</property>
<property name="value">
<number>20</number>
</property>
</widget>
</item>
</layout>
<widget class="QLabel" name="label_WPM">
<property name="text">
<string>WPM</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="pushButton_CW1">
<property name="text">
<string>1</string>
</property>
<property name="shortcut">
<string>1</string>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QPushButton" name="pushButton_CW5">
<property name="text">
<string>5</string>
</property>
<property name="shortcut">
<string>5</string>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QCheckBox" name="checkBox_APF">
<property name="toolTip">
<string>Audio Peak Filter</string>
@ -1931,6 +1980,19 @@
</property>
</widget>
</item>
<item row="0" column="4">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_FM">

Wyświetl plik

@ -1,6 +1,6 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
** Copyright 2022-2024 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** 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
@ -29,6 +29,7 @@ extern rigSettings rigSet;
extern rigCommand rigCmd;
extern rigCommand rigCap;
//* Set band to default frequency or use band change if radio has capability
void set_band (int band)
{
if (rigCap.bandChange==0)
@ -84,6 +85,7 @@ void set_band (int band)
}
}
//* Set split to 5kHz and activate it
void quick_split ()
{
rigSet.freqSub = rigGet.freqMain + 5000;
@ -94,6 +96,14 @@ void quick_split ()
rigCmd.split = 1;
}
//* Send CW keyer message 1-5
void send_cw_mem (int memory)
{
rigSet.cwMem = (char)(memory + '0');
rigCmd.cwSend = 1;
}
//* Convert AGC int value to hamlib enumerated
agc_level_e levelagcvalue (int agcValue)
{
agc_level_e agcLevel;
@ -113,6 +123,7 @@ agc_level_e levelagcvalue (int agcValue)
return agcLevel;
}
//* Convert AGC string to hamlib enumerated
agc_level_e levelagcstr (QString agcString)
{
agc_level_e agcLevel;
@ -128,6 +139,7 @@ agc_level_e levelagcstr (QString agcString)
return agcLevel;
}
//* Convert AGC hamlib enumerated to hamlib value_t
value_t valueagclevel (agc_level_e agcLevel)
{
value_t value;
@ -143,6 +155,7 @@ value_t valueagclevel (agc_level_e agcLevel)
return value;
}
//* Convert antenna string to hamlib ant_t
ant_t antstr (QString antString)
{
ant_t ant;
@ -160,6 +173,7 @@ ant_t antstr (QString antString)
return ant;
}
//* Convert Submeter combo box string into hamlib RIG_LEVEL constant
unsigned long long levelmeterstr (QString meterString)
{
unsigned long long levelMeter;

Wyświetl plik

@ -1,6 +1,6 @@
/**
** This file is part of the CatRadio project.
** Copyright 2022 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
** Copyright 2022-2024 Gianfranco Sordetti IZ8EWD <iz8ewd@pianetaradio.it>.
**
** 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
@ -29,8 +29,9 @@
void set_band (int band);
void quick_split ();
void send_cw_mem (int memory);
agc_level_e levelagcvalue (int agcValue);
agc_level_e levelagcstr (QString agcString);
value_t valueagclevel (agc_level_e agcLevel);
ant_t antstr (QString antString);
unsigned long long levelmeterstr (QString meterString); //Convert Submeter combo box string into Hamlib RIG_LEVEL constant
unsigned long long levelmeterstr (QString meterString);

Wyświetl plik

@ -116,6 +116,14 @@ void RigDaemon::rigUpdate(RIG *my_rig)
rigCmd.ptt = 0;
}
if (rigCmd.cwSend && (rigGet.mode == RIG_MODE_CW || rigGet.mode == RIG_MODE_CWN || rigGet.mode == RIG_MODE_CWR))
{
//if (rig_has_get_func(my_rig, RIG_FUNCTION_SEND_MORSE)) rig_send_morse(my_rig, RIG_VFO_CURR, &rigSet.cwMem);
retcode = rig_send_morse(my_rig, RIG_VFO_CURR, &rigSet.cwMem);
if (retcode == RIG_OK) rigGet.ptt = RIG_PTT_ON; //assume PPT on if send_morse is ok
rigCmd.cwSend = 0;
}
//* VFO
if (rigCmd.freqMain) //VFO Main
{
@ -135,6 +143,12 @@ void RigDaemon::rigUpdate(RIG *my_rig)
//***** Priority Poll execution *****
else
{
//* PTT
ptt_t retptt;
retcode = rig_get_ptt(my_rig, RIG_VFO_CURR, &retptt);
if (retcode == RIG_OK) rigGet.ptt = retptt;
//* VFO
freq_t retfreq;
retcode = rig_get_freq(my_rig, RIG_VFO_CURR, &retfreq); //get VFO Main
if (retcode == RIG_OK) rigGet.freqMain = retfreq;
@ -144,11 +158,6 @@ void RigDaemon::rigUpdate(RIG *my_rig)
if (retcode == RIG_OK) rigGet.freqSub = retfreq;
}
//* PTT
ptt_t retptt;
retcode = rig_get_ptt(my_rig, RIG_VFO_CURR, &retptt);
if (retcode == RIG_OK) rigGet.ptt = retptt;
//* Meter
if (rigGet.ptt == 1 || rigSet.ptt == 1)
{
@ -793,7 +802,7 @@ void RigDaemon::rigUpdate(RIG *my_rig)
//* IF Shift
if ((indexCmd == 17 && !rigGet.ptt && rigCom.fullPoll) || indexCmd == 0)
{
if (rig_has_get_level(my_rig, RIG_LEVEL_NR))
if (rig_has_get_level(my_rig, RIG_LEVEL_IF))
{
rig_get_level(my_rig, RIG_VFO_CURR, RIG_LEVEL_IF, &retvalue);
rigGet.ifShift = retvalue.i;
@ -813,7 +822,7 @@ void RigDaemon::rigUpdate(RIG *my_rig)
}
//* CW
if ((indexCmd == 19 && !rigGet.ptt && rigCom.fullPoll) || indexCmd == 0) //&& mode=CW
if ((indexCmd == 19 && !rigGet.ptt && rigCom.fullPoll && (rigGet.mode == RIG_MODE_CW || rigGet.mode == RIG_MODE_CWN || rigGet.mode == RIG_MODE_CWR)) || indexCmd == 0)
{
if (rig_has_get_func(my_rig, RIG_FUNC_FBKIN)) rig_get_func(my_rig, RIG_VFO_CURR, RIG_FUNC_FBKIN, &rigGet.bkin); //Break-in
if (rig_has_get_func(my_rig, RIG_FUNC_APF)) rig_get_func(my_rig, RIG_VFO_CURR, RIG_FUNC_APF, &rigGet.apf); //Audio Peak Filter
@ -822,7 +831,7 @@ void RigDaemon::rigUpdate(RIG *my_rig)
}
//* FM
if ((indexCmd == 20 && !rigGet.ptt && rigCom.fullPoll) || indexCmd == 0) //&& mode=FM
if ((indexCmd == 20 && !rigGet.ptt && rigCom.fullPoll && (rigGet.mode == RIG_MODE_FM || rigGet.mode == RIG_MODE_WFM || rigGet.mode == RIG_MODE_FMN)) || indexCmd == 0)
{
rig_get_rptr_shift(my_rig, RIG_VFO_CURR, &rigGet.rptShift); //Repeater Shift
rig_get_rptr_offs(my_rig, RIG_VFO_CURR, &rigGet.rptOffset); //Repeater Offset

Wyświetl plik

@ -71,6 +71,7 @@ typedef struct {
int tuner; //Tuner
int bkin; //CW Break-in
int wpm; //CW Keyer speed WPM
char cwMem; //CW memory keyer
int apf; //Audio Peak Filter
int noiseBlanker, noiseBlanker2; //NB
int noiseReduction; //NR
@ -109,9 +110,10 @@ typedef struct {
int tune;
int bandUp, bandDown;
int bandChange;
int bkin;
int wpm;
int apf;
int bkin; //CW break-in
int wpm; //CW wpm
int cwSend; //CW send memory (Yaesu only)
int apf; //CW audio peak filter (Yaesu only)
int noiseBlanker, noiseBlanker2;
int noiseReduction, noiseReductionLevel;
int notchFilter;