MovnaTeam / movna

Open-source training application.
GNU General Public License v3.0
0 stars 1 forks source link

Added Activity type and relevant providers. #14

Closed BriceCroix closed 1 year ago

BriceCroix commented 1 year ago

Added datatypes :

Added repository for the Activities, that get stored to an isar database.

Classes diagram is now as follow :

---
title: Movna classes uml diagram
---
classDiagram
    class GpsCoordinates{
        +latitude : Angle
        +longitude : Angle
    }

    class Location{
        +error : Distance
        +altitude : Distance
        +heading : Angle
        +speed : Speed
        +speedError : Speed
    }
    Location *-- "1" GpsCoordinates : +gpsCoordinates

    class TimedLocation{
        +timestamp : DateTime
    }
    TimedLocation *-- "1" Location : +location
    note for TimedLocation "Mirrors geolocator's Position"

    class TrackPoint{
        +timestamp : DateTime
        +heartRate : Frequency?
    }
    TrackPoint *-- "0..1" Location : +location

    class TrackSegment
    TrackSegment *-- "1..*" TrackPoint : +points

    class Activity{
        +startTime : DateTime
        +stopTime : DateTime?
        +sport : Sport?
        +name : String?
        +durationRunning : Duration
        +distance : Distance?
        +averageSpeed : Speed?
        +maxSpeed : Speed?
        +averageHeartRate : Frequency?
        +notes : String?
    }
    Activity *-- "0..*" TrackSegment : +segments
BriceCroix commented 1 year ago

There may be some things to rewrite, I am quite unsure of the relevancy of a activity source there, as the repository is quite empty, taking only care of the entity-model conversion. I am open to suggestions ! :)

BriceCroix commented 1 year ago

Made important changes : The class we knew as Location is now TimedLocation. This is the class returned by the location service. This is not related to the activities. On the other hand, Activities store TrackPoints, that represents instants of an activity, these use a Location field and a Datetime field, this allows to keep storing Trackpoints with all their data even if the Location service is disabled.