diff --git a/ground/openpilotgcs/src/plugins/pipxtreme/pipxtreme.ui b/ground/openpilotgcs/src/plugins/pipxtreme/pipxtreme.ui index cea93b770..4c155bd50 100644 --- a/ground/openpilotgcs/src/plugins/pipxtreme/pipxtreme.ui +++ b/ground/openpilotgcs/src/plugins/pipxtreme/pipxtreme.ui @@ -6,8 +6,8 @@ 0 0 - 570 - 438 + 571 + 460 @@ -118,7 +118,7 @@ - Serial Number + Serial Number (hex) Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -176,7 +176,7 @@ - Paired Serial Number + Paired Serial Number (hex) Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -214,7 +214,7 @@ - Frequency Band + Frequency Band (MHz) Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -265,7 +265,7 @@ - Min Frequency (MHz) + Min Frequency (Hz) Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -316,7 +316,7 @@ - Max Frequency (MHz) + Max Frequency (Hz) Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -635,6 +635,9 @@ + + false + 16777215 @@ -790,6 +793,9 @@ + + Click to save your new settings into PipX flash + Save to flash diff --git a/ground/openpilotgcs/src/plugins/pipxtreme/pipxtremegadgetwidget.cpp b/ground/openpilotgcs/src/plugins/pipxtreme/pipxtremegadgetwidget.cpp index d0b9f04c1..06afe6dd8 100644 --- a/ground/openpilotgcs/src/plugins/pipxtreme/pipxtremegadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/pipxtreme/pipxtremegadgetwidget.cpp @@ -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) {