From 242bfe6c69413996089cb6721f1fdd5c3f12848d Mon Sep 17 00:00:00 2001 From: zedamota Date: Tue, 24 Jan 2012 22:29:08 +0000 Subject: [PATCH 1/6] added new Transmitter artwork to the input wizard. --- .../src/plugins/config/configgadget.qrc | 1 + .../src/plugins/config/configinputwidget.cpp | 6 +- .../src/plugins/config/images/TX2.svg | 2852 +++++++++++++++++ 3 files changed, 2856 insertions(+), 3 deletions(-) create mode 100644 ground/openpilotgcs/src/plugins/config/images/TX2.svg diff --git a/ground/openpilotgcs/src/plugins/config/configgadget.qrc b/ground/openpilotgcs/src/plugins/config/configgadget.qrc index f24cb68b8..6eb11f079 100644 --- a/ground/openpilotgcs/src/plugins/config/configgadget.qrc +++ b/ground/openpilotgcs/src/plugins/config/configgadget.qrc @@ -17,5 +17,6 @@ images/gyroscope.png images/TX.svg images/camera.png + images/TX2.svg diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 863104447..2f3b83754 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -41,8 +41,8 @@ #include #include -#define ACCESS_MIN_MOVE -6 -#define ACCESS_MAX_MOVE 6 +#define ACCESS_MIN_MOVE -3 +#define ACCESS_MAX_MOVE 3 #define STICK_MIN_MOVE -8 #define STICK_MAX_MOVE 8 @@ -108,7 +108,7 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) m_renderer = new QSvgRenderer(); QGraphicsScene *l_scene = m_config->graphicsView->scene(); m_config->graphicsView->setBackgroundBrush(QBrush(Utils::StyleHelper::baseColor())); - if (QFile::exists(":/configgadget/images/TX.svg") && m_renderer->load(QString(":/configgadget/images/TX.svg")) && m_renderer->isValid()) + if (QFile::exists(":/configgadget/images/TX2.svg") && m_renderer->load(QString(":/configgadget/images/TX2.svg")) && m_renderer->isValid()) { l_scene->clear(); // Deletes all items contained in the scene as well. diff --git a/ground/openpilotgcs/src/plugins/config/images/TX2.svg b/ground/openpilotgcs/src/plugins/config/images/TX2.svg new file mode 100644 index 000000000..a6c8a533a --- /dev/null +++ b/ground/openpilotgcs/src/plugins/config/images/TX2.svg @@ -0,0 +1,2852 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 0a1645587c39e526eecea6dfc4b196942fbb079a Mon Sep 17 00:00:00 2001 From: David Ankers Date: Sun, 29 Jan 2012 04:30:43 +1100 Subject: [PATCH 2/6] Update deluxe dials --- .../Dials/deluxe/lineardial-horizontal.svg | 135 +++++------ artwork/Dials/deluxe/lineardial-vertical.svg | 219 ++++++++++-------- .../dials/deluxe/lineardial-horizontal.svg | 135 +++++------ .../dials/deluxe/lineardial-vertical.svg | 219 ++++++++++-------- 4 files changed, 352 insertions(+), 356 deletions(-) mode change 100644 => 100755 artwork/Dials/deluxe/lineardial-horizontal.svg mode change 100644 => 100755 artwork/Dials/deluxe/lineardial-vertical.svg mode change 100644 => 100755 ground/openpilotgcs/share/openpilotgcs/dials/deluxe/lineardial-horizontal.svg mode change 100644 => 100755 ground/openpilotgcs/share/openpilotgcs/dials/deluxe/lineardial-vertical.svg diff --git a/artwork/Dials/deluxe/lineardial-horizontal.svg b/artwork/Dials/deluxe/lineardial-horizontal.svg old mode 100644 new mode 100755 index 2f6f71b17..e37172ec0 --- a/artwork/Dials/deluxe/lineardial-horizontal.svg +++ b/artwork/Dials/deluxe/lineardial-horizontal.svg @@ -14,8 +14,8 @@ height="70.597504" id="svg10068" version="1.1" - inkscape:version="0.48.1 " - sodipodi:docname="lineardial-horizontal.svg" + inkscape:version="0.48.2 r9819" + sodipodi:docname="lineardial-horizontal-old2.svg" inkscape:export-filename="H:\Documents\Hobbies\W433\My Gauges\vbat-001.png" inkscape:export-xdpi="103.61" inkscape:export-ydpi="103.61" @@ -25,15 +25,19 @@ + offset="0.31684026" + style="stop-color:#a3a3a3;stop-opacity:1;" /> + @@ -57,15 +61,11 @@ + style="stop-color:#8a8a8a;stop-opacity:1;" /> - + id="stop4391" /> @@ -237,15 +237,15 @@ + style="stop-color:#676767;stop-opacity:1;" /> + style="stop-color:#7d7d7d;stop-opacity:1;" /> @@ -425,46 +425,34 @@ - + offset="0" + style="stop-color:#ffc001;stop-opacity:1;" /> - - + offset="0" + style="stop-color:#e60000;stop-opacity:1;" /> @@ -687,7 +675,7 @@ x2="87.074203" y2="168.83261" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0,0.99999995,-0.99999975,0,-11.23354,-270.8763)" /> + gradientTransform="matrix(0,1.0110991,-1.0062411,0,-10.360287,-272.19756)" /> + gradientTransform="matrix(0,1.0224134,-1.0048488,0,-10.554719,-273.54528)" /> + gradientTransform="matrix(0,1,-1.0055415,0,-10.459485,-270.8763)" /> + transform="translate(-368.2988,-507.08981)"> @@ -1225,17 +1212,16 @@ id="layer5" inkscape:label="Green Zone" style="display:inline" - transform="translate(-140.85549,-141.35611)" - sodipodi:insensitive="true"> + transform="translate(-140.85549,-141.35611)"> + transform="translate(-140.85549,-141.35611)"> + transform="translate(-140.85549,-141.35611)"> + transform="translate(-140.85549,-141.35611)"> + transform="matrix(0,1,-1,0,0,0)" + ry="2.5494981" + rx="1.9392394" /> + + + + + style="stop-color:#656565;stop-opacity:1;" /> + style="stop-color:#757575;stop-opacity:1;" /> @@ -83,15 +94,19 @@ + style="stop-color:#9c9c9c;stop-opacity:0;" /> + id="stop3921" + offset="0.359375" + style="stop-color:#6c6c6c;stop-opacity:0.88793105;" /> + + style="stop-color:#9c9c9c;stop-opacity:0;" /> @@ -215,46 +230,34 @@ - + offset="0" + style="stop-color:#ffc001;stop-opacity:1;" /> - - + offset="0" + style="stop-color:#e60000;stop-opacity:1;" /> @@ -475,7 +478,8 @@ y1="132.84332" x2="-58.661255" y2="169.46072" - gradientUnits="userSpaceOnUse" /> + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0045664,0,0,0.98072534,3.8285685,3.8328979)" /> + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0048708,0,0,1.0000284,3.816285,2.2385824)" /> + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0057658,0,0,0.99502095,3.8176724,2.8357789)" /> + y2="412.00528" + gradientTransform="matrix(1,0,0,0.98663274,0,3.8538758)" /> + x2="-136.75557" + y2="74.015358" /> + image/svg+xml - + Edouard Lafargue @@ -779,8 +796,7 @@ inkscape:label="Dark background" id="g2932" inkscape:groupmode="layer" - transform="translate(-357.06525,-236.21351)" - sodipodi:insensitive="true"> + transform="translate(-357.06525,-236.21351)"> @@ -789,39 +805,39 @@ style="fill:url(#linearGradient5344);fill-opacity:1;stroke:none" id="rect2936" width="318.58304" - height="46.756046" + height="46.131046" x="-556.79657" - y="358.44128" - ry="3.4504199" + y="357.50378" + ry="3.4042974" inkscape:export-filename="H:\Documents\Hobbies\W433\g9905.png" inkscape:export-xdpi="88.809998" inkscape:export-ydpi="88.809998" /> - + style="fill:url(#linearGradient3900);fill-opacity:1;stroke:none" /> + + transform="translate(-129.62194,129.52019)"> + style="display:inline" + transform="translate(-129.62194,129.52019)"> + transform="translate(-129.62194,129.52019)"> + width="34.173222" + height="5.9349518" + x="136.20108" + y="-114.68695" + inkscape:label="#rect5246" + ry="2.4981377" /> + transform="translate(-129.62194,129.52019)"> diff --git a/ground/openpilotgcs/share/openpilotgcs/dials/deluxe/lineardial-horizontal.svg b/ground/openpilotgcs/share/openpilotgcs/dials/deluxe/lineardial-horizontal.svg old mode 100644 new mode 100755 index 2f6f71b17..e37172ec0 --- a/ground/openpilotgcs/share/openpilotgcs/dials/deluxe/lineardial-horizontal.svg +++ b/ground/openpilotgcs/share/openpilotgcs/dials/deluxe/lineardial-horizontal.svg @@ -14,8 +14,8 @@ height="70.597504" id="svg10068" version="1.1" - inkscape:version="0.48.1 " - sodipodi:docname="lineardial-horizontal.svg" + inkscape:version="0.48.2 r9819" + sodipodi:docname="lineardial-horizontal-old2.svg" inkscape:export-filename="H:\Documents\Hobbies\W433\My Gauges\vbat-001.png" inkscape:export-xdpi="103.61" inkscape:export-ydpi="103.61" @@ -25,15 +25,19 @@ + offset="0.31684026" + style="stop-color:#a3a3a3;stop-opacity:1;" /> + @@ -57,15 +61,11 @@ + style="stop-color:#8a8a8a;stop-opacity:1;" /> - + id="stop4391" /> @@ -237,15 +237,15 @@ + style="stop-color:#676767;stop-opacity:1;" /> + style="stop-color:#7d7d7d;stop-opacity:1;" /> @@ -425,46 +425,34 @@ - + offset="0" + style="stop-color:#ffc001;stop-opacity:1;" /> - - + offset="0" + style="stop-color:#e60000;stop-opacity:1;" /> @@ -687,7 +675,7 @@ x2="87.074203" y2="168.83261" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0,0.99999995,-0.99999975,0,-11.23354,-270.8763)" /> + gradientTransform="matrix(0,1.0110991,-1.0062411,0,-10.360287,-272.19756)" /> + gradientTransform="matrix(0,1.0224134,-1.0048488,0,-10.554719,-273.54528)" /> + gradientTransform="matrix(0,1,-1.0055415,0,-10.459485,-270.8763)" /> + transform="translate(-368.2988,-507.08981)"> @@ -1225,17 +1212,16 @@ id="layer5" inkscape:label="Green Zone" style="display:inline" - transform="translate(-140.85549,-141.35611)" - sodipodi:insensitive="true"> + transform="translate(-140.85549,-141.35611)"> + transform="translate(-140.85549,-141.35611)"> + transform="translate(-140.85549,-141.35611)"> + transform="translate(-140.85549,-141.35611)"> + transform="matrix(0,1,-1,0,0,0)" + ry="2.5494981" + rx="1.9392394" /> + + + + + style="stop-color:#656565;stop-opacity:1;" /> + style="stop-color:#757575;stop-opacity:1;" /> @@ -83,15 +94,19 @@ + style="stop-color:#9c9c9c;stop-opacity:0;" /> + id="stop3921" + offset="0.359375" + style="stop-color:#6c6c6c;stop-opacity:0.88793105;" /> + + style="stop-color:#9c9c9c;stop-opacity:0;" /> @@ -215,46 +230,34 @@ - + offset="0" + style="stop-color:#ffc001;stop-opacity:1;" /> - - + offset="0" + style="stop-color:#e60000;stop-opacity:1;" /> @@ -475,7 +478,8 @@ y1="132.84332" x2="-58.661255" y2="169.46072" - gradientUnits="userSpaceOnUse" /> + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0045664,0,0,0.98072534,3.8285685,3.8328979)" /> + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0048708,0,0,1.0000284,3.816285,2.2385824)" /> + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0057658,0,0,0.99502095,3.8176724,2.8357789)" /> + y2="412.00528" + gradientTransform="matrix(1,0,0,0.98663274,0,3.8538758)" /> + x2="-136.75557" + y2="74.015358" /> + image/svg+xml - + Edouard Lafargue @@ -779,8 +796,7 @@ inkscape:label="Dark background" id="g2932" inkscape:groupmode="layer" - transform="translate(-357.06525,-236.21351)" - sodipodi:insensitive="true"> + transform="translate(-357.06525,-236.21351)"> @@ -789,39 +805,39 @@ style="fill:url(#linearGradient5344);fill-opacity:1;stroke:none" id="rect2936" width="318.58304" - height="46.756046" + height="46.131046" x="-556.79657" - y="358.44128" - ry="3.4504199" + y="357.50378" + ry="3.4042974" inkscape:export-filename="H:\Documents\Hobbies\W433\g9905.png" inkscape:export-xdpi="88.809998" inkscape:export-ydpi="88.809998" /> - + style="fill:url(#linearGradient3900);fill-opacity:1;stroke:none" /> + + transform="translate(-129.62194,129.52019)"> + style="display:inline" + transform="translate(-129.62194,129.52019)"> + transform="translate(-129.62194,129.52019)"> + width="34.173222" + height="5.9349518" + x="136.20108" + y="-114.68695" + inkscape:label="#rect5246" + ry="2.4981377" /> + transform="translate(-129.62194,129.52019)"> From fdcea011000710fc5ed71c8e43726896f1f9906f Mon Sep 17 00:00:00 2001 From: naiiawah Date: Thu, 5 Jan 2012 02:10:05 -0700 Subject: [PATCH 3/6] numberOfDevices could be left unitialized if sendData or receiveData fail in findDevices or if no one ever calls findDevices. Added init of var. --- ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp b/ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp index 961103d22..f30fca1b5 100644 --- a/ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp @@ -37,6 +37,7 @@ DFUObject::DFUObject(bool _debug,bool _use_serial,QString portname): debug(_debug),use_serial(_use_serial),mready(true) { info = NULL; + numberOfDevices = 0; qRegisterMetaType("Status"); From 3d896ffaf500dffe33e58fea5d09384667f763ae Mon Sep 17 00:00:00 2001 From: zedamota Date: Sat, 28 Jan 2012 21:25:38 +0000 Subject: [PATCH 4/6] Fixes scopegadget loading issues with Qt versions > 4.7.4 --- ground/openpilotgcs/src/libs/qwt/qwtconfig.pri | 8 ++++++++ ground/openpilotgcs/src/libs/qwt/src/qwt_global.h | 7 ++----- ground/openpilotgcs/src/libs/qwt/src/src.pro | 9 +++++++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ground/openpilotgcs/src/libs/qwt/qwtconfig.pri b/ground/openpilotgcs/src/libs/qwt/qwtconfig.pri index 82754c682..bcc921911 100644 --- a/ground/openpilotgcs/src/libs/qwt/qwtconfig.pri +++ b/ground/openpilotgcs/src/libs/qwt/qwtconfig.pri @@ -30,6 +30,14 @@ VVERSION = $$[QT_VERSION] CONFIG += QwtPlot +###################################################################### +# Build the static/shared libraries. +# If QwtDll is enabled, a shared library is built, otherwise +# it will be a static library. +###################################################################### + +QWT_CONFIG += QwtDll + ###################################################################### # QwtWidgets enables all classes, that are needed to use the all other # widgets (sliders, dials, ...), beside QwtPlot. diff --git a/ground/openpilotgcs/src/libs/qwt/src/qwt_global.h b/ground/openpilotgcs/src/libs/qwt/src/qwt_global.h index baf371f49..5fba57e27 100644 --- a/ground/openpilotgcs/src/libs/qwt/src/qwt_global.h +++ b/ground/openpilotgcs/src/libs/qwt/src/qwt_global.h @@ -29,17 +29,14 @@ #pragma warning(disable: 4660) #endif // _MSC_VER -#ifdef QWT_DLL #if defined(QWT_MAKEDLL) // create a Qwt DLL library -#define QWT_EXPORT __declspec(dllexport) +#define QWT_EXPORT Q_DECL_EXPORT #define QWT_TEMPLATEDLL #else // use a Qwt DLL library -#define QWT_EXPORT __declspec(dllimport) +#define QWT_EXPORT Q_DECL_IMPORT #endif -#endif // QWT_DLL - #endif // Q_WS_WIN #ifndef QWT_EXPORT diff --git a/ground/openpilotgcs/src/libs/qwt/src/src.pro b/ground/openpilotgcs/src/libs/qwt/src/src.pro index 133f92b0f..15c1d04e5 100644 --- a/ground/openpilotgcs/src/libs/qwt/src/src.pro +++ b/ground/openpilotgcs/src/libs/qwt/src/src.pro @@ -4,9 +4,14 @@ DEFINES += QWT_LIBRARY include(../../../openpilotgcslibrary.pri) include( ../qwtconfig.pri ) -#VVERSION = $$[QT_VERSION] - +contains(QWT_CONFIG, QwtDll) { + CONFIG += dll + win32|symbian: DEFINES += QT_DLL QWT_DLL QWT_MAKEDLL +} +else { + CONFIG += staticlib +} HEADERS += \ qwt.h \ qwt_abstract_scale_draw.h \ From c5a2afcc2c91657b79c0815381a955cd05845f38 Mon Sep 17 00:00:00 2001 From: zedamota Date: Fri, 27 Jan 2012 17:54:14 +0000 Subject: [PATCH 5/6] made the input wizard background transparent --- .../openpilotgcs/src/plugins/config/configinputwidget.cpp | 1 - ground/openpilotgcs/src/plugins/config/input.ui | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 2f3b83754..3e8cf0c87 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -107,7 +107,6 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) m_config->graphicsView->setViewportUpdateMode(QGraphicsView::FullViewportUpdate); m_renderer = new QSvgRenderer(); QGraphicsScene *l_scene = m_config->graphicsView->scene(); - m_config->graphicsView->setBackgroundBrush(QBrush(Utils::StyleHelper::baseColor())); if (QFile::exists(":/configgadget/images/TX2.svg") && m_renderer->load(QString(":/configgadget/images/TX2.svg")) && m_renderer->isValid()) { l_scene->clear(); // Deletes all items contained in the scene as well. diff --git a/ground/openpilotgcs/src/plugins/config/input.ui b/ground/openpilotgcs/src/plugins/config/input.ui index 2fac45ec9..30c0cd80d 100644 --- a/ground/openpilotgcs/src/plugins/config/input.ui +++ b/ground/openpilotgcs/src/plugins/config/input.ui @@ -90,7 +90,11 @@ - + + + background:transparent + + From 369629ad342550c89747d4a133b612c267f6117b Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Mon, 2 Jan 2012 14:21:01 +0200 Subject: [PATCH 6/6] Add "Reset To Defaults" button to Stabilization configuration tab Also add tootips to Reset/Apply/Save buttons. --- .../config/configstabilizationwidget.cpp | 50 +- .../config/configstabilizationwidget.h | 4 +- .../src/plugins/config/stabilization.ui | 1601 +++++++++-------- 3 files changed, 863 insertions(+), 792 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp index cbe554f4e..69b0427e3 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp @@ -42,8 +42,7 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa m_stabilization = new Ui_StabilizationWidget(); m_stabilization->setupUi(this); - - setupButtons(m_stabilization->saveStabilizationToRAM,m_stabilization->saveStabilizationToSD); + setupButtons(m_stabilization->saveStabilizationToRAM, m_stabilization->saveStabilizationToSD); addUAVObject("StabilizationSettings"); @@ -71,8 +70,6 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa connect(m_stabilization->pitchKi, SIGNAL(valueChanged(double)), this, SLOT(updatePitchKI(double))); connect(m_stabilization->pitchILimit, SIGNAL(valueChanged(double)), this, SLOT(updatePitchILimit(double))); - // Connect the help button - connect(m_stabilization->stabilizationHelp, SIGNAL(clicked()), this, SLOT(openHelp())); addWidget(m_stabilization->rateRollKp); addWidget(m_stabilization->rateRollKi); addWidget(m_stabilization->rateRollILimit); @@ -102,6 +99,9 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa addWidget(m_stabilization->maximumYaw); addWidget(m_stabilization->lowThrottleZeroIntegral); + // Connect buttons + connect(m_stabilization->stabilizationResetToDefaults, SIGNAL(clicked()), this, SLOT(resetToDefaults())); + connect(m_stabilization->stabilizationHelp, SIGNAL(clicked()), this, SLOT(openHelp())); } ConfigStabilizationWidget::~ConfigStabilizationWidget() @@ -195,21 +195,17 @@ void ConfigStabilizationWidget::updatePitchILimit(double val) } } - /******************************* * Stabilization Settings *****************************/ /** - Request stabilization settings from the board + * Refresh UI with new settings of StabilizationSettings object + * (either from active configuration or just loaded defaults + * to be applied or saved) */ -void ConfigStabilizationWidget::refreshWidgetsValues() +void ConfigStabilizationWidget::refreshUIValues(StabilizationSettings::DataFields &stabData) { - bool dirty=isDirty(); - // Not needed anymore as this slot is only called whenever we get - // a signal that the object was just updated - // stabSettings->requestUpdate(); - StabilizationSettings::DataFields stabData = stabSettings->getData(); // Now fill in all the fields, this is fairly tedious: m_stabilization->rateRollKp->setValue(stabData.RollRatePID[StabilizationSettings::ROLLRATEPID_KP]); m_stabilization->rateRollKi->setValue(stabData.RollRatePID[StabilizationSettings::ROLLRATEPID_KI]); @@ -247,15 +243,25 @@ void ConfigStabilizationWidget::refreshWidgetsValues() m_stabilization->maximumPitch->setValue(stabData.MaximumRate[StabilizationSettings::MAXIMUMRATE_PITCH]); m_stabilization->maximumYaw->setValue(stabData.MaximumRate[StabilizationSettings::MAXIMUMRATE_YAW]); m_stabilization->lowThrottleZeroIntegral->setChecked(stabData.LowThrottleZeroIntegral==StabilizationSettings::LOWTHROTTLEZEROINTEGRAL_TRUE ? true : false); - - setDirty(dirty); } +/** + Request stabilization settings from the board + */ +void ConfigStabilizationWidget::refreshWidgetsValues() +{ + bool dirty=isDirty(); + // Not needed anymore as this slot is only called whenever we get + // a signal that the object was just updated + // stabSettings->requestUpdate(); + StabilizationSettings::DataFields stabData = stabSettings->getData(); + refreshUIValues(stabData); + setDirty(dirty); +} /** Send telemetry settings to the board */ - void ConfigStabilizationWidget::updateObjectsFromWidgets() { StabilizationSettings::DataFields stabData = stabSettings->getData(); @@ -298,7 +304,6 @@ void ConfigStabilizationWidget::updateObjectsFromWidgets() stabData.LowThrottleZeroIntegral = (m_stabilization->lowThrottleZeroIntegral->isChecked() ? StabilizationSettings::LOWTHROTTLEZEROINTEGRAL_TRUE :StabilizationSettings::LOWTHROTTLEZEROINTEGRAL_FALSE); - stabSettings->setData(stabData); // this is atomic } @@ -311,9 +316,16 @@ void ConfigStabilizationWidget::realtimeUpdateToggle(bool state) } } -void ConfigStabilizationWidget::openHelp() +void ConfigStabilizationWidget::resetToDefaults() { - - QDesktopServices::openUrl( QUrl("http://wiki.openpilot.org/display/Doc/Stabilization+panel", QUrl::StrictMode) ); + StabilizationSettings stabDefaults; + StabilizationSettings::DataFields defaults = stabDefaults.getData(); + bool dirty=isDirty(); + refreshUIValues(defaults); + setDirty(dirty); } +void ConfigStabilizationWidget::openHelp() +{ + QDesktopServices::openUrl( QUrl("http://wiki.openpilot.org/display/Doc/Stabilization+panel", QUrl::StrictMode) ); +} diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h index e512c5097..b502dd25e 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h @@ -49,11 +49,13 @@ private: Ui_StabilizationWidget *m_stabilization; StabilizationSettings* stabSettings; QTimer updateTimer; + void refreshUIValues(StabilizationSettings::DataFields &stabData); private slots: virtual void refreshWidgetsValues(); void updateObjectsFromWidgets(); void realtimeUpdateToggle(bool); + void resetToDefaults(); void openHelp(); void updateRateRollKP(double); @@ -73,4 +75,4 @@ private slots: void updatePitchILimit(double); }; -#endif // ConfigStabilizationWidget_H +#endif // CONFIGSTABILIZATIONWIDGET_H diff --git a/ground/openpilotgcs/src/plugins/config/stabilization.ui b/ground/openpilotgcs/src/plugins/config/stabilization.ui index 5c2de727e..f99b35b94 100644 --- a/ground/openpilotgcs/src/plugins/config/stabilization.ui +++ b/ground/openpilotgcs/src/plugins/config/stabilization.ui @@ -1,772 +1,829 @@ - - - StabilizationWidget - - - - 0 - 0 - 683 - 685 - - - - Form - - - - - - - 0 - 1 - - - - QFrame::NoFrame - - - true - - - - - 0 - 0 - 665 - 627 - - - - - 0 - 0 - - - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 0 - 150 - - - - Rate Stabilization Coefficients (Inner Loop) - - - - - - Kp - - - Qt::AlignCenter - - - - - - - Ki - - - Qt::AlignCenter - - - - - - - ILimit - - - Qt::AlignCenter - - - - - - - Roll - - - - - - - Slowly raise Kp until you start seeing clear oscillations when you fly. -Then lower the value by 20% or so. - - - 6 - - - 0.000100000000000 - - - - - - - I factor for rate stabilization is usually very low or even zero. - - - 6 - - - 0.000100000000000 - - - - - - - 6 - - - 0.000100000000000 - - - - - - - If checked, the Roll and Pitch factors will be identical. -When you change one, the other is updated. - - - Link - - - - - - - Pitch - - - - - - - Slowly raise Kp until you start seeing clear oscillations when you fly. -Then lower the value by 20% or so. - - - 6 - - - 0.000100000000000 - - - - - - - I factor for rate stabilization is usually very low or even zero. - - - 6 - - - 0.000100000000000 - - - - - - - 6 - - - 0.000100000000000 - - - - - - - Yaw - - - - - - - Slowly raise Kp until you start seeing clear oscillations when you fly. -Then lower the value by 20% or so. - -You can usually go for higher values for Yaw factors. - - - 6 - - - 0.000100000000000 - - - - - - - As a rule of thumb, you can set YawRate Ki at roughly the same -value as YawRate Kp. - - - 6 - - - 0.000100000000000 - - - - - - - 6 - - - 0.000100000000000 - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 13 - - - - - - - - - 0 - 0 - - - - - 0 - 150 - - - - Attitude Stabization Coefficients (Outer Loop) - - - - - - Once Rate stabilization is done, you should increase the Kp factor until the airframe oscillates again, and go back down 20% or so. - - - - 6 - - - 0.100000000000000 - - - - - - - Ki can usually be almost identical to Kp. - - - 6 - - - 0.100000000000000 - - - - - - - ILimit can be equal to three to four times Ki, but you can adjust -depending on whether your airframe is well balanced, and your -flying style. - - - 6 - - - 0.100000000000000 - - - - - - - Kp - - - Qt::AlignCenter - - - - - - - Ki - - - Qt::AlignCenter - - - - - - - ILimit - - - Qt::AlignCenter - - - - - - - ILimit can be equal to three to four times Ki, but you can adjust -depending on whether your airframe is well balanced, and your -flying style. - - - 6 - - - 0.100000000000000 - - - - - - - Ki can usually be almost identical to Kp. - - - 6 - - - 0.100000000000000 - - - - - - - Once Rate stabilization is done, you should increase the Kp factor until the airframe oscillates again, and go back down 20% or so. - - - - 6 - - - 0.100000000000000 - - - - - - - Once Rate stabilization is done, you should increase the Kp factor until the airframe oscillates again, and go back down 20% or so. - - - - 6 - - - 0.100000000000000 - - - - - - - Yaw - - - - - - - Pitch - - - - - - - Roll - - - - - - - Ki can usually be almost identical to Kp. - - - 6 - - - 0.100000000000000 - - - - - - - ILimit can be equal to three to four times Ki, but you can adjust -depending on whether your airframe is well balanced, and your -flying style. - - - 6 - - - 0.100000000000000 - - - - - - - If checked, the Roll and Pitch factors will be identical. -When you change one, the other is updated. - - - Link - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 13 - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Stick range and limits - - - - QLayout::SetMinAndMaxSize - - - - - Roll - - - Qt::AlignCenter - - - - - - - Pitch - - - Qt::AlignCenter - - - - - - - Yaw - - - Qt::AlignCenter - - - - - - - 180 - - - - - - - 180 - - - - - - - 180 - - - - - - - - 150 - 0 - - - - - 50 - false - - - - Full stick angle (deg) - - - - - - - - 150 - 0 - - - - - 50 - false - - - - Full stick rate (deg/s) - - - - - - - 500 - - - - - - - 500 - - - - - - - 500 - - - - - - - - 150 - 0 - - - - - 50 - false - - - - - - - Maximum rate in attitude mode (deg/s) - - - - - - - 500 - - - - - - - 500 - - - - - - - 500 - - - - - - - - - - Zero the integral when throttle is low - - - - - - - Qt::Vertical - - - - 20 - 0 - - - - - - - - - - - - - - If you check this, the GCS will udpate the stabilization factors -automatically every 300ms, which will help for fast tuning. - - - Update in real time - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 32 - 32 - - - - - - - - :/core/images/helpicon.svg:/core/images/helpicon.svg - - - - 32 - 32 - - - - true - - - - - - - Apply - - - - - - - Save - - - - - - - - - - - - + + + StabilizationWidget + + + + 0 + 0 + 683 + 685 + + + + Form + + + + + + + 0 + 1 + + + + QFrame::NoFrame + + + true + + + + + 0 + 0 + 665 + 627 + + + + + 0 + 0 + + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 150 + + + + Rate Stabilization Coefficients (Inner Loop) + + + + + + Kp + + + Qt::AlignCenter + + + + + + + Ki + + + Qt::AlignCenter + + + + + + + ILimit + + + Qt::AlignCenter + + + + + + + Roll + + + + + + + Slowly raise Kp until you start seeing clear oscillations when you fly. +Then lower the value by 20% or so. + + + 6 + + + 0.000100000000000 + + + + + + + I factor for rate stabilization is usually very low or even zero. + + + 6 + + + 0.000100000000000 + + + + + + + 6 + + + 0.000100000000000 + + + + + + + If checked, the Roll and Pitch factors will be identical. +When you change one, the other is updated. + + + Link + + + + + + + Pitch + + + + + + + Slowly raise Kp until you start seeing clear oscillations when you fly. +Then lower the value by 20% or so. + + + 6 + + + 0.000100000000000 + + + + + + + I factor for rate stabilization is usually very low or even zero. + + + 6 + + + 0.000100000000000 + + + + + + + 6 + + + 0.000100000000000 + + + + + + + Yaw + + + + + + + Slowly raise Kp until you start seeing clear oscillations when you fly. +Then lower the value by 20% or so. + +You can usually go for higher values for Yaw factors. + + + 6 + + + 0.000100000000000 + + + + + + + As a rule of thumb, you can set YawRate Ki at roughly the same +value as YawRate Kp. + + + 6 + + + 0.000100000000000 + + + + + + + 6 + + + 0.000100000000000 + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 13 + + + + + + + + + 0 + 0 + + + + + 0 + 150 + + + + Attitude Stabization Coefficients (Outer Loop) + + + + + + Once Rate stabilization is done, you should increase the Kp factor until the airframe oscillates again, and go back down 20% or so. + + + + 6 + + + 0.100000000000000 + + + + + + + Ki can usually be almost identical to Kp. + + + 6 + + + 0.100000000000000 + + + + + + + ILimit can be equal to three to four times Ki, but you can adjust +depending on whether your airframe is well balanced, and your +flying style. + + + 6 + + + 0.100000000000000 + + + + + + + Kp + + + Qt::AlignCenter + + + + + + + Ki + + + Qt::AlignCenter + + + + + + + ILimit + + + Qt::AlignCenter + + + + + + + ILimit can be equal to three to four times Ki, but you can adjust +depending on whether your airframe is well balanced, and your +flying style. + + + 6 + + + 0.100000000000000 + + + + + + + Ki can usually be almost identical to Kp. + + + 6 + + + 0.100000000000000 + + + + + + + Once Rate stabilization is done, you should increase the Kp factor until the airframe oscillates again, and go back down 20% or so. + + + + 6 + + + 0.100000000000000 + + + + + + + Once Rate stabilization is done, you should increase the Kp factor until the airframe oscillates again, and go back down 20% or so. + + + + 6 + + + 0.100000000000000 + + + + + + + Yaw + + + + + + + Pitch + + + + + + + Roll + + + + + + + Ki can usually be almost identical to Kp. + + + 6 + + + 0.100000000000000 + + + + + + + ILimit can be equal to three to four times Ki, but you can adjust +depending on whether your airframe is well balanced, and your +flying style. + + + 6 + + + 0.100000000000000 + + + + + + + If checked, the Roll and Pitch factors will be identical. +When you change one, the other is updated. + + + Link + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 13 + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Stick range and limits + + + + QLayout::SetMinAndMaxSize + + + + + Roll + + + Qt::AlignCenter + + + + + + + Pitch + + + Qt::AlignCenter + + + + + + + Yaw + + + Qt::AlignCenter + + + + + + + 180 + + + + + + + 180 + + + + + + + 180 + + + + + + + + 150 + 0 + + + + + 50 + false + + + + Full stick angle (deg) + + + + + + + + 150 + 0 + + + + + 50 + false + + + + Full stick rate (deg/s) + + + + + + + 500 + + + + + + + 500 + + + + + + + 500 + + + + + + + + 150 + 0 + + + + + 50 + false + + + + + + + Maximum rate in attitude mode (deg/s) + + + + + + + 500 + + + + + + + 500 + + + + + + + 500 + + + + + + + + + + Zero the integral when throttle is low + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + + + + + + + If you check this, the GCS will udpate the stabilization factors +automatically every 300ms, which will help for fast tuning. + + + Update in real time + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 32 + 32 + + + + + + + + :/core/images/helpicon.svg:/core/images/helpicon.svg + + + + 32 + 32 + + + + true + + + + + + + Load default Stabilization settings + +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 + + + + + + + + + scrollArea + rateRollKp + rateRollKi + rateRollILimit + linkRateRP + ratePitchKp + ratePitchKi + ratePitchILimit + rateYawKp + rateYawKi + rateYawILimit + rollKp + rollKi + rollILimit + linkAttitudeRP + pitchKp + pitchKi + pitchILimit + yawKp + yawKi + yawILimit + rollMax + pitchMax + yawMax + manualRoll + manualPitch + manualYaw + maximumRoll + maximumPitch + maximumYaw + lowThrottleZeroIntegral + realTimeUpdates + stabilizationHelp + stabilizationResetToDefaults + saveStabilizationToRAM + saveStabilizationToSD + + + + + +