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
* @file
* @brief Implementation of QGCRemoteControlView
* @author Lorenz Meier <mail@qgroundcontrol.org>
* @author Bryan Godbolt <godbolt@ece.ualberta.ca>
*/
#include <QGridLayout>
......@@ -70,6 +71,14 @@ QGCRemoteControlView::QGCRemoteControlView(QWidget *parent) :
layout->addItem(rssiLayout, 2, 0, 1, 2);
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)));
}
......
......@@ -32,6 +32,7 @@ This file is part of the QGROUNDCONTROL project
#include <QWidget>
#include <QVector>
#include <QPushButton>
namespace Ui {
class QGCRemoteControlView;
......@@ -68,6 +69,8 @@ protected:
QVector<QProgressBar*> progressBars;
QProgressBar* rssiBar;
QLabel* nameLabel;
QPushButton *calibrate;
QWidget *calibrationWindow;
private:
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