[Pkg-running-devel] [openambit] 50/131: Make sure speed = -1 does not get into log pushed to movescount (since movescount returns error)
Christian Perrier
bubulle at moszumanska.debian.org
Thu Jul 17 20:19:10 UTC 2014
This is an automated email from the git hooks/post-receive script.
bubulle pushed a commit to branch master
in repository openambit.
commit ce98a182a77ab20cbb92b93e180ef2cf3053382a
Author: Emil Ljungdahl <emil at kratern.se>
Date: Tue Jan 14 21:32:37 2014 +0100
Make sure speed = -1 does not get into log pushed to movescount (since movescount returns error)
---
src/openambit/movescountjson.cpp | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/openambit/movescountjson.cpp b/src/openambit/movescountjson.cpp
index e15dce7..cac393f 100644
--- a/src/openambit/movescountjson.cpp
+++ b/src/openambit/movescountjson.cpp
@@ -280,7 +280,9 @@ bool MovesCountJSON::writePeriodicSample(ambit_log_sample_t *sample, QVariantMap
output.insert("Distance", value->u.distance);
break;
case ambit_log_sample_periodic_type_speed:
- output.insert("Speed", (double)value->u.speed/100.0);
+ if (value->u.speed != 0xffff) {
+ output.insert("Speed", (double)value->u.speed/100.0);
+ }
break;
case ambit_log_sample_periodic_type_hr:
output.insert("HeartRate", value->u.hr);
@@ -289,13 +291,19 @@ bool MovesCountJSON::writePeriodicSample(ambit_log_sample_t *sample, QVariantMap
output.insert("Time", (double)value->u.time/1000.0);
break;
case ambit_log_sample_periodic_type_gpsspeed:
- output.insert("GPSSpeed", (double)value->u.gpsspeed/100.0);
+ if (value->u.gpsspeed != 0xffff) {
+ output.insert("GPSSpeed", (double)value->u.gpsspeed/100.0);
+ }
break;
case ambit_log_sample_periodic_type_wristaccspeed:
- output.insert("WristAccSpeed", (double)value->u.wristaccspeed/100.0);
+ if (value->u.wristaccspeed != 0xffff) {
+ output.insert("WristAccSpeed", (double)value->u.wristaccspeed/100.0);
+ }
break;
case ambit_log_sample_periodic_type_bikepodspeed:
- output.insert("BikePodSpeed", (double)value->u.bikepodspeed/100.0);
+ if (value->u.bikepodspeed != 0xffff) {
+ output.insert("BikePodSpeed", (double)value->u.bikepodspeed/100.0);
+ }
break;
case ambit_log_sample_periodic_type_ehpe:
output.insert("EHPE", value->u.ehpe);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-running/openambit.git
More information about the Pkg-running-devel
mailing list