Browse Source

added rounding

QGC4.4
pixhawk 15 years ago
parent
commit
474010ff06
  1. 7
      src/ui/WaypointList.cc
  2. 5
      src/ui/WaypointView.ui

7
src/ui/WaypointList.cc

@ -93,10 +93,7 @@ WaypointList::~WaypointList()
void WaypointList::updateStatusLabel(const QString &string) void WaypointList::updateStatusLabel(const QString &string)
{ {
if (this->uas)
{
m_ui->statusLabel->setText(string); m_ui->statusLabel->setText(string);
}
} }
void WaypointList::updateLocalPosition(UASInterface* uas, double x, double y, double z, quint64 usec) void WaypointList::updateLocalPosition(UASInterface* uas, double x, double y, double z, quint64 usec)
@ -229,11 +226,11 @@ void WaypointList::addCurrentPositonWaypoint()
if (waypoints.size() > 0) if (waypoints.size() > 0)
{ {
Waypoint *last = waypoints.at(waypoints.size()-1); Waypoint *last = waypoints.at(waypoints.size()-1);
addWaypoint(new Waypoint(waypoints.size(), mavX, mavY, mavZ, mavYaw, last->getAutoContinue(), false, last->getOrbit(), last->getHoldTime())); addWaypoint(new Waypoint(waypoints.size(), (float)(qRound(mavX*100))/100.f, (float)(qRound(mavY*100))/100.f, (float)(qRound(mavZ*100))/100.f, (float)(qRound(mavYaw*100))/100.f, last->getAutoContinue(), false, last->getOrbit(), last->getHoldTime()));
} }
else else
{ {
addWaypoint(new Waypoint(waypoints.size(), mavX, mavY, mavZ, mavYaw, true, true, 0.15, 2000)); addWaypoint(new Waypoint(waypoints.size(), (float)(qRound(mavX*100))/100.f, (float)(qRound(mavY*100))/100.f, (float)(qRound(mavZ*100))/100.f, (float)(qRound(mavYaw*100))/100.f, true, true, 0.15, 2000));
} }
} }

5
src/ui/WaypointView.ui

@ -281,8 +281,11 @@ QProgressBar::chunk#thrustBar {
<property name="suffix"> <property name="suffix">
<string>°</string> <string>°</string>
</property> </property>
<property name="minimum">
<number>-180</number>
</property>
<property name="maximum"> <property name="maximum">
<number>359</number> <number>180</number>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<number>10</number> <number>10</number>

Loading…
Cancel
Save