diff --git a/ground/openpilotgcs/src/plugins/config/configgadget.qrc b/ground/openpilotgcs/src/plugins/config/configgadget.qrc
index ff81d79fb..a5b006745 100644
--- a/ground/openpilotgcs/src/plugins/config/configgadget.qrc
+++ b/ground/openpilotgcs/src/plugins/config/configgadget.qrc
@@ -30,5 +30,6 @@
images/camstab_normal.png
images/pipx-selected.png
images/pipx-normal.png
+ images/revolution_top.png
diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp
index 61c63e794..a0fc602b8 100644
--- a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp
+++ b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp
@@ -232,7 +232,7 @@ void ConfigGadgetWidget::onAutopilotConnect() {
icon = new QIcon();
icon->addFile(":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal, QIcon::Off);
- icon->addFile(":/configgadget/images/hardware_selected.png", QSize(), QIcon::Normal, QIcon::On);
+ icon->addFile(":/configgadget/images/hardware_selected.png", QSize(), QIcon::Selected, QIcon::Off);
qwd = new ConfigRevoHWWidget(this);
ftw->removeTab(ConfigGadgetWidget::hardware);
ftw->insertTab(ConfigGadgetWidget::hardware, qwd, *icon, QString("Hardware"));
diff --git a/ground/openpilotgcs/src/plugins/config/configrevohwwidget.cpp b/ground/openpilotgcs/src/plugins/config/configrevohwwidget.cpp
index f1abd4b62..532dc3b48 100644
--- a/ground/openpilotgcs/src/plugins/config/configrevohwwidget.cpp
+++ b/ground/openpilotgcs/src/plugins/config/configrevohwwidget.cpp
@@ -27,11 +27,9 @@
#include "configrevohwwidget.h"
#include
-#include
-#include
-#include
-#include
-#include
+#include
+#include
+#include "hwsettings.h"
ConfigRevoHWWidget::ConfigRevoHWWidget(QWidget *parent) : ConfigTaskWidget(parent)
@@ -39,18 +37,139 @@ ConfigRevoHWWidget::ConfigRevoHWWidget(QWidget *parent) : ConfigTaskWidget(paren
m_ui = new Ui_RevoHWWidget();
m_ui->setupUi(this);
+ ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
+ Core::Internal::GeneralSettings *settings = pm->getObject();
+ if(!settings->useExpertMode()) {
+ m_ui->saveTelemetryToRAM->setEnabled(false);
+ m_ui->saveTelemetryToRAM->setVisible(false);
+ }
+
addApplySaveButtons(m_ui->saveTelemetryToRAM, m_ui->saveTelemetryToSD);
- addUAVObjectToWidgetRelation("HwSettings", "TelemetrySpeed", m_ui->telemetrySpeed);
- enableControls(false);
+ addUAVObjectToWidgetRelation("HwSettings","RM_FlexiPort",m_ui->cbFlexi);
+ addUAVObjectToWidgetRelation("HwSettings","RM_MainPort",m_ui->cbMain);
+ addUAVObjectToWidgetRelation("HwSettings","RM_RcvrPort",m_ui->cbRcvr);
+
+ addUAVObjectToWidgetRelation("HwSettings","USB_HIDPort",m_ui->cbUSBHIDFunction);
+ addUAVObjectToWidgetRelation("HwSettings","USB_VCPPort",m_ui->cbUSBVCPFunction);
+ addUAVObjectToWidgetRelation("HwSettings","ComUsbBridgeSpeed",m_ui->cbUSBVCPSpeed);
+
+ addUAVObjectToWidgetRelation("HwSettings","TelemetrySpeed",m_ui->cbFlexiTelemSpeed);
+ addUAVObjectToWidgetRelation("HwSettings","GPSSpeed",m_ui->cbFlexiGPSSpeed);
+ addUAVObjectToWidgetRelation("HwSettings","ComUsbBridgeSpeed",m_ui->cbFlexiComSpeed);
+
+ addUAVObjectToWidgetRelation("HwSettings","TelemetrySpeed",m_ui->cbMainTelemSpeed);
+ addUAVObjectToWidgetRelation("HwSettings","GPSSpeed",m_ui->cbMainGPSSpeed);
+ addUAVObjectToWidgetRelation("HwSettings","ComUsbBridgeSpeed",m_ui->cbMainComSpeed);
+
+ addUAVObjectToWidgetRelation("HwSettings","RadioPort",m_ui->cbModem);
+ setupCustomCombos();
+ enableControls(true);
populateWidgets();
- refreshWidgetsValues(NULL);
+ refreshWidgetsValues();
+ forceConnectedState();
}
ConfigRevoHWWidget::~ConfigRevoHWWidget()
{
- // Do nothing
+ // Do nothing
}
+void ConfigRevoHWWidget::setupCustomCombos()
+{
+ m_ui->cbUSBType->addItem(tr("HID"), USB_HID);
+ m_ui->cbUSBType->addItem(tr("VCP"), USB_VCP);
+ connect(m_ui->cbUSBType, SIGNAL(currentIndexChanged(int)), this, SLOT(usbTypeChanged(int)));
+
+ m_ui->cbSonar->addItem(tr("Disabled"));
+ m_ui->cbSonar->setCurrentIndex(0);
+ m_ui->cbSonar->setEnabled(false);
+
+ connect(m_ui->cbFlexi, SIGNAL(currentIndexChanged(int)), this, SLOT(flexiPortChanged(int)));
+ connect(m_ui->cbMain, SIGNAL(currentIndexChanged(int)), this, SLOT(mainPortChanged(int)));
+
+}
+
+void ConfigRevoHWWidget::refreshWidgetsValues(UAVObject *obj)
+{
+ ConfigTaskWidget::refreshWidgetsValues(obj);
+ HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager());
+ HwSettings::DataFields data = hwSettings->getData();
+ if(data.USB_HIDPort != HwSettings::USB_HIDPORT_DISABLED){
+ m_ui->cbUSBType->setCurrentIndex(m_ui->cbUSBType->findData(USB_HID));
+ }
+ else {
+ m_ui->cbUSBType->setCurrentIndex(m_ui->cbUSBType->findData(USB_VCP));
+ }
+ usbTypeChanged(m_ui->cbUSBType->currentIndex());
+ mainPortChanged(0);
+ flexiPortChanged(0);
+}
+
+void ConfigRevoHWWidget::usbTypeChanged(int index)
+{
+ Q_UNUSED(index);
+
+ bool hid = m_ui->cbUSBType->itemData(m_ui->cbUSBType->currentIndex()) == USB_HID;
+ m_ui->cbUSBHIDFunction->setVisible(hid);
+ m_ui->cbUSBVCPFunction->setVisible(!hid);
+
+ m_ui->lblUSBVCPSpeed->setVisible(!hid);
+ m_ui->cbUSBVCPSpeed->setVisible(!hid);
+}
+
+void ConfigRevoHWWidget::flexiPortChanged(int index)
+{
+ Q_UNUSED(index);
+
+ m_ui->cbFlexiTelemSpeed->setVisible(false);
+ m_ui->cbFlexiGPSSpeed->setVisible(false);
+ m_ui->cbFlexiComSpeed->setVisible(false);
+ m_ui->lblFlexiSpeed->setVisible(true);
+
+ int value = m_ui->cbFlexi->currentIndex();
+ switch(value)
+ {
+ case HwSettings::RM_FLEXIPORT_TELEMETRY:
+ m_ui->cbFlexiTelemSpeed->setVisible(true);
+ break;
+ case HwSettings::RM_FLEXIPORT_GPS:
+ m_ui->cbFlexiGPSSpeed->setVisible(true);
+ break;
+ case HwSettings::RM_FLEXIPORT_COMBRIDGE:
+ m_ui->cbFlexiComSpeed->setVisible(true);
+ break;
+ default:
+ m_ui->lblFlexiSpeed->setVisible(false);
+ break;
+ }
+}
+
+void ConfigRevoHWWidget::mainPortChanged(int index)
+{
+ Q_UNUSED(index);
+
+ m_ui->cbMainTelemSpeed->setVisible(false);
+ m_ui->cbMainGPSSpeed->setVisible(false);
+ m_ui->cbMainComSpeed->setVisible(false);
+ m_ui->lblMainSpeed->setVisible(true);
+
+ int value = m_ui->cbMain->currentIndex();
+ switch(value)
+ {
+ case HwSettings::RM_FLEXIPORT_TELEMETRY:
+ m_ui->cbMainTelemSpeed->setVisible(true);
+ break;
+ case HwSettings::RM_FLEXIPORT_GPS:
+ m_ui->cbMainGPSSpeed->setVisible(true);
+ break;
+ case HwSettings::RM_FLEXIPORT_COMBRIDGE:
+ m_ui->cbMainComSpeed->setVisible(true);
+ break;
+ default:
+ m_ui->lblMainSpeed->setVisible(false);
+ break;
+ }
+}
/**
Request telemetry settings from the board
diff --git a/ground/openpilotgcs/src/plugins/config/configrevohwwidget.h b/ground/openpilotgcs/src/plugins/config/configrevohwwidget.h
index 84aa3c075..7e4bd4c16 100644
--- a/ground/openpilotgcs/src/plugins/config/configrevohwwidget.h
+++ b/ground/openpilotgcs/src/plugins/config/configrevohwwidget.h
@@ -45,10 +45,18 @@ public:
~ConfigRevoHWWidget();
private:
+ enum {USB_HID, USB_VCP};
Ui_RevoHWWidget *m_ui;
+ void setupCustomCombos();
+
+protected slots:
+ void refreshWidgetsValues(UAVObject * obj = NULL);
private slots:
virtual void refreshValues();
+ void usbTypeChanged(int index);
+ void flexiPortChanged(int index);
+ void mainPortChanged(int index);
};
diff --git a/ground/openpilotgcs/src/plugins/config/configrevohwwidget.ui b/ground/openpilotgcs/src/plugins/config/configrevohwwidget.ui
index e8cc05dd1..6814108c9 100644
--- a/ground/openpilotgcs/src/plugins/config/configrevohwwidget.ui
+++ b/ground/openpilotgcs/src/plugins/config/configrevohwwidget.ui
@@ -6,8 +6,8 @@
0
0
- 505
- 389
+ 834
+ 742
@@ -15,112 +15,798 @@
-
-
-
- QFrame::StyledPanel
+
+
+ 0
-
- QFrame::Raised
-
-
-
-
-
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:7.8pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">Set the serial speed of your onboard telemetry modem here. It is the speed between the OpenPilot board and the onboard modem, and could be different from the radio link speed.</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"><br /></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">Beware of not locking yourself out! You should only modify this setting when the OpenPilot board is connected through the USB port.</span></p></body></html>
-
-
-
- -
-
-
-
-
-
-
- 11
- 75
- true
-
-
-
- Telemetry speed:
+
+
+ HW settings
+
+
+
+ 0
+
+
-
+
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+ 232
+ 232
+ 232
+
+
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+ 232
+ 232
+ 232
+
+
+
+
+
+
+
+
+ 232
+ 232
+ 232
+
+
+
+
+
+
+ 232
+ 232
+ 232
+
+
+
+
+
+
+
+ QFrame::NoFrame
+
+
+ QFrame::Plain
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 806
+ 654
+
+
+
+ 12
+
+
-
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 25
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 500
+ 0
+
+
+
+
+ 500
+ 16777215
+
+
+
+
+ 75
+ true
+
+
+
+ Changes on this page only take effect after board reset or power cycle
+
+
+ Qt::AlignCenter
+
+
+ true
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 10
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
-
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Minimum
+
+
+
+ 120
+ 10
+
+
+
+
+ -
+
+
+ Sonar Port
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Fixed
+
+
+
+ 50
+ 10
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Function
+
+
+ Qt::AlignBottom|Qt::AlignHCenter
+
+
+
+ -
+
+
+ Main Port
+
+
+ Qt::AlignBottom|Qt::AlignHCenter
+
+
+
+ -
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Receiver Port
+
+
+ Qt::AlignBottom|Qt::AlignHCenter
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 25
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 120
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 350
+ 350
+
+
+
+
+
+
+ :/configgadget/images/revolution_top.png
+
+
+ false
+
+
+ Qt::AlignCenter
+
+
+ Qt::NoTextInteraction
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ USB Type
+
+
+ Qt::AlignBottom|Qt::AlignHCenter
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ Speed
+
+
+ Qt::AlignBottom|Qt::AlignHCenter
+
+
+
+ -
+
+
+ false
+
+
+
+ -
+
+
+ Speed
+
+
+ Qt::AlignBottom|Qt::AlignHCenter
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ Radio
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+ Flexi Port
+
+
+ Qt::AlignBottom|Qt::AlignHCenter
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Minimum
+
+
+
+ 120
+ 10
+
+
+
+
+ -
+
+
+ Speed
+
+
+ Qt::AlignBottom|Qt::AlignHCenter
+
+
+
+ -
+
+
+ 0
+
+
-
+
+
+ true
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ 0
+
+
-
+
+
+ true
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ true
+
+
+
+ -
+
+
+ 0
+
+
-
+
+
+ -
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Minimum
+
+
+
+ 120
+ 10
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Minimum
+
+
+
+ 120
+ 10
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Minimum
+
+
+
+ 120
+ 10
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Minimum
+
+
+
+ 20
+ 16
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Minimum
+
+
+
+ 20
+ 22
+
+
+
+
+
+
+
-
- -
-
-
- Select the speed here.
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
- -
-
-
- 4
-
-
-
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- Send to OpenPilot but don't write in SD.
-Beware of not locking yourself out!
-
-
- Apply
-
-
-
- -
-
-
- Applies and Saves all settings to SD.
-Beware of not locking yourself out!
-
-
- Save
-
-
-
-
-
-
+
+
+
+
+ -
+
+
+ 4
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 369
+ 20
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 25
+ 25
+
+
+
+
+ 25
+ 25
+
+
+
+ Takes you to the wiki page
+
+
+
+
+
+
+ :/core/images/helpicon.svg:/core/images/helpicon.svg
+
+
+
+ 25
+ 25
+
+
+
+ true
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 16777215
+ 16777215
+
+
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+ 232
+ 232
+ 232
+
+
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+ 232
+ 232
+ 232
+
+
+
+
+
+
+
+
+ 232
+ 232
+ 232
+
+
+
+
+
+
+ 232
+ 232
+ 232
+
+
+
+
+
+
+
+ Send to OpenPilot but don't write in SD.
+Beware of not locking yourself out!
+
+
+ false
+
+
+
+
+
+ Apply
+
+
+
+ 16
+ 16
+
+
+
+ false
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 16777215
+ 16777215
+
+
+
+ Applies and Saves all settings to SD.
+Beware of not locking yourself out!
+
+
+ false
+
+
+
+
+
+ Save
+
+
+
+
+
-
+
+
+
+
diff --git a/ground/openpilotgcs/src/plugins/config/images/revolution_top.png b/ground/openpilotgcs/src/plugins/config/images/revolution_top.png
new file mode 100644
index 000000000..633c424df
Binary files /dev/null and b/ground/openpilotgcs/src/plugins/config/images/revolution_top.png differ