Browse Source

added class for radio calibration window

QGC4.4
Bryan Godbolt 15 years ago
parent
commit
2ad4430fe5
  1. 9
      src/ui/QGCRemoteControlView.cc
  2. 3
      src/ui/QGCRemoteControlView.h
  3. 6
      src/ui/RadioCalibration/RadioCalibrationWindow.cc
  4. 50
      src/ui/RadioCalibration/RadioCalibrationWindow.h

9
src/ui/QGCRemoteControlView.cc

@ -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
* @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) : @@ -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)));
}

3
src/ui/QGCRemoteControlView.h

@ -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 <QVector>
#include <QPushButton>
namespace Ui {
class QGCRemoteControlView;
@ -68,6 +69,8 @@ protected: @@ -68,6 +69,8 @@ protected:
QVector<QProgressBar*> progressBars;
QProgressBar* rssiBar;
QLabel* nameLabel;
QPushButton *calibrate;
QWidget *calibrationWindow;
private:
Ui::QGCRemoteControlView *ui;

6
src/ui/RadioCalibration/RadioCalibrationWindow.cc

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
#include "RadioCalibrationWindow.h"
RadioCalibrationWindow::RadioCalibrationWindow(QWidget *parent) :
QWidget(parent, Qt::Window)
{
}

50
src/ui/RadioCalibration/RadioCalibrationWindow.h

@ -0,0 +1,50 @@ @@ -0,0 +1,50 @@
#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
Loading…
Cancel
Save