Beispiel #1
0
 public HistoLigne(IDRobot robot, DateTime heure, String message, TypeLog type = TypeLog.Strat)
 {
     ID      = idActuel++;
     Robot   = robot;
     Message = message;
     Heure   = heure;
     Type    = type;
 }
Beispiel #2
0
 public HistoLigne(IDRobot robot, DateTime heure, String message, TypeLog type = TypeLog.Strat)
 {
     ID = idActuel++;
     Robot = robot;
     Message = message;
     Heure = heure;
     Type = type;
 }
Beispiel #3
0
        private void checkedListBoxRobots_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            if (!Execution.DesignMode)
            {
                String  robotString = (String)checkedListBoxRobots.Items[e.Index];
                IDRobot robot       = (IDRobot)Enum.Parse(typeof(IDRobot), robotString);

                dicRobotsAutorises[robot] = (e.NewValue == CheckState.Checked);
            }
        }
Beispiel #4
0
        public Robot(IDRobot id, string name)
        {
            IDRobot = id;
            Name    = name;

            SpeedConfig         = new SpeedConfig(500, 1000, 1000, 500, 1000, 1000);
            AsserStats          = new AsserStats();
            IsSpeedAdvAdaptable = true;

            foreach (MotorID moteur in Enum.GetValues(typeof(MotorID)))
            {
                MotorState.Add(moteur, false);
            }

            foreach (SensorOnOffID o in Enum.GetValues(typeof(SensorOnOffID)))
            {
                SensorsOnOffValue.Add(o, false);
            }

            foreach (ActuatorOnOffID o in Enum.GetValues(typeof(ActuatorOnOffID)))
            {
                ActuatorOnOffState.Add(o, false);
            }

            foreach (SensorColorID o in Enum.GetValues(typeof(SensorColorID)))
            {
                SensorsColorValue.Add(o, Color.Black);
            }

            AnalogicPinsValue = new Dictionary <Board, List <double> >();
            AnalogicPinsValue.Add(Board.RecIO, new List <double>());
            AnalogicPinsValue.Add(Board.RecMove, new List <double>());

            for (int i = 0; i < 9; i++)
            {
                AnalogicPinsValue[Board.RecIO].Add(0);
                AnalogicPinsValue[Board.RecMove].Add(0);
            }

            NumericPinsValue = new Dictionary <Board, List <Byte> >();
            NumericPinsValue.Add(Board.RecIO, new List <byte>());
            NumericPinsValue.Add(Board.RecMove, new List <byte>());

            for (int i = 0; i < 3 * 2; i++)
            {
                NumericPinsValue[Board.RecIO].Add(0);
                NumericPinsValue[Board.RecMove].Add(0);
            }

            BatterieVoltage   = 0;
            Graph             = null;
            TrajectoryFailed  = false;
            TrajectoryCutOff  = false;
            TrajectoryRunning = null;
        }
Beispiel #5
0
        public RobotSimu(IDRobot idRobot) : base(idRobot, "Robot Simu")
        {
            _highResolutionAsservissement = true;
            _rand = new Random();

            _linkAsserv       = ThreadManager.CreateThread(link => Asservissement());
            _linkLogPositions = ThreadManager.CreateThread(link => LogPosition());

            _lockMove = new Semaphore(1, 1);
            _sensMove = SensAR.Avant;

            _inRecalibration   = false;
            _asserChrono       = null;
            _currentPolarPoint = -1;

            BatterieVoltage = 25;
        }
Beispiel #6
0
        public RobotSimu(IDRobot idRobot)
        {
            AngleTotalParcouru = 0;
            DistanceTotaleParcourue = 0;
            IDRobot = idRobot;
            timerDeplacement = new System.Timers.Timer(IntervalleRafraichissementPosition);
            timerDeplacement.Elapsed += new ElapsedEventHandler(timerDeplacement_Elapsed);
            timerDeplacement.Start();

            timerPositions = new System.Timers.Timer(100);
            timerPositions.Elapsed += new ElapsedEventHandler(timerPositions_Elapsed);
            timerPositions.Start();

            SemDeplacement = new Semaphore(1, 1);
            SensDep = SensAR.Avant;

            Entraxe = 306.11;
            Nom = "GrosRobot";
            RecallageEnCours = false;
            Rand = new Random(DateTime.Now.Millisecond);
        }
Beispiel #7
0
        public RobotReel(IDRobot idRobot, Carte carte)
        {
            AngleTotalParcouru = 0;
            DistanceTotaleParcourue = 0;
            Carte = carte;
            IDRobot = idRobot;
            ServomoteursConnectes = new List<byte>();
            CapteurActive = new Dictionary<CapteurOnOffID, bool>();

            foreach (FonctionIO fonction in Enum.GetValues(typeof(FonctionIO)))
                SemaphoresIO.Add(fonction, new Semaphore(0, int.MaxValue));

            foreach (FonctionMove fonction in Enum.GetValues(typeof(FonctionMove)))
                SemaphoresMove.Add(fonction, new Semaphore(0, int.MaxValue));

            foreach (CapteurOnOffID fonction in Enum.GetValues(typeof(CapteurOnOffID)))
            {
                SemaphoresCapteurs.Add(fonction, new Semaphore(0, int.MaxValue));
                CapteurActive.Add(fonction, false);
            }
        }
Beispiel #8
0
 public Historique(IDRobot robot)
 {
     Robot = robot;
     actions = new List<IAction>();
     HistoriqueLignes = new List<HistoLigne>();
 }
Beispiel #9
0
 public Historique(IDRobot robot)
 {
     Robot            = robot;
     actions          = new List <IAction>();
     HistoriqueLignes = new List <HistoLigne>();
 }
Beispiel #10
0
        public RobotReel(IDRobot id, Board asserBoard) : base(id, "Robot")
        {
            AsserEnable = true;
            AsservBoard = asserBoard;

            _asserConnection  = Connections.UDPBoardConnection[AsservBoard];
            _positionReceived = false;

            _lockFrame = new Dictionary <UdpFrameFunction, Semaphore>();
            foreach (UdpFrameFunction o in Enum.GetValues(typeof(UdpFrameFunction)))
            {
                _lockFrame.Add(o, new Semaphore(0, int.MaxValue));
            }

            _lockMotor = new Dictionary <MotorID, Semaphore>();
            foreach (MotorID o in Enum.GetValues(typeof(MotorID)))
            {
                _lockMotor.Add(o, new Semaphore(0, int.MaxValue));
            }

            _lockSensorOnOff = new Dictionary <SensorOnOffID, Semaphore>();
            foreach (SensorOnOffID o in Enum.GetValues(typeof(SensorOnOffID)))
            {
                _lockSensorOnOff.Add(o, new Semaphore(0, int.MaxValue));
            }

            _lockSensorColor = new Dictionary <SensorColorID, Semaphore>();
            foreach (SensorColorID o in Enum.GetValues(typeof(SensorColorID)))
            {
                _lockSensorColor.Add(o, new Semaphore(0, int.MaxValue));
            }

            _boardSensorColor = new Dictionary <SensorColorID, Board>();
            _boardSensorColor.Add(SensorColorID.BuoyRight, Board.RecMove);
            _boardSensorColor.Add(SensorColorID.BuoyLeft, Board.RecIO);

            _boardSensorOnOff = new Dictionary <SensorOnOffID, Board>();
            _boardSensorOnOff.Add(SensorOnOffID.StartTrigger, Board.RecMove);
            _boardSensorOnOff.Add(SensorOnOffID.PressureSensorLeftBack, Board.RecMove);
            _boardSensorOnOff.Add(SensorOnOffID.PressureSensorLeftFront, Board.RecMove);
            _boardSensorOnOff.Add(SensorOnOffID.PressureSensorRightBack, Board.RecIO);
            _boardSensorOnOff.Add(SensorOnOffID.PressureSensorRightFront, Board.RecIO);
            _boardSensorOnOff.Add(SensorOnOffID.PresenceBuoyRight, Board.RecIO);

            _boardActuatorOnOff = new Dictionary <ActuatorOnOffID, Board>();
            _boardActuatorOnOff.Add(ActuatorOnOffID.PowerSensorColorBuoyRight, Board.RecMove);
            _boardActuatorOnOff.Add(ActuatorOnOffID.MakeVacuumLeftBack, Board.RecMove);
            _boardActuatorOnOff.Add(ActuatorOnOffID.MakeVacuumLeftFront, Board.RecMove);
            _boardActuatorOnOff.Add(ActuatorOnOffID.OpenVacuumLeftBack, Board.RecMove);
            _boardActuatorOnOff.Add(ActuatorOnOffID.OpenVacuumLeftFront, Board.RecIO);
            _boardActuatorOnOff.Add(ActuatorOnOffID.PowerSensorColorBuoyLeft, Board.RecIO);
            _boardActuatorOnOff.Add(ActuatorOnOffID.MakeVacuumRightBack, Board.RecIO);
            _boardActuatorOnOff.Add(ActuatorOnOffID.MakeVacuumRightFront, Board.RecIO);
            _boardActuatorOnOff.Add(ActuatorOnOffID.OpenVacuumRightBack, Board.RecIO);
            _boardActuatorOnOff.Add(ActuatorOnOffID.OpenVacuumRightFront, Board.RecMove);

            // Petit robot
            _boardActuatorOnOff.Add(ActuatorOnOffID.OpenVacuumLeft, Board.RecMove);
            _boardActuatorOnOff.Add(ActuatorOnOffID.OpenVacuumRight, Board.RecMove);
            _boardActuatorOnOff.Add(ActuatorOnOffID.OpenVacuumBack, Board.RecMove);
            _boardActuatorOnOff.Add(ActuatorOnOffID.MakeVacuumLeft, Board.RecMove);
            _boardActuatorOnOff.Add(ActuatorOnOffID.MakeVacuumRight, Board.RecMove);
            _boardActuatorOnOff.Add(ActuatorOnOffID.MakeVacuumBack, Board.RecMove);

            _boardSensorOnOff.Add(SensorOnOffID.PressureSensorLeft, Board.RecMove);
            _boardSensorOnOff.Add(SensorOnOffID.PressureSensorRight, Board.RecMove);
            _boardSensorOnOff.Add(SensorOnOffID.PressureSensorBack, Board.RecMove);

            _boardMotor = new Dictionary <MotorID, Board>();
            _boardMotor.Add(MotorID.ElevatorLeft, Board.RecIO);
            _boardMotor.Add(MotorID.ElevatorRight, Board.RecIO);

            SpeedConfig.ParamChange += SpeedConfig_ParamChange;
        }