Ejemplo n.º 1
0
        protected override void Detector_MotionDetection(object sender, MotionDetectionEvent e)
        {
            switch (e.Detection)
            {
            case true:
                if (IsVideoCaptured)
                {
                    return;
                }

                var handler = AlarmEvent;
                if (handler != null)
                {
                    handler(this, new EventArgs());
                }

                Log.Motion("Motion detected");

                StartCaptionVideo(MotionDirectoryPath);
                IsVideoCaptured = true;

                var timer = new Timer();
                timer.Elapsed  += ElapsedMotion;
                timer.Interval  = Duration * 1000;
                timer.AutoReset = false;
                timer.Start();

                break;

            case false:
                Log.Motion("Motion stopped");
                break;
            }
        }
Ejemplo n.º 2
0
        protected override void Detector_MotionDetection(object sender, MotionDetectionEvent e)
        {
            switch (e.Detection)
            {
            case true:
                if (IsVideoCaptured)
                {
                    return;
                }

                OnAlarmEvent();

                Log.Motion("Motion detected");

                StartCaptionVideo(MotionDirectoryPath);
                IsVideoCaptured = true;

                MotionTimer           = new Timer();
                MotionTimer.Elapsed  += ElapsedMotion;
                MotionTimer.Interval  = Duration * 1000;
                MotionTimer.AutoReset = false;
                MotionTimer.Start();

                break;

            case false:
                Log.Motion("Motion stopped");
                break;
            }
        }
Ejemplo n.º 3
0
 protected virtual void Detector_MotionDetection(object sender, MotionDetectionEvent e) { }
        protected override void Detector_MotionDetection(object sender, MotionDetectionEvent e)
        {
            switch (e.Detection)
            {
                case true:
                    if (IsVideoCaptured)
                        return;

                    OnAlarmEvent();

                    Log.Motion("Motion detected");

                    StartCaptionVideo(MotionDirectoryPath);
                    IsVideoCaptured = true;

                    MotionTimer = new Timer();
                    MotionTimer.Elapsed += ElapsedMotion;
                    MotionTimer.Interval = Duration * 1000;
                    MotionTimer.AutoReset = false;
                    MotionTimer.Start();

                    break;

                case false:
                    Log.Motion("Motion stopped");
                    break;
            }
        }
        protected override void Detector_MotionDetection(object sender, MotionDetectionEvent e)
        {
            switch (e.Detection)
            {
                case true:
                    if (IsVideoCaptured) return;

                    var handler = AlarmEvent;
                    if (handler != null)
                        handler(this, new EventArgs());

                    Log.Motion("Motion detected");

                    StartCaptionVideo(MotionDirectoryPath);
                    IsVideoCaptured = true;

                    var timer = new Timer();
                    timer.Elapsed += ElapsedMotion;
                    timer.Interval = Duration * 1000;
                    timer.AutoReset = false;
                    timer.Start();

                    break;

                case false:
                    Log.Motion("Motion stopped");
                    break;
            }
        }
 void OnMotionDetection(object sender, MotionDetectionEvent e)
 {
     inMotion = e.Detection;
       Log.Write("OnMotionDetection(" + e.Detection + ") started");
       if (e.Detection)
       {
     //If we are already recording when motion was detected
     if (videoCapturingState.Equals(VideoCapturingState.Recording))
       return;
     StartVideoCapturing();
       }
       else
       {
     //If motion has stopped and minimum recording time has elapsed stop the recording
     Log.Write("OnMotionDetection(" + e.Detection + ") minRecTimer.Enabled == " + minRecTimer.Enabled);
     if (!minRecTimer.Enabled)
     {
       Log.Write("OnMotionDetection(" + e.Detection + ") Motion ended, minimum timer ended. Stopping video capturing");
       StopVideoCapturing();
     }
       }
       Log.Write("OnMotionDetection(" + e.Detection + ") ended");
 }
Ejemplo n.º 7
0
 protected virtual void Detector_MotionDetection(object sender, MotionDetectionEvent e)
 {
 }