Class Operator

java.lang.Object
frc8768.robot.operators.Operator
Direct Known Subclasses:
DrivebaseOperator

public abstract class Operator extends Object
Abstract class designed for Operators. Anything universal to operators goes in here.

IMPORTANT: OPERATORS ARE THREADED! For every operator a thread is made. It will process one operator without stalling other operators.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Operator constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Start the thread, do not call this method more than once per-operator.
    boolean
    Check thread status
    void
    Should an essential subsystem's thread die, restart it.
    abstract void
    run()
    The operator-specific code
    void
    While loop wrapper

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Operator

      public Operator(String name)
      Operator constructor.
      Parameters:
      name - The name of the operator.
  • Method Details

    • init

      public void init()
      Start the thread, do not call this method more than once per-operator.
    • runLoop

      public void runLoop()
      While loop wrapper
    • run

      public abstract void run()
      The operator-specific code
    • reviveThread

      public void reviveThread()
      Should an essential subsystem's thread die, restart it.
    • isAlive

      public boolean isAlive()
      Check thread status
      Returns:
      output of Thread isAlive() function for the op thread