Commit f6266e94 authored by pixhawk's avatar pixhawk

Started to add support for autopilot firmware updates, added Linux compile...

Started to add support for autopilot firmware updates, added Linux compile instructions, fixed date in mavlink.h to english independent of OS language settings
parent 7160a6c1
QGroundControl Open Source Micro Air Vehicle Ground Control Station
http://pixhawk.ethz.ch
Project:
http://qgroundcontrol.org
Files:
http://github.com/pixhawk/qgroundcontrol
http://github.com/pixhawk/mavlink
**********************************************************************************************
* PLEASE NOTE: YOU NEED TO DOWNLOAD THE MAVLINK LIBRARY IN ORDER TO COMPILE THIS APPLICATION *
**********************************************************************************************
Mac OS X
========
......@@ -21,7 +32,7 @@ Install QT with Cocoa
Get the MAVLINK Library
-----------------------
1) Clone the MAVLINK repository : `git clone git@pixhawk.ethz.ch:mavlink.git` (You need to have emailed your ssh key). **NOTE:** Make sure that the mavlink directory is in the same directory as groundcontrol. QGround control will look for mavlink library in ../mavlink
1) Clone the MAVLINK repository : `git clone git@github.com:pixhawk/mavlink.git`. **NOTE:** Make sure that the mavlink directory is in the same directory as groundcontrol. QGround control will look for mavlink library in ../mavlink
Build QGroundControl
--------------------
......@@ -35,13 +46,28 @@ Build QGroundControl
Linux
=====
**********************************************************************************************
* PLEASE NOTE: YOU NEED TO DOWNLOAD THE MAVLINK LIBRARY IN ORDER TO COMPILE THIS APPLICATION *
**********************************************************************************************
To build on Linux:
<instructions to be written>
sudo apt-get install phonon libqt4-dev libqt4-phonon-dev \
libqt4-phonon libphonon-dev libphonon4 phonon-backend-gstreamer \
qt-creator libsdl1.2-dev libflite1 flite1-dev
cd directory
git clone git@github.com:pixhawk/mavlink.git
git clone git@github.com:pixhawk/qgroundcontrol.git
Ubuntu Application Menu -> Development -> Qt Creator
QtCreator Menu File -> Open File or Project..
Open directory/qgroundcontrol/qgroundcontrol.pro
Hit the green play button to compile and launch it
Done.
Windows
=======
......
......@@ -45,11 +45,9 @@ INCLUDEPATH += . \
$$BASEDIR/../mavlink/contrib/slugs/include \
$$BASEDIR/../mavlink/include
# ../mavlink/include \
#MAVLink/include \
#mavlink/include
# ../mavlink/include \
# MAVLink/include \
# mavlink/include
# Input
FORMS += src/ui/MainWindow.ui \
src/ui/CommSettings.ui \
......@@ -73,7 +71,9 @@ FORMS += src/ui/MainWindow.ui \
src/ui/QGCSensorSettingsWidget.ui \
src/ui/watchdog/WatchdogControl.ui \
src/ui/watchdog/WatchdogProcessView.ui \
src/ui/watchdog/WatchdogView.ui
src/ui/watchdog/WatchdogView.ui \
src/ui/QGCFirmwareUpdate.ui \
src/ui/QGCPxImuFirmwareUpdate.ui
INCLUDEPATH += src \
src/ui \
src/ui/linechart \
......@@ -147,7 +147,9 @@ HEADERS += src/MG.h \
src/ui/watchdog/WatchdogView.h \
src/uas/UASWaypointManager.h \
src/ui/HSIDisplay.h \
src/QGC.h
src/QGC.h \
src/ui/QGCFirmwareUpdate.h \
src/ui/QGCPxImuFirmwareUpdate.h
SOURCES += src/main.cc \
src/Core.cc \
src/uas/UASManager.cc \
......@@ -203,5 +205,7 @@ SOURCES += src/main.cc \
src/ui/watchdog/WatchdogView.cc \
src/uas/UASWaypointManager.cc \
src/ui/HSIDisplay.cc \
src/QGC.cc
src/QGC.cc \
src/ui/QGCFirmwareUpdate.cc \
src/ui/QGCPxImuFirmwareUpdate.cc
RESOURCES = mavground.qrc
......@@ -4,6 +4,7 @@
#include <QList>
#include <QMap>
#include <QDateTime>
#include <QLocale>
#include "MAVLinkXMLParser.h"
#include <QDebug>
......@@ -222,7 +223,7 @@ bool MAVLinkXMLParser::generate()
while (!f.isNull())
{
QDomElement e2 = f.toElement();
if (!e2.isNull())
if (!e2.isNull() && e2.tagName() == "field")
{
QString fieldType = e2.attribute("type", "");
QString fieldName = e2.attribute("name", "");
......@@ -362,8 +363,9 @@ bool MAVLinkXMLParser::generate()
// XML parsed and converted to C code. Now generating the files
QDateTime now = QDateTime::currentDateTime().toUTC();
QLocale loc(QLocale::English);
QString dateFormat = "dddd, MMMM d yyyy, hh:mm UTC";
QString date = now.toString(dateFormat);
QString date = loc.toString(now, dateFormat);
QString mainHeader = QString("/** @file\n *\t@brief MAVLink comm protocol.\n *\t@see http://pixhawk.ethz.ch/software/mavlink\n *\t Generated on %1\n */\n#ifndef MAVLINK_H\n#define MAVLINK_H\n\n").arg(date); // The main header includes all messages
// Mark all code as C code
mainHeader += "#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n";
......
#include "QGCFirmwareUpdate.h"
#include "ui_QGCFirmwareUpdate.h"
QGCFirmwareUpdate::QGCFirmwareUpdate(QWidget *parent) :
QWidget(parent),
ui(new Ui::QGCFirmwareUpdate)
{
ui->setupUi(this);
}
QGCFirmwareUpdate::~QGCFirmwareUpdate()
{
delete ui;
}
void QGCFirmwareUpdate::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
#ifndef QGCFIRMWAREUPDATE_H
#define QGCFIRMWAREUPDATE_H
#include <QWidget>
namespace Ui {
class QGCFirmwareUpdate;
}
class QGCFirmwareUpdate : public QWidget {
Q_OBJECT
public:
QGCFirmwareUpdate(QWidget *parent = 0);
~QGCFirmwareUpdate();
protected:
void changeEvent(QEvent *e);
private:
Ui::QGCFirmwareUpdate *ui;
};
#endif // QGCFIRMWAREUPDATE_H
<ui version="4.0">
<author/>
<comment/>
<exportmacro/>
<class>QGCFirmwareUpdate</class>
<widget class="QWidget" name="QGCFirmwareUpdate">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
</widget>
<pixmapfunction/>
<connections/>
</ui>
#include "QGCPxImuFirmwareUpdate.h"
#include "ui_QGCPxImuFirmwareUpdate.h"
QGCPxImuFirmwareUpdate::QGCPxImuFirmwareUpdate(QWidget *parent) :
QWidget(parent),
ui(new Ui::QGCPxImuFirmwareUpdate)
{
ui->setupUi(this);
}
QGCPxImuFirmwareUpdate::~QGCPxImuFirmwareUpdate()
{
delete ui;
}
void QGCPxImuFirmwareUpdate::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
#ifndef QGCPXIMUFIRMWAREUPDATE_H
#define QGCPXIMUFIRMWAREUPDATE_H
#include <QWidget>
namespace Ui {
class QGCPxImuFirmwareUpdate;
}
class QGCPxImuFirmwareUpdate : public QWidget {
Q_OBJECT
public:
QGCPxImuFirmwareUpdate(QWidget *parent = 0);
~QGCPxImuFirmwareUpdate();
protected:
void changeEvent(QEvent *e);
private:
Ui::QGCPxImuFirmwareUpdate *ui;
};
#endif // QGCPXIMUFIRMWAREUPDATE_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QGCPxImuFirmwareUpdate</class>
<widget class="QWidget" name="QGCPxImuFirmwareUpdate">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="5">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Instructions</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="margin">
<number>2</number>
</property>
<item>
<widget class="QPlainTextEdit" name="plainTextEdit">
<property name="plainText">
<string>&lt;h1&gt;pxIMU Firmware Update&lt;/h1&gt;
&lt;li&gt;
&lt;item&gt;Item 1&lt;/item&gt;
&lt;/li&gt;
</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QRadioButton" name="radioButton">
<property name="text">
<string>From File</string>
</property>
</widget>
</item>
<item row="1" column="2" colspan="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Choose file..</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QPushButton" name="pushButton_2">
<property name="text">
<string>Choose File</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QRadioButton" name="radioButton_2">
<property name="text">
<string>From Internet</string>
</property>
</widget>
</item>
<item row="2" column="2" colspan="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Firmware v.0.2.1</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QPushButton" name="pushButton_3">
<property name="text">
<string>Download</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Waiting for first user action</string>
</property>
</widget>
</item>
<item row="3" column="3" colspan="2">
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Flash Firmware</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment