mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
Merge remote-tracking branch 'origin/pt/version-mismach-warning' into next
This commit is contained in:
commit
856f8a9b6c
@ -212,8 +212,9 @@ QString UAVSettingsImportExportFactory::createXMLDocument(
|
|||||||
QDomElement fw=doc.createElement("Embedded");
|
QDomElement fw=doc.createElement("Embedded");
|
||||||
UAVObjectUtilManager* utilMngr = pm->getObject<UAVObjectUtilManager>();
|
UAVObjectUtilManager* utilMngr = pm->getObject<UAVObjectUtilManager>();
|
||||||
|
|
||||||
fw.setAttribute("gitcommittag",utilMngr->getBoardDescriptionStruct().gitTag);
|
deviceDescriptorStruct struc=utilMngr->getBoardDescriptionStruct();
|
||||||
fw.setAttribute("fwtag",utilMngr->getBoardDescriptionStruct().description);
|
fw.setAttribute("gitcommittag",struc.gitTag);
|
||||||
|
fw.setAttribute("fwtag",struc.description);
|
||||||
fw.setAttribute("cpuSerial",QString(utilMngr->getBoardCPUSerial().toHex()));
|
fw.setAttribute("cpuSerial",QString(utilMngr->getBoardCPUSerial().toHex()));
|
||||||
|
|
||||||
versionInfo.appendChild(fw);
|
versionInfo.appendChild(fw);
|
||||||
|
@ -25,6 +25,9 @@
|
|||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#include "uploadergadgetwidget.h"
|
#include "uploadergadgetwidget.h"
|
||||||
|
#include "../../../../../build/ground/openpilotgcs/gcsversioninfo.h"
|
||||||
|
#include <coreplugin/coreconstants.h>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
#define DFU_DEBUG true
|
#define DFU_DEBUG true
|
||||||
|
|
||||||
@ -37,11 +40,13 @@ UploaderGadgetWidget::UploaderGadgetWidget(QWidget *parent) : QWidget(parent)
|
|||||||
dfu = NULL;
|
dfu = NULL;
|
||||||
m_timer = 0;
|
m_timer = 0;
|
||||||
m_progress = 0;
|
m_progress = 0;
|
||||||
|
msg=new QErrorMessage(this);
|
||||||
// Listen to autopilot connection events
|
// Listen to autopilot connection events
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||||
TelemetryManager* telMngr = pm->getObject<TelemetryManager>();
|
TelemetryManager* telMngr = pm->getObject<TelemetryManager>();
|
||||||
connect(telMngr, SIGNAL(connected()), this, SLOT(onAutopilotConnect()));
|
connect(telMngr, SIGNAL(connected()), this, SLOT(onAutopilotConnect()));
|
||||||
|
connect(telMngr, SIGNAL(connected()), this, SLOT(versionMatchCheck()));
|
||||||
|
|
||||||
connect(telMngr, SIGNAL(disconnected()), this, SLOT(onAutopilotDisconnect()));
|
connect(telMngr, SIGNAL(disconnected()), this, SLOT(onAutopilotDisconnect()));
|
||||||
|
|
||||||
connect(m_config->haltButton, SIGNAL(clicked()), this, SLOT(goToBootloader()));
|
connect(m_config->haltButton, SIGNAL(clicked()), this, SLOT(goToBootloader()));
|
||||||
@ -60,7 +65,10 @@ UploaderGadgetWidget::UploaderGadgetWidget(QWidget *parent) : QWidget(parent)
|
|||||||
|
|
||||||
// And check whether by any chance we are not already connected
|
// And check whether by any chance we are not already connected
|
||||||
if (telMngr->isConnected())
|
if (telMngr->isConnected())
|
||||||
|
{
|
||||||
onAutopilotConnect();
|
onAutopilotConnect();
|
||||||
|
versionMatchCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -603,3 +611,22 @@ void UploaderGadgetWidget::info(QString infoString, int infoNumber)
|
|||||||
Q_UNUSED(infoNumber);
|
Q_UNUSED(infoNumber);
|
||||||
m_config->boardStatus->setText(infoString);
|
m_config->boardStatus->setText(infoString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UploaderGadgetWidget::versionMatchCheck()
|
||||||
|
{
|
||||||
|
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||||
|
UAVObjectUtilManager* utilMngr = pm->getObject<UAVObjectUtilManager>();
|
||||||
|
deviceDescriptorStruct boardDescription=utilMngr->getBoardDescriptionStruct();
|
||||||
|
QString gcsDescription=QString::fromLatin1(Core::Constants::GCS_REVISION_STR);
|
||||||
|
if(boardDescription.gitTag!=gcsDescription.mid(gcsDescription.indexOf(":")+1,8))
|
||||||
|
{
|
||||||
|
qDebug()<<QDate::fromString(boardDescription.buildDate.mid(0,8),"yyyyMMdd");
|
||||||
|
qDebug()<<QDate::fromString(gcsDescription.mid(gcsDescription.indexOf(" ")+1,8),"yyyyMMdd");
|
||||||
|
qDebug()<<QDate::fromString(boardDescription.buildDate.mid(0,8),"yyyyMMdd").daysTo(QDate::fromString(gcsDescription.mid(gcsDescription.indexOf(" ")+1,8),"yyyyMMdd"));
|
||||||
|
if(QDate::fromString(boardDescription.buildDate.mid(0,8),"yyyyMMdd").daysTo(QDate::fromString(gcsDescription.mid(gcsDescription.indexOf(" ")+1,8),"yyyyMMdd"))>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));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include "devicedescriptorstruct.h"
|
#include "devicedescriptorstruct.h"
|
||||||
#include <QProgressDialog>
|
#include <QProgressDialog>
|
||||||
|
#include <QErrorMessage>
|
||||||
|
|
||||||
using namespace OP_DFU;
|
using namespace OP_DFU;
|
||||||
|
|
||||||
@ -84,8 +85,10 @@ private:
|
|||||||
QTimer* m_timer;
|
QTimer* m_timer;
|
||||||
QLineEdit* openFileNameLE;
|
QLineEdit* openFileNameLE;
|
||||||
QEventLoop m_eventloop;
|
QEventLoop m_eventloop;
|
||||||
|
QErrorMessage * msg;
|
||||||
private slots:
|
private slots:
|
||||||
void onPhisicalHWConnect();
|
void onPhisicalHWConnect();
|
||||||
|
void versionMatchCheck();
|
||||||
void error(QString errorString,int errorNumber);
|
void error(QString errorString,int errorNumber);
|
||||||
void info(QString infoString,int infoNumber);
|
void info(QString infoString,int infoNumber);
|
||||||
void goToBootloader(UAVObject* = NULL, bool = false);
|
void goToBootloader(UAVObject* = NULL, bool = false);
|
||||||
|
Loading…
Reference in New Issue
Block a user