Commit abe60a9a authored by Lorenz Meier's avatar Lorenz Meier

Merge pull request #704 from Susurrus/pfd_sizing

Allow the Primary Flight Display widget to be resized smaller than is currently possible
parents 6a4a50bf 861ef09e
...@@ -677,10 +677,10 @@ void MainWindow::buildCommonWidgets() ...@@ -677,10 +677,10 @@ void MainWindow::buildCommonWidgets()
menuActionHelper->createToolAction(tr("Actuator Status"), "HEAD_DOWN_DISPLAY_2_DOCKWIDGET"); menuActionHelper->createToolAction(tr("Actuator Status"), "HEAD_DOWN_DISPLAY_2_DOCKWIDGET");
menuActionHelper->createToolAction(tr("Radio Control")); menuActionHelper->createToolAction(tr("Radio Control"));
createDockWidget(engineeringView,new HUD(320,240,this),tr("Video Downlink"),"HEAD_UP_DISPLAY_DOCKWIDGET",VIEW_ENGINEER,Qt::RightDockWidgetArea,QSize(this->width()/1.5,0)); createDockWidget(engineeringView,new HUD(320,240,this),tr("Video Downlink"),"HEAD_UP_DISPLAY_DOCKWIDGET",VIEW_ENGINEER,Qt::RightDockWidgetArea);
createDockWidget(simView,new PrimaryFlightDisplay(320,240,this),tr("Primary Flight Display"),"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET",VIEW_SIMULATION,Qt::RightDockWidgetArea,QSize(this->width()/1.5,0)); createDockWidget(simView,new PrimaryFlightDisplay(this),tr("Primary Flight Display"),"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET",VIEW_SIMULATION,Qt::RightDockWidgetArea);
createDockWidget(pilotView,new PrimaryFlightDisplay(320,240,this),tr("Primary Flight Display"),"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET",VIEW_FLIGHT,Qt::LeftDockWidgetArea,QSize(this->width()/1.8,0)); createDockWidget(pilotView,new PrimaryFlightDisplay(this),tr("Primary Flight Display"),"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET",VIEW_FLIGHT,Qt::LeftDockWidgetArea);
QGCTabbedInfoView *infoview = new QGCTabbedInfoView(this); QGCTabbedInfoView *infoview = new QGCTabbedInfoView(this);
infoview->addSource(mavlinkDecoder); infoview->addSource(mavlinkDecoder);
...@@ -852,7 +852,7 @@ void MainWindow::loadDockWidget(const QString& name) ...@@ -852,7 +852,7 @@ void MainWindow::loadDockWidget(const QString& name)
} }
else if (name == "PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET") else if (name == "PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET")
{ {
createDockWidget(centerStack->currentWidget(),new PrimaryFlightDisplay(320,240,this),tr("Primary Flight Display"),"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET",currentView,Qt::RightDockWidgetArea); createDockWidget(centerStack->currentWidget(),new PrimaryFlightDisplay(this),tr("Primary Flight Display"),"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET",currentView,Qt::RightDockWidgetArea);
} }
else if (name == "HEAD_UP_DISPLAY_DOCKWIDGET") else if (name == "HEAD_UP_DISPLAY_DOCKWIDGET")
{ {
......
This diff is collapsed.
...@@ -9,7 +9,7 @@ class PrimaryFlightDisplay : public QWidget ...@@ -9,7 +9,7 @@ class PrimaryFlightDisplay : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
PrimaryFlightDisplay(int width = 640, int height = 480, QWidget* parent = NULL); PrimaryFlightDisplay(QWidget* parent = NULL);
~PrimaryFlightDisplay(); ~PrimaryFlightDisplay();
public slots: public slots:
...@@ -23,7 +23,6 @@ public slots: ...@@ -23,7 +23,6 @@ public slots:
void updateNavigationControllerErrors(UASInterface* uas, double altitudeError, double speedError, double xtrackError); void updateNavigationControllerErrors(UASInterface* uas, double altitudeError, double speedError, double xtrackError);
/** @brief Set the currently monitored UAS */ /** @brief Set the currently monitored UAS */
//void addUAS(UASInterface* uas);
void forgetUAS(UASInterface* uas); void forgetUAS(UASInterface* uas);
void setActiveUAS(UASInterface* uas); void setActiveUAS(UASInterface* uas);
...@@ -57,34 +56,10 @@ protected: ...@@ -57,34 +56,10 @@ protected:
/** @brief Stop updating widget */ /** @brief Stop updating widget */
void hideEvent(QHideEvent* event); void hideEvent(QHideEvent* event);
// dongfang: We have no context menu. Viewonly.
// void contextMenuEvent (QContextMenuEvent* event);
// dongfang: What is that?
// dongfang: OK it's for UI interaction. Presently, there is none.
void createActions();
signals: signals:
void visibilityChanged(bool visible); void visibilityChanged(bool visible);
private: private:
/*
enum AltimeterMode {
PRIMARY_MAIN_GPS_SUB, // Show the primary alt. on tape and GPS as extra info
GPS_MAIN // Show GPS on tape and no extra info
};
enum AltimeterFrame {
ASL, // Show ASL altitudes (plane pilots' normal preference)
RELATIVE_TO_HOME // Show relative-to-home altitude (copter pilots)
};
enum SpeedMode {
PRIMARY_MAIN_GROUND_SUB,// Show primary speed (often airspeed) on tape and groundspeed as extra
GROUND_MAIN // Show groundspeed on tape and no extra info
};
*/
/* /*
* There are at least these differences between airplane and copter PDF view: * There are at least these differences between airplane and copter PDF view:
* - Airplane show absolute altutude in altimeter, copter shows relative to home * - Airplane show absolute altutude in altimeter, copter shows relative to home
...@@ -122,12 +97,6 @@ private: ...@@ -122,12 +97,6 @@ private:
UASInterface* uas; ///< The uas currently monitored UASInterface* uas; ///< The uas currently monitored
/*
AltimeterMode altimeterMode;
AltimeterFrame altimeterFrame;
SpeedMode speedMode;
*/
bool didReceiveSpeed; bool didReceiveSpeed;
float roll; float roll;
......
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