Ejemplo n.º 1
0
        // 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);
        }
Ejemplo n.º 2
0
        public QrRecognitionControl()
        {
            InitializeComponent();

            camDevices = new CameraDevices();

            decodingThread = new Thread(DecodeBarcode);

            // pictureBox1.Paint += pictureBox1_Paint;
            resultRectPen = new Pen(Color.Green, 10);


            motionDetector = GetDefaultMotionDetector();
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
        // 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;
        }
Ejemplo n.º 5
0
        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();
            }
        }
Ejemplo n.º 6
0
        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();
            }
        }