kopia lustrzana https://github.com/PianetaRadio/CatRadio
rodzic
79453ced7b
commit
52bc03e048
|
@ -1,32 +1,8 @@
|
||||||
#include "dialogradioinfo.h"
|
#include "dialogradioinfo.h"
|
||||||
#include "ui_dialogradioinfo.h"
|
#include "ui_dialogradioinfo.h"
|
||||||
|
|
||||||
#include "rig.h"
|
#include "rig.h"
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
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"}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
DialogRadioInfo::DialogRadioInfo(RIG *rig, QWidget *parent) :
|
DialogRadioInfo::DialogRadioInfo(RIG *rig, QWidget *parent) :
|
||||||
|
@ -34,11 +10,8 @@ DialogRadioInfo::DialogRadioInfo(RIG *rig, QWidget *parent) :
|
||||||
ui(new Ui::DialogRadioInfo)
|
ui(new Ui::DialogRadioInfo)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
my_rig = rig;
|
my_rig = rig;
|
||||||
|
|
||||||
QString text;
|
QString text;
|
||||||
|
|
||||||
text = "Model: ";
|
text = "Model: ";
|
||||||
text.append(QString::number(my_rig->caps->rig_model));
|
text.append(QString::number(my_rig->caps->rig_model));
|
||||||
ui->plainTextEdit_RadioInfo->appendPlainText(text);
|
ui->plainTextEdit_RadioInfo->appendPlainText(text);
|
||||||
|
@ -54,20 +27,60 @@ DialogRadioInfo::DialogRadioInfo(RIG *rig, QWidget *parent) :
|
||||||
text = "Backend version: ";
|
text = "Backend version: ";
|
||||||
text.append(my_rig->caps->version);
|
text.append(my_rig->caps->version);
|
||||||
ui->plainTextEdit_RadioInfo->appendPlainText(text);
|
ui->plainTextEdit_RadioInfo->appendPlainText(text);
|
||||||
|
|
||||||
text = "Backend status: ";
|
text = "Backend status: ";
|
||||||
text.append(rig_strstatus(caps->status));
|
text.append(rig_strstatus(my_rig->caps->status));
|
||||||
ui->plainTextEdit_RadioInfo->appendPlainText(text);
|
ui->plainTextEdit_RadioInfo->appendPlainText(text);
|
||||||
|
|
||||||
text = "Rig type: ";
|
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);
|
ui->plainTextEdit_RadioInfo->appendPlainText(text);
|
||||||
|
|
||||||
text = "Port type: ";
|
text = "Port type: ";
|
||||||
switch (caps->port_type)
|
switch (my_rig->caps->port_type)
|
||||||
{
|
{
|
||||||
case RIG_PORT_SERIAL:
|
case RIG_PORT_SERIAL:
|
||||||
text.append("RS-232");
|
text.append("RS-232");
|
||||||
|
@ -94,20 +107,20 @@ DialogRadioInfo::DialogRadioInfo(RIG *rig, QWidget *parent) :
|
||||||
text.append("Unknown");
|
text.append("Unknown");
|
||||||
}
|
}
|
||||||
ui->plainTextEdit_RadioInfo->appendPlainText(text);
|
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(
|
text = QString("Serial speed: %1...%2 bauds, %3%4%5 %6")
|
||||||
caps->serial_rate_min,
|
.arg(my_rig->caps->serial_rate_min)
|
||||||
caps->serial_rate_max,
|
.arg(my_rig->caps->serial_rate_max)
|
||||||
caps->serial_data_bits,
|
.arg(my_rig->caps->serial_data_bits)
|
||||||
caps->serial_parity == RIG_PARITY_NONE ? 'N' :
|
.arg(my_rig->caps->serial_parity == RIG_PARITY_NONE ? 'N' :
|
||||||
caps->serial_parity == RIG_PARITY_ODD ? 'O' :
|
(my_rig->caps->serial_parity == RIG_PARITY_ODD ? 'O' :
|
||||||
caps->serial_parity == RIG_PARITY_EVEN ? 'E' :
|
(my_rig->caps->serial_parity == RIG_PARITY_EVEN ? 'E' :
|
||||||
caps->serial_parity == RIG_PARITY_MARK ? 'M' : 'S',
|
(my_rig->caps->serial_parity == RIG_PARITY_MARK ? 'M' : 'S'))))
|
||||||
caps->serial_stop_bits,
|
.arg(my_rig->caps->serial_stop_bits)
|
||||||
caps->serial_handshake == RIG_HANDSHAKE_NONE ? "" :
|
.arg(my_rig->caps->serial_handshake == RIG_HANDSHAKE_NONE ? "" :
|
||||||
(caps->serial_handshake == RIG_HANDSHAKE_XONXOFF ? "XONXOFF" : "CTS/RTS")
|
(my_rig->caps->serial_handshake == RIG_HANDSHAKE_XONXOFF ? "XONXOFF" : "CTS/RTS"));
|
||||||
);
|
|
||||||
ui->plainTextEdit_RadioInfo->appendPlainText(text);
|
ui->plainTextEdit_RadioInfo->appendPlainText(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue