projects
/
jspeed
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Theme download link fixed in web page.
[jspeed]
/
src
/
poialerts.cpp
diff --git
a/src/poialerts.cpp
b/src/poialerts.cpp
index
2d8fe0d
..
67cf921
100644
(file)
--- a/
src/poialerts.cpp
+++ b/
src/poialerts.cpp
@@
-197,7
+197,10
@@
double PoiAlerts::getCurrentDistance() const
return 0.0;
}
return 0.0;
}
- return currentDistance_;
+ const Location::Fix* fix = &(Odometer::instance().getLatestFix());
+
+ return calculateDistance(currentPoi_->latitude, currentPoi_->longitude,
+ fix->latitude, fix->longitude);
}
QString PoiAlerts::getCurrentPoi() const
}
QString PoiAlerts::getCurrentPoi() const
@@
-232,7
+235,7
@@
void PoiAlerts::onDataUpdated()
double travelled = Odometer::instance().getTotal();
double travelled = Odometer::instance().getTotal();
- if(absValue(travelled - travelled_) > 0.02)
+ if(absValue(travelled - travelled_) > 0.015)
{
double distance;
double inRouteMargin = IN_ROUTE_MARGIN + (fix->eph / 1000.0);
{
double distance;
double inRouteMargin = IN_ROUTE_MARGIN + (fix->eph / 1000.0);
@@
-268,7
+271,7
@@
void PoiAlerts::onDataUpdated()
}
else
{
}
else
{
- trackLimit = 90.0 - radToDeg(acos((inRouteMargin + (distance * 0.16)) / distance));
+ trackLimit = 90.0 - radToDeg(acos((inRouteMargin + (distance * 0.17)) / distance));
}
qDebug() << "Tracklimit: " << trackLimit;
}
qDebug() << "Tracklimit: " << trackLimit;
@@
-277,7
+280,6
@@
void PoiAlerts::onDataUpdated()
{
found = true;
currentPoi_ = &pois_[i];
{
found = true;
currentPoi_ = &pois_[i];
- currentDistance_ = distance;
emit visibilityChanged(true);
playSound(i);
}
emit visibilityChanged(true);
playSound(i);
}
@@
-292,7
+294,6
@@
void PoiAlerts::onDataUpdated()
{
found = true;
currentPoi_ = &pois_[i];
{
found = true;
currentPoi_ = &pois_[i];
- currentDistance_ = distance;
emit visibilityChanged(true);
playSound(i);
}
emit visibilityChanged(true);
playSound(i);
}