|
|
|
@ -31,6 +31,8 @@ namespace RaspiControl { |
|
|
|
JoystickRight, |
|
|
|
JoystickRight, |
|
|
|
JoystickCenter, |
|
|
|
JoystickCenter, |
|
|
|
autoMode, |
|
|
|
autoMode, |
|
|
|
|
|
|
|
finished, |
|
|
|
|
|
|
|
failure, |
|
|
|
none |
|
|
|
none |
|
|
|
} |
|
|
|
} |
|
|
|
internal class StateMachine { |
|
|
|
internal class StateMachine { |
|
|
|
@ -69,28 +71,48 @@ namespace RaspiControl { |
|
|
|
{new StateTransition(ProcessState.Ready,Command.JoystickLeft), ProcessState.StartMoveManual }, |
|
|
|
{new StateTransition(ProcessState.Ready,Command.JoystickLeft), ProcessState.StartMoveManual }, |
|
|
|
{new StateTransition(ProcessState.Ready,Command.JoystickRight), ProcessState.StartMoveManual }, |
|
|
|
{new StateTransition(ProcessState.Ready,Command.JoystickRight), ProcessState.StartMoveManual }, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{new StateTransition(ProcessState.StartMoveManual,Command.none), ProcessState.MoveManual }, |
|
|
|
{new StateTransition(ProcessState.StartMoveManual,Command.none), ProcessState.MoveManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.StartMoveManual, Command.autoMode), ProcessState.Auto }, |
|
|
|
|
|
|
|
|
|
|
|
{new StateTransition(ProcessState.MoveManualF, Command.none), ProcessState.MoveManual }, |
|
|
|
{new StateTransition(ProcessState.MoveManualF, Command.none), ProcessState.MoveManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.MoveManualF, Command.autoMode), ProcessState.Auto }, |
|
|
|
{new StateTransition(ProcessState.MoveManualB, Command.none), ProcessState.MoveManual }, |
|
|
|
{new StateTransition(ProcessState.MoveManualB, Command.none), ProcessState.MoveManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.MoveManualB, Command.autoMode), ProcessState.Auto }, |
|
|
|
{new StateTransition(ProcessState.MoveManualL, Command.none), ProcessState.MoveManual }, |
|
|
|
{new StateTransition(ProcessState.MoveManualL, Command.none), ProcessState.MoveManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.MoveManualL, Command.autoMode), ProcessState.Auto }, |
|
|
|
{new StateTransition(ProcessState.MoveManualR, Command.none), ProcessState.MoveManual }, |
|
|
|
{new StateTransition(ProcessState.MoveManualR, Command.none), ProcessState.MoveManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.MoveManualR, Command.autoMode), ProcessState.Auto }, |
|
|
|
|
|
|
|
|
|
|
|
{new StateTransition(ProcessState.MoveManual, Command.JoystickUp), ProcessState.MoveManualF }, |
|
|
|
{new StateTransition(ProcessState.MoveManual, Command.JoystickUp), ProcessState.MoveManualF }, |
|
|
|
{new StateTransition(ProcessState.MoveManual, Command.JoystickDown), ProcessState.MoveManualB }, |
|
|
|
{new StateTransition(ProcessState.MoveManual, Command.JoystickDown), ProcessState.MoveManualB }, |
|
|
|
{new StateTransition(ProcessState.MoveManual, Command.JoystickLeft), ProcessState.MoveManualL }, |
|
|
|
{new StateTransition(ProcessState.MoveManual, Command.JoystickLeft), ProcessState.MoveManualL }, |
|
|
|
{new StateTransition(ProcessState.MoveManual, Command.JoystickRight), ProcessState.MoveManualR }, |
|
|
|
{new StateTransition(ProcessState.MoveManual, Command.JoystickRight), ProcessState.MoveManualR }, |
|
|
|
{new StateTransition(ProcessState.MoveManual, Command.JoystickCenter), ProcessState.StopManual }, |
|
|
|
{new StateTransition(ProcessState.MoveManual, Command.JoystickCenter), ProcessState.StopManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.MoveManual, Command.autoMode), ProcessState.Auto }, |
|
|
|
|
|
|
|
|
|
|
|
{new StateTransition(ProcessState.StopManual,Command.JoystickUp), ProcessState.ResumeMoveManual }, |
|
|
|
{new StateTransition(ProcessState.StopManual,Command.JoystickUp), ProcessState.ResumeMoveManual }, |
|
|
|
{new StateTransition(ProcessState.StopManual,Command.JoystickDown), ProcessState.ResumeMoveManual }, |
|
|
|
{new StateTransition(ProcessState.StopManual,Command.JoystickDown), ProcessState.ResumeMoveManual }, |
|
|
|
{new StateTransition(ProcessState.StopManual,Command.JoystickLeft), ProcessState.ResumeMoveManual }, |
|
|
|
{new StateTransition(ProcessState.StopManual,Command.JoystickLeft), ProcessState.ResumeMoveManual }, |
|
|
|
{new StateTransition(ProcessState.StopManual,Command.JoystickRight), ProcessState.ResumeMoveManual }, |
|
|
|
{new StateTransition(ProcessState.StopManual,Command.JoystickRight), ProcessState.ResumeMoveManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.StopManual, Command.autoMode), ProcessState.Auto }, |
|
|
|
|
|
|
|
|
|
|
|
{new StateTransition(ProcessState.ResumeMoveManual, Command.none),ProcessState.MoveManual }, |
|
|
|
{new StateTransition(ProcessState.ResumeMoveManual, Command.none),ProcessState.MoveManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.ResumeMoveManual, Command.autoMode), ProcessState.Auto }, |
|
|
|
{new StateTransition(ProcessState.MoveManual, Command.autoMode), ProcessState.Auto }, |
|
|
|
|
|
|
|
|
|
|
|
{new StateTransition(ProcessState.Auto, Command.finished), ProcessState.Final }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.Auto, Command.JoystickUp), ProcessState.StartMoveManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.Auto, Command.JoystickDown), ProcessState.StartMoveManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.Auto, Command.JoystickLeft), ProcessState.StartMoveManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.Auto, Command.JoystickRight), ProcessState.StartMoveManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.Auto, Command.JoystickCenter), ProcessState.StartMoveManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.Auto, Command.failure), ProcessState.Error }, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{new StateTransition(ProcessState.Error, Command.JoystickUp), ProcessState.StartMoveManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.Error, Command.JoystickDown), ProcessState.StartMoveManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.Error, Command.JoystickLeft), ProcessState.StartMoveManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.Error, Command.JoystickRight), ProcessState.StartMoveManual }, |
|
|
|
|
|
|
|
{new StateTransition(ProcessState.Error, Command.JoystickCenter), ProcessState.StartMoveManual }, |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|