mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
GCS can now configure PipX modem using the PipX plugin.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2696 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
40e9a592c8
commit
beb1a6e5e8
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>570</width>
|
||||
<height>438</height>
|
||||
<width>571</width>
|
||||
<height>460</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -118,7 +118,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Serial Number</string>
|
||||
<string>Serial Number (hex)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
@ -176,7 +176,7 @@
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Paired Serial Number</string>
|
||||
<string>Paired Serial Number (hex)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
@ -214,7 +214,7 @@
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Frequency Band</string>
|
||||
<string>Frequency Band (MHz)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
@ -265,7 +265,7 @@
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Min Frequency (MHz)</string>
|
||||
<string>Min Frequency (Hz)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
@ -316,7 +316,7 @@
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Max Frequency (MHz)</string>
|
||||
<string>Max Frequency (Hz)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
@ -635,6 +635,9 @@
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QComboBox" name="comboBox_Mode">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
@ -790,6 +793,9 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_Save">
|
||||
<property name="statusTip">
|
||||
<string>Click to save your new settings into PipX flash</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string> Save to flash </string>
|
||||
</property>
|
||||
|
@ -458,7 +458,13 @@ void PipXtremeGadgetWidget::saveToFlash()
|
||||
|
||||
t_pipx_config_data_settings settings;
|
||||
|
||||
s = m_widget->lineEdit_PairedSerialNumber->text().trimmed();
|
||||
s = m_widget->lineEdit_PairedSerialNumber->text().trimmed().toLower();
|
||||
s.replace(' ', ""); // remove all spaces
|
||||
if (s.startsWith("0x"))
|
||||
{
|
||||
s.remove(0, 2);
|
||||
s = s.trimmed();
|
||||
}
|
||||
settings.destination_id = s.toUInt(&ok, 16);
|
||||
if (s.isEmpty() || !ok)
|
||||
{
|
||||
@ -469,6 +475,7 @@ void PipXtremeGadgetWidget::saveToFlash()
|
||||
settings.rf_xtal_cap = m_widget->spinBox_FrequencyCalibration->value();
|
||||
|
||||
s = m_widget->lineEdit_MinFrequency->text().trimmed();
|
||||
s.replace(' ', ""); // remove all spaces
|
||||
settings.min_frequency_Hz = s.toUInt(&ok);
|
||||
if (s.isEmpty() || !ok)
|
||||
{
|
||||
@ -477,6 +484,7 @@ void PipXtremeGadgetWidget::saveToFlash()
|
||||
}
|
||||
|
||||
s = m_widget->lineEdit_MaxFrequency->text().trimmed();
|
||||
s.replace(' ', ""); // remove all spaces
|
||||
settings.max_frequency_Hz = s.toUInt(&ok);
|
||||
if (s.isEmpty() || !ok)
|
||||
{
|
||||
@ -485,6 +493,7 @@ void PipXtremeGadgetWidget::saveToFlash()
|
||||
}
|
||||
|
||||
s = m_widget->doubleSpinBox_Frequency->text().trimmed();
|
||||
s.replace(' ', ""); // remove all spaces
|
||||
settings.frequency_Hz = s.toFloat(&ok) * 1e6;
|
||||
if (s.isEmpty() || !ok || settings.frequency_Hz < settings.min_frequency_Hz || settings.frequency_Hz > settings.max_frequency_Hz)
|
||||
{
|
||||
@ -502,6 +511,7 @@ void PipXtremeGadgetWidget::saveToFlash()
|
||||
|
||||
memset(settings.aes_key, 0, sizeof(settings.aes_key));
|
||||
s = m_widget->lineEdit_AESKey->text().trimmed();
|
||||
s.replace(' ', ""); // remove all spaces
|
||||
if (settings.aes_enable && s.length() != 32)
|
||||
{
|
||||
error("Check your \"AES Key\" entry! .. it must be 32 hex characters long", 0);
|
||||
@ -521,6 +531,7 @@ void PipXtremeGadgetWidget::saveToFlash()
|
||||
}
|
||||
|
||||
s = m_widget->lineEdit_FrequencyBand->text().trimmed();
|
||||
s.replace(' ', ""); // remove all spaces
|
||||
if (s == "434") settings.frequency_band = freqBand_434MHz;
|
||||
else
|
||||
if (s == "868") settings.frequency_band = freqBand_868MHz;
|
||||
@ -533,6 +544,7 @@ void PipXtremeGadgetWidget::saveToFlash()
|
||||
}
|
||||
|
||||
s = m_widget->lineEdit_FrequencyStepSize->text().trimmed();
|
||||
s.replace(' ', ""); // remove all spaces
|
||||
settings.frequency_step_size = s.toFloat(&ok);
|
||||
if (s.isEmpty() || !ok)
|
||||
{
|
||||
@ -541,6 +553,7 @@ void PipXtremeGadgetWidget::saveToFlash()
|
||||
}
|
||||
|
||||
s = m_widget->lineEdit_SerialNumber->text().trimmed();
|
||||
s.replace(' ', ""); // remove all spaces
|
||||
uint32_t serial_number = s.toUInt(&ok, 16);
|
||||
if (s.isEmpty() || !ok || serial_number == 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user