Delay commands: AT_TIME takes the specified time and AT_DELAY specifies the delay before the message is to be executed.
Because the resolution is frame rate, the only thing we can guarantee is that the message won't be issue before its scheduled time.
For example:
self.sendMessage("AT_DELAY",(1.0,'HEADS_UP_DISPLAY_SET_MODE',(False,))) self.sendMessage("AT_DELAY",(4.0,'HEADS_UP_DISPLAY_SET_MODE',(True,)))
will turn off the heads up display in 1s, then back on 3s after that.
Some implementation notes:
We don't have the "at wall clock time"; may come in handy for some applications and it wouldn't be difficult to add.
#include
<class_delay_interpreter_1_1_delay_interpreter.h>
Public Member Functions |
|
__init__ () | |
delayed () | |
getNumberOfDelayed () | |
getDelayedMessages () | |
tick () | |
Remember that since this method is invoked
by a timer it is called from a different thread. |
|
UPDATE_DELAYED () | |
AT_TIME () | |
Run the attached command at the specified
time, using the internal (not system) clock. |
|
AT_DELAY () | |
Delay running the attached command by a
specified interval. |
|
wantsMessage () | |
If processMessage were to be called at this
point would this interpreter handle it? |
|
MESSAGE_ARRIVED () | |
DELAY_UNTIL_MESSAGE () | |
DELAY_UNTIL_MESSAGE_BATCH () | |
REMOVE_DELAYED_MESSAGE () | |
Removes all delayed messages with the
specified message identifier. |
|
QUIT () |
DelayInterpreter.DelayInterpreter.__init__ | ( | ) |
Reimplemented from MessageInterpreter.MessageInterpreter.
DelayInterpreter.DelayInterpreter.delayed | ( | ) |
DelayInterpreter.DelayInterpreter.getNumberOfDelayed | ( | ) |
DelayInterpreter.DelayInterpreter.getDelayedMessages | ( | ) |
DelayInterpreter.DelayInterpreter.tick | ( | ) |
Remember that since this method is invoked by a timer it is called from a different thread.
This means in general that this method must be thread safe. Typically it will just trigger a redraw or queue a message.
Reimplemented from MessageInterpreter.MessageInterpreter.
DelayInterpreter.DelayInterpreter.UPDATE_DELAYED | ( | ) |
DelayInterpreter.DelayInterpreter.AT_TIME | ( | ) |
Run the attached command at the specified time, using the internal (not system) clock.
DelayInterpreter.DelayInterpreter.AT_DELAY | ( | ) |
Delay running the attached command by a specified interval.
DelayInterpreter.DelayInterpreter.wantsMessage | ( | ) |
If processMessage were to be called at this point would this interpreter handle it?
Reimplemented from MessageInterpreter.MessageInterpreter.
DelayInterpreter.DelayInterpreter.MESSAGE_ARRIVED | ( | ) |
DelayInterpreter.DelayInterpreter.DELAY_UNTIL_MESSAGE | ( | ) |
DelayInterpreter.DelayInterpreter.DELAY_UNTIL_MESSAGE_BATCH | ( | ) |
DelayInterpreter.DelayInterpreter.REMOVE_DELAYED_MESSAGE | ( | ) |
Removes all delayed messages with the specified message identifier.
DelayInterpreter.DelayInterpreter.QUIT | ( | ) |