CommandGroup¶
- class commands1.CommandGroup(*args, **kwargs)¶
Bases:
commands1._impl._commands_v1.command.Command
A CommandGroup is a list of commands which are executed in sequence.
Commands in a CommandGroup are added using the AddSequential() method and are called sequentially. CommandGroups are themselves Commands and can be given to other CommandGroups.
CommandGroups will carry all of the requirements of their Command subcommands. Additional requirements can be specified by calling Requires() normally in the constructor.
CommandGroups can also execute commands in parallel, simply by adding them using AddParallel().
This class is provided by the OldCommands VendorDep
@see Command @see Subsystem
Overloaded function.
__init__(self: commands1._impl._commands_v1.command.CommandGroup) -> None
__init__(self: commands1._impl._commands_v1.command.CommandGroup, name: str) -> None
Creates a new CommandGroup with the given name.
- Parameters
name – The name for this command group
- addParallel(*args, **kwargs)¶
Overloaded function.
addParallel(self: commands1._impl._commands_v1.command.CommandGroup, command: commands1._impl._commands_v1.command.Command) -> None
Adds a new child Command to the group. The Command will be started after all the previously added Commands.
Instead of waiting for the child to finish, a CommandGroup will have it run at the same time as the subsequent Commands. The child will run until either it finishes, a new child with conflicting requirements is started, or the main sequence runs a Command with conflicting requirements. In the latter two cases, the child will be canceled even if it says it can’t be interrupted.
Note that any requirements the given Command has will be added to the group. For this reason, a Command’s requirements can not be changed after being added to a group.
It is recommended that this method be called in the constructor.
- Parameters
command – The command to be added
addParallel(self: commands1._impl._commands_v1.command.CommandGroup, command: commands1._impl._commands_v1.command.Command, timeout: seconds) -> None
Adds a new child Command to the group with the given timeout. The Command will be started after all the previously added Commands.
Once the Command is started, it will run until it finishes, is interrupted, or the time expires, whichever is sooner. Note that the given Command will have no knowledge that it is on a timer.
Instead of waiting for the child to finish, a CommandGroup will have it run at the same time as the subsequent Commands. The child will run until either it finishes, the timeout expires, a new child with conflicting requirements is started, or the main sequence runs a Command with conflicting requirements. In the latter two cases, the child will be canceled even if it says it can’t be interrupted.
Note that any requirements the given Command has will be added to the group. For this reason, a Command’s requirements can not be changed after being added to a group.
It is recommended that this method be called in the constructor.
- Parameters
command – The command to be added
timeout – The timeout
- addSequential(*args, **kwargs)¶
Overloaded function.
addSequential(self: commands1._impl._commands_v1.command.CommandGroup, command: commands1._impl._commands_v1.command.Command) -> None
Adds a new Command to the group. The Command will be started after all the previously added Commands.
Note that any requirements the given Command has will be added to the group. For this reason, a Command’s requirements can not be changed after being added to a group.
It is recommended that this method be called in the constructor.
- Parameters
command – The Command to be added
addSequential(self: commands1._impl._commands_v1.command.CommandGroup, command: commands1._impl._commands_v1.command.Command, timeout: seconds) -> None
Adds a new Command to the group with a given timeout. The Command will be started after all the previously added commands.
Once the Command is started, it will be run until it finishes or the time expires, whichever is sooner. Note that the given Command will have no knowledge that it is on a timer.
Note that any requirements the given Command has will be added to the group. For this reason, a Command’s requirements can not be changed after being added to a group.
It is recommended that this method be called in the constructor.
- Parameters
command – The Command to be added
timeout – The timeout
- end() None ¶
Can be overridden by teams.
- execute() None ¶
Can be overridden by teams.
- getSize() int ¶
- initialize() None ¶
Can be overridden by teams.
- interrupted() None ¶
Can be overridden by teams.
- isFinished() bool ¶
Can be overridden by teams.
- isInterruptible() bool ¶