private void ResetAll_bt_Click(object sender, EventArgs e) { Transaction Txn; foreach (AlarmInfo eachA in AlarmManagement.GetAll()) { if (!eachA.NeedReset) { AlarmManagement.Remove(eachA); } } //foreach (Node node in NodeManagement.GetList()) //{ // node.State = node.LastState; //} var NodeList = AlarmManagement.GetAll().GroupBy(t => t.NodeName); foreach (var group in NodeList) { string Message = ""; Txn = new Transaction(); Txn.Method = Transaction.Command.RobotType.Reset; Txn.TaskId = ""; //NodeManagement.Get(group.First().NodeName).State = "Alarm"; NodeManagement.Get(group.First().NodeName).SendCommand(Txn, out Message); AlarmManagement.Remove(group.First().NodeName); } //NodeStatusUpdate.UpdateCurrentState("Idle"); AlarmUpdate.UpdateAlarmList(AlarmManagement.GetAll()); }
public void On_Command_TimeOut(Node Node, Transaction Txn) { logger.Debug("On_Command_TimeOut"); AlarmInfo CurrentAlarm = new AlarmInfo(); CurrentAlarm.NodeName = Node.Name; CurrentAlarm.AlarmCode = "00200002"; CurrentAlarm.NeedReset = false; try { AlarmMessage Detail = AlmMapping.Get("SYSTEM", CurrentAlarm.AlarmCode); CurrentAlarm.SystemAlarmCode = Detail.CodeID; CurrentAlarm.Desc = Detail.Code_Cause; CurrentAlarm.EngDesc = Detail.Code_Cause_English; CurrentAlarm.Type = Detail.Code_Type; CurrentAlarm.IsStop = Detail.IsStop; if (CurrentAlarm.IsStop) { //RouteCtrl.Stop(); } } catch (Exception e) { CurrentAlarm.Desc = "未定義"; logger.Error(Node.Controller + "-" + Node.AdrNo + "(GetAlarmMessage)" + e.Message + "\n" + e.StackTrace); } CurrentAlarm.TimeStamp = DateTime.Now; AlarmManagement.Add(CurrentAlarm); AlarmUpdate.UpdateAlarmList(AlarmManagement.GetAll()); AlarmUpdate.UpdateAlarmHistory(AlarmManagement.GetHistory()); }
public void On_Connection_Error(string DIOName, string ErrorMsg) { //斷線 發ALARM logger.Debug("On_Error_Occurred"); AlarmInfo CurrentAlarm = new AlarmInfo(); CurrentAlarm.NodeName = DIOName; CurrentAlarm.AlarmCode = "00200001"; CurrentAlarm.NeedReset = false; try { AlarmMessage Detail = AlmMapping.Get("DIO", CurrentAlarm.AlarmCode); CurrentAlarm.SystemAlarmCode = Detail.CodeID; CurrentAlarm.Desc = Detail.Code_Cause; CurrentAlarm.EngDesc = Detail.Code_Cause_English; CurrentAlarm.Type = Detail.Code_Type; CurrentAlarm.IsStop = Detail.IsStop; if (CurrentAlarm.IsStop) { //RouteCtrl.Stop(); } } catch (Exception e) { CurrentAlarm.Desc = "未定義"; logger.Error(DIOName + "(GetAlarmMessage)" + e.Message + "\n" + e.StackTrace); } CurrentAlarm.TimeStamp = DateTime.Now; AlarmManagement.Add(CurrentAlarm); AlarmUpdate.UpdateAlarmList(AlarmManagement.GetAll()); AlarmUpdate.UpdateAlarmHistory(AlarmManagement.GetHistory()); }
public static void Add(AlarmInfo Alm) { AlarmList.Add(Alm); AlarmHistory.Add(Alm); AlarmUpdate.UpdateStatusSignal(Alm.NodeName, "Red"); AlarmUpdate.UpdateMessage(Alm.NodeName + " Alarm Happen " + Alm.AlarmCode + ":" + Alm.Desc); AlarmUpdate.UpdateAlarmList(AlarmList.ToList()); AlarmUpdate.UpdateAlarmHistory(AlarmHistory.ToList()); }
public void On_Command_Error(Node Node, Transaction Txn, CommandReturnMessage Msg) { switch (Txn.FormName) { case "FormManual": switch (Node.Type) { case "LOADPORT": //ManualPortStatusUpdate.LockUI(false); break; } break; } logger.Debug("On_Command_Error"); AlarmInfo CurrentAlarm = new AlarmInfo(); CurrentAlarm.NodeName = Node.Name; CurrentAlarm.AlarmCode = Msg.Value; CurrentAlarm.NeedReset = true; try { AlarmMessage Detail = AlmMapping.Get(Node.Name, CurrentAlarm.AlarmCode); CurrentAlarm.SystemAlarmCode = Detail.CodeID; CurrentAlarm.Desc = Detail.Code_Cause; CurrentAlarm.EngDesc = Detail.Code_Cause_English; CurrentAlarm.Type = Detail.Code_Type; CurrentAlarm.IsStop = Detail.IsStop; if (CurrentAlarm.IsStop) { // RouteCtrl.Stop(); } } catch (Exception e) { CurrentAlarm.Desc = "未定義"; logger.Error(Node.Controller + "-" + Node.AdrNo + "(GetAlarmMessage)" + e.Message + "\n" + e.StackTrace); } CurrentAlarm.TimeStamp = DateTime.Now; AlarmManagement.Add(CurrentAlarm); AlarmUpdate.UpdateAlarmList(AlarmManagement.GetAll()); AlarmUpdate.UpdateAlarmHistory(AlarmManagement.GetHistory()); }
public static void Remove(string NodeName) { var find = from Alm in AlarmList.ToList() where Alm.NodeName.Equals(NodeName) select Alm; if (find.Count() != 0) { foreach (AlarmInfo each in find) { AlarmList.Remove(each); } } AlarmUpdate.UpdateAlarmList(GetAll()); if (NodeManagement.Get(NodeName).InitialComplete) { AlarmUpdate.UpdateStatusSignal(NodeName, "Green"); } }
public void On_TaskJob_Aborted(TaskJobManagment.CurrentProceedTask Task, string NodeName, string ReportType, string Message) { if (Task.Id.Equals("FormManual")) { ManualPortStatusUpdate.LockUI(false); } AlarmInfo CurrentAlarm = new AlarmInfo(); CurrentAlarm.NodeName = "SYSTEM"; CurrentAlarm.AlarmCode = Message; CurrentAlarm.NeedReset = false; try { AlarmMessage Detail = AlmMapping.Get("SYSTEM", CurrentAlarm.AlarmCode); if (!Detail.Code_Group.Equals("UNDEFINITION")) { CurrentAlarm.SystemAlarmCode = Detail.CodeID; CurrentAlarm.Desc = Detail.Code_Cause; CurrentAlarm.EngDesc = Detail.Code_Cause_English; CurrentAlarm.Type = Detail.Code_Type; CurrentAlarm.IsStop = Detail.IsStop; if (CurrentAlarm.IsStop) { //RouteCtrl.Stop(); } CurrentAlarm.TimeStamp = DateTime.Now; AlarmManagement.Add(CurrentAlarm); AlarmUpdate.UpdateAlarmList(AlarmManagement.GetAll()); AlarmUpdate.UpdateAlarmHistory(AlarmManagement.GetHistory()); } } catch (Exception e) { CurrentAlarm.Desc = "未定義"; logger.Error("(GetAlarmMessage)" + e.Message + "\n" + e.StackTrace); } }
private void AlarmFrom_Load(object sender, EventArgs e) { AlarmUpdate.UpdateAlarmList(AlarmManagement.GetAll()); }
public void On_Command_Excuted(Node Node, Transaction Txn, CommandReturnMessage Msg) { logger.Debug("On_Command_Excuted"); string Message = ""; Transaction SendTxn = new Transaction(); if (Txn.Method == Transaction.Command.LoadPortType.Reset) { AlarmUpdate.UpdateAlarmList(AlarmManagement.GetAll()); } switch (Node.Type) { case "LOADPORT": switch (Txn.Method) { case Transaction.Command.LoadPortType.GetMapping: case Transaction.Command.LoadPortType.Unload: case Transaction.Command.LoadPortType.MappingUnload: case Transaction.Command.LoadPortType.DoorUp: case Transaction.Command.LoadPortType.InitialPos: case Transaction.Command.LoadPortType.ForceInitialPos: WaferAssignUpdate.RefreshMapping(Node.Name); MonitoringUpdate.UpdateNodesJob(Node.Name); RunningUpdate.UpdateNodesJob(Node.Name); break; case Transaction.Command.LoadPortType.GetCassetteSize: ManualPortStatusUpdate.UpdateParameter("CASSETTE_SIZE_tb", Msg.Value); break; case Transaction.Command.LoadPortType.GetSlotOffset: ManualPortStatusUpdate.UpdateParameter("SLOT_OFFSET_tb", Msg.Value); break; case Transaction.Command.LoadPortType.GetWaferOffset: ManualPortStatusUpdate.UpdateParameter("WAFER_OFFSET_tb", Msg.Value); break; case Transaction.Command.LoadPortType.GetTweekDistance: ManualPortStatusUpdate.UpdateParameter("TWEEK_tb", Msg.Value); break; case Transaction.Command.LoadPortType.GetSlotPitch: ManualPortStatusUpdate.UpdateParameter("SLOT_PITCH_tb", Msg.Value); break; } break; case "ROBOT": switch (Txn.Method) { case Transaction.Command.RobotType.GetMapping: WaferAssignUpdate.RefreshMapping(Node.CurrentPosition); MonitoringUpdate.UpdateNodesJob(Node.CurrentPosition); RunningUpdate.UpdateNodesJob(Node.CurrentPosition); break; } break; } switch (Txn.FormName) { case "FormStatus": Util.StateUtil.UpdateSTS(Node.Name, Msg.Value); break; case "PauseProcedure": break; case "FormManual": switch (Node.Type) { case "SMARTTAG": if (!Txn.Method.Equals(Transaction.Command.SmartTagType.GetLCDData)) { //ManualPortStatusUpdate.LockUI(false); } break; case "LOADPORT": if (!Txn.CommandType.Equals("MOV") && !Txn.CommandType.Equals("HCS")) { //ManualPortStatusUpdate.LockUI(false); } else { if (Txn.Method.Equals(Transaction.Command.LoadPortType.Reset)) { // ManualPortStatusUpdate.LockUI(false); } } ManualPortStatusUpdate.UpdateLog(Node.Name, Msg.Command + " Excuted"); switch (Txn.Method) { case Transaction.Command.LoadPortType.ReadVersion: ManualPortStatusUpdate.UpdateVersion(Node.Name, Msg.Value); break; case Transaction.Command.LoadPortType.GetLED: ManualPortStatusUpdate.UpdateLED(Node.Name, Msg.Value); break; case Transaction.Command.LoadPortType.ReadStatus: ManualPortStatusUpdate.UpdateSmifStatus(Node.Name, Msg.Value); break; case Transaction.Command.LoadPortType.GetCount: break; case Transaction.Command.LoadPortType.GetMapping: ManualPortStatusUpdate.UpdateMapping(Node.Name, Msg.Value); break; } break; case "OCR": switch (Txn.Method) { case Transaction.Command.OCRType.GetOnline: //OCRUpdate.UpdateOCRStatus(Node.Name, Msg.Value); break; } break; case "ROBOT": switch (Txn.Method) { case Transaction.Command.RobotType.Speed: case Transaction.Command.RobotType.Mode: case Transaction.Command.RobotType.Reset: case Transaction.Command.RobotType.Servo: ManualRobotStatusUpdate.UpdateGUI(Txn, Node.Name, Msg.Value); //update 手動功能畫面 break; case Transaction.Command.RobotType.GetSpeed: case Transaction.Command.RobotType.GetRIO: case Transaction.Command.RobotType.GetError: case Transaction.Command.RobotType.GetMode: case Transaction.Command.RobotType.GetStatus: case Transaction.Command.RobotType.GetSV: ManualRobotStatusUpdate.UpdateGUI(Txn, Node.Name, Msg.Value); //update 手動功能畫面 break; case Transaction.Command.RobotType.GetCombineStatus: ManualRobotStatusUpdate.UpdateGUI(Txn, Node.Name, Msg.Command); //update 手動功能畫面 break; } break; case "ALIGNER": switch (Txn.Method) { case Transaction.Command.AlignerType.Speed: case Transaction.Command.AlignerType.Mode: case Transaction.Command.AlignerType.Reset: case Transaction.Command.AlignerType.Servo: //Thread.Sleep(500); ////向Aligner 詢問狀態 //Node aligner = NodeManagement.Get(Node.Name); //String script_name = aligner.Brand.ToUpper().Equals("SANWA") ? "AlignerStateGet" : "AlignerStateGet(Kawasaki)"; ////aligner.ExcuteScript(script_name, "FormManual", out Message); //ManualAlignerStatusUpdate.UpdateGUI(Txn, Node.Name, Msg.Value);//update //break; case Transaction.Command.AlignerType.GetMode: case Transaction.Command.AlignerType.GetSV: case Transaction.Command.AlignerType.GetStatus: case Transaction.Command.AlignerType.GetSpeed: case Transaction.Command.AlignerType.GetRIO: case Transaction.Command.AlignerType.GetError: ManualAlignerStatusUpdate.UpdateGUI(Txn, Node.Name, Msg.Value); //update 手動功能畫面 break; case Transaction.Command.RobotType.GetCombineStatus: ManualAlignerStatusUpdate.UpdateGUI(Txn, Node.Name, Msg.Command); //update 手動功能畫面 break; } break; } break; default: break; } }