Exemple #1
0
        static void StartInterfaces()
        {
            Thread t1 = new Thread(() =>
            {
                //Attention, il est nécessaire d'ajouter PresentationFramework, PresentationCore, WindowBase and your wpf window application aux ressources.
                interfaceRobot = new RobotInterface.WpfRobotInterface();
                //Sur evenement xx              -->>        Action a effectuer
                msgDecoder.OnMessageDecodedEvent      += interfaceRobot.DisplayMessageDecoded;
                msgDecoder.OnMessageDecodedErrorEvent += interfaceRobot.DisplayMessageDecodedError;

                robotMsgProcessor.OnIMUDataFromRobotGeneratedEvent                += interfaceRobot.UpdateImuDataOnGraph;
                robotMsgProcessor.OnMotorsCurrentsFromRobotGeneratedEvent         += interfaceRobot.UpdateMotorsCurrentsOnGraph;
                robotMsgProcessor.OnEnableDisableMotorsACKFromRobotGeneratedEvent += interfaceRobot.ActualizeEnableDisableMotorsButton;
                robotMsgProcessor.OnEnableDisableTirACKFromRobotGeneratedEvent    += interfaceRobot.ActualizeEnableDisableTirButton;
                xBoxManette.OnSpeedConsigneEvent += interfaceRobot.UpdateSpeedConsigneOnGraph;
                interfaceRobot.OnEnableDisableMotorsFromInterfaceGeneratedEvent         += robotMsgGenerator.GenerateMessageEnableDisableMotors;
                interfaceRobot.OnEnableDisableTirFromInterfaceGeneratedEvent            += robotMsgGenerator.GenerateMessageEnableDisableTir;
                interfaceRobot.OnEnableDisableControlManetteFromInterfaceGeneratedEvent += ChangeUseOfXBoxController;

                localWorldMapManager.OnLocalWorldMapEvent += interfaceRobot.OnLocalWorldMapEvent;

                interfaceRobot.ShowDialog();
            });

            t1.SetApartmentState(ApartmentState.STA);
            t1.Start();

            //Thread t2 = new Thread(() =>
            //{
            //    //Attention, il est nécessaire d'ajouter PresentationFramework, PresentationCore, WindowBase and your wpf window application aux ressources.

            //    ConsoleCamera = new RobotMonitor.WpfCameraMonitor();
            //    if (!simulatedCamera)
            //    {
            //        omniCamera.CameraInit();
            //        //omniCamera.CameraImageEvent += ConsoleCamera.CameraImageEventCB;
            //        omniCamera.OpenCvMatImageEvent += ConsoleCamera.DisplayOpenCvMatImage;
            //    }
            //    else
            //    {
            //        //omniCameraSimulator.Start();
            //        //omniCameraSimulator.CameraImageEvent += ConsoleCamera.CameraImageEventCB;
            //        omniCameraSimulator.OnOpenCvMatImageReadyEvent += ConsoleCamera.DisplayOpenCvMatImage;
            //        omniCameraSimulator.OnOpenCvMatImageReadyEvent += imageProcessingPositionFromOmniCamera.ProcessOpenCvMatImage;
            //        imageProcessingPositionFromOmniCamera.OnOpenCvMatImageProcessedEvent += ConsoleCamera.DisplayOpenCvMatImage;
            //    }
            //    ConsoleCamera.ShowDialog();

            //    //Inutile mais debug pour l'instant
            //    refBoxAdapter.OnRefereeBoxReceivedCommandEvent += ConsoleCamera.DisplayRefBoxCommand;
            //    msgDecoder.OnMessageDecodedEvent += ConsoleCamera.DisplayMessageDecoded;
            //});
            //t2.SetApartmentState(ApartmentState.STA);

            //t2.Start();
        }
Exemple #2
0
 static void StartRobotInterface()
 {
     t1 = new Thread(() =>
     {
         //Attention, il est nécessaire d'ajouter PresentationFramework, PresentationCore, WindowBase and your wpf window application aux ressources.
         interfaceRobot         = new RobotInterface.WpfRobotInterface(competition);
         interfaceRobot.Loaded += RegisterRobotInterfaceEvents;
         interfaceRobot.ShowDialog();
     });
     t1.SetApartmentState(ApartmentState.STA);
     t1.Start();
 }