From e2c4b2f97882a4ae95c19b83fdb3fdc9ef714825 Mon Sep 17 00:00:00 2001 From: zedamota Date: Sun, 13 Nov 2011 17:39:05 +0000 Subject: [PATCH] Simple mismatch detection, needs testing to find if message is clear enough for users. --- .../plugins/uploader/uploadergadgetwidget.cpp | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp index dfe62229b..00ea87629 100755 --- a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp @@ -25,8 +25,10 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "uploadergadgetwidget.h" +#include "../../../../../build/ground/openpilotgcs/gcsversioninfo.h" #include #include +#include #define DFU_DEBUG true @@ -64,7 +66,10 @@ UploaderGadgetWidget::UploaderGadgetWidget(QWidget *parent) : QWidget(parent) // And check whether by any chance we are not already connected if (telMngr->isConnected()) + { onAutopilotConnect(); + versionMatchCheck(); + } } @@ -614,14 +619,16 @@ void UploaderGadgetWidget::versionMatchCheck() UAVObjectUtilManager* utilMngr = pm->getObject(); deviceDescriptorStruct boardDescription=utilMngr->getBoardDescriptionStruct(); QString gcsDescription=QString::fromLatin1(Core::Constants::GCS_REVISION_STR); - /*TODO compare logic - if() - { - }*/ - QString version; - QErrorMessage msg(this); - msg.showMessage(QString("Incompatible GCS and FW detected, you should upgrade your GCS to %1 version").arg(version)); - msg.showMessage(QString("Incompatible GCS and FW detected, you should upgrade your board's Firmware to %1 version").arg(version)); + if(boardDescription.gitTag!=gcsDescription.mid(gcsDescription.indexOf(":")+1,8)) + { + qDebug()<0) + msg->showMessage(QString("Incompatible GCS and FW detected, you should upgrade your board's Firmware to %1 version.").arg(gcsDescription)); + else + msg->showMessage(QString("Incompatible GCS and FW detected, you should upgrade your GCS to %1 version.").arg(boardDescription.gitTag+":"+boardDescription.buildDate)); - -} + } + }