sports-alliance / sports-lib

A Library for processing GPX, TCX, FIT and JSON files from services such as Strava, Movescount, Garmin, Polar etc
GNU Affero General Public License v3.0
155 stars 21 forks source link

Check if paused #70

Open JosephTuffin opened 3 years ago

JosephTuffin commented 3 years ago

Hi, is there a way to check if the device is paused at each point of the data stream for FIT files? I can get the total time paused but I can't see a way to check at specific times.

Cheers

jimmykane commented 3 years ago

Hey its well possible. Plenty of ways todo this.

You can check the getPause(): DataPause; method on the object (event) you get back or even the events. However not all services or file formats do add pauses or events

/**
   * Gets only the start type of events
   */
  getStartEvents(): DataStartEvent[];

  /**
   * Gets only the stop type of events
   */
  getStopEvents(): DataStopEvent[];

  /**
   * Gets the stop all type of events
   */
  getStopAllEvents(): DataStopAllEvent[];

Keep me posted if you need more help and sorry for the late reply