From b8a04aa7d69a1bbfe262a6d0647c8d63cf96f423 Mon Sep 17 00:00:00 2001 From: eshe Date: Thu, 15 Jul 2010 13:25:08 +0100 Subject: [PATCH] Small tuning to speed treshold and default theme. --- src/odometer.cpp | 10 ++++++++-- src/resources/themes/default/theme.xml | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/odometer.cpp b/src/odometer.cpp index e4da0a9..161f0b2 100644 --- a/src/odometer.cpp +++ b/src/odometer.cpp @@ -34,8 +34,14 @@ namespace QString const KM_SPEEDUNIT = "km/h"; QString const MILE_SPEEDUNIT = "mph"; double const DEFAULT_SPEED_TRESHOLD = 8.0; - double const MIN_SPEED_TRESHOLD = 0.9; + double const MIN_SPEED_TRESHOLD = 0.8; double const SPEED_IGNORE_LEVEL = 0.01; + double const TRESHOLD_POINT1_EPS = 40.0; + double const TRESHOLD_POINT1_TRESHOLD = 10.0; + double const TRESHOLD_POINT2_EPS = 1.8; + double const TRESHOLD_POINT2_TRESHOLD = MIN_SPEED_TRESHOLD; + double const TRESHOLD_X = (TRESHOLD_POINT1_TRESHOLD - TRESHOLD_POINT2_TRESHOLD) / (TRESHOLD_POINT1_EPS - TRESHOLD_POINT2_EPS); + double const TRESHOLD_Y = TRESHOLD_POINT1_TRESHOLD - (TRESHOLD_POINT1_EPS * TRESHOLD_X); } Odometer::Odometer(): QObject(0), trip_(0), total_(0), @@ -105,7 +111,7 @@ void Odometer::update(Location::Fix const& fix) if(fix.eps > 0.01) { - treshold = fix.eps * 0.23822 + 0.471204; + treshold = fix.eps * TRESHOLD_X + TRESHOLD_Y; if(treshold < MIN_SPEED_TRESHOLD) { diff --git a/src/resources/themes/default/theme.xml b/src/resources/themes/default/theme.xml index a05dafe..d1d21f5 100644 --- a/src/resources/themes/default/theme.xml +++ b/src/resources/themes/default/theme.xml @@ -36,22 +36,22 @@ 000 digital7.ttf - 230 + 250 0 260 #17202b right - 450 + 470 {SPEED} digital7.ttf - 230 + 250 0 260 #fff right - 450 + 470 %.0f -- 1.7.9.5