org.team751.framework
Class FrameworkRobot

java.lang.Object
  extended by javax.microedition.midlet.MIDlet
      extended by edu.wpi.first.wpilibj.RobotBase
          extended by edu.wpi.first.wpilibj.IterativeRobot
              extended by org.team751.framework.FrameworkRobot

public class FrameworkRobot
extends edu.wpi.first.wpilibj.IterativeRobot

Robot class for the threaded robot framework
Robot classes should extend this class to use the framework.
There's one important different to keep in mind when using this framework: When overriding disabledInit(), autonomousInit(), or teleoperatedInit(), you must explicitly call the function's superclass implementation (super.disabledInit(), super.autonomousInit(), or super.teleoperatedInit() respectively). Not doing this will prevent any tasks other than the main thread from responding to enable/disable events and teleop/autonomous state changes.

Author:
Sam Crow

Field Summary
private  CompetitionState state
           
private  java.util.Vector tasks
           
 
Fields inherited from class edu.wpi.first.wpilibj.RobotBase
ERRORS_TO_DRIVERSTATION_PROP, m_ds, ROBOT_TASK_PRIORITY
 
Constructor Summary
FrameworkRobot()
           
 
Method Summary
protected  void addTask(RobotTask task)
          Add a new task.
 void autonomousInit()
           
 void disabledInit()
           
 void teleopInit()
           
private  void updateStates()
          Update every thread with the current competition state
 
Methods inherited from class edu.wpi.first.wpilibj.IterativeRobot
autonomousContinuous, autonomousPeriodic, disabledContinuous, disabledPeriodic, robotInit, startCompetition, teleopContinuous, teleopPeriodic
 
Methods inherited from class edu.wpi.first.wpilibj.RobotBase
destroyApp, free, getBooleanProperty, getWatchdog, isAutonomous, isDisabled, isEnabled, isNewDataAvailable, isOperatorControl, isSystemActive, pauseApp, startApp
 
Methods inherited from class javax.microedition.midlet.MIDlet
getAppProperty, notifyDestroyed, notifyPaused, resumeRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

state

private CompetitionState state

tasks

private java.util.Vector tasks
Constructor Detail

FrameworkRobot

public FrameworkRobot()
Method Detail

addTask

protected void addTask(RobotTask task)
Add a new task. The task will immediately be given the current state and started.

Parameters:
task - The task to add

disabledInit

public void disabledInit()
Overrides:
disabledInit in class edu.wpi.first.wpilibj.IterativeRobot

autonomousInit

public void autonomousInit()
Overrides:
autonomousInit in class edu.wpi.first.wpilibj.IterativeRobot

teleopInit

public void teleopInit()
Overrides:
teleopInit in class edu.wpi.first.wpilibj.IterativeRobot

updateStates

private void updateStates()
Update every thread with the current competition state