diff --git a/ChangeLog.txt b/ChangeLog.txt index cb687db..b4b583e 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -3,6 +3,7 @@ CatRadio (+ New, * Updated, - Removed) 1.4.1 - 2024-xx-xx + + CW memory keyer for Yaesu + Check hamlib version on startup 1.4.0 - 2024-03-17 diff --git a/mainwindow.cpp b/mainwindow.cpp index 7df3d87..b3bae55 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -39,7 +39,6 @@ #include #include #include -#include #include #include //Hamlib @@ -1079,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) { diff --git a/mainwindow.h b/mainwindow.h index 6a618b9..f798edb 100644 --- a/mainwindow.h +++ b/mainwindow.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 @@ -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; diff --git a/mainwindow.ui b/mainwindow.ui index 0e49bee..c295014 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -1765,7 +1765,7 @@ - 2 + 0 @@ -1887,6 +1887,40 @@ CW + + + + 2 + + + + + + + 4 + + + 60 + + + 20 + + + + + + + 4 + + + + + + + 3 + + + @@ -1898,30 +1932,30 @@ - - - - - WPM - - - - - - - 4 - - - 60 - - - 20 - - - - + + + WPM + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + 1 + + + + + + + 5 + + + + Audio Peak Filter @@ -1931,6 +1965,19 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + diff --git a/rigcommand.cpp b/rigcommand.cpp index 5a62dc4..7f09396 100644 --- a/rigcommand.cpp +++ b/rigcommand.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 @@ -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, Yaesu only +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 meter type string to hamlib number unsigned long long levelmeterstr (QString meterString) { unsigned long long levelMeter; diff --git a/rigcommand.h b/rigcommand.h index fc98a09..2eccd05 100644 --- a/rigcommand.h +++ b/rigcommand.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 @@ -29,6 +29,7 @@ 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); diff --git a/rigdaemon.cpp b/rigdaemon.cpp index a87118f..97b6905 100644 --- a/rigdaemon.cpp +++ b/rigdaemon.cpp @@ -116,6 +116,12 @@ void RigDaemon::rigUpdate(RIG *my_rig) rigCmd.ptt = 0; } + if (rigCmd.cwSend) + { + rig_send_morse(my_rig, RIG_VFO_CURR, &rigSet.cwMem); + rigCmd.cwSend = 0; + } + //* VFO if (rigCmd.freqMain) //VFO Main { diff --git a/rigdata.h b/rigdata.h index 6039552..38a255b 100644 --- a/rigdata.h +++ b/rigdata.h @@ -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;