mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-17 02:52:12 +01:00
Added RSSI dBm value as text to the GUI.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2722 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
14505ed9dc
commit
f6391b1803
@ -125,7 +125,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="lineEdit_SerialNumber">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -183,7 +183,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="lineEdit_FrequencyBand">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -234,7 +234,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="lineEdit_MinFrequency">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -285,7 +285,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="4" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="lineEdit_MaxFrequency">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -336,7 +336,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="5" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="lineEdit_FrequencyStepSize">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -387,7 +387,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<item row="6" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="lineEdit_LinkState">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -429,16 +429,16 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<widget class="QLabel" name="label_RSSI">
|
||||
<property name="text">
|
||||
<string>RSSI (dBm)</string>
|
||||
<string>RSSI</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<item row="7" column="1" colspan="2">
|
||||
<widget class="QProgressBar" name="progressBar_RSSI">
|
||||
<property name="font">
|
||||
<font>
|
||||
@ -462,7 +462,7 @@
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="textVisible">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="textDirection">
|
||||
<enum>QProgressBar::TopToBottom</enum>
|
||||
@ -482,7 +482,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<item row="8" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="lineEdit_RxAFC">
|
||||
<property name="font">
|
||||
<font>
|
||||
@ -515,7 +515,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="lineEdit_FirmwareVersion">
|
||||
<property name="font">
|
||||
<font>
|
||||
@ -541,7 +541,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<item row="2" column="4">
|
||||
<widget class="QSpinBox" name="spinBox_FrequencyCalibration">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -566,7 +566,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<item row="2" column="3">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Frequency Calibration</string>
|
||||
@ -576,7 +576,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<item row="3" column="4">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_Frequency">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -613,7 +613,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<item row="3" column="3">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Frequency (MHz)</string>
|
||||
@ -623,7 +623,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<item row="4" column="4">
|
||||
<widget class="QComboBox" name="comboBox_MaxRFBandwidth">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@ -636,7 +636,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<item row="4" column="3">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Max RF Datarate (bits/s)</string>
|
||||
@ -646,7 +646,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<item row="5" column="4">
|
||||
<widget class="QComboBox" name="comboBox_MaxRFTxPower">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@ -665,7 +665,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<item row="5" column="3">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Max RF Tx Power</string>
|
||||
@ -675,7 +675,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="3">
|
||||
<item row="6" column="4">
|
||||
<widget class="QComboBox" name="comboBox_SerialPortSpeed">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@ -688,7 +688,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<item row="6" column="3">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Serial Port Speed</string>
|
||||
@ -698,7 +698,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Mode</string>
|
||||
@ -708,7 +708,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<item row="0" column="4">
|
||||
<widget class="QComboBox" name="comboBox_Mode">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@ -724,7 +724,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<item row="1" column="4">
|
||||
<widget class="QLineEdit" name="lineEdit_PairedSerialNumber">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -752,7 +752,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<item row="1" column="3">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Paired Serial Number (hex)</string>
|
||||
@ -772,7 +772,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<item row="9" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="lineEdit_Retries">
|
||||
<property name="font">
|
||||
<font>
|
||||
@ -880,7 +880,7 @@
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_Import">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Restore the settings from a file</string>
|
||||
@ -893,7 +893,7 @@
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_Export">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Save the settings into a file</string>
|
||||
|
@ -25,12 +25,11 @@
|
||||
|
||||
#include <QDebug>
|
||||
#include <QtOpenGL/QGLWidget>
|
||||
#include <QSettings>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "pipxtremegadgetwidget.h"
|
||||
|
||||
//#include <aggregation/aggregate.h>
|
||||
|
||||
#define NO_PORT 0
|
||||
#define SERIAL_PORT 1
|
||||
#define USB_PORT 2
|
||||
@ -184,6 +183,8 @@ PipXtremeGadgetWidget::PipXtremeGadgetWidget(QWidget *parent) :
|
||||
m_widget->progressBar_RSSI->setMaximum(-20);
|
||||
m_widget->progressBar_RSSI->setValue(m_widget->progressBar_RSSI->minimum());
|
||||
|
||||
m_widget->label_RSSI->setText("RSSI");
|
||||
|
||||
m_widget->graphicsView_Spectrum->setScene(new QGraphicsScene(this));
|
||||
m_widget->graphicsView_Spectrum->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
|
||||
// m_widget->graphicsView_Spectrum->setViewport(new QWidget);
|
||||
@ -202,6 +203,8 @@ PipXtremeGadgetWidget::PipXtremeGadgetWidget(QWidget *parent) :
|
||||
|
||||
m_widget->pushButton_Save->setEnabled(false);
|
||||
m_widget->pushButton_ScanSpectrum->setEnabled(false);
|
||||
m_widget->pushButton_Import->setEnabled(false);
|
||||
m_widget->pushButton_Export->setEnabled(false);
|
||||
|
||||
QIcon rbi;
|
||||
rbi.addFile(QString(":pipxtreme/images/view-refresh.svg"));
|
||||
@ -229,6 +232,8 @@ PipXtremeGadgetWidget::PipXtremeGadgetWidget(QWidget *parent) :
|
||||
connect(m_widget->pushButton_ScanSpectrum, SIGNAL(clicked()), this, SLOT(scanSpectrum()));
|
||||
connect(m_widget->pushButton_Save, SIGNAL(clicked()), this, SLOT(saveToFlash()));
|
||||
connect(m_widget->lineEdit_AESKey, SIGNAL(textChanged(const QString &)), this, SLOT(textChangedAESKey(const QString &)));
|
||||
connect(m_widget->pushButton_Import, SIGNAL(clicked()), this, SLOT(importSettings()));
|
||||
connect(m_widget->pushButton_Export, SIGNAL(clicked()), this, SLOT(exportSettings()));
|
||||
}
|
||||
|
||||
// destructor .. this never gets called :(
|
||||
@ -868,6 +873,8 @@ void PipXtremeGadgetWidget::processRxPacket(quint8 *packet, int packet_size)
|
||||
|
||||
m_widget->pushButton_Save->setEnabled(true);
|
||||
m_widget->pushButton_ScanSpectrum->setEnabled(true);
|
||||
m_widget->pushButton_Import->setEnabled(true);
|
||||
m_widget->pushButton_Export->setEnabled(true);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -941,6 +948,7 @@ void PipXtremeGadgetWidget::processRxPacket(quint8 *packet, int packet_size)
|
||||
m_widget->progressBar_RSSI->setValue(m_widget->progressBar_RSSI->maximum());
|
||||
else
|
||||
m_widget->progressBar_RSSI->setValue(pipx_config_state.rssi);
|
||||
m_widget->label_RSSI->setText("RSSI " + QString::number(pipx_config_state.rssi) + "dBm");
|
||||
m_widget->lineEdit_RxAFC->setText(QString::number(pipx_config_state.afc) + "Hz");
|
||||
m_widget->lineEdit_Retries->setText(QString::number(pipx_config_state.retries));
|
||||
}
|
||||
@ -1040,6 +1048,8 @@ void PipXtremeGadgetWidget::disconnectPort(bool enable_telemetry, bool lock_stuf
|
||||
m_widget->refreshPorts->setEnabled(true);
|
||||
m_widget->pushButton_ScanSpectrum->setEnabled(false);
|
||||
m_widget->pushButton_Save->setEnabled(false);
|
||||
m_widget->pushButton_Import->setEnabled(false);
|
||||
m_widget->pushButton_Export->setEnabled(false);
|
||||
|
||||
m_widget->lineEdit_FirmwareVersion->setText("");
|
||||
m_widget->lineEdit_SerialNumber->setText("");
|
||||
@ -1049,6 +1059,7 @@ void PipXtremeGadgetWidget::disconnectPort(bool enable_telemetry, bool lock_stuf
|
||||
m_widget->lineEdit_FrequencyStepSize->setText("");
|
||||
m_widget->lineEdit_LinkState->setText("");
|
||||
m_widget->progressBar_RSSI->setValue(m_widget->progressBar_RSSI->minimum());
|
||||
m_widget->label_RSSI->setText("RSSI");
|
||||
m_widget->lineEdit_RxAFC->setText("");
|
||||
m_widget->lineEdit_Retries->setText("");
|
||||
m_widget->lineEdit_PairedSerialNumber->setText("");
|
||||
@ -1213,6 +1224,46 @@ void PipXtremeGadgetWidget::connectDisconnect()
|
||||
connectPort(); // connect
|
||||
}
|
||||
|
||||
// ***************************************************************************************
|
||||
|
||||
void PipXtremeGadgetWidget::importSettings()
|
||||
{
|
||||
QString ini_filename = "pipx_" + QString::number(pipx_config_details.serial_number, 16).rightJustified(8, '0') + ".ini";
|
||||
|
||||
QSettings settings(ini_filename, "OpenPilot");
|
||||
settings.setDefaultFormat(QSettings::IniFormat);
|
||||
|
||||
pipx_config_settings.destination_id = settings.value("settings/paired_serial_number", 0).toUInt();
|
||||
pipx_config_settings.rf_xtal_cap = settings.value("settings/frequency_calibration", 0x7f).toUInt();
|
||||
|
||||
m_widget->lineEdit_PairedSerialNumber->setText(QString::number(pipx_config_settings.destination_id, 16).toUpper());
|
||||
m_widget->spinBox_FrequencyCalibration->setValue(pipx_config_settings.rf_xtal_cap);
|
||||
// m_widget->doubleSpinBox_Frequency->setValue((double)pipx_config_settings.frequency_Hz / 1e6);
|
||||
// m_widget->comboBox_MaxRFBandwidth->setCurrentIndex(m_widget->comboBox_MaxRFBandwidth->findData(pipx_config_settings.max_rf_bandwidth));
|
||||
// m_widget->comboBox_MaxRFTxPower->setCurrentIndex(m_widget->comboBox_MaxRFTxPower->findData(pipx_config_settings.max_tx_power));
|
||||
// m_widget->comboBox_SerialPortSpeed->setCurrentIndex(m_widget->comboBox_SerialPortSpeed->findData(pipx_config_settings.serial_baudrate));
|
||||
//
|
||||
// QString key = "";
|
||||
// for (int i = 0; i < (int)sizeof(pipx_config_settings.aes_key); i++)
|
||||
// key += QString::number(pipx_config_settings.aes_key[i], 16).rightJustified(2, '0');
|
||||
// m_widget->lineEdit_AESKey->setText(key);
|
||||
// m_widget->checkBox_AESEnable->setChecked(pipx_config_settings.aes_enable);
|
||||
|
||||
}
|
||||
|
||||
void PipXtremeGadgetWidget::exportSettings()
|
||||
{
|
||||
|
||||
QString ini_filename = "pipx_" + QString::number(pipx_config_details.serial_number, 16).rightJustified(8, '0') + ".ini";
|
||||
|
||||
QSettings settings(ini_filename, "OpenPilot");
|
||||
settings.setDefaultFormat(QSettings::IniFormat);
|
||||
|
||||
settings.setValue("settings/paired_serial_number", pipx_config_settings.destination_id);
|
||||
settings.setValue("settings/frequency_calibration", pipx_config_settings.rf_xtal_cap);
|
||||
|
||||
}
|
||||
|
||||
// ***************************************************************************************
|
||||
// Shows a message box with an error string.
|
||||
|
||||
|
@ -181,6 +181,8 @@ private:
|
||||
void connectPort();
|
||||
|
||||
private slots:
|
||||
void importSettings();
|
||||
void exportSettings();
|
||||
void connectDisconnect();
|
||||
void error(QString errorString, int errorNumber);
|
||||
void getPorts();
|
||||
|
Loading…
x
Reference in New Issue
Block a user