MainWindow.cc 17.9 KB
Newer Older
pixhawk's avatar
pixhawk committed
1 2
/*=====================================================================

3
QGroundControl Open Source Ground Control Station
pixhawk's avatar
pixhawk committed
4

5 6 7
(c) 2009, 2010 QGROUNDCONTROL/PIXHAWK PROJECT
<http://www.qgroundcontrol.org>
<http://pixhawk.ethz.ch>
pixhawk's avatar
pixhawk committed
8

9
This file is part of the QGROUNDCONTROL project
pixhawk's avatar
pixhawk committed
10

11
    QGROUNDCONTROL is free software: you can redistribute it and/or modify
pixhawk's avatar
pixhawk committed
12 13 14 15
    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.

16
    QGROUNDCONTROL is distributed in the hope that it will be useful,
pixhawk's avatar
pixhawk committed
17 18 19 20 21
    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
22
    along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
pixhawk's avatar
pixhawk committed
23 24 25 26 27

======================================================================*/

/**
 * @file
28
 *   @brief Implementation of class MainWindow
29
 *   @author Lorenz Meier <mail@qgroundcontrol.org>
pixhawk's avatar
pixhawk committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
 */

#include <QSettings>
#include <QDockWidget>
#include <QNetworkInterface>
#include <QMessageBox>
#include <QDebug>
#include <QTimer>
#include <QHostInfo>

#include "MG.h"
#include "MAVLinkSimulationLink.h"
#include "SerialLink.h"
#include "UDPLink.h"
#include "MAVLinkProtocol.h"
#include "CommConfigurationWindow.h"
#include "WaypointList.h"
#include "MainWindow.h"
#include "JoystickWidget.h"
pixhawk's avatar
pixhawk committed
49
#include "GAudioOutput.h"
pixhawk's avatar
pixhawk committed
50 51 52 53 54 55 56 57 58 59 60


#include "LogCompressor.h"

/**
* Create new mainwindow. The constructor instantiates all parts of the user
* interface. It does NOT show the mainwindow. To display it, call the show()
* method.
*
* @see QMainWindow::show()
**/
61 62
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent),
    settings()
pixhawk's avatar
pixhawk committed
63
{
64 65 66
    this->hide();
    this->setVisible(false);

pixhawk's avatar
pixhawk committed
67 68 69 70 71 72 73 74
    mavlink = new MAVLinkProtocol();

    // Setup user interface
    ui.setupUi(this);

    // Initialize views, NOT show them yet, only initialize model and controller
    centerStack = new QStackedWidget(this);
    linechart = new LinechartWidget(this);
75
    linechart->setActive(false);
pixhawk's avatar
pixhawk committed
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
    connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), linechart, SLOT(setActivePlot(UASInterface*)));
    centerStack->addWidget(linechart);
    control = new UASControlWidget(this);
    //controlDock = new QDockWidget(this);
    //controlDock->setWidget(control);
    list = new UASListWidget(this);
    list->setVisible(false);
    waypoints = new WaypointList(this, NULL);
    waypoints->setVisible(false);
    info = new UASInfoWidget(this);
    info->setVisible(false);
    detection = new ObjectDetectionView("test", this);
    detection->setVisible(false);
    hud = new HUD(640, 480, this);
    hud->setVisible(false);
    debugConsole = new DebugConsole(this);
    debugConsole->setVisible(false);
    map = new MapWidget(this);
    map->setVisible(false);
    protocol = new XMLCommProtocolWidget(this);
    protocol->setVisible(false);
    parameters = new ParameterInterface(this);
    parameters->setVisible(false);
pixhawk's avatar
pixhawk committed
99 100 101 102 103

    QStringList* acceptList = new QStringList();
    acceptList->append("roll IMU");
    acceptList->append("pitch IMU");
    acceptList->append("yaw IMU");
104 105 106
    acceptList->append("vx");
    acceptList->append("vy");
    acceptList->append("vz");
pixhawk's avatar
pixhawk committed
107
    headDown1 = new HDDisplay(acceptList, this);
pixhawk's avatar
pixhawk committed
108
    headDown1->setVisible(false);
pixhawk's avatar
pixhawk committed
109 110 111 112 113 114

    QStringList* acceptList2 = new QStringList();
    acceptList2->append("Battery");
    acceptList2->append("Pressure");
    headDown2 = new HDDisplay(acceptList2, this);
    headDown2->setVisible(false);
pixhawk's avatar
pixhawk committed
115 116 117 118 119 120 121
    centerStack->addWidget(map);
    centerStack->addWidget(hud);
    setCentralWidget(centerStack);

    // Get IPs
    QList<QHostAddress> hostAddresses = QNetworkInterface::allAddresses();

pixhawk's avatar
pixhawk committed
122
    QString windowname = qApp->applicationName() + " " + qApp->applicationVersion();
lm's avatar
lm committed
123

pixhawk's avatar
pixhawk committed
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
    windowname.append(" (" + QHostInfo::localHostName() + ": ");
    bool prevAddr = false;
    for (int i = 0; i < hostAddresses.size(); i++)
    {
        // Exclude loopback IPv4 and all IPv6 addresses
        if (hostAddresses.at(i) != QHostAddress("127.0.0.1") && !hostAddresses.at(i).toString().contains(":"))
        {
            if(prevAddr) windowname.append("/");
            windowname.append(hostAddresses.at(i).toString());
            prevAddr = true;
        }
    }

    windowname.append(")");

    setWindowTitle(windowname);
#ifndef Q_WS_MAC
    //qApp->setWindowIcon(QIcon(":/core/images/qtcreator_logo_128.png"));
#endif

    // Add status bar
    setStatusBar(createStatusBar());

    // Set the application style (not the same as a style sheet)
    // Set the style to Plastique
    qApp->setStyle("plastique");
    // Set style sheet as last step
    reloadStylesheet();

    joystick = new JoystickInput();

155 156 157
    // Create actions
    connectActions();

158 159 160 161 162
    // Load widgets and show application window
    loadWidgets();

    // Adjust the size
    adjustSize();
lm's avatar
lm committed
163 164 165

    //
    connect(mavlink, SIGNAL(receiveLossChanged(float)), info, SLOT(updateReceiveLoss(float)));
pixhawk's avatar
pixhawk committed
166 167
}

pixhawk's avatar
pixhawk committed
168
MainWindow::~MainWindow()
pixhawk's avatar
pixhawk committed
169 170 171 172 173
{
    delete statusBar;
    statusBar = NULL;
}

pixhawk's avatar
pixhawk committed
174
QStatusBar* MainWindow::createStatusBar()
pixhawk's avatar
pixhawk committed
175 176 177 178 179 180 181 182
{
    QStatusBar* bar = new QStatusBar();
    /* Add status fields and messages */
    /* Enable resize grip in the bottom right corner */
    bar->setSizeGripEnabled(true);
    return bar;
}

pixhawk's avatar
pixhawk committed
183
void MainWindow::startVideoCapture()
pixhawk's avatar
pixhawk committed
184 185 186 187 188 189 190 191 192 193 194
{
    QString format = "bmp";
    QString initialPath = QDir::currentPath() + tr("/untitled.") + format;

    QString screenFileName = QFileDialog::getSaveFileName(this, tr("Save As"),
                                                          initialPath,
                                                          tr("%1 Files (*.%2);;All Files (*)")
                                                          .arg(format.toUpper())
                                                          .arg(format));
    delete videoTimer;
    videoTimer = new QTimer(this);
195 196 197
    //videoTimer->setInterval(40);
    //connect(videoTimer, SIGNAL(timeout()), this, SLOT(saveScreen()));
    //videoTimer->stop();
pixhawk's avatar
pixhawk committed
198 199
}

pixhawk's avatar
pixhawk committed
200
void MainWindow::stopVideoCapture()
pixhawk's avatar
pixhawk committed
201 202 203 204 205 206
{
    videoTimer->stop();

    // TODO Convert raw images to PNG
}

pixhawk's avatar
pixhawk committed
207
void MainWindow::saveScreen()
pixhawk's avatar
pixhawk committed
208 209 210 211 212 213 214 215 216 217
{
    QPixmap window = QPixmap::grabWindow(this->winId());
    QString format = "bmp";

    if (!screenFileName.isEmpty())
    {
        window.save(screenFileName, format.toAscii());
    }
}

218 219 220 221 222 223
/**
 * Reload the style sheet from disk. The function tries to load "qgroundcontrol.css" from the application
 * directory (which by default does not exist). If it fails, it will load the bundled default CSS
 * from memory.
 * To customize the application, just create a qgroundcontrol.css file in the application directory
 */
pixhawk's avatar
pixhawk committed
224
void MainWindow::reloadStylesheet()
pixhawk's avatar
pixhawk committed
225 226
{
    // Load style sheet
227 228 229 230 231 232 233 234
    QFile* styleSheet = new QFile(QCoreApplication::applicationDirPath() + "/qgroundcontrol.css");
    if (!styleSheet->exists())
    {
        styleSheet = new QFile(":/images/style-mission.css");
    }
    if (styleSheet->open(QIODevice::ReadOnly | QIODevice::Text)) {
        QString style = QString(styleSheet->readAll());
        style.replace("ICONDIR", QCoreApplication::applicationDirPath()+ "/images/");
pixhawk's avatar
pixhawk committed
235 236
        qApp->setStyleSheet(style);
    } else {
237
        qDebug() << "Style not set:" << styleSheet->fileName() << "opened: " << styleSheet->isOpen();
pixhawk's avatar
pixhawk committed
238
    }
239
    delete styleSheet;
pixhawk's avatar
pixhawk committed
240 241
}

pixhawk's avatar
pixhawk committed
242
void MainWindow::showStatusMessage(const QString& status, int timeout)
pixhawk's avatar
pixhawk committed
243 244 245 246
{
    statusBar->showMessage(status, timeout);
}

247
void MainWindow::showStatusMessage(const QString& status)
pixhawk's avatar
pixhawk committed
248
{
249
    statusBar->showMessage(status, 5);
pixhawk's avatar
pixhawk committed
250 251 252 253 254 255
}

/**
* @brief Create all actions associated to the main window
*
**/
pixhawk's avatar
pixhawk committed
256
void MainWindow::connectActions()
pixhawk's avatar
pixhawk committed
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
{
    // Connect actions from ui
    connect(ui.actionAdd_Link, SIGNAL(triggered()), this, SLOT(addLink()));

    // Connect internal actions
    connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), this, SLOT(UASCreated(UASInterface*)));

    // Connect user interface controls
    connect(ui.actionLiftoff, SIGNAL(triggered()), UASManager::instance(), SLOT(launchActiveUAS()));
    connect(ui.actionLand, SIGNAL(triggered()), UASManager::instance(), SLOT(returnActiveUAS()));
    connect(ui.actionEmergency_Land, SIGNAL(triggered()), UASManager::instance(), SLOT(stopActiveUAS()));
    connect(ui.actionEmergency_Kill, SIGNAL(triggered()), UASManager::instance(), SLOT(killActiveUAS()));

    connect(ui.actionConfiguration, SIGNAL(triggered()), UASManager::instance(), SLOT(configureActiveUAS()));

    // User interface actions
    connect(ui.actionPilotView, SIGNAL(triggered()), this, SLOT(loadPilotView()));
    connect(ui.actionEngineerView, SIGNAL(triggered()), this, SLOT(loadEngineerView()));
    connect(ui.actionOperatorView, SIGNAL(triggered()), this, SLOT(loadOperatorView()));
    connect(ui.actionSettingsView, SIGNAL(triggered()), this, SLOT(loadSettingsView()));
277
    connect(ui.actionShow_full_view, SIGNAL(triggered()), this, SLOT(loadAllView()));
pixhawk's avatar
pixhawk committed
278 279 280 281 282 283
    connect(ui.actionStyleConfig, SIGNAL(triggered()), this, SLOT(reloadStylesheet()));

    // Joystick configuration
    connect(ui.actionJoystickSettings, SIGNAL(triggered()), this, SLOT(configure()));
}

pixhawk's avatar
pixhawk committed
284
void MainWindow::configure()
pixhawk's avatar
pixhawk committed
285 286 287 288
{
    joystickWidget = new JoystickWidget(joystick, this);
}

pixhawk's avatar
pixhawk committed
289
void MainWindow::addLink()
pixhawk's avatar
pixhawk committed
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304
{
    SerialLink* link = new SerialLink();
    // TODO This should be only done in the dialog itself

    LinkManager::instance()->addProtocol(link, mavlink);

    CommConfigurationWindow* commWidget = new CommConfigurationWindow(link, mavlink, this);

    ui.menuNetwork->addAction(commWidget->getAction());

    commWidget->show();

    // TODO Implement the link removal!
}

pixhawk's avatar
pixhawk committed
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319
void MainWindow::addLink(LinkInterface *link)
{
    CommConfigurationWindow* commWidget = new CommConfigurationWindow(link, mavlink, this);
    ui.menuNetwork->addAction(commWidget->getAction());
    LinkManager::instance()->addProtocol(link, mavlink);

    // Special case for simulationlink
    MAVLinkSimulationLink* sim = dynamic_cast<MAVLinkSimulationLink*>(link);
    if (sim)
    {
        connect(sim, SIGNAL(valueChanged(int,QString,double,quint64)), linechart, SLOT(appendData(int,QString,double,quint64)));
        connect(ui.actionSimulate, SIGNAL(triggered(bool)), sim, SLOT(connectLink(bool)));
    }
}

pixhawk's avatar
pixhawk committed
320
void MainWindow::UASCreated(UASInterface* uas)
pixhawk's avatar
pixhawk committed
321 322
{
    // Connect the UAS to the full user interface
lm's avatar
lm committed
323
    //ui.menuConnected_Systems->addAction(QIcon(":/images/mavs/generic.svg"), tr("View ") + uas->getUASName(), uas, SLOT(setSelected()));
pixhawk's avatar
pixhawk committed
324 325

    // Line chart
pixhawk's avatar
pixhawk committed
326 327 328 329 330 331 332
    // FIXME DO THIS ONLY FOR THE FIRST CONNECTED SYSTEM
    static bool sysPresent = false;
    if (!sysPresent)
    {
        connect(uas, SIGNAL(valueChanged(int,QString,double,quint64)), linechart, SLOT(appendData(int,QString,double,quint64)), Qt::QueuedConnection);
        sysPresent = true;
    }
pixhawk's avatar
pixhawk committed
333

334 335 336
    // FIXME Should be not inside the mainwindow
    connect(uas, SIGNAL(textMessageReceived(int,int,QString)), debugConsole, SLOT(receiveTextMessage(int,int,QString)));

pixhawk's avatar
pixhawk committed
337 338 339 340 341 342 343 344 345 346 347 348 349 350
    // Health / System status indicator
    info->addUAS(uas);

    // UAS List
    list->addUAS(uas);

    // Camera view
    //camera->addUAS(uas);

    // Revalidate UI
    // TODO Stylesheet reloading should in theory not be necessary
    reloadStylesheet();
}

351 352 353
/**
 * Clears the current view completely
 */
pixhawk's avatar
pixhawk committed
354
void MainWindow::clearView()
pixhawk's avatar
pixhawk committed
355 356 357
{ 
    // Halt HUD
    hud->stop();
358
    linechart->setActive(false);
pixhawk's avatar
pixhawk committed
359 360
    headDown1->stop();
    headDown2->stop();
pixhawk's avatar
pixhawk committed
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380

    // Remove all dock widgets
    QList<QObject*> list = this->children();

    QList<QObject*>::iterator i;
    for (i = list.begin(); i != list.end(); ++i)
    {
        QDockWidget* widget = dynamic_cast<QDockWidget*>(*i);
        if (widget)
        {
            // Hide widgets
            QWidget* childWidget = dynamic_cast<QWidget*>(widget->widget());
            if (childWidget) childWidget->setVisible(false);
            // Remove dock widget
            this->removeDockWidget(widget);
            //delete widget;
        }
    }
}

pixhawk's avatar
pixhawk committed
381
void MainWindow::loadPilotView()
pixhawk's avatar
pixhawk committed
382 383
{
    clearView();
pixhawk's avatar
pixhawk committed
384
    GAudioOutput::instance()->say("Switched to Pilot View");
pixhawk's avatar
pixhawk committed
385 386 387 388 389 390

    // HEAD UP DISPLAY
    centerStack->setCurrentWidget(hud);
    hud->start();

    //connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), pfd, SLOT(setActiveUAS(UASInterface*)));
pixhawk's avatar
pixhawk committed
391
    QDockWidget* container1 = new QDockWidget(tr("Primary Flight Display"), this);
pixhawk's avatar
pixhawk committed
392 393 394
    container1->setWidget(headDown1);
    addDockWidget(Qt::RightDockWidgetArea, container1);

pixhawk's avatar
pixhawk committed
395
    QDockWidget* container2 = new QDockWidget(tr("Payload Status"), this);
pixhawk's avatar
pixhawk committed
396 397
    container2->setWidget(headDown2);
    addDockWidget(Qt::RightDockWidgetArea, container2);
pixhawk's avatar
pixhawk committed
398 399 400 401

    headDown1->start();
    headDown2->start();

pixhawk's avatar
pixhawk committed
402 403 404
    this->show();
}

pixhawk's avatar
pixhawk committed
405
void MainWindow::loadOperatorView()
pixhawk's avatar
pixhawk committed
406 407 408
{
    clearView();

pixhawk's avatar
pixhawk committed
409 410
    GAudioOutput::instance()->say("Switched to Operator View");

411
    // MAP
pixhawk's avatar
pixhawk committed
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446
    centerStack->setCurrentWidget(map);

    // UAS CONTROL
    QDockWidget* container1 = new QDockWidget(tr("Control"), this);
    container1->setWidget(control);
    addDockWidget(Qt::LeftDockWidgetArea, container1);

    // UAS LIST
    QDockWidget* container4 = new QDockWidget(tr("Unmanned Systems"), this);
    container4->setWidget(list);
    addDockWidget(Qt::BottomDockWidgetArea, container4);

    // UAS STATUS
    QDockWidget* container3 = new QDockWidget(tr("Status Details"), this);
    container3->setWidget(info);
    addDockWidget(Qt::LeftDockWidgetArea, container3);

    // WAYPOINT LIST
    QDockWidget* container5 = new QDockWidget(tr("Waypoint List"), this);
    container5->setWidget(waypoints);
    addDockWidget(Qt::BottomDockWidgetArea, container5);

    // DEBUG CONSOLE
    QDockWidget* container7 = new QDockWidget(tr("Communication Console"), this);
    container7->setWidget(debugConsole);
    addDockWidget(Qt::BottomDockWidgetArea, container7);

    // OBJECT DETECTION
    QDockWidget* container6 = new QDockWidget(tr("Object Recognition"), this);
    container6->setWidget(detection);
    addDockWidget(Qt::RightDockWidgetArea, container6);

    this->show();
}

pixhawk's avatar
pixhawk committed
447
void MainWindow::loadSettingsView()
pixhawk's avatar
pixhawk committed
448 449 450
{
    clearView();

pixhawk's avatar
pixhawk committed
451 452
    GAudioOutput::instance()->say("Switched to Settings View");

pixhawk's avatar
pixhawk committed
453
    // LINE CHART
454
    linechart->setActive(true);
pixhawk's avatar
pixhawk committed
455 456 457 458 459 460 461 462 463 464 465 466 467
    centerStack->setCurrentWidget(linechart);

    // COMM XML
    QDockWidget* container1 = new QDockWidget(tr("MAVLink XML to C Code Generator"), this);
    container1->setWidget(protocol);
    addDockWidget(Qt::LeftDockWidgetArea, container1);

    // ONBOARD PARAMETERS
    QDockWidget* container6 = new QDockWidget(tr("Onboard Parameters"), this);
    container6->setWidget(parameters);
    addDockWidget(Qt::RightDockWidgetArea, container6);
}

pixhawk's avatar
pixhawk committed
468
void MainWindow::loadEngineerView()
pixhawk's avatar
pixhawk committed
469 470 471 472
{
    clearView();
    // Engineer view, used in EMAV2009

pixhawk's avatar
pixhawk committed
473 474
    GAudioOutput::instance()->say("Switched to Engineer View");

pixhawk's avatar
pixhawk committed
475
    // LINE CHART
476
    linechart->setActive(true);
pixhawk's avatar
pixhawk committed
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506
    centerStack->setCurrentWidget(linechart);

    // UAS CONTROL
    QDockWidget* container1 = new QDockWidget(tr("Control"), this);
    container1->setWidget(control);
    addDockWidget(Qt::LeftDockWidgetArea, container1);

    // UAS LIST
    QDockWidget* container4 = new QDockWidget(tr("Unmanned Systems"), this);
    container4->setWidget(list);
    addDockWidget(Qt::BottomDockWidgetArea, container4);

    // UAS STATUS
    QDockWidget* container3 = new QDockWidget(tr("Status Details"), this);
    container3->setWidget(info);
    addDockWidget(Qt::LeftDockWidgetArea, container3);

    // WAYPOINT LIST
    QDockWidget* container5 = new QDockWidget(tr("Waypoint List"), this);
    container5->setWidget(waypoints);
    addDockWidget(Qt::BottomDockWidgetArea, container5);

    // DEBUG CONSOLE
    QDockWidget* container7 = new QDockWidget(tr("Communication Console"), this);
    container7->setWidget(debugConsole);
    addDockWidget(Qt::BottomDockWidgetArea, container7);

    this->show();
}

507 508
void MainWindow::loadAllView()
{
509 510 511 512 513 514 515 516 517 518
    clearView();
    GAudioOutput::instance()->say("Loaded complete view");

    QDockWidget* containerPFD = new QDockWidget(tr("Primary Flight Display"), this);
    containerPFD->setWidget(headDown1);
    addDockWidget(Qt::RightDockWidgetArea, containerPFD);

    QDockWidget* containerPayload = new QDockWidget(tr("Payload Status"), this);
    containerPayload->setWidget(headDown2);
    addDockWidget(Qt::RightDockWidgetArea, containerPayload);
519

520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562
    headDown1->start();
    headDown2->start();

    // UAS CONTROL
    QDockWidget* containerControl = new QDockWidget(tr("Control"), this);
    containerControl->setWidget(control);
    addDockWidget(Qt::LeftDockWidgetArea, containerControl);

    // UAS LIST
    QDockWidget* containerUASList = new QDockWidget(tr("Unmanned Systems"), this);
    containerUASList->setWidget(list);
    addDockWidget(Qt::BottomDockWidgetArea, containerUASList);

    // UAS STATUS
    QDockWidget* containerStatus = new QDockWidget(tr("Status Details"), this);
    containerStatus->setWidget(info);
    addDockWidget(Qt::LeftDockWidgetArea, containerStatus);

    // WAYPOINT LIST
    QDockWidget* containerWaypoints = new QDockWidget(tr("Waypoint List"), this);
    containerWaypoints->setWidget(waypoints);
    addDockWidget(Qt::BottomDockWidgetArea, containerWaypoints);

    // DEBUG CONSOLE
    QDockWidget* containerComm = new QDockWidget(tr("Communication Console"), this);
    containerComm->setWidget(debugConsole);
    addDockWidget(Qt::BottomDockWidgetArea, containerComm);

    // OBJECT DETECTION
    QDockWidget* containerObjRec = new QDockWidget(tr("Object Recognition"), this);
    containerObjRec->setWidget(detection);
    addDockWidget(Qt::RightDockWidgetArea, containerObjRec);

    // LINE CHART
    linechart->setActive(true);
    centerStack->setCurrentWidget(linechart);

    // ONBOARD PARAMETERS
    QDockWidget* containerParams = new QDockWidget(tr("Onboard Parameters"), this);
    containerParams->setWidget(parameters);
    addDockWidget(Qt::RightDockWidgetArea, containerParams);

    this->show();
563 564
}

pixhawk's avatar
pixhawk committed
565
void MainWindow::loadWidgets()
pixhawk's avatar
pixhawk committed
566
{
567 568
    //loadOperatorView();
    loadEngineerView();
pixhawk's avatar
pixhawk committed
569 570
    //loadPilotView();
}