DovesLapTimer 4.3.0
GPS-based lap timing Arduino library — go-karts to race cars
Loading...
Searching...
No Matches
SprintTimer Class Reference

#include <SprintTimer.h>

+ Collaboration diagram for SprintTimer:

Public Member Functions

bool areSectorLinesConfigured () const
 True when at least one split line is configured (note: NOT the circuit timer's both-or-nothing rule — a single split is legal).
 
void forceCatmullRomInterpolation ()
 
void forceLinearInterpolation ()
 
float getBestLapDistance () const
 
int getBestLapNumber () const
 
unsigned long getBestLapTime () const
 
float getBestRunDistance () const
 
int getBestRunNumber () const
 1-based run number that set the best time (0 = none yet).
 
unsigned long getBestRunTime () const
 
int getBestSector1LapNumber () const
 
unsigned long getBestSector1Time () const
 
int getBestSector2LapNumber () const
 
unsigned long getBestSector2Time () const
 
int getBestSector3LapNumber () const
 
unsigned long getBestSector3Time () const
 
int getCancelledRunCount () const
 Runs cancelled by re-crossing the start line mid-run.
 
bool getCrossing () const
 True while inside any configured line's crossing zone.
 
float getCurrentLapDistance () const
 
unsigned long getCurrentLapSector1Time () const
 
unsigned long getCurrentLapSector2Time () const
 
unsigned long getCurrentLapSector3Time () const
 
unsigned long getCurrentLapTime () const
 
float getCurrentRunDistance () const
 
unsigned long getCurrentRunTime () const
 Elapsed ms of the run in progress, 0 while WAITING.
 
int getCurrentSector () const
 Current segment (1..N) while a run is active, 0 while WAITING.
 
float getCurrentSpeedKmh () const
 
float getCurrentSpeedMph () const
 
int getDirection () const
 
int getLaps () const
 
float getLastLapDistance () const
 
unsigned long getLastLapTime () const
 
float getLastRunDistance () const
 
unsigned long getLastRunTime () const
 
unsigned long getOptimalLapTime () const
 Sum of best segment times (theoretical best run). 0 unless at least one split is configured and every segment has a best recorded.
 
float getPaceDifference () const
 Pace delta vs the best run in ms per meter (see DovesLapTimer::getPaceDifference). 0 while WAITING.
 
bool getRaceStarted () const
 True once any run has ever started this session.
 
unsigned int getRejectedCrossingCount () const
 Total zone exits whose interpolation was rejected, all lines.
 
int getRuns () const
 Completed run count this session.
 
float getTotalDistanceTraveled () const
 
bool isDirectionResolved () const
 
bool isFinishLineConfigured () const
 
bool isRunActive () const
 True while a run is in progress (between start and finish).
 
bool isStartLineConfigured () const
 
int loop (double currentLat, double currentLng, float currentAltitudeMeters, float currentSpeedKnots)
 Feed a GPS fix. Call updateCurrentTime() first, then this, on every fix — identical contract to DovesLapTimer::loop().
 
void reset ()
 Reset all run/timing state to zero. Configured lines are kept.
 
void setFinishLine (double pointALat, double pointALng, double pointBLat, double pointBLng)
 Sets the FINISH line (a run completes when it is crossed while a run is active).
 
void setSector2Line (double pointALat, double pointALng, double pointBLat, double pointBLng)
 Sets the optional sector 2 split line (closes segment 1).
 
void setSector3Line (double pointALat, double pointALng, double pointBLat, double pointBLng)
 Sets the optional sector 3 split line (closes the segment after sector 2's, or segment 1 if sector 2 is not configured).
 
void setStartLine (double pointALat, double pointALng, double pointBLat, double pointBLng)
 Sets the START line (a run begins when it is crossed).
 
 SprintTimer (double crossingThresholdMeters=7, Stream *debugSerial=NULL)
 
void updateCurrentTime (unsigned long currentTimeMilliseconds)
 Updates the current GPS time since midnight (milliseconds).
 

Constructor & Destructor Documentation

◆ SprintTimer()

SprintTimer::SprintTimer ( double  crossingThresholdMeters = 7,
Stream *  debugSerial = NULL 
)

Member Function Documentation

◆ areSectorLinesConfigured()

bool SprintTimer::areSectorLinesConfigured ( ) const

True when at least one split line is configured (note: NOT the circuit timer's both-or-nothing rule — a single split is legal).

◆ forceCatmullRomInterpolation()

void SprintTimer::forceCatmullRomInterpolation ( )

◆ forceLinearInterpolation()

void SprintTimer::forceLinearInterpolation ( )

◆ getBestLapDistance()

float SprintTimer::getBestLapDistance ( ) const
inline

◆ getBestLapNumber()

int SprintTimer::getBestLapNumber ( ) const
inline

◆ getBestLapTime()

unsigned long SprintTimer::getBestLapTime ( ) const
inline

◆ getBestRunDistance()

float SprintTimer::getBestRunDistance ( ) const

◆ getBestRunNumber()

int SprintTimer::getBestRunNumber ( ) const

1-based run number that set the best time (0 = none yet).

◆ getBestRunTime()

unsigned long SprintTimer::getBestRunTime ( ) const

◆ getBestSector1LapNumber()

int SprintTimer::getBestSector1LapNumber ( ) const

◆ getBestSector1Time()

unsigned long SprintTimer::getBestSector1Time ( ) const

◆ getBestSector2LapNumber()

int SprintTimer::getBestSector2LapNumber ( ) const

◆ getBestSector2Time()

unsigned long SprintTimer::getBestSector2Time ( ) const

◆ getBestSector3LapNumber()

int SprintTimer::getBestSector3LapNumber ( ) const

◆ getBestSector3Time()

unsigned long SprintTimer::getBestSector3Time ( ) const

◆ getCancelledRunCount()

int SprintTimer::getCancelledRunCount ( ) const

Runs cancelled by re-crossing the start line mid-run.

◆ getCrossing()

bool SprintTimer::getCrossing ( ) const

True while inside any configured line's crossing zone.

◆ getCurrentLapDistance()

float SprintTimer::getCurrentLapDistance ( ) const
inline

◆ getCurrentLapSector1Time()

unsigned long SprintTimer::getCurrentLapSector1Time ( ) const

◆ getCurrentLapSector2Time()

unsigned long SprintTimer::getCurrentLapSector2Time ( ) const

◆ getCurrentLapSector3Time()

unsigned long SprintTimer::getCurrentLapSector3Time ( ) const

◆ getCurrentLapTime()

unsigned long SprintTimer::getCurrentLapTime ( ) const
inline

◆ getCurrentRunDistance()

float SprintTimer::getCurrentRunDistance ( ) const

◆ getCurrentRunTime()

unsigned long SprintTimer::getCurrentRunTime ( ) const

Elapsed ms of the run in progress, 0 while WAITING.

◆ getCurrentSector()

int SprintTimer::getCurrentSector ( ) const

Current segment (1..N) while a run is active, 0 while WAITING.

◆ getCurrentSpeedKmh()

float SprintTimer::getCurrentSpeedKmh ( ) const

◆ getCurrentSpeedMph()

float SprintTimer::getCurrentSpeedMph ( ) const

◆ getDirection()

int SprintTimer::getDirection ( ) const
inline

◆ getLaps()

int SprintTimer::getLaps ( ) const
inline

◆ getLastLapDistance()

float SprintTimer::getLastLapDistance ( ) const
inline

◆ getLastLapTime()

unsigned long SprintTimer::getLastLapTime ( ) const
inline

◆ getLastRunDistance()

float SprintTimer::getLastRunDistance ( ) const

◆ getLastRunTime()

unsigned long SprintTimer::getLastRunTime ( ) const

◆ getOptimalLapTime()

unsigned long SprintTimer::getOptimalLapTime ( ) const

Sum of best segment times (theoretical best run). 0 unless at least one split is configured and every segment has a best recorded.

◆ getPaceDifference()

float SprintTimer::getPaceDifference ( ) const

Pace delta vs the best run in ms per meter (see DovesLapTimer::getPaceDifference). 0 while WAITING.

◆ getRaceStarted()

bool SprintTimer::getRaceStarted ( ) const

True once any run has ever started this session.

◆ getRejectedCrossingCount()

unsigned int SprintTimer::getRejectedCrossingCount ( ) const

Total zone exits whose interpolation was rejected, all lines.

◆ getRuns()

int SprintTimer::getRuns ( ) const

Completed run count this session.

◆ getTotalDistanceTraveled()

float SprintTimer::getTotalDistanceTraveled ( ) const

◆ isDirectionResolved()

bool SprintTimer::isDirectionResolved ( ) const
inline

◆ isFinishLineConfigured()

bool SprintTimer::isFinishLineConfigured ( ) const

◆ isRunActive()

bool SprintTimer::isRunActive ( ) const

True while a run is in progress (between start and finish).

◆ isStartLineConfigured()

bool SprintTimer::isStartLineConfigured ( ) const

◆ loop()

int SprintTimer::loop ( double  currentLat,
double  currentLng,
float  currentAltitudeMeters,
float  currentSpeedKnots 
)

Feed a GPS fix. Call updateCurrentTime() first, then this, on every fix — identical contract to DovesLapTimer::loop().

Parameters
currentLatLatitude in decimal degrees.
currentLngLongitude in decimal degrees.
currentAltitudeMetersAltitude in meters.
currentSpeedKnotsSpeed in knots.
Returns
0 if near any configured line this fix, -1 otherwise (or the fix was rejected as invalid).

◆ reset()

void SprintTimer::reset ( )

Reset all run/timing state to zero. Configured lines are kept.

◆ setFinishLine()

void SprintTimer::setFinishLine ( double  pointALat,
double  pointALng,
double  pointBLat,
double  pointBLng 
)

Sets the FINISH line (a run completes when it is crossed while a run is active).

◆ setSector2Line()

void SprintTimer::setSector2Line ( double  pointALat,
double  pointALng,
double  pointBLat,
double  pointBLng 
)

Sets the optional sector 2 split line (closes segment 1).

◆ setSector3Line()

void SprintTimer::setSector3Line ( double  pointALat,
double  pointALng,
double  pointBLat,
double  pointBLng 
)

Sets the optional sector 3 split line (closes the segment after sector 2's, or segment 1 if sector 2 is not configured).

◆ setStartLine()

void SprintTimer::setStartLine ( double  pointALat,
double  pointALng,
double  pointBLat,
double  pointBLng 
)

Sets the START line (a run begins when it is crossed).

◆ updateCurrentTime()

void SprintTimer::updateCurrentTime ( unsigned long  currentTimeMilliseconds)

Updates the current GPS time since midnight (milliseconds).


The documentation for this class was generated from the following files: