souplesse

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 8988bb5b6110cefc7e37329cc122ae2e46127d89
parent 1bb2fe921883ef1670963acca84c0a3b825e692a
Author: Daniel Barlow <dan@telent.net>
Date:   Mon, 11 Nov 2024 18:44:26 +0000

add cadence/power/heartRate to Point

we're not using it for anything yet, just parsing it

Diffstat:
Mfrontend/src/Main.elm | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/frontend/src/Main.elm b/frontend/src/Main.elm @@ -43,7 +43,7 @@ type alias TileNumber = { x: Int, y: Int } type alias Lat = Float type alias Lng = Float --- project latling to co-ordinates based on pseudocode at +-- project lat/long to co-ordinates based on pseudocode at -- https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Zoom_levels sec x = 1 / (cos x) @@ -140,6 +140,9 @@ type alias Pos = type alias Point = { time : Float , pos : Pos + , cadence : Maybe Int + , power : Maybe Int + , heartRate : Maybe Int } posDecoder : D.Decoder Pos @@ -150,9 +153,12 @@ posDecoder = D.map3 Pos pointDecoder : D.Decoder Point -pointDecoder = D.map2 Point +pointDecoder = D.map5 Point (D.field "time" D.float) (D.field "pos" posDecoder) + (D.field "cadence" (D.maybe D.int)) + (D.field "power" (D.maybe D.int)) + (D.field "heartRate" (D.maybe D.int)) trackDecoder : D.Decoder (List Point) trackDecoder = D.list pointDecoder