|
|
|
|
@ -33,7 +33,8 @@ namespace RaspiControl { |
|
|
|
|
autoMode, |
|
|
|
|
finished, |
|
|
|
|
failure, |
|
|
|
|
none |
|
|
|
|
none, |
|
|
|
|
manualMode |
|
|
|
|
} |
|
|
|
|
internal class StateMachine { |
|
|
|
|
|
|
|
|
|
@ -70,10 +71,13 @@ namespace RaspiControl { |
|
|
|
|
{new StateTransition(ProcessState.Ready,Command.JoystickDown), ProcessState.StartMoveManual }, |
|
|
|
|
{new StateTransition(ProcessState.Ready,Command.JoystickLeft), ProcessState.StartMoveManual }, |
|
|
|
|
{new StateTransition(ProcessState.Ready,Command.JoystickRight), ProcessState.StartMoveManual }, |
|
|
|
|
{new StateTransition(ProcessState.Ready,Command.autoMode), ProcessState.Auto }, |
|
|
|
|
{new StateTransition(ProcessState.Ready,Command.manualMode), ProcessState.Ready }, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{new StateTransition(ProcessState.StartMoveManual,Command.none), ProcessState.MoveManual }, |
|
|
|
|
{new StateTransition(ProcessState.StartMoveManual, Command.autoMode), ProcessState.Auto }, |
|
|
|
|
{new StateTransition(ProcessState.StartMoveManual, Command.manualMode), ProcessState.StartMoveManual }, |
|
|
|
|
|
|
|
|
|
{new StateTransition(ProcessState.MoveManualF, Command.none), ProcessState.MoveManual }, |
|
|
|
|
{new StateTransition(ProcessState.MoveManualF, Command.autoMode), ProcessState.Auto }, |
|
|
|
|
@ -101,18 +105,22 @@ namespace RaspiControl { |
|
|
|
|
{new StateTransition(ProcessState.ResumeMoveManual, 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.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.Auto, Command.manualMode), ProcessState.ResumeMoveManual }, |
|
|
|
|
|
|
|
|
|
{new StateTransition(ProcessState.Error, Command.JoystickUp), ProcessState.ResumeMoveManual }, |
|
|
|
|
{new StateTransition(ProcessState.Error, Command.JoystickDown), ProcessState.ResumeMoveManual }, |
|
|
|
|
{new StateTransition(ProcessState.Error, Command.JoystickLeft), ProcessState.ResumeMoveManual }, |
|
|
|
|
{new StateTransition(ProcessState.Error, Command.JoystickRight), ProcessState.ResumeMoveManual }, |
|
|
|
|
{new StateTransition(ProcessState.Error, Command.JoystickCenter), ProcessState.ResumeMoveManual }, |
|
|
|
|
{new StateTransition(ProcessState.Error, Command.finished), ProcessState.Final }, |
|
|
|
|
{new StateTransition(ProcessState.Error, Command.manualMode), ProcessState.ResumeMoveManual }, |
|
|
|
|
|
|
|
|
|
{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 }, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|