#15
1.3.0
PianetaRadio 2022-11-22 21:47:32 +01:00 zatwierdzone przez GitHub
rodzic bf2b4455ae
commit 31dcbc3255
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
9 zmienionych plików z 170 dodań i 14 usunięć

Wyświetl plik

@ -10,7 +10,9 @@ CONFIG += c++11
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \ SOURCES += \
dialogcommand.cpp \
dialogconfig.cpp \ dialogconfig.cpp \
dialogradioinfo.cpp \
dialogsetup.cpp \ dialogsetup.cpp \
guidata.cpp \ guidata.cpp \
main.cpp \ main.cpp \
@ -23,7 +25,9 @@ SOURCES += \
vfodisplay.cpp vfodisplay.cpp
HEADERS += \ HEADERS += \
dialogcommand.h \
dialogconfig.h \ dialogconfig.h \
dialogradioinfo.h \
dialogsetup.h \ dialogsetup.h \
guidata.h \ guidata.h \
mainwindow.h \ mainwindow.h \
@ -35,7 +39,9 @@ HEADERS += \
vfodisplay.h vfodisplay.h
FORMS += \ FORMS += \
dialogcommand.ui \
dialogconfig.ui \ dialogconfig.ui \
dialogradioinfo.ui \
dialogsetup.ui \ dialogsetup.ui \
mainwindow.ui mainwindow.ui

Wyświetl plik

@ -22,11 +22,13 @@
#include "rig.h" #include "rig.h"
DialogCommand::DialogCommand(QWidget *parent) :
DialogCommand::DialogCommand(RIG *rig, QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::DialogCommand) ui(new Ui::DialogCommand)
{ {
ui->setupUi(this); ui->setupUi(this);
my_rig = rig;
} }
DialogCommand::~DialogCommand() DialogCommand::~DialogCommand()
@ -36,7 +38,25 @@ DialogCommand::~DialogCommand()
void DialogCommand::on_pushButton_send_clicked() void DialogCommand::on_pushButton_send_clicked()
{ {
//int rig_send_raw(rig, unsigned char *send, int send_len, unsigned char *reply, int reply_len, unsigned char term); unsigned char rcvdCmd[100] = "a";
//QString rcvdCmdS;
int rcvdCmdLen = 10;
QString sendCmdS = ui->lineEdit_commandSend->text();
const unsigned char *sendCmd = (unsigned char*)sendCmdS.toLatin1().data();
int sendCmdLen = sendCmdS.size();
unsigned char termCmd[] = ";";
//qDebug()<<sendCmdS<<(char*)termCmd<<(char*)sendCmd<<sendCmdLen;
rig_send_raw(my_rig, sendCmd, sendCmdLen, rcvdCmd, rcvdCmdLen, termCmd);
//sendCmdS = (char*)rcvdCmd;
//qDebug()<<i<<rcvdCmdS<<rcvdCmd<<rcvdCmdLen;
//int rig_send_raw(rig, const unsigned char *send, int send_len, unsigned char *reply, int reply_len, unsigned char *term);
//send contains the raw command data //send contains the raw command data
//send_len is the # of bytes to send //send_len is the # of bytes to send
//If reply is NULL no answer is expected //If reply is NULL no answer is expected

Wyświetl plik

@ -20,8 +20,11 @@
#ifndef DIALOGCOMMAND_H #ifndef DIALOGCOMMAND_H
#define DIALOGCOMMAND_H #define DIALOGCOMMAND_H
#include "rig.h"
#include <QDialog> #include <QDialog>
namespace Ui { namespace Ui {
class DialogCommand; class DialogCommand;
} }
@ -31,7 +34,7 @@ class DialogCommand : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit DialogCommand(QWidget *parent = nullptr); explicit DialogCommand(RIG *rig, QWidget *parent = nullptr);
~DialogCommand(); ~DialogCommand();
private slots: private slots:
@ -41,6 +44,8 @@ private slots:
private: private:
Ui::DialogCommand *ui; Ui::DialogCommand *ui;
RIG *my_rig;
}; };
#endif // DIALOGCOMMAND_H #endif // DIALOGCOMMAND_H

Wyświetl plik

@ -0,0 +1,37 @@
#include "dialogradioinfo.h"
#include "ui_dialogradioinfo.h"
#include "rig.h"
DialogRadioInfo::DialogRadioInfo(RIG *rig, QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogRadioInfo)
{
ui->setupUi(this);
my_rig = rig;
QString text;
text = "Model: ";
text.append(QString::number(my_rig->caps->rig_model));
ui->plainTextEdit_RadioInfo->appendPlainText(text);
text = "Model name: ";
text.append(my_rig->caps->model_name);
ui->plainTextEdit_RadioInfo->appendPlainText(text);
text = "Mfg name: ";
text.append(my_rig->caps->mfg_name);
ui->plainTextEdit_RadioInfo->appendPlainText(text);
text = "Backend version: ";
text.append(my_rig->caps->version);
ui->plainTextEdit_RadioInfo->appendPlainText(text);
}
DialogRadioInfo::~DialogRadioInfo()
{
delete ui;
}

26
dialogradioinfo.h 100644
Wyświetl plik

@ -0,0 +1,26 @@
#ifndef DIALOGRADIOINFO_H
#define DIALOGRADIOINFO_H
#include <QDialog>
#include "rig.h"
namespace Ui {
class DialogRadioInfo;
}
class DialogRadioInfo : public QDialog
{
Q_OBJECT
public:
explicit DialogRadioInfo(RIG *rig, QWidget *parent = nullptr);
~DialogRadioInfo();
private:
Ui::DialogRadioInfo *ui;
RIG *my_rig;
};
#endif // DIALOGRADIOINFO_H

28
dialogradioinfo.ui 100644
Wyświetl plik

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogRadioInfo</class>
<widget class="QDialog" name="DialogRadioInfo">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Radio Info</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QPlainTextEdit" name="plainTextEdit_RadioInfo">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

Wyświetl plik

@ -22,6 +22,7 @@
#include "dialogconfig.h" #include "dialogconfig.h"
#include "dialogsetup.h" #include "dialogsetup.h"
#include "dialogcommand.h" #include "dialogcommand.h"
#include "dialogradioinfo.h"
#include "rigdaemon.h" #include "rigdaemon.h"
#include "rigdata.h" #include "rigdata.h"
#include "guidata.h" #include "guidata.h"
@ -41,7 +42,7 @@
#include <rig.h> //Hamlib #include <rig.h> //Hamlib
RIG *my_rig; //RIG *my_rig;
extern rigConnect rigCom; extern rigConnect rigCom;
extern rigSettings rigGet; extern rigSettings rigGet;
@ -63,6 +64,7 @@ QThread workerThread; //
RigDaemon *rigDaemon = new RigDaemon; RigDaemon *rigDaemon = new RigDaemon;
QDialog *command = nullptr; QDialog *command = nullptr;
QDialog *radioInfo = nullptr;
//***** MainWindow ***** //***** MainWindow *****
@ -334,9 +336,9 @@ void MainWindow::guiInit()
else rigCap.modeSub = 0; else rigCap.modeSub = 0;
if (my_rig->caps->targetable_vfo == RIG_TARGETABLE_NONE) if (my_rig->caps->targetable_vfo == RIG_TARGETABLE_NONE)
{ {
rigCap.freqSub = 0; //disable get/set freq for subVFO rigCap.freqSub = 0; //disable get/set freq for subVFO
rigCap.modeSub = 0; //disable get/set mode for subVFO rigCap.modeSub = 0; //disable get/set mode for subVFO
ui->radioButton_VFOSub->setCheckable(false); //disable VFOsub radio button ui->radioButton_VFOSub->setCheckable(false); //disable VFOsub radio button
} }
//} //}
//else //NET rigctl, as workaround assume targetable_vfo //else //NET rigctl, as workaround assume targetable_vfo
@ -345,6 +347,10 @@ void MainWindow::guiInit()
// rigCap.modeSub = 1; // rigCap.modeSub = 1;
//} //}
//* Menu
//ui->action_Command->setEnabled(true);
ui->action_RadioInfo->setEnabled(true);
guiCmd.rangeList = 1; //update range list guiCmd.rangeList = 1; //update range list
guiCmd.antList = 1; //update antenna list guiCmd.antList = 1; //update antenna list
guiCmd.toneList = 1; //update tone list guiCmd.toneList = 1; //update tone list
@ -1441,7 +1447,14 @@ void MainWindow::on_action_Setup_triggered()
ui->lineEdit_vfoSub->setMode(guiConf.vfoDisplayMode); ui->lineEdit_vfoSub->setMode(guiConf.vfoDisplayMode);
} }
void MainWindow::on_actionCommand_triggered() void MainWindow::on_action_RadioInfo_triggered()
{
if (!radioInfo) radioInfo = new DialogRadioInfo(my_rig, this);
radioInfo->setModal(true);
radioInfo->exec();
}
void MainWindow::on_action_Command_triggered()
{ {
//DialogCommand command; //DialogCommand command;
//command.setModal(true); //command.setModal(true);
@ -1449,7 +1462,7 @@ void MainWindow::on_actionCommand_triggered()
if (!command) if (!command)
{ {
command = new DialogCommand(this); command = new DialogCommand(my_rig, this);
} }
command->setModal(false); command->setModal(false);
command->show(); command->show();
@ -1500,3 +1513,6 @@ void MainWindow::on_action_CatRadioHomepage_triggered()
QUrl homepage("https://www.pianetaradio.it/blog/catradio/"); QUrl homepage("https://www.pianetaradio.it/blog/catradio/");
QDesktopServices::openUrl(homepage); QDesktopServices::openUrl(homepage);
} }

Wyświetl plik

@ -23,6 +23,8 @@
#include <QMainWindow> #include <QMainWindow>
#include <QTimer> #include <QTimer>
#include "rig.h"
#define RELEASE_DATE __DATE__ #define RELEASE_DATE __DATE__
#define VERSION_MAJ 1 #define VERSION_MAJ 1
#define VERSION_MIN 3 #define VERSION_MIN 3
@ -204,12 +206,16 @@ private slots:
void on_checkBox_micMonitor_toggled(bool checked); void on_checkBox_micMonitor_toggled(bool checked);
void on_actionCommand_triggered(); void on_action_Command_triggered();
void on_action_RadioInfo_triggered();
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;
QTimer *timer; QTimer *timer;
RIG *my_rig;
void guiInit(); void guiInit();
void setSubMeter(); void setSubMeter();
}; };

Wyświetl plik

@ -2063,14 +2063,15 @@
<addaction name="action_AboutHamLib"/> <addaction name="action_AboutHamLib"/>
<addaction name="action_AboutQT"/> <addaction name="action_AboutQT"/>
</widget> </widget>
<widget class="QMenu" name="menuUtility"> <widget class="QMenu" name="menu_Utility">
<property name="title"> <property name="title">
<string>Utility</string> <string>Utility</string>
</property> </property>
<addaction name="actionCommand"/> <addaction name="action_RadioInfo"/>
<addaction name="action_Command"/>
</widget> </widget>
<addaction name="menu_Config"/> <addaction name="menu_Config"/>
<addaction name="menuUtility"/> <addaction name="menu_Utility"/>
<addaction name="menu_Help"/> <addaction name="menu_Help"/>
</widget> </widget>
<widget class="QStatusBar" name="statusbar"/> <widget class="QStatusBar" name="statusbar"/>
@ -2104,11 +2105,22 @@
<string>CatRadio homepage</string> <string>CatRadio homepage</string>
</property> </property>
</action> </action>
<action name="actionCommand"> <action name="action_Command">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text"> <property name="text">
<string>Command</string> <string>Command</string>
</property> </property>
</action> </action>
<action name="action_RadioInfo">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Radio info</string>
</property>
</action>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>