From 0e505a396e46e594da5608dd2c6af8dae687d76a Mon Sep 17 00:00:00 2001 From: Laura Sebesta Date: Fri, 25 May 2012 11:45:28 +0300 Subject: [PATCH 01/13] Fixed scrolling issues in plugin by adding all elements to a parent QFrame widget, and then activating scrolling in configpipxtremewidget.cpp constructor. --- .../plugins/config/configpipxtremewidget.cpp | 5 + .../src/plugins/config/pipxtreme.ui | 203 +++++++++--------- 2 files changed, 112 insertions(+), 96 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp index f4d20fc5d..b810ebde9 100644 --- a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp @@ -89,6 +89,11 @@ ConfigPipXtremeWidget::ConfigPipXtremeWidget(QWidget *parent) : ConfigTaskWidget timeOut = new QTimer(this); connect(timeOut, SIGNAL(timeout()),this,SLOT(disconnected())); + //Add scroll bar when necessary + QScrollArea *scroll = new QScrollArea; + scroll->setWidget(m_pipx->frame_3); + m_pipx->verticalLayout_3->addWidget(scroll); + // Request and update of the setting object. settingsUpdated = false; pipxSettingsObj->requestUpdate(); diff --git a/ground/openpilotgcs/src/plugins/config/pipxtreme.ui b/ground/openpilotgcs/src/plugins/config/pipxtreme.ui index 06662e450..1326f2b35 100644 --- a/ground/openpilotgcs/src/plugins/config/pipxtreme.ui +++ b/ground/openpilotgcs/src/plugins/config/pipxtreme.ui @@ -7,7 +7,7 @@ 0 0 840 - 724 + 834 @@ -165,6 +165,12 @@ + + + 400 + 0 + + 75 @@ -374,7 +380,7 @@ - Frequency Step Size + Freq. Step Size Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -779,7 +785,7 @@ - Telemetry Port Configuration + Telemetry Port Config. Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -1105,13 +1111,13 @@ true - 0 + 0 - 1000000000 + 1000000000 - 100000 + 100000 @@ -1210,99 +1216,104 @@ + + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + true + + + + + + + + + + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Send settings to the board but do not save to the non-volatile memory + + + Apply + + + + + + + Send settings to the board and save to the non-volatile memory + + + Save + + + false + + + + + + + + frame_2 + groupBox + layoutWidget + layoutWidget_2 + graphicsView_Spectrum - - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - true - - - - - - - - - - - - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Send settings to the board but do not save to the non-volatile memory - - - Apply - - - - - - - Send settings to the board and save to the non-volatile memory - - - Save - - - false - - - - - - - From a6e18371614de360025d83bb9b17eb396e913510 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 15 May 2012 16:24:49 -0500 Subject: [PATCH 02/13] Remove stylesheets for stabilization ui group boxes as they don't work properly on all platforms. Also removed custom fonts as these don't work consistently across platforms. Basically don't customize shit in the .ui file. Generate a stylesheet and let's properly validate them and/or have one per platform. Even things like changing font sizes behave inconsistently. Don't specify the size of buttons, at least to any precision. It will not work across platforms. --- .../config/configstabilizationwidget.cpp | 5 + .../src/plugins/config/stabilization.ui | 1207 ++--------------- overo | 2 +- 3 files changed, 129 insertions(+), 1085 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp index 3f2b4d216..07f6904c3 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp @@ -40,6 +40,11 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa { m_stabilization = new Ui_StabilizationWidget(); m_stabilization->setupUi(this); + + // To bring old style sheet back without adding it manually do this: + // Alternatively apply a global stylesheet to the QGroupBox + // setStyleSheet("QGroupBox {background-color: qlineargradient(spread:pad, x1:0.507, y1:0.869318, x2:0.507, y2:0.0965909, stop:0 rgba(243, 243, 243, 255), stop:1 rgba(250, 250, 250, 255)); border: 1px outset #999; border-radius: 3; }"); + autoLoadWidgets(); realtimeUpdates=new QTimer(this); connect(m_stabilization->realTimeUpdates_6,SIGNAL(stateChanged(int)),this,SLOT(realtimeUpdatesSlot(int))); diff --git a/ground/openpilotgcs/src/plugins/config/stabilization.ui b/ground/openpilotgcs/src/plugins/config/stabilization.ui index ef0b52a15..fd6b01ca8 100755 --- a/ground/openpilotgcs/src/plugins/config/stabilization.ui +++ b/ground/openpilotgcs/src/plugins/config/stabilization.ui @@ -495,29 +495,13 @@ 0 - 0 + -114 673 - 880 + 790 - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - + Qt::Horizontal @@ -533,7 +517,7 @@ - + @@ -541,19 +525,12 @@ 16 - - - 9 - 75 - true - - Rate Stabilization (Inner Loop) - + @@ -573,530 +550,6 @@ 181 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 251 - 251 - 251 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 251 - 251 - 251 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 124 - 124 - 124 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 124 - 124 - 124 - - - - - - - 255 - 255 - 255 - - - - - - - 124 - 124 - 124 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 248 - 248 - 248 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - false - - - #RateStabilizationGroup_15{background-color: qlineargradient(spread:pad, x1:0.507, y1:0.869318, x2:0.507, y2:0.0965909, stop:0 rgba(243, 243, 243, 255), stop:1 rgba(250, 250, 250, 255)); - -border: 1px outset #999; -border-radius: 3; -} - @@ -3966,23 +3419,7 @@ value as the Kp. - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 15 - - - - - + Qt::Horizontal @@ -3998,7 +3435,7 @@ value as the Kp. - + @@ -4006,19 +3443,12 @@ value as the Kp. 16 - - - 9 - 75 - true - - Attitude Stabilization (Outer Loop) - + @@ -4555,13 +3985,6 @@ value as the Kp. false - - #RateStabilizationGroup_17{background-color: qlineargradient(spread:pad, x1:0.507, y1:0.869318, x2:0.507, y2:0.0965909, stop:0 rgba(243, 243, 243, 255), stop:1 rgba(250, 250, 250, 255)); - -border: 1px outset #999; -border-radius: 3; -} - @@ -4604,26 +4027,14 @@ border-radius: 3; - + - - - 0 - 0 - - 81 28 - - - 81 - 28 - - QPushButton { border: 1px outset #999; @@ -4656,7 +4067,7 @@ border-radius: 4; - + @@ -7335,26 +6746,14 @@ border-radius: 5; - + - - - 0 - 0 - - 51 28 - - - 51 - 28 - - QPushButton { border: 1px outset #999; @@ -7387,42 +6786,23 @@ border-radius: 4; + + + + Qt::Horizontal + + + + 40 + 20 + + + + - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 2 - 10 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 15 - - - - - + Qt::Horizontal @@ -7438,7 +6818,7 @@ border-radius: 4; - + @@ -7446,19 +6826,12 @@ border-radius: 4; 16 - - - 9 - 75 - true - - Stick Range and Limits - + @@ -7992,16 +7365,6 @@ border-radius: 4; - - false - - - #RateStabilizationGroup_19{background-color: qlineargradient(spread:pad, x1:0.507, y1:0.869318, x2:0.507, y2:0.0965909, stop:0 rgba(243, 243, 243, 255), stop:1 rgba(250, 250, 250, 255)); - -border: 1px outset #999; -border-radius: 3; -} - @@ -8019,7 +7382,7 @@ border-radius: 3; - 10 + 1000 10 @@ -8027,24 +7390,12 @@ border-radius: 3; - - - 0 - 0 - - 51 28 - - - 51 - 28 - - QPushButton { border: 1px outset #999; @@ -8091,12 +7442,6 @@ border-radius: 4; 28 - - - 81 - 28 - - QPushButton { border: 1px outset #999; @@ -11063,23 +10408,7 @@ Attitude - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - + Qt::Vertical @@ -11095,23 +10424,7 @@ Attitude - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 2 - 10 - - - - - + @@ -11648,13 +10961,6 @@ Attitude false - - #RateStabilizationGroup_21{background-color: qlineargradient(spread:pad, x1:0.507, y1:0.869318, x2:0.507, y2:0.0965909, stop:0 rgba(243, 243, 243, 255), stop:1 rgba(250, 250, 250, 255)); - -border: 1px outset #999; -border-radius: 3; -} - @@ -11734,29 +11040,12 @@ automatically every 300ms, which will help for fast tuning. - - - 0 - 0 - - 120 28 - - - 120 - 28 - - - - - 8 - - Reloads the saved settings into GCS. Useful if you have accidentally changed some settings. @@ -11795,29 +11084,12 @@ border-radius: 4; - - - 0 - 0 - - 60 28 - - - 60 - 28 - - - - - 8 - - Send settings to the board but do not save to the non-volatile memory @@ -11854,29 +11126,12 @@ border-radius: 4; - - - 0 - 0 - - 60 28 - - - 60 - 28 - - - - - 8 - - Send settings to the board and save to the non-volatile memory @@ -11939,27 +11194,11 @@ border-radius: 4; 0 0 673 - 1079 + 981 - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 25 - 10 - - - - - + Qt::Horizontal @@ -11975,7 +11214,7 @@ border-radius: 4; - + @@ -11983,19 +11222,12 @@ border-radius: 4; 16 - - - 9 - 75 - true - - Rate Stabization Coefficients (Inner Loop) - + @@ -12529,16 +11761,6 @@ border-radius: 4; - - false - - - #RateStabilizationGroup_8{background-color: qlineargradient(spread:pad, x1:0.507, y1:0.869318, x2:0.507, y2:0.0965909, stop:0 rgba(243, 243, 243, 255), stop:1 rgba(250, 250, 250, 255)); - -border: 1px outset #999; -border-radius: 3; -} - @@ -15474,55 +14696,7 @@ value as the Kp. - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 2 - 10 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 2 - 10 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 15 - - - - - Qt::Horizontal @@ -15538,7 +14712,7 @@ value as the Kp. - + @@ -15546,19 +14720,12 @@ value as the Kp. 16 - - - 9 - 75 - true - - Attitude Stabization Coefficients (Outer Loop) - + @@ -16095,13 +15262,6 @@ value as the Kp. false - - #RateStabilizationGroup_4{background-color: qlineargradient(spread:pad, x1:0.507, y1:0.869318, x2:0.507, y2:0.0965909, stop:0 rgba(243, 243, 243, 255), stop:1 rgba(250, 250, 250, 255)); - -border: 1px outset #999; -border-radius: 3; -} - @@ -16112,85 +15272,6 @@ border-radius: 3; false - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 10 - - - - - - - - - - - Link Roll and Pitch - - - - - - - - 0 - 0 - - - - - 81 - 28 - - - - - 81 - 28 - - - - QPushButton { -border: 1px outset #999; -border-radius: 5; -background-color: qlineargradient(spread:pad, x1:0.507, y1:0.869318, x2:0.507, y2:0.0965909, stop:0.28 rgba(236, 236, 236, 255), stop:1 rgba(252, 252, 252, 255)); -} - -QPushButton:pressed { - - border-style: inset; - background-color: qlineargradient(spread:pad, x1:0.502, y1:0.664864, x2:0.502, y2:0.034, stop:0.358209 rgba(250, 250, 250, 255), stop:0.626866 rgba(235, 235, 235, 255)); - -} - - -QPushButton:hover { - border: 1px outset #999; -border-color: rgb(83, 83, 83); -border-radius: 4; - } - - - Default - - - - objname:StabilizationSettings - button:default - buttongroup:5 - - - - @@ -18839,26 +17920,89 @@ border-radius: 5; + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 10 + + + + + + + + + 0 + 0 + + + + + 81 + 28 + + + + + 81 + 28 + + + + QPushButton { +border: 1px outset #999; +border-radius: 5; +background-color: qlineargradient(spread:pad, x1:0.507, y1:0.869318, x2:0.507, y2:0.0965909, stop:0.28 rgba(236, 236, 236, 255), stop:1 rgba(252, 252, 252, 255)); +} + +QPushButton:pressed { + + border-style: inset; + background-color: qlineargradient(spread:pad, x1:0.502, y1:0.664864, x2:0.502, y2:0.034, stop:0.358209 rgba(250, 250, 250, 255), stop:0.626866 rgba(235, 235, 235, 255)); + +} + + +QPushButton:hover { + border: 1px outset #999; +border-color: rgb(83, 83, 83); +border-radius: 4; + } + + + Default + + + + objname:StabilizationSettings + button:default + buttongroup:5 + + + + + + + + + + + Link Roll and Pitch + + + - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 15 - - - - - + Qt::Horizontal @@ -18874,7 +18018,7 @@ border-radius: 5; - + @@ -18882,19 +18026,12 @@ border-radius: 5; 16 - - - 9 - 75 - true - - Stick Range and Limits - + @@ -19428,16 +18565,6 @@ border-radius: 5; - - false - - - #RateStabilizationGroup_6{background-color: qlineargradient(spread:pad, x1:0.507, y1:0.869318, x2:0.507, y2:0.0965909, stop:0 rgba(243, 243, 243, 255), stop:1 rgba(250, 250, 250, 255)); - -border: 1px outset #999; -border-radius: 3; -} - @@ -19455,7 +18582,7 @@ border-radius: 3; - 10 + 10000 10 @@ -19463,24 +18590,12 @@ border-radius: 3; - - - 0 - 0 - - 81 28 - - - 81 - 28 - - QPushButton { border: 1px outset #999; @@ -22192,23 +21307,7 @@ rate(deg/s) - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - + Qt::Horizontal @@ -22224,7 +21323,7 @@ rate(deg/s) - + @@ -22232,26 +21331,13 @@ rate(deg/s) 16 - - - 9 - 75 - true - - Sensor Tunning - + - - - 0 - 0 - - 0 @@ -22781,13 +21867,6 @@ rate(deg/s) false - - #RateStabilizationGroup_23{background-color: qlineargradient(spread:pad, x1:0.507, y1:0.869318, x2:0.507, y2:0.0965909, stop:0 rgba(243, 243, 243, 255), stop:1 rgba(250, 250, 250, 255)); - -border: 1px outset #999; -border-radius: 3; -} - @@ -25118,23 +24197,7 @@ border-radius: 5; - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - + @@ -25671,13 +24734,6 @@ border-radius: 5; false - - #RateStabilizationGroup_22{background-color: qlineargradient(spread:pad, x1:0.507, y1:0.869318, x2:0.507, y2:0.0965909, stop:0 rgba(243, 243, 243, 255), stop:1 rgba(250, 250, 250, 255)); - -border: 1px outset #999; -border-radius: 3; -} - @@ -25724,13 +24780,6 @@ border-radius: 3; 0 - - - 9 - 50 - false - - If you check this, the GCS will udpate the stabilization factors automatically every 300ms, which will help for fast tuning. @@ -25776,11 +24825,6 @@ automatically every 300ms, which will help for fast tuning. 28 - - - 8 - - Send settings to the board but do not save to the non-volatile memory @@ -25835,11 +24879,6 @@ border-radius: 4; 28 - - - 8 - - Send settings to the board and save to the non-volatile memory diff --git a/overo b/overo index 8381aa124..335a3486d 160000 --- a/overo +++ b/overo @@ -1 +1 @@ -Subproject commit 8381aa124feafbb268c4d87d569a8185765f4297 +Subproject commit 335a3486dd41e48345209d0a65d49a8cc8b442a1 From 60af442f27e7bd2818af83fef44057c6bea5b381 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 15 May 2012 17:33:36 -0500 Subject: [PATCH 03/13] Remove the custom stylesheet from the txpid .ui group boxes --- .../openpilotgcs/src/plugins/config/txpid.ui | 1248 ++++++++--------- 1 file changed, 601 insertions(+), 647 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/txpid.ui b/ground/openpilotgcs/src/plugins/config/txpid.ui index 9862bfad1..e7ce7ab5d 100644 --- a/ground/openpilotgcs/src/plugins/config/txpid.ui +++ b/ground/openpilotgcs/src/plugins/config/txpid.ui @@ -1,647 +1,601 @@ - - - TxPIDWidget - - - - 0 - 0 - 720 - 567 - - - - Form - - - - - - QFrame::NoFrame - - - true - - - - - 0 - 0 - 702 - 489 - - - - - - - Qt::StrongFocus - - - This module will periodically update values of stabilization PID settings -depending on configured input control channels. New values of stabilization -settings are not saved to flash, but updated in RAM. It is expected that the -module will be enabled only for tuning. When desired values are found, they -can be read via GCS and saved permanently. Then this module should be -disabled again. - -Up to 3 separate PID options (or option pairs) can be selected and updated. - - - Enable TxPID module - - - - - - - After enabling the module, you must power cycle before using and configuring. - - - - - - - Qt::Horizontal - - - - - - - Qt::Vertical - - - QSizePolicy::Preferred - - - - 20 - 10 - - - - - - - - - 0 - 0 - - - - - 0 - 100 - - - - #groupBox_6{ -background-color: qlineargradient(spread:pad, x1:0.507, y1:0.869318, x2:0.507, y2:0.0965909, stop:0 rgba(243, 243, 243, 255), stop:1 rgba(250, 250, 250, 255)); -border: 1px outset #999; -border-radius: 3; -font:bold; -} - -QGroupBox::title { - subcontrol-origin: margin; - subcontrol-position: top center; /* position at the top center */ - padding: 0 3px; - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #FFOECE, stop: 1 #FFFFFF); - top: 5px; - } - - - Module Settings - - - - - - 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; - - - PID option - - - Qt::AlignCenter - - - - - - - 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; - - - Control Source - - - Qt::AlignCenter - - - - - - - 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 - - - - - - - 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 - - - - - - - Instance 1 - - - - - - - Qt::StrongFocus - - - Select PID option or option pair to update. -Set to Disabled if not used. - - - - - - - Qt::StrongFocus - - - Select input used as a control source for this instance. -It can be one of Accessory channels or Throttle channel. - -If Accessory channel is chosen then its range [0..1] will be mapped -to PID range [Min..Max] defined for this instance. - -If Throttle channel is chosen then Throttle range [Min..Max] will -be mapped to PID range [Min..Max] defined for this instance. If -Throttle is out of bounds then PID Min and Max values will be used -accordingly. - -Note that it is possible to set PID Min > Max. In that case increasing -control input value will decrease the PID option value. This can be -used, for instance, to decrease PID value when increasing Throttle. - - - - - - - Qt::StrongFocus - - - Minimum PID value mapped to Accessory channel = 0 or -Throttle channel lesser or equal to Throttle Min value. - - - 6 - - - 0.000100000000000 - - - - - - - Qt::StrongFocus - - - Maximum PID value mapped to Accessory channel = 1 or -Throttle channel greater or equal to Throttle Max value. - - - 6 - - - 0.000100000000000 - - - - - - - Instance 2 - - - - - - - Qt::StrongFocus - - - Select PID option or option pair to update. -Set to Disabled if not used. - - - - - - - Qt::StrongFocus - - - Select input used as a control source for this instance. -It can be one of Accessory channels or Throttle channel. - -If Accessory channel is chosen then its range [0..1] will be mapped -to PID range [Min..Max] defined for this instance. - -If Throttle channel is chosen then Throttle range [Min..Max] will -be mapped to PID range [Min..Max] defined for this instance. If -Throttle is out of bounds then PID Min and Max values will be used -accordingly. - -Note that it is possible to set PID Min > Max. In that case increasing -control input value will decrease the PID option value. This can be -used, for instance, to decrease PID value when increasing Throttle. - - - - - - - Qt::StrongFocus - - - Minimum PID value mapped to Accessory channel = 0 or -Throttle channel lesser or equal to Throttle Min value. - - - 6 - - - 0.000100000000000 - - - - - - - Qt::StrongFocus - - - Maximum PID value mapped to Accessory channel = 1 or -Throttle channel greater or equal to Throttle Max value. - - - 6 - - - 0.000100000000000 - - - - - - - Instance 3 - - - - - - - Qt::StrongFocus - - - Select PID option or option pair to update. -Set to Disabled if not used. - - - - - - - Qt::StrongFocus - - - Select input used as a control source for this instance. -It can be one of Accessory channels or Throttle channel. - -If Accessory channel is chosen then its range [0..1] will be mapped -to PID range [Min..Max] defined for this instance. - -If Throttle channel is chosen then Throttle range [Min..Max] will -be mapped to PID range [Min..Max] defined for this instance. If -Throttle is out of bounds then PID Min and Max values will be used -accordingly. - -Note that it is possible to set PID Min > Max. In that case increasing -control input value will decrease the PID option value. This can be -used, for instance, to decrease PID value when increasing Throttle. - - - - - - - Qt::StrongFocus - - - Minimum PID value mapped to Accessory channel = 0 or -Throttle channel lesser or equal to Throttle Min value. - - - 6 - - - 0.000100000000000 - - - - - - - Qt::StrongFocus - - - Maximum PID value mapped to Accessory channel = 1 or -Throttle channel greater or equal to Throttle Max value. - - - 6 - - - 0.000100000000000 - - - - - - - Update Mode - - - - - - - Qt::StrongFocus - - - PID values update mode which can be set to: -- Never: this disables PID updates (but module still will be run if enabled), -- When Armed: PID updated only when system is armed, -- Always: PID updated always regardless of arm state. - -Since the GCS updates GUI PID values in real time on change, could be -tricky to change other PID values from the GUI if the module is enabled -and constantly updates stabilization settings object. As a workaround, -this option can be used to temporarily disable updates or enable them -only when system is armed without disabling the module. - - - - - - - Throttle Range - - - - - - - Qt::StrongFocus - - - Throttle channel lower bound mapped to PID Min value - - - 1.000000000000000 - - - 0.010000000000000 - - - - - - - Qt::StrongFocus - - - Throttle channel upper bound mapped to PID Max value - - - 1.000000000000000 - - - 0.010000000000000 - - - - - - - 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 - - - - - - - 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 - - - - - - - Qt::Vertical - - - - 20 - 20 - - - - - - - - Qt::Vertical - - - QSizePolicy::Preferred - - - - 20 - 20 - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Send settings to the board but do not save to the non-volatile memory - - - Apply - - - - - - - Send settings to the board and save to the non-volatile memory - - - Save - - - false - - - - - - - - - - - TxPIDEnable - Apply - Save - scrollArea - PID1 - Input1 - MinPID1 - MaxPID1 - PID2 - Input2 - MinPID2 - MaxPID2 - PID3 - Input3 - MinPID3 - MaxPID3 - ThrottleMin - ThrottleMax - UpdateMode - - - - + + + TxPIDWidget + + + + 0 + 0 + 720 + 567 + + + + Form + + + + + + QFrame::NoFrame + + + true + + + + + 0 + 0 + 696 + 475 + + + + + + + Qt::StrongFocus + + + This module will periodically update values of stabilization PID settings +depending on configured input control channels. New values of stabilization +settings are not saved to flash, but updated in RAM. It is expected that the +module will be enabled only for tuning. When desired values are found, they +can be read via GCS and saved permanently. Then this module should be +disabled again. + +Up to 3 separate PID options (or option pairs) can be selected and updated. + + + Enable TxPID module + + + + + + + After enabling the module, you must power cycle before using and configuring. + + + + + + + Qt::Horizontal + + + + + + + + 0 + 0 + + + + + 0 + 100 + + + + Module Settings + + + + + + 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; + + + PID option + + + Qt::AlignCenter + + + + + + + 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; + + + Control Source + + + Qt::AlignCenter + + + + + + + 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 + + + + + + + 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 + + + + + + + Instance 1 + + + + + + + Qt::StrongFocus + + + Select PID option or option pair to update. +Set to Disabled if not used. + + + + + + + Qt::StrongFocus + + + Select input used as a control source for this instance. +It can be one of Accessory channels or Throttle channel. + +If Accessory channel is chosen then its range [0..1] will be mapped +to PID range [Min..Max] defined for this instance. + +If Throttle channel is chosen then Throttle range [Min..Max] will +be mapped to PID range [Min..Max] defined for this instance. If +Throttle is out of bounds then PID Min and Max values will be used +accordingly. + +Note that it is possible to set PID Min > Max. In that case increasing +control input value will decrease the PID option value. This can be +used, for instance, to decrease PID value when increasing Throttle. + + + + + + + Qt::StrongFocus + + + Minimum PID value mapped to Accessory channel = 0 or +Throttle channel lesser or equal to Throttle Min value. + + + 6 + + + 0.000100000000000 + + + + + + + Qt::StrongFocus + + + Maximum PID value mapped to Accessory channel = 1 or +Throttle channel greater or equal to Throttle Max value. + + + 6 + + + 0.000100000000000 + + + + + + + Instance 2 + + + + + + + Qt::StrongFocus + + + Select PID option or option pair to update. +Set to Disabled if not used. + + + + + + + Qt::StrongFocus + + + Select input used as a control source for this instance. +It can be one of Accessory channels or Throttle channel. + +If Accessory channel is chosen then its range [0..1] will be mapped +to PID range [Min..Max] defined for this instance. + +If Throttle channel is chosen then Throttle range [Min..Max] will +be mapped to PID range [Min..Max] defined for this instance. If +Throttle is out of bounds then PID Min and Max values will be used +accordingly. + +Note that it is possible to set PID Min > Max. In that case increasing +control input value will decrease the PID option value. This can be +used, for instance, to decrease PID value when increasing Throttle. + + + + + + + Qt::StrongFocus + + + Minimum PID value mapped to Accessory channel = 0 or +Throttle channel lesser or equal to Throttle Min value. + + + 6 + + + 0.000100000000000 + + + + + + + Qt::StrongFocus + + + Maximum PID value mapped to Accessory channel = 1 or +Throttle channel greater or equal to Throttle Max value. + + + 6 + + + 0.000100000000000 + + + + + + + Instance 3 + + + + + + + Qt::StrongFocus + + + Select PID option or option pair to update. +Set to Disabled if not used. + + + + + + + Qt::StrongFocus + + + Select input used as a control source for this instance. +It can be one of Accessory channels or Throttle channel. + +If Accessory channel is chosen then its range [0..1] will be mapped +to PID range [Min..Max] defined for this instance. + +If Throttle channel is chosen then Throttle range [Min..Max] will +be mapped to PID range [Min..Max] defined for this instance. If +Throttle is out of bounds then PID Min and Max values will be used +accordingly. + +Note that it is possible to set PID Min > Max. In that case increasing +control input value will decrease the PID option value. This can be +used, for instance, to decrease PID value when increasing Throttle. + + + + + + + Qt::StrongFocus + + + Minimum PID value mapped to Accessory channel = 0 or +Throttle channel lesser or equal to Throttle Min value. + + + 6 + + + 0.000100000000000 + + + + + + + Qt::StrongFocus + + + Maximum PID value mapped to Accessory channel = 1 or +Throttle channel greater or equal to Throttle Max value. + + + 6 + + + 0.000100000000000 + + + + + + + Update Mode + + + + + + + Qt::StrongFocus + + + PID values update mode which can be set to: +- Never: this disables PID updates (but module still will be run if enabled), +- When Armed: PID updated only when system is armed, +- Always: PID updated always regardless of arm state. + +Since the GCS updates GUI PID values in real time on change, could be +tricky to change other PID values from the GUI if the module is enabled +and constantly updates stabilization settings object. As a workaround, +this option can be used to temporarily disable updates or enable them +only when system is armed without disabling the module. + + + + + + + Throttle Range + + + + + + + Qt::StrongFocus + + + Throttle channel lower bound mapped to PID Min value + + + 1.000000000000000 + + + 0.010000000000000 + + + + + + + Qt::StrongFocus + + + Throttle channel upper bound mapped to PID Max value + + + 1.000000000000000 + + + 0.010000000000000 + + + + + + + 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 + + + + + + + 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 + + + + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 20 + 20 + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Send settings to the board but do not save to the non-volatile memory + + + Apply + + + + + + + Send settings to the board and save to the non-volatile memory + + + Save + + + false + + + + + + + + + + + TxPIDEnable + Apply + Save + scrollArea + PID1 + Input1 + MinPID1 + MaxPID1 + PID2 + Input2 + MinPID2 + MaxPID2 + PID3 + Input3 + MinPID3 + MaxPID3 + ThrottleMin + ThrottleMax + UpdateMode + + + + From 8682937f8a3a60a1852e0bc02da4b160d3e7e88e Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 15 May 2012 17:40:33 -0500 Subject: [PATCH 04/13] Remove custom style sheets from camerastab. At least that was applied widget wide, but still should be done to look nice cross platform (or from a window specific runtime command). --- .../src/plugins/config/camerastabilization.ui | 1729 ++++++++--------- 1 file changed, 835 insertions(+), 894 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/camerastabilization.ui b/ground/openpilotgcs/src/plugins/config/camerastabilization.ui index 828cded66..e535faa50 100644 --- a/ground/openpilotgcs/src/plugins/config/camerastabilization.ui +++ b/ground/openpilotgcs/src/plugins/config/camerastabilization.ui @@ -1,894 +1,835 @@ - - - CameraStabilizationWidget - - - - 0 - 0 - 720 - 567 - - - - Form - - - - - - #groupBox_5,#groupBox{ -background-color: qlineargradient(spread:pad, x1:0.507, y1:0.869318, x2:0.507, y2:0.0965909, stop:0 rgba(243, 243, 243, 255), stop:1 rgba(250, 250, 250, 255)); -border: 1px outset #999; -border-radius: 3; -font:bold; -} - -QGroupBox::title { - subcontrol-origin: margin; - subcontrol-position: top center; /* position at the top center */ - padding: 0 3px; - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #FFOECE, stop: 1 #FFFFFF); - top: 5px; - } - - - QFrame::NoFrame - - - true - - - - - 0 - 0 - 702 - 484 - - - - - - - Qt::StrongFocus - - - Enable CameraStabilization module - - - - - - - After enabling the module, you must power cycle before using and configuring. - - - - - - - Qt::Horizontal - - - - - - - Qt::Vertical - - - QSizePolicy::Preferred - - - - 20 - 10 - - - - - - - - - 0 - 0 - - - - - 0 - 100 - - - - Basic Settings (Stabilization) - - - - - - Qt::StrongFocus - - - Camera yaw angle for 100% output value, deg. - -This value should be tuned for particular gimbal and servo. You also -have to define channel output range using Output configuration tab. - - - 180 - - - 20 - - - - - - - Qt::StrongFocus - - - Camera pitch angle for 100% output value, deg. - -This value should be tuned for particular gimbal and servo. You also -have to define channel output range using Output configuration tab. - - - 180 - - - 20 - - - - - - - Qt::StrongFocus - - - Camera roll angle for 100% output value, deg. - -This value should be tuned for particular gimbal and servo. You also -have to define channel output range using Output configuration tab. - - - 180 - - - 20 - - - - - - - Qt::StrongFocus - - - Yaw output channel for camera gimbal - - - - None - - - - - - - - Qt::StrongFocus - - - Pitch output channel for camera gimbal - - - - None - - - - - - - - Qt::StrongFocus - - - Roll output channel for camera gimbal - - - - None - - - - - - - - Output Channel - - - - - - - Output Range - - - - - - - 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; - - - Yaw - - - Qt::AlignCenter - - - - - - - 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; - - - Pitch - - - Qt::AlignCenter - - - - - - - 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 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Preferred - - - - 20 - 10 - - - - - - - - - 0 - 0 - - - - - 0 - 204 - - - - Advanced Settings (Control) - - - - - - 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; - - - Yaw - - - Qt::AlignCenter - - - - - - - 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; - - - Pitch - - - Qt::AlignCenter - - - - - - - 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 - - - - - - - Qt::StrongFocus - - - Input channel to control camera yaw - -Don't forget to map this channel using Input configuration tab. - - - - None - - - - - - - - Qt::StrongFocus - - - Input channel to control camera pitch - -Don't forget to map this channel using Input configuration tab. - - - - None - - - - - - - - Qt::StrongFocus - - - Input channel to control camera roll - -Don't forget to map this channel using Input configuration tab. - - - - None - - - - - - - - Input Channel - - - - - - - Qt::StrongFocus - - - Axis stabilization mode - -Attitude: camera tracks level for the axis. Input controls the deflection. -AxisLock: camera remembers tracking attitude. Input controls the rate of deflection. - - - - Attitude - - - - - - - - Qt::StrongFocus - - - Maximum camera yaw deflection for 100% input in Attitude mode, deg. - - - 180 - - - 20 - - - - - - - Qt::StrongFocus - - - Maximum camera yaw rate for 100% input in AxisLock mode, deg/s. - - - 180 - - - 50 - - - - - - - Qt::StrongFocus - - - Input low-pass filter response time for yaw axis, ms. - -This option smoothes the stick input. Zero value disables LPF. - - - 1000 - - - 150 - - - - - - - Qt::StrongFocus - - - Axis stabilization mode - -Attitude: camera tracks level for the axis. Input controls the deflection. -AxisLock: camera remembers tracking attitude. Input controls the rate of deflection. - - - - Attitude - - - - - - - - Qt::StrongFocus - - - Maximum camera pitch deflection for 100% input in Attitude mode, deg. - - - 180 - - - 20 - - - - - - - Qt::StrongFocus - - - Maximum camera pitch rate for 100% input in AxisLock mode, deg/s. - - - 180 - - - 50 - - - - - - - Qt::StrongFocus - - - Input low-pass filter response time for pitch axis, ms. - -This option smoothes the stick input. Zero value disables LPF. - - - 1000 - - - 150 - - - - - - - Qt::StrongFocus - - - Axis stabilization mode - -Attitude: camera tracks level for the axis. Input controls the deflection. -AxisLock: camera remembers tracking attitude. Input controls the rate of deflection. - - - - Attitude - - - - - - - - Qt::StrongFocus - - - Maximum camera roll deflection for 100% input in Attitude mode, deg. - - - 180 - - - 20 - - - - - - - Qt::StrongFocus - - - Maximum camera roll rate for 100% input in AxisLock mode, deg/s. - - - 180 - - - 50 - - - - - - - Qt::StrongFocus - - - Input low-pass filter response time for roll axis, ms. - -This option smoothes the stick input. Zero value disables LPF. - - - 1000 - - - 150 - - - - - - - MaxAxisLockRate - - - - - - - Response Time - - - - - - - Input Rate - - - - - - - Input Range - - - - - - - Stabilization Mode - - - - - - - (the same value for Roll, Pitch, Yaw) - - - - - - - Qt::StrongFocus - - - Stick input deadband for all axes in AxisLock mode, deg/s. - -When stick input is within the MaxAxisLockRate range, camera tracks -current attitude. Otherwise it starts moving according to input with -rate depending on input value. - -If you have drift in your Tx controls, you may want to increase this -value. - - - 1 - - - 0.100000000000000 - - - 1.000000000000000 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 32 - 32 - - - - - true - - - - - - - - :/core/images/helpicon.svg:/core/images/helpicon.svg - - - - 32 - 32 - - - - Ctrl+S - - - false - - - true - - - - - - - Load default CameraStabilization settings except output channels - -Loaded settings are not applied automatically. You have to click the -Apply or Save button afterwards. - - - Reset To Defaults - - - - - - - Send settings to the board but do not save to the non-volatile memory - - - Apply - - - - - - - Send settings to the board and save to the non-volatile memory - - - Save - - - false - - - - - - - - - - - enableCameraStabilization - rollChannel - pitchChannel - yawChannel - rollOutputRange - pitchOutputRange - yawOutputRange - rollInputChannel - pitchInputChannel - yawInputChannel - rollStabilizationMode - pitchStabilizationMode - yawStabilizationMode - rollInputRange - pitchInputRange - yawInputRange - rollInputRate - pitchInputRate - yawInputRate - rollResponseTime - pitchResponseTime - yawResponseTime - MaxAxisLockRate - camerastabilizationHelp - camerastabilizationResetToDefaults - camerastabilizationSaveRAM - camerastabilizationSaveSD - scrollArea - - - - - - + + + CameraStabilizationWidget + + + + 0 + 0 + 720 + 739 + + + + Form + + + + + + QFrame::NoFrame + + + true + + + + + 0 + 0 + 696 + 635 + + + + + + + Qt::StrongFocus + + + Enable CameraStabilization module + + + + + + + After enabling the module, you must power cycle before using and configuring. + + + + + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 20 + 10 + + + + + + + + + 0 + 0 + + + + + 0 + 100 + + + + Basic Settings (Stabilization) + + + + + + Qt::StrongFocus + + + Camera yaw angle for 100% output value, deg. + +This value should be tuned for particular gimbal and servo. You also +have to define channel output range using Output configuration tab. + + + 180 + + + 20 + + + + + + + Qt::StrongFocus + + + Camera pitch angle for 100% output value, deg. + +This value should be tuned for particular gimbal and servo. You also +have to define channel output range using Output configuration tab. + + + 180 + + + 20 + + + + + + + Qt::StrongFocus + + + Camera roll angle for 100% output value, deg. + +This value should be tuned for particular gimbal and servo. You also +have to define channel output range using Output configuration tab. + + + 180 + + + 20 + + + + + + + Qt::StrongFocus + + + Yaw output channel for camera gimbal + + + + None + + + + + + + + Qt::StrongFocus + + + Pitch output channel for camera gimbal + + + + None + + + + + + + + Qt::StrongFocus + + + Roll output channel for camera gimbal + + + + None + + + + + + + + Output Channel + + + + + + + Output Range + + + + + + + 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; + + + Yaw + + + Qt::AlignCenter + + + + + + + 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; + + + Pitch + + + Qt::AlignCenter + + + + + + + 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 + 0 + + + + + 0 + 204 + + + + Advanced Settings (Control) + + + + + + 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; + + + Yaw + + + Qt::AlignCenter + + + + + + + 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; + + + Pitch + + + Qt::AlignCenter + + + + + + + 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 + + + + + + + Qt::StrongFocus + + + Input channel to control camera yaw + +Don't forget to map this channel using Input configuration tab. + + + + None + + + + + + + + Qt::StrongFocus + + + Input channel to control camera pitch + +Don't forget to map this channel using Input configuration tab. + + + + None + + + + + + + + Qt::StrongFocus + + + Input channel to control camera roll + +Don't forget to map this channel using Input configuration tab. + + + + None + + + + + + + + Input Channel + + + + + + + Qt::StrongFocus + + + Axis stabilization mode + +Attitude: camera tracks level for the axis. Input controls the deflection. +AxisLock: camera remembers tracking attitude. Input controls the rate of deflection. + + + + Attitude + + + + + + + + Qt::StrongFocus + + + Maximum camera yaw deflection for 100% input in Attitude mode, deg. + + + 180 + + + 20 + + + + + + + Qt::StrongFocus + + + Maximum camera yaw rate for 100% input in AxisLock mode, deg/s. + + + 180 + + + 50 + + + + + + + Qt::StrongFocus + + + Input low-pass filter response time for yaw axis, ms. + +This option smoothes the stick input. Zero value disables LPF. + + + 1000 + + + 150 + + + + + + + Qt::StrongFocus + + + Axis stabilization mode + +Attitude: camera tracks level for the axis. Input controls the deflection. +AxisLock: camera remembers tracking attitude. Input controls the rate of deflection. + + + + Attitude + + + + + + + + Qt::StrongFocus + + + Maximum camera pitch deflection for 100% input in Attitude mode, deg. + + + 180 + + + 20 + + + + + + + Qt::StrongFocus + + + Maximum camera pitch rate for 100% input in AxisLock mode, deg/s. + + + 180 + + + 50 + + + + + + + Qt::StrongFocus + + + Input low-pass filter response time for pitch axis, ms. + +This option smoothes the stick input. Zero value disables LPF. + + + 1000 + + + 150 + + + + + + + Qt::StrongFocus + + + Axis stabilization mode + +Attitude: camera tracks level for the axis. Input controls the deflection. +AxisLock: camera remembers tracking attitude. Input controls the rate of deflection. + + + + Attitude + + + + + + + + Qt::StrongFocus + + + Maximum camera roll deflection for 100% input in Attitude mode, deg. + + + 180 + + + 20 + + + + + + + Qt::StrongFocus + + + Maximum camera roll rate for 100% input in AxisLock mode, deg/s. + + + 180 + + + 50 + + + + + + + Qt::StrongFocus + + + Input low-pass filter response time for roll axis, ms. + +This option smoothes the stick input. Zero value disables LPF. + + + 1000 + + + 150 + + + + + + + MaxAxisLockRate + + + + + + + Response Time + + + + + + + Input Rate + + + + + + + Input Range + + + + + + + Stabilization Mode + + + + + + + (the same value for Roll, Pitch, Yaw) + + + + + + + Qt::StrongFocus + + + Stick input deadband for all axes in AxisLock mode, deg/s. + +When stick input is within the MaxAxisLockRate range, camera tracks +current attitude. Otherwise it starts moving according to input with +rate depending on input value. + +If you have drift in your Tx controls, you may want to increase this +value. + + + 1 + + + 0.100000000000000 + + + 1.000000000000000 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 32 + 32 + + + + + true + + + + + + + + :/core/images/helpicon.svg:/core/images/helpicon.svg + + + + 32 + 32 + + + + Ctrl+S + + + false + + + true + + + + + + + Load default CameraStabilization settings except output channels + +Loaded settings are not applied automatically. You have to click the +Apply or Save button afterwards. + + + Reset To Defaults + + + + + + + Send settings to the board but do not save to the non-volatile memory + + + Apply + + + + + + + Send settings to the board and save to the non-volatile memory + + + Save + + + false + + + + + + + + + + + enableCameraStabilization + rollChannel + pitchChannel + yawChannel + rollOutputRange + pitchOutputRange + yawOutputRange + rollInputChannel + pitchInputChannel + yawInputChannel + rollStabilizationMode + pitchStabilizationMode + yawStabilizationMode + rollInputRange + pitchInputRange + yawInputRange + rollInputRate + pitchInputRate + yawInputRate + rollResponseTime + pitchResponseTime + yawResponseTime + MaxAxisLockRate + camerastabilizationHelp + camerastabilizationResetToDefaults + camerastabilizationSaveRAM + camerastabilizationSaveSD + scrollArea + + + + + + From 1a4e358f7cdd4bbfcfedfe755826c70899966bac Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 15 May 2012 17:46:51 -0500 Subject: [PATCH 05/13] Remove custom style from airframe --- .../src/plugins/config/airframe.ui | 33 +++++-------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/airframe.ui b/ground/openpilotgcs/src/plugins/config/airframe.ui index f3acc28e9..be1957244 100644 --- a/ground/openpilotgcs/src/plugins/config/airframe.ui +++ b/ground/openpilotgcs/src/plugins/config/airframe.ui @@ -6,8 +6,8 @@ 0 0 - 730 - 602 + 796 + 605 @@ -73,25 +73,8 @@ - - #groupBox,#groupBox_2,#groupBox_3,#groupBox_6,#elevonMixBox{ -background-color: qlineargradient(spread:pad, x1:0.507, y1:0.869318, x2:0.507, y2:0.0965909, stop:0 rgba(243, 243, 243, 255), stop:1 rgba(250, 250, 250, 255)); -border: 1px outset #999; -border-radius: 3; -font:bold; -} - -QGroupBox::title { - subcontrol-origin: margin; - subcontrol-position: top center; /* position at the top center */ - padding: 0 3px; - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #FFOECE, stop: 1 #FFFFFF); - top: 5px; - } - - 2 + 1 @@ -2801,14 +2784,14 @@ p, li { white-space: pre-wrap; } <!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:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;"> <table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;"> <tr> <td style="border: none;"> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:600; color:#ff0000;">SETTING UP FEED FORWARD IS DANGEROUS</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;"></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:'Lucida Grande'; font-size:13pt;">Beware: Feed Forward Tuning will launch all engines around mid-throttle, you have been warned!</span></p> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Lucida Grande'; font-size:13pt;">Remove your props initially, and for fine-tuning, make sure your airframe is safely held in place. Wear glasses and protect your face and body.</span></p></td></tr></table></body></html> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:14pt; font-weight:600; color:#ff0000;">SETTING UP FEED FORWARD IS DANGEROUS</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:'Ubuntu'; font-size:11pt;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Beware: Feed Forward Tuning will launch all engines around mid-throttle, you have been warned!</p> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Remove your props initially, and for fine-tuning, make sure your airframe is safely held in place. Wear glasses and protect your face and body.</p></td></tr></table></body></html> From dd9e2de4b9243909e73870b7837c0be2c61278af Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 15 May 2012 19:02:29 -0500 Subject: [PATCH 06/13] Match small spacing between TxPid and CameraStab --- .../openpilotgcs/src/plugins/config/txpid.ui | 75 ++++++++++++------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/txpid.ui b/ground/openpilotgcs/src/plugins/config/txpid.ui index e7ce7ab5d..6ffa2e62d 100644 --- a/ground/openpilotgcs/src/plugins/config/txpid.ui +++ b/ground/openpilotgcs/src/plugins/config/txpid.ui @@ -66,8 +66,27 @@ Up to 3 separate PID options (or option pairs) can be selected and updated. + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 20 + 10 + + + + + + true + 0 @@ -84,7 +103,7 @@ Up to 3 separate PID options (or option pairs) can be selected and updated.Module Settings - + 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)); @@ -101,7 +120,7 @@ margin:1px; - + 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)); @@ -118,7 +137,7 @@ margin:1px; - + 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)); @@ -135,7 +154,7 @@ margin:1px; - + 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)); @@ -152,14 +171,14 @@ margin:1px; - + Instance 1 - + Qt::StrongFocus @@ -170,7 +189,7 @@ Set to Disabled if not used. - + Qt::StrongFocus @@ -193,7 +212,7 @@ used, for instance, to decrease PID value when increasing Throttle. - + Qt::StrongFocus @@ -210,7 +229,7 @@ Throttle channel lesser or equal to Throttle Min value. - + Qt::StrongFocus @@ -227,14 +246,14 @@ Throttle channel greater or equal to Throttle Max value. - + Instance 2 - + Qt::StrongFocus @@ -245,7 +264,7 @@ Set to Disabled if not used. - + Qt::StrongFocus @@ -268,7 +287,7 @@ used, for instance, to decrease PID value when increasing Throttle. - + Qt::StrongFocus @@ -285,7 +304,7 @@ Throttle channel lesser or equal to Throttle Min value. - + Qt::StrongFocus @@ -302,14 +321,14 @@ Throttle channel greater or equal to Throttle Max value. - + Instance 3 - + Qt::StrongFocus @@ -320,7 +339,7 @@ Set to Disabled if not used. - + Qt::StrongFocus @@ -343,7 +362,7 @@ used, for instance, to decrease PID value when increasing Throttle. - + Qt::StrongFocus @@ -360,7 +379,7 @@ Throttle channel lesser or equal to Throttle Min value. - + Qt::StrongFocus @@ -377,14 +396,14 @@ Throttle channel greater or equal to Throttle Max value. - + Update Mode - + Qt::StrongFocus @@ -403,14 +422,14 @@ only when system is armed without disabling the module. - + Throttle Range - + Qt::StrongFocus @@ -426,7 +445,7 @@ only when system is armed without disabling the module. - + Qt::StrongFocus @@ -442,7 +461,7 @@ only when system is armed without disabling the module. - + 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)); @@ -459,7 +478,7 @@ margin:1px; - + 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)); @@ -476,7 +495,7 @@ margin:1px; - + Qt::Vertical @@ -503,7 +522,7 @@ margin:1px; 20 - 40 + 20 From 126671ae4cc92dcab88400f1bc123937d4edb1ba Mon Sep 17 00:00:00 2001 From: James Cotton Date: Sat, 26 May 2012 09:55:04 -0500 Subject: [PATCH 07/13] Add line from Kenz that fixes button overlap on OSX --- .../config/configstabilizationwidget.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp index 07f6904c3..331c39e23 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp @@ -59,6 +59,24 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa connect(this,SIGNAL(widgetContentsChanged(QWidget*)),this,SLOT(processLinkedWidgets(QWidget*))); disableMouseWheelEvents(); + + // This is needed because new style tries to compact things as much as possible in grid + // and on OSX the widget sizes of PushButtons is reported incorrectly: + // https://bugreports.qt-project.org/browse/QTBUG-14591 + m_stabilization->saveStabilizationToRAM_6->setAttribute(Qt::WA_LayoutUsesWidgetRect); + m_stabilization->saveStabilizationToSD_6->setAttribute(Qt::WA_LayoutUsesWidgetRect); + m_stabilization->stabilizationReloadBoardData_6->setAttribute(Qt::WA_LayoutUsesWidgetRect); + m_stabilization->saveStabilizationToRAM_7->setAttribute(Qt::WA_LayoutUsesWidgetRect); + m_stabilization->saveStabilizationToSD_7->setAttribute(Qt::WA_LayoutUsesWidgetRect); + m_stabilization->pushButton_2->setAttribute(Qt::WA_LayoutUsesWidgetRect); + m_stabilization->pushButton_3->setAttribute(Qt::WA_LayoutUsesWidgetRect); + m_stabilization->pushButton_4->setAttribute(Qt::WA_LayoutUsesWidgetRect); + m_stabilization->pushButton_19->setAttribute(Qt::WA_LayoutUsesWidgetRect); + m_stabilization->pushButton_20->setAttribute(Qt::WA_LayoutUsesWidgetRect); + m_stabilization->pushButton_21->setAttribute(Qt::WA_LayoutUsesWidgetRect); + m_stabilization->pushButton_22->setAttribute(Qt::WA_LayoutUsesWidgetRect); + m_stabilization->pushButton_23->setAttribute(Qt::WA_LayoutUsesWidgetRect); + m_stabilization->pushButton_24->setAttribute(Qt::WA_LayoutUsesWidgetRect); } From 5fb615c3e5eea332675e0e8433a79cb6650fa9ea Mon Sep 17 00:00:00 2001 From: James Cotton Date: Sat, 26 May 2012 14:09:42 -0500 Subject: [PATCH 08/13] Remove stylesheet on subpanel of input.ui as it doesn't look consistent across platforms. --- .../openpilotgcs/src/plugins/config/input.ui | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/input.ui b/ground/openpilotgcs/src/plugins/config/input.ui index da2a59ddd..422904bb5 100644 --- a/ground/openpilotgcs/src/plugins/config/input.ui +++ b/ground/openpilotgcs/src/plugins/config/input.ui @@ -16,23 +16,6 @@ - - #groupBox_2,#groupBox{ -background-color: qlineargradient(spread:pad, x1:0.507, y1:0.869318, x2:0.507, y2:0.0965909, stop:0 rgba(243, 243, 243, 255), stop:1 rgba(250, 250, 250, 255)); -border: 1px outset #999; -border-radius: 3; -font:bold; -} - -QGroupBox::title { - subcontrol-origin: margin; - subcontrol-position: top center; /* position at the top center */ - padding: 0 3px; - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #FFOECE, stop: 1 #FFFFFF); - top: 5px; - } - 0 @@ -246,7 +229,7 @@ QGroupBox::title { 30 160 451 - 141 + 161 @@ -442,9 +425,6 @@ margin:1px; 121 - - - FlightMode Switch Positions From f95d29a3b8a6277479624087ab54a222029a6fd3 Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Mon, 28 May 2012 12:48:55 +0300 Subject: [PATCH 09/13] TxPID: add GyroTau to the list of parameters (OP-637) --- flight/Modules/TxPID/txpid.c | 3 +++ shared/uavobjectdefinition/txpidsettings.xml | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/flight/Modules/TxPID/txpid.c b/flight/Modules/TxPID/txpid.c index cff9c1d9e..fd350c0d4 100644 --- a/flight/Modules/TxPID/txpid.c +++ b/flight/Modules/TxPID/txpid.c @@ -275,6 +275,9 @@ static void updatePIDs(UAVObjEvent* ev) case TXPIDSETTINGS_PIDS_YAWATTITUDEILIMIT: needsUpdate |= update(&stab.YawPI[STABILIZATIONSETTINGS_YAWPI_ILIMIT], value); break; + case TXPIDSETTINGS_PIDS_GYROTAU: + needsUpdate |= update(&stab.GyroTau, value); + break; default: PIOS_Assert(0); } diff --git a/shared/uavobjectdefinition/txpidsettings.xml b/shared/uavobjectdefinition/txpidsettings.xml index bdc05ba33..5b69063e8 100644 --- a/shared/uavobjectdefinition/txpidsettings.xml +++ b/shared/uavobjectdefinition/txpidsettings.xml @@ -16,7 +16,8 @@ Roll Rate.ILimit, Pitch Rate.ILimit, Roll+Pitch Rate.ILimit, Yaw Rate.ILimit, Roll Attitude.Kp, Pitch Attitude.Kp, Roll+Pitch Attitude.Kp, Yaw Attitude.Kp, Roll Attitude.Ki, Pitch Attitude.Ki, Roll+Pitch Attitude.Ki, Yaw Attitude.Ki, - Roll Attitude.ILimit, Pitch Attitude.ILimit, Roll+Pitch Attitude.ILimit, Yaw Attitude.ILimit" + Roll Attitude.ILimit, Pitch Attitude.ILimit, Roll+Pitch Attitude.ILimit, Yaw Attitude.ILimit, + GyroTau" defaultvalue="Disabled"/> From ea03f8f220a1efd62fd6ab9141acb73b34c1e6ed Mon Sep 17 00:00:00 2001 From: James Cotton Date: Mon, 28 May 2012 10:40:35 -0500 Subject: [PATCH 10/13] Remove the specific function for the setSpinningArmed flag. This is now done differently with the configTaskWidget style. --- .../src/plugins/config/configoutputwidget.cpp | 62 ++++++++----------- .../src/plugins/config/configoutputwidget.h | 1 - 2 files changed, 26 insertions(+), 37 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index ff0927709..1ff7df6e1 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -77,8 +77,6 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren firstUpdate = true; - connect(m_config->spinningArmed, SIGNAL(toggled(bool)), this, SLOT(setSpinningArmed(bool))); - // Connect the help button connect(m_config->outputHelp, SIGNAL(clicked()), this, SLOT(openHelp())); addWidget(m_config->cb_outputRate4); @@ -196,24 +194,6 @@ void ConfigOutputWidget::assignOutputChannel(UAVDataObject *obj, QString str) outputChannelForm->setAssignment(str); } -/** - * Set the "Spin motors at neutral when armed" flag in ActuatorSettings - */ -void ConfigOutputWidget::setSpinningArmed(bool val) -{ - ActuatorSettings *actuatorSettings = ActuatorSettings::GetInstance(getObjectManager()); - Q_ASSERT(actuatorSettings); - ActuatorSettings::DataFields actuatorSettingsData = actuatorSettings->getData(); - - if(val) - actuatorSettingsData.MotorsSpinWhileArmed = ActuatorSettings::MOTORSSPINWHILEARMED_TRUE; - else - actuatorSettingsData.MotorsSpinWhileArmed = ActuatorSettings::MOTORSSPINWHILEARMED_FALSE; - - // Apply settings - actuatorSettings->setData(actuatorSettingsData); -} - /** Sends the channel value to the UAV to move the servo. Returns immediately if we are not in testing mode @@ -347,26 +327,36 @@ void ConfigOutputWidget::refreshWidgetsValues(UAVObject *) */ void ConfigOutputWidget::updateObjectsFromWidgets() { + emit updateObjectsFromWidgetsRequested(); + ActuatorSettings *actuatorSettings = ActuatorSettings::GetInstance(getObjectManager()); Q_ASSERT(actuatorSettings); - ActuatorSettings::DataFields actuatorSettingsData = actuatorSettings->getData(); + if(actuatorSettings) { + ActuatorSettings::DataFields actuatorSettingsData = actuatorSettings->getData(); - // Set channel ranges - QList outputChannelForms = findChildren(); - foreach(OutputChannelForm *outputChannelForm, outputChannelForms) - { - actuatorSettingsData.ChannelMax[outputChannelForm->index()] = outputChannelForm->max(); - actuatorSettingsData.ChannelMin[outputChannelForm->index()] = outputChannelForm->min(); - actuatorSettingsData.ChannelNeutral[outputChannelForm->index()] = outputChannelForm->neutral(); + // Set channel ranges + QList outputChannelForms = findChildren(); + foreach(OutputChannelForm *outputChannelForm, outputChannelForms) + { + actuatorSettingsData.ChannelMax[outputChannelForm->index()] = outputChannelForm->max(); + actuatorSettingsData.ChannelMin[outputChannelForm->index()] = outputChannelForm->min(); + actuatorSettingsData.ChannelNeutral[outputChannelForm->index()] = outputChannelForm->neutral(); + } + + // Set update rates + actuatorSettingsData.ChannelUpdateFreq[0] = m_config->cb_outputRate1->currentText().toUInt(); + actuatorSettingsData.ChannelUpdateFreq[1] = m_config->cb_outputRate2->currentText().toUInt(); + actuatorSettingsData.ChannelUpdateFreq[2] = m_config->cb_outputRate3->currentText().toUInt(); + actuatorSettingsData.ChannelUpdateFreq[3] = m_config->cb_outputRate4->currentText().toUInt(); + + if(m_config->spinningArmed->isChecked() == true) + actuatorSettingsData.MotorsSpinWhileArmed = ActuatorSettings::MOTORSSPINWHILEARMED_TRUE; + else + actuatorSettingsData.MotorsSpinWhileArmed = ActuatorSettings::MOTORSSPINWHILEARMED_FALSE; + + // Apply settings + actuatorSettings->setData(actuatorSettingsData); } - - // Set update rates - actuatorSettingsData.ChannelUpdateFreq[0] = m_config->cb_outputRate1->currentText().toUInt(); - actuatorSettingsData.ChannelUpdateFreq[1] = m_config->cb_outputRate2->currentText().toUInt(); - actuatorSettingsData.ChannelUpdateFreq[2] = m_config->cb_outputRate3->currentText().toUInt(); - actuatorSettingsData.ChannelUpdateFreq[3] = m_config->cb_outputRate4->currentText().toUInt(); - // Apply settings - actuatorSettings->setData(actuatorSettingsData); } void ConfigOutputWidget::openHelp() diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.h b/ground/openpilotgcs/src/plugins/config/configoutputwidget.h index 4602487ba..e558dd6f1 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.h @@ -73,7 +73,6 @@ private slots: void updateObjectsFromWidgets(); void runChannelTests(bool state); void sendChannelTest(int index, int value); - void setSpinningArmed(bool val); void openHelp(); protected: void enableControls(bool enable); From 52a3d0079e2ef74fbfa2d9136596a1fe08022f48 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Mon, 28 May 2012 14:06:34 -0500 Subject: [PATCH 11/13] Clean up the output widget a bit with whole it interfaces to the configTaskWidget. Uses more of the parent functionality. --- .../src/plugins/config/configoutputwidget.cpp | 27 +++++++++++-------- .../src/plugins/config/configoutputwidget.h | 2 +- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index 1ff7df6e1..12c81df9d 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -50,15 +50,10 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren m_config->setupUi(this); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - addApplySaveButtons(m_config->saveRCOutputToRAM,m_config->saveRCOutputToSD); - addUAVObject("ActuatorSettings"); UAVSettingsImportExportFactory * importexportplugin = pm->getObject(); connect(importexportplugin,SIGNAL(importAboutToBegin()),this,SLOT(stopTests())); - addApplySaveButtons(m_config->saveRCOutputToRAM,m_config->saveRCOutputToSD); - addUAVObject("ActuatorSettings"); - // 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++) @@ -73,23 +68,37 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren connect(m_config->channelOutTest, SIGNAL(toggled(bool)), this, SLOT(runChannelTests(bool))); - refreshWidgetsValues(); firstUpdate = true; + // Configure the task widget // Connect the help button connect(m_config->outputHelp, SIGNAL(clicked()), this, SLOT(openHelp())); + + // Add custom handling of displaying things + connect(this,SIGNAL(refreshWidgetsValuesRequested()), this, SLOT(refreshOutputWidgetsValues())); + + addApplySaveButtons(m_config->saveRCOutputToRAM,m_config->saveRCOutputToSD); + + // Track the ActuatorSettings object + addUAVObject("ActuatorSettings"); + + // Associate the buttons with their UAVO fields addWidget(m_config->cb_outputRate4); addWidget(m_config->cb_outputRate3); addWidget(m_config->cb_outputRate2); addWidget(m_config->cb_outputRate1); addWidget(m_config->spinningArmed); + disconnect(this, SLOT(refreshWidgetsValues(UAVObject*))); + UAVObjectManager *objManager = pm->getObject(); UAVObject* obj = objManager->getObject(QString("ActuatorCommand")); if(UAVObject::GetGcsTelemetryUpdateMode(obj->getMetadata()) == UAVObject::UPDATEMODE_ONCHANGE) this->setEnabled(false); connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(disableIfNotMe(UAVObject*))); + + refreshWidgetsValues(); } void ConfigOutputWidget::enableControls(bool enable) { @@ -222,10 +231,8 @@ void ConfigOutputWidget::sendChannelTest(int index, int value) /** Request the current config from the board (RC Output) */ -void ConfigOutputWidget::refreshWidgetsValues(UAVObject *) +void ConfigOutputWidget::refreshOutputWidgetsValues(UAVObject *) { - bool dirty=isDirty(); - // Reset all channel assignements: QList outputChannelForms = findChildren(); foreach(OutputChannelForm *outputChannelForm, outputChannelForms) @@ -318,8 +325,6 @@ void ConfigOutputWidget::refreshWidgetsValues(UAVObject *) int neutral = actuatorSettingsData.ChannelNeutral[outputChannelForm->index()]; outputChannelForm->neutral(neutral); } - - setDirty(dirty); } /** diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.h b/ground/openpilotgcs/src/plugins/config/configoutputwidget.h index e558dd6f1..e939db7a7 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.h @@ -69,7 +69,7 @@ private: private slots: void stopTests(); void disableIfNotMe(UAVObject *obj); - virtual void refreshWidgetsValues(UAVObject * obj = NULL); + void refreshOutputWidgetsValues(UAVObject * obj = NULL); void updateObjectsFromWidgets(); void runChannelTests(bool state); void sendChannelTest(int index, int value); From a6e9235888501fa71a34b9c964898f9702c3dd62 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Mon, 28 May 2012 14:09:23 -0500 Subject: [PATCH 12/13] Make the connections in the config gadget unique and add a flag to make sure the refreshWidgetValues is never caleld after disabling updates --- .../uavobjectwidgetutils/configtaskwidget.cpp | 14 +++++++++----- .../uavobjectwidgetutils/configtaskwidget.h | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp index cceec4216..7fb8d70c7 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp @@ -32,7 +32,7 @@ /** * Constructor */ -ConfigTaskWidget::ConfigTaskWidget(QWidget *parent) : QWidget(parent),isConnected(false),smartsave(NULL),dirty(false),outOfLimitsStyle("background-color: rgb(255, 0, 0);"),timeOut(NULL) +ConfigTaskWidget::ConfigTaskWidget(QWidget *parent) : QWidget(parent),isConnected(false),smartsave(NULL),dirty(false),outOfLimitsStyle("background-color: rgb(255, 0, 0);"),timeOut(NULL),allowWidgetUpdates(true) { pm = ExtensionSystem::PluginManager::instance(); objManager = pm->getObject(); @@ -127,7 +127,7 @@ void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString fiel Q_ASSERT(obj); objectUpdates.insert(obj,true); connect(obj, SIGNAL(objectUpdated(UAVObject*)),this, SLOT(objectUpdated(UAVObject*))); - connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshWidgetsValues(UAVObject*))); + connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshWidgetsValues(UAVObject*)), Qt::UniqueConnection); } if(!field.isEmpty() && obj) _field = obj->getField(QString(field)); @@ -258,6 +258,9 @@ void ConfigTaskWidget::populateWidgets() */ void ConfigTaskWidget::refreshWidgetsValues(UAVObject * obj) { + if (!allowWidgetUpdates) + return; + bool dirtyBack=dirty; emit refreshWidgetsValuesRequested(); foreach(objectToWidget * ow,objOfInterest) @@ -452,10 +455,10 @@ bool ConfigTaskWidget::isDirty() */ void ConfigTaskWidget::disableObjUpdates() { + allowWidgetUpdates = false; foreach(objectToWidget * obj,objOfInterest) { - if(obj->object) - disconnect(obj->object, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshWidgetsValues())); + if(obj->object)disconnect(obj->object, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshWidgetsValues(UAVObject*))); } } /** @@ -463,10 +466,11 @@ void ConfigTaskWidget::disableObjUpdates() */ void ConfigTaskWidget::enableObjUpdates() { + allowWidgetUpdates = true; foreach(objectToWidget * obj,objOfInterest) { if(obj->object) - connect(obj->object, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshWidgetsValues(UAVObject*))); + connect(obj->object, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshWidgetsValues(UAVObject*)), Qt::UniqueConnection); } } /** diff --git a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.h b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.h index 3099fa529..76d6b55bd 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.h +++ b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.h @@ -145,6 +145,7 @@ private slots: void reloadButtonClicked(); private: bool isConnected; + bool allowWidgetUpdates; QStringList objectsList; QList objOfInterest; ExtensionSystem::PluginManager *pm; From 19d8f8a98a114739e18dba89a8fb4af8987a08de Mon Sep 17 00:00:00 2001 From: James Cotton Date: Mon, 28 May 2012 20:17:35 -0500 Subject: [PATCH 13/13] Bump the history file a bit with recent commits --- HISTORY.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/HISTORY.txt b/HISTORY.txt index 2525b4736..b2cfe1b92 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -1,5 +1,12 @@ Short summary of changes. For a complete list see the git log. +2012-05-26 +Revert some UI changes that didn't work consistently between OSX and Windows. + +2012-05-24 +Merged the updated firmware for the PipXtreme, thanks to Brian for a lot of +work on this. + 2012-05-04 Support for CC3D. This involved changes to various things such as the sensors being split from AttitudeRaw to Accels,Gyros,Magnetometer. A single firmware