LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
abstractTimer.hpp
Go to the documentation of this file.
1/*
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 */
6#pragma once
7
10
11namespace okapi {
13 public:
19 explicit AbstractTimer(QTime ifirstCalled);
20
21 virtual ~AbstractTimer();
22
28 virtual QTime millis() const = 0;
29
35 virtual QTime getDt();
36
43 virtual QTime readDt() const;
44
50 virtual QTime getStartingTime() const;
51
57 virtual QTime getDtFromStart() const;
58
62 virtual void placeMark();
63
69 virtual QTime clearMark();
70
75 virtual void placeHardMark();
76
82 virtual QTime clearHardMark();
83
89 virtual QTime getDtFromMark() const;
90
96 virtual QTime getDtFromHardMark() const;
97
106 virtual bool repeat(QTime time);
107
116 virtual bool repeat(QFrequency frequency);
117
118 protected:
121 QTime mark;
122 QTime hardMark;
124};
125} // namespace okapi
virtual void placeMark()
Place a time marker.
virtual ~AbstractTimer()
virtual QTime millis() const =0
Returns the current time in units of QTime.
virtual QTime getDtFromMark() const
Returns the time since the time marker.
virtual QTime getDtFromHardMark() const
Returns the time since the hard time marker.
virtual QTime readDt() const
Returns the time passed in ms since the previous call of getDt().
virtual QTime clearMark()
Clears the marker.
virtual QTime getDtFromStart() const
Returns the time since the timer was first constructed.
virtual QTime getDt()
Returns the time passed in ms since the previous call of this function.
virtual bool repeat(QTime time)
Returns true when the input time period has passed, then resets.
virtual QTime getStartingTime() const
Returns the time the timer was first constructed.
virtual QTime clearHardMark()
Clears the hard marker.
AbstractTimer(QTime ifirstCalled)
A Timer base class which implements its methods in terms of millis().
virtual void placeHardMark()
Place a hard time marker.
virtual bool repeat(QFrequency frequency)
Returns true when the input time period has passed, then resets.