public class DecodedControlAction
extends java.lang.Object
An immutable and pure data class that represents an action decoded from a protocol data message.
| Modifier and Type | Class and Description |
|---|---|
static class |
DecodedControlAction.Action
All recognized actions.
|
static class |
DecodedControlAction.Motor
All motor ports and possible combinations without repetitions.
|
| Modifier and Type | Field and Description |
|---|---|
DecodedControlAction.Action |
action |
DecodedControlAction.Motor |
motor |
int |
speed |
| Constructor and Description |
|---|
DecodedControlAction()
Create a new ControlAction object using
DecodedControlAction#STOP as
the default action, DecodedControlAction#MOTOR_ABC as motor flag, and
0 as default speed. |
DecodedControlAction(DecodedControlAction.Action action)
Create a new ControlAction object using the specified action.
|
DecodedControlAction(DecodedControlAction.Action action,
DecodedControlAction.Motor motor)
Create a new ControlAction object using the specified action and motor flag.
|
DecodedControlAction(DecodedControlAction.Action action,
DecodedControlAction.Motor motor,
int speed)
Create a new ControlAction object using the specified action, motor flag and speed.
|
public final DecodedControlAction.Action action
public final DecodedControlAction.Motor motor
public final int speed
public DecodedControlAction()
Create a new ControlAction object using DecodedControlAction#STOP as
the default action, DecodedControlAction#MOTOR_ABC as motor flag, and
0 as default speed.
public DecodedControlAction(DecodedControlAction.Action action)
Create a new ControlAction object using the specified action. The motor
flag is set to DecodedControlAction#MOTOR_ABC and the speed is set to 100.
action - The action flag to set.public DecodedControlAction(DecodedControlAction.Action action, DecodedControlAction.Motor motor)
Create a new ControlAction object using the specified action and motor flag. The speed is set to 100.
action - The action flag to set.motor - The motor flag to set.public DecodedControlAction(DecodedControlAction.Action action, DecodedControlAction.Motor motor, int speed)
Create a new ControlAction object using the specified action, motor flag and speed.
action - The action flag to set.motor - The motor flag to set.speed - The speed to set. Will be clamped to the range [-100, 100].