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
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);
}
else
{
- trackLimit = 90.0 - radToDeg(acos((inRouteMargin + (distance * 0.16)) / distance));
+ trackLimit = 90.0 - radToDeg(acos((inRouteMargin + (distance * 0.17)) / distance));
}
qDebug() << "Tracklimit: " << trackLimit;
{
found = true;
currentPoi_ = &pois_[i];
- currentDistance_ = distance;
emit visibilityChanged(true);
playSound(i);
}
{
found = true;
currentPoi_ = &pois_[i];
- currentDistance_ = distance;
emit visibilityChanged(true);
playSound(i);
}
public:
static int const POI_ALERT_INTERVAL = 120;
- static int const IN_ROUTE_MARGIN = 20;
+ static int const IN_ROUTE_MARGIN = 22;
static PoiAlerts& instance();
static QString getPoiDir();
~PoiAlerts();
double distance_;
double travelled_;
PoiReader::Poi* currentPoi_;
- double currentDistance_;
bool loaded_;
QString error_;
<file>resources/themes/default/theme.xml</file>
<file>resources/themes/default/digital7.ttf</file>
<file>resources/themes/default/background.png</file>
+ <file>resources/themes/default/speedcamera.png</file>
</qresource>
</RCC>
<color>#a5efff</color>
</effect>
</text>
+ <image>
+ <src>speedcamera.png</src>
+ <xpos>14</xpos>
+ <ypos>418</ypos>
+ <effect name="flicker">
+ <interval>500</interval>
+ </effect>
+ <visiblewhen>poivisible</visiblewhen>
+ </image>
+ <text>
+ <data>{POIDISTANCE} {DISTANCEUNIT}</data>
+ <xpos>77</xpos>
+ <ypos>420</ypos>
+ <font>Nokia Sans Bold</font>
+ <size>20</size>
+ <color>#e4ff00</color>
+ <bold>true</bold>
+ <visiblewhen>poivisible</visiblewhen>
+ </text>
</mainscreen>
<mainscreen orientation="portrait">
<image>
<color>#a5efff</color>
</effect>
</text>
+ <image>
+ <src>speedcamera.png</src>
+ <xpos>14</xpos>
+ <ypos>738</ypos>
+ <effect name="flicker">
+ <interval>500</interval>
+ </effect>
+ <visiblewhen>poivisible</visiblewhen>
+ </image>
+ <text>
+ <data>{POIDISTANCE} {DISTANCEUNIT}</data>
+ <xpos>77</xpos>
+ <ypos>740</ypos>
+ <font>Nokia Sans Bold</font>
+ <size>20</size>
+ <color>#e4ff00</color>
+ <bold>true</bold>
+ <visiblewhen>poivisible</visiblewhen>
+ </text>
</mainscreen>
</theme>
if(format.isEmpty())
{
- format = "%.1lf";
+ format = "%.0lf";
}
QString result;