diff --git a/R-Dash/core/Lap.ts b/R-Dash/core/Lap.ts
index 3bdb122..fc45595 100644
--- a/R-Dash/core/Lap.ts
+++ b/R-Dash/core/Lap.ts
@@ -51,6 +51,17 @@ export class Lap {
});
return sum/this.points.length;
}
+
+ getMaxSpeed(){
+ var max = 0.0;
+ this.points.forEach(pt => {
+ if(max < pt.getVCar()){
+ max = pt.getVCar();
+ }
+ });
+ return max;
+ }
+
getLocationLat(){
var sum = 0.0;
this.points.forEach(pt => {
@@ -58,6 +69,7 @@ export class Lap {
});
return sum/this.points.length;
}
+
getLocationLong(){
var sum = 0.0;
this.points.forEach(pt => {
@@ -65,4 +77,5 @@ export class Lap {
});
return sum/this.points.length;
}
+
}
\ No newline at end of file
diff --git a/R-Dash/screens/Lap.tsx b/R-Dash/screens/Lap.tsx
index ed3d52f..6e8a8a2 100644
--- a/R-Dash/screens/Lap.tsx
+++ b/R-Dash/screens/Lap.tsx
@@ -6,12 +6,12 @@ import React from 'react';
import { Lap as LapModel} from '../core/Lap';
import TopBar from '../components/TopBar';
-export default function Lap(props: { navigation: any, route }) {
+export default function Lap(props: { navigation: any, route : any}) {
const { session } = props.route.params;
const { navigation } = props;
// const laps: LapModel[] = session.getLaps();
- const laps: LapModel[] = session.getLaps().sort((lap1, lap2) => lap1.getNumber() - lap2.getNumber());
+ const laps: LapModel[] = session.getLaps().sort((lap1 : LapModel, lap2 : LapModel) => lap1.getNumber() - lap2.getNumber());
const [currentLapIndex, setCurrentLapIndex] = React.useState(0);
@@ -112,17 +112,7 @@ export default function Lap(props: { navigation: any, route }) {
Max Speed:
- {} km/h
-
-
-
- X:
- {} X
-
-
-
- X:
- {} X
+ {currentLap.getMaxSpeed()} km/h
diff --git a/R-Dash/screens/NewTrack.tsx b/R-Dash/screens/NewTrack.tsx
index 2b6df27..61dcf5c 100644
--- a/R-Dash/screens/NewTrack.tsx
+++ b/R-Dash/screens/NewTrack.tsx
@@ -3,6 +3,7 @@ import React, { useState } from 'react';
import { Button, Pressable, StyleSheet, Text, View, Image, TouchableOpacity, TextInput } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import * as DocumentPicker from 'expo-document-picker';
+import TopBar from '../components/TopBar';
export default function NewTrack(props: { navigation: any }) {
const { navigation } = props;
@@ -23,25 +24,8 @@ export default function NewTrack(props: { navigation: any }) {
return (
-
-
-
-
-
- Name
-
-
-
-
-
-
-
-
-
-
-
-
-
+ {/* Header */}
+
{/* Page */}
diff --git a/R-Dash/screens/Point_Viewer.tsx b/R-Dash/screens/Point_Viewer.tsx
index 8817758..f2a04b8 100644
--- a/R-Dash/screens/Point_Viewer.tsx
+++ b/R-Dash/screens/Point_Viewer.tsx
@@ -1,13 +1,13 @@
import { BackgroundImage } from '@rneui/base';
import { StyleSheet, Text, View, TouchableOpacity, ScrollView } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
-import MapView, { Polyline } from 'react-native-maps';
+import MapView, { Marker, Polyline } from 'react-native-maps';
import React from 'react';
import { Lap as LapModel} from '../core/Lap';
import TopBar from '../components/TopBar';
import { Point } from '../core/Point';
-export default function Lap(props: { navigation: any, route }) {
+export default function Lap(props: { navigation: any, route : any}) {
const { currentLap } = props.route.params;
const { navigation } = props;
@@ -30,6 +30,18 @@ export default function Lap(props: { navigation: any, route }) {
}
};
+ const markers: { id: number; name: string; coordinate: { latitude: number; longitude: number } }[] = points.map((pt, index) => {
+ return {
+ id: index,
+ name: pt.getDistance() + 'm',
+ coordinate: { latitude: pt.getGeo().getGpsLat(), longitude: pt.getGeo().getGpsLong() },
+ };
+ });
+
+ const handleMarker = (index : number) => {
+ setCurrentPointIndex(index);
+ }
+
// currentLap.getPoints().forEach(pt => {
// points.push({ latitude: pt.getGeo().getGpsLat(), longitude: pt.getGeo().getGpsLong() });
@@ -73,13 +85,10 @@ export default function Lap(props: { navigation: any, route }) {
longitudeDelta: 0.015,
}}
>
- {/* console.log('pressed')}
- /> */}
+ {markers.map(({ id, name, coordinate }) => (
+ handleMarker(id)} />
+ ))}
+