Commit 2ad4430f authored by Bryan Godbolt's avatar Bryan Godbolt

added class for radio calibration window

parent d09690cc
...@@ -25,6 +25,7 @@ This file is part of the QGROUNDCONTROL project ...@@ -25,6 +25,7 @@ This file is part of the QGROUNDCONTROL project
* @file * @file
* @brief Implementation of QGCRemoteControlView * @brief Implementation of QGCRemoteControlView
* @author Lorenz Meier <mail@qgroundcontrol.org> * @author Lorenz Meier <mail@qgroundcontrol.org>
* @author Bryan Godbolt <godbolt@ece.ualberta.ca>
*/ */
#include <QGridLayout> #include <QGridLayout>
...@@ -70,6 +71,14 @@ QGCRemoteControlView::QGCRemoteControlView(QWidget *parent) : ...@@ -70,6 +71,14 @@ QGCRemoteControlView::QGCRemoteControlView(QWidget *parent) :
layout->addItem(rssiLayout, 2, 0, 1, 2); layout->addItem(rssiLayout, 2, 0, 1, 2);
setVisible(false); setVisible(false);
calibrate = new QPushButton(tr("Calibrate"), this);
QHBoxLayout *calibrateButtonLayout = new QHBoxLayout();
calibrateButtonLayout->addWidget(calibrate, 0, Qt::AlignHCenter);
layout->addItem(calibrateButtonLayout, 3, 0, 1, 2);
calibrationWindow = new QWidget(this, Qt::Window);
connect(calibrate, SIGNAL(clicked()), calibrationWindow, SLOT(show()));
connect(UASManager::instance(), SIGNAL(activeUASSet(int)), this, SLOT(setUASId(int))); connect(UASManager::instance(), SIGNAL(activeUASSet(int)), this, SLOT(setUASId(int)));
} }
......
...@@ -32,6 +32,7 @@ This file is part of the QGROUNDCONTROL project ...@@ -32,6 +32,7 @@ This file is part of the QGROUNDCONTROL project
#include <QWidget> #include <QWidget>
#include <QVector> #include <QVector>
#include <QPushButton>
namespace Ui { namespace Ui {
class QGCRemoteControlView; class QGCRemoteControlView;
...@@ -68,6 +69,8 @@ protected: ...@@ -68,6 +69,8 @@ protected:
QVector<QProgressBar*> progressBars; QVector<QProgressBar*> progressBars;
QProgressBar* rssiBar; QProgressBar* rssiBar;
QLabel* nameLabel; QLabel* nameLabel;
QPushButton *calibrate;
QWidget *calibrationWindow;
private: private:
Ui::QGCRemoteControlView *ui; Ui::QGCRemoteControlView *ui;
......
#include "RadioCalibrationWindow.h"
RadioCalibrationWindow::RadioCalibrationWindow(QWidget *parent) :
QWidget(parent, Qt::Window)
{
}
#ifndef RADIOCALIBRATIONWINDOW_H
#define RADIOCALIBRATIONWINDOW_H
#include <QWidget>
#include <QLabel>
#include <QGroupBox>
#include <QPushButton>
#include <QVector>
class RadioCalibrationWindow : public QWidget
{
Q_OBJECT
public:
explicit RadioCalibrationWindow(QWidget *parent = 0);
signals:
public slots:
protected:
class AirfoilServoCalibrator : public QWidget
{
Q_OBJECT
public:
explicit AirfoilServoCalibrator(QWidget *parent=0);
signals:
void highSetpointChanged(float);
void centerSetpointChanged(float);
void lowSetpointChanged(float);
public slots:
void channelChanged(float raw);
protected:
QLabel *pulseWidth;
QPushButton *highButton;
QPushButton *centerButton;
QPushButton *lowButton;
float high;
float center;
float low;
QVector<float> log;
};
};
#endif // RADIOCALIBRATIONWINDOW_H
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