RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
org.wpilib.command3.SchedulerEvent Interface Reference

Public Member Functions

long timestampNanos ()
record Scheduled (Command command, long timestampNanos) implements SchedulerEvent
record Mounted (Command command, long timestampNanos) implements SchedulerEvent
record Yielded (Command command, long timestampNanos) implements SchedulerEvent
record Completed (Command command, long timestampNanos) implements SchedulerEvent
record CompletedWithError (Command command, Throwable error, long timestampNanos) implements SchedulerEvent
record Canceled (Command command, long timestampNanos) implements SchedulerEvent
record Interrupted (Command command, Command interrupter, long timestampNanos) implements SchedulerEvent
record ForkFailure (Command command, List< ScheduleResult.Failure > failures, long timestampNanos) implements SchedulerEvent

Detailed Description

An event that occurs during scheduler processing. This can range from a command being scheduled by a trigger or manual call to Scheduler#schedule(Command) to a command being interrupted by another. Event listeners can be registered with a scheduler via Scheduler#addEventListener(Consumer). All events have a timestamp to indicate when the event occurred.

Definition at line 19 of file SchedulerEvent.java.

Member Function Documentation

◆ Canceled()

record org.wpilib.command3.SchedulerEvent.Canceled ( Command command,
long timestampNanos )

An event marking when a command was canceled. If the command was canceled because it was interrupted by another command, an Interrupted will be emitted immediately prior to the cancellation event.

Parameters
commandThe command that was canceled
timestampNanosWhen the command was canceled

Definition at line 79 of file SchedulerEvent.java.

◆ Completed()

record org.wpilib.command3.SchedulerEvent.Completed ( Command command,
long timestampNanos )

An event marking when a command completed naturally.

Parameters
commandThe command that completed
timestampNanosWhen the command completed

Definition at line 59 of file SchedulerEvent.java.

◆ CompletedWithError()

record org.wpilib.command3.SchedulerEvent.CompletedWithError ( Command command,
Throwable error,
long timestampNanos )

An event marking when a command threw or encountered an unhanded exception.

Parameters
commandThe command that encountered the error
errorThe unhandled error
timestampNanosWhen the error occurred

Definition at line 68 of file SchedulerEvent.java.

◆ ForkFailure()

record org.wpilib.command3.SchedulerEvent.ForkFailure ( Command command,
List< ScheduleResult.Failure > failures,
long timestampNanos )

An event marking when a child command could not be forked.

Parameters
commandThe command attempting to fork the child commands
failuresThe reasons the child commands could not be forked
timestampNanosWhen the child commands were attempted to be forked

Definition at line 99 of file SchedulerEvent.java.

◆ Interrupted()

record org.wpilib.command3.SchedulerEvent.Interrupted ( Command command,
Command interrupter,
long timestampNanos )

An event marking when a command was interrupted by another. Typically followed by an Canceled event.

Parameters
commandThe command that was interrupted
interrupterThe interrupting command
timestampNanosWhen the command was interrupted

Definition at line 89 of file SchedulerEvent.java.

◆ Mounted()

record org.wpilib.command3.SchedulerEvent.Mounted ( Command command,
long timestampNanos )

An event marking when a command starts running.

Parameters
commandThe command that started
timestampNanosWhen the command started

Definition at line 43 of file SchedulerEvent.java.

◆ Scheduled()

record org.wpilib.command3.SchedulerEvent.Scheduled ( Command command,
long timestampNanos )

An event marking when a command is scheduled in Scheduler#schedule(Command).

Parameters
commandThe command that was scheduled
timestampNanosWhen the command was scheduled

Definition at line 35 of file SchedulerEvent.java.

◆ timestampNanos()

long org.wpilib.command3.SchedulerEvent.timestampNanos ( )

The timestamp for when the event occurred. Measured in nanoseconds since some arbitrary start time.

Returns
The event timestamp.
See also
RobotController.getTime()

◆ Yielded()

record org.wpilib.command3.SchedulerEvent.Yielded ( Command command,
long timestampNanos )

An event marking when a command yielded control with Coroutine#yield().

Parameters
commandThe command that yielded
timestampNanosWhen the command yielded

Definition at line 51 of file SchedulerEvent.java.


The documentation for this interface was generated from the following file: