protected override void SwitchOffButtonLamp(ConfigClasses.EquipmentStateConfig stateConfig) { SetLampState(EmptyTrayStackerEquipment.OperationUnit.StartButtonLamp, CurrentStateConfig.ButtonLamp.StartLamp, false); SetLampState(EmptyTrayStackerEquipment.OperationUnit.StopButtonLamp, CurrentStateConfig.ButtonLamp.StopLamp, false); SetLampState(EmptyTrayStackerEquipment.OperationUnit.InitializeButtonLamp, CurrentStateConfig.ButtonLamp.InitialLamp, false); SetLampState(EmptyTrayStackerEquipment.OperationUnit.AlarmClearButtonLamp, CurrentStateConfig.ButtonLamp.JamClearLamp, false); SetLampState(EmptyTrayStackerEquipment.OperationUnit.SoundClearButtonLamp, CurrentStateConfig.ButtonLamp.SoundClearLamp, false); }
protected override void SwitchOnButtonLamp(ConfigClasses.EquipmentStateConfig stateConfig) { SetLampState(VT5070Equipment.OperationUnit.StartButtonLamp, CurrentStateConfig.ButtonLamp.StartLamp, true); SetLampState(VT5070Equipment.OperationUnit.StopButtonLamp, CurrentStateConfig.ButtonLamp.StopLamp, true); SetLampState(VT5070Equipment.OperationUnit.InitializeButtonLamp, CurrentStateConfig.ButtonLamp.InitialLamp, true); SetLampState(VT5070Equipment.OperationUnit.AlarmClearButtonLamp, CurrentStateConfig.ButtonLamp.JamClearLamp, true); SetLampState(VT5070Equipment.OperationUnit.SoundClearButtonLamp, CurrentStateConfig.ButtonLamp.SoundClearLamp, true); }
public bool Show(Equipment.EquipmentBase equipment, string defaultName, out string name, FALibrary.Alarm.FAAlarm alarm, string moreMsg, bool useSound, Module.StateSignalModule stateSignalModule, ConfigClasses.EquipmentStateConfig stateConfig) { if (alarm != null) { System.Windows.Media.Imaging.BitmapImage bitmap = null; if (System.IO.File.Exists(alarm.ImagePath)) { try { App.Current.Dispatcher.Invoke( new Action( delegate { bitmap = new System.Windows.Media.Imaging.BitmapImage(new Uri((string)alarm.ImagePath)); })); } catch { } } string caption = string.Format("{0}{1}{2}{3}", "[", alarm.AlarmNo, "] ", alarm.AlarmName); string message = string.Empty; if (string.IsNullOrEmpty(moreMsg)) message = alarm.Solution; else message = string.Format("{0}\n{1}", moreMsg, alarm.Solution); name = caption; return Show(equipment, caption, message, bitmap, useSound, stateSignalModule, stateConfig); } else { name = defaultName; return Show(equipment, defaultName, defaultName, null, true, stateSignalModule, stateConfig); } }
public bool Show(Equipment.EquipmentBase equipment, string name, string message, System.Windows.Media.ImageSource image, bool useSound, Module.StateSignalModule stateSignalModule, ConfigClasses.EquipmentStateConfig stateConfig) { bool result = false; App.Current.Dispatcher.Invoke( new Action( delegate() { if (_messageWindowList.ContainsKey(name) == false) { _messageWindowList.Add(name, new MessageWindowInfo(null, stateSignalModule)); } _messageWindowList[name].StateSignalModule = stateSignalModule; bool customSoundMode = false; if (stateSignalModule != null && stateConfig != null) { try { customSoundMode = true; stateConfig.CopyTo(stateSignalModule.CustomState); } catch { } } var windowInfo = _messageWindowList[name]; var window = _messageWindowList[name].WindowInstance; if (window == null || window.IsLoaded == false) { equipment.StateSignalModuleReferance.OffSound = false; var messageWindow = new MessageWindow(); windowInfo.WindowInstance = messageWindow; messageWindow.EquipmentInstance = equipment; messageWindow.RaisedTime = DateTime.Now; messageWindow.Message = message; messageWindow.Caption = name; messageWindow.ImageSource = image; messageWindow.UseSound = useSound; messageWindow.UseCustomSound = customSoundMode; messageWindow.Owner = equipment.Window; messageWindow.OnCloseWindow += delegate { if (stateSignalModule != null) { stateSignalModule.CustomMode = false; } }; messageWindow.Show(); result = true; } else if (window.Message != message) { var messageWindow = windowInfo.WindowInstance; messageWindow.RaisedTime = DateTime.Now; messageWindow.Message = message; messageWindow.Caption = name; messageWindow.ImageSource = image; messageWindow.Owner = equipment.Window; messageWindow.UseSound = useSound; result = true; } else result = false; if (stateSignalModule != null) { stateSignalModule.CustomMode = true; } if (equipment != null && result == true) LogManager.Instance.WriteTraceLog(equipment, string.Format("MESSAGE : CAPTION = {0}, MESSAGE = {1}", name, message)); })); return result; }
protected override void SetButtonLampState(ConfigClasses.EquipmentStateConfig stateConfig) { SwitchOffButtonLamp(stateConfig); }
private void SwitchOn(ConfigClasses.EquipmentStateConfig stateConfig) { if (stateConfig == null) return; try { SetLampState(SignalTowerGreen, stateConfig.SignalTower.GreenLamp, true); SetLampState(SignalTowerYellow, stateConfig.SignalTower.YellowLamp, true); SetLampState(SignalTowerRed, stateConfig.SignalTower.RedLamp, true); SetBuzzerState(stateConfig.SignalTower.Buzzer, true); SwitchOnButtonLamp(stateConfig); } catch { } }
protected virtual void SwitchOnButtonLamp(ConfigClasses.EquipmentStateConfig stateConfig) { }
protected virtual void SetButtonLampState(ConfigClasses.EquipmentStateConfig stateConfig) { }
public void Configure() { ConfigClasses.Add( item.Key, new CarsTT(item.Value, item.Value, "", "start")); }