Reset() public méthode

Reset motion detector to initial state.

The method resets motion detection and motion processing algotithms by calling their IMotionDetector.Reset and IMotionProcessing.Reset methods.

public Reset ( ) : void
Résultat void
Exemple #1
0
        private void CloseVideoSource()
        {
            // set busy cursor
            this.Cursor = Cursors.WaitCursor;

            // stop current video source
            videoSourcePlayer1.SignalToStop();

            // wait 2 seconds until camera stops
            for (int i = 0; (i < 50) && (videoSourcePlayer1.IsRunning); i++)
            {
                Thread.Sleep(100);
            }
            if (videoSourcePlayer1.IsRunning)
            {
                videoSourcePlayer1.Stop();
            }

            // stop timers
            timer.Stop();
            alarmTimer.Stop();

            motionHistory.Clear();

            // reset motion detector
            if (detector != null)
            {
                detector.Reset();
            }

            videoSourcePlayer1.BorderColor = Color.Black;
            this.Cursor = Cursors.Default;
        }
        private async void GlobalTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            // These event fires after 30 seconds.   This is a safety catch to make sure there is a recast.
            // If no motion as been detected this will fire, if motion has been detected then the timer for this event is reset.
            if (!running)
            {
                return;
            }
            PauseFishing();
            motionDetector.Reset();

            await sendFishingCastCommand();  //  Inject a keyDown and keyUp event into windows for the '=' key.  Todo: The key should be configurable.

            ResumeFishing();
        }