From fd14bf8d5874aacd547f268db9f9e50f9871fe4c Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 26 Apr 2013 08:49:13 +0200 Subject: [PATCH 1/2] Attempt to preven RC widget issues --- src/ui/QGCRemoteControlView.cc | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/ui/QGCRemoteControlView.cc b/src/ui/QGCRemoteControlView.cc index bfef68e..efeabc6 100644 --- a/src/ui/QGCRemoteControlView.cc +++ b/src/ui/QGCRemoteControlView.cc @@ -139,10 +139,9 @@ void QGCRemoteControlView::setUASId(int id) void QGCRemoteControlView::setChannelRaw(int channelId, float raw) { - if (this->raw.size() <= channelId) { + if (this->raw.count() <= channelId) { // This is a new channel, append it this->raw.append(raw); - //this->normalized.append(0); appendChannelWidget(channelId); updated = true; } else { @@ -154,7 +153,7 @@ void QGCRemoteControlView::setChannelRaw(int channelId, float raw) void QGCRemoteControlView::setChannelScaled(int channelId, float normalized) { - if (this->normalized.size() <= channelId) // using raw vector as size indicator + if (this->normalized.count() <= channelId) // using raw vector as size indicator { // This is a new channel, append it this->normalized.append(normalized); @@ -200,19 +199,11 @@ void QGCRemoteControlView::redraw() { if(isVisible() && updated) { - // Update raw values - //for(int i = 0; i < rawLabels.count(); i++) - //{ - //rawLabels.at(i)->setText(QString("%1 us").arg(raw.at(i), 4, 10, QChar('0'))); - //} - - // Update percent bars - for(int i = 0; i < progressBars.count(); i++) + // Update percent bars and raw labels + for(int i = 0; (i < progressBars.count()) && (i < rawLabels.count()) && (i < normalized.count()); i++) { rawLabels.at(i)->setText(QString("%1 us").arg(raw.at(i), 4, 10, QChar('0'))); int vv = normalized.at(i)*100.0f; - //progressBars.at(i)->setValue(vv); -// int vv = raw.at(i)*1.0f; progressBars.at(i)->setValue(vv); } // Update RSSI From 44566c18cebd4180f2d024ae0558ccaeec24922c Mon Sep 17 00:00:00 2001 From: Thomas Gubler Date: Fri, 26 Apr 2013 13:44:36 +0200 Subject: [PATCH 2/2] hotfix: fix small compilation error --- src/uas/UAS.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 69a8805..0a7213e 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -2727,7 +2727,7 @@ void UAS::enableHilXPlane(bool enable) * @param yacc Y acceleration (mg) * @param zacc Z acceleration (mg) */ -void UAS::sendHilState(uint64_t time_us, float roll, float pitch, float yaw, float rollspeed, +void UAS::sendHilState(quint64 time_us, float roll, float pitch, float yaw, float rollspeed, float pitchspeed, float yawspeed, double lat, double lon, double alt, float vx, float vy, float vz, float xacc, float yacc, float zacc) {