public override void Output()
        {
            if (inOutPut)
            {
                Util.Notify("报警输出中当前输出忽略");
                return;
            }
            //
            Task.Run(() =>
            {
                lock (lockObj1)
                {
                    inOutPut = true;

                    VCDProp.RangeValue[VCDIDs.VCDElement_GPIOOut] = 1;
                    // Now write it into the video capture device.
                    VCDProp.OnePush(VCDIDs.VCDElement_GPIOWrite);
                    Thread.Sleep((int)outLineTime);
                    VCDProp.RangeValue[VCDIDs.VCDElement_GPIOOut] = 0;
                    // Now write it into the video capture device.
                    VCDProp.OnePush(VCDIDs.VCDElement_GPIOWrite);
                    Util.Notify("相机报警输出完成");
                    inOutPut = false;
                }
            });
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Activate built-in camera autofocus. Requires 2 second sleep to allow autofocus to complete
 /// </summary>
 /// <returns>New focus level</returns>
 public int AutoFocus()
 {
     if (this.Available && this.ic.DeviceValid)
     {
         VCDProp.OnePush(VCDIDs.VCDID_Focus);
         // Stupid work-around recommended by TIS:
         // Wait two seconds and assume autofocus will complete by then
         System.Threading.Thread.Sleep(2000);
         return(VCDProp.RangeValue[VCDIDs.VCDID_Focus]);
     }
     else
     {
         MessageBox.Show("Camera disconnected");
         return(0);
     }
 }