コード例 #1
0
DroneshareUploadDialog::DroneshareUploadDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DroneshareUploadDialog),
    m_uasInterface(NULL),
    m_droneshareUpload(NULL),
    m_droneshareQuery(NULL)
{
    ui->setupUi(this);

    connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(closeButtonClicked()));
    connect(ui->uploadButton, SIGNAL(clicked()), this, SLOT(uploadClicked()));

    connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)),
            this, SLOT(activeUASSet(UASInterface*)));
    activeUASSet(UASManager::instance()->getActiveUAS());
}
コード例 #2
0
MissionElevationDisplay::MissionElevationDisplay(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::MissionElevationDisplay),
    m_uasInterface(NULL),
    m_uasWaypointMgr(NULL),
    m_totalDistance(0),
    m_elevationData(NULL),
    m_useHomeAltOffset(false),
    m_homeAltOffset(0.0),
    m_elevationShown(false)
{
    ui->setupUi(this);

    ui->sampleSpinBox->setEnabled(false);

    QCustomPlot* customPlot = ui->customPlot;
    customPlot->addGraph(); // Mission Elevation Graph (ElevationGraphMissionId)
    customPlot->graph(ElevationGraphMissionId)->setPen(QPen(Qt::blue)); // line color blue for mission data
    customPlot->graph(ElevationGraphMissionId)->setBrush(QBrush(QColor(0, 0, 255, 20))); // first graph will be filled with translucent blue

    customPlot->addGraph(); // Google Elevation Graph (ElevationGraphElevationId)
    customPlot->graph(ElevationGraphElevationId)->setPen(QPen(Qt::red)); // line color red for elevation data
    customPlot->graph(ElevationGraphElevationId)->setBrush(QBrush(QColor(255, 0, 0, 20))); // first graph will be filled with translucent blue
    customPlot->graph(ElevationGraphElevationId)->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssDiamond, 10));
    customPlot->xAxis->setLabel("distance (m)");
    customPlot->yAxis->setLabel("altitude (m)");
    // set default ranges for Alt and distance
    customPlot->xAxis->setRange(0,ElevationDefaultDistanceMax); //m
    customPlot->yAxis->setRange(ElevationDefaultAltMin,ElevationDefaultAltMax); //m

    QFont legendFont = font();
    legendFont.setPointSize(9);
    customPlot->legend->setFont(legendFont);

    // set a more compact font size for bottom and left axis tick labels:
    customPlot->xAxis->setTickLabelFont(QFont(QFont().family(), 9));
    customPlot->xAxis->setLabelFont(QFont(QFont().family(), 9));
    customPlot->yAxis->setTickLabelFont(QFont(QFont().family(), 9));
    customPlot->yAxis->setLabelFont(QFont(QFont().family(), 9));

    customPlot->replot();

    connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUASSet(UASInterface*)));
    activeUASSet(UASManager::instance()->getActiveUAS());

    connect(ui->infoButton, SIGNAL(clicked()), this, SLOT(showInfoBox()));
}
コード例 #3
0
CompassMotorCalibrationDialog::CompassMotorCalibrationDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::CompassMotorCalibrationDialog),
    m_uasInterface(NULL)
{
    ui->setupUi(this);

    QCustomPlot* customPlot = ui->customPlot;
    customPlot->addGraph();
    customPlot->graph(GRAPH_ID_INTERFERENCE)->setPen(QPen(GRAPH_COLOR_INTERFERENCE)); // line color blue for first graph
    customPlot->graph(GRAPH_ID_INTERFERENCE)->setBrush(QBrush(GRAPH_COLOR_INTERFERENCE_FILL)); // first graph will be filled with translucent blue

    customPlot->xAxis->setLabel("Throttle (%)");

    customPlot->yAxis->setLabel("Interference (%)");
    customPlot->yAxis->setLabelColor(GRAPH_COLOR_INTERFERENCE);
    customPlot->xAxis->setRange(0,100);
    customPlot->yAxis->setRange(0,100);

    customPlot->addGraph();
    customPlot->graph(GRAPH_ID_CURRENT)->setPen(QPen(GRAPH_COLOR_CURRENT)); // line color red for second graph
    customPlot->graph(GRAPH_ID_CURRENT)->setBrush(QBrush(GRAPH_COLOR_CURRENT_FILL));

    customPlot->yAxis2->setVisible(true);
    customPlot->yAxis2->setLabel("Amps (A)");
    customPlot->yAxis2->setLabelColor(GRAPH_COLOR_CURRENT);
    customPlot->xAxis2->setRange(0,100);
    customPlot->yAxis2->setRange(0,50);

    customPlot->replot();

    connect(ui->okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked()));
    connect(this, SIGNAL(about), this, SLOT(rejected()));
    connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUASSet(UASInterface*)));
    activeUASSet(UASManager::instance()->getActiveUAS());

    int ok = QMessageBox::warning(this, "Compass Motor Calibration", tr("CAUTION: Starting the compass motor calibration arms the motors.\n"
                                                               "Please make sure you have read and followed all instructions"
                                                               "before untertaking the calibration as serious injury could occur!"),
                         QMessageBox::Ok, QMessageBox::Cancel);
    if (ok == QMessageBox::Cancel){
        QTimer::singleShot(100, this, SLOT(cancelCalibration()));
    }

}
コード例 #4
0
UASActionsWidget::UASActionsWidget(QWidget *parent) : QWidget(parent)
{
    QLOG_INFO() << "UASActionsWidget creating " << this;
    m_uas = NULL;
    ui.setupUi(this);
    connect(ui.changeAltitudeButton,SIGNAL(clicked()),this,SLOT(changeAltitudeClicked()));
    connect(ui.changeSpeedButton,SIGNAL(clicked()),this,SLOT(changeSpeedClicked()));
    connect(ui.goToWaypointButton,SIGNAL(clicked()),this,SLOT(goToWaypointClicked()));
    connect(ui.armDisarmButton,SIGNAL(clicked()),this,SLOT(armButtonClicked()));
    connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUASSet(UASInterface*)));

    if (UASManager::instance()->getActiveUAS())
    {
        activeUASSet(UASManager::instance()->getActiveUAS());
    }

    // Setup Action Combo Box
    ui.actionComboBox->addItem("Loiter Unlimited", MAV_CMD_NAV_LOITER_UNLIM);
    ui.actionComboBox->addItem("Return To Launch", MAV_CMD_NAV_RETURN_TO_LAUNCH);
    ui.actionComboBox->addItem("Preflight Calibration", MAV_CMD_PREFLIGHT_CALIBRATION);
    ui.actionComboBox->addItem("Mission Start", MAV_CMD_MISSION_START);
    ui.actionComboBox->addItem("Preflight Reboot", MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN);

    connect(ui.exeActionButton, SIGNAL(clicked()),
            this, SLOT(setAction()));

    // Mode Shortcut Buttons
    connect(ui.autoModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.stabilizeModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.rtlModeButton, SIGNAL(clicked()),
            this, SLOT(setRTLMode()));
    connect(ui.loiterModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));

    connect(ui.opt1ModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.opt2ModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.opt3ModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.opt4ModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
}
コード例 #5
0
UASActionsWidget::UASActionsWidget(QWidget *parent) : QWidget(parent)
{
    QLOG_INFO() << "UASActionsWidget creating " << this;
    m_uas = NULL;
    ui.setupUi(this);
    connect(ui.changeAltitudeButton,SIGNAL(clicked()),this,SLOT(changeAltitudeClicked()));
    connect(ui.changeSpeedButton,SIGNAL(clicked()),this,SLOT(changeSpeedClicked()));
    connect(ui.goToWaypointButton,SIGNAL(clicked()),this,SLOT(goToWaypointClicked()));
    connect(ui.armDisarmButton,SIGNAL(clicked()),this,SLOT(armButtonClicked()));
    connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUASSet(UASInterface*)));

    if (UASManager::instance()->getActiveUAS())
    {
        activeUASSet(UASManager::instance()->getActiveUAS());
    }

    ui.missionGroupBox->setDisabled(true);
    ui.actionsGroupBox->setDisabled(true);
    ui.shortcutGroupBox->setDisabled(true);

    connect(ui.exeActionButton, SIGNAL(clicked()),
            this, SLOT(setAction()));

    // Mode Shortcut Buttons
    connect(ui.autoModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.stabilizeModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.rtlModeButton, SIGNAL(clicked()),
            this, SLOT(setRTLMode()));
    connect(ui.loiterModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));

    connect(ui.opt1ModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.opt2ModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.opt3ModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
    connect(ui.opt4ModeButton, SIGNAL(clicked()),
            this, SLOT(setShortcutMode()));
}
コード例 #6
0
UASRawStatusView::UASRawStatusView(QWidget *parent) : QWidget(parent)
{
    m_uas = 0;
    ui.setupUi(this);
    ui.tableWidget->setColumnCount(2);
    ui.tableWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    ui.tableWidget->setShowGrid(false);
    ui.tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
    m_tableRefreshTimer = new QTimer(this);
    connect(m_tableRefreshTimer,SIGNAL(timeout()),this,SLOT(updateTableTimerTick()));

    m_updateTimer = new QTimer(this);
    connect(m_updateTimer,SIGNAL(timeout()),this,SLOT(updateTimerTick()));

    // FIXME reinstate once fixed.

    //timer->start(2000);
    connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUASSet(UASInterface*)));
    activeUASSet(UASManager::instance()->getActiveUAS());
}
コード例 #7
0
AP2DataPlot2D::AP2DataPlot2D(QWidget *parent) : QWidget(parent),
    m_uas(NULL),
    m_logDownloadDialog(NULL),
    m_updateTimer(NULL),
    m_tlogReplayEnabled(false)
{
    m_startIndex = 0;
    m_axisGroupingDialog = 0;
    m_logLoaderThread= 0;
    m_logLoaded = false;
    m_progressDialog=0;
    m_currentIndex=0;
    m_graphCount=0;
    m_showOnlyActive = false;

    ui.setupUi(this);

    QDateTime utc = QDateTime::currentDateTimeUtc();
    utc.setTimeSpec(Qt::LocalTime);
    m_timeDiff = QDateTime::currentDateTime().msecsTo(utc);
    m_plot = new QCustomPlot(ui.widget);
    m_plot->setInteraction(QCP::iRangeDrag, true);
    m_plot->setInteraction(QCP::iRangeZoom, true);

    connect(m_plot,SIGNAL(axisDoubleClick(QCPAxis*,QCPAxis::SelectablePart,QMouseEvent*)),this,SLOT(axisDoubleClick(QCPAxis*,QCPAxis::SelectablePart,QMouseEvent*)));

    connect(m_plot,SIGNAL(mouseMove(QMouseEvent*)),this,SLOT(plotMouseMove(QMouseEvent*)));

    //ui.horizontalLayout_3->addWidget(m_plot);
    ui.verticalLayout_5->insertWidget(0,m_plot);

    m_plot->show();
    m_plot->plotLayout()->clear();

    m_wideAxisRect = new QCPAxisRect(m_plot);
    m_wideAxisRect->setupFullAxesBox(true);
    m_wideAxisRect->axis(QCPAxis::atRight, 0)->setTickLabels(false);
    m_wideAxisRect->removeAxis(m_wideAxisRect->axis(QCPAxis::atLeft,0));

    m_wideAxisRect->axis(QCPAxis::atBottom, 0)->setTickLabelType(QCPAxis::ltDateTime);
    m_wideAxisRect->axis(QCPAxis::atBottom, 0)->setDateTimeFormat("hh:mm:ss");
    m_wideAxisRect->axis(QCPAxis::atBottom, 0)->setRange(m_timeDiff / 1000,(m_timeDiff / 1000) + 100); //Default range of 0-100 milliseconds?


    m_plot->plotLayout()->addElement(0, 0, m_wideAxisRect);

    QCPMarginGroup *marginGroup = new QCPMarginGroup(m_plot);
    m_wideAxisRect->setMarginGroup(QCP::msLeft | QCP::msRight, marginGroup);

    m_dataSelectionScreen = new DataSelectionScreen(this);
    connect( m_dataSelectionScreen,SIGNAL(itemEnabled(QString)),this,SLOT(itemEnabled(QString)));
    connect( m_dataSelectionScreen,SIGNAL(itemDisabled(QString)),this,SLOT(itemDisabled(QString)));
    ui.horizontalLayout_3->addWidget(m_dataSelectionScreen);

    ui.horizontalLayout_3->setStretch(0,5);
    ui.horizontalLayout_3->setStretch(1,1);

    connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUASSet(UASInterface*)));
    activeUASSet(UASManager::instance()->getActiveUAS());

    ui.tableWidget->setContextMenuPolicy(Qt::ActionsContextMenu);

    m_addGraphAction = new QAction("Add To Graph",0);
    ui.tableWidget->addAction(m_addGraphAction);
    connect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(addGraphLeft()));

    ui.tableWidget->setVisible(false);
    ui.hideExcelView->setVisible(false);

    connect(ui.loadOfflineLogButton,SIGNAL(clicked()),this,SLOT(loadButtonClicked()));
    connect(ui.autoScrollCheckBox,SIGNAL(clicked(bool)),this,SLOT(autoScrollClicked(bool)));
    connect(ui.hideExcelView,SIGNAL(clicked(bool)),ui.tableWidget,SLOT(setHidden(bool)));
    connect(ui.tableWidget,SIGNAL(cellClicked(int,int)),this,SLOT(tableCellClicked(int,int)));

    ui.logTypeLabel->setText("<p align=\"center\"><span style=\" font-size:24pt; color:#0000ff;\">Live Data</span></p>");


    connect(ui.graphControlsPushButton,SIGNAL(clicked()),this,SLOT(graphControlsButtonClicked()));
    model = new QStandardItemModel();
    connect(ui.toKMLPushButton, SIGNAL(clicked()), this, SIGNAL(toKMLClicked()));
    connect(ui.horizontalScrollBar,SIGNAL(sliderMoved(int)),this,SLOT(horizontalScrollMoved(int)));
    connect(ui.verticalScrollBar,SIGNAL(sliderMoved(int)),this,SLOT(verticalScrollMoved(int)));

    connect(ui.horizontalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(horizontalScrollMoved(int)));
    connect(ui.verticalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(verticalScrollMoved(int)));
    connect(m_wideAxisRect->axis(QCPAxis::atBottom), SIGNAL(rangeChanged(QCPRange)), this, SLOT(xAxisChanged(QCPRange)));
    m_plot->setPlottingHint(QCP::phFastPolylines,true);

    connect(ui.downloadPushButton, SIGNAL(clicked()), this, SLOT(showLogDownloadDialog()));
    ui.downloadPushButton->setEnabled(false);
    connect(ui.loadTLogButton,SIGNAL(clicked()),this,SLOT(replyTLogButtonClicked()));
}