This commit is contained in:
Ren Juan 2021-08-29 00:11:00 +00:00
parent de380df8d6
commit 183a97003e
3 changed files with 12 additions and 10 deletions

View File

@ -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;
@ -195,11 +196,12 @@ export class GT2 {
if (Trips.startPoint.mLatitude == 0.0) Trips.startPoint.set(lat,lon);
t = expoFix.coords['accuracy']; if (t < minExpoAccuracy ) return;
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() }
</Text>
</View> );
else;
else
return(
<View>
<Text style={styles.tripText}>

View File

@ -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",

View File

@ -91,7 +91,7 @@ export default function TripScreen( { navigation }: RootTabScreenProps<'Trip'>)
<TripDisplay></TripDisplay>
</View>
);
else;
else
return (
<View style={styles.container}>
<Text style={styles.title}>Trip Control</Text>