Commit 89056b9e authored by Don Gagne's avatar Don Gagne

Stream rate widget no longer supported

parent d9e8402f
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
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.
QGROUNDCONTROL is distributed in the hope that it will be useful,
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
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Implementation of QGCSensorSettingsWidget
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#include "QGCSensorSettingsWidget.h"
#include "ui_QGCSensorSettingsWidget.h"
QGCSensorSettingsWidget::QGCSensorSettingsWidget(UASInterface* uas, QWidget *parent) :
QWidget(parent),
mav(uas),
ui(new Ui::QGCSensorSettingsWidget)
{
ui->setupUi(this);
// Set up delay timers
delayedSendRawSensorTimer.setInterval(800);
delayedSendControllerTimer.setInterval(800);
delayedSendExtendedTimer.setInterval(800);
delayedSendRCTimer.setInterval(800);
delayedSendPositionTimer.setInterval(800);
delayedSendExtra1Timer.setInterval(800);
delayedSendExtra2Timer.setInterval(800);
delayedSendExtra3Timer.setInterval(800);
connect(&delayedSendRawSensorTimer, SIGNAL(timeout()), this, SLOT(sendRawSensor()));
connect(&delayedSendControllerTimer, SIGNAL(timeout()), this, SLOT(sendController()));
connect(&delayedSendExtendedTimer, SIGNAL(timeout()), this, SLOT(sendExtended()));
connect(&delayedSendRCTimer, SIGNAL(timeout()), this, SLOT(sendRC()));
connect(&delayedSendPositionTimer, SIGNAL(timeout()), this, SLOT(sendPosition()));
connect(&delayedSendExtra1Timer, SIGNAL(timeout()), this, SLOT(sendExtra1()));
connect(&delayedSendExtra2Timer, SIGNAL(timeout()), this, SLOT(sendExtra2()));
connect(&delayedSendExtra3Timer, SIGNAL(timeout()), this, SLOT(sendExtra3()));
// Connect UI
connect(ui->spinBox_rawSensor, SIGNAL(valueChanged(int)), this, SLOT(delayedSendRawSensor(int)));//mav, SLOT(enableRawSensorDataTransmission(int)));
connect(ui->spinBox_controller, SIGNAL(valueChanged(int)), this, SLOT(delayedSendController(int)));
connect(ui->spinBox_extended, SIGNAL(valueChanged(int)), this, SLOT(delayedSendExtended(int)));
connect(ui->spinBox_rc, SIGNAL(valueChanged(int)), this, SLOT(delayedSendRC(int)));
connect(ui->spinBox_position, SIGNAL(valueChanged(int)), this, SLOT(delayedSendPosition(int)));
connect(ui->spinBox_extra1, SIGNAL(valueChanged(int)), this, SLOT(delayedSendExtra1(int)));
connect(ui->spinBox_extra2, SIGNAL(valueChanged(int)), this, SLOT(delayedSendExtra2(int)));
connect(ui->spinBox_extra3, SIGNAL(valueChanged(int)), this, SLOT(delayedSendExtra3(int)));
// Calibration
connect(ui->rcCalButton, SIGNAL(clicked()), mav, SLOT(startRadioControlCalibration()));
connect(ui->magCalButton, SIGNAL(clicked()), mav, SLOT(startMagnetometerCalibration()));
connect(ui->pressureCalButton, SIGNAL(clicked()), mav, SLOT(startPressureCalibration()));
connect(ui->gyroCalButton, SIGNAL(clicked()), mav, SLOT(startGyroscopeCalibration()));
// Hide the calibration stuff - done in custom widgets anyway
ui->groupBox_3->hide();
}
void QGCSensorSettingsWidget::delayedSendRawSensor(int rate)
{
Q_UNUSED(rate);
delayedSendRawSensorTimer.start();
}
void QGCSensorSettingsWidget::delayedSendController(int rate)
{
Q_UNUSED(rate);
delayedSendControllerTimer.start();
}
void QGCSensorSettingsWidget::delayedSendExtended(int rate)
{
Q_UNUSED(rate);
delayedSendExtendedTimer.start();
}
void QGCSensorSettingsWidget::delayedSendRC(int rate)
{
Q_UNUSED(rate);
delayedSendRCTimer.start();
}
void QGCSensorSettingsWidget::delayedSendPosition(int rate)
{
Q_UNUSED(rate);
delayedSendPositionTimer.start();
}
void QGCSensorSettingsWidget::delayedSendExtra1(int rate)
{
Q_UNUSED(rate);
delayedSendExtra1Timer.start();
}
void QGCSensorSettingsWidget::delayedSendExtra2(int rate)
{
Q_UNUSED(rate);
delayedSendExtra2Timer.start();
}
void QGCSensorSettingsWidget::delayedSendExtra3(int rate)
{
Q_UNUSED(rate);
delayedSendExtra3Timer.start();
}
void QGCSensorSettingsWidget::sendRawSensor()
{
delayedSendRawSensorTimer.stop();
mav->enableRawSensorDataTransmission(ui->spinBox_rawSensor->value());
}
void QGCSensorSettingsWidget::sendController()
{
delayedSendControllerTimer.stop();
mav->enableRawControllerDataTransmission(ui->spinBox_controller->value());
}
void QGCSensorSettingsWidget::sendExtended()
{
delayedSendExtendedTimer.stop();
mav->enableExtendedSystemStatusTransmission(ui->spinBox_extended->value());
}
void QGCSensorSettingsWidget::sendRC()
{
delayedSendRCTimer.stop();
mav->enableRCChannelDataTransmission(ui->spinBox_rc->value());
}
void QGCSensorSettingsWidget::sendPosition()
{
delayedSendPositionTimer.stop();
mav->enablePositionTransmission(ui->spinBox_position->value());
}
void QGCSensorSettingsWidget::sendExtra1()
{
delayedSendExtra1Timer.stop();
mav->enableExtra1Transmission(ui->spinBox_extra1->value());
}
void QGCSensorSettingsWidget::sendExtra2()
{
delayedSendExtra2Timer.stop();
mav->enableExtra2Transmission(ui->spinBox_extra2->value());
}
void QGCSensorSettingsWidget::sendExtra3()
{
delayedSendExtra3Timer.stop();
mav->enableExtra3Transmission(ui->spinBox_extra3->value());
}
QGCSensorSettingsWidget::~QGCSensorSettingsWidget()
{
delete ui;
}
void QGCSensorSettingsWidget::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
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.
QGROUNDCONTROL is distributed in the hope that it will be useful,
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
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Declaration of class QGCSensorSettingsWidget
* @author Lorenz Meier <mail@qgroundcontrol.org>
*/
#ifndef QGCSENSORSETTINGSWIDGET_H
#define QGCSENSORSETTINGSWIDGET_H
#include <QWidget>
#include "UASInterface.h"
namespace Ui
{
class QGCSensorSettingsWidget;
}
class QGCSensorSettingsWidget : public QWidget
{
Q_OBJECT
public:
QGCSensorSettingsWidget(UASInterface* uas, QWidget *parent = 0);
~QGCSensorSettingsWidget();
public slots:
void delayedSendRawSensor(int rate);
void delayedSendController(int rate);
void delayedSendExtended(int rate);
void delayedSendRC(int rate);
void delayedSendPosition(int rate);
void delayedSendExtra1(int rate);
void delayedSendExtra2(int rate);
void delayedSendExtra3(int rate);
protected:
UASInterface* mav;
QTimer delayedSendRawSensorTimer;
QTimer delayedSendControllerTimer;
QTimer delayedSendExtendedTimer;
QTimer delayedSendRCTimer;
QTimer delayedSendPositionTimer;
QTimer delayedSendExtra1Timer;
QTimer delayedSendExtra2Timer;
QTimer delayedSendExtra3Timer;
void changeEvent(QEvent *e);
protected slots:
void sendRawSensor();
void sendController();
void sendExtended();
void sendRC();
void sendPosition();
void sendExtra1();
void sendExtra2();
void sendExtra3();
private:
Ui::QGCSensorSettingsWidget *ui;
};
#endif // QGCSENSORSETTINGSWIDGET_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QGCSensorSettingsWidget</class>
<widget class="QWidget" name="QGCSensorSettingsWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>307</width>
<height>221</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_4" rowstretch="10,0">
<property name="margin">
<number>0</number>
</property>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Calibration Wizards</string>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="100,100">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<property name="horizontalSpacing">
<number>12</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QPushButton" name="rcCalButton">
<property name="text">
<string>RC Cal.</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="magCalButton">
<property name="text">
<string>Mag. Cal.</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="gyroCalButton">
<property name="text">
<string>Gyro Cal.</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="pressureCalButton">
<property name="text">
<string>Pressure Cal.</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Data Stream Rates (Hz)</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<property name="horizontalSpacing">
<number>5</number>
</property>
<property name="verticalSpacing">
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QSpinBox" name="spinBox_rawSensor">
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Raw Sensor</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QSpinBox" name="spinBox_extended">
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QSpinBox" name="spinBox_position">
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QSpinBox" name="spinBox_controller">
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Ext. Status</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Position</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Raw Contr.</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="spinBox_rc">
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="spinBox_extra1">
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QSpinBox" name="spinBox_extra2">
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QSpinBox" name="spinBox_extra3">
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_5">
<property name="text">
<string>RC Chan.</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Extra 1</string>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Extra 2</string>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Extra 3</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
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