public interface EventLoop
Event loops need to implement this interface. Contains methods for managing the life cycle of your robot.
Modifier and Type | Method and Description |
---|---|
OpModeManager |
getOpModeManager() |
void |
init(EventLoopManager eventLoopManager)
Init method, this will be called before the first call to loop.
|
void |
loop()
This method will be repeatedly called by the event loop manager.
|
void |
processCommand(Command command)
Process command method, this will be called if the event loop manager receives a user defined
command.
|
void |
teardown()
Teardown method, this will be called after the last call to loop.
|
void init(EventLoopManager eventLoopManager) throws RobotCoreException, java.lang.InterruptedException
eventLoopManager
- event loop manager that is responsible for this event loopRobotCoreException
- if a RobotCoreException is thrown, it will be handled
by the event loop manager. The manager will report that the robot failed
to start.java.lang.InterruptedException
void loop() throws RobotCoreException, java.lang.InterruptedException
RobotCoreException
- if a RobotCoreException is thrown, it will be handled
by the event loop manager. The manager may decide to either stop processing
this iteration of the loop, or it may decide to shut down the robot.java.lang.InterruptedException
void teardown() throws RobotCoreException, java.lang.InterruptedException
RobotCoreException
- if a RobotCoreException is thrown, it will be handled by the event
loop manager. The manager will then attempt to shut down the robot without the benefit
of the teardown method.java.lang.InterruptedException
void processCommand(Command command)
command
- command to processOpModeManager getOpModeManager()