From 183a97003ed9497a88214e9d1ce47b55547d7efa Mon Sep 17 00:00:00 2001 From: Ren Juan Date: Sun, 29 Aug 2021 00:11:00 +0000 Subject: [PATCH] 2.0.7 --- Ejectable/GT2.tsx | 16 +++++++++------- Ejectable/app.json | 4 ++-- Ejectable/screens/TripScreen.tsx | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Ejectable/GT2.tsx b/Ejectable/GT2.tsx index 98447739..f86e498e 100644 --- a/Ejectable/GT2.tsx +++ b/Ejectable/GT2.tsx @@ -4,7 +4,7 @@ import { Text, View } from './components/Themed'; import { StyleSheet } from 'react-native'; import * as geolib from 'geolib'; -export const ver:string = "2.06;" +export const ver:string = "2.0.7" var debug:number = 0; var endIsNigh:boolean = false; var testCount = 0; @@ -14,6 +14,7 @@ export var locEnabled:boolean = false; const heartbeat:number = 500; const displayBeat:number = 3; + const ticksPerDS = 200; const geoLibAccuracy:number = 0.1; const minExpoAccuracy:number = 5; @@ -193,13 +194,14 @@ export class GT2 { this.trip.loc.set(lat,lon); - if (Trips.startPoint.mLatitude == 0.0) Trips.startPoint.set(lat,lon); - - t = expoFix.coords['accuracy']; if (t < minExpoAccuracy ) return; + if (Trips.startPoint.mLatitude == 0.0) Trips.startPoint.set(lat,lon); - if (this.trip.lastFix.mLatitude == 0.0) this.trip.lastFix.set(lat,lon); + if (this.trip.lastFix.mLatitude == 0.0) + this.trip.lastFix.set(lat,lon); else - {this.trip.ds += this.trip.lastFix.distanceTo(this.trip.loc); + if ((this.trip.ticks % ticksPerDS) == 0) { + t = expoFix.coords['accuracy']; if (t < minExpoAccuracy ) return; + this.trip.ds += this.trip.lastFix.distanceTo(this.trip.loc); this.trip.lastFix.set(lat,lon); if (debug > 10) console.log('delta ' + this.trip.ds); @@ -341,7 +343,7 @@ export class TripDisplay extends React.Component { {Trips.getTripPanel() } ); - else; + else return( diff --git a/Ejectable/app.json b/Ejectable/app.json index 93ddaeb8..4f74adc8 100644 --- a/Ejectable/app.json +++ b/Ejectable/app.json @@ -2,7 +2,7 @@ "expo": { "name": "GT2 Green Travel Carbon App", "slug": "GT2standalone", - "version": "2.0.6", + "version": "2.0.7", "orientation": "default", "description": "Travel Carbon Footprint (simplified version)", "icon": "./assets/images/icon.png", @@ -22,7 +22,7 @@ "ios": { "supportsTablet": true, "bundleIdentifier": "app.greentravel.gt2", - "buildNumber": "2", + "buildNumber": "3", "infoPlist": { "UIBackgroundModes": [ "location", diff --git a/Ejectable/screens/TripScreen.tsx b/Ejectable/screens/TripScreen.tsx index 16bd673f..617c31bd 100644 --- a/Ejectable/screens/TripScreen.tsx +++ b/Ejectable/screens/TripScreen.tsx @@ -91,7 +91,7 @@ export default function TripScreen( { navigation }: RootTabScreenProps<'Trip'>) ); - else; + else return ( Trip Control