This commit is contained in:
Ren Juan 2021-08-29 00:47:37 +00:00
parent 183a97003e
commit eb01f8981a
2 changed files with 7 additions and 2 deletions

View File

@ -14,7 +14,7 @@ export var locEnabled:boolean = false;
const heartbeat:number = 500; const heartbeat:number = 500;
const displayBeat:number = 3; const displayBeat:number = 3;
const ticksPerDS = 200; const ticksPerDS = 10;
const geoLibAccuracy:number = 0.1; const geoLibAccuracy:number = 0.1;
const minExpoAccuracy:number = 5; const minExpoAccuracy:number = 5;
@ -114,6 +114,7 @@ class Trip {
public elapsed:string = "00.00.00"; public elapsed:string = "00.00.00";
ticks:number = 0; ticks:number = 0;
interval:any; interval:any;
minTripDone:boolean = false;
segments:number = 1; segments:number = 1;
ds:number = 0; ds:number = 0;
CO2:number = 0.0; CO2:number = 0.0;
@ -202,6 +203,10 @@ export class GT2 {
if ((this.trip.ticks % ticksPerDS) == 0) { if ((this.trip.ticks % ticksPerDS) == 0) {
t = expoFix.coords['accuracy']; if (t < minExpoAccuracy ) return; t = expoFix.coords['accuracy']; if (t < minExpoAccuracy ) return;
this.trip.ds += this.trip.lastFix.distanceTo(this.trip.loc); 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); this.trip.lastFix.set(lat,lon);
if (debug > 10) console.log('delta ' + this.trip.ds); if (debug > 10) console.log('delta ' + this.trip.ds);

View File

@ -102,7 +102,7 @@ export default function TripScreen( { navigation }: RootTabScreenProps<'Trip'>)
title={sButtonText} title={sButtonText}
onPress={() => { onPress={() => {
if (!getAdvised()) { 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(); setAdvised();
} }
if (!Trips.inProgress) {startTrip(); if (!Trips.inProgress) {startTrip();