Commit 614151ce authored by Bryan Godbolt's avatar Bryan Godbolt

radio calibraion working

parent 9481145a
......@@ -120,25 +120,25 @@ void QGCRemoteControlView::setChannelRaw(int channelId, float raw)
redraw();
}
//void QGCRemoteControlView::setChannelScaled(int channelId, float normalized)
//{
// if (this->raw.size() <= channelId) // using raw vector as size indicator
// {
// // This is a new channel, append it
// this->normalized.append(normalized);
// this->raw.append(0);
// appendChannelWidget(channelId);
// }
// else
// {
// // This is an existing channel, update it
// this->normalized[channelId] = normalized;
// }
// updated = true;
void QGCRemoteControlView::setChannelScaled(int channelId, float normalized)
{
if (this->raw.size() <= channelId) // using raw vector as size indicator
{
// This is a new channel, append it
this->normalized.append(normalized);
this->raw.append(0);
appendChannelWidget(channelId);
}
else
{
// This is an existing channel, update it
this->normalized[channelId] = normalized;
}
updated = true;
// // FIXME Will be timer based in the future
// redraw();
//}
// FIXME Will be timer based in the future
redraw();
}
void QGCRemoteControlView::setRemoteRSSI(float rssiNormalized)
{
......@@ -179,9 +179,9 @@ void QGCRemoteControlView::redraw()
// Update percent bars
for(int i = 0; i < progressBars.count(); i++) {
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);
int vv = raw.at(i)*1.0f;
// int vv = raw.at(i)*1.0f;
progressBars.at(i)->setValue(vv);
}
// Update RSSI
......
......@@ -55,7 +55,7 @@ public:
public slots:
void setUASId(int id);
void setChannelRaw(int channelId, float raw);
//void setChannelScaled(int channelId, float normalized);
void setChannelScaled(int channelId, float normalized);
void setRemoteRSSI(float rssiNormalized);
void redraw();
......
......@@ -43,12 +43,12 @@ RadioCalibrationWindow::RadioCalibrationWindow(QWidget *parent) :
connect(transmit, SIGNAL(clicked()), this, SLOT(send()));
connect(get, SIGNAL(clicked()), this, SLOT(request()));
connect(aileron, SIGNAL(setpointChanged(int,float)), radio, SLOT(setAileron(int,float)));
connect(elevator, SIGNAL(setpointChanged(int,float)), radio, SLOT(setElevator(int,float)));
connect(rudder, SIGNAL(setpointChanged(int,float)), radio, SLOT(setRudder(int,float)));
connect(gyro, SIGNAL(setpointChanged(int,float)), radio, SLOT(setGyro(int,float)));
connect(pitch, SIGNAL(setpointChanged(int,float)), radio, SLOT(setPitch(int,float)));
connect(throttle, SIGNAL(setpointChanged(int,float)), radio, SLOT(setThrottle(int,float)));
connect(aileron, SIGNAL(setpointChanged(int,uint16_t)), radio, SLOT(setAileron(int,uint16_t)));
connect(elevator, SIGNAL(setpointChanged(int,uint16_t)), radio, SLOT(setElevator(int,uint16_t)));
connect(rudder, SIGNAL(setpointChanged(int,uint16_t)), radio, SLOT(setRudder(int,uint16_t)));
connect(gyro, SIGNAL(setpointChanged(int,uint16_t)), radio, SLOT(setGyro(int,uint16_t)));
connect(pitch, SIGNAL(setpointChanged(int,uint16_t)), radio, SLOT(setPitch(int,uint16_t)));
connect(throttle, SIGNAL(setpointChanged(int,uint16_t)), radio, SLOT(setThrottle(int,uint16_t)));
setUASId(0);
}
......
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