|
|
@ -181,15 +181,6 @@ MainWindow::MainWindow(QWidget *parent): |
|
|
|
actions << ui.actionSoftwareConfig; |
|
|
|
actions << ui.actionSoftwareConfig; |
|
|
|
toolBar->setPerspectiveChangeActions(actions); |
|
|
|
toolBar->setPerspectiveChangeActions(actions); |
|
|
|
|
|
|
|
|
|
|
|
// We only want one of these.
|
|
|
|
|
|
|
|
apmToolBar = new APMToolBar(this); |
|
|
|
|
|
|
|
apmToolBar->setFlightViewAction(ui.actionFlightView); |
|
|
|
|
|
|
|
apmToolBar->setFlightPlanViewAction(ui.actionMissionView); |
|
|
|
|
|
|
|
apmToolBar->setHardwareViewAction(ui.actionHardwareConfig); |
|
|
|
|
|
|
|
apmToolBar->setSoftwareViewAction(ui.actionSoftwareConfig); |
|
|
|
|
|
|
|
apmToolBar->setSimulationViewAction(ui.actionSimulation_View); |
|
|
|
|
|
|
|
apmToolBar->setTerminalViewAction(ui.actionSimulation_View); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add actions for advanced users (displayed in dropdown under "advanced")
|
|
|
|
// Add actions for advanced users (displayed in dropdown under "advanced")
|
|
|
|
QList<QAction*> advancedActions; |
|
|
|
QList<QAction*> advancedActions; |
|
|
|
advancedActions << ui.actionSimulation_View; |
|
|
|
advancedActions << ui.actionSimulation_View; |
|
|
@ -200,8 +191,6 @@ MainWindow::MainWindow(QWidget *parent): |
|
|
|
setStatusBar(customStatusBar); |
|
|
|
setStatusBar(customStatusBar); |
|
|
|
statusBar()->setSizeGripEnabled(true); |
|
|
|
statusBar()->setSizeGripEnabled(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
emit initStatusChanged("Building common widgets."); |
|
|
|
emit initStatusChanged("Building common widgets."); |
|
|
|
|
|
|
|
|
|
|
|
buildCommonWidgets(); |
|
|
|
buildCommonWidgets(); |
|
|
@ -616,9 +605,17 @@ void MainWindow::buildCommonWidgets() |
|
|
|
createDockWidget(pilotView,new PrimaryFlightDisplay(320,240,this),tr("Primary Flight Display"),"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET",VIEW_FLIGHT,Qt::LeftDockWidgetArea,this->width()/1.8); |
|
|
|
createDockWidget(pilotView,new PrimaryFlightDisplay(320,240,this),tr("Primary Flight Display"),"PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET",VIEW_FLIGHT,Qt::LeftDockWidgetArea,this->width()/1.8); |
|
|
|
|
|
|
|
|
|
|
|
// Add Our new 'toolbar'
|
|
|
|
// Add Our new 'toolbar'
|
|
|
|
qDebug() << "width" << this->width(); |
|
|
|
// Create the APM Toolbar
|
|
|
|
|
|
|
|
APMToolBar *apmToolBar = new APMToolBar(this); |
|
|
|
|
|
|
|
apmToolBar->setFlightViewAction(ui.actionFlightView); |
|
|
|
|
|
|
|
apmToolBar->setFlightPlanViewAction(ui.actionMissionView); |
|
|
|
|
|
|
|
apmToolBar->setHardwareViewAction(ui.actionHardwareConfig); |
|
|
|
|
|
|
|
apmToolBar->setSoftwareViewAction(ui.actionSoftwareConfig); |
|
|
|
|
|
|
|
apmToolBar->setSimulationViewAction(ui.actionSimulation_View); |
|
|
|
|
|
|
|
apmToolBar->setTerminalViewAction(ui.actionSimulation_View); |
|
|
|
createDockWidget(pilotView,apmToolBar,tr("APM Tool Bar"),"APM_TOOLBAR_DOCKWIDGET",VIEW_FLIGHT,Qt::TopDockWidgetArea,this->width(), 70); |
|
|
|
createDockWidget(pilotView,apmToolBar,tr("APM Tool Bar"),"APM_TOOLBAR_DOCKWIDGET",VIEW_FLIGHT,Qt::TopDockWidgetArea,this->width(), 70); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QGCTabbedInfoView *infoview = new QGCTabbedInfoView(this); |
|
|
|
QGCTabbedInfoView *infoview = new QGCTabbedInfoView(this); |
|
|
|
infoview->addSource(mavlinkDecoder); |
|
|
|
infoview->addSource(mavlinkDecoder); |
|
|
|
createDockWidget(pilotView,infoview,tr("Info View"),"UAS_INFO_INFOVIEW_DOCKWIDGET",VIEW_FLIGHT,Qt::LeftDockWidgetArea); |
|
|
|
createDockWidget(pilotView,infoview,tr("Info View"),"UAS_INFO_INFOVIEW_DOCKWIDGET",VIEW_FLIGHT,Qt::LeftDockWidgetArea); |
|
|
@ -864,7 +861,15 @@ void MainWindow::loadDockWidget(QString name) |
|
|
|
else if (name == "APM_TOOLBAR_DOCKWIDGET") |
|
|
|
else if (name == "APM_TOOLBAR_DOCKWIDGET") |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Add Our new 'toolbar'
|
|
|
|
// Add Our new 'toolbar'
|
|
|
|
createDockWidget(centerStack->currentWidget(),apmToolBar,tr("APM Tool Bar"),"APM_TOOLBAR_DOCKWIDGET",VIEW_FLIGHT,Qt::TopDockWidgetArea,this->width(), 70); |
|
|
|
// Create the APM Toolbar
|
|
|
|
|
|
|
|
APMToolBar *apmToolBar = new APMToolBar(this); |
|
|
|
|
|
|
|
apmToolBar->setFlightViewAction(ui.actionFlightView); |
|
|
|
|
|
|
|
apmToolBar->setFlightPlanViewAction(ui.actionMissionView); |
|
|
|
|
|
|
|
apmToolBar->setHardwareViewAction(ui.actionHardwareConfig); |
|
|
|
|
|
|
|
apmToolBar->setSoftwareViewAction(ui.actionSoftwareConfig); |
|
|
|
|
|
|
|
apmToolBar->setSimulationViewAction(ui.actionSimulation_View); |
|
|
|
|
|
|
|
apmToolBar->setTerminalViewAction(ui.actionSimulation_View); |
|
|
|
|
|
|
|
createDockWidget(centerStack->currentWidget(),apmToolBar,tr("APM Tool Bar"),"APM_TOOLBAR_DOCKWIDGET",currentView,Qt::TopDockWidgetArea,this->width(), 70); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
@ -1651,6 +1656,29 @@ void MainWindow::addLink() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool MainWindow::configLink(LinkInterface *link) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// Go searching for this link's configuration window
|
|
|
|
|
|
|
|
QList<QAction*> actions = ui.menuNetwork->actions(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool found(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const int32_t& linkIndex(LinkManager::instance()->getLinks().indexOf(link)); |
|
|
|
|
|
|
|
const int32_t& linkID(LinkManager::instance()->getLinks()[linkIndex]->getId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (QAction* action, actions) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (action->data().toInt() == linkID) |
|
|
|
|
|
|
|
{ // LinkManager::instance()->getLinks().indexOf(link)
|
|
|
|
|
|
|
|
found = true; |
|
|
|
|
|
|
|
action->trigger(); // Show the Link Config Dialog
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return found; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::addLink(LinkInterface *link) |
|
|
|
void MainWindow::addLink(LinkInterface *link) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// IMPORTANT! KEEP THESE TWO LINES
|
|
|
|
// IMPORTANT! KEEP THESE TWO LINES
|
|
|
@ -1680,7 +1708,7 @@ void MainWindow::addLink(LinkInterface *link) |
|
|
|
|
|
|
|
|
|
|
|
if (!found) |
|
|
|
if (!found) |
|
|
|
{ // || udp
|
|
|
|
{ // || udp
|
|
|
|
CommConfigurationWindow* commWidget = new CommConfigurationWindow(link, mavlink, this); |
|
|
|
CommConfigurationWindow* commWidget = new CommConfigurationWindow(link, mavlink, NULL); |
|
|
|
commsWidgetList.append(commWidget); |
|
|
|
commsWidgetList.append(commWidget); |
|
|
|
connect(commWidget,SIGNAL(destroyed(QObject*)),this,SLOT(commsWidgetDestroyed(QObject*))); |
|
|
|
connect(commWidget,SIGNAL(destroyed(QObject*)),this,SLOT(commsWidgetDestroyed(QObject*))); |
|
|
|
QAction* action = commWidget->getAction(); |
|
|
|
QAction* action = commWidget->getAction(); |
|
|
@ -1696,6 +1724,11 @@ void MainWindow::addLink(LinkInterface *link) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//void MainWindow::configLink(LinkInterface *link)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
void MainWindow::commsWidgetDestroyed(QObject *obj) |
|
|
|
void MainWindow::commsWidgetDestroyed(QObject *obj) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (commsWidgetList.contains(obj)) |
|
|
|
if (commsWidgetList.contains(obj)) |
|
|
|