diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 1cc7bd14e..c7d6da563 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -146,10 +146,6 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : addWidgetBinding("ManualControlSettings", "Stabilization2Settings", ui->fmsSsPos2Yaw, "Yaw", 1, true); addWidgetBinding("ManualControlSettings", "Stabilization3Settings", ui->fmsSsPos3Yaw, "Yaw", 1, true); - addWidgetBinding("StabilizationSettings", "FlightModeMap", ui->pidBankSs1, "Stabilized1", 1, true); - addWidgetBinding("StabilizationSettings", "FlightModeMap", ui->pidBankSs2, "Stabilized2", 1, true); - addWidgetBinding("StabilizationSettings", "FlightModeMap", ui->pidBankSs3, "Stabilized3", 1, true); - addWidgetBinding("ManualControlSettings", "Arming", ui->armControl); addWidgetBinding("ManualControlSettings", "ArmedTimeout", ui->armTimeout, 0, 1000); connect(ManualControlCommand::GetInstance(getObjectManager()), SIGNAL(objectUpdated(UAVObject *)), this, SLOT(moveFMSlider())); @@ -158,6 +154,8 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : addWidget(ui->configurationWizard); addWidget(ui->runCalibration); + autoLoadWidgets(); + populateWidgets(); refreshWidgetsValues(); // Connect the help button @@ -1316,21 +1314,33 @@ void ConfigInputWidget::updatePositionSlider() default: case 6: ui->fmsModePos6->setEnabled(true); + ui->cc_box_5->setEnabled(true); + ui->pidBankSs1_5->setEnabled(true); // pass through case 5: ui->fmsModePos5->setEnabled(true); + ui->cc_box_4->setEnabled(true); + ui->pidBankSs1_4->setEnabled(true); // pass through case 4: ui->fmsModePos4->setEnabled(true); + ui->cc_box_3->setEnabled(true); + ui->pidBankSs1_3->setEnabled(true); // pass through case 3: ui->fmsModePos3->setEnabled(true); + ui->cc_box_2->setEnabled(true); + ui->pidBankSs1_2->setEnabled(true); // pass through case 2: ui->fmsModePos2->setEnabled(true); + ui->cc_box_1->setEnabled(true); + ui->pidBankSs1_1->setEnabled(true); // pass through case 1: ui->fmsModePos1->setEnabled(true); + ui->cc_box_0->setEnabled(true); + ui->pidBankSs1_0->setEnabled(true); // pass through case 0: break; @@ -1339,21 +1349,33 @@ void ConfigInputWidget::updatePositionSlider() switch (manualSettingsDataPriv.FlightModeNumber) { case 0: ui->fmsModePos1->setEnabled(false); + ui->cc_box_0->setEnabled(false); + ui->pidBankSs1_0->setEnabled(false); // pass through case 1: ui->fmsModePos2->setEnabled(false); + ui->cc_box_1->setEnabled(false); + ui->pidBankSs1_1->setEnabled(false); // pass through case 2: ui->fmsModePos3->setEnabled(false); + ui->cc_box_2->setEnabled(false); + ui->pidBankSs1_2->setEnabled(false); // pass through case 3: ui->fmsModePos4->setEnabled(false); + ui->cc_box_3->setEnabled(false); + ui->pidBankSs1_3->setEnabled(false); // pass through case 4: ui->fmsModePos5->setEnabled(false); + ui->cc_box_4->setEnabled(false); + ui->pidBankSs1_4->setEnabled(false); // pass through case 5: ui->fmsModePos6->setEnabled(false); + ui->cc_box_5->setEnabled(false); + ui->pidBankSs1_5->setEnabled(false); // pass through case 6: default: diff --git a/ground/openpilotgcs/src/plugins/config/input.ui b/ground/openpilotgcs/src/plugins/config/input.ui index 1049a15a9..410dc7690 100644 --- a/ground/openpilotgcs/src/plugins/config/input.ui +++ b/ground/openpilotgcs/src/plugins/config/input.ui @@ -6,8 +6,8 @@ 0 0 - 880 - 672 + 796 + 828 @@ -29,7 +29,7 @@ - 0 + 1 @@ -128,8 +128,8 @@ 0 0 - 850 - 589 + 766 + 745 @@ -277,6 +277,13 @@ + + + + Qt::Horizontal + + + @@ -552,11 +559,11 @@ 0 0 - 850 - 589 + 766 + 745 - + 12 @@ -569,420 +576,21 @@ 12 - - - + + + + Qt::Vertical + + + QSizePolicy::Expanding + + - 0 - 230 + 20 + 20 - - - 16777215 - 230 - - - - FlightMode Switch Positions - - - - 12 - - - 12 - - - 12 - - - 12 - - - - - - - - 0 - 0 - - - - - 0 - 16 - - - - - 16777215 - 16 - - - - Pos. 1 - - - - - - - - 0 - 0 - - - - - 16 - 16 - - - - - 16777215 - 16 - - - - Pos. 2 - - - - - - - - 0 - 0 - - - - - 0 - 16 - - - - - 16777215 - 16 - - - - Pos. 3 - - - - - - - - 0 - 0 - - - - - 0 - 16 - - - - - 16777215 - 16 - - - - Pos. 4 - - - - - - - - 0 - 0 - - - - - 0 - 16 - - - - - 16777215 - 16 - - - - Pos. 5 - - - - - - - - 0 - 0 - - - - - 0 - 16 - - - - - 16777215 - 16 - - - - Pos. 6 - - - - - - - - - false - - - - 16777215 - 160 - - - - Qt::StrongFocus - - - This slider moves when you move the flight mode switch -on your remote. It shows currently active flight mode. - -Setup the flight mode channel on the RC Input tab if you have not done so already. - - - 0 - - - 5 - - - 10 - - - 0 - - - 0 - - - Qt::Vertical - - - true - - - QSlider::TicksBelow - - - 1 - - - - - - - 3 - - - - - Qt::StrongFocus - - - Select the stabilization mode on this position (manual/stabilized/auto) - - - - - - - Qt::StrongFocus - - - - - - - Qt::StrongFocus - - - - - - - false - - - Qt::StrongFocus - - - Select the stabilization mode on this position (manual/stabilized/auto) - - - - - - - false - - - Qt::StrongFocus - - - - - - - false - - - Qt::StrongFocus - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - - - - - Number of flight modes: - - - - - - - Number of positions your FlightMode switch has. - -Default is 3. - -It will be 2 or 3 for most of setups, but it also can be up to 6. -In that case you have to configure your radio mixers so the whole range -from min to max is split into N equal intervals, and you may set arbitrary -channel value for each flight mode. - - - 1 - - - 6 - - - 3 - - - - - - - - - - 75 - true - - - - Avoid "Manual" for multirotors! - - - true - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 0 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 0 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + @@ -992,34 +600,50 @@ channel value for each flight mode. Stabilization Modes Configuration - + 9 - 12 + 6 - - + + Qt::Horizontal - QSizePolicy::Minimum + QSizePolicy::Fixed - 5 + 10 20 - + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + - 0 + 120 20 @@ -1044,120 +668,11 @@ margin:1px; - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 20 - 20 - - - - - - - - Qt::StrongFocus - - - - - - - Stabilized 1 - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 20 - 20 - - - - - - - - Stabilized 2 - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - Qt::StrongFocus - - - - - - - Qt::StrongFocus - - - - - - - Qt::StrongFocus - - - - - - - - 0 - 20 - - - - - 16777215 - 20 - - - - 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; - - - Roll - - - Qt::AlignCenter - - - - + - 0 + 120 20 @@ -1182,113 +697,315 @@ margin:1px; - - - - Qt::StrongFocus - - - - - - - - 102 - 0 - - - - Qt::StrongFocus - - - - - - - Qt::StrongFocus - - - - - - - - 102 - 0 - - - - Qt::StrongFocus - - - - - - - Stabilized 3 - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 102 - 0 - - - - Qt::StrongFocus - - - - - - - - 102 - 0 - - - - Qt::StrongFocus - - - - - - - - 102 - 0 - - - - Qt::StrongFocus - - - - - + + Qt::Horizontal + + QSizePolicy::Preferred + - 40 + 170 20 - + + + + + 120 + 20 + + + + + 16777215 + 20 + + + + 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; + + + Roll + + + Qt::AlignCenter + + + + + + + + 75 + 0 + + + + + 75 + 16777215 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Stabilized 1 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Stabilized 2 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Stabilized 3 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 1 + + + 1 + + + 1 + + + 1 + + + + + + 0 + 0 + + + + Qt::StrongFocus + + + + + + + Qt::StrongFocus + + + + + + + Qt::StrongFocus + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 1 + + + 1 + + + 1 + + + 1 + + + + + + 0 + 0 + + + + Qt::StrongFocus + + + + + + + Qt::StrongFocus + + + + + + + Qt::StrongFocus + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 1 + + + 1 + + + 1 + + + 1 + + + + + + 0 + 0 + + + + Qt::StrongFocus + + + + + + + Qt::StrongFocus + + + + + + + Qt::StrongFocus + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + + + + + 0 + 230 + + + + + 16777215 + 230 + + + + Flight Mode Switch Positions + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + + - 0 + 120 20 @@ -1313,54 +1030,1029 @@ margin:1px; - - + + - 102 - 0 + 120 + 20 - - Qt::StrongFocus + + + 16777215 + 20 + + + + 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; + + + Flight Mode Count + + + Qt::AlignCenter - - + + + + + 151 + 16777215 + + + + Number of positions your FlightMode switch has. + +Default is 3. + +It will be 2 or 3 for most of setups, but it also can be up to 6. +In that case you have to configure your radio mixers so the whole range +from min to max is split into N equal intervals, and you may set arbitrary +channel value for each flight mode. + + + 1 + + + 6 + + + 3 + + + + + + + + 0 + 0 + + + + + 75 + true + + + + Avoid "Manual" for multirotors! + + + Qt::AlignCenter + + + true + + + + + Qt::Horizontal - QSizePolicy::MinimumExpanding + QSizePolicy::Fixed - 20 + 10 20 + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + + 120 + 20 + + + + + 16777215 + 20 + + + + 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; + + + Cruise Control + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + + + + + + 120 + 20 + + + + + 16777215 + 20 + + + + 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; + + + Flight Mode + + + Qt::AlignCenter + + + + + + + + 120 + 0 + + + + + 16777215 + 16777215 + + + + + 6 + + + 1 + + + 1 + + + 1 + + + 1 + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + + 75 + true + + + + <html><head/><body><p>Enabling this check this box will enable Cruise Control for Flight Mode Switch position #1.</p></body></html> + + + Qt::RightToLeft + + + + + + + objname:StabilizationSettings + fieldname:CruiseControlFlightModeSwitchPosEnable + index:0 + haslimits:no + scale:1 + buttongroup:16 + + + + + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + + 75 + true + + + + <html><head/><body><p>Enabling this check this box will enable Cruise Control for Flight Mode Switch position #2.</p></body></html> + + + Qt::RightToLeft + + + + + + + objname:StabilizationSettings + fieldname:CruiseControlFlightModeSwitchPosEnable + index:1 + haslimits:no + scale:1 + buttongroup:16 + + + + + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + + 75 + true + + + + <html><head/><body><p>Enabling this check this box will enable Cruise Control for Flight Mode Switch position #3.</p></body></html> + + + Qt::RightToLeft + + + + + + + objname:StabilizationSettings + fieldname:CruiseControlFlightModeSwitchPosEnable + index:2 + haslimits:no + scale:1 + buttongroup:16 + + + + + + + + false + + + + 0 + 20 + + + + + 16777215 + 20 + + + + + 75 + true + + + + <html><head/><body><p>Enabling this check this box will enable Cruise Control for Flight Mode Switch position #4.</p></body></html> + + + Qt::RightToLeft + + + + + + + objname:StabilizationSettings + fieldname:CruiseControlFlightModeSwitchPosEnable + index:3 + haslimits:no + scale:1 + buttongroup:16 + + + + + + + + false + + + + 0 + 20 + + + + + 16777215 + 20 + + + + + 75 + true + + + + <html><head/><body><p>Enabling this check this box will enable Cruise Control for Flight Mode Switch position #5.</p></body></html> + + + Qt::RightToLeft + + + + + + + objname:StabilizationSettings + fieldname:CruiseControlFlightModeSwitchPosEnable + index:4 + haslimits:no + scale:1 + buttongroup:16 + + + + + + + + false + + + + 0 + 20 + + + + + 16777215 + 20 + + + + + 75 + true + + + + <html><head/><body><p>Enabling this check this box will enable Cruise Control for Flight Mode Switch position #6.</p></body></html> + + + Qt::RightToLeft + + + + + + + objname:StabilizationSettings + fieldname:CruiseControlFlightModeSwitchPosEnable + index:5 + haslimits:no + scale:1 + buttongroup:16 + + + + + + + + + + + + 75 + 0 + + + + + 75 + 16777215 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 1 + + + 1 + + + 1 + + + 1 + + + 10 + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + 16777215 + 16 + + + + Pos. 5 + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + 16777215 + 16 + + + + Pos. 3 + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + 16777215 + 16 + + + + Pos. 4 + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + 16777215 + 16 + + + + Pos. 1 + + + + + + + + 0 + 0 + + + + + 16 + 20 + + + + + 16777215 + 16 + + + + Pos. 2 + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + 16777215 + 16 + + + + Pos. 6 + + + + + + + false + + + + 16777215 + 150 + + + + Qt::StrongFocus + + + This slider moves when you move the flight mode switch +on your remote. It shows currently active flight mode. + +Setup the flight mode channel on the RC Input tab if you have not done so already. + + + 0 + + + 5 + + + 10 + + + 0 + + + 0 + + + Qt::Vertical + + + true + + + QSlider::TicksBelow + + + 1 + + + + + + + + + + + 120 + 0 + + + + + 16777215 + 16777215 + + + + + 1 + + + 1 + + + 1 + + + 1 + + + + + false + + + Qt::StrongFocus + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Qt::StrongFocus + + + Select the stabilization mode on this position (manual/stabilized/auto) + + + + + + + false + + + Qt::StrongFocus + + + + + + + Qt::StrongFocus + + + + + + + false + + + Qt::StrongFocus + + + Select the stabilization mode on this position (manual/stabilized/auto) + + + + + + + Qt::StrongFocus + + + + + + + + + + + 120 + 0 + + + + + 16777215 + 16777215 + + + + + 1 + + + 1 + + + 1 + + + 1 + + + + + + 102 + 0 + + + + Qt::StrongFocus + + + + objname:StabilizationSettings + fieldname:FlightModeMap + index:0 + haslimits:no + scale:1 + buttongroup:16 + + + + + + + + + 102 + 0 + + + + Qt::StrongFocus + + + + objname:StabilizationSettings + fieldname:FlightModeMap + index:1 + haslimits:no + scale:1 + buttongroup:16 + + + + + + + + + 102 + 0 + + + + Qt::StrongFocus + + + + objname:StabilizationSettings + fieldname:FlightModeMap + index:2 + haslimits:no + scale:1 + buttongroup:16 + + + + + + + + false + + + + 102 + 0 + + + + Qt::StrongFocus + + + + objname:StabilizationSettings + fieldname:FlightModeMap + index:3 + haslimits:no + scale:1 + buttongroup:16 + + + + + + + + false + + + + 102 + 0 + + + + Qt::StrongFocus + + + + objname:StabilizationSettings + fieldname:FlightModeMap + index:4 + haslimits:no + scale:1 + buttongroup:16 + + + + + + + + false + + + + 102 + 0 + + + + Qt::StrongFocus + + + + objname:StabilizationSettings + fieldname:FlightModeMap + index:5 + haslimits:no + scale:1 + buttongroup:16 + + + + + + + - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - @@ -1461,8 +2153,8 @@ margin:1px; 0 0 - 850 - 589 + 766 + 745 @@ -1722,15 +2414,6 @@ Applies and Saves all settings to SD - fmsSsPos1Roll - fmsSsPos1Pitch - fmsSsPos1Yaw - fmsSsPos2Roll - fmsSsPos2Pitch - fmsSsPos2Yaw - fmsSsPos3Roll - fmsSsPos3Pitch - fmsSsPos3Yaw tabWidget deadband graphicsView diff --git a/ground/openpilotgcs/src/plugins/config/stabilization.ui b/ground/openpilotgcs/src/plugins/config/stabilization.ui index 0e8d1fb3c..4193262b4 100644 --- a/ground/openpilotgcs/src/plugins/config/stabilization.ui +++ b/ground/openpilotgcs/src/plugins/config/stabilization.ui @@ -551,8 +551,8 @@ 0 0 - 798 - 705 + 796 + 708 @@ -8762,8 +8762,8 @@ border-radius: 5; 0 0 - 784 - 731 + 796 + 708 @@ -18775,8 +18775,8 @@ border-radius: 5; 0 0 - 798 - 705 + 796 + 708 @@ -26963,8 +26963,8 @@ border-radius: 5; 0 0 - 868 - 691 + 796 + 708 @@ -27247,6 +27247,19 @@ border-radius: 5; + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -27278,44 +27291,6 @@ border-radius: 5; - - - - - 75 - true - - - - <html><head/><body><p>Enabling this check this box will enable Cruise Control for Flight Mode Switch position #3.</p></body></html> - - - Qt::RightToLeft - - - 3 - - - - - - - - 75 - true - - - - <html><head/><body><p>Enabling this check this box will enable Cruise Control for Flight Mode Switch position #6.</p></body></html> - - - Qt::RightToLeft - - - 6 - - - @@ -27353,73 +27328,6 @@ border-radius: 5; - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - <html><head/><body><p>This needs to be 0 for all copters except CP helis that are using idle up.</p></body></html> - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - true - - - 0 - - - - objname:StabilizationSettings - fieldname:CruiseControlNeutralThrust - haslimits:no - scale:1 - buttongroup:16 - - - - - - - - - 75 - true - - - - <html><head/><body><p>Enabling this check this box will enable Cruise Control for Flight Mode Switch position #1.</p></body></html> - - - Qt::RightToLeft - - - 1 - - - - objname:StabilizationSettings - fieldname:CruiseControlFlightModeSwitchPosEnable - element:[0] - haslimits:no - scale:1 - buttongroup:16 - - - - @@ -27453,6 +27361,31 @@ border-radius: 5; + + + + <html><head/><body><p>This needs to be 0 for all copters except CP helis that are using idle up.</p></body></html> + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + 0 + + + + objname:StabilizationSettings + fieldname:CruiseControlNeutralThrust + haslimits:no + scale:1 + buttongroup:16 + + + + @@ -27556,39 +27489,6 @@ border-radius: 5; - - - - - 0 - 0 - - - - - 140 - 16 - - - - - 75 - 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; - - - NeutralThrust - - - Qt::AlignCenter - - - @@ -27622,25 +27522,6 @@ border-radius: 5; - - - - - 75 - true - - - - <html><head/><body><p>Enabling this check this box will enable Cruise Control for Flight Mode Switch position #5.</p></body></html> - - - Qt::RightToLeft - - - 5 - - - @@ -27669,22 +27550,36 @@ border-radius: 5; - - + + + + + 0 + 0 + + + + + 140 + 16 + + 75 true - - <html><head/><body><p>Enabling this check this box will enable Cruise Control for Flight Mode Switch position #4.</p></body></html> - - - Qt::RightToLeft + + 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; - 4 + NeutralThrust + + + Qt::AlignCenter @@ -27782,25 +27677,6 @@ border-radius: 5; - - - - - 75 - true - - - - <html><head/><body><p>Enabling this check this box will enable Cruise Control for Flight Mode Switch position #2.</p></body></html> - - - Qt::RightToLeft - - - 2 - - - @@ -27817,30 +27693,6 @@ border-radius: 5; - - - - - 75 - true - - - - <html><head/><body><p>Checking a box here enables Cruise Control for the corresponding Flight Mode Switch position (1 - 6).</p></body></html> - - - 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; - - - FltModePosEnable - - - Qt::AlignCenter - - - @@ -27926,8 +27778,8 @@ border-radius: 5; 0 0 - 798 - 705 + 796 + 708 diff --git a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp index 12f58a50e..047e2175d 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp @@ -572,20 +572,23 @@ void ConfigTaskWidget::autoLoadWidgets() if (info.isValid()) { bindingStruct uiRelation; - uiRelation.buttonType = none; + uiRelation.buttonType = none; uiRelation.scale = 1; - uiRelation.element = QString(); - uiRelation.haslimits = false; + uiRelation.index = -1; + uiRelation.elementName = QString(); + uiRelation.haslimits = false; foreach(QString str, info.toStringList()) { QString prop = str.split(":").at(0); QString value = str.split(":").at(1); if (prop == "objname") { - uiRelation.objname = value; + uiRelation.objectName = value; } else if (prop == "fieldname") { - uiRelation.fieldname = value; + uiRelation.fieldName = value; } else if (prop == "element") { - uiRelation.element = value; + uiRelation.elementName = value; + } else if (prop == "index") { + uiRelation.index = value.toInt(); } else if (prop == "scale") { if (value == "null") { uiRelation.scale = 1; @@ -658,7 +661,11 @@ void ConfigTaskWidget::autoLoadWidgets() } else { QWidget *wid = qobject_cast(widget); if (wid) { - addWidgetBinding(uiRelation.objname, uiRelation.fieldname, wid, uiRelation.element, uiRelation.scale, uiRelation.haslimits, &uiRelation.buttonGroup); + if (uiRelation.index != -1) { + addWidgetBinding(uiRelation.objectName, uiRelation.fieldName, wid, uiRelation.index, uiRelation.scale, uiRelation.haslimits, &uiRelation.buttonGroup); + } else { + addWidgetBinding(uiRelation.objectName, uiRelation.fieldName, wid, uiRelation.elementName, uiRelation.scale, uiRelation.haslimits, &uiRelation.buttonGroup); + } } } } @@ -667,7 +674,7 @@ void ConfigTaskWidget::autoLoadWidgets() forceShadowUpdates(); /* - foreach(WidgetBinding * binding, m_widgetBindingsPerObject) { + foreach(WidgetBinding * binding, m_widgetBindingsPerObject) { if (binding->widget()) { qDebug() << "Binding :" << binding->widget()->objectName(); qDebug() << " Object :" << binding->object()->getName(); @@ -681,8 +688,8 @@ void ConfigTaskWidget::autoLoadWidgets() qDebug() << " Scale :" << shadow->scale(); } } - } - */ + } + */ } void ConfigTaskWidget::addWidgetToReloadGroups(QWidget *widget, QList *reloadGroupIDs) @@ -1157,10 +1164,10 @@ void WidgetBinding::setValue(const QVariant &value) { m_value = value; /* - if (m_object && m_field) { + if (m_object && m_field) { qDebug() << "WidgetBinding" << m_object->getName() << ":" << m_field->getName() << "value =" << value.toString(); - } - */ + } + */ } void WidgetBinding::updateObjectFieldFromValue() diff --git a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.h b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.h index 14db4b4c2..9ac0959fb 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.h +++ b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.h @@ -191,9 +191,10 @@ private: enum buttonTypeEnum { none, save_button, apply_button, reload_button, default_button, help_button }; struct bindingStruct { - QString objname; - QString fieldname; - QString element; + QString objectName; + QString fieldName; + QString elementName; + int index; QString url; buttonTypeEnum buttonType; QList buttonGroup;