Exemplo n.º 1
0
        void TaskThreadProcess()
        {
            while (true)
            {
                switch (state)
                {
                case TaskDeposeStates.Init:
                    state = TaskDeposeStates.Attente;
                    break;

                case TaskDeposeStates.Attente:
                    break;

                case TaskDeposeStates.Deplacement1:
                    if (parentManager.Team == Equipe.Bleue)
                    {
                        parentManager.robotDestination = new PointD(1.2, -0.2);
                        parentManager.robotOrientation = 0;
                    }
                    else if (parentManager.Team == Equipe.Jaune)
                    {
                        parentManager.robotDestination = new PointD(-1.2, -0.2);
                        parentManager.robotOrientation = Math.PI;
                    }
                    state = TaskDeposeStates.Deplacement1Attente;
                    break;

                case TaskDeposeStates.Deplacement1Attente:
                    if (parentManager.isDeplacementFinished)
                    {
                        state = TaskDeposeStates.Finished;
                        OnPilotageVentouse(5, -50);
                        OnPilotageVentouse(6, -50);
                        OnPilotageVentouse(7, -50);
                        Thread.Sleep(20);
                    }
                    break;

                case TaskDeposeStates.Finished:
                    isFinished = true;
                    OnPilotageVentouse(5, 0);
                    OnPilotageVentouse(6, 0);
                    OnPilotageVentouse(7, 0);
                    break;
                }
                Thread.Sleep(10);
            }
        }
Exemplo n.º 2
0
 public void Start()
 {
     state      = TaskDeposeStates.Deplacement1;
     isFinished = false;
 }
Exemplo n.º 3
0
 public void Pause()
 {
     state      = TaskDeposeStates.Attente;
     isFinished = false;
 }
Exemplo n.º 4
0
 public void Init()
 {
     state      = TaskDeposeStates.Init;
     isFinished = false;
 }