Esempio n. 1
0
        public async Task <ActionResult <IncomingUserTask> > Get(int Id)
        {
            try
            {
                var result = await taskrepository.GetTaskAsync(Id);

                if (result == null || GetUsedId() != result.UserId)
                {
                    return(BadRequest());
                }

                TaskNumber taskNumber = new TaskNumber(result.Number, result.TaskDate);

                return(Ok(
                           new IncomingUserTask()
                {
                    Comment = result.Comment,
                    Date = result.Date,
                    Status = result.Status,
                    TaskNumber = taskNumber.ToString()
                }));
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, "Repository failure"));
            }
        }
Esempio n. 2
0
        public void Task16c()
        {
            const int TaskNumber = 16;

            uMTasks.ActiveTask = TaskNumber;

            switch (uMTasks.Work[TaskNumber].StateNo)
            {
            case

                1:
                uMTasks.SleepAGN(0.61F);         // 0.4 + TaskNumber*0.01 secondes .. ou n'importe quoi d'autre
                break;

            case

                2:
                uPiaget.GoState(1000);
                break;

            case



                1000: uPiaget.GoState(1); break;

            default:
            {
                uPanel.MessageErreur = "Task" + TaskNumber.ToString() + " - Line missing: " + uMTasks.Work[TaskNumber].StateNo.ToString();        // uPanel.MessageErreur.Length;
            } break;
            } // end switch
        } // end void Task16c
Esempio n. 3
0
        public void Task01c()
        {
            const int TaskNumber = 1;

            uMTasks.ActiveTask = TaskNumber;

            switch (uMTasks.Work[TaskNumber].StateNo)
            {
            //-----------------------------------------------------------------
            case
                1: uMTasks.SleepAGN(0.8F);

                break;

            case
                2:
                if (uPanel.Choix[uPanel.NCMusique].Etat)
                {
                    System.Media.SystemSounds.Beep.Play();
                }
                uPiaget.GoNext();
                break;

            case
                3:  uPiaget.GoState(1);
                break;

            default:
            {
                uPanel.MessageErreur = "Task" + TaskNumber.ToString() + " - Line missing: " + uMTasks.Work[TaskNumber].StateNo.ToString();        // uPanel.MessageErreur.Length;
            } break;
                //-------------------------------------------------------------------

                /*
                 * case
                 *
                 *  1:
                 *  uMTasks.SleepAGN(0.41F);     // 0.4 + TaskNumber*0.01 secondes .. ou n'importe quoi d'autre
                 *  break;
                 * case
                 *
                 *  2:
                 *  uPiaget.GoState(1000);
                 *  break;
                 * case
                 *
                 *
                 *
                 *
                 *
                 *  1000: uPiaget.GoState(1); break;
                 * default:
                 *  {
                 *      uPanel.MessageErreur = "Task" + TaskNumber.ToString() + " - Line missing: " + uMTasks.Work[TaskNumber].StateNo.ToString();// uPanel.MessageErreur.Length;
                 *  } break;
                 */
            } // end switch
        }     // end void Task01c
Esempio n. 4
0
    {   /*
         * Faire un pas  - move a little bit
         */
        public void Task02c()
        {
            const int TaskNumber = 2;

            uMTasks.ActiveTask = TaskNumber;
            //------------------------------------------------------------------------------------------


            int  i;
            bool SG, SD;

            switch (uMTasks.Work[TaskNumber].StateNo)
            {
            case
                1:
                if (uMTasks.Work[TaskNumber].TaskStatus == uMTasks.tPhase.Demandee)
                {
                    uMTasks.Work[TaskNumber].TaskStatus = uMTasks.tPhase.EnAction;
                    if (uPanel.Choix[uPanel.NCStepSound].Etat)
                    {
                        System.Media.SystemSounds.Beep.Play();
                    }
                    uMTasks.Work[TaskNumber].StateNo = 10;
                }
                break;

            case
                10:
                uMTasks.Work[TaskNumber].StateNo = 20;
                break;

            case
                20:
                SG = uMouv.SensGauche;
                SD = uMouv.SensDroit;
                if (uPanel.InverseSensLineaire)
                {
                    SG = !SG;
                    SD = !SD;
                }

                uTasks.V2Duree = uPanel.DeltaTPas / 2;
                uMTasks.Work[TaskNumber].StateNo = 30;

                break;

            case
                30:
                uMTasks.SleepAGN(uTasks.V2Duree);
                break;

            case
                31:
                uMTasks.Work[TaskNumber].StateNo = 40;
                break;

            case
                40:
                uMTasks.SleepAGN(uTasks.V2Duree);
                break;

            case
                41:
                uMTasks.Work[TaskNumber].StateNo = 60;
                break;

            case
                60:
                uMTasks.Work[TaskNumber].TaskStatus = uMTasks.tPhase.Faite;
                uMTasks.Work[TaskNumber].StateNo    = 1;
                break;

            default:
            {
                uPanel.MessageErreur = "Task" + TaskNumber.ToString() + " - Line missing: " + uMTasks.Work[TaskNumber].StateNo.ToString();        // uPanel.MessageErreur.Length;
            } break;
            }//end switch
             //------------------------------------------------------------------------------------------

            /* code origine
             * void Task02()   // (* Faire un pas *)
             * {
             * extern bool InteractionSouhaitee;
             * int const TaskNumber=2;
             * int i;
             * bool SG,SD;
             * ActiveTask=TaskNumber;
             * switch ( Work[TaskNumber].StateNo ){
             * case
             * 1:
             * if (Work[TaskNumber].TaskStatus==Demandee)
             *  {
             *   Work[TaskNumber].TaskStatus=EnAction;
             * if ( Choix[NCStepSound].Etat ) Beep();
             *   Work[TaskNumber].StateNo=10;
             *  }
             *     break;  case
             * 10:
             * Work[TaskNumber].StateNo=20;
             *     break;  case
             * 20: {
             * //    PasGauche,SensGauche,
             * //              PasDroit,SensDroit
             * SG=SensGauche;
             * SD=SensDroit;
             * if (InverseSensLineaire)
             * {SG=!SG;
             * SD=!SD;}
             *
             * V2Duree=DeltaTPas / 2;
             * Work[TaskNumber].StateNo=30;
             * }
             *     break;  case
             *
             * 30:  SleepAGN(V2Duree);
             *    break;  case
             *
             * 31:
             * //****        if Choix[NCStepSound].etat then NoSound;
             * Work[TaskNumber].StateNo=40;
             * //     Work[TaskNumber].StateNo=41;
             *    break;  case
             * 40:  SleepAGN(V2Duree);
             *    break;  case
             *
             * 41:
             * //****       if (!( VarEtat[NVEArret].etat))
             *  Work[TaskNumber].StateNo=60;
             *    break;  case
             *
             * 60:
             * Work[TaskNumber].TaskStatus=Faite;
             * Work[TaskNumber].StateNo=1;
             *
             * break;
             * default :
             * {
             * MessageErreur="Task"+IntToStr(TaskNumber)+" - Line missing: "+IntToStr(Work[TaskNumber].StateNo);
             * };
             * }
             * }   // Task02
             */
        } // end void Task02c
Esempio n. 5
0
        public void Task06c()
        {
            const int TaskNumber = 6;

            uMTasks.ActiveTask = TaskNumber;

            switch (uMTasks.Work[TaskNumber].StateNo)
            {
            case
                1:
                //uMTasks.SleepAGN(0.61F);     // 0.4 + TaskNumber*0.01 secondes .. ou n'importe quoi d'autre
                uMTasks.Work[TaskNumber].StateNo = 2;
                break;

            case
                2:
                if ((!uPanel.Choix[uPanel.NCSimulation].Etat) && (uPanel.SupportPhysiqueES) && (uPanel.Choix[uPanel.NCBeckhoff].Etat))
                {
                    uMTasks.Work[TaskNumber].TaskStatus = uMTasks.tPhase.Demandee;
                    uMTasks.Work[TaskNumber].StateNo    = 3;
                }
                else
                {
                    if (uMTasks.Work[TaskNumber].TaskStatus == uMTasks.tPhase.Faite)
                    {
                        uMTasks.Work[TaskNumber].TaskStatus = uMTasks.tPhase.EnAction;

                        ThBeck.BeckhoffDelegate beckhoff_off = new ThBeck.BeckhoffDelegate(ThBeck.Beckhoff);
                        beckhoff_off.BeginInvoke("BC9020_OFF", null, null);     //retour: uMTasks.tPhase.Suspendue!

                        uMTasks.Work[TaskNumber].StateNo = 3;
                    }
                    else
                    {
                        uMTasks.Work[TaskNumber].StateNo = 4;
                    }
                }
                break;

            case
                3:
                switch (uMTasks.Work[TaskNumber].TaskStatus)
                {
                case
                    uMTasks.tPhase.Demandee: uMTasks.Work[TaskNumber].TaskStatus = uMTasks.tPhase.EnAction;

                    ThBeck.BeckhoffDelegate beckhoff = new ThBeck.BeckhoffDelegate(ThBeck.Beckhoff);
                    beckhoff.BeginInvoke("BC9020_ON", null, null);

                    break;

                case
                    uMTasks.tPhase.Faite:         //uMTasks.Work[TaskNumber].StateNo = 20;
                    uPiaget.GoNext();
                    break;

                case
                    uMTasks.tPhase.EnAction: uMTasks.Work[TaskNumber].StateNo = 3;
                    break;

                case
                    uMTasks.tPhase.Suspendue:

                    // uPiaget.GoNext();
                    uMTasks.Work[TaskNumber].StateNo = 4;



                    break;

//                            default: ;
                }


                break;

            case
                4:
                uPiaget.GoState(1000);
                break;

            case



                1000: uPiaget.GoState(1); break;

            default:
            {
                uPanel.MessageErreur = "Task" + TaskNumber.ToString() + " - Line missing: " + uMTasks.Work[TaskNumber].StateNo.ToString();        // uPanel.MessageErreur.Length;
            } break;
            } // end switch
        } // end void Task06c
Esempio n. 6
0
 private void RefreshTaskScheduler()
 {
     txtCollState.Text = EnableColl ? "已启动" : "已停止";
     txtCollCycle.Text = CollCycle.ToString();
     txtTasksNum.Text  = TaskNumber.ToString();
 }
Esempio n. 7
0
    {   /*
         * Mouvements PTP - move point to point
         */
        public void Task04c()
        {
            const int TaskNumber = 4;

            uMTasks.ActiveTask = TaskNumber;

            switch (uMTasks.Work[TaskNumber].StateNo)
            {
            //-----------------------------------------------------------------------------------------------
            case
                1:
                if (uMTasks.Work[TaskNumber].TaskStatus == uMTasks.tPhase.Demandee)
                {
                    uMTasks.Work[TaskNumber].StateNo    = 15;
                    uMTasks.Work[TaskNumber].TaskStatus = uMTasks.tPhase.EnAction;
                    uTasks.V4MouvementGalilFait         = false;
                }
                break;

            case
                15: //--------------------------------------------------------------------------------
                if (uPanel.Mouvement.NPas > 0)
                {   // (* demande de pas et calcul de durée *)
                    uMouv.CalculerImpulsions(ref uMouv.PasGauche, ref uMouv.SensGauche, ref uMouv.PasDroit, ref uMouv.SensDroit);

                    if ((!uPanel.Choix[uPanel.NCSimulation].Etat) && (uPanel.Mouvement.NPas > 0))
                    {
                        switch (uPanel.ServoCommande)
                        {
                        case uPanel.tServoCommande.ServoGalilEthernet:
                                    #if (!SimulationOnly)
                            uGalil.LancerMouvementGalil(uPanel.Mouvement);
                                    #endif
                            uTasks.V4MouvementGalilFait = false;
                            break;
                        } // fin switch (uPanel.ServoCommande)
                    }
                }         // fin if Mouvement.NPas>0

                uMTasks.Work[TaskNumber].StateNo = 20;
                break;

            case
                20://--------------------------------------------------------------------------------

                if ((uPanel.Mouvement.Etat == uPanel.tEtat.Fait) || (uPanel.Mouvement.NPas == 0))
                {
                    uMTasks.Work[TaskNumber].StateNo = 50;                                                                                       //(* fin *)
                }
                else
                {
                    uMouv.CalculerImpulsions(ref uMouv.PasGauche, ref uMouv.SensGauche, ref uMouv.PasDroit, ref uMouv.SensDroit);
                    //(*      Writeln(' mouv.NoPasCourant ', Mouvement.NoPasCourant:8,
                    //				              Mouvement.NPas:8);  *)

                    uMTasks.Work[TaskNumber].StateNo = 30;
                }         //(* if *)
                break;

            case
                30:                                                                      //-----------------------------------------------------------------------------
                if (!(uMTasks.Work[uPanel.NTPas].TaskStatus == uMTasks.tPhase.EnAction)) //(*;PasEnCours *) then  (* prˆt pour un step? *)
                {
                    uMTasks.Work[uPanel.NTPas].TaskStatus = uMTasks.tPhase.Demandee;
                    //   (*    writeln(DemandeDUnPas, PasFait, NStepsMouvementPTP:6);  *)
                    uPanel.DeltaTPas = uPanel.DeltaT;
                    uMTasks.Work[TaskNumber].StateNo = 40;
                }
                break;

            case
                40:                                                                //---------------------------------------------------------------------------
                if (uMTasks.Work[uPanel.NTPas].TaskStatus == uMTasks.tPhase.Faite) // (*;PasFait*) then
                {
                    uMTasks.Work[TaskNumber].StateNo = 20;                         //  (* step termin‚ *)
                }
                break;

            case
                50: //---------------------------------------------------------------------------
                    //  (* attente de fin  *)
                if (uPanel.Mouvement.NPas > 0)
                {
                    uMTasks.Work[TaskNumber].StateNo = 60;         //(* 55 ou 59 *)
                }
                else
                {
                    uMTasks.Work[TaskNumber].StateNo = 150;
                }
                break;

            case
                55:                                    //-------------------------------------------------------------------------
                //*****        if  (MouvementFaitN(MoteurGauche))
                uMTasks.Work[TaskNumber].StateNo = 59; //(*** Attention, tester autre axe si *)
                //   (*rotation … gauche de rayon 15 cm environ...*)
                break;

            case
                60: //------------------------------------------------------------------------
                //-- uTasks.V4WaitingForEndOfMotion = true;
                //  MessageErreur=" Waiting for end of motion ";
                uTasks.V8TimeOut = false;
                if (uGalil.TesterFinMouvementDApresErreur)
                {
                    uPiaget.GoState(79);
                }

                else
                {
                    uPiaget.GoState(150);
                }
                break;

            case
                79: //------------------------------------------------------------------------
                uTasks.V8Compteur = 0;
                uPiaget.GoNext();
                break;

            case
                80://------------------------------------------------------------------------
                switch (uPanel.ServoCommande)
                {
                case uPanel.tServoCommande.ServoGalilEthernet:
                                #if (!SimulationOnly)
                    if (uPanel.Choix[uPanel.NCSimulation].Etat == false)
                    {
                        uPiaget.LireErreurGalil();
                    }
                                #endif
                    break;
                }          // end case uPanel.ServoCommande   ********************

                if (uPanel.ModeRHYorOPYlow)
                {
                    uTasks.V8ErreurMaxTemp = uTasks.V8ErreurMax;
                }
                else
                {
                    uTasks.V8ErreurMaxTemp = uTasks.V8ErreurMaxOPY;
                }

                if ((Math.Abs(uTasks.V8ErreurGauche) + Math.Abs(uTasks.V8ErreurDroite)) < uTasks.V8ErreurMaxTemp)          // uPanel.ModeRHYorOPYlow
                {
                    uPanel.MessageErreur = "  Erreurs gauche: " +
                                           uTasks.V8ErreurGauche + "  et droite :" +
                                           uTasks.V8ErreurDroite;
                    uPiaget.WriteErreurGalil();
                    uPiaget.GoState(260);
                }             // ex 180
                else
                {
                    uPiaget.GoState(82);
                }
                break;

            case
                82:  //----------------------------------------------------------------------
                uMTasks.SleepAGN(uTasks.V8Duree / uTasks.V8NCycles);
                break;

            case
                83: //----------------------------------------------------------------------
                uTasks.V8Compteur++;
                if (uTasks.V8Compteur >= uTasks.V8NCycles)
                {
                    uPiaget.GoState(120);
                }
                else
                {
                    uPiaget.GoState(80);
                }
                break;

            case
                120:  //----------------------------------------------------------------------
                uTasks.V8TimeOut  = true;
                uTasks.V8Compteur = 0;

                if (uPanel.ServoCommande == uPanel.tServoCommande.ServoGalilEthernet)
                {
                            #if (!SimulationOnly)
                    uGalil.ExecuterCommandeGalil("AB" + uTasks.ACR);              //     Abort
                    uTasks.warningAnsiString();
                    uGalil.ResetPositionGalil();
                            #endif
                    //    UtiliserCoordonneesAbsolues=false;  // suite en relatif
                }

                uPiaget.GoState(260);                // ex 180
                break;

            case
                150:                                               //----------------------------------------------------------------------
                uMTasks.SleepAGN(uPanel.Mouvement.NPas * 0.00015); //(*********  Attente pour essais ...  ******)
                break;

            case
                151:                  //----------------------------------------------------------------------
                uPiaget.GoState(260); // ex 180
                break;

            case
                260://----------------------------------------------------------------------
                uTasks.V4WaitingForEndOfMotion = false;
                uTasks.V4MouvementGalilFait    = true;

                if (uMouv.IndicePileMouvement > 0)
                {
                    //uMouv.PrendreMouvementSurPile(ref uPanel.Mouvement, ref uMouv.IndicePileMouvement);
                    uMouv.PrendreMouvementSurPile();
                    uMTasks.Work[TaskNumber].StateNo = 15;
                }
                else
                {
                    uMTasks.Work[TaskNumber].TaskStatus = uMTasks.tPhase.Faite;
                    uMTasks.Work[TaskNumber].StateNo    = 1;
                }         //(* if *)
                break;

            //-----------------------------------------------------------------------------------------------

            /*
             * case
             *  1:
             *  uMTasks.SleepAGN(0.61F);     // 0.4 + TaskNumber*0.01 secondes .. ou n'importe quoi d'autre
             *  break;
             * case
             *
             *  2:
             *  uPiaget.uPiaget.GoState(1000);
             *  break;
             * case
             *  1000: uPiaget.uPiaget.GoState(1); break;
             */
            default:
            {
                uPanel.MessageErreur = "Task" + TaskNumber.ToString() + " - Line missing: " + uMTasks.Work[TaskNumber].StateNo.ToString();            // uPanel.MessageErreur.Length;
            } break;
            } // end switch (uMTasks.Work[TaskNumber].StateNo)
        } // end void Task04c
Esempio n. 8
0
 public string toString()
 {
     return("Task " + TaskNumber.ToString());
 }
Esempio n. 9
0
        /*
         * Lire clavier - read keyboard
         */
        public void Task03c()
        {
            const int TaskNumber = 3;

            uMTasks.ActiveTask = TaskNumber;

            switch (uMTasks.Work[TaskNumber].StateNo)
            {
            case
                1:     uMTasks.SleepAGN(0.03F);  // s
                break;

            case
                2:
                //     extern void ToggleEtatSI(int NS);
                if ((uPanel.CarLu == 'd') || (uPanel.CarLu == 'D'))
                {
                    ;                                                 // ToggleEtatSI(1);//{SignauxIn[NSDemarrer].EtatVF  = true ;}
                }
                if (uPanel.CarLu == 'l')
                {
                    uParam.LireParametres();
                }
                if (uPanel.CarLu == 'n')
                {
                    uPanel.LireFichierReserve = true;
                    uParam.LireParametres();
                }
                ;
                if (uPanel.CarLu == 'h')
                {
                    uParam.SauverParametres();
                }
                //    if (CarLu=='r'){Initialise=false;}
                if (uPanel.CarLu == 's')
                {
                    uPanel.Choix[uPanel.NCSimulation].Etat = !uPanel.Choix[uPanel.NCSimulation].Etat;
                    FPiaget.CheckSupportPhysiqueES();
                }
                if (uPanel.CarLu == 'a')
                {
                    uPanel.Choix[uPanel.NCMusique].Etat = !uPanel.Choix[uPanel.NCMusique].Etat;
                }

                if ((uPanel.CarLu == 'y') || (uPanel.CarLu == 'Y'))
                {
                    uMTasks.Work[uPanel.NTVision].TaskStatus = uMTasks.tPhase.Demandee;
                }

                if (uPanel.CarLu == 'z')
                {
                    uPanel.Choix[uPanel.NCStepSound].Etat = !uPanel.Choix[uPanel.NCStepSound].Etat;
                }

                if (uPanel.CarLu == 'b')
                {
                    uPanel.Choix[uPanel.NCVisionContinue].Etat = !uPanel.Choix[uPanel.NCVisionContinue].Etat;
                }

                if ((uPanel.CarLu == 'c') || (uPanel.CarLu == 'C'))
                {
                    uPanel.Choix[uPanel.NCCalibration].Etat = !uPanel.Choix[uPanel.NCCalibration].Etat;
                }

                if ((uPanel.CarLu == '+') || (uPanel.CarLu == '-'))
                {
                    uPanel.DeltaTPas = 1.5F;
                    uMouv.PasGauche  = true; uMouv.SensGauche = (uPanel.CarLu == '+');
                    uMouv.PasDroit   = true; uMouv.SensDroit = (uPanel.CarLu == '+');
                    uMTasks.Work[uPanel.NTPas].TaskStatus = uMTasks.tPhase.Demandee;
                }

                uPiaget.GoNext();
                break;

            case
                3:
                if (uPanel.Done1)
                {
                    if ((uPanel.CarLu != 'q') && (uPanel.CarLu != ','))
                    {
                        uPanel.Done1 = false;
                        /* if (FPiaget.ActiveForm != null) tBControl.Text = "";*/
                    }// Form1->MControl->Lines->Text = "                                ";
                }
                if (uPanel.CarLu == 'q')
                {
                    if (uPanel.Done1 == true)
                    {
                        FPiaget.ActiveForm.Close();                          // Controls["BQuit"];
                    }
                    else
                    {
                        uPanel.Done1 = true;
                        ///*if (FPiaget.ActiveForm != null) */FPiaget.ActiveForm.Controls["*/tBControl"].Text = "Voulez-vous vraiment quitter (q) ?";
                    }
                }
                uPiaget.GoNext();
                break;

            case
                4:
                if ((uPanel.CarLu == '*') || (uPanel.CarLu == '/'))
                {
                    uPanel.Mouvement.NPas        = 50;
                    uPanel.Mouvement.VitesseMaxM = uPanel.VitesseMaxCourante;
                    uPanel.Mouvement.Etat        = uPanel.tEtat.AFaire;
                    if (uPanel.CarLu == '*')
                    {
                        uPanel.Mouvement.IncrGauche = 1;
                        uPanel.Mouvement.IncrDroit  = 1;
                    }
                    else
                    {
                        uPanel.Mouvement.IncrGauche = -1;
                        uPanel.Mouvement.IncrDroit  = -1;
                    }  // (* if *)
                    uMTasks.Work[uPanel.NTMouvementPTP].TaskStatus = uMTasks.tPhase.Demandee;
                }      // (* '*', '/'   *)

                uPiaget.GoNext();
                break;

            case
                5: /*
                    * Deplacement relatif
                    */
                switch (uPanel.CarLu)
                {
                case
                    't':        // (* avance 10 cm *)
                    if (uPanel.Choix[uPanel.NCCalibration].Etat)
                    {
                        uMouv.P0RobotFutur.ds = uPanel.CalibrationDs;             //(*DistancePourCalibration*)
                    }
                    else
                    {
                        uMouv.P0RobotFutur.ds = 10;
                    }
                    uMouv.LancerMouvement(uPanel.tModeDeMouvement.MDMds, uMouv.P0RobotFutur);
                    // (*  t *)
                    break;

                //Code 016.02.24

                /*case
                 *
                 * 'T':   // (* pivote … gauche de 22.5 degr‚s autour du bord gauche *)
                 *  uMouv.P0RobotFutur.RayonTrajectoire=-15; //(* cm; <> DemiEcartRouesExt*);
                 *  if (uPanel.Choix[uPanel.NCCalibration].Etat)
                 *      uMouv.P0RobotFutur.AngleTrajectoire = uPanel.CalibrationAngle;
                 *  else
                 *      uMouv.P0RobotFutur.AngleTrajectoire=23 ;    // (* 45 div 2 *)
                 *  uMouv.LancerMouvement(uPanel.tModeDeMouvement.RotExc, uMouv.P0RobotFutur);
                 *  break;*/

                case

                    'T':                                      // (* pivote … gauche de 22.5 degr‚s autour du bord gauche *)
                    uMouv.P0RobotFutur.RayonTrajectoire = 15; //(* cm; <> DemiEcartRouesExt*);

                    if (uPanel.Choix[uPanel.NCCalibration].Etat)
                    {
                        uMouv.P0RobotFutur.AngleTrajectoire = -uPanel.CalibrationAngle;
                    }

                    else
                    {
                        uMouv.P0RobotFutur.AngleTrajectoire = -23;            // (* 45 div 2 *)
                    }
                    uMouv.LancerMouvement(uPanel.tModeDeMouvement.RotExc, uMouv.P0RobotFutur);
                    break;



                case
                    'v':      //   (* recule 10 cm *)
                    if (uPanel.Choix[uPanel.NCCalibration].Etat)
                    {
                        uMouv.P0RobotFutur.ds = -uPanel.CalibrationDs;
                    }
                    else
                    {
                        uMouv.P0RobotFutur.ds = -10;
                    }
                    uMouv.LancerMouvement(uPanel.tModeDeMouvement.MDMds, uMouv.P0RobotFutur);
                    //   (* V *)
                    break;


                /*  case
                 * 'V':   // (* pivote arriŠre droite de 22.5 degr‚s autour du bord droit *)
                 *    uMouv.P0RobotFutur.RayonTrajectoire = 15; //(* cm; <> DemiEcartRouesExt*);
                 *    if (uPanel.Choix[uPanel.NCCalibration].Etat)
                 *        uMouv.P0RobotFutur.AngleTrajectoire = uPanel.CalibrationAngle;
                 *    else
                 *        uMouv.P0RobotFutur.AngleTrajectoire = 23;   //  (* 45 div 2 *)
                 *    uMouv.LancerMouvement(uPanel.tModeDeMouvement.RotExc, uMouv.P0RobotFutur);
                 *    //   (* V *)
                 *    break;  */
                case
                    'V':                                       // (* pivote arriŠre droite de 22.5 degr‚s autour du bord droit *)
                    uMouv.P0RobotFutur.RayonTrajectoire = -15; //(* cm; <> DemiEcartRouesExt*);
                    if (uPanel.Choix[uPanel.NCCalibration].Etat)
                    {
                        uMouv.P0RobotFutur.AngleTrajectoire = -uPanel.CalibrationAngle;
                    }
                    else
                    {
                        uMouv.P0RobotFutur.AngleTrajectoire = -23;           //  (* 45 div 2 *)
                    }
                    uMouv.LancerMouvement(uPanel.tModeDeMouvement.RotExc, uMouv.P0RobotFutur);
                    //   (* V *)
                    break;

                /*case
                 * 'f':  //  (* tourne … gauche de 22.5 degr‚s *)
                 *  if (uPanel.Choix[uPanel.NCCalibration].Etat)
                 *      uMouv.P0RobotFutur.ThetaRobotDegres =uMouv.P0Robot.ThetaRobotDegres + uPanel.CalibrationAngle;
                 *  else
                 *      uMouv.P0RobotFutur.ThetaRobotDegres = Convert.ToInt32(uMouv.P0Robot.ThetaRobotDegres + 22.5);   //  (* 45 div 2 *)
                 *  uMouv.LancerMouvement(uPanel.tModeDeMouvement.Rot, uMouv.P0RobotFutur);
                 *  //   (* f *)
                 *  break;  */

                case
                    'f':      //  (* tourne … gauche de 22.5 degr‚s *)
                    if (uPanel.Choix[uPanel.NCCalibration].Etat)
                    {
                        uMouv.P0RobotFutur.ThetaRobotDegres = uMouv.P0Robot.ThetaRobotDegres - uPanel.CalibrationAngle;
                    }
                    else
                    {
                        uMouv.P0RobotFutur.ThetaRobotDegres = Convert.ToInt32(uMouv.P0Robot.ThetaRobotDegres - 22.5);           //  (* 45 div 2 *)
                    }
                    uMouv.LancerMouvement(uPanel.tModeDeMouvement.Rot, uMouv.P0RobotFutur);
                    //   (* f *)
                    break;

                /*      case
                 *
                 * 'F':  //   (* pivote arrière gauche de 22.5 degrés autour du bord gauche *)
                 *      uMouv.P0RobotFutur.RayonTrajectoire=-15; // (* cm; <> DemiEcartRouesExt*);
                 *      if (uPanel.Choix[uPanel.NCCalibration].Etat)
                 *          uMouv.P0RobotFutur.AngleTrajectoire = -uPanel.CalibrationAngle;
                 *      else
                 *          uMouv.P0RobotFutur.AngleTrajectoire = -23; // (* 45 div 2 *)
                 *      uMouv.LancerMouvement(uPanel.tModeDeMouvement.RotExc, uMouv.P0RobotFutur);
                 *      //  (* F *)
                 *      break;*/
                case
                    'F':                                      //   (* pivote arrière gauche de 22.5 degrés autour du bord gauche *)
                    uMouv.P0RobotFutur.RayonTrajectoire = 15; // (* cm; <> DemiEcartRouesExt*);
                    if (uPanel.Choix[uPanel.NCCalibration].Etat)
                    {
                        uMouv.P0RobotFutur.AngleTrajectoire = uPanel.CalibrationAngle;
                    }
                    else
                    {
                        uMouv.P0RobotFutur.AngleTrajectoire = 23;         // (* 45 div 2 *)
                    }
                    uMouv.LancerMouvement(uPanel.tModeDeMouvement.RotExc, uMouv.P0RobotFutur);
                    //  (* F *)
                    break;

                case
                    'g':      //   (* tourne … droite de 22.5 degrés *)
                    if (uPanel.Choix[uPanel.NCCalibration].Etat)
                    {
                        uMouv.P0RobotFutur.ThetaRobotDegres = uMouv.P0Robot.ThetaRobotDegres + uPanel.CalibrationAngle;         //(* 45 div 2 *)
                    }
                    else
                    {
                        uMouv.P0RobotFutur.ThetaRobotDegres = (float)(uMouv.P0Robot.ThetaRobotDegres + 22.5);         // (* 45 div 2 *)
                    }
                    uMouv.LancerMouvement(uPanel.tModeDeMouvement.Rot, uMouv.P0RobotFutur);
                    //   (* g *)
                    break;

                //Code 016.02.24

                /* case
                 * 'G':  //   (* pivote … droite de 22.5 degrés autour du bord droit *)
                 *   uMouv.P0RobotFutur.RayonTrajectoire = 15; //(* cm; <> DemiEcartRouesExt*);
                 *   if (uPanel.Choix[uPanel.NCCalibration].Etat)
                 *       uMouv.P0RobotFutur.AngleTrajectoire = -uPanel.CalibrationAngle;
                 *   else
                 *       uMouv.P0RobotFutur.AngleTrajectoire = -23;  //(* 45 div 2 *)
                 *   uMouv.LancerMouvement(uPanel.tModeDeMouvement.RotExc, uMouv.P0RobotFutur);
                 *   //   (* G *)
                 *   break;  */

                case
                    'G':                                       //   (* pivote … droite de 22.5 degrés autour du bord droit *)
                    uMouv.P0RobotFutur.RayonTrajectoire = -15; //(* cm; <> DemiEcartRouesExt*);
                    if (uPanel.Choix[uPanel.NCCalibration].Etat)
                    {
                        uMouv.P0RobotFutur.AngleTrajectoire = +uPanel.CalibrationAngle;
                    }
                    else
                    {
                        uMouv.P0RobotFutur.AngleTrajectoire = +23;          //(* 45 div 2 *)
                    }
                    uMouv.LancerMouvement(uPanel.tModeDeMouvement.RotExc, uMouv.P0RobotFutur);
                    //   (* G *)
                    break;

                //  'i', 'I':  //   (*    va au centre  *)
                case  'i':          //   (*    va au centre  *)
                case  'I':          // no break, same case
                    uMouv.P0RobotFutur.x = 100;
                    uMouv.P0RobotFutur.y = 150;
                    uMouv.P0RobotFutur.ThetaRobotDegres = 90;
                    uMouv.LancerMouvement(uPanel.tModeDeMouvement.RXY, uMouv.P0RobotFutur);
                    //   (* i, I *)
                    break;
                }        //End switch (uPanel.CarLu)
                uPiaget.GoNext();
                break;

            case
                6: if (uPanel.CarLu == ' ')
                {
                    // à compléter *******  uTask05i.V5CarLu = ' ';
                    uPanel.V5CarLu = ' ';
                }
                uPiaget.GoNext();
                break;

            case
                7:  if (uPanel.CarLu == 'r')
                {
                    uPiaget.FermerLiaisons();
                    uPanel.InitialiserLaser = false;
                    uPiaget.GoNext();
                }
                else
                {
                    uPiaget.GoState(10);
                }
                break;

            case
                8:
                uMTasks.SleepAGN(1);      // délai pour reset
                break;

            case
                9:
                uPanel.Initialise = false;      // fin du  reset
                uPiaget.GoNext();
                break;

            case
                10:
                uPanel.CarLu = ',';

                uPanel.InteractionSouhaitee = true;
                //   Work[TaskNumber].StateNo=1;
                uPiaget.GoState(1);
                break;

            //
            default:
            {
                uPanel.MessageErreur = "Task" + TaskNumber.ToString() + " - Line missing: " + uMTasks.Work[TaskNumber].StateNo.ToString();        // uPanel.MessageErreur.Length;
            } break;
            } // end switch (uMTasks.Work[TaskNumber].StateNo)
        } // end void Task03c()
Esempio n. 10
0
        //public uPanel uPanneauAux = new uPanel();
        public void Task08c()
        {
            const int TaskNumber = 8;

            uMTasks.ActiveTask = TaskNumber;

            switch (uMTasks.Work[TaskNumber].StateNo)
            {
            case

                1:

                if ((uMTasks.Work[TaskNumber].TaskStatus == uMTasks.tPhase.Demandee) && uPanel.Phase != uPanel.tPhase.GameOver)
                {
                    uMTasks.Work[TaskNumber].TaskStatus           = uMTasks.tPhase.EnAction;
                    uMTasks.Work[TaskNumber].V4MouvementGalilFait = false;
                    uMouv.CinematiqueInverse();

                    switch (uPanel.Mouvement.ModeDeMouvement)
                    {
                    case uPanel.tModeDeMouvement.XY:
                        uMTasks.Work[TaskNumber].StateNo = 20;
                        break;

                    case uPanel.tModeDeMouvement.MDMds:
                        uMTasks.Work[TaskNumber].StateNo = 40;             // 20
                        break;

                    case uPanel.tModeDeMouvement.Rot:
                        uMTasks.Work[TaskNumber].StateNo = 50;             // 20
                        break;

                    case uPanel.tModeDeMouvement.RotExc:
                        uMTasks.Work[TaskNumber].StateNo = 58; //  15
                        break;
                    }                                          // fin switch  uPanel.Mouvement.ModeDeMouvement
                    if (uPanel.Mouvement.ModeDeMouvement == uPanel.tModeDeMouvement.RotExc)
                    {
                        uMTasks.Work[TaskNumber].StateNo = 15;
                    }
                    else
                    {
                        uMTasks.Work[TaskNumber].StateNo = 20;
                    }
                }
                else
                {
                    uPiaget.GoNext();
                }
                break;

            case

                2:
                uMTasks.SleepAGN(0.05F);
                //uPiaget.GoState(1000);
                break;

            //uPanel.ServoCommande
            //uPanel.tServoCommande.ServoGalilEthernet
            case
                3:
                switch (uPanel.ServoCommande)
                {
                case uPanel.tServoCommande.ServoGalilEthernet:
                        #if (!SimulationOnly)
                    if (uPanel.Choix[uPanel.NCSimulation].Etat == false)
                    {
                        uPiaget.LireErreurGalil();
                    }
                        #endif
                    break;
                }  // end case Servocommande   ********************
                uPanel.MessageErreur = "  Erreurs gauche: " + uTasks.V8ErreurGauche.ToString() +
                                       "  et droite : " + uTasks.V8ErreurDroite.ToString();
                uTasks.V8Compteur++;
                if (uTasks.V8Compteur >= uTasks.V8NCycles)
                {
                    uTasks.V8TimeOut            = false;
                    uTasks.V4MouvementGalilFait = true;
                }
                uPiaget.GoState(1);
                break;

            case
                15:
                uMouv.CalculerMouvementCourbe();
                uPiaget.GoState(60);
                break;

            case
                20:
                uMouv.CalculerMouvementDroit();

                //uMouv.EmpilerMouvement(uPanel.Mouvement, uMouv.IndicePileMouvement);
                uMouv.EmpilerMouvement();

                uMTasks.Work[TaskNumber].StateNo = 50;

                break;

            case
                40:  // MDMds
                uMouv.CalculerMouvementDroit();
                uMTasks.Work[TaskNumber].StateNo = 60;

                break;

            case
                50:                               //  Rot ou partie Rot de XY
                uPanel.Mouvement.ModeDeMouvement = uPanel.tModeDeMouvement.Rot;
                uMouv.CalculerMouvementRotatif(); //(* fait en premier *)
                uMTasks.Work[TaskNumber].StateNo = 60;
                break;

            case
                58:  // RotExc
                uMouv.CalculerMouvementCourbe();
                uPiaget.GoState(60);
                break;

            case
                60:                                                                               // lancement de mouvement
                if (!(uMTasks.Work[uPanel.NTMouvementPTP].TaskStatus == uMTasks.tPhase.EnAction)) // (*EnMouvementPTP*)
                //  (* prˆt pour un mouvement PTP? *)
                {                                                                                 //	  (*   impulsions *)
                    uMTasks.Work[uPanel.NTMouvementPTP].TaskStatus = uMTasks.tPhase.Demandee;
                    //  (*    writeln(DemandeDUnPas, PasFait, NStepsMouvementPTP:6);  *)
                    uMTasks.Work[TaskNumber].StateNo = 70;
                }
                break;

            case
                70: if (uMTasks.Work[uPanel.NTMouvementPTP].TaskStatus == uMTasks.tPhase.Faite)
                {
                    // Mouvement.Etat=Fait;
                    uMTasks.Work[TaskNumber].StateNo = 72;      //  (* mvmt PTP terminé *)
                }
                break;

            case
                72: uPiaget.GoState(180);
                break;

            case
                180:
                uMouv.MiseAJourPosition();
                uPanel.Mouvement.Etat = uPanel.tEtat.Fait;
                uMTasks.Work[TaskNumber].TaskStatus = uMTasks.tPhase.Faite;
                uMTasks.Work[TaskNumber].StateNo    = 1;
                break;

            case

                1000: uPiaget.GoState(1); break;

            default:
            {
                uPanel.MessageErreur = "Task" + TaskNumber.ToString() + " - Line missing: " + uMTasks.Work[TaskNumber].StateNo.ToString();        // uPanel.MessageErreur.Length;
            } break;
            } // end switch
        } // end void Task08c
Esempio n. 11
0
        public void Task05c()
        {
            const int TaskNumber = 5;

            uMTasks.ActiveTask = TaskNumber;


            SpeechSynthesizer reader = new SpeechSynthesizer();//**for speak Code 016.02.29


            switch (uMTasks.Work[TaskNumber].StateNo)
            {
            case

                1:
                SleepAGN(0.45F);         // 0.4 + TaskNumber*0.01 secondes .. ou n'importe quoi d'autre
                break;

            case

                2: SleepAGN(1); break;

            case
                3: SleepAGN(1); break;

            case
                4: SleepAGN(1); break;

            case
                5: SleepAGN(1); break;

            case
                6: SleepAGN(1); break;

            case
                7: GoState(1000); break;

            ////////////////////////////////////////// CASE 900 //////////////////////////////////////////
            case
                900:

                /*    for (int i = 1; i <= 2; i++)
                 *  {
                 *    //  Console.WriteLine(i);
                 *  }
                 */

                // Cliquer sur un bouton de l'interface
                CliquerBouton("bSO4");
                //        CliquerBouton("bLaserC");

                /*
                 * uMouv.P0Robot.x = 20;
                 * uMouv.P0Robot.y = 30;
                 * uMouv.P0Robot.ThetaRobotDegres = 90;
                 */
                reader.Dispose();
                reader = new SpeechSynthesizer();
                reader.SpeakAsync("Hello,I am ready !");
                //          string t="Hello,I am ready !";



                // frm2.testlabel.Text = ("Hello,I am ready !");
                GoNext();
                break;



            ////////////////////////////////////////// END OF CASE 900 //////////////////////////////////////////


            case
                901:

                break;

            case
                1000: GoState(1); break;

            default:
            {
                uPanel.MessageErreur = "Task" + TaskNumber.ToString() + " - Line missing: " + uMTasks.Work[TaskNumber].StateNo.ToString();        // uPanel.MessageErreur.Length;
            } break;
            } // end switch
        } // end void Task05c