ZForge.Motion.Controls.CameraView.timer_Elapsed C# (CSharp) Method

timer_Elapsed() private method

private timer_Elapsed ( object sender, System e ) : void
sender object
e System
return void
        private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            Camera camera = cameraWindow.Camera;
            if (camera != null)
            {
                // get number of frames for the last second
                mStat.Push(camera.FramesReceived);
                this.toolStripStatusLabelFps.Text = mStat.FPS.ToString("F2") + " fps";
            }
            this.UpdateUIWithFrame();
            if (this.EditMode)
            {
                return;
            }
            mMutexAlarm.WaitOne();
            if (this.mFireAlarmEvent)
            {
                this.AlarmCount = this.AlarmCount + 1;
                this.CameraClass.PlugIns.AlarmAll(true);
                this.mFireAlarmEvent = false;
            }

            if (this.CameraClass != null && this.CameraClass.CaptureElapse > 0 && this.CameraClass.Capturing == true)
            {
                Motion.Core.DateTimeEx date = new Motion.Core.DateTimeEx();
                if ((date.TimeStamp - mCaptureElapse) / 3600 >= this.CameraClass.CaptureElapse)
                {
                    this.StopAlarm();
                    this.StopCapture();
                    mMutexAlarm.ReleaseMutex();
                    return;
                }
            }
            // descrease save counter
            if (mIntervalsToSave > 0)
            {
                mIntervalsToSave--;
                if (mIntervalsToSave <= 0)
                {
                    this.StopAlarm();
                    if (this.CaptureFlag != CAPTUREFLAG.ALWAYS)
                    {
                        this.StopCapture();
                    }
                }
            }
            mMutexAlarm.ReleaseMutex();
        }