Browse Source

Improved speed by preventing update of UASView on every vehicle state change, view is now bound to 10 Hz update timer

QGC4.4
lm 15 years ago
parent
commit
fefea1c00e
  1. 4
      src/ui/uas/UASView.cc
  2. 12
      src/ui/uas/UASView.h

4
src/ui/uas/UASView.cc

@ -312,7 +312,7 @@ void UASView::refresh()
m_ui->thrustBar->setValue(this->thrust); m_ui->thrustBar->setValue(this->thrust);
// Position // Position
//QString position; QString position;
position = position.sprintf("%02.2f %02.2f %02.2f m", x, y, z); position = position.sprintf("%02.2f %02.2f %02.2f m", x, y, z);
m_ui->positionLabel->setText(position); m_ui->positionLabel->setText(position);
QString globalPosition; QString globalPosition;
@ -320,7 +320,7 @@ void UASView::refresh()
m_ui->gpsLabel->setText(globalPosition); m_ui->gpsLabel->setText(globalPosition);
// Speed // Speed
QString speed; QString speed;
speed = speed.sprintf("%02.2f m/s", totalSpeed); speed = speed.sprintf("%02.2f m/s", totalSpeed);
m_ui->speedLabel->setText(speed); m_ui->speedLabel->setText(speed);

12
src/ui/uas/UASView.h

@ -78,14 +78,22 @@ protected:
QColor heartbeatColor; QColor heartbeatColor;
quint64 startTime; quint64 startTime;
int timeRemaining; int timeRemaining;
double chargeLevel; float chargeLevel;
UASInterface* uas; UASInterface* uas;
double load; float load;
QString state; QString state;
QString stateDesc; QString stateDesc;
QString mode; QString mode;
double thrust; ///< Current vehicle thrust: 0 - 1.0 for 100% thrust double thrust; ///< Current vehicle thrust: 0 - 1.0 for 100% thrust
bool isActive; ///< Is this MAV selected by the user? bool isActive; ///< Is this MAV selected by the user?
float x;
float y;
float z;
float totalSpeed;
float lat;
float lon;
float alt;
void mouseDoubleClickEvent (QMouseEvent * event); void mouseDoubleClickEvent (QMouseEvent * event);
/** @brief Mouse enters the widget */ /** @brief Mouse enters the widget */

Loading…
Cancel
Save