public static void startActions(ModeOperatoire mode, TypeRobot type, CouleurEquipe couleur)
 {
     Informations.printInformations(Priority.HIGH, "Starting actions with mod : " + mode.ToString() + " & type : " + type.ToString());
     if (ACTION_PER_TYPE.Contains(mode))
     {
         if (((Hashtable)ACTION_PER_TYPE[mode]).Contains(type))
         {
             if (((Hashtable)((Hashtable)ACTION_PER_TYPE[mode])[type]).Contains(couleur))
             {
                 Informations.printInformations(Priority.HIGH, "Lancement de l'action mère avec le mode " + mode.ToString() + " & type : " + type.ToString() + " & couleur " + couleur.ToString());
                 ((Action)((Hashtable)((Hashtable)ACTION_PER_TYPE[mode])[type])[couleur]).Execute();
                 return;
             }
             else
             {
                 Informations.printInformations(Priority.HIGH, "MODE INTROUVABLE : Impossible de lancer l'action mère (introuvable) pour la couleur : " + couleur.ToString());
             }
         }
         else
         {
             Informations.printInformations(Priority.HIGH, "MODE INTROUVABLE : Impossible de lancer l'action mère (introuvable) pour le mode : " + mode.ToString());
         }
     }
     else
     {
         Informations.printInformations(Priority.HIGH, "TYPE INTROUVABLE : Impossible de lancer l'action mère (introuvable) pour le type : " + type.ToString());
     }
 }
Example #2
0
 private static void setMotherAction(ModeOperatoire mode, Action a)
 {
     if (ACTION_PER_TYPE.Contains(mode))
     {
         ACTION_PER_TYPE[mode] = a;
     }
     else
     {
         ACTION_PER_TYPE.Add(mode, a);
     }
     Informations.printInformations(Priority.MEDIUM, "actions mère redéfinie");
 }
Example #3
0
 public static void startActions(ModeOperatoire mode)
 {
     if (ACTION_PER_TYPE.Contains(mode))
     {
         Debug.Print("Lancement de l'action mère avec le mode " + mode.ToString());
         ((Action)ACTION_PER_TYPE[mode]).Execute();
     }
     else
     {
         Debug.Print("Impossible de lancer l'action mère (introuvable) pour le mode " + mode.ToString());
     }
 }
Example #4
0
        /* ********************************** FIN TEST ROBOT 1 ****************************** */

        /// <summary>
        /// Fin de la liste des composants
        /// </summary>


        public Robot(composants.IHM.Parametrization parametrization)
        {
            this.typeRobot      = parametrization.GetTypeRobot();
            this.modeOperatoire = parametrization.GetModeOperatoire();
            this.couleurEquipe  = parametrization.GetCouleurEquipe();
            //ecranTactile = new DisplayTE35(14, 13, 12, 10); // L'écran tactile est présent sur chaque robot

            parametrization.startMethod += this.Start;
            robot = this;

            loadComponents();
        }
Example #5
0
        /* ********************************** FIN TEST ROBOT 1 ****************************** */

        /// <summary>
        /// Fin de la liste des composants
        /// </summary>

        public Robot(composants.IHM.Parametrization parametrization, composants.IHM.C_IHM IHM)
        {
            this.IHM = IHM;

            Debug.Print("Querying type...");
            this.typeRobot = parametrization.GetTypeRobot();
            Debug.Print("Got type : " + typeRobot.ToString());

            Debug.Print("Querying mode operatoire...");
            this.modeOperatoire = parametrization.GetModeOperatoire();
            Debug.Print("Got mode : " + modeOperatoire.ToString());

            Debug.Print("Querying couleur...");
            this.couleurEquipe = parametrization.GetCouleurEquipe();
            Debug.Print("Got couleur : " + Couleur.ToString());
            //ecranTactile = new DisplayTE35(14, 13, 12, 10); // L'écran tactile est présent sur chaque robot

            parametrization.startMethod += this.Start;

            robot = this;

            loadComponents();

            new Thread(() =>
            {
                while (true)
                {
                    Thread.Sleep(this.BASE_ROULANTE.REFRESH_RATE_KANGAROO);
                    this.BASE_ROULANTE.kangaroo.CheckMovingStatus();
                }
            }).Start();

            /*
             * if (this.TypeRobot == TypeRobot.PETIT_ROBOT)
             * {
             *  new Thread(() =>
             *  {
             *      while (true)
             *      {
             *          //Thread.Sleep(PR_ULTRASON.REFRESH_RATE);
             *          PR_ULTRASON.detectObstacle(null);
             *      }
             *  }).Start();
             * }*/


            /*Debug.Print("Starting ROBOT !!!");
             * parametrization.startMethod();*/
        }
        private static void setMotherAction(ModeOperatoire mode, TypeRobot type, CouleurEquipe couleur, Action a)
        {
            if (!ACTION_PER_TYPE.Contains(mode))
            {
                ACTION_PER_TYPE.Add(mode, new Hashtable());
            }

            if (!((Hashtable)ACTION_PER_TYPE[mode]).Contains(type))
            {
                ((Hashtable)ACTION_PER_TYPE[mode]).Add(type, new Hashtable());
            }

            if (((Hashtable)((Hashtable)ACTION_PER_TYPE[mode])[type]).Contains(couleur))
            {
                ((Hashtable)((Hashtable)ACTION_PER_TYPE[mode])[type])[couleur] = a;
            }
            else
            {
                ((Hashtable)((Hashtable)ACTION_PER_TYPE[mode])[type]).Add(couleur, a);
            }
            Informations.printInformations(Priority.MEDIUM, "actions mere set pour le type " + type + " & le mode " + mode + " & couleur " + couleur);
        }
Example #7
0
 public CustomParametrization(TypeRobot typeRobot, ModeOperatoire modeOperatoire, CouleurEquipe couleurEquipe)
 {
     this.typeRobot      = typeRobot;
     this.modeOperatoire = modeOperatoire;
     this.couleurEquipe  = couleurEquipe;
 }