Add files via upload

#15
1.3.0
PianetaRadio 2022-11-23 20:17:38 +01:00 zatwierdzone przez GitHub
rodzic 79453ced7b
commit 52bc03e048
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 61 dodań i 48 usunięć

Wyświetl plik

@ -1,32 +1,8 @@
#include "dialogradioinfo.h"
#include "ui_dialogradioinfo.h"
#include "rig.h"
struct rig_type_s
{
int type;
char *description;
};
struct rig_type_s rig_type[] =
{
{RIG_TYPE_OTHER, "Other"},
{RIG_FLAG_RECEIVER, "Receiver"},
{RIG_FLAG_TRANSMITTER, "Transmitter"},
{RIG_FLAG_SCANNER, "Scanner"},
{RIG_FLAG_MOBILE, "Mobile"},
{RIG_FLAG_HANDHELD, "Handheld"},
{RIG_FLAG_COMPUTER, "Computer"},
{RIG_FLAG_TRANSCEIVER, "Transceiver"},
{RIG_FLAG_TRUNKING, "Trunking scanner"},
{RIG_FLAG_APRS, "APRS"},
{RIG_FLAG_TNC, "TNC"},
{RIG_FLAG_DXCLUSTER, "DxCluster"},
{RIG_FLAG_TUNER, "Tuner"},
{-1, "Unknown"}
};
#include <QString>
DialogRadioInfo::DialogRadioInfo(RIG *rig, QWidget *parent) :
@ -34,11 +10,8 @@ DialogRadioInfo::DialogRadioInfo(RIG *rig, QWidget *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);
@ -54,20 +27,60 @@ DialogRadioInfo::DialogRadioInfo(RIG *rig, QWidget *parent) :
text = "Backend version: ";
text.append(my_rig->caps->version);
ui->plainTextEdit_RadioInfo->appendPlainText(text);
text = "Backend status: ";
text.append(rig_strstatus(caps->status));
text.append(rig_strstatus(my_rig->caps->status));
ui->plainTextEdit_RadioInfo->appendPlainText(text);
text = "Rig type: ";
for (int i = 0; rig_type[i].type != -1; ++i)
switch (my_rig->caps->rig_type)
{
if ((rig_type[i].type & caps->rig_type) == rig_type[i].type) text.append(rig_type[i].description);
case RIG_TYPE_OTHER:
text.append("Other");
break;
case RIG_FLAG_RECEIVER:
text.append("Receiver");
break;
case RIG_FLAG_TRANSMITTER:
text.append("Transmitter");
break;
case RIG_FLAG_SCANNER:
text.append("Scanner");
break;
case RIG_FLAG_MOBILE:
text.append("Mobile");
break;
case RIG_FLAG_HANDHELD:
text.append("Handheld");
break;
case RIG_FLAG_COMPUTER:
text.append("Computer");
break;
case RIG_FLAG_TRANSCEIVER:
text.append("Transceiver");
break;
case RIG_FLAG_TRUNKING:
text.append("Trunking scanner");
break;
case RIG_FLAG_APRS:
text.append("APRS");
break;
case RIG_FLAG_TNC:
text.append("TNC");
break;
case RIG_FLAG_DXCLUSTER:
text.append("DxCluster");
break;
case RIG_FLAG_TUNER:
text.append("Tuner");
break;
default:
text.append("Unknown");
}
ui->plainTextEdit_RadioInfo->appendPlainText(text);
text = "Port type: ";
switch (caps->port_type)
switch (my_rig->caps->port_type)
{
case RIG_PORT_SERIAL:
text.append("RS-232");
@ -94,20 +107,20 @@ DialogRadioInfo::DialogRadioInfo(RIG *rig, QWidget *parent) :
text.append("Unknown");
}
ui->plainTextEdit_RadioInfo->appendPlainText(text);
if (caps->port_type == RIG_PORT_SERIAL)
if (my_rig->caps->port_type == RIG_PORT_SERIAL)
{
text = QString("Serial speed: %1..%2 bauds, %3%4%5 %6").arg(
caps->serial_rate_min,
caps->serial_rate_max,
caps->serial_data_bits,
caps->serial_parity == RIG_PARITY_NONE ? 'N' :
caps->serial_parity == RIG_PARITY_ODD ? 'O' :
caps->serial_parity == RIG_PARITY_EVEN ? 'E' :
caps->serial_parity == RIG_PARITY_MARK ? 'M' : 'S',
caps->serial_stop_bits,
caps->serial_handshake == RIG_HANDSHAKE_NONE ? "" :
(caps->serial_handshake == RIG_HANDSHAKE_XONXOFF ? "XONXOFF" : "CTS/RTS")
);
text = QString("Serial speed: %1...%2 bauds, %3%4%5 %6")
.arg(my_rig->caps->serial_rate_min)
.arg(my_rig->caps->serial_rate_max)
.arg(my_rig->caps->serial_data_bits)
.arg(my_rig->caps->serial_parity == RIG_PARITY_NONE ? 'N' :
(my_rig->caps->serial_parity == RIG_PARITY_ODD ? 'O' :
(my_rig->caps->serial_parity == RIG_PARITY_EVEN ? 'E' :
(my_rig->caps->serial_parity == RIG_PARITY_MARK ? 'M' : 'S'))))
.arg(my_rig->caps->serial_stop_bits)
.arg(my_rig->caps->serial_handshake == RIG_HANDSHAKE_NONE ? "" :
(my_rig->caps->serial_handshake == RIG_HANDSHAKE_XONXOFF ? "XONXOFF" : "CTS/RTS"));
ui->plainTextEdit_RadioInfo->appendPlainText(text);
}
}