diff --git a/Ejectable/GT2.tsx b/Ejectable/GT2.tsx index f86e498e..66290748 100644 --- a/Ejectable/GT2.tsx +++ b/Ejectable/GT2.tsx @@ -14,7 +14,7 @@ export var locEnabled:boolean = false; const heartbeat:number = 500; const displayBeat:number = 3; - const ticksPerDS = 200; + const ticksPerDS = 10; const geoLibAccuracy:number = 0.1; const minExpoAccuracy:number = 5; @@ -114,6 +114,7 @@ class Trip { public elapsed:string = "00.00.00"; ticks:number = 0; interval:any; + minTripDone:boolean = false; segments:number = 1; ds:number = 0; CO2:number = 0.0; @@ -202,6 +203,10 @@ export class GT2 { if ((this.trip.ticks % ticksPerDS) == 0) { t = expoFix.coords['accuracy']; if (t < minExpoAccuracy ) return; this.trip.ds += this.trip.lastFix.distanceTo(this.trip.loc); + if (this.trip.ds > 250 && !this.trip.minTripDone) { + this.trip.ds =0.0; + this.trip.minTripDone = true; + } this.trip.lastFix.set(lat,lon); if (debug > 10) console.log('delta ' + this.trip.ds); diff --git a/Ejectable/screens/TripScreen.tsx b/Ejectable/screens/TripScreen.tsx index 617c31bd..0174ce4c 100644 --- a/Ejectable/screens/TripScreen.tsx +++ b/Ejectable/screens/TripScreen.tsx @@ -102,7 +102,7 @@ export default function TripScreen( { navigation }: RootTabScreenProps<'Trip'>) title={sButtonText} onPress={() => { if (!getAdvised()) { - Alert.alert("Note: GT2 2.0.6 doesn't run while in background or sleeping."); + Alert.alert("Note: GT2" + ver + " doesn't run while in background or sleeping."); setAdvised(); } if (!Trips.inProgress) {startTrip();