Commit e1270632 authored by Mariano Lizarraga's avatar Mariano Lizarraga

Merge branch 'master' of git@pixhawk.ethz.ch:qgroundcontrol into checkRemote

Conflicts:

	src/ui/MapWidget.h
parents cbfe1775 74746fec
......@@ -101,8 +101,46 @@ QSeparator {
QSpinBox {
min-height: 12 px;
}
min-height: 14px;
max-height: 18px;
border: 1px solid #4A4A4F;
border-radius: 5px;
}
QSpinBox::up-button {
subcontrol-origin: border;
subcontrol-position: top right; /* position at the top right corner */
border-image: url(:/images/actions/go-up.svg) 1;
border-width: 1px;
}
QSpinBox::down-button {
subcontrol-origin: border;
subcontrol-position: bottom right; /* position at the top right corner */
border-image: url(:/images/actions/go-down.svg) 1;
border-width: 1px;
}
QDoubleSpinBox {
min-height: 14px;
max-height: 18px;
border: 1px solid #4A4A4F;
border-radius: 5px;
}
QDoubleSpinBox::up-button {
subcontrol-origin: border;
subcontrol-position: top right; /* position at the top right corner */
border-image: url(:/images/actions/go-up.svg) 1;
border-width: 1px;
max-width: 5px;
}
QDoubleSpinBox::down-button {
subcontrol-origin: border;
subcontrol-position: bottom right; /* position at the top right corner */
border-image: url(:/images/actions/go-down.svg) 1;
border-width: 1px;
max-width: 5px;
}
QPushButton {
font-weight: bold;
......
......@@ -27,8 +27,7 @@
namespace qmapcontrol
{
GoogleMapAdapter::GoogleMapAdapter()
: TileMapAdapter("mt2.google.com", "/mt?n=404&x=%2&y=%3&zoom=%1", 256, 17, 0)
//: TileMapAdapter("tile.openstreetmap.org", "/%1/%2/%3.png", 256, 0, 17)
: TileMapAdapter("mt0.google.com", "/vt/lyrs=&x=%2&s=&y=%3&z=%1", 256, 0, 17)
{
}
......
......@@ -29,155 +29,155 @@
namespace qmapcontrol
{
GoogleSatMapAdapter::GoogleSatMapAdapter()
: TileMapAdapter("kh2.google.com", "/kh?n=404&v=8&t=trtqtt", 256, 0, 19)
: TileMapAdapter("khm.google.com", "/kh?v=51&x=%2&s=&y=%3&z=%1", 256, 0, 17)
{
// name = "googlesat";
numberOfTiles = pow(2, current_zoom+0.0);
coord_per_x_tile = 360. / numberOfTiles;
coord_per_y_tile = 180. / numberOfTiles;
// // name = "googlesat";
//
// numberOfTiles = pow(2, current_zoom+0.0);
// coord_per_x_tile = 360. / numberOfTiles;
// coord_per_y_tile = 180. / numberOfTiles;
}
GoogleSatMapAdapter::~GoogleSatMapAdapter()
{
}
QString GoogleSatMapAdapter::getHost() const
{
int random = qrand() % 4;
return QString("kh%1.google.com").arg(random);
}
QPoint GoogleSatMapAdapter::coordinateToDisplay(const QPointF& coordinate) const
{
//double x = ((coordinate.x()+180)*(tilesize*numberOfTiles/360));
//double y = (((coordinate.y()*-1)+90)*(tilesize*numberOfTiles/180));
qreal x = (coordinate.x()+180.) * (numberOfTiles*mytilesize)/360.; // coord to pixel!
//double y = -1*(coordinate.y()-90) * (numberOfTiles*tilesize)/180.; // coord to pixel!
qreal y = (getMercatorYCoord(coordinate.y())-M_PI) * -1 * (numberOfTiles*mytilesize)/(2*M_PI); // coord to pixel!
return QPoint(int(x), int(y));
}
QPointF GoogleSatMapAdapter::displayToCoordinate(const QPoint& point) const
{
//double lon = ((point.x()/tilesize*numberOfTiles)*360)-180;
//double lat = (((point.y()/tilesize*numberOfTiles)*180)-90)*-1;
qreal lon = (point.x()*(360.0/(numberOfTiles*mytilesize)))-180.0;
// qreal lat = -(point.y()*(180.0/(numberOfTiles*mytilesize)))+90.0;
// FIXME Looks buggy
qreal lat = getMercatorLatitude(point.y()*-1*(2*M_PI/(numberOfTiles*mytilesize)) + M_PI);
//qreal lat = lat *180./M_PI;
return QPointF(lon, lat);
}
qreal GoogleSatMapAdapter::getMercatorLatitude(qreal YCoord) const
{
//http://welcome.warnercnr.colostate.edu/class_info/nr502/lg4/projection_mathematics/converting.html
if (YCoord > M_PI) return 9999.;
if (YCoord < -M_PI) return -9999.;
qreal t = atan(exp(YCoord));
qreal res = (2.*(t))-(M_PI/2.);
return res;
}
qreal GoogleSatMapAdapter::getMercatorYCoord(qreal lati) const
{
qreal lat = lati;
// conversion degre=>radians
qreal phi = M_PI * lat / 180;
qreal res;
//double temp = Math.Tan(Math.PI / 4 - phi / 2);
//res = Math.Log(temp);
res = 0.5 * log((1 + sin(phi)) / (1 - sin(phi)));
return res;
}
void GoogleSatMapAdapter::zoom_in()
{
current_zoom+=1;
numberOfTiles = pow(2, current_zoom+0.0);
coord_per_x_tile = 360. / numberOfTiles;
coord_per_y_tile = 180. / numberOfTiles;
}
void GoogleSatMapAdapter::zoom_out()
{
current_zoom-=1;
numberOfTiles = pow(2, current_zoom+0.0);
coord_per_x_tile = 360. / numberOfTiles;
coord_per_y_tile = 180. / numberOfTiles;
}
bool GoogleSatMapAdapter::isValid(int x, int y, int z) const
{
if ((x>=0 && x < numberOfTiles) && (y>=0 && y < numberOfTiles) && z>=0)
{
return true;
}
return false;
}
QString GoogleSatMapAdapter::query(int i, int j, int z) const
{
return getQ(-180+i*coord_per_x_tile,
90-(j+1)*coord_per_y_tile, z);
}
QString GoogleSatMapAdapter::getQ(qreal longitude, qreal latitude, int zoom) const
{
qreal xmin=-180;
qreal xmax=180;
qreal ymin=-90;
qreal ymax=90;
qreal xmoy=0;
qreal ymoy=0;
QString location="t";
//Google uses a latitude divided by 2;
qreal halflat = latitude;
for (int i = 0; i < zoom; i++)
{
xmoy = (xmax + xmin) / 2;
ymoy = (ymax + ymin) / 2;
if (halflat >= ymoy) //upper part (q or r)
{
ymin = ymoy;
if (longitude < xmoy)
{ /*q*/
location+= "q";
xmax = xmoy;
}
else
{/*r*/
location+= "r";
xmin = xmoy;
}
}
else //lower part (t or s)
{
ymax = ymoy;
if (longitude < xmoy)
{ /*t*/
location+= "t";
xmax = xmoy;
}
else
{/*s*/
location+= "s";
xmin = xmoy;
}
}
}
return QString("/kh?n=404&v=24&t=%1").arg(location);
}
//
// QString GoogleSatMapAdapter::getHost() const
// {
// int random = qrand() % 4;
// return QString("kh%1.google.com").arg(random);
// }
//
// QPoint GoogleSatMapAdapter::coordinateToDisplay(const QPointF& coordinate) const
// {
// //double x = ((coordinate.x()+180)*(tilesize*numberOfTiles/360));
// //double y = (((coordinate.y()*-1)+90)*(tilesize*numberOfTiles/180));
//
// qreal x = (coordinate.x()+180.) * (numberOfTiles*mytilesize)/360.; // coord to pixel!
// //double y = -1*(coordinate.y()-90) * (numberOfTiles*tilesize)/180.; // coord to pixel!
// qreal y = (getMercatorYCoord(coordinate.y())-M_PI) * -1 * (numberOfTiles*mytilesize)/(2*M_PI); // coord to pixel!
// return QPoint(int(x), int(y));
// }
//
// QPointF GoogleSatMapAdapter::displayToCoordinate(const QPoint& point) const
// {
// //double lon = ((point.x()/tilesize*numberOfTiles)*360)-180;
// //double lat = (((point.y()/tilesize*numberOfTiles)*180)-90)*-1;
//
// qreal lon = (point.x()*(360.0/(numberOfTiles*mytilesize)))-180.0;
// // qreal lat = -(point.y()*(180.0/(numberOfTiles*mytilesize)))+90.0;
// // FIXME Looks buggy
//
// qreal lat = getMercatorLatitude(point.y()*-1*(2*M_PI/(numberOfTiles*mytilesize)) + M_PI);
// //qreal lat = lat *180./M_PI;
// return QPointF(lon, lat);
// }
//
// qreal GoogleSatMapAdapter::getMercatorLatitude(qreal YCoord) const
// {
// //http://welcome.warnercnr.colostate.edu/class_info/nr502/lg4/projection_mathematics/converting.html
// if (YCoord > M_PI) return 9999.;
// if (YCoord < -M_PI) return -9999.;
//
// qreal t = atan(exp(YCoord));
// qreal res = (2.*(t))-(M_PI/2.);
// return res;
// }
//
// qreal GoogleSatMapAdapter::getMercatorYCoord(qreal lati) const
// {
// qreal lat = lati;
//
// // conversion degre=>radians
// qreal phi = M_PI * lat / 180;
//
// qreal res;
// //double temp = Math.Tan(Math.PI / 4 - phi / 2);
// //res = Math.Log(temp);
// res = 0.5 * log((1 + sin(phi)) / (1 - sin(phi)));
//
// return res;
// }
//
// void GoogleSatMapAdapter::zoom_in()
// {
// current_zoom+=1;
// numberOfTiles = pow(2, current_zoom+0.0);
// coord_per_x_tile = 360. / numberOfTiles;
// coord_per_y_tile = 180. / numberOfTiles;
// }
//
// void GoogleSatMapAdapter::zoom_out()
// {
// current_zoom-=1;
// numberOfTiles = pow(2, current_zoom+0.0);
// coord_per_x_tile = 360. / numberOfTiles;
// coord_per_y_tile = 180. / numberOfTiles;
// }
//
// bool GoogleSatMapAdapter::isValid(int x, int y, int z) const
// {
// if ((x>=0 && x < numberOfTiles) && (y>=0 && y < numberOfTiles) && z>=0)
// {
// return true;
// }
// return false;
// }
// QString GoogleSatMapAdapter::query(int i, int j, int z) const
// {
// return getQ(-180+i*coord_per_x_tile,
// 90-(j+1)*coord_per_y_tile, z);
// }
//
// QString GoogleSatMapAdapter::getQ(qreal longitude, qreal latitude, int zoom) const
// {
// qreal xmin=-180;
// qreal xmax=180;
// qreal ymin=-90;
// qreal ymax=90;
//
// qreal xmoy=0;
// qreal ymoy=0;
// QString location="t";
//
// //Google uses a latitude divided by 2;
// qreal halflat = latitude;
//
// for (int i = 0; i < zoom; i++)
// {
// xmoy = (xmax + xmin) / 2;
// ymoy = (ymax + ymin) / 2;
// if (halflat >= ymoy) //upper part (q or r)
// {
// ymin = ymoy;
// if (longitude < xmoy)
// { /*q*/
// location+= "q";
// xmax = xmoy;
// }
// else
// {/*r*/
// location+= "r";
// xmin = xmoy;
// }
// }
// else //lower part (t or s)
// {
// ymax = ymoy;
// if (longitude < xmoy)
// { /*t*/
//
// location+= "t";
// xmax = xmoy;
// }
// else
// {/*s*/
// location+= "s";
// xmin = xmoy;
// }
// }
// }
// return QString("/kh?n=404&v=24&t=%1").arg(location);
// }
}
......@@ -44,31 +44,31 @@ namespace qmapcontrol
*/
GoogleSatMapAdapter();
virtual ~GoogleSatMapAdapter();
virtual QPoint coordinateToDisplay(const QPointF&) const;
virtual QPointF displayToCoordinate(const QPoint&) const;
//! returns the host of this MapAdapter
/*!
* @return the host of this MapAdapter
*/
QString getHost () const;
protected:
virtual void zoom_in();
virtual void zoom_out();
virtual QString query(int x, int y, int z) const;
virtual bool isValid(int x, int y, int z) const;
private:
virtual QString getQ(qreal longitude, qreal latitude, int zoom) const;
qreal getMercatorLatitude(qreal YCoord) const;
qreal getMercatorYCoord(qreal lati) const;
qreal coord_per_x_tile;
qreal coord_per_y_tile;
int srvNum;
//
// virtual QPoint coordinateToDisplay(const QPointF&) const;
// virtual QPointF displayToCoordinate(const QPoint&) const;
//
// //! returns the host of this MapAdapter
// /*!
// * @return the host of this MapAdapter
// */
// QString getHost () const;
//
//
// protected:
// virtual void zoom_in();
// virtual void zoom_out();
// virtual QString query(int x, int y, int z) const;
// virtual bool isValid(int x, int y, int z) const;
//
// private:
// virtual QString getQ(qreal longitude, qreal latitude, int zoom) const;
// qreal getMercatorLatitude(qreal YCoord) const;
// qreal getMercatorYCoord(qreal lati) const;
//
// qreal coord_per_x_tile;
// qreal coord_per_y_tile;
// int srvNum;
};
}
#endif
price quantity
210 81
250 73
280 64
300 61
320 50
340 46
360 45
380 44
400 43
420 39
440 36
......@@ -31,7 +31,10 @@
message(Qt version $$[QT_VERSION])
release {
# DEFINES += QT_NO_DEBUG_OUTPUT
# DEFINES += QT_NO_WARNING_OUTPUT
}
# MAC OS X
macx {
......
......@@ -124,7 +124,6 @@ HEADERS += src/MG.h \
src/ui/ObjectDetectionView.h \
src/input/JoystickInput.h \
src/ui/JoystickWidget.h \
src/ui/PFD.h \
src/ui/DebugConsole.h \
src/ui/MapWidget.h \
src/ui/XMLCommProtocolWidget.h \
......@@ -153,7 +152,10 @@ HEADERS += src/MG.h \
src/ui/QGCPxImuFirmwareUpdate.h \
src/comm/MAVLinkLightProtocol.h \
src/ui/QGCDataPlot2D.h \
src/ui/linechart/IncrementalPlot.h
src/ui/linechart/IncrementalPlot.h \
src/ui/map/Waypoint2DIcon.h \
src/ui/map/MAV2DIcon.h \
src/ui/map/QGC2DIcon.h
SOURCES += src/main.cc \
src/Core.cc \
src/uas/UASManager.cc \
......@@ -185,7 +187,6 @@ SOURCES += src/main.cc \
src/ui/ObjectDetectionView.cc \
src/input/JoystickInput.cc \
src/ui/JoystickWidget.cc \
src/ui/PFD.cc \
src/ui/DebugConsole.cc \
src/ui/MapWidget.cc \
src/ui/XMLCommProtocolWidget.cc \
......@@ -214,12 +215,16 @@ SOURCES += src/main.cc \
src/ui/QGCPxImuFirmwareUpdate.cc \
src/comm/MAVLinkLightProtocol.cc \
src/ui/QGCDataPlot2D.cc \
src/ui/linechart/IncrementalPlot.cc
src/ui/linechart/IncrementalPlot.cc \
src/ui/map/Waypoint2DIcon.cc \
src/ui/map/MAV2DIcon.cc \
src/ui/map/QGC2DIcon.cc
RESOURCES = mavground.qrc
# Include RT-LAB Library
win32 {
LIBS += -LC:\OPAL-RT\RT-LAB7.2.4\Common\bin -lOpalApi
win32 {
LIBS += -LC:\OPAL-RT\RT-LAB7.2.4\Common\bin \
-lOpalApi
INCLUDEPATH += src/lib/opalrt
SOURCES += src/comm/OpalLink.cc
HEADERS += src/comm/OpalLink.h
......
......@@ -36,6 +36,9 @@ This file is part of the QGROUNDCONTROL project
#include <QDebug>
/**
* It will only get active upon calling startCompression()
*/
LogCompressor::LogCompressor(QString logFileName, QString outFileName, int uasid) :
logFileName(logFileName),
outFileName(outFileName),
......@@ -44,7 +47,6 @@ LogCompressor::LogCompressor(QString logFileName, QString outFileName, int uasid
dataLines(1),
uasid(uasid)
{
start();
}
void LogCompressor::run()
......@@ -174,9 +176,15 @@ void LogCompressor::run()
dataLines = 1;
delete keys;
qDebug() << "Done with logfile processing";
emit finishedFile(outfile.fileName());
running = false;
}
void LogCompressor::startCompression()
{
start();
}
bool LogCompressor::isFinished()
{
return !running;
......
......@@ -5,11 +5,15 @@
class LogCompressor : public QThread
{
Q_OBJECT
public:
/** @brief Create the log compressor. It will only get active upon calling startCompression() */
LogCompressor(QString logFileName, QString outFileName="", int uasid = 0);
void startCompression();
bool isFinished();
int getDataLines();
int getCurrentLine();
protected:
void run();
QString logFileName;
......@@ -18,6 +22,12 @@ protected:
int currentDataLine;
int dataLines;
int uasid;
signals:
/** @brief This signal is emitted once a logfile has been finished writing
* @param fileName The name out the output (CSV) file
*/
void finishedFile(QString fileName);
};
#endif // LOGCOMPRESSOR_H
......@@ -258,7 +258,7 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b)
//if ()
// If a new loss was detected or we just hit one 128th packet step
if (lastLoss != totalLossCounter || (totalReceiveCounter & 0x7F) == 0)
if (lastLoss != totalLossCounter || (totalReceiveCounter == 128))
{
// Calculate new loss ratio
// Receive loss
......
......@@ -40,6 +40,7 @@ This file is part of the QGROUNDCONTROL project
#include "ProtocolInterface.h"
#include "LinkInterface.h"
#include "protocol.h"
#include "mavlink.h"
/**
* @brief MAVLink micro air vehicle protocol reference implementation.
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef ARDUPILOTMAV_H
#define ARDUPILOTMAV_H
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef PXQUADMAV_H
#define PXQUADMAV_H
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef SLUGSMAV_H
#define SLUGSMAV_H
......
......@@ -360,7 +360,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
if (alt != alt)
{
alt = 0;
emit textMessageReceived(uasId, 255, "GCS ERROR: RECEIVED NaN FOR ALTITUDE");
emit textMessageReceived(uasId, message.compid, 255, "GCS ERROR: RECEIVED NaN FOR ALTITUDE");
}
emit valueChanged(uasId, "alt", pos.alt, time);
// Smaller than threshold and not NaN
......@@ -372,7 +372,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
}
else
{
emit textMessageReceived(uasId, 255, QString("GCS ERROR: RECEIVED INVALID SPEED OF %1 m/s").arg(pos.v));
emit textMessageReceived(uasId, message.compid, 255, QString("GCS ERROR: RECEIVED INVALID SPEED OF %1 m/s").arg(pos.v));
}
emit globalPositionChanged(this, pos.lon, pos.lat, alt, time);
}
......@@ -498,7 +498,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
int severity = mavlink_msg_statustext_get_severity(&message);
//qDebug() << "RECEIVED STATUS:" << text;false
//emit statusTextReceived(severity, text);
emit textMessageReceived(uasId, severity, text);
emit textMessageReceived(uasId, message.compid, severity, text);
}
break;
default:
......@@ -1038,6 +1038,11 @@ void UAS::setManualControlCommands(double roll, double pitch, double yaw, double
}
}
int UAS::getSystemType()
{
return this->type;
}
void UAS::receiveButton(int buttonIndex)
{
switch (buttonIndex)
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......@@ -142,6 +142,7 @@ protected:
public:
UASWaypointManager &getWaypointManager(void) { return waypointManager; }
int getSystemType();
public slots:
/** @brief Launches the system **/
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......@@ -135,6 +135,9 @@ public:
return colors[nextColor++];
}
/** @brief Get the type of the system (airplane, quadrotor, helicopter,..)*/
virtual int getSystemType() = 0;
QColor getColor()
{
return color;
......@@ -228,10 +231,11 @@ signals:
* messages like critical errors.
*
* @param uasid ID of the sending system
* @param compid ID of the sending component
* @param text the status text
* @param severity The severity of the message, 0 for plain debug messages, 10 for very critical messages
*/
void textMessageReceived(int uasid, int severity, QString text);
void textMessageReceived(int uasid, int componentid, int severity, QString text);
/**
* @brief Update the error count of a device
*
......
......@@ -23,7 +23,7 @@ This file is part of the PIXHAWK project
/**
* @file
* @brief Implementation of central manager for all connected aerial vehicles
* @brief Implementation of class UASManager
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
......@@ -81,9 +81,7 @@ void UASManager::addUAS(UASInterface* uas)
// If there is no active UAS yet, set the first one as the active UAS
if (activeUAS == NULL)
{
activeUAS = uas;
emit activeUASSet(uas);
emit activeUASSet(uas->getUASID());
setActiveUAS(uas);
}
}
......@@ -165,6 +163,11 @@ void UASManager::setActiveUAS(UASInterface* uas)
if (uas != NULL)
{
activeUASMutex.lock();
if (activeUAS != NULL)
{
emit activeUASStatusChanged(activeUAS, false);
emit activeUASStatusChanged(activeUAS->getUASID(), false);
}
activeUAS = uas;
activeUASMutex.unlock();
......@@ -172,6 +175,8 @@ void UASManager::setActiveUAS(UASInterface* uas)
emit activeUASSet(uas);
emit activeUASSet(uas->getUASID());
emit activeUASStatusChanged(uas, true);
emit activeUASStatusChanged(uas->getUASID(), true);
}
}
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of central manager for all connected aerial vehicles
* @brief Definition of class UASManager
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
......@@ -37,7 +37,7 @@ This file is part of the PIXHAWK project
#include <UASInterface.h>
/**
* @brief Manager class for the UASs
* @brief Central manager for all connected aerial vehicles
*
* This class keeps a list of all connected / configured UASs. It also stores which
* UAS is currently select with respect to user input or manual controls.
......@@ -165,8 +165,14 @@ protected:
signals:
void UASCreated(UASInterface* UAS);
/** @brief The UAS currently under main operator control changed */
void activeUASSet(UASInterface* UAS);
/** @brief The UAS currently under main operator control changed */
void activeUASSet(int systemId);
/** @brief The UAS currently under main operator control changed */
void activeUASStatusChanged(UASInterface* UAS, bool active);
/** @brief The UAS currently under main operator control changed */
void activeUASStatusChanged(int systemId, bool active);
};
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Implementation of class AudioOutputWidget
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#include "AudioOutputWidget.h"
#include "ui_AudioOutputWidget.h"
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of class AudioOutputWidget
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#ifndef AUDIOOUTPUTWIDGET_H
#define AUDIOOUTPUTWIDGET_H
......@@ -7,7 +37,11 @@ namespace Ui {
class AudioOutputWidget;
}
class AudioOutputWidget : public QWidget {
/**
* @brief Widget to control audio/volume/mute
*/
class AudioOutputWidget : public QWidget
{
Q_OBJECT
public:
AudioOutputWidget(QWidget *parent = 0);
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
Please see our website at <http://pixhawk.ethz.ch>
QGroundControl Open Source Ground Control Station
(c) 2009 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of configuration window for serial links
* @brief Definition of class CommConfigurationWindow
*
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
......@@ -44,6 +43,9 @@ This file is part of the PIXHAWK project
#include "OpalLink.h"
#endif
/**
* @brief Configuration window for communication links
*/
class CommConfigurationWindow : public QWidget
{
Q_OBJECT
......
......@@ -33,6 +33,7 @@ This file is part of the PIXHAWK project
#include "DebugConsole.h"
#include "ui_DebugConsole.h"
#include "LinkManager.h"
#include "UASManager.h"
#include "protocol.h"
#include <QDebug>
......@@ -163,9 +164,13 @@ void DebugConsole::setAutoHold(bool hold)
autoHold = hold;
}
void DebugConsole::receiveTextMessage(int id, int severity, QString text)
/**
* Prints the message in the UAS color
*/
void DebugConsole::receiveTextMessage(int id, int component, int severity, QString text)
{
m_ui->receiveText->appendHtml(QString("<font color=\"yellow\">(MAV" + QString::number(id) + QString(":") + QString::number(severity) + QString(") ") + text + QString("</font>")));
Q_UNUSED(severity);
m_ui->receiveText->appendHtml(QString("<font color=\"%1\">(MAV%2:%3) %4</font>").arg(UASManager::instance()->getUASForId(id)->getColor().name(), QString::number(id), QString::number(component), text));
}
void DebugConsole::updateTrafficMeasurements()
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......@@ -43,7 +43,14 @@ namespace Ui {
class DebugConsole;
}
class DebugConsole : public QWidget {
/**
* @brief Shows a debug console
*
* This class shows the raw data stream of each link
* and the debug / text messages sent by all systems
*/
class DebugConsole : public QWidget
{
Q_OBJECT
public:
DebugConsole(QWidget *parent = 0);
......@@ -69,7 +76,7 @@ public slots:
/** @brief Enable auto-freeze mode if traffic intensity is too high to display */
void setAutoHold(bool hold);
/** @brief Receive plain text message to output to the user */
void receiveTextMessage(int id, int severity, QString text);
void receiveTextMessage(int id, int component, int severity, QString text);
protected slots:
/** @brief Draw information overlay */
......
......@@ -32,6 +32,8 @@ This file is part of the PIXHAWK project
#include <QFile>
#include <QGLWidget>
#include <QStringList>
#include <QGraphicsTextItem>
#include <QMouseEvent>
#include "UASManager.h"
#include "HDDisplay.h"
#include "ui_HDDisplay.h"
......@@ -40,7 +42,7 @@ This file is part of the PIXHAWK project
#include <QDebug>
HDDisplay::HDDisplay(QStringList* plotList, QWidget *parent) :
QWidget(parent),
QGraphicsView(parent),
uas(NULL),
values(QMap<QString, float>()),
valuesDot(QMap<QString, float>()),
......@@ -80,11 +82,47 @@ HDDisplay::HDDisplay(QStringList* plotList, QWidget *parent) :
acceptList = new QStringList();
}
// setBackgroundBrush(QBrush(backgroundColor));
// setDragMode(QGraphicsView::ScrollHandDrag);
// setCacheMode(QGraphicsView::CacheBackground);
// // FIXME Handle full update with care - ressource intensive
// setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
//
// setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
//
// //Set-up the scene
// QGraphicsScene* Scene = new QGraphicsScene(this);
// setScene(Scene);
//
// //Populate the scene
// for(int x = 0; x < 1000; x = x + 25) {
// for(int y = 0; y < 1000; y = y + 25) {
//
// if(x % 100 == 0 && y % 100 == 0) {
// Scene->addRect(x, y, 2, 2);
//
// QString pointString;
// QTextStream stream(&pointString);
// stream << "(" << x << "," << y << ")";
// QGraphicsTextItem* item = Scene->addText(pointString);
// item->setPos(x, y);
// } else {
// Scene->addRect(x, y, 1, 1);
// }
// }
// }
//
// //Set-up the view
// setSceneRect(0, 0, 1000, 1000);
// setCenter(QPointF(500.0, 500.0)); //A modified version of centerOn(), handles special cases
// setCursor(Qt::OpenHandCursor);
this->setMinimumHeight(125);
this->setMinimumWidth(100);
// Refresh timer
refreshTimer->setInterval(150); // 200 Hz/5 ms
refreshTimer->setInterval(180); //
connect(refreshTimer, SIGNAL(timeout()), this, SLOT(triggerUpdate()));
//connect(refreshTimer, SIGNAL(timeout()), this, SLOT(paintGL()));
......@@ -109,28 +147,27 @@ HDDisplay::~HDDisplay()
delete m_ui;
}
void HDDisplay::enableGLRendering(bool enable)
{
}
void HDDisplay::triggerUpdate()
{
// Only repaint the regions necessary
QRect r = geometry();
update(r);
update(this->geometry());
}
void HDDisplay::paintEvent(QPaintEvent * event)
{
Q_UNUSED(event);
//paintGL();
static quint64 interval = 0;
//qDebug() << "INTERVAL:" << MG::TIME::getGroundTimeNow() - interval << __FILE__ << __LINE__;
interval = MG::TIME::getGroundTimeNow();
paintDisplay();
}
void HDDisplay::paintGL()
{
renderOverlay();
}
void HDDisplay::paintDisplay()
void HDDisplay::renderOverlay()
{
quint64 refreshInterval = 100;
quint64 currTime = MG::TIME::getGroundTimeNow();
......@@ -148,10 +185,10 @@ void HDDisplay::paintDisplay()
double scalingFactorH = this->height()/vheight;
if (scalingFactorH < scalingFactor) scalingFactor = scalingFactorH;
QPainter painter(this);
QPainter painter(viewport());
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setRenderHint(QPainter::HighQualityAntialiasing, true);
painter.fillRect(QRect(0, 0, width(), height()), backgroundColor);
//painter.fillRect(QRect(0, 0, width(), height()), backgroundColor);
const int columns = 3;
const float spacing = 0.4f; // 40% of width
const float gaugeWidth = vwidth / (((float)columns) + (((float)columns+1) * spacing + spacing * 0.5f));
......@@ -628,3 +665,138 @@ void HDDisplay::changeEvent(QEvent *e)
break;
}
}
///**
// * Sets the current centerpoint. Also updates the scene's center point.
// * Unlike centerOn, which has no way of getting the floating point center
// * back, SetCenter() stores the center point. It also handles the special
// * sidebar case. This function will claim the centerPoint to sceneRec ie.
// * the centerPoint must be within the sceneRec.
// */
////Set the current centerpoint in the
//void HDDisplay::setCenter(const QPointF& centerPoint) {
// //Get the rectangle of the visible area in scene coords
// QRectF visibleArea = mapToScene(rect()).boundingRect();
//
// //Get the scene area
// QRectF sceneBounds = sceneRect();
//
// double boundX = visibleArea.width() / 2.0;
// double boundY = visibleArea.height() / 2.0;
// double boundWidth = sceneBounds.width() - 2.0 * boundX;
// double boundHeight = sceneBounds.height() - 2.0 * boundY;
//
// //The max boundary that the centerPoint can be to
// QRectF bounds(boundX, boundY, boundWidth, boundHeight);
//
// if(bounds.contains(centerPoint)) {
// //We are within the bounds
// currentCenterPoint = centerPoint;
// } else {
// //We need to clamp or use the center of the screen
// if(visibleArea.contains(sceneBounds)) {
// //Use the center of scene ie. we can see the whole scene
// currentCenterPoint = sceneBounds.center();
// } else {
//
// currentCenterPoint = centerPoint;
//
// //We need to clamp the center. The centerPoint is too large
// if(centerPoint.x() > bounds.x() + bounds.width()) {
// currentCenterPoint.setX(bounds.x() + bounds.width());
// } else if(centerPoint.x() < bounds.x()) {
// currentCenterPoint.setX(bounds.x());
// }
//
// if(centerPoint.y() > bounds.y() + bounds.height()) {
// currentCenterPoint.setY(bounds.y() + bounds.height());
// } else if(centerPoint.y() < bounds.y()) {
// currentCenterPoint.setY(bounds.y());
// }
//
// }
// }
//
// //Update the scrollbars
// centerOn(currentCenterPoint);
//}
//
///**
// * Handles when the mouse button is pressed
// */
//void HDDisplay::mousePressEvent(QMouseEvent* event) {
// //For panning the view
// lastPanPoint = event->pos();
// setCursor(Qt::ClosedHandCursor);
//}
//
///**
// * Handles when the mouse button is released
// */
//void HDDisplay::mouseReleaseEvent(QMouseEvent* event) {
// setCursor(Qt::OpenHandCursor);
// lastPanPoint = QPoint();
//}
//
///**
//*Handles the mouse move event
//*/
//void HDDisplay::mouseMoveEvent(QMouseEvent* event) {
// if(!lastPanPoint.isNull()) {
// //Get how much we panned
// QPointF delta = mapToScene(lastPanPoint) - mapToScene(event->pos());
// lastPanPoint = event->pos();
//
// //Update the center ie. do the pan
// setCenter(getCenter() + delta);
// }
//}
//
///**
// * Zoom the view in and out.
// */
//void HDDisplay::wheelEvent(QWheelEvent* event) {
//
// //Get the position of the mouse before scaling, in scene coords
// QPointF pointBeforeScale(mapToScene(event->pos()));
//
// //Get the original screen centerpoint
// QPointF screenCenter = getCenter(); //CurrentCenterPoint; //(visRect.center());
//
// //Scale the view ie. do the zoom
// double scaleFactor = 1.15; //How fast we zoom
// if(event->delta() > 0) {
// //Zoom in
// scale(scaleFactor, scaleFactor);
// } else {
// //Zooming out
// scale(1.0 / scaleFactor, 1.0 / scaleFactor);
// }
//
// //Get the position after scaling, in scene coords
// QPointF pointAfterScale(mapToScene(event->pos()));
//
// //Get the offset of how the screen moved
// QPointF offset = pointBeforeScale - pointAfterScale;
//
// //Adjust to the new center for correct zooming
// QPointF newCenter = screenCenter + offset;
// setCenter(newCenter);
//}
//
///**
// * Need to update the center so there is no jolt in the
// * interaction after resizing the widget.
// */
//void HDDisplay::resizeEvent(QResizeEvent* event) {
// //Get the rectangle of the visible area in scene coords
// QRectF visibleArea = mapToScene(rect()).boundingRect();
// setCenter(visibleArea.center());
//
// //Call the subclass resize so the scrollbars are updated correctly
// QGraphicsView::resizeEvent(event);
//}
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......@@ -32,7 +32,7 @@ This file is part of the PIXHAWK project
#ifndef HDDISPLAY_H
#define HDDISPLAY_H
#include <QtGui/QWidget>
#include <QtGui/QGraphicsView>
#include <QColor>
#include <QTimer>
#include <QFontDatabase>
......@@ -46,7 +46,16 @@ namespace Ui {
class HDDisplay;
}
class HDDisplay : public QWidget {
/**
* @brief Head Down Display Widget
*
* This widget is used for any head down display as base widget. It handles the basic widget setup
* each head down instrument has a virtual screen size in millimeters as base coordinate system
* this virtual screen size is then scaled to pixels on the screen.
* When the pixel per millimeter ratio is known, a 1:1 representation is possible on the screen
*/
class HDDisplay : public QGraphicsView
{
Q_OBJECT
public:
HDDisplay(QStringList* plotList, QWidget *parent = 0);
......@@ -60,8 +69,9 @@ public slots:
void setActiveUAS(UASInterface* uas);
protected slots:
void paintGL();
void paintDisplay();
void enableGLRendering(bool enable);
//void render(QPainter* painter, const QRectF& target = QRectF(), const QRect& source = QRect(), Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio);
void renderOverlay();
void triggerUpdate();
protected:
......@@ -84,6 +94,23 @@ protected:
void drawSystemIndicator(float xRef, float yRef, int maxNum, float maxWidth, float maxHeight, QPainter* painter);
void paintText(QString text, QColor color, float fontSize, float refX, float refY, QPainter* painter);
// //Holds the current centerpoint for the view, used for panning and zooming
// QPointF currentCenterPoint;
//
// //From panning the view
// QPoint lastPanPoint;
//
// //Set the current centerpoint in the
// void setCenter(const QPointF& centerPoint);
// QPointF getCenter() { return currentCenterPoint; }
//
// //Take over the interaction
// virtual void mousePressEvent(QMouseEvent* event);
// virtual void mouseReleaseEvent(QMouseEvent* event);
// virtual void mouseMoveEvent(QMouseEvent* event);
// virtual void wheelEvent(QWheelEvent* event);
// virtual void resizeEvent(QResizeEvent* event);
UASInterface* uas; ///< The uas currently monitored
QMap<QString, float> values; ///< The variables this HUD displays
QMap<QString, float> valuesDot; ///< First derivative of the variable
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......@@ -32,12 +32,16 @@ This file is part of the PIXHAWK project
#include <QFile>
#include <QStringList>
#include <QPainter>
#include <QGraphicsScene>
#include <QHBoxLayout>
#include <QDoubleSpinBox>
#include "UASManager.h"
#include "HSIDisplay.h"
#include "MG.h"
#include "QGC.h"
#include "Waypoint.h"
#include "UASWaypointManager.h"
#include "Waypoint2DIcon.h"
#include <QDebug>
......@@ -98,9 +102,28 @@ HSIDisplay::HSIDisplay(QWidget *parent) :
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*)));
refreshTimer->setInterval(60);
// this->setScene(new QGraphicsScene(-metricWidth/2.0f, -metricWidth/2.0f, metricWidth, metricWidth, this));
xCenterPos = vwidth/2.0f;
yCenterPos = vheight/2.0f + topMargin - bottomMargin;
// Add interaction elements
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setMargin(2);
layout->setSpacing(0);
QDoubleSpinBox* spinBox = new QDoubleSpinBox(this);
spinBox->setMinimum(0.1);
spinBox->setMaximum(9999);
connect(spinBox, SIGNAL(valueChanged(double)), this, SLOT(setMetricWidth(double)));
connect(this, SIGNAL(metricWidthChanged(double)), spinBox, SLOT(setValue(double)));
layout->addWidget(spinBox);
layout->setAlignment(spinBox, Qt::AlignBottom | Qt::AlignLeft);
this->setLayout(layout);
this->setVisible(false);
// Do first update
setMetricWidth(metricWidth);
}
void HSIDisplay::paintEvent(QPaintEvent * event)
......@@ -110,10 +133,10 @@ void HSIDisplay::paintEvent(QPaintEvent * event)
static quint64 interval = 0;
//qDebug() << "INTERVAL:" << MG::TIME::getGroundTimeNow() - interval << __FILE__ << __LINE__;
interval = MG::TIME::getGroundTimeNow();
paintDisplay();
renderOverlay();
}
void HSIDisplay::paintDisplay()
void HSIDisplay::renderOverlay()
{
// Center location of the HSI gauge items
......@@ -131,12 +154,13 @@ void HSIDisplay::paintDisplay()
double scalingFactorH = this->height()/vheight;
if (scalingFactorH < scalingFactor) scalingFactor = scalingFactorH;
QPainter painter(this);
QPainter painter(viewport());
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setRenderHint(QPainter::HighQualityAntialiasing, true);
// Draw background
painter.fillRect(QRect(0, 0, width(), height()), backgroundColor);
//painter.fillRect(QRect(0, 0, width(), height()), backgroundColor);
// Draw base instrument
// ----------------------
......@@ -393,6 +417,15 @@ void HSIDisplay::mouseDoubleClickEvent(QMouseEvent * event)
}
}
void HSIDisplay::setMetricWidth(double width)
{
if (width != metricWidth)
{
metricWidth = width;
emit metricWidthChanged(metricWidth);
}
}
/**
*
* @param uas the UAS/MAV to monitor/display with the HUD
......@@ -634,6 +667,18 @@ void HSIDisplay::drawWaypoints(QPainter& painter)
if (uas)
{
const QVector<Waypoint*>& list = uas->getWaypointManager().getWaypointList();
// for (int i = 0; i < list.size(); i++)
// {
// QPointF in(list.at(i)->getX(), list.at(i)->getY());
// // Transform from world to body coordinates
// in = metricWorldToBody(in);
// // Scale from metric to screen reference coordinates
// QPointF p = metricBodyToRef(in);
// Waypoint2DIcon* wp = new Waypoint2DIcon();
// wp->setLocalPosition(list.at(i)->getX(), list.at(i)->getY());
// wp->setPos(0, 0);
// scene()->addItem(wp);
// }
QColor color;
painter.setBrush(Qt::NoBrush);
......@@ -863,18 +908,22 @@ void HSIDisplay::drawAltitudeSetpoint(float xRef, float yRef, float radius, cons
// paintText(label, color, 4.5f, xRef-7.5f, yRef-2.0f, painter);
}
/**
* @param fix 0: lost, 1: 2D local position hold, 2: 2D localization, 3: 3D localization
*/
void localizationChanged(UASInterface* uas, int fix);
/**
* @param fix 0: lost, 1: at least one satellite, but no GPS fix, 2: 2D localization, 3: 3D localization
*/
void gpsLocalizationChanged(UASInterface* uas, int fix);
/**
* @param fix 0: lost, 1: 2D local position hold, 2: 2D localization, 3: 3D localization
*/
void visionLocalizationChanged(UASInterface* uas, int fix);
void HSIDisplay::wheelEvent(QWheelEvent* event)
{
double zoomScale = 0.005; // Scaling of zoom value
if(event->delta() > 0)
{
// Reduce width -> Zoom in
metricWidth -= event->delta() * zoomScale;
}
else
{
// Increase width -> Zoom out
metricWidth -= event->delta() * zoomScale;
}
metricWidth = qBound(0.1, metricWidth, 9999.0);
emit metricWidthChanged(metricWidth);
}
void HSIDisplay::updateJoystick(double roll, double pitch, double yaw, double thrust, int xHat, int yHat)
{
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......@@ -51,6 +51,8 @@ public:
public slots:
void setActiveUAS(UASInterface* uas);
/** @brief Set the width in meters this widget shows from top */
void setMetricWidth(double width);
void updateSatellite(int uasid, int satid, float azimuth, float direction, float snr, bool used);
void updateAttitudeSetpoints(UASInterface*, double rollDesired, double pitchDesired, double yawDesired, double thrustDesired, quint64 usec);
void updateAttitude(UASInterface* uas, double roll, double pitch, double yaw, quint64 time);
......@@ -80,8 +82,11 @@ public slots:
void updateJoystick(double roll, double pitch, double yaw, double thrust, int xHat, int yHat);
void pressKey(int key);
signals:
void metricWidthChanged(double width);
protected slots:
void paintDisplay();
void renderOverlay();
void drawGPS(QPainter &painter);
void drawObjects(QPainter &painter);
void drawPositionDirection(float xRef, float yRef, float radius, const QColor& color, QPainter* painter);
......@@ -101,8 +106,11 @@ protected slots:
void drawSafetyArea(const QPointF &topLeft, const QPointF &bottomRight, const QColor &color, QPainter &painter);
/** @brief Receive mouse clicks */
void mouseDoubleClickEvent(QMouseEvent* event);
/** @brief Receive mouse wheel events */
void wheelEvent(QWheelEvent* event);
protected:
/** @brief Get color from GPS signal-to-noise colormap */
static QColor getColorForSNR(float snr);
/** @brief Metric world coordinates to metric body coordinates */
......@@ -201,7 +209,7 @@ protected:
float uiYSetCoordinate; ///< Y Setpoint coordinate wanted by the UI
float uiZSetCoordinate; ///< Z Setpoint coordinate wanted by the UI
float uiYawSet; ///< Yaw Setpoint wanted by the UI
float metricWidth; ///< Width the instrument represents in meters (the width of the ground shown by the widget)
double metricWidth; ///< Width the instrument represents in meters (the width of the ground shown by the widget)
//
float xCenterPos; ///< X center of instrument in virtual coordinates
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......
......@@ -145,6 +145,7 @@ void MainWindow::connectWidgets()
{
connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), linechart, SLOT(addSystem(UASInterface*)));
connect(UASManager::instance(), SIGNAL(activeUASSet(int)), linechart, SLOT(selectSystem(int)));
connect(linechart, SIGNAL(logfileWritten(QString)), this, SLOT(loadDataView(QString)));
connect(mavlink, SIGNAL(receiveLossChanged(int, float)), info, SLOT(updateSendLoss(int, float)));
}
......@@ -390,29 +391,61 @@ void MainWindow::addLink(LinkInterface *link)
void MainWindow::UASCreated(UASInterface* uas)
{
// Connect the UAS to the full user interface
//ui.menuConnected_Systems->addAction(QIcon(":/images/mavs/generic.svg"), tr("View ") + uas->getUASName(), uas, SLOT(setSelected()));
// FIXME Should be not inside the mainwindow
connect(uas, SIGNAL(textMessageReceived(int,int,QString)), debugConsole, SLOT(receiveTextMessage(int,int,QString)));
if (uas != NULL)
{
QIcon icon;
// Set matching icon
switch (uas->getSystemType())
{
case 0:
icon = QIcon(":/images/mavs/generic.svg");
break;
case 1:
icon = QIcon(":/images/mavs/fixed-wing.svg");
break;
case 2:
icon = QIcon(":/images/mavs/quadrotor.svg");
break;
case 3:
icon = QIcon(":/images/mavs/coaxial.svg");
break;
case 4:
icon = QIcon(":/images/mavs/helicopter.svg");
break;
case 5:
icon = QIcon(":/images/mavs/groundstation.svg");
break;
default:
icon = QIcon(":/images/mavs/unknown.svg");
break;
}
// Health / System status indicator
info->addUAS(uas);
ui.menuConnected_Systems->addAction(icon, tr("Select %1 for control").arg(uas->getUASName()), uas, SLOT(setSelected()));
// UAS List
list->addUAS(uas);
// FIXME Should be not inside the mainwindow
connect(uas, SIGNAL(textMessageReceived(int,int,int,QString)), debugConsole, SLOT(receiveTextMessage(int,int,int,QString)));
// Camera view
//camera->addUAS(uas);
// Health / System status indicator
info->addUAS(uas);
// Revalidate UI
// TODO Stylesheet reloading should in theory not be necessary
reloadStylesheet();
// UAS List
list->addUAS(uas);
// Camera view
//camera->addUAS(uas);
// Revalidate UI
// TODO Stylesheet reloading should in theory not be necessary
reloadStylesheet();
// Check which type this UAS is of
PxQuadMAV* mav = dynamic_cast<PxQuadMAV*>(uas);
if (mav) loadPixhawkView();
SlugsMAV* mav2 = dynamic_cast<SlugsMAV*>(uas);
if (mav2) loadSlugsView();
// Check which type this UAS is of
PxQuadMAV* mav = dynamic_cast<PxQuadMAV*>(uas);
if (mav) loadPixhawkView();
SlugsMAV* mav2 = dynamic_cast<SlugsMAV*>(uas);
if (mav2) loadSlugsView();
}
}
/**
......@@ -544,6 +577,13 @@ void MainWindow::loadDataView()
centerStack->setCurrentWidget(dataplot);
}
void MainWindow::loadDataView(QString fileName)
{
clearView();
centerStack->setCurrentWidget(dataplot);
dataplot->loadFile(fileName);
}
void MainWindow::loadPilotView()
{
clearView();
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Main application window
* @brief Definition of class MainWindow
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
......@@ -52,7 +52,6 @@ This file is part of the PIXHAWK project
#include "AS4Protocol.h"
#include "ObjectDetectionView.h"
#include "HUD.h"
#include "PFD.h"
#include "JoystickWidget.h"
#include "input/JoystickInput.h"
#include "DebugConsole.h"
......@@ -119,6 +118,8 @@ public slots:
void loadMAVLinkView();
/** @brief Load data view, allowing to plot flight data */
void loadDataView();
/** @brief Load data view, allowing to plot flight data */
void loadDataView(QString fileName);
/** @brief Show the online help for users */
void showHelp();
......
......@@ -87,8 +87,14 @@
<addaction name="actionProject_Roadmap"/>
<addaction name="actionCredits_Developers"/>
</widget>
<widget class="QMenu" name="menuConnected_Systems">
<property name="title">
<string>Select System</string>
</property>
</widget>
<addaction name="menuMGround"/>
<addaction name="menuNetwork"/>
<addaction name="menuConnected_Systems"/>
<addaction name="menuUnmanned_System"/>
<addaction name="menuWindow"/>
<addaction name="menuHelp"/>
......
This diff is collapsed.
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......@@ -26,7 +26,7 @@ This file is part of the PIXHAWK project
* @brief Definition of MapWidget
*
* @author Lorenz Meier <mavteam@student.ethz.ch>
* @author Mariano Lizzaraga
* @author Mariano Lizarraga
*
*/
......@@ -38,12 +38,20 @@ This file is part of the PIXHAWK project
#include "qmapcontrol.h"
#include "UASInterface.h"
class QMenu;
namespace Ui {
class MapWidget;
}
using namespace qmapcontrol;
/**
* @brief 2D Moving map
*
* This map displays street maps, aerial images and the MAV position,
* waypoints and trails on top.
*/
class MapWidget : public QWidget {
Q_OBJECT
public:
......@@ -61,20 +69,29 @@ protected:
void keyPressEvent(QKeyEvent *event);
void resizeEvent(QResizeEvent* event);
QAction* osmAction;
QAction* yahooActionMap;
QAction* yahooActionSatellite;
QAction* yahooActionOverlay;
QAction* googleActionMap;
QAction* googleSatAction;
QPushButton* followgps;
QPushButton* createPath;
QLabel* gpsposition;
MapControl* mc;
QMenu* mapMenu;
QPushButton* mapButton;
MapControl* mc; ///< QMapControl widget
MapAdapter* mapadapter; ///< Adapter to load the map data
qmapcontrol::Layer* l; ///< Current map layer (background)
qmapcontrol::Layer* overlay; ///< Street overlay (foreground)
qmapcontrol::GeometryLayer* geomLayer; ///< Layer for waypoints
int zoomLevel;
int detailZoom; ///< Steps zoomed in further than qMapControl allows
static const int scrollStep = 40; ///< Scroll n pixels per keypress
static const int maxZoom = 50;
TileMapAdapter* osmAdapter;
GoogleSatMapAdapter* gSatAdapter;
Layer* osmLayer;
Layer* geomLayer;
static const int maxZoom = 50; ///< Maximum zoom level
//Layer* gSatLayer;
......@@ -87,6 +104,7 @@ protected:
void captureMapClick (const QMouseEvent* event, const QPointF coordinate);
void createPathButtonClicked();
void captureGeometryClick(Geometry*, QPoint);
void mapproviderSelected(QAction* action);
void captureGeometryDrag(Geometry* geom, QPointF coordinate);
private:
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
(c) 2009 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
This file is part of the PIXHAWK project
PIXHAWK is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Head Down Display / Primary Flight Display
*
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#include "PFD.h"
PFD::PFD(int width, int height, QWidget* parent)
: HUD(width, height, parent)
{
vGaugeSpacing = 70.0f;
vwidth = 200.0f;
vheight = 200.0f;
}
// xCenterOffset(0.0f),
// yCenterOffset(0.0f),
// vwidth(200.0f),
// vheight(150.0f),
// vGaugeSpacing(50.0f),
// vPitchPerDeg(6.0f), ///< 4 mm y translation per degree)
// noCamera(true),
// hardwareAcceleration(true),
// strongStrokeWidth(1.5f),
// normalStrokeWidth(1.0f),
// fineStrokeWidth(0.5f)
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
(c) 2009 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
This file is part of the PIXHAWK project
PIXHAWK is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Head Down Display / Primary Flight Display
*
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#ifndef PFD_H
#define PFD_H
#include "HUD.h"
class PFD : public HUD
{
public:
PFD(int width, int height, QWidget* parent);
};
#endif // PFD_H
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of class ParameterInterface
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#include <QTreeWidget>
#include "ParameterInterface.h"
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of class ParameterInterface
*
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#ifndef PARAMETERINTERFACE_H
#define PARAMETERINTERFACE_H
......@@ -11,7 +42,13 @@ namespace Ui {
class ParameterInterface;
}
class ParameterInterface : public QWidget {
/**
* @brief Container class for onboard parameter widgets
*
* @see QGCParamWidget
*/
class ParameterInterface : public QWidget
{
Q_OBJECT
public:
explicit ParameterInterface(QWidget *parent = 0);
......
This diff is collapsed.
......@@ -16,11 +16,17 @@ public:
QGCDataPlot2D(QWidget *parent = 0);
~QGCDataPlot2D();
/** @brief Calculate and display regression function*/
bool calculateRegression(QString xName, QString yName, QString method="linear");
/** @brief Linear regression over data points */
int linearRegression(double *x,double *y,int n,double *a,double *b,double *r);
int linearRegression(double* x,double* y,int n,double* a,double* b,double* r);
public slots:
/** @brief Load previously selected file */
void loadFile();
/** @brief Load file with this name */
void loadFile(QString file);
/** @brief Reload a file, with filtering enabled */
void reloadFile();
void selectFile();
......@@ -29,10 +35,14 @@ public slots:
void saveCsvLog();
/** @brief Save plot to PDF or SVG */
void savePlot();
/** @brief Export PDF file */
void exportPDF(QString fileName);
/** @brief Export SVG file */
void exportSVG(QString file);
/** @brief Print or save PDF file (MacOS/Linux) */
void print();
/** @brief Calculate and display regression function*/
bool calculateRegression();
protected:
void changeEvent(QEvent *e);
......@@ -40,6 +50,7 @@ protected:
LogCompressor* compressor;
QFile* logFile;
QString fileName;
QStringList curveNames;
private:
Ui::QGCDataPlot2D *ui;
......
......@@ -6,22 +6,22 @@
<rect>
<x>0</x>
<y>0</y>
<width>807</width>
<width>1073</width>
<height>308</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="2,10,2,0,0,0,0,0,0,0,0,0,0">
<item row="0" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>X</string>
</property>
</widget>
</item>
<item row="0" column="2">
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="xAxis"/>
</item>
<item row="0" column="3">
......@@ -53,7 +53,12 @@
</item>
<item>
<property name="text">
<string>Only dots</string>
<string>Only rectangles</string>
</property>
</item>
<item>
<property name="text">
<string>Only symbols</string>
</property>
</item>
<item>
......@@ -68,7 +73,12 @@
</item>
<item>
<property name="text">
<string>Lines and dots</string>
<string>Lines and rects</string>
</property>
</item>
<item>
<property name="text">
<string>Lines and symbols</string>
</property>
</item>
<item>
......@@ -83,7 +93,7 @@
</item>
<item>
<property name="text">
<string>Dotted lines and dots</string>
<string>Dotted lines and rects</string>
</property>
</item>
<item>
......@@ -98,39 +108,91 @@
</item>
<item>
<property name="text">
<string>Dashed lines and dots</string>
<string>Dashed lines and rects</string>
</property>
</item>
</widget>
</item>
<item row="0" column="9">
<item row="0" column="7" colspan="2">
<widget class="QPushButton" name="reloadButton">
<property name="text">
<string>Reload</string>
<string>Replot</string>
</property>
</widget>
</item>
<item row="0" column="10">
<spacer name="horizontalSpacer_2">
<item row="0" column="11">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</widget>
</item>
<item row="0" column="11">
<item row="0" column="12" colspan="2">
<widget class="QPushButton" name="savePlotButton">
<property name="text">
<string>Save Plot</string>
<string>Save Image</string>
</property>
</widget>
</item>
<item row="0" column="19">
<widget class="QPushButton" name="printButton">
<property name="text">
<string>Print</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Title</string>
</property>
</widget>
</item>
<item row="1" column="2" colspan="3">
<widget class="QLineEdit" name="plotTitle"/>
</item>
<item row="1" column="5">
<widget class="QLabel" name="label_5">
<property name="text">
<string>X label</string>
</property>
</widget>
</item>
<item row="1" column="6" colspan="2">
<widget class="QLineEdit" name="plotXAxisLabel"/>
</item>
<item row="1" column="8">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Y label</string>
</property>
</widget>
</item>
<item row="1" column="9" colspan="3">
<widget class="QLineEdit" name="plotYAxisLabel"/>
</item>
<item row="1" column="12" colspan="2">
<widget class="QCheckBox" name="symmetricCheckBox">
<property name="text">
<string>Symmetric</string>
</property>
</widget>
</item>
<item row="1" column="14" colspan="2">
<widget class="QCheckBox" name="legendCheckBox">
<property name="text">
<string>Legend</string>
</property>
</widget>
</item>
<item row="1" column="16">
<widget class="QCheckBox" name="gridCheckBox">
<property name="text">
<string>Grid</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="13">
<item row="2" column="0" colspan="20">
<widget class="QFrame" name="plotFrame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
......@@ -140,14 +202,14 @@
</property>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>File</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<item row="3" column="1" colspan="2">
<widget class="QComboBox" name="inputFileType">
<item>
<property name="text">
......@@ -166,14 +228,21 @@
</item>
</widget>
</item>
<item row="2" column="3" colspan="4">
<item row="3" column="3" colspan="4">
<widget class="QLabel" name="filenameLabel">
<property name="text">
<string>Please select input file..</string>
</property>
</widget>
</item>
<item row="2" column="10">
<item row="3" column="8" colspan="2">
<widget class="QPushButton" name="selectFileButton">
<property name="text">
<string>Select file</string>
</property>
</widget>
</item>
<item row="3" column="10" colspan="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
......@@ -186,41 +255,60 @@
</property>
</spacer>
</item>
<item row="0" column="12">
<widget class="QPushButton" name="printButton">
<property name="text">
<string>Print</string>
<item row="3" column="12">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="2" column="12">
<widget class="QPushButton" name="saveCsvButton">
<item row="3" column="13">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Save CSV</string>
<string>Regression</string>
</property>
</widget>
</item>
<item row="2" column="9">
<widget class="QPushButton" name="selectFileButton">
<item row="3" column="14" colspan="2">
<widget class="QComboBox" name="xRegressionComboBox"/>
</item>
<item row="3" column="16" colspan="2">
<widget class="QComboBox" name="yRegressionComboBox"/>
</item>
<item row="3" column="19">
<widget class="QPushButton" name="regressionButton">
<property name="text">
<string>Select file</string>
<string>Calculate</string>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="QCheckBox" name="symmetricCheckBox">
<property name="text">
<string>Symmetric</string>
<item row="3" column="18">
<widget class="QLineEdit" name="regressionOutput">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="8">
<widget class="QCheckBox" name="legendCheckBox">
<item row="0" column="14">
<widget class="QPushButton" name="saveCsvButton">
<property name="text">
<string>Legend</string>
<string>Save Data</string>
</property>
</widget>
</item>
<item row="0" column="9" colspan="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
......
......@@ -2,9 +2,7 @@
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL/PIXHAWK PROJECT
<http://www.qgroundcontrol.org>
<http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#include "QGCPxImuFirmwareUpdate.h"
#include "ui_QGCPxImuFirmwareUpdate.h"
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Declaration of class QGCPxImuFirmwareUpdate
* @author Lorenz Meier <mail@qgroundcontrol.org>
*/
#ifndef QGCPXIMUFIRMWAREUPDATE_H
#define QGCPXIMUFIRMWAREUPDATE_H
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#include "QGCSensorSettingsWidget.h"
#include "ui_QGCSensorSettingsWidget.h"
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Declaration of class QGCSensorSettingsWidget
* @author Lorenz Meier <mail@qgroundcontrol.org>
*/
#ifndef QGCSENSORSETTINGSWIDGET_H
#define QGCSENSORSETTINGSWIDGET_H
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
Please see our website at <http://pixhawk.ethz.ch>
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
Please see our website at <http://pixhawk.ethz.ch>
QGroundControl Open Source Ground Control Station
(c) 2009 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......
......@@ -6,20 +6,20 @@
<rect>
<x>0</x>
<y>0</y>
<width>280</width>
<height>164</height>
<width>287</width>
<height>354</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>280</width>
<height>130</height>
<height>170</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout" rowminimumheight="5,10,10,0,10,5,0">
<layout class="QGridLayout" name="gridLayout" rowminimumheight="10,20,0,10,10,10,300">
<property name="leftMargin">
<number>6</number>
</property>
......@@ -60,7 +60,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
<height>2</height>
</size>
</property>
</spacer>
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of class XMLCommProtocolWidget
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#ifndef XMLCOMMPROTOCOLWIDGET_H
#define XMLCOMMPROTOCOLWIDGET_H
......
This diff is collapsed.
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Defition of class IncrementalPlot
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#ifndef INCREMENTALPLOT_H
#define INCREMENTALPLOT_H
......@@ -5,21 +35,25 @@
#include <qwt_array.h>
#include <qwt_plot.h>
#include <qwt_legend.h>
#include <qwt_plot_grid.h>
#include <QMap>
#include "ScrollZoomer.h"
class QwtPlotCurve;
/**
* @brief Plot data container for growing data
*/
class CurveData
{
// A container class for growing data
public:
CurveData();
void append(double *x, double *y, int count);
/** @brief The number of datasets held in the data structure */
int count() const;
/** @brief The reserved size of the data structure in units */
int size() const;
const double *x() const;
const double *y() const;
......@@ -32,44 +66,89 @@ private:
int d_timerCount;
};
/**
* @brief Incremental plotting widget
*
* This widget plots data incrementally when new data arrives.
* It will only repaint the minimum screen content necessary to avoid
* a too high CPU consumption. It auto-scales the plot to new data.
*/
class IncrementalPlot : public QwtPlot
{
Q_OBJECT
public:
/** @brief Create a new, empty incremental plot */
IncrementalPlot(QWidget *parent = NULL);
virtual ~IncrementalPlot();
/** @brief Get color map of this plot */
QList<QColor> getColorMap();
/** @brief Get next color of color map */
QColor getNextColor();
/** @brief Get color for curve id */
QColor getColorForCurve(QString id);
/** @brief Get the state of the grid */
bool gridEnabled();
/** @brief Read out data from a curve */
int data(QString key, double* r_x, double* r_y, int maxSize);
float symbolWidth;
float curveWidth;
float gridWidth;
float scaleWidth;
public slots:
/** @brief Append one data point */
void appendData(QString key, double x, double y);
void appendData(QString key, double *x, double *y, int size);
/** @brief Append multiple data points */
void appendData(QString key, double* x, double* y, int size);
/** @brief Reset the plot scaling to the default value */
void resetScaling();
/** @brief Update the plot scale based on current data/symmetric mode */
void updateScale();
/** @brief Remove all data from the plot and repaint */
void removeData();
/** @brief Show the plot legend */
void showLegend(bool show);
/** @brief Show the plot grid */
void showGrid(bool show);
/** @brief Set new plot style */
void setStyleText(QString style);
/** @brief Set symmetric axis scaling mode */
void setSymmetric(bool symmetric);
protected slots:
/** @brief Handle the click on a legend item */
void handleLegendClick(QwtPlotItem* item, bool on);
protected:
QList<QColor> colors;
int nextColor;
ScrollZoomer* zoomer;
QwtLegend* legend;
double xmin;
double xmax;
double ymin;
double ymax;
bool symmetric; ///< Enable symmetric plotting
QList<QColor> colors; ///< Colormap for curves
int nextColor; ///< Next index in color map
ScrollZoomer* zoomer; ///< Zoomer class for widget
QwtLegend* legend; ///< Plot legend
QwtPlotGrid* grid; ///< Plot grid
double xmin; ///< Minimum x value seen
double xmax; ///< Maximum x value seen
double ymin; ///< Minimum y value seen
double ymax; ///< Maximum y value seen
private:
QMap<QString, CurveData* > d_data;
QMap<QString, QwtPlotCurve* > d_curve;
QMap<QString, CurveData* > d_data; ///< Data points
QMap<QString, QwtPlotCurve* > d_curve; ///< Plot curves
};
#endif /* INCREMENTALPLOT_H */
......@@ -136,7 +136,7 @@ d_curve(NULL)
// Enable zooming
//zoomer = new Zoomer(canvas());
zoomer = new ScrollZoomer(canvas());
zoomer->setRubberBandPen(QPen(Qt::blue, 2, Qt::DotLine));
zoomer->setRubberBandPen(QPen(Qt::blue, 1.2, Qt::DotLine));
zoomer->setTrackerPen(QPen(Qt::blue));
// Start QTimer for plot update
......@@ -314,7 +314,7 @@ QColor LinechartPlot::getNextColor()
{
/* Return current color and increment counter for next round */
nextColor++;
if(nextColor >= colors.size()) nextColor = 0;
if(nextColor >= colors.count()) nextColor = 0;
return colors[nextColor++];
}
......@@ -762,15 +762,15 @@ void TimeSeriesData::append(quint64 ms, double value)
mean = mean / static_cast<double>(qMin(averageWindow,static_cast<unsigned int>(count)));
qSort(medianList);
if (medianList.size() > 2)
if (medianList.count() > 2)
{
if (medianList.size() % 2 == 0)
if (medianList.count() % 2 == 0)
{
median = (medianList.at(medianList.size()/2) + medianList.at(medianList.size()/2+1)) / 2.0;
median = (medianList.at(medianList.count()/2) + medianList.at(medianList.count()/2+1)) / 2.0;
}
else
{
median = medianList.at(medianList.size()/2+1);
median = medianList.at(medianList.count()/2+1);
}
}
......
......@@ -214,7 +214,7 @@ public:
static const int SCALE_LOGARITHMIC = 2;
static const int DEFAULT_REFRESH_RATE = 40; ///< The default refresh rate is 25 Hz / every 100 ms
static const int DEFAULT_PLOT_INTERVAL = 1000 * 10; ///< The default plot interval is 10 seconds
static const int DEFAULT_PLOT_INTERVAL = 1000 * 15; ///< The default plot interval is 15 seconds
static const int DEFAULT_SCALE_INTERVAL = 1000 * 5;
public slots:
......
......@@ -141,8 +141,9 @@ void LinechartWidget::createLayout()
// Averaging spin box
averageSpinBox = new QSpinBox(this);
averageSpinBox->setValue(2);
averageSpinBox->setValue(200);
averageSpinBox->setMinimum(2);
averageSpinBox->setMaximum(9999);
layout->addWidget(averageSpinBox, 1, 2);
layout->setColumnStretch(2, 0);
connect(averageSpinBox, SIGNAL(valueChanged(int)), this, SLOT(setAverageWindow(int)));
......@@ -306,6 +307,8 @@ void LinechartWidget::stopLogging()
logFile->close();
// Postprocess log file
compressor = new LogCompressor(logFile->fileName());
connect(compressor, SIGNAL(finishedFile(QString)), this, SIGNAL(logfileWritten(QString)));
compressor->startCompression();
}
logButton->setText(tr("Start logging"));
disconnect(logButton, SIGNAL(clicked()), this, SLOT(stopLogging()));
......
......@@ -163,6 +163,9 @@ signals:
void plotWindowPositionUpdated(quint64 position);
void plotWindowPositionUpdated(int position);
/** @brief This signal is emitted once a logfile has been finished writing */
void logfileWritten(QString fileName);
};
#endif // LINECHARTWIDGET_H
......@@ -55,6 +55,7 @@ void Linecharts::addSystem(UASInterface* uas)
addWidget(widget);
plots.insert(uas->getUASID(), widget);
connect(uas, SIGNAL(valueChanged(int,QString,double,quint64)), widget, SLOT(appendData(int,QString,double,quint64)));
connect(widget, SIGNAL(logfileWritten(QString)), this, SIGNAL(logfileWritten(QString)));
// Set system active if this is the only system
if (active)
{
......
......@@ -14,6 +14,8 @@ public:
explicit Linecharts(QWidget *parent = 0);
signals:
/** @brief This signal is emitted once a logfile has been finished writing */
void logfileWritten(QString fileName);
public slots:
/** @brief Set all plots active/inactive */
......
#include "MAV2DIcon.h"
#include <QPainter>
MAV2DIcon::MAV2DIcon(QGraphicsItem* parent) :
QGC2DIcon(parent)
{
}
/**
* @return the bounding rectangle of the icon
*/
QRectF MAV2DIcon::boundingRect() const
{
qreal penWidth = 1;
return QRectF(-10 - penWidth / 2, -10 - penWidth / 2,
20 + penWidth, 20 + penWidth);
}
/**
* @param painter QPainter to draw with
* @param option Visual style
* @param widget Parent widget
*/
void MAV2DIcon::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
{
painter->drawRoundedRect(-10, -10, 20, 20, 5, 5);
}
#ifndef MAV2DICON_H
#define MAV2DICON_H
#include "QGC2DIcon.h"
class MAV2DIcon : public QGC2DIcon
{
public:
explicit MAV2DIcon(QGraphicsItem* parent = 0);
QRectF boundingRect() const;
void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*);
};
#endif // MAV2DICON_H
#include "QGC2DIcon.h"
QGC2DIcon::QGC2DIcon(QPointF localOriginInGlobalCoords, bool onlyLocal, QGraphicsItem* parent) :
QGraphicsItem(parent),
localOriginInGlobalCoords(localOriginInGlobalCoords),
local(onlyLocal)
{
}
QGC2DIcon::QGC2DIcon(bool onlyLocal, QGraphicsItem* parent) :
QGraphicsItem(parent),
localOriginInGlobalCoords(QPointF(0, 0)),
local(onlyLocal)
{
}
QGC2DIcon::QGC2DIcon(QGraphicsItem* parent) :
QGraphicsItem(parent),
localOriginInGlobalCoords(QPointF(0, 0)),
local(false)
{
}
QGC2DIcon::~QGC2DIcon()
{
}
QPointF QGC2DIcon::getGlobalPosition()
{
}
QPointF QGC2DIcon::getLocalPosition()
{
}
void QGC2DIcon::setGlobalPosition(QPointF pos)
{
}
void QGC2DIcon::setLocalPosition(QPointF pos)
{
}
void QGC2DIcon::setLocalPosition(float x, float y)
{
}
bool QGC2DIcon::isLocal()
{
return local;
}
#ifndef QGC2DICON_H
#define QGC2DICON_H
#include <QGraphicsItem>
#include <QPointF>
class QGC2DIcon : public QGraphicsItem
{
public:
QGC2DIcon(QPointF localOriginInGlobalCoords, bool onlyLocal=false, QGraphicsItem* parent = 0);
QGC2DIcon(bool onlyLocal=false, QGraphicsItem* parent = 0);
explicit QGC2DIcon(QGraphicsItem* parent = 0);
~QGC2DIcon();
QPointF getGlobalPosition();
QPointF getLocalPosition();
void setGlobalPosition(QPointF pos);
void setLocalPosition(QPointF pos);
void setLocalPosition(float x, float y);
bool isLocal();
virtual QRectF boundingRect() const = 0;
virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) = 0;
signals:
public slots:
protected:
QPointF localOriginInGlobalCoords;
QPointF globalPosition;
QPointF localPosition;
bool local;
};
#endif // QGC2DICON_H
#include "Waypoint2DIcon.h"
#include <QPainter>
#include <QDebug>
Waypoint2DIcon::Waypoint2DIcon(QGraphicsItem* parent) :
QGC2DIcon(parent)
{
}
/**
* @return the bounding rectangle of the icon
*/
QRectF Waypoint2DIcon::boundingRect() const
{
qreal penWidth = 1;
return QRectF(-10 - penWidth / 2, -10 - penWidth / 2,
20 + penWidth, 20 + penWidth);
}
/**
* @param painter QPainter to draw with
* @param option Visual style
* @param widget Parent widget
*/
void Waypoint2DIcon::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
{
qDebug() << __FILE__ << __LINE__ << "DRAWING";
painter->setPen(QPen(Qt::red));
painter->drawRoundedRect(-10, -10, 20, 20, 5, 5);
}
#ifndef WAYPOINT2DICON_H
#define WAYPOINT2DICON_H
#include <QGraphicsItem>
#include "QGC2DIcon.h"
class Waypoint2DIcon : public QGC2DIcon
{
public:
explicit Waypoint2DIcon(QGraphicsItem* parent = 0);
QRectF boundingRect() const;
void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*);
};
#endif // WAYPOINT2DICON_H
......@@ -35,6 +35,7 @@ This file is part of the PIXHAWK project
#include <QFileDialog>
#include <QDebug>
#include <QProcess>
#include <QPalette>
#include <MG.h>
#include "UASControlWidget.h"
......@@ -59,8 +60,8 @@ This file is part of the PIXHAWK project
#define CONTROL_MODE_TEST3_INDEX 8
UASControlWidget::UASControlWidget(QWidget *parent) : QWidget(parent),
uas(NULL),
engineOn(false)
uas(0),
engineOn(false)
{
ui.setupUi(this);
......@@ -74,45 +75,66 @@ UASControlWidget::UASControlWidget(QWidget *parent) : QWidget(parent),
ui.modeComboBox->insertItem(CONTROL_MODE_TEST1_INDEX, CONTROL_MODE_TEST1);
ui.modeComboBox->insertItem(CONTROL_MODE_TEST2_INDEX, CONTROL_MODE_TEST2);
ui.modeComboBox->insertItem(CONTROL_MODE_TEST3_INDEX, CONTROL_MODE_TEST3);
connect(ui.modeComboBox, SIGNAL(activated(int)), this, SLOT(setMode(int)));
connect(ui.setModeButton, SIGNAL(clicked()), this, SLOT(transmitMode()));
ui.modeComboBox->setCurrentIndex(0);
}
void UASControlWidget::setUAS(UASInterface* uas)
{
if (this->uas != NULL)
if (this->uas != 0)
{
disconnect(ui.controlButton, SIGNAL(clicked()), uas, SLOT(enable_motors()));
disconnect(ui.liftoffButton, SIGNAL(clicked()), uas, SLOT(launch()));
disconnect(ui.landButton, SIGNAL(clicked()), uas, SLOT(home()));
disconnect(ui.shutdownButton, SIGNAL(clicked()), uas, SLOT(shutdown()));
disconnect(ui.modeComboBox, SIGNAL(activated(int)), this, SLOT(setMode(int)));
disconnect(ui.setModeButton, SIGNAL(clicked()), this, SLOT(transmitMode()));
UASInterface* oldUAS = UASManager::instance()->getUASForId(this->uas);
disconnect(ui.controlButton, SIGNAL(clicked()), oldUAS, SLOT(enable_motors()));
disconnect(ui.liftoffButton, SIGNAL(clicked()), oldUAS, SLOT(launch()));
disconnect(ui.landButton, SIGNAL(clicked()), oldUAS, SLOT(home()));
disconnect(ui.shutdownButton, SIGNAL(clicked()), oldUAS, SLOT(shutdown()));
disconnect(uas, SIGNAL(modeChanged(int,QString,QString)), this, SLOT(updateMode(int,QString,QString)));
disconnect(uas, SIGNAL(statusChanged(int)), this, SLOT(updateState(int)));
}
else
{
// Connect user interface controls
connect(ui.controlButton, SIGNAL(clicked()), this, SLOT(cycleContextButton()));
connect(ui.liftoffButton, SIGNAL(clicked()), uas, SLOT(launch()));
connect(ui.landButton, SIGNAL(clicked()), uas, SLOT(home()));
connect(ui.shutdownButton, SIGNAL(clicked()), uas, SLOT(shutdown()));
connect(ui.modeComboBox, SIGNAL(activated(int)), this, SLOT(setMode(int)));
connect(ui.setModeButton, SIGNAL(clicked()), this, SLOT(transmitMode()));
ui.modeComboBox->insertItem(0, "Select..");
ui.controlStatusLabel->setText(tr("Connected to ") + uas->getUASName());
// Connect user interface controls
connect(ui.controlButton, SIGNAL(clicked()), this, SLOT(cycleContextButton()));
connect(ui.liftoffButton, SIGNAL(clicked()), uas, SLOT(launch()));
connect(ui.landButton, SIGNAL(clicked()), uas, SLOT(home()));
connect(ui.shutdownButton, SIGNAL(clicked()), uas, SLOT(shutdown()));
connect(uas, SIGNAL(modeChanged(int,QString,QString)), this, SLOT(updateMode(int,QString,QString)));
connect(uas, SIGNAL(statusChanged(int)), this, SLOT(updateState(int)));
connect(uas, SIGNAL(modeChanged(int,QString,QString)), this, SLOT(updateMode(int,QString,QString)));
connect(uas, SIGNAL(statusChanged(int)), this, SLOT(updateState(int)));
ui.controlStatusLabel->setText(tr("Connected to ") + uas->getUASName());
this->uas = uas;
}
this->uas = uas->getUASID();
setBackgroundColor(uas->getColor());
}
UASControlWidget::~UASControlWidget() {
UASControlWidget::~UASControlWidget()
{
}
/**
* Set the background color based on the MAV color. If the MAV is selected as the
* currently actively controlled system, the frame color is highlighted
*/
void UASControlWidget::setBackgroundColor(QColor color)
{
// UAS color
QColor uasColor = color;
QString colorstyle;
QString borderColor = "#4A4A4F";
borderColor = "#FA4A4F";
uasColor = uasColor.darker(900);
colorstyle = colorstyle.sprintf("QLabel { border-radius: 3px; padding: 0px; margin: 0px; background-color: #%02X%02X%02X; border: 0px solid %s; }",
uasColor.red(), uasColor.green(), uasColor.blue(), borderColor.toStdString().c_str());
setStyleSheet(colorstyle);
QPalette palette = this->palette();
palette.setBrush(QPalette::Window, QBrush(uasColor));
setPalette(palette);
setAutoFillBackground(true);
}
void UASControlWidget::updateMode(int uas,QString mode,QString description)
{
Q_UNUSED(uas);
......@@ -187,14 +209,14 @@ void UASControlWidget::transmitMode()
{
if (uasMode != 0)
{
this->uas->setMode(uasMode);
ui.lastActionLabel->setText(QString("Set new mode for system %1").arg(uas->getUASName()));
UASManager::instance()->getUASForId(this->uas)->setMode(uasMode);
ui.lastActionLabel->setText(QString("Set new mode for system %1").arg(UASManager::instance()->getUASForId(uas)->getUASName()));
}
}
void UASControlWidget::cycleContextButton()
{
UAS* mav = dynamic_cast<UAS*>(this->uas);
UAS* mav = dynamic_cast<UAS*>(UASManager::instance()->getUASForId(this->uas));
if (mav)
{
......@@ -202,16 +224,16 @@ void UASControlWidget::cycleContextButton()
{
ui.controlButton->setText(tr("Stop Engine"));
mav->enable_motors();
ui.lastActionLabel->setText(QString("Attempted to enable motors on %1").arg(uas->getUASName()));
ui.lastActionLabel->setText(QString("Attempted to enable motors on %1").arg(mav->getUASName()));
}
else
{
ui.controlButton->setText(tr("Activate Engine"));
mav->disable_motors();
ui.lastActionLabel->setText(QString("Attempted to disable motors on %1").arg(uas->getUASName()));
ui.lastActionLabel->setText(QString("Attempted to disable motors on %1").arg(mav->getUASName()));
}
//ui.controlButton->setText(tr("Force Landing"));
//ui.controlButton->setText(tr("KILL VEHICLE"));
//ui.controlButton->setText(tr("Force Landing"));
//ui.controlButton->setText(tr("KILL VEHICLE"));
}
}
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of widget controlling one MAV
* @brief Definition of class UASControlWidget
*
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
......@@ -39,7 +39,11 @@ This file is part of the PIXHAWK project
#include <ui_UASControl.h>
#include <UASInterface.h>
class UASControlWidget : public QWidget {
/**
* @brief Widget controlling one MAV
*/
class UASControlWidget : public QWidget
{
Q_OBJECT
public:
......@@ -60,10 +64,14 @@ public slots:
/** @brief Update state */
void updateState(int state);
protected slots:
/** @brief Set the background color for the widget */
void setBackgroundColor(QColor color);
protected:
UASInterface* uas;
unsigned int uasMode;
bool engineOn;
int uas; ///< Reference to the current uas
unsigned int uasMode; ///< Current uas mode
bool engineOn; ///< Engine state
private:
Ui::uasControl ui;
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
(c) 2009 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
This file is part of the PIXHAWK project
PIXHAWK is free software: you can redistribute it and/or modify
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......
......@@ -78,6 +78,7 @@ UASView::UASView(UASInterface* uas, QWidget *parent) :
connect(uas, SIGNAL(waypointSelected(int,int)), this, SLOT(selectWaypoint(int,int)));
connect(&(uas->getWaypointManager()), SIGNAL(currentWaypointChanged(quint16)), this, SLOT(currentWaypointUpdated(quint16)));
connect(uas, SIGNAL(systemTypeSet(UASInterface*,uint)), this, SLOT(setSystemType(UASInterface*,uint)));
connect(UASManager::instance(), SIGNAL(activeUASStatusChanged(UASInterface*,bool)), this, SLOT(updateActiveUAS(UASInterface*,bool)));
// Setup UAS selection
connect(m_ui->uasViewFrame, SIGNAL(clicked(bool)), this, SLOT(setUASasActive(bool)));
......@@ -108,7 +109,7 @@ UASView::UASView(UASInterface* uas, QWidget *parent) :
// Heartbeat fade
refreshTimer = new QTimer(this);
connect(refreshTimer, SIGNAL(timeout()), this, SLOT(refresh()));
refreshTimer->start(100);
refreshTimer->start(180);
}
UASView::~UASView()
......@@ -142,9 +143,19 @@ void UASView::setBackgroundColor()
void UASView::setUASasActive(bool active)
{
UASManager::instance()->setActiveUAS(this->uas);
this->isActive = active;
setBackgroundColor();
if (active)
{
UASManager::instance()->setActiveUAS(this->uas);
}
}
void UASView::updateActiveUAS(UASInterface* uas, bool active)
{
if (uas == this->uas)
{
this->isActive = active;
setBackgroundColor();
}
}
void UASView::updateMode(int sysId, QString status, QString description)
......
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
QGroundControl Open Source Ground Control Station
(c) 2009 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the PIXHAWK project
This file is part of the QGROUNDCONTROL project
PIXHAWK is free software: you can redistribute it and/or modify
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
......@@ -42,7 +42,8 @@ namespace Ui {
class UASView;
}
class UASView : public QWidget {
class UASView : public QWidget
{
Q_OBJECT
public:
UASView(UASInterface* uas, QWidget *parent = 0);
......@@ -71,6 +72,8 @@ public slots:
void setSystemType(UASInterface* uas, unsigned int systemType);
/** @brief Set the current UAS as the globally active system */
void setUASasActive(bool);
/** @brief Update the view if an UAS has been set to active */
void updateActiveUAS(UASInterface* uas, bool active);
/** @brief Set the background color for the widget */
void setBackgroundColor();
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Implementation of class WatchdogControl
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#include "WatchdogControl.h"
#include "WatchdogView.h"
#include "WatchdogProcessView.h"
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of class WatchdogControl
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#ifndef WATCHDOGCONTROL_H
#define WATCHDOGCONTROL_H
......@@ -19,6 +49,9 @@ namespace Ui {
class WatchdogControl;
}
/**
* @brief Overall widget for controlling all watchdogs of all connected MAVs
*/
class WatchdogControl : public QWidget {
Q_OBJECT
public:
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Implementation of class WatchdogControl
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#include "WatchdogProcessView.h"
#include "ui_WatchdogProcessView.h"
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of class WatchdogProcessView
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#ifndef WATCHDOGPROCESSVIEW_H
#define WATCHDOGPROCESSVIEW_H
......@@ -8,6 +38,9 @@ namespace Ui {
class WatchdogProcessView;
}
/**
* @brief Represents one process monitored by the linux onboard watchdog
*/
class WatchdogProcessView : public QWidget {
Q_OBJECT
public:
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Implementation of class WatchdogControl
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#include "WatchdogView.h"
#include "ui_WatchdogView.h"
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of class WatchdogView
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#ifndef WATCHDOGVIEW_H
#define WATCHDOGVIEW_H
......@@ -7,6 +37,9 @@ namespace Ui {
class WatchdogView;
}
/**
* @brief Represents one onboard watchdog
*/
class WatchdogView : public QWidget {
Q_OBJECT
public:
......
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