#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
SOURCES += \
dialogcommand.cpp \
dialogconfig.cpp \
dialogradioinfo.cpp \
dialogsetup.cpp \
guidata.cpp \
main.cpp \
@ -23,7 +25,9 @@ SOURCES += \
vfodisplay.cpp
HEADERS += \
dialogcommand.h \
dialogconfig.h \
dialogradioinfo.h \
dialogsetup.h \
guidata.h \
mainwindow.h \
@ -35,7 +39,9 @@ HEADERS += \
vfodisplay.h
FORMS += \
dialogcommand.ui \
dialogconfig.ui \
dialogradioinfo.ui \
dialogsetup.ui \
mainwindow.ui

Wyświetl plik

@ -22,11 +22,13 @@
#include "rig.h"
DialogCommand::DialogCommand(QWidget *parent) :
DialogCommand::DialogCommand(RIG *rig, QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogCommand)
{
ui->setupUi(this);
my_rig = rig;
}
DialogCommand::~DialogCommand()
@ -36,7 +38,25 @@ DialogCommand::~DialogCommand()
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_len is the # of bytes to send
//If reply is NULL no answer is expected

Wyświetl plik

@ -20,8 +20,11 @@
#ifndef DIALOGCOMMAND_H
#define DIALOGCOMMAND_H
#include "rig.h"
#include <QDialog>
namespace Ui {
class DialogCommand;
}
@ -31,7 +34,7 @@ class DialogCommand : public QDialog
Q_OBJECT
public:
explicit DialogCommand(QWidget *parent = nullptr);
explicit DialogCommand(RIG *rig, QWidget *parent = nullptr);
~DialogCommand();
private slots:
@ -41,6 +44,8 @@ private slots:
private:
Ui::DialogCommand *ui;
RIG *my_rig;
};
#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 "dialogsetup.h"
#include "dialogcommand.h"
#include "dialogradioinfo.h"
#include "rigdaemon.h"
#include "rigdata.h"
#include "guidata.h"
@ -41,7 +42,7 @@
#include <rig.h> //Hamlib
RIG *my_rig;
//RIG *my_rig;
extern rigConnect rigCom;
extern rigSettings rigGet;
@ -63,6 +64,7 @@ QThread workerThread; //
RigDaemon *rigDaemon = new RigDaemon;
QDialog *command = nullptr;
QDialog *radioInfo = nullptr;
//***** MainWindow *****
@ -334,9 +336,9 @@ void MainWindow::guiInit()
else rigCap.modeSub = 0;
if (my_rig->caps->targetable_vfo == RIG_TARGETABLE_NONE)
{
rigCap.freqSub = 0; //disable get/set freq for subVFO
rigCap.modeSub = 0; //disable get/set mode for subVFO
ui->radioButton_VFOSub->setCheckable(false); //disable VFOsub radio button
rigCap.freqSub = 0; //disable get/set freq for subVFO
rigCap.modeSub = 0; //disable get/set mode for subVFO
ui->radioButton_VFOSub->setCheckable(false); //disable VFOsub radio button
}
//}
//else //NET rigctl, as workaround assume targetable_vfo
@ -345,6 +347,10 @@ void MainWindow::guiInit()
// rigCap.modeSub = 1;
//}
//* Menu
//ui->action_Command->setEnabled(true);
ui->action_RadioInfo->setEnabled(true);
guiCmd.rangeList = 1; //update range list
guiCmd.antList = 1; //update antenna list
guiCmd.toneList = 1; //update tone list
@ -1441,7 +1447,14 @@ void MainWindow::on_action_Setup_triggered()
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;
//command.setModal(true);
@ -1449,7 +1462,7 @@ void MainWindow::on_actionCommand_triggered()
if (!command)
{
command = new DialogCommand(this);
command = new DialogCommand(my_rig, this);
}
command->setModal(false);
command->show();
@ -1500,3 +1513,6 @@ void MainWindow::on_action_CatRadioHomepage_triggered()
QUrl homepage("https://www.pianetaradio.it/blog/catradio/");
QDesktopServices::openUrl(homepage);
}

Wyświetl plik

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

Wyświetl plik

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