private void btnTurnOffAllLights_Click(object sender, EventArgs e) { LEDStatusLightingUtil ledStatusLightingUtil = LEDStatusLightingUtil.Instance; ledStatusLightingUtil.TurnOffAllLEDs(); //if (chkSSA.Checked) //{ // string hexCommand = ""; // string asciiCommand = ""; // // // // Turn of RED light // // // asciiCommand = "WR 605 0"; // hexCommand = ToHEX(asciiCommand); // SendCommand(hexCommand); // // // // Turn of GREEN light // // // asciiCommand = "WR 606 0"; // hexCommand = ToHEX(asciiCommand); // SendCommand(hexCommand); // // // // Turn of BLUE light // // // asciiCommand = "WR 604 0"; // hexCommand = ToHEX(asciiCommand); // SendCommand(hexCommand); //} }
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()); } }