예제 #1
0
        /// <summary>
        /// Blink detection event handler
        /// </summary>
        private void OnBlinkDetected(object sender, DetectedBlinkEventArgs e)
        {
            try
            {
                switch (e.State)
                {
                case WinkState.Wink:
                {
                    switch (e.Eye)
                    {
                    case Eyes.Left:
                        BlinkLeftCount++;
                        break;

                    case Eyes.Right:
                        BlinkRightCount++;
                        break;
                    }
                }
                break;
                }

                labelBlinkDetector.Invoke(new Action(() => { labelBlinkDetector.Text = $"Blink Left: {BlinkLeftCount}\nBlink Right: {BlinkRightCount}"; }));
            }
            catch (Exception)
            { }
        }
예제 #2
0
 private void Detector_DetectedBlink(object sender, DetectedBlinkEventArgs e)
 {
     if (e.State == WinkState.Wink)
     {
         if (e.Eye == Eyes.Left)
         {
             LeftCount++;
         }
         else
         {
             RightCount++;
         }
     }
 }
예제 #3
0
        private void Processor_DetectedBlink(object sender, DetectedBlinkEventArgs e)
        {
            int count;

            if (e.Eye == Eyes.Left)
            {
                CountLeft++;
                count = CountLeft;
            }
            else
            {
                CountRight++;
                count = CountRight;
            }

            System.Diagnostics.Debug.WriteLine($"{(e.TimeStamp - TestTimeStart).ToString("N4")}  Check Detected blink {count} in {e.Eye} eye.");
        }
예제 #4
0
        private void OnDetectedBlink(object sender, DetectedBlinkEventArgs e)
        {
            if (EnableLights)
            {
                switch (e.Eye)
                {
                case Eyes.Left:
                {
                    switch (e.State)
                    {
                    case WinkState.Rising:
                        GpioPinManager.LightLeftRising();
                        break;

                    case WinkState.Falling:
                        GpioPinManager.LightLeftFalling();
                        break;

                    case WinkState.Wink:
                        GpioPinManager.LightLeftBlink();
                        break;
                    }
                }
                break;

                case Eyes.Right:
                {
                    switch (e.State)
                    {
                    case WinkState.Rising:
                        GpioPinManager.LightRightRising();
                        break;

                    case WinkState.Falling:
                        GpioPinManager.LightRightFalling();
                        break;

                    case WinkState.Wink:
                        GpioPinManager.LightRightBlink();
                        break;
                    }
                }
                break;
                }
            }
        }
예제 #5
0
        private void Processor_DetectedBlink(object sender, DetectedBlinkEventArgs e)
        {
            int count;

            if (e.State == WinkState.Wink)
            {
                if (e.Eye == Eyes.Left)
                {
                    CountLeft++;
                    count = CountLeft;
                }
                else
                {
                    CountRight++;
                    count = CountRight;
                }
            }
        }