From 274c6aadad197a1cc5cf3df3479576aa278741f8 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sat, 10 May 2014 20:40:14 +0200 Subject: [PATCH] OP-1331 trying new approach to address input/output channel configuration grid alignment issues. New approach is to move the individual widgets to the parent grid layout in order to have them all under the same constraints. This wip to have feedback on other OSes. --- .../src/plugins/config/configgadgetwidget.cpp | 77 +- .../src/plugins/config/configgadgetwidget.h | 3 +- .../src/plugins/config/configinputwidget.cpp | 28 +- .../src/plugins/config/configoutputwidget.cpp | 6 +- .../openpilotgcs/src/plugins/config/input.ui | 52 +- .../src/plugins/config/inputchannelform.cpp | 71 +- .../src/plugins/config/inputchannelform.h | 6 +- .../src/plugins/config/inputchannelform.ui | 1596 ++++++++--------- .../openpilotgcs/src/plugins/config/output.ui | 70 +- .../src/plugins/config/outputchannelform.cpp | 84 +- .../src/plugins/config/outputchannelform.h | 6 +- .../src/plugins/config/outputchannelform.ui | 1384 +++++++------- 12 files changed, 1726 insertions(+), 1657 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp index 4ae81eb08..482f42add 100644 --- a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp @@ -55,69 +55,67 @@ ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent) { setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - ftw = new MyTabbedStackWidget(this, true, true); - ftw->setIconSize(64); + stackWidget = new MyTabbedStackWidget(this, true, true); + stackWidget->setIconSize(64); QVBoxLayout *layout = new QVBoxLayout; layout->setContentsMargins(0, 0, 0, 0); - layout->addWidget(ftw); + layout->addWidget(stackWidget); setLayout(layout); - // ********************* QWidget *qwd; QIcon *icon = new QIcon(); icon->addFile(":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/hardware_selected.png", QSize(), QIcon::Selected, QIcon::Off); qwd = new DefaultHwSettingsWidget(this); - ftw->insertTab(ConfigGadgetWidget::hardware, qwd, *icon, QString("Hardware")); + stackWidget->insertTab(ConfigGadgetWidget::hardware, qwd, *icon, QString("Hardware")); icon = new QIcon(); icon->addFile(":/configgadget/images/vehicle_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/vehicle_selected.png", QSize(), QIcon::Selected, QIcon::Off); qwd = new ConfigVehicleTypeWidget(this); - ftw->insertTab(ConfigGadgetWidget::aircraft, qwd, *icon, QString("Vehicle")); + stackWidget->insertTab(ConfigGadgetWidget::aircraft, qwd, *icon, QString("Vehicle")); icon = new QIcon(); icon->addFile(":/configgadget/images/input_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/input_selected.png", QSize(), QIcon::Selected, QIcon::Off); qwd = new ConfigInputWidget(this); - ftw->insertTab(ConfigGadgetWidget::input, qwd, *icon, QString("Input")); + stackWidget->insertTab(ConfigGadgetWidget::input, qwd, *icon, QString("Input")); icon = new QIcon(); icon->addFile(":/configgadget/images/output_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/output_selected.png", QSize(), QIcon::Selected, QIcon::Off); qwd = new ConfigOutputWidget(this); - ftw->insertTab(ConfigGadgetWidget::output, qwd, *icon, QString("Output")); + stackWidget->insertTab(ConfigGadgetWidget::output, qwd, *icon, QString("Output")); icon = new QIcon(); icon->addFile(":/configgadget/images/ins_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/ins_selected.png", QSize(), QIcon::Selected, QIcon::Off); qwd = new DefaultAttitudeWidget(this); - ftw->insertTab(ConfigGadgetWidget::sensors, qwd, *icon, QString("Attitude")); + stackWidget->insertTab(ConfigGadgetWidget::sensors, qwd, *icon, QString("Attitude")); icon = new QIcon(); icon->addFile(":/configgadget/images/stabilization_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/stabilization_selected.png", QSize(), QIcon::Selected, QIcon::Off); qwd = new ConfigStabilizationWidget(this); - ftw->insertTab(ConfigGadgetWidget::stabilization, qwd, *icon, QString("Stabilization")); + stackWidget->insertTab(ConfigGadgetWidget::stabilization, qwd, *icon, QString("Stabilization")); icon = new QIcon(); icon->addFile(":/configgadget/images/camstab_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/camstab_selected.png", QSize(), QIcon::Selected, QIcon::Off); qwd = new ConfigCameraStabilizationWidget(this); - ftw->insertTab(ConfigGadgetWidget::camerastabilization, qwd, *icon, QString("Gimbal")); + stackWidget->insertTab(ConfigGadgetWidget::camerastabilization, qwd, *icon, QString("Gimbal")); icon = new QIcon(); icon->addFile(":/configgadget/images/txpid_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/txpid_selected.png", QSize(), QIcon::Selected, QIcon::Off); qwd = new ConfigTxPIDWidget(this); - ftw->insertTab(ConfigGadgetWidget::txpid, qwd, *icon, QString("TxPID")); + stackWidget->insertTab(ConfigGadgetWidget::txpid, qwd, *icon, QString("TxPID")); + + stackWidget->setCurrentIndex(ConfigGadgetWidget::hardware); - ftw->setCurrentIndex(ConfigGadgetWidget::hardware); - // ********************* // Listen to autopilot connection events - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); TelemetryManager *telMngr = pm->getObject(); connect(telMngr, SIGNAL(connected()), this, SLOT(onAutopilotConnect())); @@ -129,9 +127,9 @@ ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent) } help = 0; - connect(ftw, SIGNAL(currentAboutToShow(int, bool *)), this, SLOT(tabAboutToChange(int, bool *))); + connect(stackWidget, SIGNAL(currentAboutToShow(int, bool *)), this, SLOT(tabAboutToChange(int, bool *))); - // Connect to the PipXStatus object updates + // Connect to the OPLinkStatus object updates UAVObjectManager *objManager = pm->getObject(); oplinkStatusObj = dynamic_cast(objManager->getObject("OPLinkStatus")); if (oplinkStatusObj != NULL) { @@ -148,13 +146,14 @@ ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent) ConfigGadgetWidget::~ConfigGadgetWidget() { - // TODO: properly delete all the tabs in ftw before exiting + // TODO: properly delete all the tabs in stackWidget before exiting + delete stackWidget } void ConfigGadgetWidget::startInputWizard() { - ftw->setCurrentIndex(ConfigGadgetWidget::input); - ConfigInputWidget *inputWidget = dynamic_cast(ftw->getWidget(ConfigGadgetWidget::input)); + stackWidget->setCurrentIndex(ConfigGadgetWidget::input); + ConfigInputWidget *inputWidget = dynamic_cast(stackWidget->getWidget(ConfigGadgetWidget::input)); Q_ASSERT(inputWidget); inputWidget->startInputWizard(); } @@ -166,24 +165,24 @@ void ConfigGadgetWidget::resizeEvent(QResizeEvent *event) void ConfigGadgetWidget::onAutopilotDisconnect() { - int selectedIndex = ftw->currentIndex(); + int selectedIndex = stackWidget->currentIndex(); QIcon *icon = new QIcon(); icon->addFile(":/configgadget/images/ins_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/ins_selected.png", QSize(), QIcon::Selected, QIcon::Off); QWidget *qwd = new DefaultAttitudeWidget(this); - ftw->removeTab(ConfigGadgetWidget::sensors); - ftw->insertTab(ConfigGadgetWidget::sensors, qwd, *icon, QString("Attitude")); + stackWidget->removeTab(ConfigGadgetWidget::sensors); + stackWidget->insertTab(ConfigGadgetWidget::sensors, qwd, *icon, QString("Attitude")); icon = new QIcon(); icon->addFile(":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/hardware_selected.png", QSize(), QIcon::Selected, QIcon::Off); qwd = new DefaultHwSettingsWidget(this); - ftw->removeTab(ConfigGadgetWidget::hardware); - ftw->insertTab(ConfigGadgetWidget::hardware, qwd, *icon, QString("Hardware")); + stackWidget->removeTab(ConfigGadgetWidget::hardware); + stackWidget->insertTab(ConfigGadgetWidget::hardware, qwd, *icon, QString("Hardware")); - ftw->setCurrentIndex(selectedIndex); + stackWidget->setCurrentIndex(selectedIndex); emit autopilotDisconnected(); } @@ -196,7 +195,7 @@ void ConfigGadgetWidget::onAutopilotConnect() ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectUtilManager *utilMngr = pm->getObject(); if (utilMngr) { - int selectedIndex = ftw->currentIndex(); + int selectedIndex = stackWidget->currentIndex(); int board = utilMngr->getBoardModel(); if ((board & 0xff00) == 1024) { // CopterControl family @@ -205,15 +204,15 @@ void ConfigGadgetWidget::onAutopilotConnect() icon->addFile(":/configgadget/images/ins_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/ins_selected.png", QSize(), QIcon::Selected, QIcon::Off); QWidget *qwd = new ConfigCCAttitudeWidget(this); - ftw->removeTab(ConfigGadgetWidget::sensors); - ftw->insertTab(ConfigGadgetWidget::sensors, qwd, *icon, QString("Attitude")); + stackWidget->removeTab(ConfigGadgetWidget::sensors); + stackWidget->insertTab(ConfigGadgetWidget::sensors, qwd, *icon, QString("Attitude")); icon = new QIcon(); icon->addFile(":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/hardware_selected.png", QSize(), QIcon::Selected, QIcon::Off); qwd = new ConfigCCHWWidget(this); - ftw->removeTab(ConfigGadgetWidget::hardware); - ftw->insertTab(ConfigGadgetWidget::hardware, qwd, *icon, QString("Hardware")); + stackWidget->removeTab(ConfigGadgetWidget::hardware); + stackWidget->insertTab(ConfigGadgetWidget::hardware, qwd, *icon, QString("Hardware")); } else if ((board & 0xff00) == 0x0900) { // Revolution family @@ -221,20 +220,20 @@ void ConfigGadgetWidget::onAutopilotConnect() icon->addFile(":/configgadget/images/ins_normal.png", QSize(), QIcon::Normal, QIcon::Off); icon->addFile(":/configgadget/images/ins_selected.png", QSize(), QIcon::Selected, QIcon::Off); QWidget *qwd = new ConfigRevoWidget(this); - ftw->removeTab(ConfigGadgetWidget::sensors); - ftw->insertTab(ConfigGadgetWidget::sensors, qwd, *icon, QString("Attitude")); + stackWidget->removeTab(ConfigGadgetWidget::sensors); + stackWidget->insertTab(ConfigGadgetWidget::sensors, qwd, *icon, QString("Attitude")); icon = new QIcon(); icon->addFile(":/configgadget/images/hardware_normal.png", QSize(), QIcon::Normal, QIcon::Off); 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")); + stackWidget->removeTab(ConfigGadgetWidget::hardware); + stackWidget->insertTab(ConfigGadgetWidget::hardware, qwd, *icon, QString("Hardware")); } else { // Unknown board qDebug() << "Unknown board " << board; } - ftw->setCurrentIndex(selectedIndex); + stackWidget->setCurrentIndex(selectedIndex); } emit autopilotConnected(); @@ -244,7 +243,7 @@ void ConfigGadgetWidget::tabAboutToChange(int i, bool *proceed) { Q_UNUSED(i); *proceed = true; - ConfigTaskWidget *wid = qobject_cast(ftw->currentWidget()); + ConfigTaskWidget *wid = qobject_cast(stackWidget->currentWidget()); if (!wid) { return; } @@ -275,7 +274,7 @@ void ConfigGadgetWidget::updateOPLinkStatus(UAVObject *) icon->addFile(":/configgadget/images/pipx-selected.png", QSize(), QIcon::Selected, QIcon::Off); QWidget *qwd = new ConfigPipXtremeWidget(this); - ftw->insertTab(ConfigGadgetWidget::oplink, qwd, *icon, QString("OPLink")); + stackWidget->insertTab(ConfigGadgetWidget::oplink, qwd, *icon, QString("OPLink")); oplinkConnected = true; } } @@ -284,6 +283,6 @@ void ConfigGadgetWidget::onOPLinkDisconnect() { qDebug() << "ConfigGadgetWidget onOPLinkDisconnect"; oplinkTimeout->stop(); - ftw->removeTab(ConfigGadgetWidget::oplink); + stackWidget->removeTab(ConfigGadgetWidget::oplink); oplinkConnected = false; } diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.h b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.h index 45eadd8b5..0a443b9e0 100644 --- a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.h @@ -65,7 +65,6 @@ signals: protected: void resizeEvent(QResizeEvent *event); - MyTabbedStackWidget *ftw; private: UAVDataObject *oplinkStatusObj; @@ -73,6 +72,8 @@ private: // A timer that timesout the connction to the OPLink. QTimer *oplinkTimeout; bool oplinkConnected; + + MyTabbedStackWidget *stackWidget; }; #endif // CONFIGGADGETWIDGET_H diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index b3568032c..b983a1e27 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -80,24 +80,24 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : unsigned int indexRT = 0; foreach(QString name, manualSettingsObj->getField("ChannelNumber")->getElementNames()) { Q_ASSERT(index < ManualControlSettings::CHANNELGROUPS_NUMELEM); - InputChannelForm *inpForm = new InputChannelForm(this, index == 0); - ui->channelSettings->layout()->addWidget(inpForm); // Add the row to the UI - inpForm->setName(name); + InputChannelForm *form = new InputChannelForm(this); + form->addToGrid(ui->channelLayout); + form->setName(name); // The order of the following binding calls is important. Since the values will be populated // in reverse order of the binding order otherwise the 'Reversed' logic will floor the neutral value // to the max value ( which is smaller than the neutral value when reversed ) and the channel number // will not be set correctly. - addWidgetBinding("ManualControlSettings", "ChannelNumber", inpForm->ui->channelNumberDropdown, index); - addWidgetBinding("ManualControlSettings", "ChannelGroups", inpForm->ui->channelGroup, index); - addWidgetBinding("ManualControlSettings", "ChannelNeutral", inpForm->ui->channelNeutral, index); - addWidgetBinding("ManualControlSettings", "ChannelNeutral", inpForm->ui->neutralValue, index); - addWidgetBinding("ManualControlSettings", "ChannelMax", inpForm->ui->channelMax, index); - addWidgetBinding("ManualControlSettings", "ChannelMin", inpForm->ui->channelMin, index); - addWidgetBinding("ManualControlSettings", "ChannelMax", inpForm->ui->channelMax, index); + addWidgetBinding("ManualControlSettings", "ChannelNumber", form->ui->channelNumber, index); + addWidgetBinding("ManualControlSettings", "ChannelGroups", form->ui->channelGroup, index); + addWidgetBinding("ManualControlSettings", "ChannelNeutral", form->ui->channelNeutral, index); + addWidgetBinding("ManualControlSettings", "ChannelNeutral", form->ui->neutralValue, index); + addWidgetBinding("ManualControlSettings", "ChannelMax", form->ui->channelMax, index); + addWidgetBinding("ManualControlSettings", "ChannelMin", form->ui->channelMin, index); + addWidgetBinding("ManualControlSettings", "ChannelMax", form->ui->channelMax, index); - addWidget(inpForm->ui->channelResponseTime); - addWidget(inpForm->ui->channelRev); + addWidget(form->ui->channelResponseTime); + addWidget(form->ui->channelRev); // Input filter response time fields supported for some channels only switch (index) { @@ -107,13 +107,13 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : case ManualControlSettings::CHANNELGROUPS_ACCESSORY0: case ManualControlSettings::CHANNELGROUPS_ACCESSORY1: case ManualControlSettings::CHANNELGROUPS_ACCESSORY2: - addWidgetBinding("ManualControlSettings", "ResponseTime", inpForm->ui->channelResponseTime, indexRT); + addWidgetBinding("ManualControlSettings", "ResponseTime", form->ui->channelResponseTime, indexRT); ++indexRT; break; case ManualControlSettings::CHANNELGROUPS_THROTTLE: case ManualControlSettings::CHANNELGROUPS_FLIGHTMODE: case ManualControlSettings::CHANNELGROUPS_COLLECTIVE: - inpForm->ui->channelResponseTime->setEnabled(false); + form->ui->channelResponseTime->setEnabled(false); break; default: Q_ASSERT(0); diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index 9ca2ed943..5108d9b0f 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -76,10 +76,12 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren // NOTE: we have channel indices from 0 to 9, but the convention for OP is Channel 1 to Channel 10. // Register for ActuatorSettings changes: for (unsigned int i = 0; i < ActuatorCommand::CHANNEL_NUMELEM; i++) { - OutputChannelForm *form = new OutputChannelForm(i, this, i == 0); + OutputChannelForm *form = new OutputChannelForm(i, this); + form->addToGrid(ui->channelLayout); + connect(ui->channelOutTest, SIGNAL(toggled(bool)), form, SLOT(enableChannelTest(bool))); connect(form, SIGNAL(channelChanged(int, int)), this, SLOT(sendChannelTest(int, int))); - ui->channelLayout->addWidget(form); + addWidget(form->ui.actuatorMin); addWidget(form->ui.actuatorNeutral); addWidget(form->ui.actuatorMax); diff --git a/ground/openpilotgcs/src/plugins/config/input.ui b/ground/openpilotgcs/src/plugins/config/input.ui index f3fa1c43b..b53d7ba6d 100644 --- a/ground/openpilotgcs/src/plugins/config/input.ui +++ b/ground/openpilotgcs/src/plugins/config/input.ui @@ -174,9 +174,9 @@ 0 - - - 6 + + + 12 @@ -198,7 +198,7 @@ - + Qt::Horizontal @@ -211,14 +211,14 @@ - + Roll/Pitch/Yaw stick deadband - + Stick deadband in percents of full range (0-10), zero to disable @@ -234,22 +234,6 @@ - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 12 - 20 - - - - @@ -260,7 +244,7 @@ 20 - 40 + 10 @@ -369,6 +353,12 @@ + + + 0 + 0 + + 210 @@ -413,6 +403,12 @@ true + + + 0 + 0 + + 210 @@ -546,8 +542,8 @@ 0 0 - 724 - 497 + 772 + 751 @@ -2048,8 +2044,8 @@ Setup the flight mode channel on the RC Input tab if you have not done so alread 0 0 - 407 - 138 + 772 + 751 @@ -2238,7 +2234,7 @@ Set to 0 to disable (recommended for soaring fixed wings). - + :/core/images/helpicon.svg:/core/images/helpicon.svg diff --git a/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp b/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp index adc9c7d70..788b96d2f 100644 --- a/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp +++ b/ground/openpilotgcs/src/plugins/config/inputchannelform.cpp @@ -4,13 +4,31 @@ #include "manualcontrolsettings.h" #include "gcsreceiver.h" -InputChannelForm::InputChannelForm(QWidget *parent, bool showLegend) : - ConfigTaskWidget(parent), ui(new Ui::InputChannelForm) +InputChannelForm::InputChannelForm(QWidget *parent) : ConfigTaskWidget(parent), ui(new Ui::InputChannelForm) { ui->setupUi(this); + connect(ui->channelMin, SIGNAL(valueChanged(int)), this, SLOT(minMaxUpdated())); + connect(ui->channelMax, SIGNAL(valueChanged(int)), this, SLOT(minMaxUpdated())); + connect(ui->neutralValue, SIGNAL(valueChanged(int)), this, SLOT(neutralUpdated())); + connect(ui->channelGroup, SIGNAL(currentIndexChanged(int)), this, SLOT(groupUpdated())); + connect(ui->channelRev, SIGNAL(toggled(bool)), this, SLOT(reversedUpdated())); + + disableMouseWheelEvents(); +} + +InputChannelForm::~InputChannelForm() +{ + delete ui; +} + +void InputChannelForm::addToGrid(QGridLayout *gridLayout) +{ + // if we are the first row to be inserted the show the legend + bool showLegend = (gridLayout->rowCount() == 1); + // The first time through the loop, keep the legend. All other times, delete it. - if (!showLegend) { + if (false && !showLegend) { QLayout *legendLayout = layout()->itemAt(0)->layout(); Q_ASSERT(legendLayout); // remove every item @@ -31,19 +49,40 @@ InputChannelForm::InputChannelForm(QWidget *parent, bool showLegend) : delete legendLayout; } - connect(ui->channelMin, SIGNAL(valueChanged(int)), this, SLOT(minMaxUpdated())); - connect(ui->channelMax, SIGNAL(valueChanged(int)), this, SLOT(minMaxUpdated())); - connect(ui->neutralValue, SIGNAL(valueChanged(int)), this, SLOT(neutralUpdated())); - connect(ui->channelGroup, SIGNAL(currentIndexChanged(int)), this, SLOT(groupUpdated())); - connect(ui->channelRev, SIGNAL(toggled(bool)), this, SLOT(reversedUpdated())); + QGridLayout *srcLayout = dynamic_cast(layout()); + Q_ASSERT(srcLayout); - disableMouseWheelEvents(); -} + if (showLegend) { + Q_ASSERT(srcLayout); + int row = gridLayout->rowCount(); + for(int col = 0; col < srcLayout->columnCount(); col++) { + QLayoutItem *item = srcLayout->itemAtPosition(0, col); + if (!item) { + continue; + } + QWidget *widget = item->widget(); + if (widget) { + gridLayout->addWidget(widget, row, col); + continue; + } + } + } + int row = gridLayout->rowCount(); + for(int col = 0; col < srcLayout->columnCount(); col++) { + QLayoutItem *item = srcLayout->itemAtPosition(1, col); + if (!item) { + continue; + } + QWidget *widget = item->widget(); + if (widget) { + gridLayout->addWidget(widget, row, col); + continue; + } + } -InputChannelForm::~InputChannelForm() -{ - delete ui; + // + setVisible(false); } void InputChannelForm::setName(QString &name) @@ -118,8 +157,8 @@ void InputChannelForm::reversedUpdated() */ void InputChannelForm::groupUpdated() { - ui->channelNumberDropdown->clear(); - ui->channelNumberDropdown->addItem("Disabled"); + ui->channelNumber->clear(); + ui->channelNumber->addItem("Disabled"); quint8 count = 0; @@ -150,6 +189,6 @@ void InputChannelForm::groupUpdated() } for (int i = 0; i < count; i++) { - ui->channelNumberDropdown->addItem(QString(tr("Chan %1").arg(i + 1))); + ui->channelNumber->addItem(QString(tr("Chan %1").arg(i + 1))); } } diff --git a/ground/openpilotgcs/src/plugins/config/inputchannelform.h b/ground/openpilotgcs/src/plugins/config/inputchannelform.h index 28511bd1a..ad17d0963 100644 --- a/ground/openpilotgcs/src/plugins/config/inputchannelform.h +++ b/ground/openpilotgcs/src/plugins/config/inputchannelform.h @@ -13,10 +13,14 @@ class InputChannelForm : public ConfigTaskWidget { Q_OBJECT public: - explicit InputChannelForm(QWidget *parent = 0, const bool showLegend = false); + explicit InputChannelForm(QWidget *parent = 0); ~InputChannelForm(); + friend class ConfigInputWidget; + void setName(QString &name); + void addToGrid(QGridLayout *gridLayout); + private slots: void minMaxUpdated(); void neutralUpdated(); diff --git a/ground/openpilotgcs/src/plugins/config/inputchannelform.ui b/ground/openpilotgcs/src/plugins/config/inputchannelform.ui index 5e1ee9107..b9052fece 100644 --- a/ground/openpilotgcs/src/plugins/config/inputchannelform.ui +++ b/ground/openpilotgcs/src/plugins/config/inputchannelform.ui @@ -6,14 +6,14 @@ 0 0 - 839 - 57 + 859 + 51 Form - + 0 @@ -26,783 +26,34 @@ 0 - - - - 6 + + 12 + + + + + true - - - - true - - - - 0 - 0 - - - - - 80 - 20 - - - - - -1 - 75 - false - true - - - - Channel function - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font: bold 12px; -margin:1px; - - - QFrame::StyledPanel - - - Function - - - Qt::AlignCenter - - - - - - - true - - - - 0 - 0 - - - - - 100 - 20 - - - - - -1 - 75 - false - true - - - - Channel type - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font: bold 12px; -margin:1px; - - - QFrame::StyledPanel - - - Type - - - Qt::AlignCenter - - - - - - - true - - - - 0 - 0 - - - - - 90 - 20 - - - - - -1 - 75 - false - true - - - - Channel number - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font: bold 12px; -margin:1px; - - - QFrame::StyledPanel - - - Number - - - Qt::AlignCenter - - - - - - - true - - - - 0 - 0 - - - - - 55 - 20 - - - - - -1 - 75 - false - true - - - - Channel min - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font: bold 12px; -margin:1px; - - - QFrame::StyledPanel - - - Min - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - true - - - - 0 - 0 - - - - - 0 - 20 - - - - - -1 - 75 - false - true - - - - Channel neutral - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font: bold 12px; -margin:1px; - - - QFrame::StyledPanel - - - Neutral - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - true - - - - 0 - 0 - - - - - 55 - 20 - - - - - -1 - 75 - false - true - - - - Channel max - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font: bold 12px; -margin:1px; - - - QFrame::StyledPanel - - - 1 - - - Max - - - Qt::AlignCenter - - - - - - - true - - - - 0 - 0 - - - - - 75 - 20 - - - - - -1 - 75 - false - true - - - - Channel values are inverted - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font: bold 12px; -margin:1px; - - - QFrame::StyledPanel - - - 1 - - - Reversed - - - Qt::AlignCenter - - - - - - - true - - - - 0 - 0 - - - - - 45 - 20 - - - - - -1 - 75 - false - true - - - - Response time - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font: bold 12px; -margin:1px; - - - QFrame::StyledPanel - - - 1 - - - RT - - - Qt::AlignCenter - - - - - - - - - 6 + + + 0 + 0 + - - - - - 0 - 0 - - - - - 80 - 25 - - - - - 80 - 16777215 - - - - Text - - - - - - - - 0 - 0 - - - - - 100 - 25 - - - - - 100 - 16777215 - - - - Qt::StrongFocus - - - - - - - - 0 - 0 - - - - - 90 - 25 - - - - - 90 - 16777215 - - - - Qt::StrongFocus - - - 7 - - - - - - - - 0 - 0 - - - - - 55 - 25 - - - - - 55 - 16777215 - - - - Qt::StrongFocus - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - QAbstractSpinBox::UpDownArrows - - - 9999 - - - 1000 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - QFrame::NoFrame - - - QFrame::Plain - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 50 - 0 - - - - Qt::StrongFocus - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 9999 - - - 1000 - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - - 0 - 0 - - - - - 55 - 25 - - - - - 55 - 16777215 - - - - Qt::StrongFocus - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - QAbstractSpinBox::UpDownArrows - - - 9999 - - - 1000 - - - - - - - - 0 - 0 - - - - - 75 - 25 - - - - - 75 - 16777215 - - - - QFrame::NoFrame - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - true - - - - 0 - 0 - - - - - 0 - 20 - - - - - - - - - - - - - - true - - - - 0 - 0 - - - - - 45 - 25 - - - - - 45 - 16777215 - - - - Optional input filter response time. + + + 50 + 0 + + + + + 16777215 + 16777215 + + + + Optional input filter response time. Range: 0-999ms, 0 disables filter (default). @@ -810,29 +61,778 @@ Warning: this is an expert mode feature, mostly used for aerial video camera control (airframe yaw and camera gimbal accessory channels). Too high values for main controls can cause undesirable effects and even lead to crash. Use with caution. - - - false - - - true - - - QAbstractSpinBox::UpDownArrows - - - 999 - - - - + + + false + + + true + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + QAbstractSpinBox::UpDownArrows + + + 999 + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + + 16777215 + 16777215 + + + + Text + + + + + + + + 0 + 0 + + + + + 90 + 0 + + + + + 16777215 + 16777215 + + + + Qt::StrongFocus + + + 7 + + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 16777215 + 16777215 + + + + Qt::StrongFocus + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + + 16777215 + 16777215 + + + + Qt::StrongFocus + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + QAbstractSpinBox::UpDownArrows + + + 9999 + + + 1000 + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + true + + + + 0 + 0 + + + + + 80 + 20 + + + + + -1 + 75 + false + true + + + + Channel function + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + QFrame::StyledPanel + + + Function + + + Qt::AlignCenter + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + true + + + + 0 + 0 + + + + + 75 + 20 + + + + + -1 + 75 + false + true + + + + Channel values are inverted + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + QFrame::StyledPanel + + + 1 + + + Reversed + + + Qt::AlignCenter + + + + + + + true + + + + 0 + 0 + + + + + 50 + 20 + + + + + -1 + 75 + false + true + + + + Response time + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + QFrame::StyledPanel + + + 1 + + + RT + + + Qt::AlignCenter + + + + + + + true + + + + 0 + 0 + + + + + 50 + 20 + + + + + -1 + 75 + false + true + + + + Channel max + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + QFrame::StyledPanel + + + 1 + + + Max + + + Qt::AlignCenter + + + + + + + true + + + + 0 + 0 + + + + + 0 + 20 + + + + + -1 + 75 + false + true + + + + Channel neutral + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + QFrame::StyledPanel + + + Neutral + + + Qt::AlignCenter + + + + + + + true + + + + 0 + 0 + + + + + 50 + 20 + + + + + -1 + 75 + false + true + + + + Channel min + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + QFrame::StyledPanel + + + Min + + + Qt::AlignCenter + + + + + + + true + + + + 0 + 0 + + + + + 90 + 20 + + + + + -1 + 75 + false + true + + + + Channel number + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + QFrame::StyledPanel + + + Number + + + Qt::AlignCenter + + + + + + + true + + + + 0 + 0 + + + + + 100 + 20 + + + + + -1 + 75 + false + true + + + + Channel type + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + QFrame::StyledPanel + + + Type + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + + 16777215 + 16777215 + + + + Qt::StrongFocus + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + QAbstractSpinBox::UpDownArrows + + + 9999 + + + 1000 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + QFrame::NoFrame + + + QFrame::Plain + + + + 2 + + + 0 + + + 2 + + + 0 + + + + + + 0 + 0 + + + + + 50 + 0 + + + + Qt::StrongFocus + + + Qt::Horizontal + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 9999 + + + 1000 + + + + + + + + + + + 0 + 0 + + + + + 75 + 0 + + + + + 16777215 + 16777215 + + + + QFrame::NoFrame + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + + + - - channelGroup - channelNumberDropdown - diff --git a/ground/openpilotgcs/src/plugins/config/output.ui b/ground/openpilotgcs/src/plugins/config/output.ui index 3be59f710..575b03e58 100644 --- a/ground/openpilotgcs/src/plugins/config/output.ui +++ b/ground/openpilotgcs/src/plugins/config/output.ui @@ -654,44 +654,46 @@ Leave at 50Hz for fixed wing. - - - 6 - - - QLayout::SetDefaultConstraint + + + 12 - - - - - - 519 - 20 - - - - Motors spin at neutral output when armed and throttle below zero (be careful) - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + + 0 + 0 + + + + + 519 + 20 + + + + Motors spin at neutral output when armed and throttle below zero (be careful) + + diff --git a/ground/openpilotgcs/src/plugins/config/outputchannelform.cpp b/ground/openpilotgcs/src/plugins/config/outputchannelform.cpp index 259655158..b5d9c2358 100644 --- a/ground/openpilotgcs/src/plugins/config/outputchannelform.cpp +++ b/ground/openpilotgcs/src/plugins/config/outputchannelform.cpp @@ -28,30 +28,10 @@ #include "outputchannelform.h" #include "configoutputwidget.h" -OutputChannelForm::OutputChannelForm(const int index, QWidget *parent, const bool showLegend) : +OutputChannelForm::OutputChannelForm(const int index, QWidget *parent) : ConfigTaskWidget(parent), ui(), m_index(index), m_inChannelTest(false) { ui.setupUi(this); - if (!showLegend) { - QLayout *legendLayout = layout()->itemAt(0)->layout(); - Q_ASSERT(legendLayout); - // remove every item - while (legendLayout->count()) { - QLayoutItem *item = legendLayout->takeAt(0); - if (!item) { - continue; - } - // get widget from layout item - QWidget *widget = item->widget(); - if (widget) { - delete widget; - continue; - } - } - // and finally remove and delete the legend layout - layout()->removeItem(legendLayout); - delete legendLayout; - } // The convention for OP is Channel 1 to Channel 10. ui.actuatorNumber->setText(QString("%1:").arg(m_index + 1)); @@ -74,6 +54,68 @@ OutputChannelForm::~OutputChannelForm() // Do nothing } +void OutputChannelForm::addToGrid(QGridLayout *gridLayout) +{ + // if we are the first row to be inserted the show the legend + bool showLegend = (gridLayout->rowCount() == 1); + + if (false && !showLegend) { + QLayout *legendLayout = layout()->itemAt(0)->layout(); + Q_ASSERT(legendLayout); + // remove every item + while (legendLayout->count()) { + QLayoutItem *item = legendLayout->takeAt(0); + if (!item) { + continue; + } + // get widget from layout item + QWidget *widget = item->widget(); + if (widget) { + delete widget; + continue; + } + } + // and finally remove and delete the legend layout + layout()->removeItem(legendLayout); + delete legendLayout; + } + + QGridLayout *srcLayout = dynamic_cast(layout()); + Q_ASSERT(srcLayout); + + if (showLegend) { + Q_ASSERT(srcLayout); + int row = gridLayout->rowCount(); + for(int col = 0; col < srcLayout->columnCount(); col++) { + QLayoutItem *item = srcLayout->itemAtPosition(0, col); + if (!item) { + continue; + } + QWidget *widget = item->widget(); + if (widget) { + gridLayout->addWidget(widget, row, col); + continue; + } + } + } + + int row = gridLayout->rowCount(); + for(int col = 0; col < srcLayout->columnCount(); col++) { + QLayoutItem *item = srcLayout->itemAtPosition(1, col); + if (!item) { + continue; + } + QWidget *widget = item->widget(); + if (widget) { + gridLayout->addWidget(widget, row, col); + continue; + } + } + + // + setVisible(false); +} + /** * Restrict UI to protect users from accidental misuse. */ diff --git a/ground/openpilotgcs/src/plugins/config/outputchannelform.h b/ground/openpilotgcs/src/plugins/config/outputchannelform.h index a537f55e7..c854548b2 100644 --- a/ground/openpilotgcs/src/plugins/config/outputchannelform.h +++ b/ground/openpilotgcs/src/plugins/config/outputchannelform.h @@ -35,12 +35,14 @@ class OutputChannelForm : public ConfigTaskWidget { Q_OBJECT public: - explicit OutputChannelForm(const int index, QWidget *parent = NULL, const bool showLegend = false); + explicit OutputChannelForm(const int index, QWidget *parent = NULL); ~OutputChannelForm(); + friend class ConfigOutputWidget; void setAssignment(const QString &assignment); int index() const; + void addToGrid(QGridLayout *gridLayout); public slots: void max(int maximum); @@ -57,7 +59,7 @@ signals: private: Ui::outputChannelForm ui; - /// Channel index + // Channel index int m_index; bool m_inChannelTest; diff --git a/ground/openpilotgcs/src/plugins/config/outputchannelform.ui b/ground/openpilotgcs/src/plugins/config/outputchannelform.ui index 9e0c7fa1b..c5a542622 100644 --- a/ground/openpilotgcs/src/plugins/config/outputchannelform.ui +++ b/ground/openpilotgcs/src/plugins/config/outputchannelform.ui @@ -7,16 +7,13 @@ 0 0 772 - 57 + 51 Form - - - 6 - + 0 @@ -29,726 +26,711 @@ 0 - - - - 12 + + 12 + + + + + + 0 + 0 + - - - - - 0 - 0 - - - - - 20 - 20 - - - - - 16777215 - 16777215 - - - - - -1 - 75 - false - true - - - - Qt::LeftToRight - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); + + + 110 + 20 + + + + + 16777215 + 16777215 + + + + + -1 + 75 + false + true + + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); color: rgb(255, 255, 255); border-radius: 5; font: bold 12px; margin:1px; - - - # - - - Qt::AlignCenter - - - 0 - - - - - - - - 0 - 0 - - - - - 110 - 20 - - - - - 16777215 - 16777215 - - - - - -1 - 75 - false - true - - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font: bold 12px; -margin:1px; - - - Assignment - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 55 - 20 - - - - - 16777215 - 16777215 - - - - - -1 - 75 - false - true - - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font: bold 12px; -margin:1px; - - - Min - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 5 - 20 - - - - - - - - - 0 - 0 - - - - - 0 - 20 - - - - - -1 - 75 - false - true - - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font: bold 12px; -margin:1px; - - - Neutral (slowest for motor) - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 5 - 20 - - - - - - - - - 0 - 0 - - - - - 55 - 20 - - - - - 16777215 - 16777215 - - - - - -1 - 75 - false - true - - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font: bold 12px; -margin:1px; - - - Max - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 75 - 20 - - - - - 16777215 - 16777215 - - - - - -1 - 75 - false - true - - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font: bold 12px; -margin:1px; - - - Reversed - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 45 - 20 - - - - - 16777215 - 16777215 - - - - - -1 - 75 - false - true - - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font: bold 12px; -margin:1px; - - - Link - - - Qt::AlignCenter - - - - + + + Assignment + + + Qt::AlignCenter + + - - - - 12 + + + + + 0 + 0 + - - - - - 0 - 0 - - - - - 20 - 25 - - - - - 20 - 16777215 - - - - Channel Number - - - 0: - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 110 - 25 - - - - - 110 - 16777215 - - - - - - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 55 - 25 - - - - - 55 - 16777215 - - - - Qt::StrongFocus - - - Minimum PWM value, beware of not overdriving your servo. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 9999 - - - 0 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 5 - 20 - - - - - - - - - 0 - 0 - - - - QFrame::NoFrame - - - QFrame::Raised - - - - 0 + + + 50 + 20 + + + + + 16777215 + 16777215 + + + + + -1 + 75 + false + true + + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + Min + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + -1 + 75 + false + true + + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + Neutral (slowest for motor) + + + Qt::AlignCenter + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 5 + 20 + + + + + + + + + 0 + 0 + + + + + 20 + 20 + + + + + 16777215 + 16777215 + + + + + -1 + 75 + false + true + + + + Qt::LeftToRight + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + # + + + Qt::AlignCenter + + + 0 + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 5 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 5 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 5 + 20 + + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + + 16777215 + 16777215 + + + + Qt::StrongFocus + + + Minimum PWM value, beware of not overdriving your servo. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 9999 + + + 0 + + + + + + + + 0 + 0 + + + + + 20 + 0 + + + + + 16777215 + 16777215 + + + + Channel Number + + + 0: + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 50 + 20 + + + + + 16777215 + 16777215 + + + + + -1 + 75 + false + true + + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + Max + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 75 + 20 + + + + + 16777215 + 16777215 + + + + + -1 + 75 + false + true + + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + Reversed + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 45 + 20 + + + + + 16777215 + 16777215 + + + + + -1 + 75 + false + true + + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + Link + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 110 + 0 + + + + + 16777215 + 16777215 + + + + - + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + + 16777215 + 16777215 + + + + Qt::StrongFocus + + + Maximum PWM value, beware of not overdriving your servo. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 9999 + + + + + + + + 0 + 0 + + + + QFrame::NoFrame + + + QFrame::Raised + + + + 2 + + + 0 + + + 2 + + + 0 + + + + + + 0 + 0 + - - 0 + + + 50 + 0 + - - 0 + + Qt::StrongFocus - - 0 + + 9999 - - - - - 0 - 0 - - - - - 50 - 0 - - - - Qt::StrongFocus - - - 9999 - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 24 - 25 - - - - - 24 - 16777215 - - - - Current value of slider. - - - 0000 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 5 - 20 - - - - - - - - - 0 - 0 - - - - - 55 - 25 - - - - - 55 - 16777215 - - - - Qt::StrongFocus - - - Maximum PWM value, beware of not overdriving your servo. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 9999 - - - - - - - - 0 - 0 - - - - - 75 - 0 - - - - QFrame::NoFrame - - - - 0 + + Qt::Horizontal - - 0 + + + + + + + 0 + 0 + - - 0 + + + 20 + 0 + - - 0 + + + 16777215 + 16777215 + - - 0 + + Current value of slider. - - - - - 0 - 0 - - - - - 0 - 0 - - - - Qt::StrongFocus - - - Check to invert the channel. - - - - - - - - - - - 0 - 0 - - - - - 45 - 25 - - - - QFrame::NoFrame - - - QFrame::Plain - - - - 0 + + 0000 - - 0 + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - 0 + + + + + + + + + + 0 + 0 + + + + + 75 + 0 + + + + QFrame::NoFrame + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + - - 0 + + + 0 + 0 + - - 0 + + Qt::StrongFocus - - - - - 0 - 0 - - - - - 0 - 0 - - - - Qt::StrongFocus - - - Output mode - - - - - - - + + Check to invert the channel. + + + + + + + + + + + 0 + 0 + + + + + 45 + 0 + + + + QFrame::NoFrame + + + QFrame::Plain + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Qt::StrongFocus + + + Output mode + + + + + - - actuatorMin - actuatorMax -