Interface MultiPhaseAction

  • All Superinterfaces:
    Action

    public interface MultiPhaseAction
    extends Action
    A continuing action can ask to be iterated within the cycle.

    Motors must:

    • Detect when an action is a multi-phase action at initialization time, not in the inner loop
    • Call accept(cycle) as normal.
    • If the action is a multi-phase action, keep calling accept(cycle), with the same cycle number as above, until incomplete returns false.
    • Method Summary

      Modifier and Type Method Description
      boolean incomplete()
      Signal to the caller whether or not the current multi-phase is completed.
      int runPhase​(long value)
      Apply a work function to an input value, producing an int status code.
      • Methods inherited from interface io.engineblock.activityapi.core.Action

        init
    • Method Detail

      • incomplete

        boolean incomplete()
        Signal to the caller whether or not the current multi-phase is completed.
        Returns:
        true when the action is not yet complete.
      • runPhase

        int runPhase​(long value)

        Apply a work function to an input value, producing an int status code.

        This iterative interface represents work that occurs within the scope of an existing action cycle. The last value returned by this phase loop will take the place of the value returned by SyncAction.runCycle(long)

        This will be called iteratively so long as incomplete() returns true.

        The meaning of status codes is activity specific, however, negative values are reserved.

        Parameters:
        value - a long input
        Returns:
        an int status