Commit 44dc6619 authored by dongfang's avatar dongfang Committed by Michael Carpenter

Undone the HUD_old renaming and fixed public slots in PrimaryFlightDisply that were not.

parent c6ab1f05
This diff is collapsed.
......@@ -29,8 +29,8 @@ This file is part of the QGROUNDCONTROL project
*
*/
#ifndef HUD_old_H
#define HUD_old_H
#ifndef HUD_H
#define HUD_H
#include <QImage>
#include <QGLWidget>
......@@ -41,18 +41,18 @@ This file is part of the QGROUNDCONTROL project
#include "UASInterface.h"
/**
* @brief Displays a Head Up Display (HUD_old)
* @brief Displays a Head Up Display (HUD)
*
* This class represents a head up display (HUD_old) and draws this HUD_old in an OpenGL widget (QGLWidget).
* It can superimpose the HUD_old over the current live image stream (any arriving image stream will be auto-
* 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_old : public QGLWidget
class HUD : public QGLWidget
{
Q_OBJECT
public:
HUD_old(int width = 640, int height = 480, QWidget* parent = NULL);
~HUD_old();
HUD(int width = 640, int height = 480, QWidget* parent = NULL);
~HUD();
void setImageSize(int width, int height, int depth, int channels);
void resizeGL(int w, int h);
......@@ -90,7 +90,7 @@ public slots:
/** @brief Select directory where to load the offline files from */
void selectOfflineDirectory();
/** @brief Enable the HUD instruments */
void enableHUD_oldInstruments(bool enabled);
void enableHUDInstruments(bool enabled);
/** @brief Enable Video */
void enableVideo(bool enabled);
/** @brief Copy an image from the current active UAS */
......@@ -103,9 +103,9 @@ protected slots:
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_old */
/** @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_old();
void paintHUD();
void paintPitchLinePos(QString text, float refPosX, float refPosY, QPainter* painter);
void paintPitchLineNeg(QString text, float refPosX, float refPosY, QPainter* painter);
......@@ -156,8 +156,8 @@ protected:
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_old 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_old instrument in pixel coordinates. Allows to off-center the whole instrument in its OpenGL window, e.g. to fit another instrument
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
......@@ -172,8 +172,8 @@ protected:
int receivedWidth; ///< Width in pixels of the current image
int receivedHeight; ///< Height in pixels of the current image
// HUD_old colors
QColor defaultColor; ///< Color for most HUD_old elements, e.g. pitch lines, center cross, change rate gauges
// 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
......@@ -184,17 +184,17 @@ protected:
int warningBlinkRate; ///< Blink rate of warning messages, will be rounded to the refresh rate
QTimer* refreshTimer; ///< The main timer, controls the update rate
QPainter* HUD_oldPainter;
QFont font; ///< The HUD_old font, per default the free Bitstream Vera SANS, which is very close to actual HUD_old fonts
QFontDatabase fontDatabase;///< Font database, only used to load the TrueType font file (the HUD_old font is directly loaded from file rather than from the system)
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_old
float normalStrokeWidth; ///< Normal line stroke width, used throughout the HUD_old
float fineStrokeWidth; ///< Fine line stroke width, used throughout the HUD_old
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_old
QString waypointName; ///< Waypoint name displayed in HUD
float roll;
float pitch;
float yaw;
......@@ -235,4 +235,4 @@ protected:
unsigned int imageLogCounter;
};
#endif // HUD_old_H
#endif // HUD_H
......@@ -170,6 +170,8 @@ void PrimaryFlightDisplay::updateAttitude(UASInterface* uas, double roll, double
this->heading = yaw;
}
// TODO: Else-part. We really should have an "attitude bad or unknown" indication instead of just freezing.
qDebug("r,p,y: %f,%f,%f", roll, pitch, yaw);
}
/*
......@@ -184,6 +186,8 @@ void PrimaryFlightDisplay::updateAttitude(UASInterface* uas, int component, doub
Q_UNUSED(pitch);
Q_UNUSED(yaw);
Q_UNUSED(timestamp);
qDebug("ignore (!!!) r,p,y: %f,%f,%f", roll, pitch, yaw);
}
void PrimaryFlightDisplay::updateBattery(UASInterface* uas, double voltage, double percent, int seconds)
......@@ -1122,3 +1126,5 @@ void PrimaryFlightDisplay::doPaint() {
paintAllInOne();
#endif
}
void PrimaryFlightDisplay:: createActions() {}
......@@ -84,6 +84,7 @@ public:
PrimaryFlightDisplay(int width = 640, int height = 480, QWidget* parent = NULL);
~PrimaryFlightDisplay();
public slots:
/** @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 */
......@@ -100,6 +101,7 @@ public:
void updateLoad(UASInterface*, double);
void selectWaypoint(int uasId, int id);
protected:
void paintEvent(QPaintEvent *event);
void resizeEvent(QResizeEvent *e);
......@@ -115,11 +117,10 @@ public:
// dongfang: We have no context menu. Viewonly.
// void contextMenuEvent (QContextMenuEvent* event);
protected:
// dongfang: What is that?
void createActions();
static const int updateInterval = 40;
public slots:
/** @brief Set the currently monitored UAS */
virtual void setActiveUAS(UASInterface* uas);
......@@ -208,6 +209,9 @@ private:
static const int tickValues[];
static const QString compassWindNames[];
static const int updateInterval = 40;
signals:
public slots:
......
......@@ -6,7 +6,7 @@
#include "UASManager.h"
QGCRGBDView::QGCRGBDView(int width, int height, QWidget *parent) :
HUD_old(width, height, parent),
HUD(width, height, parent),
rgbEnabled(false),
depthEnabled(false)
{
......@@ -70,7 +70,7 @@ void QGCRGBDView::setActiveUAS(UASInterface* uas)
connect(uas, SIGNAL(rgbdImageChanged(UASInterface*)), this, SLOT(updateData(UASInterface*)));
}
HUD_old::setActiveUAS(uas);
HUD::setActiveUAS(uas);
}
void QGCRGBDView::clearData(void)
......
......@@ -3,7 +3,7 @@
#include "HUD.h"
class QGCRGBDView : public HUD_old
class QGCRGBDView : public HUD
{
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