From 54fa56d42177e89b3e7503519a6069ad54687f84 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Mon, 3 Oct 2016 21:30:02 +0200 Subject: [PATCH] LP-346 RFM22 tuning: Add Gui for tuning. --- .../src/plugins/config/configoplinkwidget.cpp | 7 + ground/gcs/src/plugins/config/oplink.ui | 147 +++++++++++++++--- 2 files changed, 135 insertions(+), 19 deletions(-) diff --git a/ground/gcs/src/plugins/config/configoplinkwidget.cpp b/ground/gcs/src/plugins/config/configoplinkwidget.cpp index 64b39d016..87ecf8255 100644 --- a/ground/gcs/src/plugins/config/configoplinkwidget.cpp +++ b/ground/gcs/src/plugins/config/configoplinkwidget.cpp @@ -84,6 +84,9 @@ ConfigOPLinkWidget::ConfigOPLinkWidget(QWidget *parent) : ConfigTaskWidget(paren addWidgetBinding("OPLinkSettings", "FlexiPort", m_oplink->FlexiPort); addWidgetBinding("OPLinkSettings", "VCPPort", m_oplink->VCPPort); + addWidgetBinding("OPLinkSettings", "RFXtalCap", m_oplink->RFXtalCapValue); + addWidgetBinding("OPLinkSettings", "RFXtalCap", m_oplink->RFXtalCapSlider); + addWidgetBinding("OPLinkStatus", "DeviceID", m_oplink->DeviceID); addWidgetBinding("OPLinkStatus", "RxGood", m_oplink->Good); addWidgetBinding("OPLinkStatus", "RxCorrected", m_oplink->Corrected); @@ -104,6 +107,7 @@ ConfigOPLinkWidget::ConfigOPLinkWidget(QWidget *parent) : ConfigTaskWidget(paren addWidgetBinding("OPLinkStatus", "TXRate", m_oplink->TXRate); addWidgetBinding("OPLinkStatus", "RXPacketRate", m_oplink->RXPacketRate); addWidgetBinding("OPLinkStatus", "TXPacketRate", m_oplink->TXPacketRate); + addWidgetBinding("OPLinkStatus", "AFCCorrection", m_oplink->AFCCorrection); // initially hide port combo boxes setPortsVisible(false); @@ -172,6 +176,9 @@ void ConfigOPLinkWidget::updateStatus() m_oplink->PairSignalStrengthBar1->setValue(linkConnected ? m_oplink->RSSI->text().toInt() : -127); m_oplink->PairSignalStrengthLabel1->setText(QString("%1dB").arg(m_oplink->PairSignalStrengthBar1->value())); + int afc_valueKHz = m_oplink->AFCCorrection->text().toInt() / 1000; + m_oplink->AFCCorrectionBar->setValue(afc_valueKHz); + // Enable components based on the board type connected. switch (oplinkStatusObj->boardType()) { case 0x09: // Revolution, DiscoveryF4Bare, RevoNano, RevoProto diff --git a/ground/gcs/src/plugins/config/oplink.ui b/ground/gcs/src/plugins/config/oplink.ui index 7c074263a..892151857 100644 --- a/ground/gcs/src/plugins/config/oplink.ui +++ b/ground/gcs/src/plugins/config/oplink.ui @@ -776,7 +776,7 @@ Leave blank to use autogenerated Device ID. - + Qt::Vertical @@ -789,7 +789,7 @@ Leave blank to use autogenerated Device ID. - + @@ -1353,6 +1353,22 @@ Leave blank to use autogenerated Device ID. + + + + + 50 + false + + + + RSSI + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + @@ -1391,22 +1407,6 @@ Leave blank to use autogenerated Device ID. - - - - - 50 - false - - - - RSSI - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - @@ -1866,10 +1866,30 @@ Leave blank to use autogenerated Device ID. + + + + AFC Correction + + + + + + + + 101 + 16777215 + + + + The automatic frequency correction in Hz. + + + - + Qt::Horizontal @@ -1882,6 +1902,95 @@ Leave blank to use autogenerated Device ID. + + + + Frequency Tuning + + + + 9 + + + 9 + + + 9 + + + 9 + + + + + The xtal capacitor value for fine tune frequency and get a AFC value close to zero. Default value is 127. + + + 171 + + + 1 + + + 127 + + + Qt::Horizontal + + + + + + + The xtal capacitor value for fine tune frequency and get a AFC value close to zero. Default value is 127. + + + 171 + + + + + + + Xtal Capacitor + + + + + + + The Automatic Frequency Correction: How much the modem will correct a frequency misalignement between the two modems. + + + -50 + + + 50 + + + 0 + + + Qt::AlignCenter + + + true + + + %v KHz + + + + + + + AFC Correction + + + + + +