1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

LP-346 RFM22 tuning: Add Gui for tuning.

This commit is contained in:
Laurent Lalanne 2016-10-03 21:30:02 +02:00
parent 8e1d6f6d86
commit 54fa56d421
2 changed files with 135 additions and 19 deletions

View File

@ -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

View File

@ -776,7 +776,7 @@ Leave blank to use autogenerated Device ID.</string>
</item>
</layout>
</item>
<item row="2" column="0">
<item row="4" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -789,7 +789,7 @@ Leave blank to use autogenerated Device ID.</string>
</property>
</spacer>
</item>
<item row="1" column="0">
<item row="3" column="0">
<widget class="QGroupBox" name="statusGroupBox">
<property name="minimumSize">
<size>
@ -1353,6 +1353,22 @@ Leave blank to use autogenerated Device ID.</string>
</property>
</widget>
</item>
<item row="1" column="6">
<widget class="QLabel" name="RSSILabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>RSSI</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="6">
<widget class="QLabel" name="TXRateLabel">
<property name="font">
@ -1391,22 +1407,6 @@ Leave blank to use autogenerated Device ID.</string>
</property>
</widget>
</item>
<item row="1" column="6">
<widget class="QLabel" name="RSSILabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>RSSI</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QLabel" name="LinkQualityLabel">
<property name="font">
@ -1866,10 +1866,30 @@ Leave blank to use autogenerated Device ID.</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>AFC Correction</string>
</property>
</widget>
</item>
<item row="7" column="3">
<widget class="QLineEdit" name="AFCCorrection">
<property name="maximumSize">
<size>
<width>101</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>The automatic frequency correction in Hz.</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="1">
<item row="3" column="1">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -1882,6 +1902,95 @@ Leave blank to use autogenerated Device ID.</string>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="FrequencyTuning">
<property name="title">
<string>Frequency Tuning</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item row="1" column="1">
<widget class="QSlider" name="RFXtalCapSlider">
<property name="toolTip">
<string>The xtal capacitor value for fine tune frequency and get a AFC value close to zero. Default value is 127.</string>
</property>
<property name="maximum">
<number>171</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>127</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="RFXtalCapValue">
<property name="toolTip">
<string>The xtal capacitor value for fine tune frequency and get a AFC value close to zero. Default value is 127.</string>
</property>
<property name="maximum">
<number>171</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Xtal Capacitor</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QProgressBar" name="AFCCorrectionBar">
<property name="toolTip">
<string>The Automatic Frequency Correction: How much the modem will correct a frequency misalignement between the two modems.</string>
</property>
<property name="minimum">
<number>-50</number>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="textVisible">
<bool>true</bool>
</property>
<property name="format">
<string>%v KHz</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>AFC Correction</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>