Пример #1
0
        private void UpdateLEDsLight()
        {
            try
            {
                LEDStatusLightingUtil ledLightUtil = LEDStatusLightingUtil.Instance;

                if (_station.ToUpper() == EnumStation.ARK)
                {
                    // Get latest application status
                    EnumApplicationStatus newApplicationStatus = GetApplicationStatus();

                    if (newApplicationStatus != _applicationStatus)
                    {
                        _applicationStatus = newApplicationStatus;


                        LogManager.Debug("UpdateLEDsLight: TurnOffAllLEDs");
                        LogManager.Debug("UpdateLEDsLight - New status: " + _applicationStatus.ToString());

                        // Always turn off all LEDs before select which LED(s) to turn on.
                        ledLightUtil.TurnOffAllLEDs();

                        //MessageBox.Show(_applicationStatus.ToString());
                        switch (_applicationStatus)
                        {
                        case EnumApplicationStatus.Initialization:
                            ledLightUtil.StartBLUELightFlashing();
                            break;

                        case EnumApplicationStatus.Ready:
                            ledLightUtil.SwitchGREENLightOnOff(true);
                            break;

                        case EnumApplicationStatus.Caution:
                            ledLightUtil.StartYELLOWLightFlashing();
                            break;

                        case EnumApplicationStatus.Error:
                            ledLightUtil.SwitchREDLightOnOff(true);
                            break;

                        case EnumApplicationStatus.Busy:
                            ledLightUtil.SwitchBLUELightOnOff(true);
                            break;

                        default:
                            ledLightUtil.SwitchREDLightOnOff(true);
                            break;
                        }
                    }
                }
                else if (_station.ToUpper() == EnumStation.ALK)
                {
                    // Get latest application status
                    EnumApplicationStatus newApplicationStatus = GetApplicationStatus();

                    if (newApplicationStatus != _applicationStatus)
                    {
                        _applicationStatus = newApplicationStatus;

                        LogManager.Debug("UpdateLEDsLight: TurnOffAllLEDs");
                        LogManager.Debug("UpdateLEDsLight - New status: " + _applicationStatus.ToString());

                        // Always turn off all LEDs before select which LED(s) to turn on.
                        ledLightUtil.TurnOffAllLEDs();

                        //MessageBox.Show(_applicationStatus.ToString());
                        switch (_applicationStatus)
                        {
                        case EnumApplicationStatus.Initialization:
                            ledLightUtil.StartBLUELightFlashing();
                            break;

                        case EnumApplicationStatus.Ready:
                            ledLightUtil.SwitchGREENLightOnOff(true);
                            break;

                        case EnumApplicationStatus.Caution:
                            ledLightUtil.StartYELLOWLightFlashing();
                            break;

                        case EnumApplicationStatus.Error:
                            ledLightUtil.SwitchREDLightOnOff(true);
                            break;

                        case EnumApplicationStatus.Busy:
                            ledLightUtil.SwitchBLUELightOnOff(true);
                            break;

                        default:
                            ledLightUtil.SwitchREDLightOnOff(true);
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogManager.Error("UpdateLEDsLight exception: " + ex.ToString());
                Debug.WriteLine("UpdateLEDsLight exception: " + ex.ToString());
            }
        }
Пример #2
0
        private void radBLUELight_CheckedChanged(object sender, EventArgs e)
        {
            LEDStatusLightingUtil ledStatusLightingUtil = LEDStatusLightingUtil.Instance;

            ledStatusLightingUtil.SwitchBLUELightOnOff(radBLUELight.Checked);
        }