Browse Source
These use OpenGL implementation which prevented moving to ANGLE support. Since they are rarely used they are being remove instead of being upgrade.QGC4.4
12 changed files with 0 additions and 5369 deletions
@ -1,207 +0,0 @@
@@ -1,207 +0,0 @@
|
||||
/*=====================================================================
|
||||
|
||||
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 Head Down Display (HDD) |
||||
* |
||||
* @author Lorenz Meier <mavteam@student.ethz.ch> |
||||
* |
||||
*/ |
||||
|
||||
#ifndef HDDISPLAY_H |
||||
#define HDDISPLAY_H |
||||
|
||||
#include <QGraphicsView> |
||||
#include <QColor> |
||||
#include <QTimer> |
||||
#include <QFontDatabase> |
||||
#include <QMap> |
||||
#include <QContextMenuEvent> |
||||
#include <QPair> |
||||
#include <cmath> |
||||
|
||||
#include "UASInterface.h" |
||||
#include "Vehicle.h" |
||||
|
||||
namespace Ui |
||||
{ |
||||
class HDDisplay; |
||||
} |
||||
|
||||
/**
|
||||
* @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(const QStringList& plotList, QString title="", QWidget *parent = 0); |
||||
~HDDisplay(); |
||||
|
||||
public slots: |
||||
/** @brief Update the HDD with new data */ |
||||
void updateValue(const int uasId, const QString& name, const QString& unit, const QVariant &value, const quint64 msec); |
||||
|
||||
/** @brief Connects a source to the updateValue() signals */ |
||||
void addSource(QObject* obj); |
||||
/** @brief Disconnects a source to the updateValue() signals */ |
||||
void removeSource(QObject* obj); |
||||
|
||||
/** @brief Removes a plot item by the action data */ |
||||
void removeItemByAction(); |
||||
/** @brief Bring up the menu to add a gauge */ |
||||
void addGauge(); |
||||
/** @brief Add a gauge using this spec string */ |
||||
void addGauge(const QString& gauge); |
||||
/** @brief Set the title of this widget and any existing parent dock widget */ |
||||
void setTitle(); |
||||
/** @brief Set the number of colums via popup */ |
||||
void setColumns(); |
||||
/** @brief Set the number of colums */ |
||||
void setColumns(int cols); |
||||
/** @brief Save the current layout and state to disk */ |
||||
void saveState(); |
||||
/** @brief Restore the last layout and state from disk */ |
||||
void restoreState(); |
||||
|
||||
protected slots: |
||||
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(); |
||||
/** @brief Adjust the size hint for the current gauge layout */ |
||||
void adjustGaugeAspectRatio(); |
||||
|
||||
protected: |
||||
QSize sizeHint() const; |
||||
void changeEvent(QEvent* e); |
||||
void paintEvent(QPaintEvent* event); |
||||
void showEvent(QShowEvent* event); |
||||
void hideEvent(QHideEvent* event); |
||||
void contextMenuEvent(QContextMenuEvent* event); |
||||
QList<QAction*> getItemRemoveActions(); |
||||
void createActions(); |
||||
float refLineWidthToPen(float line); |
||||
float refToScreenX(float x); |
||||
float refToScreenY(float y); |
||||
float screenToRefX(float x); |
||||
float screenToRefY(float y); |
||||
void rotatePolygonClockWiseRad(QPolygonF& p, float angle, QPointF origin); |
||||
void drawPolygon(QPolygonF refPolygon, QPainter* painter); |
||||
void drawLine(float refX1, float refY1, float refX2, float refY2, float width, const QColor& color, QPainter* painter); |
||||
void drawEllipse(float refX, float refY, float radiusX, float radiusY, float lineWidth, const QColor& color, QPainter* painter); |
||||
void drawCircle(float refX, float refY, float radius, float lineWidth, const QColor& color, QPainter* painter); |
||||
|
||||
void drawChangeRateStrip(float xRef, float yRef, float height, float minRate, float maxRate, float value, QPainter* painter); |
||||
void drawChangeIndicatorGauge(float xRef, float yRef, float radius, float expectedMaxChange, float value, const QColor& color, QPainter* painter, bool solid=true); |
||||
void drawGauge(float xRef, float yRef, float radius, float min, float max, const QString name, float value, const QColor& color, QPainter* painter, bool symmetric, QPair<float, float> goodRange, QPair<float, float> criticalRange, bool solid=true); |
||||
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, double> values; ///< The variables this HUD displays
|
||||
QMap<QString, QString> units; ///< The units
|
||||
QMap<QString, float> valuesDot; ///< First derivative of the variable
|
||||
QMap<QString, float> valuesMean; ///< Mean since system startup for this variable
|
||||
QMap<QString, int> valuesCount; ///< Number of values received so far
|
||||
QMap<QString, quint64> lastUpdate; ///< The last update time for this variable
|
||||
QMap<QString, float> minValues; ///< The minimum value this variable is assumed to have
|
||||
QMap<QString, float> maxValues; ///< The maximum value this variable is assumed to have
|
||||
QMap<QString, bool> symmetric; ///< Draw the gauge / dial symmetric bool = yes
|
||||
QMap<QString, bool> intValues; ///< Is the gauge value an integer?
|
||||
QMap<QString, QString> customNames; ///< Custom names for the data names
|
||||
QMap<QString, QPair<float, float> > goodRanges; ///< The range of good values
|
||||
QMap<QString, QPair<float, float> > critRanges; ///< The range of critical values
|
||||
double scalingFactor; ///< Factor used to scale all absolute values to screen coordinates
|
||||
float xCenterOffset, yCenterOffset; ///< Offset from center of window in mm coordinates
|
||||
float vwidth; ///< Virtual width of this window, 200 mm per default. This allows to hardcode positions and aspect ratios. This virtual image plane is then scaled to the window size.
|
||||
float vheight; ///< Virtual height of this window, 150 mm per default
|
||||
|
||||
int xCenter; ///< Center of the HUD instrument in pixel coordinates. Allows to off-center the whole instrument in its OpenGL window, e.g. to fit another instrument
|
||||
int yCenter; ///< Center of the HUD instrument in pixel coordinates. Allows to off-center the whole instrument in its OpenGL window, e.g. to fit another instrument
|
||||
|
||||
// HUD colors
|
||||
QColor backgroundColor; ///< Background color
|
||||
QColor defaultColor; ///< Color for most HUD elements, e.g. pitch lines, center cross, change rate gauges
|
||||
QColor setPointColor; ///< Color for the current control set point, e.g. yaw desired
|
||||
QColor warningColor; ///< Color for warning messages
|
||||
QColor criticalColor; ///< Color for caution messages
|
||||
QColor infoColor; ///< Color for normal/default messages
|
||||
QColor fuelColor; ///< Current color for the fuel message, can be info, warning or critical color
|
||||
|
||||
// Blink rates
|
||||
int warningBlinkRate; ///< Blink rate of warning messages, will be rounded to the refresh rate
|
||||
|
||||
QTimer* refreshTimer; ///< The main timer, controls the update rate
|
||||
static const int updateInterval = 300; ///< Update interval in milliseconds
|
||||
QPainter* hudPainter; |
||||
QFont font; ///< The HUD font, per default the free Bitstream Vera SANS, which is very close to actual HUD fonts
|
||||
QFontDatabase fontDatabase;///< Font database, only used to load the TrueType font file (the HUD font is directly loaded from file rather than from the system)
|
||||
bool hardwareAcceleration; ///< Enable hardware acceleration
|
||||
|
||||
float strongStrokeWidth; ///< Strong line stroke width, used throughout the HUD
|
||||
float normalStrokeWidth; ///< Normal line stroke width, used throughout the HUD
|
||||
float fineStrokeWidth; ///< Fine line stroke width, used throughout the HUD
|
||||
|
||||
QStringList* acceptList; ///< Variable names to plot
|
||||
QStringList* acceptUnitList; ///< Unit names to plot
|
||||
|
||||
quint64 lastPaintTime; ///< Last time this widget was refreshed
|
||||
int columns; ///< Number of instrument columns
|
||||
|
||||
QAction* addGaugeAction; ///< Action adding a gauge
|
||||
QAction* setTitleAction; ///< Action setting the title
|
||||
QAction* setColumnsAction; ///< Action setting the number of columns
|
||||
bool valuesChanged; |
||||
|
||||
private slots: |
||||
void _activeVehicleChanged(Vehicle* vehicle); |
||||
|
||||
private: |
||||
Ui::HDDisplay *m_ui; |
||||
}; |
||||
|
||||
#endif // HDDISPLAY_H
|
@ -1,27 +0,0 @@
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<ui version="4.0"> |
||||
<class>HDDisplay</class> |
||||
<widget class="QWidget" name="HDDisplay"> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>400</width> |
||||
<height>300</height> |
||||
</rect> |
||||
</property> |
||||
<property name="windowTitle"> |
||||
<string>Form</string> |
||||
</property> |
||||
<layout class="QHBoxLayout" name="horizontalLayout"> |
||||
<property name="margin"> |
||||
<number>0</number> |
||||
</property> |
||||
<item> |
||||
<widget class="QGraphicsView" name="view"/> |
||||
</item> |
||||
</layout> |
||||
</widget> |
||||
<resources/> |
||||
<connections/> |
||||
</ui> |
@ -1,429 +0,0 @@
@@ -1,429 +0,0 @@
|
||||
/*=====================================================================
|
||||
|
||||
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 of Horizontal Situation Indicator class |
||||
* |
||||
* @author Lorenz Meier <mavteam@student.ethz.ch> |
||||
* |
||||
*/ |
||||
|
||||
#ifndef HSIDISPLAY_H |
||||
#define HSIDISPLAY_H |
||||
|
||||
#include <QWidget> |
||||
#include <QColor> |
||||
#include <QTimer> |
||||
#include <QMap> |
||||
#include <QPair> |
||||
#include <QMouseEvent> |
||||
#include <cmath> |
||||
|
||||
#include "HDDisplay.h" |
||||
#include "MG.h" |
||||
#include "Vehicle.h" |
||||
|
||||
class HSIDisplay : public HDDisplay |
||||
{ |
||||
Q_OBJECT |
||||
public: |
||||
HSIDisplay(QWidget *parent = 0); |
||||
~HSIDisplay(); |
||||
|
||||
public slots: |
||||
/** @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*, float rollDesired, float pitchDesired, float yawDesired, float thrustDesired, quint64 usec); |
||||
void updateAttitude(UASInterface* uas, double roll, double pitch, double yaw, quint64 time); |
||||
void updateUserPositionSetpoints(int uasid, float xDesired, float yDesired, float zDesired, float yawDesired); |
||||
void updatePositionSetpoints(int uasid, float xDesired, float yDesired, float zDesired, float yawDesired, quint64 usec); |
||||
void updateLocalPosition(UASInterface*, double x, double y, double z, quint64 usec); |
||||
void updateGlobalPosition(UASInterface*, double lat, double lon, double altAMSL, double altWGS84, quint64 usec); |
||||
void updateSpeed(UASInterface* uas, double vx, double vy, double vz, quint64 time); |
||||
void UpdateNavErrors(UASInterface *uas, double altitudeError, double airspeedError, double crosstrackError); |
||||
void updatePositionLock(UASInterface* uas, bool lock); |
||||
void updateAttitudeControllerEnabled(bool enabled); |
||||
void updatePositionXYControllerEnabled(bool enabled); |
||||
void updatePositionZControllerEnabled(bool enabled); |
||||
|
||||
/** @brief Optical flow status changed */ |
||||
void updateOpticalFlowStatus(bool supported, bool enabled, bool ok) { |
||||
if (supported && enabled && ok) { |
||||
visionFix = true; |
||||
} else { |
||||
visionFix = false; |
||||
} |
||||
} |
||||
|
||||
/** @brief Vision based localization status changed */ |
||||
void updateVisionLocalizationStatus(bool supported, bool enabled, bool ok) { |
||||
if (enabled && ok) { |
||||
visionFix = true; |
||||
} else { |
||||
visionFix = false; |
||||
} |
||||
visionFixKnown = supported; |
||||
} |
||||
/** @brief Infrared / Ultrasound status changed */ |
||||
void updateDistanceSensorStatus(bool supported, bool enabled, bool ok) { |
||||
if (enabled && ok) { |
||||
iruFix = true; |
||||
} else { |
||||
iruFix = false; |
||||
} |
||||
iruFixKnown = supported; |
||||
} |
||||
/** @brief Gyroscope status changed */ |
||||
void updateGyroStatus(bool supported, bool enabled, bool ok) { |
||||
gyroKnown = supported; |
||||
gyroON = enabled; |
||||
gyroOK = ok; |
||||
} |
||||
/** @brief Accelerometer status changed */ |
||||
void updateAccelStatus(bool supported, bool enabled, bool ok) { |
||||
accelKnown = supported; |
||||
accelON = enabled; |
||||
accelOK = ok; |
||||
} |
||||
/** @brief Magnetometer status changed */ |
||||
void updateMagSensorStatus(bool supported, bool enabled, bool ok) { |
||||
magKnown = supported; |
||||
magON = enabled; |
||||
magOK = ok; |
||||
} |
||||
/** @brief Barometer status changed */ |
||||
void updateBaroStatus(bool supported, bool enabled, bool ok) { |
||||
pressureKnown = supported; |
||||
pressureON = enabled; |
||||
pressureOK = ok; |
||||
} |
||||
/** @brief Differential pressure / airspeed status changed */ |
||||
void updateAirspeedStatus(bool supported, bool enabled, bool ok) { |
||||
diffPressureKnown = supported; |
||||
diffPressureON = enabled; |
||||
diffPressureOK = ok; |
||||
} |
||||
/** @brief Actuator status changed */ |
||||
void updateActuatorStatus(bool supported, bool enabled, bool ok) { |
||||
actuatorsKnown = supported; |
||||
actuatorsON = enabled; |
||||
actuatorsOK = ok; |
||||
} |
||||
/** @brief Laser scanner status changed */ |
||||
void updateLaserStatus(bool supported, bool enabled, bool ok) { |
||||
laserKnown = supported; |
||||
laserON = enabled; |
||||
laserOK = ok; |
||||
} |
||||
/** @brief Vicon / Leica Geotracker status changed */ |
||||
void updateGroundTruthSensorStatus(bool supported, bool enabled, bool ok) { |
||||
viconKnown = supported; |
||||
viconON = enabled; |
||||
viconOK = ok; |
||||
} |
||||
|
||||
void updateObjectPosition(unsigned int time, int id, int type, const QString& name, int quality, float bearing, float distance); |
||||
/** @brief Heading control enabled/disabled */ |
||||
void updatePositionYawControllerEnabled(bool enabled); |
||||
|
||||
/** @brief Localization quality changed */ |
||||
void updateLocalization(UASInterface* uas, int localization); |
||||
/** @brief GPS localization quality changed */ |
||||
void updateGpsLocalization(UASInterface* uas, int localization); |
||||
/** @brief Vision localization quality changed */ |
||||
void updateVisionLocalization(UASInterface* uas, int localization); |
||||
|
||||
/** @brief Ultrasound/Infrared localization changed */ |
||||
void updateInfraredUltrasoundLocalization(UASInterface* uas, int fix); |
||||
|
||||
/** @brief Repaint the widget */ |
||||
void paintEvent(QPaintEvent * event); |
||||
/** @brief Update state from joystick */ |
||||
void updateJoystick(double roll, double pitch, double yaw, double thrust, int xHat, int yHat); |
||||
void pressKey(int key); |
||||
/** @brief Reset the state of the view */ |
||||
void resetMAVState(); |
||||
/** @brief Clear the status message */ |
||||
void clearStatusMessage() |
||||
{ |
||||
statusMessage = ""; |
||||
if (actionPending) statusMessage = "TIMED OUT, NO ACTION"; |
||||
statusClearTimer.start(); |
||||
userSetPointSet = false; |
||||
actionPending = false; |
||||
} |
||||
|
||||
signals: |
||||
void metricWidthChanged(double width); |
||||
|
||||
protected slots: |
||||
void renderOverlay(); |
||||
void drawGPS(QPainter &painter); |
||||
void drawObjects(QPainter &painter); |
||||
void drawPositionDirection(float xRef, float yRef, float radius, const QColor& color, QPainter* painter); |
||||
void drawAttitudeDirection(float xRef, float yRef, float radius, const QColor& color, QPainter* painter); |
||||
void drawAltitudeSetpoint(float xRef, float yRef, float radius, const QColor& color, QPainter* painter); |
||||
/** @brief Draw a status flag indicator */ |
||||
void drawStatusFlag(float x, float y, QString label, bool status, bool known, QPainter& painter); |
||||
void drawStatusFlag(float x, float y, QString label, bool status, bool known, bool ok, QPainter& painter); |
||||
/** @brief Draw a position lock indicator */ |
||||
void drawPositionLock(float x, float y, QString label, int status, bool known, QPainter& painter); |
||||
void setBodySetpointCoordinateXY(double x, double y); |
||||
void setBodySetpointCoordinateYaw(double yaw); |
||||
void setBodySetpointCoordinateZ(double z); |
||||
/** @brief Send the current ui setpoint coordinates as new setpoint to the MAV */ |
||||
void sendBodySetPointCoordinates(); |
||||
/** @brief Draw one setpoint */ |
||||
void drawSetpointXYZYaw(float x, float y, float z, float yaw, const QColor &color, QPainter &painter); |
||||
/** @brief Draw waypoints of this system */ |
||||
void drawWaypoints(QPainter& painter); |
||||
/** @brief Draw one waypoint */ |
||||
void drawWaypoint(QPainter& painter, const QColor& color, float width, const MissionItem *w, const QPointF& p); |
||||
/** @brief Draw the limiting safety area */ |
||||
void drawSafetyArea(const QPointF &topLeft, const QPointF &bottomRight, const QColor &color, QPainter &painter); |
||||
/** @brief Receive mouse clicks */ |
||||
void mouseDoubleClickEvent(QMouseEvent* event); |
||||
void mousePressEvent(QMouseEvent * event); |
||||
void mouseReleaseEvent(QMouseEvent * event); |
||||
void mouseMoveEvent(QMouseEvent * event); |
||||
/** @brief Receive mouse wheel events */ |
||||
void wheelEvent(QWheelEvent* event); |
||||
/** @brief Read out send keys */ |
||||
void keyPressEvent(QKeyEvent* event); |
||||
/** @brief Ignore context menu event */ |
||||
void contextMenuEvent (QContextMenuEvent* event); |
||||
/** @brief Set status message on screen */ |
||||
void setStatusMessage(const QString& message) |
||||
{ |
||||
statusMessage = message; |
||||
statusClearTimer.start(); |
||||
} |
||||
|
||||
protected: |
||||
|
||||
void showEvent(QShowEvent* event); |
||||
void hideEvent(QHideEvent* event); |
||||
/** @brief Get color from GPS signal-to-noise colormap */ |
||||
static QColor getColorForSNR(float snr); |
||||
/** @brief Metric world coordinates to metric body coordinates */ |
||||
QPointF metricWorldToBody(QPointF world); |
||||
/** @brief Metric body coordinates to metric world coordinates */ |
||||
QPointF metricBodyToWorld(QPointF body); |
||||
/** @brief Screen coordinates of widget to metric coordinates in body frame */ |
||||
QPointF screenToMetricBody(QPointF ref); |
||||
/** @brief Reference coordinates to metric coordinates */ |
||||
QPointF refToMetricBody(QPointF &ref); |
||||
/** @brief Metric coordinates to reference coordinates */ |
||||
QPointF metricBodyToRef(QPointF &metric); |
||||
/** @brief Metric length to reference coordinates */ |
||||
double metricToRef(double metric); |
||||
/** @bried Reference coordinates to metric length */ |
||||
double refToMetric(double ref); |
||||
/** @brief Metric body coordinates to screen coordinates */ |
||||
QPointF metricBodyToScreen(QPointF metric); |
||||
|
||||
/**
|
||||
* @brief Private data container class to be used within the HSI widget |
||||
*/ |
||||
class GPSSatellite |
||||
{ |
||||
public: |
||||
GPSSatellite(int id, float elevation, float azimuth, float snr, bool used) : |
||||
id(id), |
||||
elevation(elevation), |
||||
azimuth(azimuth), |
||||
snr(snr), |
||||
used(used), |
||||
lastUpdate(MG::TIME::getGroundTimeNowUsecs()) { |
||||
|
||||
} |
||||
|
||||
void update(int id, float elevation, float azimuth, float snr, bool used) { |
||||
this->id = id; |
||||
this->elevation = elevation; |
||||
this->azimuth = azimuth; |
||||
this->snr = snr; |
||||
this->used = used; |
||||
this->lastUpdate = MG::TIME::getGroundTimeNowUsecs(); |
||||
} |
||||
|
||||
int id; |
||||
float elevation; |
||||
float azimuth; |
||||
float snr; |
||||
bool used; |
||||
quint64 lastUpdate; |
||||
|
||||
friend class HSIDisplay; |
||||
}; |
||||
|
||||
QMap<int, QString> objectNames; |
||||
QMap<int, int> objectTypes; |
||||
QMap<int, float> objectQualities; |
||||
QMap<int, float> objectBearings; |
||||
QMap<int, float> objectDistances; |
||||
bool dragStarted; |
||||
bool leftDragStarted; |
||||
bool mouseHasMoved; |
||||
float startX; |
||||
float startY; |
||||
QTimer statusClearTimer; |
||||
QString statusMessage; |
||||
bool actionPending; |
||||
bool directSending; |
||||
|
||||
QMap<int, GPSSatellite*> gpsSatellites; |
||||
unsigned int satellitesUsed; |
||||
|
||||
// Current controller values
|
||||
float attXSet; |
||||
float attYSet; |
||||
float attYawSet; |
||||
float altitudeSet; |
||||
|
||||
float posXSet; |
||||
float posYSet; |
||||
float posZSet; |
||||
|
||||
// Controller saturation values
|
||||
float attXSaturation; |
||||
float attYSaturation; |
||||
float attYawSaturation; |
||||
|
||||
float posXSaturation; |
||||
float posYSaturation; |
||||
float altitudeSaturation; |
||||
|
||||
// Position
|
||||
float lat; |
||||
float lon; |
||||
float alt; |
||||
quint64 globalAvailable; ///< Last global position update time
|
||||
float x; |
||||
float y; |
||||
float z; |
||||
float vx; |
||||
float vy; |
||||
float vz; |
||||
float speed; |
||||
quint64 localAvailable; ///< Last local position update time
|
||||
float roll; |
||||
float pitch; |
||||
float yaw; |
||||
float bodyXSetCoordinate; ///< X Setpoint coordinate active on the MAV
|
||||
float bodyYSetCoordinate; ///< Y Setpoint coordinate active on the MAV
|
||||
float bodyZSetCoordinate; ///< Z Setpoint coordinate active on the MAV
|
||||
float bodyYawSet; ///< Yaw setpoint coordinate active on the MAV
|
||||
float uiXSetCoordinate; ///< X Setpoint coordinate wanted by the UI
|
||||
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
|
||||
double metricWidth; ///< Width the instrument represents in meters (the width of the ground shown by the widget)
|
||||
|
||||
// Navigation parameters
|
||||
double crosstrackError; ///< The crosstrack error (m) reported by the UAS
|
||||
|
||||
//
|
||||
float xCenterPos; ///< X center of instrument in virtual coordinates
|
||||
float yCenterPos; ///< Y center of instrument in virtual coordinates
|
||||
|
||||
bool positionLock; |
||||
bool rateControlEnabled; ///< Rate control enabled
|
||||
bool attControlEnabled; ///< Attitude control enabled
|
||||
bool xyControlEnabled; ///< Horizontal control enabled
|
||||
bool zControlEnabled; ///< Vertical control enabled
|
||||
bool yawControlEnabled; ///< Yaw angle position control enabled
|
||||
int positionFix; ///< Total dimensions the MAV is localizaed in
|
||||
int gpsFix; ///< Localization dimensions based on GPS
|
||||
int visionFix; ///< Localizaiton dimensions based on computer vision
|
||||
int laserFix; ///< Localization dimensions based on laser
|
||||
int iruFix; ///< Localization dimensions based on ultrasound
|
||||
|
||||
bool mavInitialized; ///< The MAV is initialized once the setpoint has been received
|
||||
float topMargin; ///< Margin on top of the page, in virtual coordinates
|
||||
float bottomMargin; ///< Margin on the bottom of the page, in virtual coordinates
|
||||
|
||||
bool rateControlKnown; ///< Rate control status known flag
|
||||
bool attControlKnown; ///< Attitude control status known flag
|
||||
bool xyControlKnown; ///< XY control status known flag
|
||||
bool zControlKnown; ///< Z control status known flag
|
||||
bool yawControlKnown; ///< Yaw control status known flag
|
||||
|
||||
// Position lock indicators
|
||||
bool positionFixKnown; ///< Position fix status known flag
|
||||
bool visionFixKnown; ///< Vision fix status known flag
|
||||
bool gpsFixKnown; ///< GPS fix status known flag
|
||||
bool iruFixKnown; ///< Infrared/Ultrasound fix status known flag
|
||||
|
||||
// System state indicators
|
||||
bool gyroKnown; |
||||
bool gyroON; |
||||
bool gyroOK; |
||||
|
||||
bool accelKnown; |
||||
bool accelON; |
||||
bool accelOK; |
||||
|
||||
bool magKnown; |
||||
bool magON; |
||||
bool magOK; |
||||
|
||||
bool pressureKnown; |
||||
bool pressureON; |
||||
bool pressureOK; |
||||
|
||||
bool diffPressureKnown; |
||||
bool diffPressureON; |
||||
bool diffPressureOK; |
||||
|
||||
bool flowKnown; |
||||
bool flowON; |
||||
bool flowOK; |
||||
|
||||
bool laserKnown; |
||||
bool laserON; |
||||
bool laserOK; |
||||
|
||||
bool viconKnown; |
||||
bool viconON; |
||||
bool viconOK; |
||||
|
||||
bool actuatorsKnown; |
||||
bool actuatorsON; |
||||
bool actuatorsOK; |
||||
|
||||
// Data indicators
|
||||
bool setPointKnown; ///< Controller setpoint known status flag
|
||||
bool positionSetPointKnown; ///< Position setpoint known status flag
|
||||
bool userSetPointSet; ///< User set X, Y and Z
|
||||
bool userXYSetPointSet; ///< User set the X/Y position already
|
||||
bool userZSetPointSet; ///< User set the Z position already
|
||||
bool userYawSetPointSet; ///< User set the YAW position already
|
||||
|
||||
private slots: |
||||
void _activeVehicleChanged(Vehicle* vehicle); |
||||
}; |
||||
|
||||
#endif // HSIDISPLAY_H
|
@ -1,236 +0,0 @@
@@ -1,236 +0,0 @@
|
||||
/*=====================================================================
|
||||
|
||||
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 Head up display |
||||
* |
||||
* @author Lorenz Meier <mavteam@student.ethz.ch> |
||||
* |
||||
*/ |
||||
|
||||
#ifndef HUD_H |
||||
#define HUD_H |
||||
|
||||
#include <QImage> |
||||
#include <QWidget> |
||||
#include <QLabel> |
||||
#include <QPainter> |
||||
#include <QFontDatabase> |
||||
#include <QTimer> |
||||
#include <QVector3D> |
||||
|
||||
#include "UASInterface.h" |
||||
#include "MainWindow.h" |
||||
#include "Vehicle.h" |
||||
|
||||
/**
|
||||
* @brief Displays a Head Up Display (HUD) |
||||
* |
||||
* This class represents a head up display (HUD) and draws this HUD in an OpenGL widget (QGLWidget). |
||||
* It can superimpose the HUD over the current live image stream (any arriving image stream will be auto- |
||||
* matically used as background), or it draws the classic blue-brown background known from instruments. |
||||
*/ |
||||
class HUD : public QLabel |
||||
{ |
||||
Q_OBJECT |
||||
public: |
||||
HUD(int width = 640, int height = 480, QWidget* parent = NULL); |
||||
~HUD(); |
||||
|
||||
void setImageSize(int width, int height, int depth, int channels); |
||||
void resize(int w, int h); |
||||
|
||||
public slots: |
||||
void styleChanged(bool styleIsDark); |
||||
|
||||
/** @brief Attitude from main autopilot / system state */ |
||||
void updateAttitude(UASInterface* uas, double roll, double pitch, double yaw, quint64 timestamp); |
||||
/** @brief Attitude from one specific component / redundant autopilot */ |
||||
void updateAttitude(UASInterface* uas, int component, double roll, double pitch, double yaw, quint64 timestamp); |
||||
// void updateAttitudeThrustSetPoint(UASInterface*, double rollDesired, double pitchDesired, double yawDesired, double thrustDesired, quint64 usec);
|
||||
void updateBattery(UASInterface*, double, double, double, int); |
||||
void receiveHeartbeat(UASInterface*); |
||||
void updateThrust(UASInterface*, double); |
||||
void updateLocalPosition(UASInterface*,double,double,double,quint64); |
||||
void updateGlobalPosition(UASInterface*,double,double,double,double,quint64); |
||||
void updateSpeed(UASInterface*,double,double,double,quint64); |
||||
void updateState(UASInterface*,QString); |
||||
void updateMode(int id,QString mode, QString description); |
||||
void updateLoad(UASInterface*, double); |
||||
void selectWaypoint(int uasId, int id); |
||||
|
||||
void startImage(int imgid, int width, int height, int depth, int channels); |
||||
void setPixels(int imgid, const unsigned char* imageData, int length, int startIndex); |
||||
void finishImage(); |
||||
void saveImage(); |
||||
void saveImage(QString fileName); |
||||
void saveImages(bool save); |
||||
/** @brief Select directory where to load the offline files from */ |
||||
void selectOfflineDirectory(); |
||||
/** @brief Enable the HUD instruments */ |
||||
void enableHUDInstruments(bool enabled); |
||||
/** @brief Enable Video */ |
||||
void enableVideo(bool enabled); |
||||
/** @brief Copy an image from the current active UAS */ |
||||
void copyImage(UASInterface* uas); |
||||
|
||||
|
||||
protected slots: |
||||
void _activeVehicleChanged(Vehicle* vehicle); |
||||
void paintRollPitchStrips(); |
||||
void paintPitchLines(float pitch, QPainter* painter); |
||||
/** @brief Paint text on top of the image and OpenGL drawings */ |
||||
void paintText(QString text, QColor color, float fontSize, float refX, float refY, QPainter* painter); |
||||
/** @brief Setup the OpenGL view for drawing a sub-component of the HUD */ |
||||
void setupGLView(float referencePositionX, float referencePositionY, float referenceWidth, float referenceHeight); |
||||
void paintHUD(); |
||||
void paintPitchLinePos(QString text, float refPosX, float refPosY, QPainter* painter); |
||||
void paintPitchLineNeg(QString text, float refPosX, float refPosY, QPainter* painter); |
||||
|
||||
void drawLine(float refX1, float refY1, float refX2, float refY2, float width, const QColor& color, QPainter* painter); |
||||
void drawEllipse(float refX, float refY, float radiusX, float radiusY, float startDeg, float endDeg, float lineWidth, const QColor& color, QPainter* painter); |
||||
void drawCircle(float refX, float refY, float radius, float startDeg, float endDeg, float lineWidth, const QColor& color, QPainter* painter); |
||||
|
||||
void drawChangeRateStrip(float xRef, float yRef, float height, float minRate, float maxRate, float value, QPainter* painter,bool reverse = false); |
||||
void drawChangeIndicatorGauge(float xRef, float yRef, float radius, float expectedMaxChange, float value, const QColor& color, QPainter* painter, bool solid=true); |
||||
|
||||
void drawPolygon(QPolygonF refPolygon, QPainter* painter); |
||||
|
||||
signals: |
||||
void visibilityChanged(bool visible); |
||||
|
||||
protected: |
||||
void commitRawDataToGL(); |
||||
/** @brief Convert reference coordinates to screen coordinates */ |
||||
float refToScreenX(float x); |
||||
/** @brief Convert reference coordinates to screen coordinates */ |
||||
float refToScreenY(float y); |
||||
/** @brief Convert mm line widths to QPen line widths */ |
||||
float refLineWidthToPen(float line); |
||||
/** @brief Rotate a polygon around a point clockwise */ |
||||
void rotatePolygonClockWiseRad(QPolygonF& p, float angle, QPointF origin); |
||||
/** @brief Preferred Size */ |
||||
QSize sizeHint() const; |
||||
/** @brief Start updating widget */ |
||||
void showEvent(QShowEvent* event); |
||||
/** @brief Stop updating widget */ |
||||
void hideEvent(QHideEvent* event); |
||||
void contextMenuEvent (QContextMenuEvent* event); |
||||
void createActions(); |
||||
|
||||
static const int updateInterval = 100; |
||||
|
||||
QImage* image; ///< Double buffer image
|
||||
QImage glImage; ///< The background / camera image
|
||||
UASInterface* uas; ///< The uas currently monitored
|
||||
float yawInt; ///< The yaw integral. Used to damp the yaw indication.
|
||||
QString mode; ///< The current vehicle mode
|
||||
QString state; ///< The current vehicle state
|
||||
QString fuelStatus; ///< Current fuel level / battery voltage
|
||||
double scalingFactor; ///< Factor used to scale all absolute values to screen coordinates
|
||||
float xCenterOffset, yCenterOffset; ///< Offset from center of window in mm coordinates
|
||||
float vwidth; ///< Virtual width of this window, 200 mm per default. This allows to hardcode positions and aspect ratios. This virtual image plane is then scaled to the window size.
|
||||
float vheight; ///< Virtual height of this window, 150 mm per default
|
||||
float vGaugeSpacing; ///< Virtual spacing of the gauges from the center, 50 mm per default
|
||||
float vPitchPerDeg; ///< Virtual pitch to mm conversion. Currently one degree is 3 mm up/down in the pitch markings
|
||||
|
||||
int xCenter; ///< Center of the HUD instrument in pixel coordinates. Allows to off-center the whole instrument in its OpenGL window, e.g. to fit another instrument
|
||||
int yCenter; ///< Center of the HUD instrument in pixel coordinates. Allows to off-center the whole instrument in its OpenGL window, e.g. to fit another instrument
|
||||
|
||||
// Image buffers
|
||||
unsigned char* rawBuffer1; ///< Double buffer 1 for the image
|
||||
unsigned char* rawBuffer2; ///< Double buffer 2 for the image
|
||||
unsigned char* rawImage; ///< Pointer to current complete image
|
||||
int rawLastIndex; ///< The last byte index received of the image
|
||||
int rawExpectedBytes; ///< Number of raw image bytes expected. Calculated by: image depth * channels * widht * height / 8
|
||||
int bytesPerLine; ///< Bytes per image line. Is calculated as: image depth * channels * width / 8
|
||||
bool imageStarted; ///< If an image is currently in transmission
|
||||
int receivedDepth; ///< Image depth in bit for the current image
|
||||
int receivedChannels; ///< Number of color channels
|
||||
int receivedWidth; ///< Width in pixels of the current image
|
||||
int receivedHeight; ///< Height in pixels of the current image
|
||||
|
||||
// HUD colors
|
||||
QColor defaultColor; ///< Color for most HUD elements, e.g. pitch lines, center cross, change rate gauges
|
||||
QColor setPointColor; ///< Color for the current control set point, e.g. yaw desired
|
||||
QColor warningColor; ///< Color for warning messages
|
||||
QColor criticalColor; ///< Color for caution messages
|
||||
QColor infoColor; ///< Color for normal/default messages
|
||||
QColor fuelColor; ///< Current color for the fuel message, can be info, warning or critical color
|
||||
|
||||
// Blink rates
|
||||
int warningBlinkRate; ///< Blink rate of warning messages, will be rounded to the refresh rate
|
||||
|
||||
QTimer* refreshTimer; ///< The main timer, controls the update rate
|
||||
QPainter* HUDPainter; |
||||
QFont font; ///< The HUD font, per default the free Bitstream Vera SANS, which is very close to actual HUD fonts
|
||||
QFontDatabase fontDatabase;///< Font database, only used to load the TrueType font file (the HUD font is directly loaded from file rather than from the system)
|
||||
bool noCamera; ///< No camera images available, draw the ground/sky box to indicate the horizon
|
||||
bool hardwareAcceleration; ///< Enable hardware acceleration
|
||||
|
||||
float strongStrokeWidth; ///< Strong line stroke width, used throughout the HUD
|
||||
float normalStrokeWidth; ///< Normal line stroke width, used throughout the HUD
|
||||
float fineStrokeWidth; ///< Fine line stroke width, used throughout the HUD
|
||||
|
||||
QString waypointName; ///< Waypoint name displayed in HUD
|
||||
float roll; |
||||
float pitch; |
||||
float yaw; |
||||
QMap<uint8_t, QVector3D> attitudes; |
||||
float rollLP; |
||||
float pitchLP; |
||||
float yawLP; |
||||
double yawDiff; |
||||
double xPos; |
||||
double yPos; |
||||
double zPos; |
||||
double xSpeed; |
||||
double ySpeed; |
||||
double zSpeed; |
||||
quint64 lastSpeedUpdate; |
||||
double totalSpeed; |
||||
double totalAcc; |
||||
double lat; |
||||
double lon; |
||||
double alt; |
||||
float load; |
||||
QString offlineDirectory; |
||||
QString nextOfflineImage; |
||||
bool HUDInstrumentsEnabled; |
||||
bool videoEnabled; |
||||
bool imageLoggingEnabled; |
||||
float xImageFactor; |
||||
float yImageFactor; |
||||
QAction* enableHUDAction; |
||||
QAction* enableVideoAction; |
||||
QAction* selectOfflineDirectoryAction; |
||||
QAction* selectVideoChannelAction; |
||||
QAction* selectSaveDirectoryAction; |
||||
void paintEvent(QPaintEvent *event); |
||||
bool imageRequested; |
||||
QString imageLogDirectory; |
||||
unsigned int imageLogCounter; |
||||
}; |
||||
|
||||
#endif // HUD_H
|
@ -1,249 +0,0 @@
@@ -1,249 +0,0 @@
|
||||
#include <QMenu> |
||||
#include <QContextMenuEvent> |
||||
#include <QSettings> |
||||
|
||||
#include "QGCRGBDView.h" |
||||
#include "MultiVehicleManager.h" |
||||
|
||||
QGCRGBDView::QGCRGBDView(int width, int height, QWidget *parent) : |
||||
HUD(width, height, parent), |
||||
rgbEnabled(false), |
||||
depthEnabled(false) |
||||
{ |
||||
enableRGBAction = new QAction(tr("Enable RGB Image"), this); |
||||
enableRGBAction->setStatusTip(tr("Show the RGB image live stream in this window")); |
||||
enableRGBAction->setCheckable(true); |
||||
enableRGBAction->setChecked(rgbEnabled); |
||||
connect(enableRGBAction, SIGNAL(triggered(bool)), this, SLOT(enableRGB(bool))); |
||||
|
||||
enableDepthAction = new QAction(tr("Enable Depthmap"), this); |
||||
enableDepthAction->setStatusTip(tr("Show the Depthmap in this window")); |
||||
enableDepthAction->setCheckable(true); |
||||
enableDepthAction->setChecked(depthEnabled); |
||||
connect(enableDepthAction, SIGNAL(triggered(bool)), this, SLOT(enableDepth(bool))); |
||||
|
||||
connect(MultiVehicleManager::instance(), &MultiVehicleManager::activeVehicleChanged, this, &QGCRGBDView::_activeVehicleChanged); |
||||
_activeVehicleChanged(MultiVehicleManager::instance()->activeVehicle()); |
||||
|
||||
clearData(); |
||||
loadSettings(); |
||||
} |
||||
|
||||
QGCRGBDView::~QGCRGBDView() |
||||
{ |
||||
storeSettings(); |
||||
} |
||||
|
||||
void QGCRGBDView::storeSettings() |
||||
{ |
||||
QSettings settings; |
||||
settings.beginGroup("QGC_RGBDWIDGET"); |
||||
settings.setValue("STREAM_RGB_ON", rgbEnabled); |
||||
settings.setValue("STREAM_DEPTH_ON", depthEnabled); |
||||
settings.endGroup(); |
||||
} |
||||
|
||||
void QGCRGBDView::loadSettings() |
||||
{ |
||||
QSettings settings; |
||||
settings.beginGroup("QGC_RGBDWIDGET"); |
||||
rgbEnabled = settings.value("STREAM_RGB_ON", rgbEnabled).toBool(); |
||||
// Only enable depth if RGB is not on
|
||||
if (!rgbEnabled) depthEnabled = settings.value("STREAM_DEPTH_ON", depthEnabled).toBool(); |
||||
settings.endGroup(); |
||||
} |
||||
|
||||
void QGCRGBDView::_activeVehicleChanged(Vehicle* vehicle) |
||||
{ |
||||
if (this->uas != NULL) |
||||
{ |
||||
// Disconnect any previously connected active MAV
|
||||
disconnect(this->uas, SIGNAL(rgbdImageChanged(UASInterface*)), this, SLOT(updateData(UASInterface*))); |
||||
|
||||
clearData(); |
||||
} |
||||
|
||||
if (vehicle) |
||||
{ |
||||
// Now connect the new UAS
|
||||
// Setup communication
|
||||
connect(vehicle->uas(), SIGNAL(rgbdImageChanged(UASInterface*)), this, SLOT(updateData(UASInterface*))); |
||||
} |
||||
} |
||||
|
||||
void QGCRGBDView::clearData(void) |
||||
{ |
||||
QImage offlineImg; |
||||
qDebug() << offlineImg.load(":/files/images/status/colorbars.png"); |
||||
|
||||
glImage = offlineImg; |
||||
} |
||||
|
||||
void QGCRGBDView::contextMenuEvent(QContextMenuEvent* event) |
||||
{ |
||||
QMenu menu(this); |
||||
// Update actions
|
||||
enableHUDAction->setChecked(HUDInstrumentsEnabled); |
||||
//enableVideoAction->setChecked(videoEnabled);
|
||||
enableRGBAction->setChecked(rgbEnabled); |
||||
enableDepthAction->setChecked(depthEnabled); |
||||
|
||||
menu.addAction(enableHUDAction); |
||||
menu.addAction(enableRGBAction); |
||||
menu.addAction(enableDepthAction); |
||||
//menu.addAction(selectHUDColorAction);
|
||||
//menu.addAction(enableVideoAction);
|
||||
//menu.addAction(selectOfflineDirectoryAction);
|
||||
//menu.addAction(selectVideoChannelAction);
|
||||
menu.exec(event->globalPos()); |
||||
} |
||||
|
||||
void QGCRGBDView::enableRGB(bool enabled) |
||||
{ |
||||
rgbEnabled = enabled; |
||||
videoEnabled = rgbEnabled | depthEnabled; |
||||
QWidget::resize(size().width(), size().height()); |
||||
} |
||||
|
||||
void QGCRGBDView::enableDepth(bool enabled) |
||||
{ |
||||
depthEnabled = enabled; |
||||
videoEnabled = rgbEnabled | depthEnabled; |
||||
QWidget::resize(size().width(), size().height()); |
||||
} |
||||
|
||||
float colormapJet[128][3] = { |
||||
{0.0f,0.0f,0.53125f}, |
||||
{0.0f,0.0f,0.5625f}, |
||||
{0.0f,0.0f,0.59375f}, |
||||
{0.0f,0.0f,0.625f}, |
||||
{0.0f,0.0f,0.65625f}, |
||||
{0.0f,0.0f,0.6875f}, |
||||
{0.0f,0.0f,0.71875f}, |
||||
{0.0f,0.0f,0.75f}, |
||||
{0.0f,0.0f,0.78125f}, |
||||
{0.0f,0.0f,0.8125f}, |
||||
{0.0f,0.0f,0.84375f}, |
||||
{0.0f,0.0f,0.875f}, |
||||
{0.0f,0.0f,0.90625f}, |
||||
{0.0f,0.0f,0.9375f}, |
||||
{0.0f,0.0f,0.96875f}, |
||||
{0.0f,0.0f,1.0f}, |
||||
{0.0f,0.03125f,1.0f}, |
||||
{0.0f,0.0625f,1.0f}, |
||||
{0.0f,0.09375f,1.0f}, |
||||
{0.0f,0.125f,1.0f}, |
||||
{0.0f,0.15625f,1.0f}, |
||||
{0.0f,0.1875f,1.0f}, |
||||
{0.0f,0.21875f,1.0f}, |
||||
{0.0f,0.25f,1.0f}, |
||||
{0.0f,0.28125f,1.0f}, |
||||
{0.0f,0.3125f,1.0f}, |
||||
{0.0f,0.34375f,1.0f}, |
||||
{0.0f,0.375f,1.0f}, |
||||
{0.0f,0.40625f,1.0f}, |
||||
{0.0f,0.4375f,1.0f}, |
||||
{0.0f,0.46875f,1.0f}, |
||||
{0.0f,0.5f,1.0f}, |
||||
{0.0f,0.53125f,1.0f}, |
||||
{0.0f,0.5625f,1.0f}, |
||||
{0.0f,0.59375f,1.0f}, |
||||
{0.0f,0.625f,1.0f}, |
||||
{0.0f,0.65625f,1.0f}, |
||||
{0.0f,0.6875f,1.0f}, |
||||
{0.0f,0.71875f,1.0f}, |
||||
{0.0f,0.75f,1.0f}, |
||||
{0.0f,0.78125f,1.0f}, |
||||
{0.0f,0.8125f,1.0f}, |
||||
{0.0f,0.84375f,1.0f}, |
||||
{0.0f,0.875f,1.0f}, |
||||
{0.0f,0.90625f,1.0f}, |
||||
{0.0f,0.9375f,1.0f}, |
||||
{0.0f,0.96875f,1.0f}, |
||||
{0.0f,1.0f,1.0f}, |
||||
{0.03125f,1.0f,0.96875f}, |
||||
{0.0625f,1.0f,0.9375f}, |
||||
{0.09375f,1.0f,0.90625f}, |
||||
{0.125f,1.0f,0.875f}, |
||||
{0.15625f,1.0f,0.84375f}, |
||||
{0.1875f,1.0f,0.8125f}, |
||||
{0.21875f,1.0f,0.78125f}, |
||||
{0.25f,1.0f,0.75f}, |
||||
{0.28125f,1.0f,0.71875f}, |
||||
{0.3125f,1.0f,0.6875f}, |
||||
{0.34375f,1.0f,0.65625f}, |
||||
{0.375f,1.0f,0.625f}, |
||||
{0.40625f,1.0f,0.59375f}, |
||||
{0.4375f,1.0f,0.5625f}, |
||||
{0.46875f,1.0f,0.53125f}, |
||||
{0.5f,1.0f,0.5f}, |
||||
{0.53125f,1.0f,0.46875f}, |
||||
{0.5625f,1.0f,0.4375f}, |
||||
{0.59375f,1.0f,0.40625f}, |
||||
{0.625f,1.0f,0.375f}, |
||||
{0.65625f,1.0f,0.34375f}, |
||||
{0.6875f,1.0f,0.3125f}, |
||||
{0.71875f,1.0f,0.28125f}, |
||||
{0.75f,1.0f,0.25f}, |
||||
{0.78125f,1.0f,0.21875f}, |
||||
{0.8125f,1.0f,0.1875f}, |
||||
{0.84375f,1.0f,0.15625f}, |
||||
{0.875f,1.0f,0.125f}, |
||||
{0.90625f,1.0f,0.09375f}, |
||||
{0.9375f,1.0f,0.0625f}, |
||||
{0.96875f,1.0f,0.03125f}, |
||||
{1.0f,1.0f,0.0f}, |
||||
{1.0f,0.96875f,0.0f}, |
||||
{1.0f,0.9375f,0.0f}, |
||||
{1.0f,0.90625f,0.0f}, |
||||
{1.0f,0.875f,0.0f}, |
||||
{1.0f,0.84375f,0.0f}, |
||||
{1.0f,0.8125f,0.0f}, |
||||
{1.0f,0.78125f,0.0f}, |
||||
{1.0f,0.75f,0.0f}, |
||||
{1.0f,0.71875f,0.0f}, |
||||
{1.0f,0.6875f,0.0f}, |
||||
{1.0f,0.65625f,0.0f}, |
||||
{1.0f,0.625f,0.0f}, |
||||
{1.0f,0.59375f,0.0f}, |
||||
{1.0f,0.5625f,0.0f}, |
||||
{1.0f,0.53125f,0.0f}, |
||||
{1.0f,0.5f,0.0f}, |
||||
{1.0f,0.46875f,0.0f}, |
||||
{1.0f,0.4375f,0.0f}, |
||||
{1.0f,0.40625f,0.0f}, |
||||
{1.0f,0.375f,0.0f}, |
||||
{1.0f,0.34375f,0.0f}, |
||||
{1.0f,0.3125f,0.0f}, |
||||
{1.0f,0.28125f,0.0f}, |
||||
{1.0f,0.25f,0.0f}, |
||||
{1.0f,0.21875f,0.0f}, |
||||
{1.0f,0.1875f,0.0f}, |
||||
{1.0f,0.15625f,0.0f}, |
||||
{1.0f,0.125f,0.0f}, |
||||
{1.0f,0.09375f,0.0f}, |
||||
{1.0f,0.0625f,0.0f}, |
||||
{1.0f,0.03125f,0.0f}, |
||||
{1.0f,0.0f,0.0f}, |
||||
{0.96875f,0.0f,0.0f}, |
||||
{0.9375f,0.0f,0.0f}, |
||||
{0.90625f,0.0f,0.0f}, |
||||
{0.875f,0.0f,0.0f}, |
||||
{0.84375f,0.0f,0.0f}, |
||||
{0.8125f,0.0f,0.0f}, |
||||
{0.78125f,0.0f,0.0f}, |
||||
{0.75f,0.0f,0.0f}, |
||||
{0.71875f,0.0f,0.0f}, |
||||
{0.6875f,0.0f,0.0f}, |
||||
{0.65625f,0.0f,0.0f}, |
||||
{0.625f,0.0f,0.0f}, |
||||
{0.59375f,0.0f,0.0f}, |
||||
{0.5625f,0.0f,0.0f}, |
||||
{0.53125f,0.0f,0.0f}, |
||||
{0.5f,0.0f,0.0f} |
||||
}; |
||||
|
||||
void QGCRGBDView::updateData(UASInterface *uas) |
||||
{ |
||||
Q_UNUSED(uas); |
||||
} |
@ -1,38 +0,0 @@
@@ -1,38 +0,0 @@
|
||||
#ifndef QGCRGBDVIEW_H |
||||
#define QGCRGBDVIEW_H |
||||
|
||||
#include "HUD.h" |
||||
#include "Vehicle.h" |
||||
|
||||
class QGCRGBDView : public HUD |
||||
{ |
||||
Q_OBJECT |
||||
public: |
||||
explicit QGCRGBDView(int width=640, int height=480, QWidget *parent = 0); |
||||
~QGCRGBDView(); |
||||
|
||||
signals: |
||||
|
||||
public slots: |
||||
void clearData(void); |
||||
void enableRGB(bool enabled); |
||||
void enableDepth(bool enabled); |
||||
void updateData(UASInterface *uas); |
||||
|
||||
protected: |
||||
bool rgbEnabled; |
||||
bool depthEnabled; |
||||
QAction* enableRGBAction; |
||||
QAction* enableDepthAction; |
||||
|
||||
void contextMenuEvent (QContextMenuEvent* event); |
||||
/** @brief Store current configuration of widget */ |
||||
void storeSettings(); |
||||
/** @brief Load configuration of widget */ |
||||
void loadSettings(); |
||||
|
||||
private slots: |
||||
void _activeVehicleChanged(Vehicle* vehicle); |
||||
}; |
||||
|
||||
#endif // QGCRGBDVIEW_H
|
Loading…
Reference in new issue