16#ifndef _WAYPOINT_LAP_TIMER_H
17#define _WAYPOINT_LAP_TIMER_H
24#define WLT_STATE_IDLE 0
25#define WLT_STATE_WAITING_SPEED 1
26#define WLT_STATE_DRIVING 2
27#define WLT_STATE_IN_PROXIMITY 3
34 int loop(
double currentLat,
double currentLng,
float currentAltitudeMeters,
float currentSpeedKnots);
80#ifdef DOVES_DISABLE_DEBUG
88 template<
typename... Args>
void debug_print(Args&&...) {}
89 template<
typename... Args>
void debug_println(Args&&...) {}
91 template<
typename... Args>
92 void debug_print(Args&&... args) {
93 if(_serial) { _serial->print(std::forward<Args>(args)...); }
95 template<
typename... Args>
96 void debug_println(Args&&... args) {
97 if(_serial) { _serial->println(std::forward<Args>(args)...); }
102 void _checkSpeed(
double lat,
double lng);
103 void _checkProximity(
double lat,
double lng);
104 void _updateProximity(
double lat,
double lng);
105 void _resetClosestApproach();
106 void _finalizeProximityPass();
111 unsigned long _millisecondsSinceMidnight;
116 float _waypointOdometer;
119 float _totalDistanceTraveled;
120 double _positionPrevLat;
121 double _positionPrevLng;
122 bool _firstPositionReceived;
123 int _consecutiveJumpCount;
124 float _currentSpeedKmh;
125 float _speedThresholdMph;
126 float _proximityMeters;
131 unsigned long _currentLapStartTime;
132 unsigned long _lastLapTime;
133 unsigned long _bestLapTime;
134 float _currentLapOdometerStart;
135 float _lastLapDistance;
136 float _bestLapDistance;
145 unsigned long _closestTime;
146 float _closestOdometer;
#define DIR_UNKNOWN
Definition DovesLapTimer.h:55
void loop()
Definition basic_oled_example.ino:116
Definition WaypointLapTimer.h:29
bool areSectorLinesConfigured() const
Definition WaypointLapTimer.h:63
float getCurrentSpeedKmh() const
Definition WaypointLapTimer.cpp:289
float getTotalDistanceTraveled() const
Definition WaypointLapTimer.cpp:268
double getWaypointLat() const
Definition WaypointLapTimer.cpp:309
unsigned long getBestSector2Time() const
Definition WaypointLapTimer.h:68
void reset()
Definition WaypointLapTimer.cpp:109
bool isDirectionResolved() const
Definition WaypointLapTimer.h:77
int getCurrentSector() const
Definition WaypointLapTimer.h:62
void setSpeedThresholdMph(float mph)
Definition WaypointLapTimer.cpp:113
unsigned long getCurrentLapTime() const
Definition WaypointLapTimer.cpp:248
unsigned long getBestSector1Time() const
Definition WaypointLapTimer.h:67
int getBestLapNumber() const
Definition WaypointLapTimer.cpp:272
int getBestSector2LapNumber() const
Definition WaypointLapTimer.h:72
int getDirection() const
Definition WaypointLapTimer.h:76
void updateCurrentTime(unsigned long currentTimeMilliseconds)
Definition WaypointLapTimer.cpp:51
float getCurrentSpeedMph() const
Definition WaypointLapTimer.cpp:293
int getBestSector3LapNumber() const
Definition WaypointLapTimer.h:73
bool getCrossing() const
Definition WaypointLapTimer.cpp:240
unsigned long getBestSector3Time() const
Definition WaypointLapTimer.h:69
unsigned long getCurrentLapSector3Time() const
Definition WaypointLapTimer.h:66
int getLaps() const
Definition WaypointLapTimer.cpp:244
unsigned long getCurrentLapSector1Time() const
Definition WaypointLapTimer.h:64
float getLastLapDistance() const
Definition WaypointLapTimer.cpp:297
int getBestSector1LapNumber() const
Definition WaypointLapTimer.h:71
bool hasWaypoint() const
Definition WaypointLapTimer.cpp:305
float getPaceDifference() const
Definition WaypointLapTimer.cpp:276
unsigned long getCurrentLapSector2Time() const
Definition WaypointLapTimer.h:65
float getBestLapDistance() const
Definition WaypointLapTimer.cpp:301
float getCurrentLapDistance() const
Definition WaypointLapTimer.cpp:262
void setProximityMeters(float meters)
Definition WaypointLapTimer.cpp:117
unsigned long getOptimalLapTime() const
Definition WaypointLapTimer.h:70
double getWaypointLng() const
Definition WaypointLapTimer.cpp:313
bool getRaceStarted() const
Definition WaypointLapTimer.cpp:236
unsigned long getLastLapTime() const
Definition WaypointLapTimer.cpp:254
unsigned long getBestLapTime() const
Definition WaypointLapTimer.cpp:258