// 2013/4/10 // 比较两个设备列表是否一致 public bool IsEqual(CameraDevices other) { if (this == other) { return(true); } if (this.Devices == null && other.Devices == null) { return(true); } if (this.Devices == null || other.Devices == null) { return(false); } if (this.Devices.Count != other.Devices.Count) { return(false); } for (int i = 0; i < this.Devices.Count; i++) { FilterInfo info = this.Devices[i]; FilterInfo other_info = other.Devices[i]; if (info.CompareTo(other_info) != 0) { return(false); } } return(true); }
public QrRecognitionControl() { InitializeComponent(); camDevices = new CameraDevices(); decodingThread = new Thread(DecodeBarcode); // pictureBox1.Paint += pictureBox1_Paint; resultRectPen = new Pen(Color.Green, 10); motionDetector = GetDefaultMotionDetector(); }
public QrRecognitionControl() { InitializeComponent(); // test // throw new Exception("test exception"); camDevices = new CameraDevices(); decodingThread = new Thread(DecodeBarcode); // pictureBox1.Paint += pictureBox1_Paint; resultRectPen = new Pen(Color.Green, 10); motionDetector = GetDefaultMotionDetector(); }
// 2013/4/10 // 比较两个设备列表是否一致 public bool IsEqual(CameraDevices other) { if (this == other) return true; if (this.Devices == null && other.Devices == null) return true; if (this.Devices == null || other.Devices == null) return false; if (this.Devices.Count != other.Devices.Count) return false; for (int i = 0; i < this.Devices.Count; i++) { FilterInfo info = this.Devices[i]; FilterInfo other_info = other.Devices[i]; if (info.CompareTo(other_info) != 0) return false; } return true; }
public void RefreshDevList() { CameraDevices temp = new CameraDevices(); if (this.camDevices.IsEqual(temp) == false) { #if NO if (this.camDevices != null && camDevices.Current != null) { if (camDevices.Current.IsRunning) { camDevices.Current.SignalToStop(); } camDevices.Current.NewFrame -= Current_NewFrame; // this.camDevices.Current.WaitForStop(); WaitForStop(); } #endif EndCatch(); camDevices = new CameraDevices(); LoadDevicesToCombobox(); } }