예제 #1
0
        /// <summary>
        /// Initializes a new instance of the Presenter class.
        /// </summary>
        /// <param name="screen"></param>
        /// <param name="uploadWatcher"></param>
        public Presenter(IImageScreen screen,
                         ICamera camera)
        {
            this.screen = screen;
            this.camera = camera;

#if DEBUG
            this.FaceRecognize = true;
#endif

            motionDetectThread =
                Properties.Settings.Default.DetectMotion ?
                new Thread(this.DetectMotion) : new Thread(this.BypassDetectMotion);
            motionDetectThread.IsBackground = true;
            motionDetectThread.Name         = "motion detect";


            this.screen.Observer         = this;
            this.worker                  = new System.ComponentModel.BackgroundWorker();
            worker.WorkerReportsProgress = true;
            worker.RunWorkerCompleted   += worker_RunWorkerCompleted;
            worker.DoWork               += worker_DoWork;

            this.timer.Interval = 1000 / int.Parse(Properties.Settings.Default.FPs);
            this.timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);

            videoFileCheckTimer.Interval = 1000 * 60;
            videoFileCheckTimer.Elapsed += new System.Timers.ElapsedEventHandler(videoFileCheckTimer_Elapsed);

            if (File.Exists("bg.jpg"))
            {
                BackGround = OpenCvSharp.IplImage.FromFile(@"bg.jpg");
            }
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the Presenter class.
        /// </summary>
        /// <param name="screen"></param>
        /// <param name="uploadWatcher"></param>
        public Presenter(IImageScreen screen,
            ICamera camera)
        {
            this.screen = screen;
            this.camera = camera;

            motionDetectThread = new Thread(this.DetectMotion);
            motionDetectThread.IsBackground = true;
            motionDetectThread.Name = "motion detect";

            this.screen.Observer = this;
            this.worker = new System.ComponentModel.BackgroundWorker();
            worker.WorkerReportsProgress = true;
            worker.RunWorkerCompleted += worker_RunWorkerCompleted;
            worker.DoWork += worker_DoWork;

            this.timer.Interval = 1000 / int.Parse(Properties.Settings.Default.FPs);
            this.timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the Presenter class.
        /// </summary>
        /// <param name="screen"></param>
        /// <param name="uploadWatcher"></param>
        public Presenter(IImageScreen screen,
                         ImageUploadWatcher uploadWatcher,
                         IIconExtractor extractor)
        {
            this.screen        = screen;
            this.uploadWatcher = uploadWatcher;
            this.extractor     = extractor;

            this.screen.Observer         = this;
            this.worker                  = new System.ComponentModel.BackgroundWorker();
            worker.WorkerReportsProgress = true;
            worker.RunWorkerCompleted   += worker_RunWorkerCompleted;
            worker.ProgressChanged      += new System.ComponentModel.ProgressChangedEventHandler(worker_ProgressChanged);
            worker.DoWork               += worker_DoWork;

            imgsQueue = new Queue <ImageDetail[]>();

            this.uploadWatcher.ImagesUploaded += uploadWatcher_ImagesUploaded;
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of the Presenter class.
        /// </summary>
        /// <param name="screen"></param>
        /// <param name="uploadWatcher"></param>
        public Presenter(IImageScreen screen,
            ImageUploadWatcher uploadWatcher,
            IIconExtractor extractor)
        {
            this.screen = screen;
            this.uploadWatcher = uploadWatcher;
            this.extractor = extractor;

            this.screen.Observer = this;
            this.worker = new System.ComponentModel.BackgroundWorker();
            worker.WorkerReportsProgress = true;
            worker.RunWorkerCompleted += worker_RunWorkerCompleted;
            worker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(worker_ProgressChanged);
            worker.DoWork += worker_DoWork;

            imgsQueue = new Queue<ImageDetail[]>();

            this.uploadWatcher.ImagesUploaded += uploadWatcher_ImagesUploaded;
        }
예제 #5
0
        /// <summary>
        /// Initializes a new instance of the Presenter class.
        /// </summary>
        /// <param name="screen"></param>
        /// <param name="uploadWatcher"></param>
        public Presenter(IImageScreen screen,
                         ICamera camera)
        {
            this.screen = screen;
            this.camera = camera;

            motionDetectThread = new Thread(this.DetectMotion);
            motionDetectThread.IsBackground = true;
            motionDetectThread.Name         = "motion detect";


            this.screen.Observer         = this;
            this.worker                  = new System.ComponentModel.BackgroundWorker();
            worker.WorkerReportsProgress = true;
            worker.RunWorkerCompleted   += worker_RunWorkerCompleted;
            worker.DoWork               += worker_DoWork;

            this.timer.Interval = 1000 / int.Parse(Properties.Settings.Default.FPs);
            this.timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
        }