ConditionalCommand

class commands1.ConditionalCommand(*args, **kwargs)

Bases: commands1._impl._commands_v1.command.Command

A ConditionalCommand is a Command that starts one of two commands.

A ConditionalCommand uses the Condition method to determine whether it should run onTrue or onFalse.

A ConditionalCommand adds the proper Command to the Scheduler during Initialize() and then IsFinished() will return true once that Command has finished executing.

If no Command is specified for onFalse, the occurrence of that condition will be a no-op.

A ConditionalCommand will require the superset of subsystems of the onTrue and onFalse commands.

This class is provided by the OldCommands VendorDep

@see Command @see Scheduler

Overloaded function.

  1. __init__(self: commands1._impl._commands_v1.command.ConditionalCommand, onTrue: commands1._impl._commands_v1.command.Command, onFalse: commands1._impl._commands_v1.command.Command = None) -> None

Creates a new ConditionalCommand with given onTrue and onFalse Commands.

Parameters
  • onTrue – The Command to execute if Condition() returns true

  • onFalse – The Command to execute if Condition() returns false

  1. __init__(self: commands1._impl._commands_v1.command.ConditionalCommand, name: str, onTrue: commands1._impl._commands_v1.command.Command, onFalse: commands1._impl._commands_v1.command.Command = None) -> None

Creates a new ConditionalCommand with given onTrue and onFalse Commands.

Parameters
  • name – The name for this command group

  • onTrue – The Command to execute if Condition() returns true

  • onFalse – The Command to execute if Condition() returns false

isFinished() bool