Commit 4608295a authored by Bryant's avatar Bryant

Rearrange code and add documentation for perspective code.

No functionality changes in this code, just code clarify improvements.
parent 6140fed9
......@@ -503,7 +503,7 @@ void MainWindow::buildCommonWidgets()
logPlayer = new QGCMAVLinkLogPlayer(mavlink, customStatusBar);
customStatusBar->setLogPlayer(logPlayer);
// Center widgets
// Initialize all of the views, if they haven't been already, and add their central widgets
if (!plannerView)
{
plannerView = new SubMainWindow(this);
......@@ -511,8 +511,6 @@ void MainWindow::buildCommonWidgets()
plannerView->setCentralWidget(new QGCMapTool(this));
addToCentralStackedWidget(plannerView, VIEW_MISSION, "Maps");
}
//pilotView (aka Flight or Mission View)
if (!pilotView)
{
pilotView = new SubMainWindow(this);
......@@ -520,7 +518,6 @@ void MainWindow::buildCommonWidgets()
pilotView->setCentralWidget(new PrimaryFlightDisplay(this));
addToCentralStackedWidget(pilotView, VIEW_FLIGHT, "Pilot");
}
if (!terminalView)
{
terminalView = new SubMainWindow(this);
......@@ -529,7 +526,6 @@ void MainWindow::buildCommonWidgets()
terminalView->setCentralWidget(terminalConsole);
addToCentralStackedWidget(terminalView, VIEW_TERMINAL, tr("Terminal View"));
}
if (!setupView)
{
setupView = new SubMainWindow(this);
......@@ -537,7 +533,6 @@ void MainWindow::buildCommonWidgets()
setupView->setCentralWidget(new SetupView(this));
addToCentralStackedWidget(setupView, VIEW_SETUP, "Setup");
}
if (!engineeringView)
{
engineeringView = new SubMainWindow(this);
......@@ -545,7 +540,6 @@ void MainWindow::buildCommonWidgets()
engineeringView->setCentralWidget(new QGCDataPlot2D(this));
addToCentralStackedWidget(engineeringView, VIEW_ENGINEER, tr("Logfile Plot"));
}
#ifdef QGC_GOOGLE_EARTH_ENABLED
if (!googleEarthView)
{
......@@ -555,7 +549,6 @@ void MainWindow::buildCommonWidgets()
addToCentralStackedWidget(googleEarthView, VIEW_GOOGLEEARTH, tr("Google Earth View"));
}
#endif
#ifdef QGC_OSG_ENABLED
if (!local3DView)
{
......@@ -577,39 +570,37 @@ void MainWindow::buildCommonWidgets()
addToCentralStackedWidget(simView, VIEW_SIMULATION, tr("Simulation View"));
}
// Dock widgets
createDockWidget(simView,new UASControlWidget(this),tr("Control"),"UNMANNED_SYSTEM_CONTROL_DOCKWIDGET",VIEW_SIMULATION,Qt::LeftDockWidgetArea);
// Add dock widgets for the planner view
createDockWidget(plannerView, new PrimaryFlightDisplay(this), tr("Primary Flight Display"), "PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET", VIEW_FLIGHT, Qt::LeftDockWidgetArea);
createDockWidget(plannerView, new UASListWidget(this), tr("Unmanned Systems"), "UNMANNED_SYSTEM_LIST_DOCKWIDGET", VIEW_MISSION, Qt::LeftDockWidgetArea);
createDockWidget(plannerView, new QGCWaypointListMulti(this), tr("Mission Plan"), "WAYPOINT_LIST_DOCKWIDGET", VIEW_MISSION, Qt::BottomDockWidgetArea);
createDockWidget(plannerView,new UASListWidget(this),tr("Unmanned Systems"),"UNMANNED_SYSTEM_LIST_DOCKWIDGET",VIEW_MISSION,Qt::LeftDockWidgetArea);
createDockWidget(plannerView,new QGCWaypointListMulti(this),tr("Mission Plan"),"WAYPOINT_LIST_DOCKWIDGET",VIEW_MISSION,Qt::BottomDockWidgetArea);
// Add dock widgets for the pilot view
createDockWidget(pilotView, new DebugConsole(this), tr("Communications Console"), "COMMUNICATION_CONSOLE_DOCKWIDGET", VIEW_FLIGHT, Qt::LeftDockWidgetArea);
QGCTabbedInfoView *infoview = new QGCTabbedInfoView(this);
infoview->addSource(mavlinkDecoder);
createDockWidget(pilotView, infoview, tr("Info View"), "UAS_INFO_INFOVIEW_DOCKWIDGET", VIEW_FLIGHT, Qt::LeftDockWidgetArea);
// Add dock widgets for the simulation view
createDockWidget(simView,new UASControlWidget(this),tr("Control"),"UNMANNED_SYSTEM_CONTROL_DOCKWIDGET",VIEW_SIMULATION,Qt::LeftDockWidgetArea);
createDockWidget(simView,new QGCWaypointListMulti(this),tr("Mission Plan"),"WAYPOINT_LIST_DOCKWIDGET",VIEW_SIMULATION,Qt::BottomDockWidgetArea);
createDockWidget(engineeringView,new QGCMAVLinkInspector(mavlink,this),tr("MAVLink Inspector"),"MAVLINK_INSPECTOR_DOCKWIDGET",VIEW_ENGINEER,Qt::RightDockWidgetArea);
createDockWidget(simView, new ParameterInterface(this), tr("Onboard Parameters"), "PARAMETER_INTERFACE_DOCKWIDGET", VIEW_SIMULATION, Qt::RightDockWidgetArea);
createDockWidget(simView, new PrimaryFlightDisplay(this), tr("Primary Flight Display"), "PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET", VIEW_SIMULATION, Qt::RightDockWidgetArea);
createDockWidget(engineeringView,new ParameterInterface(this),tr("Onboard Parameters"),"PARAMETER_INTERFACE_DOCKWIDGET",VIEW_ENGINEER,Qt::RightDockWidgetArea);
createDockWidget(engineeringView,new QGCUASFileViewMulti(this),tr("Onboard Files"),"FILE_VIEW_DOCKWIDGET",VIEW_ENGINEER,Qt::RightDockWidgetArea);
createDockWidget(simView,new ParameterInterface(this),tr("Onboard Parameters"),"PARAMETER_INTERFACE_DOCKWIDGET",VIEW_SIMULATION,Qt::RightDockWidgetArea);
// Add dock widgets for the engineering view
createDockWidget(engineeringView, new QGCMAVLinkInspector(mavlink, this), tr("MAVLink Inspector"), "MAVLINK_INSPECTOR_DOCKWIDGET", VIEW_ENGINEER, Qt::RightDockWidgetArea);
createDockWidget(engineeringView, new ParameterInterface(this), tr("Onboard Parameters"), "PARAMETER_INTERFACE_DOCKWIDGET", VIEW_ENGINEER, Qt::RightDockWidgetArea);
createDockWidget(engineeringView, new QGCUASFileViewMulti(this), tr("Onboard Files"), "FILE_VIEW_DOCKWIDGET", VIEW_ENGINEER, Qt::RightDockWidgetArea);
createDockWidget(engineeringView, new HUD(320, 240, this), tr("Video Downlink"), "HEAD_UP_DISPLAY_DOCKWIDGET", VIEW_FLIGHT, Qt::RightDockWidgetArea);
// Add some extra widgets to the Tool Widgets menu
menuActionHelper->createToolAction(tr("Map View"), "MAP_VIEW_DOCKWIDGET");
menuActionHelper->createToolAction(tr("Status Details"), "UAS_STATUS_DETAILS_DOCKWIDGET");
createDockWidget(pilotView, new DebugConsole(this), tr("Communications Console"), "COMMUNICATION_CONSOLE_DOCKWIDGET", VIEW_FLIGHT, Qt::LeftDockWidgetArea);
menuActionHelper->createToolAction(tr("Flight Display"), "HEAD_DOWN_DISPLAY_1_DOCKWIDGET");
menuActionHelper->createToolAction(tr("Actuator Status"), "HEAD_DOWN_DISPLAY_2_DOCKWIDGET");
menuActionHelper->createToolAction(tr("Radio Control"));
createDockWidget(engineeringView,new HUD(320,240,this),tr("Video Downlink"),"HEAD_UP_DISPLAY_DOCKWIDGET",VIEW_FLIGHT,Qt::RightDockWidgetArea);
createDockWidget(simView,new PrimaryFlightDisplay(this),tr("Primary Flight Display"),"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET",VIEW_SIMULATION,Qt::RightDockWidgetArea);
createDockWidget(plannerView,new PrimaryFlightDisplay(this),tr("Primary Flight Display"),"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET",VIEW_FLIGHT,Qt::LeftDockWidgetArea);
QGCTabbedInfoView *infoview = new QGCTabbedInfoView(this);
infoview->addSource(mavlinkDecoder);
createDockWidget(pilotView,infoview,tr("Info View"),"UAS_INFO_INFOVIEW_DOCKWIDGET",VIEW_FLIGHT,Qt::LeftDockWidgetArea);
menuActionHelper->createToolAction(tr("Radio Control")); // FIXME: Remove as this menu item does nothing
// Custom widgets, added last to all menus and layouts
// Add any custom widgets last to all menus and layouts
buildCustomWidget();
}
......
......@@ -301,17 +301,17 @@ protected:
typedef enum _VIEW_SECTIONS
{
VIEW_ENGINEER,
VIEW_MISSION,
VIEW_FLIGHT,
VIEW_SIMULATION,
VIEW_FIRMWAREUPDATE,
VIEW_SETUP,
VIEW_SOFTWARE_CONFIG,
VIEW_TERMINAL,
VIEW_LOCAL3D,
VIEW_GOOGLEEARTH,
VIEW_DEFAULT
VIEW_ENGINEER, // Engineering/Analyze view mode. Used for analyzing data and modifying onboard parameters
VIEW_MISSION, // Mission/Map/Plan view mode. Used for setting mission waypoints and high-level system commands.
VIEW_FLIGHT, // Flight/Fly/Operate view mode. Used for 1st-person observation of the vehicle
VIEW_SIMULATION, // Simulation view. Useful overview of the entire system for simulation.
VIEW_FIRMWAREUPDATE, // Firmware Update view. Used for modifying the onboard vehicle firmware. UNUSED.
VIEW_SETUP, // Setup view. Used for initializing the system for operation. Includes UI for calibration, firmware updating/checking, and parameter modifcation.
VIEW_SOFTWARE_CONFIG, // Software view. Used for configuring the onboard software/firmware.
VIEW_TERMINAL, // Terminal interface. Used for communicating with the remote system, usually in a special configuration input mode.
VIEW_LOCAL3D, // A local 3D view. Provides a local 3D view that makes visualizing 3D attitude/orientation/pose easy while in operation.
VIEW_GOOGLEEARTH, // 3D Google Earth view. A 3D terrain view, though the vehicle is still 2D.
VIEW_DEFAULT // Not a real view. Merely a programming abstraction to simplify the code.
} VIEW_SECTIONS;
/**
......
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