Commit 474010ff authored by pixhawk's avatar pixhawk

added rounding

parent 69addca7
......@@ -93,10 +93,7 @@ WaypointList::~WaypointList()
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)
......@@ -229,11 +226,11 @@ void WaypointList::addCurrentPositonWaypoint()
if (waypoints.size() > 0)
{
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
{
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));
}
}
......
......@@ -281,8 +281,11 @@ QProgressBar::chunk#thrustBar {
<property name="suffix">
<string>°</string>
</property>
<property name="minimum">
<number>-180</number>
</property>
<property name="maximum">
<number>359</number>
<number>180</number>
</property>
<property name="singleStep">
<number>10</number>
......
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