From 7d15cbd7200ccf33dc3a769f75c1ef04aa3c44e8 Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Sat, 21 Jan 2012 00:55:08 +0200 Subject: [PATCH 01/15] gcscontrol: new joystick image with active stick area --- .../plugins/gcscontrol/images/joystick.svg | 2764 ++++++----------- .../plugins/gcscontrol/joystickcontrol.cpp | 32 +- .../src/plugins/gcscontrol/joystickcontrol.h | 1 + 3 files changed, 904 insertions(+), 1893 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/gcscontrol/images/joystick.svg b/ground/openpilotgcs/src/plugins/gcscontrol/images/joystick.svg index 386881587..29d5c8762 100644 --- a/ground/openpilotgcs/src/plugins/gcscontrol/images/joystick.svg +++ b/ground/openpilotgcs/src/plugins/gcscontrol/images/joystick.svg @@ -1,5 +1,5 @@ - + image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 50 % - - 75 % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 75 % - - 50 % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + inkscape:version="0.48.1 " + sodipodi:docname="joystick.svg"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.cpp b/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.cpp index d738da556..3e8e111df 100644 --- a/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.cpp +++ b/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.cpp @@ -60,13 +60,24 @@ JoystickControl::JoystickControl(QWidget *parent) : m_joystickEnd = new QGraphicsSvgItem(); m_joystickEnd->setSharedRenderer(m_renderer); m_joystickEnd->setElementId(QString("joystickEnd")); - m_joystickEnd->setPos(0,0); + + m_joystickArea = new QGraphicsSvgItem(); + m_joystickArea->setSharedRenderer(m_renderer); + m_joystickArea->setElementId(QString("joystickArea")); + m_joystickArea->setPos( + (m_background->boundingRect().width() - m_joystickArea->boundingRect().width()) * 0.5, + (m_background->boundingRect().height() - m_joystickArea->boundingRect().height()) * 0.5 + ); + m_joystickArea->setVisible(false); QGraphicsScene *l_scene = scene(); l_scene->clear(); // This also deletes all items contained in the scene. l_scene->addItem(m_background); + l_scene->addItem(m_joystickArea); l_scene->addItem(m_joystickEnd); l_scene->setSceneRect(m_background->boundingRect()); + + changePosition(0.0, 0.0); } JoystickControl::~JoystickControl() @@ -90,11 +101,12 @@ void JoystickControl::enableOpenGL(bool flag) */ void JoystickControl::changePosition(double x, double y) { - QRectF sceneSize = scene()->sceneRect(); - - m_joystickEnd->setPos( - (x+1) / 2*sceneSize.width() - m_joystickEnd->boundingRect().width() / 2, - (-y+1) / 2*sceneSize.height() - m_joystickEnd->boundingRect().height() / 2); + QRectF areaSize = m_joystickArea->boundingRect(); + QPointF point( + ((1 + x) * areaSize.width() - m_joystickEnd->boundingRect().width()) * 0.5, + ((1 - y) * areaSize.height() - m_joystickEnd->boundingRect().height()) * 0.5 + ); + m_joystickEnd->setPos(m_joystickArea->mapToScene(point)); } /** @@ -102,11 +114,11 @@ void JoystickControl::changePosition(double x, double y) */ void JoystickControl::mouseMoveEvent(QMouseEvent *event) { - QPointF point = mapToScene(event->pos()); - QRectF sceneSize = scene()->sceneRect(); + QPointF point = m_joystickArea->mapFromScene(mapToScene(event->pos())); + QSizeF areaSize = m_joystickArea->boundingRect().size(); - double Y = - (point.y() / sceneSize.height() - .5) * 2; - double X = (point.x() / sceneSize.width() - .5) * 2; + double Y = - (point.y() / areaSize.height() - .5) * 2; + double X = (point.x() / areaSize.width() - .5) * 2; if (Y<-1) Y = -1; if (Y> 1) Y = 1; if (X<-1) X = -1; diff --git a/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.h b/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.h index 8492474e6..bd0871761 100644 --- a/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.h +++ b/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.h @@ -64,6 +64,7 @@ signals: private: QSvgRenderer *m_renderer; QGraphicsSvgItem *m_background; + QGraphicsSvgItem *m_joystickArea; QGraphicsSvgItem *m_joystickEnd; }; From 9006dd558f97dce5da4677be57f3cded0fb3cb4d Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Sat, 21 Jan 2012 00:52:35 +0200 Subject: [PATCH 02/15] gcscontrol: code style formatting and cleanup --- .../plugins/gcscontrol/joystickcontrol.cpp | 60 ++++++++----------- .../src/plugins/gcscontrol/joystickcontrol.h | 21 ++++--- 2 files changed, 36 insertions(+), 45 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.cpp b/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.cpp index 3e8e111df..0596b22c1 100644 --- a/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.cpp +++ b/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.cpp @@ -7,7 +7,7 @@ * @{ * @addtogroup GCSControlGadgetPlugin GCSControl Gadget Plugin * @{ - * @brief A that mimics a transmitter joystick and updates the MCC + * @brief The plugin that mimics a transmitter joystick and updates the MCC *****************************************************************************/ /* * This program is free software; you can redistribute it and/or modify @@ -28,30 +28,24 @@ #include "joystickcontrol.h" #include "extensionsystem/pluginmanager.h" #include -#include #include -#include -#include -#include -#include -#include #include -#include +#include /** * @brief Constructor for JoystickControl widget. Sets up the image of a joystick */ -JoystickControl::JoystickControl(QWidget *parent) : - QGraphicsView(parent) +JoystickControl::JoystickControl(QWidget *parent) : QGraphicsView(parent) { - setMinimumSize(64,64); + setMinimumSize(64, 64); setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); setScene(new QGraphicsScene(this)); setRenderHints(QPainter::Antialiasing); m_renderer = new QSvgRenderer(); bool test = m_renderer->load(QString(":/gcscontrol/images/joystick.svg")); - Q_ASSERT( test ); + Q_UNUSED(test); + Q_ASSERT(test); m_background = new QGraphicsSvgItem(); m_background->setSharedRenderer(m_renderer); @@ -82,18 +76,18 @@ JoystickControl::JoystickControl(QWidget *parent) : JoystickControl::~JoystickControl() { - + // Do nothing } -/*! - \brief Enables/Disables OpenGL +/** + * @brief Enables/Disables OpenGL */ void JoystickControl::enableOpenGL(bool flag) { - if (flag) - setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers))); - else - setViewport(new QWidget); + if (flag) + setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers))); + else + setViewport(new QWidget); } /** @@ -103,8 +97,8 @@ void JoystickControl::changePosition(double x, double y) { QRectF areaSize = m_joystickArea->boundingRect(); QPointF point( - ((1 + x) * areaSize.width() - m_joystickEnd->boundingRect().width()) * 0.5, - ((1 - y) * areaSize.height() - m_joystickEnd->boundingRect().height()) * 0.5 + ((1.0 + x) * areaSize.width() - m_joystickEnd->boundingRect().width()) * 0.5, + ((1.0 - y) * areaSize.height() - m_joystickEnd->boundingRect().height()) * 0.5 ); m_joystickEnd->setPos(m_joystickArea->mapToScene(point)); } @@ -117,14 +111,14 @@ void JoystickControl::mouseMoveEvent(QMouseEvent *event) QPointF point = m_joystickArea->mapFromScene(mapToScene(event->pos())); QSizeF areaSize = m_joystickArea->boundingRect().size(); - double Y = - (point.y() / areaSize.height() - .5) * 2; - double X = (point.x() / areaSize.width() - .5) * 2; - if (Y<-1) Y = -1; - if (Y> 1) Y = 1; - if (X<-1) X = -1; - if (X> 1) X = 1; + double y = - (point.y() / areaSize.height() - 0.5) * 2.0; + double x = (point.x() / areaSize.width() - 0.5) * 2.0; + if (y < -1.0) y = -1.0; + if (y > 1.0) y = 1.0; + if (x < -1.0) x = -1.0; + if (x > 1.0) x = 1.0; - emit positionClicked(X, Y); + emit positionClicked(x, y); } /** @@ -132,12 +126,11 @@ void JoystickControl::mouseMoveEvent(QMouseEvent *event) */ void JoystickControl::mousePressEvent(QMouseEvent *event) { - if( event->button() == Qt::LeftButton ) { + if (event->button() == Qt::LeftButton) { mouseMoveEvent(event); } } - void JoystickControl::paint() { update(); @@ -145,9 +138,9 @@ void JoystickControl::paint() void JoystickControl::paintEvent(QPaintEvent *event) { - // Skip painting until the dial file is loaded - if (! m_renderer->isValid()) { - qDebug()<<"Image file not loaded, not rendering"; + // Skip painting until the image file is loaded + if (!m_renderer->isValid()) { + qDebug() << "Image file not loaded, not rendering"; } QGraphicsView::paintEvent(event); @@ -159,7 +152,6 @@ void JoystickControl::resizeEvent(QResizeEvent *event) fitInView(m_background, Qt::IgnoreAspectRatio ); } - /** * @} * @} diff --git a/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.h b/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.h index bd0871761..9c6ac59d0 100644 --- a/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.h +++ b/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.h @@ -7,7 +7,7 @@ * @{ * @addtogroup GCSControlGadgetPlugin GCSControl Gadget Plugin * @{ - * @brief A that mimics a transmitter joystick and updates the MCC + * @brief The plugin that mimics a transmitter joystick and updates the MCC *****************************************************************************/ /* * This program is free software; you can redistribute it and/or modify @@ -25,7 +25,6 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - #ifndef JOYSTICKCONTROL_H #define JOYSTICKCONTROL_H @@ -46,27 +45,27 @@ class JoystickControl : public QGraphicsView public: explicit JoystickControl(QWidget *parent = 0); ~JoystickControl(); - void enableOpenGL(bool flag); - void paint(); + void enableOpenGL(bool flag); + void paint(); protected: - void mouseMoveEvent(QMouseEvent *event); - void mousePressEvent(QMouseEvent *event); - void paintEvent(QPaintEvent *event); - void resizeEvent(QResizeEvent *event); + void mouseMoveEvent(QMouseEvent *event); + void mousePressEvent(QMouseEvent *event); + void paintEvent(QPaintEvent *event); + void resizeEvent(QResizeEvent *event); public slots: - void changePosition (double X, double Y); + void changePosition(double x, double y); signals: - void positionClicked(double X, double Y); + void positionClicked(double x, double y); private: QSvgRenderer *m_renderer; QGraphicsSvgItem *m_background; QGraphicsSvgItem *m_joystickArea; QGraphicsSvgItem *m_joystickEnd; - }; +}; #endif // JOYSTICKCONTROL_H From da650cee607b194b6057d9f42498f82ba4813ca6 Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Tue, 24 Jan 2012 11:31:00 +0200 Subject: [PATCH 03/15] gcscontrol: keep joystick image aspect ratio OP-619 --- ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.cpp b/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.cpp index 0596b22c1..571b07068 100644 --- a/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.cpp +++ b/ground/openpilotgcs/src/plugins/gcscontrol/joystickcontrol.cpp @@ -149,7 +149,7 @@ void JoystickControl::paintEvent(QPaintEvent *event) void JoystickControl::resizeEvent(QResizeEvent *event) { Q_UNUSED(event); - fitInView(m_background, Qt::IgnoreAspectRatio ); + fitInView(m_background, Qt::KeepAspectRatio); } /** From 242bfe6c69413996089cb6721f1fdd5c3f12848d Mon Sep 17 00:00:00 2001 From: zedamota Date: Tue, 24 Jan 2012 22:29:08 +0000 Subject: [PATCH 04/15] 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 05/15] 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 06/15] 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 07/15] 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 08/15] 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 09/15] 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 + + + + + + From 3a66f70eaecf0ddf77f299945e14af71be139f43 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 31 Jan 2012 11:24:19 -0600 Subject: [PATCH 10/15] Input config: Increase the delay after detecting a channel to ask for next one --- ground/openpilotgcs/src/plugins/config/configinputwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 3e8cf0c87..cc79bc706 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -717,7 +717,7 @@ void ConfigInputWidget::identifyControls() m_config->wzText->clear(); setTxMovement(nothing); - QTimer::singleShot(500, this, SLOT(wzNext())); + QTimer::singleShot(2500, this, SLOT(wzNext())); } void ConfigInputWidget::identifyLimits() From d07b386beb09ecb263fe71b77e4351a358b57973 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 31 Jan 2012 13:09:01 -0600 Subject: [PATCH 11/15] Revert "made the input wizard background transparent" This reverts commit c5a2afcc2c91657b79c0815381a955cd05845f38. --- .../openpilotgcs/src/plugins/config/configinputwidget.cpp | 1 + ground/openpilotgcs/src/plugins/config/input.ui | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index cc79bc706..3b48e4652 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -107,6 +107,7 @@ 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 30c0cd80d..2fac45ec9 100644 --- a/ground/openpilotgcs/src/plugins/config/input.ui +++ b/ground/openpilotgcs/src/plugins/config/input.ui @@ -90,11 +90,7 @@ - - - background:transparent - - + From 318354a1151f614d4a3e1a2b9eb79524ca7a84c9 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 31 Jan 2012 13:31:14 -0600 Subject: [PATCH 12/15] Fix resizing issue with input wizard --- ground/openpilotgcs/src/plugins/config/configinputwidget.cpp | 1 + ground/openpilotgcs/src/plugins/config/input.ui | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 3b48e4652..4387d10f4 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -401,6 +401,7 @@ void ConfigInputWidget::wizardSetUpStep(enum wizardSteps step) case wizardChooseMode: { m_config->graphicsView->setVisible(true); + m_config->graphicsView->fitInView(m_txBackground, Qt::KeepAspectRatio ); setTxMovement(nothing); m_config->wzText->setText(tr("Please choose your transmiter type.\n" "Mode 1 means your throttle stick is on the right\n" diff --git a/ground/openpilotgcs/src/plugins/config/input.ui b/ground/openpilotgcs/src/plugins/config/input.ui index 2fac45ec9..5b591089f 100644 --- a/ground/openpilotgcs/src/plugins/config/input.ui +++ b/ground/openpilotgcs/src/plugins/config/input.ui @@ -76,7 +76,7 @@ 0 - 70 + 90 From a2979125b7bd40bedd87e7497bc1aeb83734db86 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 31 Jan 2012 14:11:04 -0600 Subject: [PATCH 13/15] Remove the hardcoded .svg from the QLabel and load it dynamically. This will be useful for CC3D. --- .../src/plugins/config/cc_hw_settings.ui | 610 +++++++++--------- .../plugins/config/config_cc_hw_widget.cpp | 3 + 2 files changed, 306 insertions(+), 307 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/cc_hw_settings.ui b/ground/openpilotgcs/src/plugins/config/cc_hw_settings.ui index 929c9053d..6da1e703a 100644 --- a/ground/openpilotgcs/src/plugins/config/cc_hw_settings.ui +++ b/ground/openpilotgcs/src/plugins/config/cc_hw_settings.ui @@ -1,307 +1,303 @@ - - - CC_HW_Widget - - - - 0 - 0 - 517 - 487 - - - - Form - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - - - :/configgadget/images/coptercontrol.svg - - - true - - - - - - - - - - - - - MainPort - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - - - - - - - - - - FlexiPort - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - RcvrPort - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - - - Telemetry speed: - - - - - - - - 55 - 0 - - - - GPS speed: - - - - - - - Select the speed here. - - - - - - - Select the speed here. - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 75 - true - - - - - - - Qt::AutoText - - - true - - - - - - - - 75 - true - - - - Changes on this page only take effect after board reset or power cycle - - - true - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 32 - 32 - - - - - 32 - 32 - - - - - - - - :/core/images/helpicon.svg:/core/images/helpicon.svg - - - - 32 - 32 - - - - true - - - - - - - Send to OpenPilot but don't write in SD. -Beware of not locking yourself out! - - - true - - - - - - Apply - - - false - - - - - - - Applies and Saves all settings to SD. -Beware of not locking yourself out! - - - false - - - - - - Save - - - - - - - - - - - - - - - - + + + CC_HW_Widget + + + + 0 + 0 + 517 + 487 + + + + Form + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + + + true + + + + + + + + + + + + + MainPort + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + + + + + + + + FlexiPort + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + RcvrPort + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + + + + Telemetry speed: + + + + + + + + 55 + 0 + + + + GPS speed: + + + + + + + Select the speed here. + + + + + + + Select the speed here. + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 75 + true + + + + + + + Qt::AutoText + + + true + + + + + + + + 75 + true + + + + Changes on this page only take effect after board reset or power cycle + + + true + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 32 + 32 + + + + + 32 + 32 + + + + + + + + :/core/images/helpicon.svg:/core/images/helpicon.svg + + + + 32 + 32 + + + + true + + + + + + + Send to OpenPilot but don't write in SD. +Beware of not locking yourself out! + + + true + + + + + + Apply + + + false + + + + + + + Applies and Saves all settings to SD. +Beware of not locking yourself out! + + + false + + + + + + Save + + + + + + + + + + + + + + + diff --git a/ground/openpilotgcs/src/plugins/config/config_cc_hw_widget.cpp b/ground/openpilotgcs/src/plugins/config/config_cc_hw_widget.cpp index 1d0f723d0..1b8a7eb70 100644 --- a/ground/openpilotgcs/src/plugins/config/config_cc_hw_widget.cpp +++ b/ground/openpilotgcs/src/plugins/config/config_cc_hw_widget.cpp @@ -40,6 +40,9 @@ ConfigCCHWWidget::ConfigCCHWWidget(QWidget *parent) : ConfigTaskWidget(parent) { m_telemetry = new Ui_CC_HW_Widget(); m_telemetry->setupUi(this); + + m_telemetry->label_2->setPixmap(QPixmap(":/configgadget/images/coptercontrol.svg")); + setupButtons(m_telemetry->saveTelemetryToRAM,m_telemetry->saveTelemetryToSD); addUAVObjectToWidgetRelation("HwSettings","CC_FlexiPort",m_telemetry->cbFlexi); addUAVObjectToWidgetRelation("HwSettings","CC_MainPort",m_telemetry->cbTele); From 7990d209a8e13559964e0435d772e3de33ee6166 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 31 Jan 2012 14:46:58 -0600 Subject: [PATCH 14/15] Fix package deployment script for OSX to make sure the SVG pixmap shows up --- .../src/plugins/config/config_cc_hw_widget.h | 1 + package/osx/libraries | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/config/config_cc_hw_widget.h b/ground/openpilotgcs/src/plugins/config/config_cc_hw_widget.h index f815786fb..7c74043b3 100644 --- a/ground/openpilotgcs/src/plugins/config/config_cc_hw_widget.h +++ b/ground/openpilotgcs/src/plugins/config/config_cc_hw_widget.h @@ -50,6 +50,7 @@ private slots: private: Ui_CC_HW_Widget *m_telemetry; + QSvgRenderer *m_renderer; }; #endif // CONFIGCCHWWIDGET_H diff --git a/package/osx/libraries b/package/osx/libraries index 5c87ba15b..fc21721e9 100755 --- a/package/osx/libraries +++ b/package/osx/libraries @@ -5,7 +5,7 @@ PLUGINS="${APP}/Contents/Plugins" OP_PLUGINS="${APP}/Contents/Plugins/OpenPilot" QT_LIBS="QtGui QtTest QtCore QtSvg QtSql QtOpenGL QtNetwork QtXml QtDBus QtScript phonon" QT_DIR=$(otool -L "${APP}/Contents/MacOS/OpenPilot GCS" | sed -n -e 's/\/QtCore\.framework.*//p' | sed -n -E 's:^.::p') -QT_EXTRA="accessible/libqtaccessiblewidgets.dylib bearer/libqgenericbearer.dylib codecs/libqcncodecs.dylib codecs/libqjpcodecs.dylib codecs/libqkrcodecs.dylib codecs/libqtwcodecs.dylib graphicssystems/libqtracegraphicssystem.dylib imageformats/libqgif.dylib imageformats/libqico.dylib imageformats/libqjpeg.dylib imageformats/libqmng.dylib imageformats/libqtiff.dylib qmltooling/libqmldbg_inspector.dylib qmltooling/libqmldbg_tcp.dylib" +QT_EXTRA="accessible/libqtaccessiblewidgets.dylib bearer/libqgenericbearer.dylib codecs/libqcncodecs.dylib codecs/libqjpcodecs.dylib codecs/libqkrcodecs.dylib codecs/libqtwcodecs.dylib graphicssystems/libqtracegraphicssystem.dylib imageformats/libqgif.dylib imageformats/libqico.dylib imageformats/libqjpeg.dylib imageformats/libqmng.dylib imageformats/libqtiff.dylib imageformats/libqsvg.dylib qmltooling/libqmldbg_inspector.dylib qmltooling/libqmldbg_tcp.dylib" echo "Qt library directory is \"${QT_DIR}\"" @@ -50,10 +50,21 @@ done for f in ${QT_EXTRA} do + echo "Copying package ${f}" + cp "${QT_DIR}/../plugins/${f}" "${APP}/Contents/Plugins/${f}" echo "Changing package identification of ${f}" install_name_tool -id \ @executable_path/../Plugins/${f} \ "${PLUGINS}/${f}" + + echo "Changing package linkages" + for g in $QT_LIBS + do + install_name_tool -change \ + "${QT_DIR}/${g}.framework/Versions/4/${g}" \ + @executable_path/../Frameworks/${g}.framework/Versions/4/${g} \ + "${APP}/Contents/Plugins/${f}" + done done echo "Copying SDL" From 213a915f67b34a9ed555a2878d6fc5c4933c8892 Mon Sep 17 00:00:00 2001 From: David Ankers Date: Wed, 1 Feb 2012 20:09:43 +1100 Subject: [PATCH 15/15] Remove flightplanner screen --- .../src/plugins/coreplugin/OpenPilotGCS.xml | 79 ++++--------------- 1 file changed, 16 insertions(+), 63 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/OpenPilotGCS.xml b/ground/openpilotgcs/src/plugins/coreplugin/OpenPilotGCS.xml index fb6187949..7394a661f 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/OpenPilotGCS.xml +++ b/ground/openpilotgcs/src/plugins/coreplugin/OpenPilotGCS.xml @@ -2650,53 +2650,6 @@ UAVGadgetManagerV1 - false - - - OPMapGadget - - default - - uavGadget - - - - ModelViewGadget - - Test Quad X - - uavGadget - - - - DialGadget - - Attitude - - uavGadget - - - DialGadget - - Compass - - uavGadget - - 1 - @Variant(AAAACQAAAAA=) - splitter - - 2 - @Variant(AAAACQAAAAIAAAACAAABiwAAAAIAAADs) - splitter - - 1 - @Variant(AAAACQAAAAIAAAACAAAD1AAAAAIAAAGB) - splitter - - UAVGadgetManagerV1 - - false @@ -2751,8 +2704,8 @@ splitter UAVGadgetManagerV1 - - + + false @@ -2822,8 +2775,8 @@ splitter UAVGadgetManagerV1 - - + + false @@ -2869,30 +2822,30 @@ splitter UAVGadgetManagerV1 - + @ByteArray(AAAA/wAAAAD9AAAAAAAABQAAAALCAAAABAAAAAQAAAABAAAACPwAAAAA) :/core/images/ah.png - :/core/images/openpilot_logo_64.png :/core/images/config.png - :/core/images/world.png - :/core/images/scopes.png - :/core/images/joystick.png - :/core/images/cog.png + :/core/images/scopes.png + :/core/images/joystick.png + :/core/images/cog.png + :/core/images/openpilot_logo_64.png :/core/images/openpilot_logo_64.png :/core/images/openpilot_logo_64.png :/core/images/openpilot_logo_64.png - 6 + :/core/images/openpilot_logo_64.png + 5 Flight data - Workspace10 Configuration - Flight Planner - Scopes - HITL - Firmware + Scopes + HITL + Firmware + Workspace6 Workspace7 Workspace8 Workspace9 + Workspace10