|
|
| Chronometer (Engine &engine=Engine::primary()) |
| | Constructor.
|
| |
| virtual float | get () |
| | Returns elapsed time since start (in seconds).
|
| |
| virtual float | put (float value) |
| | Sets current time in seconds and returns it.
|
| |
|
virtual void | clearEvents () |
| |
|
float | seconds () const |
| | Returns engine time in seconds.
|
| |
|
uint32_t | milliSeconds () const |
| | Returns engine time in milliseconds.
|
| |
|
uint64_t | microSeconds () const |
| | Returns engine time in microseconds.
|
| |
|
unsigned long | nSteps () const |
| | Returns number of engine steps.
|
| |
|
float | sampleRate () const |
| | Returns engine sample rate.
|
| |
|
float | samplePeriod () const |
| | Returns enginesample period.
|
| |
|
| operator float () |
| | Object can be used directly to access its value.
|
| |
| virtual float | mapTo (float toLow, float toHigh) |
| | Maps value to new range.
|
| |
|
| operator bool () |
| | Operator that allows usage in conditional expressions.
|
| |
| virtual void | pause () |
| | Interrupts the chronometer.
|
| |
| virtual void | resume () |
| | Resumes process.
|
| |
|
virtual float | elapsed () const |
| | The time currently elapsed by the chronometer (in seconds).
|
| |
|
virtual bool | hasPassed (float timeout) const |
| | Returns true iff elapsed time has passed given timeout.
|
| |
| virtual bool | hasPassed (float timeout, bool restartIfPassed) |
| |
| virtual void | setTime (float time) |
| | Forces current time (in seconds).
|
| |
| virtual void | addTime (float time) |
| | Adds/subtracts time to the chronometer.
|
| |
| virtual bool | isRunning () const |
| | Returns true iff the chronometer is currently running.
|
| |
| bool | isStarted () const |
| |
| virtual void | start () |
| | Starts/restarts the chronometer.
|
| |
|
virtual void | stop () |
| | Interrupts the chronometer and resets to zero.
|
| |
|
virtual void | togglePause () |
| | Toggles pause/unpause.
|
| |
|
|
static bool | analogToDigital (float f) |
| | Converts analog (float) value to digital (bool) value.
|
| |
|
static float | digitalToAnalog (bool b) |
| | Converts digital (bool) value to analog (float) value.
|
| |
|
| virtual void | begin () |
| |
| virtual void | step () |
| |
| virtual float | _time () const |
| |
| virtual bool | eventTriggered (EventType eventType) |
| | Returns true iff an event of a certain type has been triggered.
|
| |
|
virtual void | onEvent (EventCallback callback, EventType eventType) |
| | Registers event callback.
|
| |
|
Engine * | engine () const |
| | Returns the engine that owns this unit.
|
| |
|
virtual void | update () |
| |
| virtual void | _setRunning (bool isRunning) |
| |
|
|
float | _startTime |
| |
|
float | _offsetTime |
| |
|
float | _elapsedTime |
| |
|
bool | _isRunning |
| |
◆ _setRunning()
| virtual void pq::AbstractChronometer::_setRunning |
( |
bool |
isRunning | ) |
|
|
inlineprotectedvirtualinherited |
◆ _time()
| float pq::Chronometer::_time |
( |
| ) |
const |
|
protectedvirtual |
◆ addTime()
| void pq::AbstractChronometer::addTime |
( |
float |
time | ) |
|
|
virtualinherited |
Adds/subtracts time to the chronometer.
Implements pq::Timeable.
◆ begin()
| void pq::Chronometer::begin |
( |
| ) |
|
|
protectedvirtual |
◆ eventTriggered()
| virtual bool pq::Unit::eventTriggered |
( |
EventType |
eventType | ) |
|
|
inlineprotectedvirtualinherited |
◆ get()
| virtual float pq::Chronometer::get |
( |
| ) |
|
|
inlinevirtual |
Returns elapsed time since start (in seconds).
Reimplemented from pq::Chainable.
◆ hasPassed()
| bool pq::AbstractChronometer::hasPassed |
( |
float |
timeout, |
|
|
bool |
restartIfPassed |
|
) |
| |
|
virtualinherited |
- Deprecated:
- Returns true iff elapsed time has passed given timeout (optional argument to automatically restart if true).
◆ isRunning()
| virtual bool pq::AbstractChronometer::isRunning |
( |
| ) |
const |
|
inlinevirtualinherited |
Returns true iff the chronometer is currently running.
Implements pq::Timeable.
◆ isStarted()
| bool pq::AbstractChronometer::isStarted |
( |
| ) |
const |
|
inlineinherited |
◆ mapTo()
| virtual float pq::Chainable::mapTo |
( |
float |
toLow, |
|
|
float |
toHigh |
|
) |
| |
|
inlinevirtualinherited |
◆ pause()
| void pq::AbstractChronometer::pause |
( |
| ) |
|
|
virtualinherited |
Interrupts the chronometer.
Reimplemented from pq::Timeable.
◆ put()
| float pq::Chronometer::put |
( |
float |
value | ) |
|
|
virtual |
Sets current time in seconds and returns it.
Reimplemented from pq::Chainable.
◆ resume()
| void pq::AbstractChronometer::resume |
( |
| ) |
|
|
virtualinherited |
◆ setTime()
| void pq::AbstractChronometer::setTime |
( |
float |
time | ) |
|
|
virtualinherited |
◆ start()
| void pq::Timeable::start |
( |
| ) |
|
|
virtualinherited |
◆ step()
| void pq::Chronometer::step |
( |
| ) |
|
|
protectedvirtual |
The documentation for this class was generated from the following files:
- /home/tats/Documents/workspace/Plaquette/src/Chronometer.h
- /home/tats/Documents/workspace/Plaquette/src/Chronometer.cpp