예제 #1
0
        private void connect(int i)
        {
            IpCameraHandler cam = new IpCameraHandler();

            cam.CameraStateChanged += ModelCameraStateChanged;
            cam.CameraErrorOccured += ModelCameraErrorOccured;
            cam.ConnectOnvifCamera("192.168.226.10" + i + ":80;Username=admin;Password=123456;Transport=UDP;");
            kamerak[i] = cam;
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            int i = int.Parse(textBox1.Text);

            IpCameraHandler cam = new IpCameraHandler();

            cam.CameraStateChanged += ModelCameraStateChanged;
            cam.CameraErrorOccured += ModelCameraErrorOccured;
            cam.ConnectOnvifCamera("192.168.226.10" + i + ":80;Username=admin;Password=123456;Transport=UDP;");
            kamerak[i] = cam;
        }
예제 #3
0
 private void ModelCameraErrorOccured(object sender, CameraErrorEventArgs e)
 {
     InvokeGuiThread(() =>
     {
         IpCameraHandler curr = (IpCameraHandler)sender;
         Log.Write("Camera error: " + (e.Details ?? e.Error.ToString()));
         if (e.Error.Equals(IPCameraError.NoEndPoint))
         {
             string str = curr.Camera.CameraAddress.ToString().Split(':')[0].Substring(curr.Camera.CameraAddress.ToString().Split(':')[0].Length - 2);
             kamerak[(int.Parse(str))] = null;
         }
     });
 }
예제 #4
0
 private void ModelCameraStateChanged(object sender, CameraStateEventArgs e)
 {
     InvokeGuiThread(() =>
     {
         IpCameraHandler curr = (IpCameraHandler)sender;
         Log.Write(curr.Camera.CameraAddress.ToString() + " : " + e.State);
         string str = curr.Camera.CameraAddress.ToString().Split(':')[0].Substring(curr.Camera.CameraAddress.ToString().Split(':')[0].Length - 2);
         if (connectall && (e.State.Equals(CameraState.Connected) || e.State.Equals(CameraState.Disconnected)))
         {
             try
             {
                 if (kamerak[(int.Parse(str)) + 1] == null)
                 {
                     connect((int.Parse(str)) + 1);
                 }
             }
             catch (Exception ex)
             {
             }
         }
     });
 }
예제 #5
0
 private void SetSpeed(IpCameraHandler cam, int sp)
 {
     cam.Camera.CameraMovement.TiltSpeed = (float)sp / 8;
     cam.Camera.CameraMovement.PanSpeed  = (float)sp / 8;
 }
예제 #6
0
 private void GetCameraStreams(IpCameraHandler _model)
 {
 }