1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

Merge remote-tracking branch 'origin/Bertrand/OP-1250_Add_GPS_Protocol_Config' into next

This commit is contained in:
Alessio Morale 2014-04-01 21:45:11 +02:00
commit 840e4727fd
4 changed files with 246 additions and 166 deletions

View File

@ -116,8 +116,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>624</width> <width>622</width>
<height>516</height> <height>519</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
@ -227,14 +227,14 @@
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0"> <item row="0" column="1">
<widget class="QLabel" name="telemetrySpeedLabel"> <widget class="QComboBox" name="telemetrySpeed">
<property name="text"> <property name="toolTip">
<string>Telemetry speed:</string> <string>Select the speed here.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="2" column="0">
<widget class="QLabel" name="GpsSpeedLabel"> <widget class="QLabel" name="GpsSpeedLabel">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@ -247,7 +247,28 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="0" column="0">
<widget class="QLabel" name="telemetrySpeedLabel">
<property name="text">
<string>Telemetry speed:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comUsbBridgeSpeed">
<property name="toolTip">
<string>Select the speed here.</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="gpsSpeed">
<property name="toolTip">
<string>Select the speed here.</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="ComUsbBridgeSpeedLabel"> <widget class="QLabel" name="ComUsbBridgeSpeedLabel">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@ -260,26 +281,15 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="3" column="0">
<widget class="QComboBox" name="telemetrySpeed"> <widget class="QLabel" name="GpsProtocolLabel">
<property name="toolTip"> <property name="text">
<string>Select the speed here.</string> <string>GPS protocol :</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="3" column="1">
<widget class="QComboBox" name="gpsSpeed"> <widget class="QComboBox" name="gpsProtocol"/>
<property name="toolTip">
<string>Select the speed here.</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comUsbBridgeSpeed">
<property name="toolTip">
<string>Select the speed here.</string>
</property>
</widget>
</item> </item>
</layout> </layout>
</item> </item>

View File

@ -82,6 +82,9 @@ ConfigCCHWWidget::ConfigCCHWWidget(QWidget *parent) : ConfigTaskWidget(parent)
addWidgetBinding("HwSettings", "USB_VCPPort", m_telemetry->cbUsbVcp); addWidgetBinding("HwSettings", "USB_VCPPort", m_telemetry->cbUsbVcp);
addWidgetBinding("HwSettings", "TelemetrySpeed", m_telemetry->telemetrySpeed); addWidgetBinding("HwSettings", "TelemetrySpeed", m_telemetry->telemetrySpeed);
addWidgetBinding("HwSettings", "GPSSpeed", m_telemetry->gpsSpeed); addWidgetBinding("HwSettings", "GPSSpeed", m_telemetry->gpsSpeed);
// Add Gps protocol configuration
addWidgetBinding("GPSSettings", "DataProtocol", m_telemetry->gpsProtocol);
addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_telemetry->comUsbBridgeSpeed); addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_telemetry->comUsbBridgeSpeed);
connect(m_telemetry->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp())); connect(m_telemetry->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp()));
enableSaveButtons(false); enableSaveButtons(false);

View File

@ -65,6 +65,10 @@ ConfigRevoHWWidget::ConfigRevoHWWidget(QWidget *parent) : ConfigTaskWidget(paren
addWidgetBinding("HwSettings", "GPSSpeed", m_ui->cbMainGPSSpeed); addWidgetBinding("HwSettings", "GPSSpeed", m_ui->cbMainGPSSpeed);
addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_ui->cbMainComSpeed); addWidgetBinding("HwSettings", "ComUsbBridgeSpeed", m_ui->cbMainComSpeed);
// Add Gps protocol configuration
addWidgetBinding("GPSSettings", "DataProtocol", m_ui->cbMainGPSProtocol);
addWidgetBinding("GPSSettings", "DataProtocol", m_ui->cbFlexiGPSProtocol);
connect(m_ui->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp())); connect(m_ui->cchwHelp, SIGNAL(clicked()), this, SLOT(openHelp()));
setupCustomCombos(); setupCustomCombos();
@ -191,6 +195,10 @@ void ConfigRevoHWWidget::flexiPortChanged(int index)
m_ui->cbFlexiComSpeed->setVisible(false); m_ui->cbFlexiComSpeed->setVisible(false);
m_ui->lblFlexiSpeed->setVisible(true); m_ui->lblFlexiSpeed->setVisible(true);
// Add Gps protocol configuration
m_ui->cbFlexiGPSProtocol->setVisible(false);
m_ui->lbFlexiGPSProtocol->setVisible(false);
switch (m_ui->cbFlexi->currentIndex()) { switch (m_ui->cbFlexi->currentIndex()) {
case HwSettings::RM_FLEXIPORT_TELEMETRY: case HwSettings::RM_FLEXIPORT_TELEMETRY:
m_ui->cbFlexiTelemSpeed->setVisible(true); m_ui->cbFlexiTelemSpeed->setVisible(true);
@ -199,6 +207,10 @@ void ConfigRevoHWWidget::flexiPortChanged(int index)
} }
break; break;
case HwSettings::RM_FLEXIPORT_GPS: case HwSettings::RM_FLEXIPORT_GPS:
// Add Gps protocol configuration
m_ui->cbFlexiGPSProtocol->setVisible(true);
m_ui->lbFlexiGPSProtocol->setVisible(true);
m_ui->cbFlexiGPSSpeed->setVisible(true); m_ui->cbFlexiGPSSpeed->setVisible(true);
if (m_ui->cbMain->currentIndex() == HwSettings::RM_MAINPORT_GPS) { if (m_ui->cbMain->currentIndex() == HwSettings::RM_MAINPORT_GPS) {
m_ui->cbMain->setCurrentIndex(HwSettings::RM_MAINPORT_DISABLED); m_ui->cbMain->setCurrentIndex(HwSettings::RM_MAINPORT_DISABLED);
@ -234,6 +246,10 @@ void ConfigRevoHWWidget::mainPortChanged(int index)
m_ui->cbMainComSpeed->setVisible(false); m_ui->cbMainComSpeed->setVisible(false);
m_ui->lblMainSpeed->setVisible(true); m_ui->lblMainSpeed->setVisible(true);
// Add Gps protocol configuration
m_ui->cbMainGPSProtocol->setVisible(false);
m_ui->lbMainGPSProtocol->setVisible(false);
switch (m_ui->cbMain->currentIndex()) { switch (m_ui->cbMain->currentIndex()) {
case HwSettings::RM_MAINPORT_TELEMETRY: case HwSettings::RM_MAINPORT_TELEMETRY:
m_ui->cbMainTelemSpeed->setVisible(true); m_ui->cbMainTelemSpeed->setVisible(true);
@ -242,6 +258,10 @@ void ConfigRevoHWWidget::mainPortChanged(int index)
} }
break; break;
case HwSettings::RM_MAINPORT_GPS: case HwSettings::RM_MAINPORT_GPS:
// Add Gps protocol configuration
m_ui->cbMainGPSProtocol->setVisible(true);
m_ui->lbMainGPSProtocol->setVisible(true);
m_ui->cbMainGPSSpeed->setVisible(true); m_ui->cbMainGPSSpeed->setVisible(true);
if (m_ui->cbFlexi->currentIndex() == HwSettings::RM_FLEXIPORT_GPS) { if (m_ui->cbFlexi->currentIndex() == HwSettings::RM_FLEXIPORT_GPS) {
m_ui->cbFlexi->setCurrentIndex(HwSettings::RM_FLEXIPORT_DISABLED); m_ui->cbFlexi->setCurrentIndex(HwSettings::RM_FLEXIPORT_DISABLED);

View File

@ -27,7 +27,16 @@
<string>HW settings</string> <string>HW settings</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<property name="margin"> <property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
@ -113,16 +122,117 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>818</width> <width>810</width>
<height>673</height> <height>665</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
<property name="margin"> <property name="leftMargin">
<number>12</number> <number>12</number>
</property> </property>
<property name="topMargin">
<number>12</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<number>12</number>
</property>
<item row="0" column="2">
<widget class="QLabel" name="label_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Changes on this page only take effect after board reset or power cycle</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="3">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2"> <item row="2" column="2">
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"> <layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0">
<item row="5" column="0"> <item row="5" column="0">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="sizePolicy"> <property name="sizePolicy">
@ -155,27 +265,7 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="15" column="1"> <item row="19" column="1">
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="spacing">
<number>0</number>
</property>
<item alignment="Qt::AlignTop">
<widget class="QComboBox" name="cbFlexiTelemSpeed">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
<item alignment="Qt::AlignTop">
<widget class="QComboBox" name="cbFlexiGPSSpeed"/>
</item>
<item alignment="Qt::AlignTop">
<widget class="QComboBox" name="cbFlexiComSpeed"/>
</item>
</layout>
</item>
<item row="16" column="1">
<spacer name="horizontalSpacer_7"> <spacer name="horizontalSpacer_7">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -191,13 +281,13 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="14" column="3"> <item row="16" column="3">
<widget class="QLabel" name="lblMainSpeed"> <widget class="QLabel" name="lbMainGPSProtocol">
<property name="text"> <property name="text">
<string>Speed</string> <string>Protocol</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignBottom|Qt::AlignHCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
@ -232,10 +322,46 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="5">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="15" column="1">
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="spacing">
<number>0</number>
</property>
<item alignment="Qt::AlignTop">
<widget class="QComboBox" name="cbFlexiTelemSpeed">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
<item alignment="Qt::AlignTop">
<widget class="QComboBox" name="cbFlexiGPSSpeed"/>
</item>
<item alignment="Qt::AlignTop">
<widget class="QComboBox" name="cbFlexiComSpeed"/>
</item>
</layout>
</item>
<item row="13" column="1"> <item row="13" column="1">
<widget class="QComboBox" name="cbFlexi"/> <widget class="QComboBox" name="cbFlexi"/>
</item> </item>
<item row="16" column="4"> <item row="19" column="4">
<spacer name="horizontalSpacer_8"> <spacer name="horizontalSpacer_8">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -271,22 +397,6 @@
<item row="13" column="3"> <item row="13" column="3">
<widget class="QComboBox" name="cbMain"/> <widget class="QComboBox" name="cbMain"/>
</item> </item>
<item row="10" column="5">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="12" column="3"> <item row="12" column="3">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
@ -471,7 +581,7 @@
<item row="3" column="0"> <item row="3" column="0">
<widget class="QComboBox" name="cbRcvr"/> <widget class="QComboBox" name="cbRcvr"/>
</item> </item>
<item row="16" column="3"> <item row="19" column="3">
<spacer name="horizontalSpacer_9"> <spacer name="horizontalSpacer_9">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -551,7 +661,7 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="16" column="2"> <item row="19" column="2">
<spacer name="horizontalSpacer_10"> <spacer name="horizontalSpacer_10">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -564,100 +674,37 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="14" column="3">
<widget class="QLabel" name="lblMainSpeed">
<property name="text">
<string>Speed</string>
</property>
<property name="alignment">
<set>Qt::AlignBottom|Qt::AlignHCenter</set>
</property>
</widget>
</item>
<item row="16" column="1">
<widget class="QLabel" name="lbFlexiGPSProtocol">
<property name="text">
<string>Protocol</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="18" column="3">
<widget class="QComboBox" name="cbMainGPSProtocol"/>
</item>
<item row="18" column="1">
<widget class="QComboBox" name="cbFlexiGPSProtocol"/>
</item>
</layout> </layout>
</item> </item>
<item row="0" column="2">
<widget class="QLabel" name="label_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Changes on this page only take effect after board reset or power cycle</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="3">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>