Пример #1
0
 public MainWindow()
 {
     InitializeComponent();
     FilterInfoCollection videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
     if (videoDevices.Count > 0)
     {
         MessageBox.Show("found video device, connecting");
     }
     else
     {
         MessageBox.Show("Not enough local cameras found to satisfy request local cameras found");
         return;
     }
     VideoCaptureDevice tempSource = new VideoCaptureDevice(videoDevices[0].MonikerString); //just use the first camera found
     MVT = new managedVideoTransmitter(tempSource, IPAddress.Parse("155.99.166.173"), 45000);
     MVT.actualFPSRecalculated += MVT_actualFPSRecalculated;
 }
Пример #2
0
        public MainWindow()
        {
            InitializeComponent();

            driveIPLabel.Content = rocConstants.MCIP_DRIVE.ToString();
            armIPLabel.Content = rocConstants.MCIP_ARM.ToString();
            logisticsIPLabel.Content = rocConstants.MCIP_LOGISTICS;
            engineeringIPLabel.Content = rocConstants.MCIP_ENG.ToString();

            NetMan = networkManager.getInstance(incomingDriveLineManager, incomingEngLineManager, incomingArmLineManager, incomingLogisticsLineManager);
            NetMan.DriveConnectionStatusChanged += NetMan_DriveConnectionStatusChanged;
            NetMan.EngineeringConnectionStatusChanged += NetMan_EngineeringConnectionStatusChanged;
            NetMan.ArmConnectionStatusChanged += NetMan_ArmConnectionStatusChanged;
            NetMan.LogisticsConnectionStatusChanged += NetMan_LogisticsConnectionStatusChanged;

            ArduMan = ArduinoManager.Instance;
            ArduMan.findArduinos();

            backDrive = ArduMan.getDriveBackArduino(false);
            frontDrive = ArduMan.getDriveFrontArduino(false);
            ptDuino = ArduMan.getPanTiltArduino(true);
            ArmDuino = ArduMan.getArmArduino(false);
            HandDuino = ArduMan.getHandArduino(false);
            miscDuino = ArduMan.getMiscArduino(false);

            backDrive.Data_Received += backDrive_Data_Received;
            frontDrive.Data_Received += frontDrive_Data_Received;
            ptDuino.Data_Received += ptDuino_Data_Received;
            ArmDuino.Data_Received += ArmDuino_Data_Received;
            HandDuino.Data_Received += HandDuino_Data_Received;
            miscDuino.Data_Received += miscDuino_Data_Received;

            driveMan = driveManager.getInstance(backDrive, frontDrive, NetMan);
            ptMan = ptManager.getInstance(ptDuino, NetMan);
            armMan = armManager.getInstance(ArmDuino, HandDuino, NetMan);

            hwMonitor = ROCInfo.getInstance(1000);//updates once per second
            hwMonitor.updatedValue += hwMonitor_updatedValue;

            camMan = cameraManager.getInstance();
            camMan.assignCameras();

            VideoCaptureDevice panTiltLeft;
            VideoCaptureDevice panTiltRight;
            if(camMan.getCamera(rocConstants.CAMS.PT_left, out panTiltLeft)  &&  camMan.getCamera(rocConstants.CAMS.PT_right, out panTiltRight)){ //if both the left and right cameras are found...
                panTiltTransmitter = new managedDualVideoTransmitter(panTiltLeft, panTiltRight, rocConstants.MCIP_DRIVE, rocConstants.MCPORT_DRIVE_VIDEO_OCULUS);
                panTiltTransmitter.startTransmitting();
            }

            //////////////
            ///VIDEO CAMS SETUP
            //////////////

            VideoCaptureDevice palmCam;
            if (camMan.getCamera(rocConstants.CAMS.PALM, out palmCam))
            {
                palmCamTransmitter = new managedVideoTransmitter(palmCam, rocConstants.MCIP_ARM, rocConstants.MCPORT_ARM_VIDEO_PALM);
            }

            VideoCaptureDevice noseCam;
            if (camMan.getCamera(rocConstants.CAMS.NOSE, out noseCam))
            {
                noseCamTransmitter = new managedVideoTransmitter(noseCam, rocConstants.MCIP_DRIVE, rocConstants.MCPORT_DRIVE_VIDEO_NOSE);
            }

            VideoCaptureDevice humerusCam;
            if (camMan.getCamera(rocConstants.CAMS.Humerus, out humerusCam))
            {
                humerusCamTransmitter = new managedVideoTransmitter(humerusCam, rocConstants.MCIP_ARM, rocConstants.MCPORT_ARM_VIDEO_HUMERUS);
            }

            //////////////
            ///SNAPSHOT CAMS SETUP
            //////////////

            VideoCaptureDevice logFrontCam;
            if (camMan.getCamera(rocConstants.CAMS.LOG_FRONT, out logFrontCam))
            {
                logFrontSS = new snapShotSender(logFrontCam);
            }

            VideoCaptureDevice logRightCam;
            if (camMan.getCamera(rocConstants.CAMS.LOG_RIGHT, out logRightCam))
            {
                logRightSS = new snapShotSender(logRightCam);
            }

            VideoCaptureDevice logBackCam;
            if (camMan.getCamera(rocConstants.CAMS.LOG_BACK, out logBackCam))
            {
                logBackSS = new snapShotSender(logBackCam);
            }

            VideoCaptureDevice logLeftCam;
            if (camMan.getCamera(rocConstants.CAMS.LOG_LEFT, out logLeftCam))
            {
                logLeftSS = new snapShotSender(logLeftCam);
            }

        }