Commit f75f4424 authored by LM's avatar LM

Merge branch 'dev-lin' of https://github.com/godbolt/qgroundcontrol into dev

parents 63900c28 d163ee02
...@@ -957,12 +957,12 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -957,12 +957,12 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
case MAVLINK_MSG_ID_RADIO_CALIBRATION: { case MAVLINK_MSG_ID_RADIO_CALIBRATION: {
mavlink_radio_calibration_t radioMsg; mavlink_radio_calibration_t radioMsg;
mavlink_msg_radio_calibration_decode(&message, &radioMsg); mavlink_msg_radio_calibration_decode(&message, &radioMsg);
QVector<float> aileron; QVector<uint16_t> aileron;
QVector<float> elevator; QVector<uint16_t> elevator;
QVector<float> rudder; QVector<uint16_t> rudder;
QVector<float> gyro; QVector<uint16_t> gyro;
QVector<float> pitch; QVector<uint16_t> pitch;
QVector<float> throttle; QVector<uint16_t> throttle;
for (int i=0; i<MAVLINK_MSG_RADIO_CALIBRATION_FIELD_AILERON_LEN; ++i) for (int i=0; i<MAVLINK_MSG_RADIO_CALIBRATION_FIELD_AILERON_LEN; ++i)
aileron << radioMsg.aileron[i]; aileron << radioMsg.aileron[i];
......
...@@ -120,25 +120,25 @@ void QGCRemoteControlView::setChannelRaw(int channelId, float raw) ...@@ -120,25 +120,25 @@ void QGCRemoteControlView::setChannelRaw(int channelId, float raw)
redraw(); redraw();
} }
//void QGCRemoteControlView::setChannelScaled(int channelId, float normalized) void QGCRemoteControlView::setChannelScaled(int channelId, float normalized)
//{ {
// if (this->raw.size() <= channelId) // using raw vector as size indicator if (this->raw.size() <= channelId) // using raw vector as size indicator
// { {
// // This is a new channel, append it // This is a new channel, append it
// this->normalized.append(normalized); this->normalized.append(normalized);
// this->raw.append(0); this->raw.append(0);
// appendChannelWidget(channelId); appendChannelWidget(channelId);
// } }
// else else
// { {
// // This is an existing channel, update it // This is an existing channel, update it
// this->normalized[channelId] = normalized; this->normalized[channelId] = normalized;
// } }
// updated = true; // updated = true;
// // FIXME Will be timer based in the future // // FIXME Will be timer based in the future
// redraw(); // redraw();
//} }
void QGCRemoteControlView::setRemoteRSSI(float rssiNormalized) void QGCRemoteControlView::setRemoteRSSI(float rssiNormalized)
{ {
...@@ -179,9 +179,9 @@ void QGCRemoteControlView::redraw() ...@@ -179,9 +179,9 @@ void QGCRemoteControlView::redraw()
// Update percent bars // Update percent bars
for(int i = 0; i < progressBars.count(); i++) { for(int i = 0; i < progressBars.count(); i++) {
rawLabels.at(i)->setText(QString("%1 us").arg(raw.at(i), 4, 10, QChar('0'))); rawLabels.at(i)->setText(QString("%1 us").arg(raw.at(i), 4, 10, QChar('0')));
//int vv = normalized.at(i)*100.0f; int vv = normalized.at(i)*100.0f;
//progressBars.at(i)->setValue(vv); //progressBars.at(i)->setValue(vv);
int vv = raw.at(i)*1.0f; // int vv = raw.at(i)*1.0f;
progressBars.at(i)->setValue(vv); progressBars.at(i)->setValue(vv);
} }
// Update RSSI // Update RSSI
......
...@@ -55,7 +55,7 @@ public: ...@@ -55,7 +55,7 @@ public:
public slots: public slots:
void setUASId(int id); void setUASId(int id);
void setChannelRaw(int channelId, float raw); void setChannelRaw(int channelId, float raw);
//void setChannelScaled(int channelId, float normalized); void setChannelScaled(int channelId, float normalized);
void setRemoteRSSI(float rssiNormalized); void setRemoteRSSI(float rssiNormalized);
void redraw(); void redraw();
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
AbstractCalibrator::AbstractCalibrator(QWidget *parent) : AbstractCalibrator::AbstractCalibrator(QWidget *parent) :
QWidget(parent), QWidget(parent),
pulseWidth(new QLabel()), pulseWidth(new QLabel()),
log(new QVector<float>()) log(new QVector<uint16_t>())
{ {
} }
...@@ -12,17 +12,17 @@ AbstractCalibrator::~AbstractCalibrator() ...@@ -12,17 +12,17 @@ AbstractCalibrator::~AbstractCalibrator()
delete log; delete log;
} }
float AbstractCalibrator::logAverage() uint16_t AbstractCalibrator::logAverage()
{ {
float total = 0; uint16_t total = 0;
for (int i=0; i<log->size(); ++i) for (int i=0; i<log->size(); ++i)
total += log->value(i); total += log->value(i);
return floor(total/log->size()); return total/log->size();
} }
float AbstractCalibrator::logExtrema() uint16_t AbstractCalibrator::logExtrema()
{ {
float extrema = logAverage(); uint16_t extrema = logAverage();
if (logAverage() < 1500) { if (logAverage() < 1500) {
for (int i=0; i<log->size(); ++i) { for (int i=0; i<log->size(); ++i) {
if (log->value(i) < extrema) if (log->value(i) < extrema)
...@@ -40,9 +40,9 @@ float AbstractCalibrator::logExtrema() ...@@ -40,9 +40,9 @@ float AbstractCalibrator::logExtrema()
return extrema; return extrema;
} }
void AbstractCalibrator::channelChanged(float raw) void AbstractCalibrator::channelChanged(uint16_t raw)
{ {
pulseWidth->setText(QString::number(static_cast<double>(raw))); pulseWidth->setText(QString::number(raw));
if (log->size() == 5) if (log->size() == 5)
log->pop_front(); log->pop_front();
log->push_back(raw); log->push_back(raw);
......
...@@ -36,6 +36,7 @@ This file is part of the QGROUNDCONTROL project ...@@ -36,6 +36,7 @@ This file is part of the QGROUNDCONTROL project
#include <QVector> #include <QVector>
#include <math.h> #include <math.h>
#include <stdint.h>
/** /**
@brief Holds the code which is common to all the radio calibration widgets. @brief Holds the code which is common to all the radio calibration widgets.
...@@ -53,30 +54,30 @@ public: ...@@ -53,30 +54,30 @@ public:
changing the display from an external source (file/uav). changing the display from an external source (file/uav).
@param data QVector of setpoints @param data QVector of setpoints
*/ */
virtual void set(const QVector<float>& data)=0; virtual void set(const QVector<uint16_t>& data)=0;
signals: signals:
/** Announce a setpoint change. /** Announce a setpoint change.
@param index setpoint number - 0 based in the current implementation @param index setpoint number - 0 based in the current implementation
@param value new value @param value new value
*/ */
void setpointChanged(int index, float value); void setpointChanged(int index, uint16_t value);
public slots: public slots:
/** Slot to call when the relevant channel is updated /** Slot to call when the relevant channel is updated
@param raw current channel value @param raw current channel value
*/ */
void channelChanged(float raw); void channelChanged(uint16_t raw);
protected: protected:
/** Display the current pulse width */ /** Display the current pulse width */
QLabel *pulseWidth; QLabel *pulseWidth;
/** Log of the past few samples for use in averaging and finding extrema */ /** Log of the past few samples for use in averaging and finding extrema */
QVector<float> *log; QVector<uint16_t> *log;
/** Find the maximum or minimum of the data log */ /** Find the maximum or minimum of the data log */
float logExtrema(); uint16_t logExtrema();
/** Find the average of the log */ /** Find the average of the log */
float logAverage(); uint16_t logAverage();
}; };
#endif // ABSTRACTCALIBRATOR_H #endif // ABSTRACTCALIBRATOR_H
...@@ -78,23 +78,23 @@ AirfoilServoCalibrator::AirfoilServoCalibrator(AirfoilType type, QWidget *parent ...@@ -78,23 +78,23 @@ AirfoilServoCalibrator::AirfoilServoCalibrator(AirfoilType type, QWidget *parent
void AirfoilServoCalibrator::setHigh() void AirfoilServoCalibrator::setHigh()
{ {
highPulseWidth->setText(QString::number(static_cast<double>(logExtrema()))); highPulseWidth->setText(QString::number(logExtrema()));
emit setpointChanged(2, logExtrema()); emit setpointChanged(2, logExtrema());
} }
void AirfoilServoCalibrator::setCenter() void AirfoilServoCalibrator::setCenter()
{ {
centerPulseWidth->setText(QString::number(static_cast<double>(logAverage()))); centerPulseWidth->setText(QString::number(logAverage()));
emit setpointChanged(1, logAverage()); emit setpointChanged(1, logAverage());
} }
void AirfoilServoCalibrator::setLow() void AirfoilServoCalibrator::setLow()
{ {
lowPulseWidth->setText(QString::number(static_cast<double>(logExtrema()))); lowPulseWidth->setText(QString::number(logExtrema()));
emit setpointChanged(0, logExtrema()); emit setpointChanged(0, logExtrema());
} }
void AirfoilServoCalibrator::set(const QVector<float> &data) void AirfoilServoCalibrator::set(const QVector<uint16_t> &data)
{ {
if (data.size() == 3) { if (data.size() == 3) {
lowPulseWidth->setText(QString::number(data[0])); lowPulseWidth->setText(QString::number(data[0]));
......
...@@ -58,7 +58,7 @@ public: ...@@ -58,7 +58,7 @@ public:
explicit AirfoilServoCalibrator(AirfoilType type = AILERON, QWidget *parent = 0); explicit AirfoilServoCalibrator(AirfoilType type = AILERON, QWidget *parent = 0);
/** @param data must have exaclty 3 elemets. they are assumed to be low center high */ /** @param data must have exaclty 3 elemets. they are assumed to be low center high */
void set(const QVector<float>& data); void set(const QVector<uint16_t>& data);
protected slots: protected slots:
void setHigh(); void setHigh();
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
CurveCalibrator::CurveCalibrator(QString titleString, QWidget *parent) : CurveCalibrator::CurveCalibrator(QString titleString, QWidget *parent) :
AbstractCalibrator(parent), AbstractCalibrator(parent),
setpoints(new QVector<double>(5)), setpoints(new QVector<uint16_t>(5)),
positions(new QVector<double>()) positions(new QVector<uint16_t>())
{ {
QGridLayout *grid = new QGridLayout(this); QGridLayout *grid = new QGridLayout(this);
QLabel *title = new QLabel(titleString); QLabel *title = new QLabel(titleString);
...@@ -32,7 +32,17 @@ CurveCalibrator::CurveCalibrator(QString titleString, QWidget *parent) : ...@@ -32,7 +32,17 @@ CurveCalibrator::CurveCalibrator(QString titleString, QWidget *parent) :
curve = new QwtPlotCurve(); curve = new QwtPlotCurve();
curve->setPen(QPen(QColor(QString("lime")))); curve->setPen(QPen(QColor(QString("lime"))));
curve->setData(*positions, *setpoints);
QVector<double> pos(positions->size());
QVector<double> set(setpoints->size());
for (int i=0; i<positions->size()&&i<setpoints->size(); i++)
{
pos[i] = static_cast<double>((*positions)[i]);
set[i] = static_cast<double>((*setpoints)[i]);
}
curve->setData(pos, set);
curve->attach(plot); curve->attach(plot);
plot->replot(); plot->replot();
...@@ -75,22 +85,40 @@ CurveCalibrator::~CurveCalibrator() ...@@ -75,22 +85,40 @@ CurveCalibrator::~CurveCalibrator()
void CurveCalibrator::setSetpoint(int setpoint) void CurveCalibrator::setSetpoint(int setpoint)
{ {
if (setpoint == 0 || setpoint == 4) { if (setpoint == 0 || setpoint == 4) {
setpoints->replace(setpoint, static_cast<double>(logExtrema())); setpoints->replace(setpoint,logExtrema());
} else { } else {
setpoints->replace(setpoint, static_cast<double>(logAverage())); setpoints->replace(setpoint, logAverage());
} }
curve->setData(*positions, *setpoints);
QVector<double> pos(positions->size());
QVector<double> set(setpoints->size());
for (int i=0; i<positions->size()&&i<setpoints->size(); i++)
{
pos[i] = static_cast<double>((*positions)[i]);
set[i] = static_cast<double>((*setpoints)[i]);
}
curve->setData(pos, set);
plot->replot(); plot->replot();
emit setpointChanged(setpoint, static_cast<float>(setpoints->value(setpoint))); emit setpointChanged(setpoint, setpoints->value(setpoint));
} }
void CurveCalibrator::set(const QVector<float> &data) void CurveCalibrator::set(const QVector<uint16_t> &data)
{ {
if (data.size() == 5) { if (data.size() == 5) {
for (int i=0; i<data.size(); ++i) for (int i=0; i<data.size(); ++i)
setpoints->replace(i, static_cast<double>(data[i])); setpoints->replace(i, data[i]);
curve->setData(*positions, *setpoints); QVector<double> pos(positions->size());
QVector<double> set(setpoints->size());
for (int i=0; i<positions->size()&&i<setpoints->size(); i++)
{
pos[i] = static_cast<double>((*positions)[i]);
set[i] = static_cast<double>((*setpoints)[i]);
}
curve->setData(pos, set);
plot->replot(); plot->replot();
} else { } else {
qDebug() << __FILE__ << __LINE__ << ": wrong data vector size"; qDebug() << __FILE__ << __LINE__ << ": wrong data vector size";
......
...@@ -58,14 +58,14 @@ public: ...@@ -58,14 +58,14 @@ public:
explicit CurveCalibrator(QString title = QString(), QWidget *parent = 0); explicit CurveCalibrator(QString title = QString(), QWidget *parent = 0);
~CurveCalibrator(); ~CurveCalibrator();
void set(const QVector<float> &data); void set(const QVector<uint16_t> &data);
protected slots: protected slots:
void setSetpoint(int setpoint); void setSetpoint(int setpoint);
protected: protected:
QVector<double> *setpoints; QVector<uint16_t> *setpoints;
QVector<double> *positions; QVector<uint16_t> *positions;
/** Plot to display calibration curve */ /** Plot to display calibration curve */
QwtPlot *plot; QwtPlot *plot;
/** Curve object of calibration curve */ /** Curve object of calibration curve */
......
...@@ -2,23 +2,23 @@ ...@@ -2,23 +2,23 @@
RadioCalibrationData::RadioCalibrationData() RadioCalibrationData::RadioCalibrationData()
{ {
data = new QVector<QVector<float> >(6); data = new QVector<QVector<uint16_t> >(6);
(*data).insert(AILERON, QVector<float>(3)); (*data).insert(AILERON, QVector<uint16_t>(3));
(*data).insert(ELEVATOR, QVector<float>(3)); (*data).insert(ELEVATOR, QVector<uint16_t>(3));
(*data).insert(RUDDER, QVector<float>(3)); (*data).insert(RUDDER, QVector<uint16_t>(3));
(*data).insert(GYRO, QVector<float>(2)); (*data).insert(GYRO, QVector<uint16_t>(2));
(*data).insert(PITCH, QVector<float>(5)); (*data).insert(PITCH, QVector<uint16_t>(5));
(*data).insert(THROTTLE, QVector<float>(5)); (*data).insert(THROTTLE, QVector<uint16_t>(5));
} }
RadioCalibrationData::RadioCalibrationData(const QVector<float> &aileron, RadioCalibrationData::RadioCalibrationData(const QVector<uint16_t> &aileron,
const QVector<float> &elevator, const QVector<uint16_t> &elevator,
const QVector<float> &rudder, const QVector<uint16_t> &rudder,
const QVector<float> &gyro, const QVector<uint16_t> &gyro,
const QVector<float> &pitch, const QVector<uint16_t> &pitch,
const QVector<float> &throttle) const QVector<uint16_t> &throttle)
{ {
data = new QVector<QVector<float> >(); data = new QVector<QVector<uint16_t> >();
(*data) << aileron (*data) << aileron
<< elevator << elevator
<< rudder << rudder
...@@ -30,7 +30,7 @@ RadioCalibrationData::RadioCalibrationData(const QVector<float> &aileron, ...@@ -30,7 +30,7 @@ RadioCalibrationData::RadioCalibrationData(const QVector<float> &aileron,
RadioCalibrationData::RadioCalibrationData(const RadioCalibrationData &other) RadioCalibrationData::RadioCalibrationData(const RadioCalibrationData &other)
:QObject() :QObject()
{ {
data = new QVector<QVector<float> >(*other.data); data = new QVector<QVector<uint16_t> >(*other.data);
} }
RadioCalibrationData::~RadioCalibrationData() RadioCalibrationData::~RadioCalibrationData()
...@@ -38,7 +38,7 @@ RadioCalibrationData::~RadioCalibrationData() ...@@ -38,7 +38,7 @@ RadioCalibrationData::~RadioCalibrationData()
delete data; delete data;
} }
const float* RadioCalibrationData::operator [](int i) const const uint16_t* RadioCalibrationData::operator [](int i) const
{ {
if (i < data->size()) { if (i < data->size()) {
return (*data)[i].constData(); return (*data)[i].constData();
...@@ -47,7 +47,7 @@ const float* RadioCalibrationData::operator [](int i) const ...@@ -47,7 +47,7 @@ const float* RadioCalibrationData::operator [](int i) const
return NULL; return NULL;
} }
const QVector<float>& RadioCalibrationData::operator ()(const int i) const throw(std::out_of_range) const QVector<uint16_t>& RadioCalibrationData::operator ()(const int i) const throw(std::out_of_range)
{ {
if ((i < data->size()) && (i >=0)) { if ((i < data->size()) && (i >=0)) {
return (*data)[i]; return (*data)[i];
......
...@@ -36,6 +36,8 @@ This file is part of the QGROUNDCONTROL project ...@@ -36,6 +36,8 @@ This file is part of the QGROUNDCONTROL project
#include <QString> #include <QString>
#include <stdexcept> #include <stdexcept>
#include <stdint.h>
/** /**
@brief Class to hold the calibration data. @brief Class to hold the calibration data.
...@@ -48,12 +50,12 @@ class RadioCalibrationData : public QObject ...@@ -48,12 +50,12 @@ class RadioCalibrationData : public QObject
public: public:
explicit RadioCalibrationData(); explicit RadioCalibrationData();
RadioCalibrationData(const RadioCalibrationData&); RadioCalibrationData(const RadioCalibrationData&);
RadioCalibrationData(const QVector<float>& aileron, RadioCalibrationData(const QVector<uint16_t>& aileron,
const QVector<float>& elevator, const QVector<uint16_t>& elevator,
const QVector<float>& rudder, const QVector<uint16_t>& rudder,
const QVector<float>& gyro, const QVector<uint16_t>& gyro,
const QVector<float>& pitch, const QVector<uint16_t>& pitch,
const QVector<float>& throttle); const QVector<uint16_t>& throttle);
~RadioCalibrationData(); ~RadioCalibrationData();
enum RadioElement { enum RadioElement {
...@@ -65,33 +67,33 @@ public: ...@@ -65,33 +67,33 @@ public:
THROTTLE THROTTLE
}; };
const float* operator[](int i) const; const uint16_t* operator[](int i) const;
#ifdef _MSC_VER #ifdef _MSC_VER
const QVector<float>& operator()(int i) const; const QVector<uint16_t>& operator()(int i) const;
#else #else
const QVector<float>& operator()(int i) const throw(std::out_of_range); const QVector<uint16_t>& operator()(int i) const throw(std::out_of_range);
#endif #endif
void set(int element, int index, float value) { void set(int element, int index, float value) {
(*data)[element][index] = value; (*data)[element][index] = value;
} }
public slots: public slots:
void setAileron(int index, float value) { void setAileron(int index, uint16_t value) {
set(AILERON, index, value); set(AILERON, index, value);
} }
void setElevator(int index, float value) { void setElevator(int index, uint16_t value) {
set(ELEVATOR, index, value); set(ELEVATOR, index, value);
} }
void setRudder(int index, float value) { void setRudder(int index, uint16_t value) {
set(RUDDER, index, value); set(RUDDER, index, value);
} }
void setGyro(int index, float value) { void setGyro(int index, uint16_t value) {
set(GYRO, index, value); set(GYRO, index, value);
} }
void setPitch(int index, float value) { void setPitch(int index, uint16_t value) {
set(PITCH, index, value); set(PITCH, index, value);
} }
void setThrottle(int index, float value) { void setThrottle(int index, uint16_t value) {
set(THROTTLE, index, value); set(THROTTLE, index, value);
} }
...@@ -100,7 +102,7 @@ public: ...@@ -100,7 +102,7 @@ public:
QString toString(const RadioElement element) const; QString toString(const RadioElement element) const;
protected: protected:
QVector<QVector<float> > *data; QVector<QVector<uint16_t> > *data;
void init(const QVector<float>& aileron, void init(const QVector<float>& aileron,
const QVector<float>& elevator, const QVector<float>& elevator,
......
...@@ -43,12 +43,12 @@ RadioCalibrationWindow::RadioCalibrationWindow(QWidget *parent) : ...@@ -43,12 +43,12 @@ RadioCalibrationWindow::RadioCalibrationWindow(QWidget *parent) :
connect(transmit, SIGNAL(clicked()), this, SLOT(send())); connect(transmit, SIGNAL(clicked()), this, SLOT(send()));
connect(get, SIGNAL(clicked()), this, SLOT(request())); connect(get, SIGNAL(clicked()), this, SLOT(request()));
connect(aileron, SIGNAL(setpointChanged(int,float)), radio, SLOT(setAileron(int,float))); connect(aileron, SIGNAL(setpointChanged(int,uint16_t)), radio, SLOT(setAileron(int,uint16_t)));
connect(elevator, SIGNAL(setpointChanged(int,float)), radio, SLOT(setElevator(int,float))); connect(elevator, SIGNAL(setpointChanged(int,uint16_t)), radio, SLOT(setElevator(int,uint16_t)));
connect(rudder, SIGNAL(setpointChanged(int,float)), radio, SLOT(setRudder(int,float))); connect(rudder, SIGNAL(setpointChanged(int,uint16_t)), radio, SLOT(setRudder(int,uint16_t)));
connect(gyro, SIGNAL(setpointChanged(int,float)), radio, SLOT(setGyro(int,float))); connect(gyro, SIGNAL(setpointChanged(int,uint16_t)), radio, SLOT(setGyro(int,uint16_t)));
connect(pitch, SIGNAL(setpointChanged(int,float)), radio, SLOT(setPitch(int,float))); connect(pitch, SIGNAL(setpointChanged(int,uint16_t)), radio, SLOT(setPitch(int,uint16_t)));
connect(throttle, SIGNAL(setpointChanged(int,float)), radio, SLOT(setThrottle(int,float))); connect(throttle, SIGNAL(setpointChanged(int,uint16_t)), radio, SLOT(setThrottle(int,uint16_t)));
setUASId(0); setUASId(0);
} }
......
...@@ -44,6 +44,8 @@ This file is part of the QGROUNDCONTROL project ...@@ -44,6 +44,8 @@ This file is part of the QGROUNDCONTROL project
#include <QtXml> #include <QtXml>
#include <QTextStream> #include <QTextStream>
#include <stdint.h>
#include "AirfoilServoCalibrator.h" #include "AirfoilServoCalibrator.h"
#include "SwitchCalibrator.h" #include "SwitchCalibrator.h"
#include "CurveCalibrator.h" #include "CurveCalibrator.h"
......
...@@ -38,17 +38,17 @@ SwitchCalibrator::SwitchCalibrator(QString titleString, QWidget *parent) : ...@@ -38,17 +38,17 @@ SwitchCalibrator::SwitchCalibrator(QString titleString, QWidget *parent) :
void SwitchCalibrator::setDefault() void SwitchCalibrator::setDefault()
{ {
defaultPulseWidth->setText(QString::number(static_cast<double>(logExtrema()))); defaultPulseWidth->setText(QString::number(logExtrema()));
emit setpointChanged(0, logExtrema()); emit setpointChanged(0, logExtrema());
} }
void SwitchCalibrator::setToggled() void SwitchCalibrator::setToggled()
{ {
toggledPulseWidth->setText(QString::number(static_cast<double>(logExtrema()))); toggledPulseWidth->setText(QString::number(logExtrema()));
emit setpointChanged(1, logExtrema()); emit setpointChanged(1, logExtrema());
} }
void SwitchCalibrator::set(const QVector<float> &data) void SwitchCalibrator::set(const QVector<uint16_t> &data)
{ {
if (data.size() == 2) { if (data.size() == 2) {
defaultPulseWidth->setText(QString::number(data[0])); defaultPulseWidth->setText(QString::number(data[0]));
......
...@@ -49,7 +49,7 @@ class SwitchCalibrator : public AbstractCalibrator ...@@ -49,7 +49,7 @@ class SwitchCalibrator : public AbstractCalibrator
public: public:
explicit SwitchCalibrator(QString title=QString(), QWidget *parent = 0); explicit SwitchCalibrator(QString title=QString(), QWidget *parent = 0);
void set(const QVector<float> &data); void set(const QVector<uint16_t> &data);
protected slots: protected slots:
void setDefault(); void setDefault();
......
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