From faaa60862f6c157ec061742e2f39f5851cae3999 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Mon, 1 May 2017 00:22:08 +0200 Subject: [PATCH] LP-505 Refactor OPlink tab GUI --- .../src/plugins/config/configoplinkwidget.cpp | 28 +- .../src/plugins/config/configoplinkwidget.h | 2 +- ground/gcs/src/plugins/config/oplink.ui | 2049 +++++++++-------- 3 files changed, 1065 insertions(+), 1014 deletions(-) diff --git a/ground/gcs/src/plugins/config/configoplinkwidget.cpp b/ground/gcs/src/plugins/config/configoplinkwidget.cpp index 89d57c4d6..ad42e8264 100644 --- a/ground/gcs/src/plugins/config/configoplinkwidget.cpp +++ b/ground/gcs/src/plugins/config/configoplinkwidget.cpp @@ -113,8 +113,8 @@ ConfigOPLinkWidget::ConfigOPLinkWidget(QWidget *parent) : ConfigTaskWidget(paren addWidgetBinding("OPLinkStatus", "TXPacketRate", m_oplink->TXPacketRate); addWidgetBinding("OPLinkStatus", "AFCCorrection", m_oplink->AFCCorrection); - // initially hide port combo boxes - setPortsVisible(false); + // initially hide Oplink Mini options + setOPLMOptionsVisible(false); // Connect the selection changed signals. connect(m_oplink->Protocol, SIGNAL(currentIndexChanged(int)), this, SLOT(protocolChanged())); @@ -189,10 +189,10 @@ void ConfigOPLinkWidget::updateStatus() switch (oplinkStatusObj->boardType()) { case 0x09: // Revolution, DiscoveryF4Bare, RevoNano, RevoProto case 0x92: // Sparky2 - setPortsVisible(false); + setOPLMOptionsVisible(false); break; case 0x03: // OPLinkMini - setPortsVisible(true); + setOPLMOptionsVisible(true); break; default: // This shouldn't happen. @@ -206,24 +206,10 @@ void ConfigOPLinkWidget::updateStatus() } } -void ConfigOPLinkWidget::setPortsVisible(bool visible) +void ConfigOPLinkWidget::setOPLMOptionsVisible(bool visible) { - m_oplink->UartsLabel->setVisible(visible); - m_oplink->MainPort->setVisible(visible); - m_oplink->MainPortLabel->setVisible(visible); - m_oplink->FlexiPort->setVisible(visible); - m_oplink->FlexiPortLabel->setVisible(visible); - m_oplink->ConnectionsLabel->setVisible(visible); - m_oplink->RadioPriStream->setVisible(visible); - m_oplink->RadioPriStreamLabel->setVisible(visible); - m_oplink->RadioAuxStream->setVisible(visible); - m_oplink->RadioAuxStreamLabel->setVisible(visible); - m_oplink->MainComSpeed->setVisible(visible); - m_oplink->MainComSpeedLabel->setVisible(visible); - m_oplink->FlexiComSpeed->setVisible(visible); - m_oplink->FlexiComSpeedLabel->setVisible(visible); - m_oplink->VCPBridge->setVisible(visible); - m_oplink->VCPBridgeLabel->setVisible(visible); + m_oplink->UartsGroupBox->setVisible(visible); + m_oplink->ConnectionsGroupBox->setVisible(visible); } void ConfigOPLinkWidget::updateInfo() diff --git a/ground/gcs/src/plugins/config/configoplinkwidget.h b/ground/gcs/src/plugins/config/configoplinkwidget.h index 25e9a1b7c..f8b72d4cb 100644 --- a/ground/gcs/src/plugins/config/configoplinkwidget.h +++ b/ground/gcs/src/plugins/config/configoplinkwidget.h @@ -62,7 +62,7 @@ private: void updateInfo(); void updateSettings(); - void setPortsVisible(bool visible); + void setOPLMOptionsVisible(bool visible); private slots: void connected(); diff --git a/ground/gcs/src/plugins/config/oplink.ui b/ground/gcs/src/plugins/config/oplink.ui index 0ce5929db..7616704e2 100644 --- a/ground/gcs/src/plugins/config/oplink.ui +++ b/ground/gcs/src/plugins/config/oplink.ui @@ -55,885 +55,12 @@ 0 0 - 926 - 647 + 936 + 754 - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - true - - - - 0 - 0 - - - - - 900 - 16777215 - - - - - 50 - false - - - - Configuration - - - - - - - 0 - 0 - - - - - 90 - 16777215 - - - - - 50 - false - - - - This is the coordinator ID we currently are bound to. -To manually bind to a specific coordinator, just type -or paste its device ID in this box and save. -The device must be rebooted for the binding to take place. - - - 8 - - - Qt::LogicalMoveStyle - - - false - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 90 - 16777215 - - - - - 50 - false - - - - Qt::StrongFocus - - - Enter your custom ID for this device as a hexadecimal value, -this allows device clones. Be sure only one device with this -ID transmits at the same time! -Leave blank to use autogenerated Device ID. - - - 8 - - - true - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - false - - - - - - Qt::LogicalMoveStyle - - - false - - - - - - - - 0 - 0 - - - - - 50 - true - - - - Serial Ports - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 50 - false - - - - Main Port - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Choose a function for the main port. - - - - - - - - 50 - false - - - - Speed - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 16777215 - 16777215 - - - - Choose the baud rate for the main com port. - - - - - - - - 50 - false - - - - Flexi Port - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Choose a function for the flexi port. - - - - - - - - 50 - false - - - - Speed - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 16777215 - 16777215 - - - - Choose the baud rate for the main com port. - - - - - - - - 0 - 0 - - - - - 50 - true - - - - Connections - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 50 - false - - - - Radio Primary - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Choose a destination for the primary radio stream. - - - - - - - - 50 - false - - - - Air Data Rate - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 90 - 16777215 - - - - Choose the over-the-air baud rate for the radio. - - - - - - - - 50 - false - - - - Radio Auxiliary - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 16777215 - 16777215 - - - - Choose a destination for the auxiliary radio stream. - - - - - - - - 50 - false - - - - VCP Bridge - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 16777215 - 16777215 - - - - Choose a destination for the Virtual Com Port bridge connection. - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - 50 - false - - - - Max Chan - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 16777215 - 16777215 - - - - Set the modem protocol - - - Qt::LeftToRight - - - 0 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 0 - 0 - - - - - 60 - 16777215 - - - - - 50 - false - - - - Channel 0 is 430 MHz, channel 250 is 440 MHz, and the channel spacing is 40 KHz. - - - 250 - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - 440.000 (MHz) - - - - - - - - - Qt::NoFocus - - - Clear the binding/coordinator ID - - - Unbind - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - 50 - false - - - - Min Chan - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 50 - false - - - - Protocol - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 50 - false - - - - Link Type - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - 0 - 0 - - - - - 60 - 16777215 - - - - - 50 - false - - - - Channel 0 is 430 MHz, channel 250 is 440 MHz, and the channel spacing is 40 KHz. - - - 250 - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - 430.000 (MHz) - - - - - - - - - - 50 - false - - - - Device ID - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 50 - false - - - - Qt::LeftToRight - - - Coordinator ID - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 16777215 - 16777215 - - - - Configure what type of packets will be sent over the link - - - Qt::LeftToRight - - - 0 - - - - - - - - 0 - 0 - - - - - 50 - false - - - - Max Power - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 90 - 16777215 - - - - Set the maximum TX output power the modem will use (mW) -0 to disable the modem. - - - Qt::LeftToRight - - - 0 - - - - - - - - 50 - false - - - - RF Band - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 90 - 16777215 - - - - Set the RF Band used. - - - Qt::LeftToRight - - - 0 - - - - - - - - - - - 0 - 0 - - - - - 150 - 16777215 - - - - RX Level - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 50 - false - - - - -100dBm - - - Qt::AlignCenter - - - - - - - - - - 0 - 0 - - - - - 30 - 16777215 - - - - - 0 - 0 - - - - Qt::RightToLeft - - - false - - - -127 - - - 0 - - - -127 - - - Qt::AlignCenter - - - false - - - Qt::Vertical - - - false - - - %v dBm - - - - - - - - - - - + Qt::Vertical @@ -946,7 +73,7 @@ Leave blank to use autogenerated Device ID. - + @@ -2079,6 +1206,22 @@ Leave blank to use autogenerated Device ID. + + + + + 101 + 16777215 + + + + Qt::NoFocus + + + The automatic frequency correction in Hz. + + + @@ -2102,26 +1245,10 @@ Leave blank to use autogenerated Device ID. - - - - - 101 - 16777215 - - - - Qt::NoFocus - - - The automatic frequency correction in Hz. - - - - + Qt::Horizontal @@ -2134,100 +1261,1037 @@ Leave blank to use autogenerated Device ID. - - - - Frequency Tuning + + + + 0 - - - 9 - - - 9 - - - 9 - - - 9 - - - - - Qt::NoFocus + + + + Frequency Settings + + + + 9 - - Adjust the xtal capacitor value to fine tune frequency and + + 9 + + + 9 + + + 9 + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + 50 + false + + + + Channel 0 is 430 MHz, channel 250 is 440 MHz, and the channel spacing is 40 KHz. + + + 250 + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + 430.000 (MHz) + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 50 + false + + + + From Channel + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + false + + + + RF Band + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 90 + 16777215 + + + + Set the RF Band used. + + + Qt::LeftToRight + + + 0 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + + 50 + false + + + + Channel 0 is 430 MHz, channel 250 is 440 MHz, and the channel spacing is 40 KHz. + + + 250 + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + 440.000 (MHz) + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 50 + false + + + + To Channel + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + true + + + + 0 + 0 + + + + + 900 + 16777215 + + + + + 50 + false + + + + Configuration + + + + + + + 50 + false + + + + Device ID + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + false + + + + Qt::LeftToRight + + + Coordinator ID + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + false + + + + Link Type + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Configure what type of packets will be sent over the link + + + Qt::LeftToRight + + + 0 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 90 + 16777215 + + + + + 50 + false + + + + Qt::StrongFocus + + + Enter your custom ID for this device as a hexadecimal value, +this allows device clones. Be sure only one device with this +ID transmits at the same time! +Leave blank to use autogenerated Device ID. + + + 8 + + + true + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + false + + + + + + Qt::LogicalMoveStyle + + + false + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Set the maximum TX output power the modem will use (mW) +0 to disable the modem. + + + Qt::LeftToRight + + + 0 + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Set the modem protocol + + + Qt::LeftToRight + + + 0 + + + + + + + + 0 + 0 + + + + + 50 + false + + + + Max Power + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 50 + false + + + + Mode + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + false + + + + Air Data Rate + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Choose the over-the-air baud rate for the radio. + + + + + + + + + + 0 + 0 + + + + + 90 + 16777215 + + + + + 50 + false + + + + This is the coordinator ID we currently are bound to. +To manually bind to a specific coordinator, just type +or paste its device ID in this box and save. +The device must be rebooted for the binding to take place. + + + 8 + + + Qt::LogicalMoveStyle + + + false + + + + + + + + 0 + 0 + + + + Qt::NoFocus + + + Clear the binding/coordinator ID + + + Unbind + + + + + + + + + + + + 0 + + + + + Connections + + + + + + + 0 + 0 + + + + + 50 + false + + + + Radio Primary + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + Choose a destination for the primary radio stream. + + + + + + + + 50 + false + + + + VCP Bridge + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + false + + + + Radio Auxiliary + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 16777215 + 16777215 + + + + Choose a destination for the auxiliary radio stream. + + + + + + + + 16777215 + 16777215 + + + + Choose a destination for the Virtual Com Port bridge connection. + + + + + + + + + + Serial Ports + + + + + + + 16777215 + 16777215 + + + + Choose the baud rate for the main com port. + + + + + + + + 50 + false + + + + Speed + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Choose a function for the flexi port. + + + + + + + + 50 + false + + + + Main Port + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + false + + + + Speed + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + false + + + + Flexi Port + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Choose the baud rate for the main com port. + + + + + + + + 0 + 0 + + + + Choose a function for the main port. + + + + + + + + + + + + Frequency Tuning + + + + + + Xtal Capacitor + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + AFC Correction + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::NoFocus + + + Adjust the xtal capacitor value to fine tune frequency and get an AFC value close to zero. Default value is 127. - - - 171 - - - 1 - - - 127 - - - Qt::Horizontal - - - - - - - Adjust the xtal capacitor value to fine tune frequency and + + + 171 + + + 1 + + + 127 + + + Qt::Horizontal + + + + + + + Adjust the xtal capacitor value to fine tune frequency and get an AFC value close to zero. Default value is 127. - - - 171 - - - - - - - Xtal Capacitor - - - - - - - The Automatic Frequency Correction: How much the modem will correct + + + 171 + + + + + + + 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 - - - - - + + + -50 + + + 50 + + + 0 + + + Qt::AlignCenter + + + true + + + %v KHz + + + + + + + + + + + 0 + 0 + + + + + 150 + 16777215 + + + + RX Level + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 50 + false + + + + -100dBm + + + Qt::AlignCenter + + + + + + + + + + 0 + 0 + + + + + 30 + 16777215 + + + + + 0 + 0 + + + + Qt::RightToLeft + + + false + + + -127 + + + 0 + + + -127 + + + Qt::AlignCenter + + + false + + + Qt::Vertical + + + false + + + %v dBm + + + + + + + + + @@ -2337,18 +2401,19 @@ a frequency misalignement between the two modems. Protocol MaxRFTxPower - LinkType - ComSpeed CustomDeviceID - CoordID - UnbindButton - RFBand - MaximumChannel - MinimumChannel + LinkType + AirDataRate + RadioPriStream + RadioAuxStream + VCPBridge MainPort + MainComSpeed FlexiPort - VCPPort - RadioAuxPort + FlexiComSpeed + RFBand + MinimumChannel + MaximumChannel RFXtalCapValue applyButton saveButton