From 822d5f348236a21e1613b05f1337b51aad61d53f Mon Sep 17 00:00:00 2001 From: lhiven Date: Thu, 5 Oct 2023 18:21:07 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=92=8C=E4=B8=AD=E6=8E=A7?= =?UTF-8?q?=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.SkyLine/Commom/Ops.cs | 23 +++--- Rs.SkyLine/Commom/TestCenterMessageBox.cs | 82 ++++++++++---------- Rs.SkyLine/Flow/BaseFlow.cs | 1 + Rs.SkyLine/Flow/MonitorSystemButton.cs | 91 ++++++++++++++++++++--- Rs.SkyLine/Flow/TestCenter.cs | 3 +- Rs.SkyLine/Flow/TurnoverFlow.cs | 2 - Rs.SkyLine/Flow/WorkEnvironment.cs | 2 +- Rs.SkyLine/Flow/WorkFlow.cs | 71 ++++++++---------- Rs.SkyLine/SysConfig/StartPosConfig.cs | 25 ++++++- 9 files changed, 189 insertions(+), 111 deletions(-) diff --git a/Rs.SkyLine/Commom/Ops.cs b/Rs.SkyLine/Commom/Ops.cs index 4ab00fc..2e0ad4b 100644 --- a/Rs.SkyLine/Commom/Ops.cs +++ b/Rs.SkyLine/Commom/Ops.cs @@ -157,6 +157,17 @@ namespace Rs.MotionPlat.Commom }); } + public static void Stop() + { + WorkFlow.Instance.Stop(); + TurnoverFlow.Instance.Stop(); + TakeTrayFlow.Instance.Stop(); + StockManager.Instance.Stop(); + MachineManage.Instance.SetCenterMachineStatus(ERunStatus.Stopped); + MachineManage.Instance.SetLoadUnloadStatus(ERunState.Interrupt); + MachineManage.Instance.MachineStatus = EMachineStatus.Stop; + } + public static void GoHome() { if (MachineManage.Instance.MachineStatus == EMachineStatus.Homed @@ -171,17 +182,7 @@ namespace Rs.MotionPlat.Commom MessageQueue.Instance.Warn($"device state {MachineManage.Instance.MachineStatus} cann't home!"); } } - public static void Stop() - { - WorkFlow.Instance.Stop(); - TurnoverFlow.Instance.Stop(); - TakeTrayFlow.Instance.Stop(); - StockManager.Instance.Stop(); - MachineManage.Instance.SetCenterMachineStatus(ERunStatus.Stopped); - MachineManage.Instance.SetLoadUnloadStatus(ERunState.Interrupt); - MachineManage.Instance.MachineStatus = EMachineStatus.Stop; - - } + public static bool IsStop(params string[] axies) { foreach (var axisname in axies) diff --git a/Rs.SkyLine/Commom/TestCenterMessageBox.cs b/Rs.SkyLine/Commom/TestCenterMessageBox.cs index fca11bd..ebd290e 100644 --- a/Rs.SkyLine/Commom/TestCenterMessageBox.cs +++ b/Rs.SkyLine/Commom/TestCenterMessageBox.cs @@ -1,7 +1,9 @@ using Rs.MotionPlat.Flow; using System; +using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; +using System.Runtime.CompilerServices; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -11,63 +13,67 @@ namespace Rs.MotionPlat.Commom { public class TestCenterMessageBox { - private int ID; - private SchedulingMessageBox msgBox; - private ManualResetEvent msgRecivedEvent; - public TestCenterMessageBox() + static Dictionary msgSentEvent; + static Dictionary resultMessageBox; + static object msgLock = new object(); + static TestCenterMessageBox() { - msgBox = new SchedulingMessageBox(); - msgRecivedEvent = new ManualResetEvent(false); + msgSentEvent = new Dictionary(); + resultMessageBox = new Dictionary(); } - public void Show(int id,string message,ETipButton button,Dictionary buttonTexts) + public static void Show(int id, string message, ETipButton button) { - ID = id; - msgBox.ButtonContexts = buttonTexts; + Show(id, message, button, null); + } + + + public static void Show(int id,string message,ETipButton button,Dictionary buttonTexts) + { + SchedulingMessageBox msgBox = new SchedulingMessageBox(); + if(buttonTexts!=null) + msgBox.ButtonContexts = buttonTexts; msgBox.Message = message; msgBox.Button = button; msgBox.Instruction = EInstruction.ShowMessage; msgBox.ID = id; TestCenter.Instance.ShowMsgBox(msgBox); - TestCenterMessageBoxManager.Add(id, this); - } - - public SchedulingMessageBox Result; - - public void Recived(SchedulingMessageBox result) - { - Result = result; - msgRecivedEvent.Set(); - + msgSentEvent.Add(id, new ManualResetEvent(false)); } - public SchedulingMessageBox WaitResult() + public static void RecivedMsg(SchedulingMessageBox result) { - msgRecivedEvent.WaitOne(); - TestCenterMessageBoxManager.Remove(ID); - return Result; - } - } + if (msgSentEvent.ContainsKey(result.ID)) + { + if (!resultMessageBox.ContainsKey(result.ID)) + { + resultMessageBox.Add(result.ID, result); + } + msgSentEvent[result.ID].Set(); + } - public class TestCenterMessageBoxManager - { - private static Dictionary msgBoxDic = new Dictionary(); - public static void Add(int id,TestCenterMessageBox msgBox) - { - msgBoxDic.Add(id,msgBox); } - public static TestCenterMessageBox GetMsgbox(int id) + public static SchedulingMessageBox WaitResult(int id) { - if(msgBoxDic.ContainsKey(id)) - return msgBoxDic[id]; - return null; + SchedulingMessageBox box = new SchedulingMessageBox(); + if (msgSentEvent.ContainsKey(id)) + { + msgSentEvent[id].WaitOne(); + msgSentEvent.Remove(id); + box = resultMessageBox[id]; + resultMessageBox.Remove(id); + } + return box; } - public static void Remove(int id) + public static int GetMsgID() { - if( msgBoxDic.ContainsKey(id)) - msgBoxDic.Remove(id); + if(msgSentEvent.Count==1) + { + return msgSentEvent.ElementAt(0).Key; + } + return -1; } } } diff --git a/Rs.SkyLine/Flow/BaseFlow.cs b/Rs.SkyLine/Flow/BaseFlow.cs index a6b602e..8a4438e 100644 --- a/Rs.SkyLine/Flow/BaseFlow.cs +++ b/Rs.SkyLine/Flow/BaseFlow.cs @@ -14,6 +14,7 @@ namespace Rs.MotionPlat.Flow protected bool b_IsStop = true; private Task mainTask; protected string logInfo = ""; + protected string alarmInfo = ""; protected int stopWaitTime = 10; protected int sleepTime = 10; public BaseFlow() { diff --git a/Rs.SkyLine/Flow/MonitorSystemButton.cs b/Rs.SkyLine/Flow/MonitorSystemButton.cs index df9b0c7..b5d6962 100644 --- a/Rs.SkyLine/Flow/MonitorSystemButton.cs +++ b/Rs.SkyLine/Flow/MonitorSystemButton.cs @@ -23,7 +23,11 @@ namespace Rs.MotionPlat.Flow StopButtonUp,//停止按钮抬起, DoorOpend,//门被打开, LightButtonPressed,//照明被按下 - LightButtonUp//照明被抬起 + LightButtonUp,//照明被抬起 + SkipButtonPressed,//跳过被按下 + SkipButtonUp,//跳过被抬起 + RetryButtonPressed,//重试被按下 + RetryButtonUp//重试被抬起 } public enum ESystemButton @@ -49,6 +53,7 @@ namespace Rs.MotionPlat.Flow EMonitorButtonStep step = EMonitorButtonStep.Monitoring; private static MonitorSystemButton instance; private short signalValue = 0; + int msgID = -1; public static MonitorSystemButton Instance { get @@ -127,6 +132,20 @@ namespace Rs.MotionPlat.Flow step = EMonitorButtonStep.LightButtonPressed; break; } + + signalValue = IoManager.Instance.ReadIn("跳过"); + if (signalValue == 1) + { + step = EMonitorButtonStep.SkipButtonPressed; + break; + } + + signalValue = IoManager.Instance.ReadIn("重试"); + if (signalValue == 1) + { + step = EMonitorButtonStep.RetryButtonPressed; + break; + } break; case EMonitorButtonStep.EStopButtonPressed: MessageQueue.Instance.Insert("急停按钮按下"); @@ -155,15 +174,16 @@ namespace Rs.MotionPlat.Flow if (MachineManage.Instance.MachineStatus== EMachineStatus.Stop || MachineManage.Instance.MachineStatus== EMachineStatus.Homed) { - if(MachineManage.Instance.NeedRestoreMove) - { - MachineManage.Instance.NeedRestoreMove = false; - //WorkFlow.Instance.Restore(); - Thread.Sleep(100); - } - WorkFlow.Instance.Start(); - MachineManage.Instance.MachineStatus = EMachineStatus.Working; - LightManger.Instance.SetStatus(ELightStatus.Green); + Ops.Start(); + //if(MachineManage.Instance.NeedRestoreMove) + //{ + // MachineManage.Instance.NeedRestoreMove = false; + // //WorkFlow.Instance.Restore(); + // Thread.Sleep(100); + //} + //WorkFlow.Instance.Start(); + //MachineManage.Instance.MachineStatus = EMachineStatus.Working; + //LightManger.Instance.SetStatus(ELightStatus.Green); } else { @@ -210,8 +230,9 @@ namespace Rs.MotionPlat.Flow } else { - WorkFlow.Instance.Stop(); - MachineManage.Instance.MachineStatus = EMachineStatus.Stop; + //WorkFlow.Instance.Stop(); + Ops.Stop(); + //MachineManage.Instance.MachineStatus = EMachineStatus.Stop; } LightManger.Instance.SetStatus(ELightStatus.Yellow); } @@ -251,6 +272,52 @@ namespace Rs.MotionPlat.Flow step = EMonitorButtonStep.Monitoring; } break; + case EMonitorButtonStep.SkipButtonPressed: + //关闭消息 + MessageQueue.Instance.Insert("跳过按钮按下"); + msgID = TestCenterMessageBox.GetMsgID(); + if (msgID>0) + { + SchedulingMessageBox box = new SchedulingMessageBox(); + box.Button = SchedulingMessageBox.ETipButton.Skip; + box.Instruction = EInstruction.CloseMessage; + box.TurnoverID = 0; + box.GroupID= 0; + box.ID = msgID; + TestCenter.Instance.Send(box); + } + step = EMonitorButtonStep.SkipButtonUp; + break; + case EMonitorButtonStep.SkipButtonUp: + if (Ops.IsOff("跳过")) + { + MessageQueue.Instance.Insert("跳过按钮抬起"); + step = EMonitorButtonStep.Monitoring; + } + break; + case EMonitorButtonStep.RetryButtonPressed: + //关闭消息 + MessageQueue.Instance.Insert("重试按钮按下"); + msgID = TestCenterMessageBox.GetMsgID(); + if (msgID > 0) + { + SchedulingMessageBox box = new SchedulingMessageBox(); + box.Button = SchedulingMessageBox.ETipButton.Retry; + box.Instruction = EInstruction.CloseMessage; + box.TurnoverID = 0; + box.GroupID = 0; + box.ID = msgID; + TestCenter.Instance.Send(box); + } + step = EMonitorButtonStep.RetryButtonUp; + break; + case EMonitorButtonStep.RetryButtonUp: + if (Ops.IsOff("重试")) + { + MessageQueue.Instance.Insert("重试按钮抬起"); + step = EMonitorButtonStep.Monitoring; + } + break; default: break; } diff --git a/Rs.SkyLine/Flow/TestCenter.cs b/Rs.SkyLine/Flow/TestCenter.cs index 8f6ea6e..3f3d90c 100644 --- a/Rs.SkyLine/Flow/TestCenter.cs +++ b/Rs.SkyLine/Flow/TestCenter.cs @@ -188,7 +188,8 @@ namespace Rs.MotionPlat.Flow break; case EInstruction.CloseMessage: SchedulingMessageBox mbox = JsonConvert.DeserializeObject(json); - TestCenterMessageBoxManager.GetMsgbox(mbox.ID)?.Recived(mbox); + TestCenterMessageBox.RecivedMsg(mbox); + //TestCenterMessageBoxManager.GetMsgbox(mbox.ID)?.Recived(mbox); break; case EInstruction.MachineButtonDown: break; diff --git a/Rs.SkyLine/Flow/TurnoverFlow.cs b/Rs.SkyLine/Flow/TurnoverFlow.cs index f706ea4..3a09f85 100644 --- a/Rs.SkyLine/Flow/TurnoverFlow.cs +++ b/Rs.SkyLine/Flow/TurnoverFlow.cs @@ -155,7 +155,6 @@ namespace Rs.MotionPlat.Flow } logInfo = $"到周转盘取料位上方"; MessageQueue.Instance.Insert(logInfo); - LogHelper.Debug(logInfo); Step = ETurnoverFlowStep.等待运动到周转盘取料位上方; } else @@ -168,7 +167,6 @@ namespace Rs.MotionPlat.Flow { logInfo = $"已运动到周转盘取料位上方 TurnoverY at:{Ops.GetCurPosition( AxisAlias.TurnoverY)}"; MessageQueue.Instance.Insert(logInfo); - LogHelper.Debug(logInfo); Step = ETurnoverFlowStep.到周转盘下方取料位1; } break; diff --git a/Rs.SkyLine/Flow/WorkEnvironment.cs b/Rs.SkyLine/Flow/WorkEnvironment.cs index 1a00c0b..f064c8c 100644 --- a/Rs.SkyLine/Flow/WorkEnvironment.cs +++ b/Rs.SkyLine/Flow/WorkEnvironment.cs @@ -55,7 +55,7 @@ namespace Rs.MotionPlat.Flow } else { - StockManager.Instance.ChangeStatus(EStockType.Input, AutoDischarge.V3.Flow.ETrayStatus.Loaded); + //StockManager.Instance.ChangeStatus(EStockType.Input, AutoDischarge.V3.Flow.ETrayStatus.Loaded); } if (!StockManager.Instance.HasTray(EStockType.Empty2) || GlobalVar.VirtualAxis) diff --git a/Rs.SkyLine/Flow/WorkFlow.cs b/Rs.SkyLine/Flow/WorkFlow.cs index b656919..a87dee4 100644 --- a/Rs.SkyLine/Flow/WorkFlow.cs +++ b/Rs.SkyLine/Flow/WorkFlow.cs @@ -1,4 +1,5 @@ using HalconDotNet; +using Rs.AutoDischarge.V3.Flow; using Rs.Camera; using Rs.Controls; using Rs.Framework; @@ -15,6 +16,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; +using static Rs.MotionPlat.Commom.SchedulingMessageBox; namespace Rs.MotionPlat.Flow { @@ -398,14 +400,27 @@ namespace Rs.MotionPlat.Flow FetchNum++; if (FetchNum == 6) { + Dictionary buttonText = new Dictionary(); + if(curTask.FromType== TurnoverType.ToBeTested) + { + buttonText.Add(ETipButton.No, "结束上料|EndInput"); + } + buttonText.Add(ETipButton.Yes, "继续|Continue"); + buttonText.Add(ETipButton.Skip, "跳过|Skip"); + buttonText.Add(ETipButton.Retry, "重试|Retry"); //DialogResult dr = Msg.ShowError($"吸嘴{curNozzle.NozzleIndex}取料{FetchNum}次失败报警,请处理后点击确定", MessageBoxButtons.RetryCancel); - CloseResult cr = new TakeFailMsg().ShowMsg($"吸嘴{curNozzle.NozzleIndex}取料{FetchNum}次失败报警,请处理后点击确定"); - if (cr.Result == ECloseButton.Retry) + //CloseResult cr = new TakeFailMsg().ShowMsg($"吸嘴{curNozzle.NozzleIndex}取料{FetchNum}次失败报警,请处理后点击确定"); + //结束上料/跳过/重试/继续 + ETipButton btnText = (ETipButton.Retry | ETipButton.Skip | ETipButton.Yes | ETipButton.No); + alarmInfo = $"吸嘴{curNozzle.NozzleIndex}取料{FetchNum}次失败报警,请处理后点击确定"; + TestCenterMessageBox.Show(AlarmConstID.TrayTakeFailAlarm,alarmInfo , btnText); + SchedulingMessageBox box = TestCenterMessageBox.WaitResult(AlarmConstID.TrayTakeFailAlarm); + if (box.Button== ETipButton.Retry) { FetchNum = 0; flowStep = EWorkFlowStep.到取料位下方; } - else if (cr.Result == ECloseButton.Skip)//switch + else if (box.Button== ETipButton.Skip)//switch { FetchNum = 0; if (curTask.FromType == TurnoverType.Turnover) @@ -425,7 +440,7 @@ namespace Rs.MotionPlat.Flow flowStep = EWorkFlowStep.到下相机拍照起始位; } } - else if(cr.Result== ECloseButton.EndInput) + else if(box.Button== ETipButton.No)//结束上料 { FetchNum = 0; TestCenter.Instance.EndInput(); @@ -439,7 +454,7 @@ namespace Rs.MotionPlat.Flow flowStep = EWorkFlowStep.任务结束到安全位; } } - else if (cr.Result == ECloseButton.Continue) + else if (box.Button== ETipButton.Yes)//继续 { FetchNum = 0; curNozzle.Status = ENozzleStatus.ToUnload; @@ -469,26 +484,7 @@ namespace Rs.MotionPlat.Flow } else { - if(GlobalVar.VirtualAxis) - { - foreach (Nozzle nl in NozzleManager.GetNozzlesByStatus(ENozzleStatus.ToUnload)) - { - if (string.IsNullOrEmpty(nl.SN)) - nl.SN = nl.FromIndex.ToString().PadLeft(18, '0'); - //nl.SN = GuidHelper.Create(); - } - mrs = new List(); - for (int i = 0; i < needGrabNum; i++) - { - mrs.Add(new MatchResult()); - } - flowStep = EWorkFlowStep.到放料位上方; - } - else - { - flowStep = EWorkFlowStep.到下相机拍照起始位; - } - + flowStep = EWorkFlowStep.到下相机拍照起始位; } } } @@ -947,7 +943,6 @@ namespace Rs.MotionPlat.Flow { logInfo = "放料完成抬起"; MessageQueue.Instance.Insert(logInfo); - LogHelper.Debug(logInfo); flowStep = EWorkFlowStep.等待放料完成抬起; } break; @@ -956,7 +951,6 @@ namespace Rs.MotionPlat.Flow { logInfo = "放料完成已运动到抬起位,准备真空检测"; MessageQueue.Instance.Insert(logInfo); - LogHelper.Debug(logInfo); flowStep = EWorkFlowStep.放料真空检测; } break; @@ -967,16 +961,14 @@ namespace Rs.MotionPlat.Flow { logInfo = $"周转盘{curNozzle.ToIndex + 1}号穴位真空吸检测 OK"; MessageQueue.Instance.Insert(logInfo); - LogHelper.Debug(logInfo); - flowStep = EWorkFlowStep.放料任务完成; } else { logInfo = $"放料时周转盘{curNozzle.ToIndex + 1}号穴位真空吸异常"; MessageQueue.Instance.Warn(logInfo); - LogHelper.Debug(logInfo); DialogResult dr = Msg.ShowError($"周转盘{curNozzle.ToIndex + 1}号穴位真空吸异常,点击确定后跳过"); + //TestCenterMessageBox.Show(AlarmConstID) if (dr == DialogResult.OK) { flowStep = EWorkFlowStep.放料任务完成; @@ -991,7 +983,6 @@ namespace Rs.MotionPlat.Flow case EWorkFlowStep.放料任务完成: logInfo = "放料任务完成"; MessageQueue.Instance.Insert(logInfo); - LogHelper.Debug(logInfo); AxisControl.GetAxis($"NozzleZ{curNozzle.NozzleIndex}").Home(); //Ops.HomeAndGoStartPos($"NozzleR{NozzleIndex}"); if (curNozzle.ToType == TurnoverType.Turnover) @@ -1061,17 +1052,13 @@ namespace Rs.MotionPlat.Flow { logInfo = "任务结束已回到安全位"; MessageQueue.Instance.Insert(logInfo); - LogHelper.Debug(logInfo); if (TestCenter.Instance.LoadResult()) { logInfo = "通知中控任务完成"; MessageQueue.Instance.Insert(logInfo); - LogHelper.Debug(logInfo); - LoadAndUnloadTask.Instance.Clear(); logInfo = "任务完成,清除任务"; MessageQueue.Instance.Insert(logInfo); - LogHelper.Debug(logInfo); } MachineManage.Instance.SetLoadUnloadStatus(ERunState.Waiting); flowStep = EWorkFlowStep.等待任务; @@ -1143,49 +1130,49 @@ namespace Rs.MotionPlat.Flow } break; case EWorkFlowStep.等待Input料仓上料完成: - if(StockManager.Instance.GetStockStatus(EStockType.Input)== AutoDischarge.V3.Flow.ETrayStatus.Loaded) + if(StockManager.Instance.GetStockStatus(EStockType.Input)== ETrayStatus.Loaded) { flowStep = restoreFlowStep; restoreFlowStep = EWorkFlowStep.IDLE; } break; case EWorkFlowStep.等待Ok料仓收料完成: - if(StockManager.Instance.GetStockStatus( EStockType.Ok)== AutoDischarge.V3.Flow.ETrayStatus.Unloaded) + if(StockManager.Instance.GetStockStatus( EStockType.Ok)== ETrayStatus.Unloaded) { flowStep = EWorkFlowStep.等待Ok料盘搬运完成; TakeTrayFlow.Instance.Take(EStockType.Empty2, EStockType.Ok); } break; case EWorkFlowStep.等待Ok料盘搬运完成: - if(TakeTrayFlow.Instance.TakeStatus== ETakeStatus.TakeOK && StockManager.Instance.GetStockStatus( EStockType.Ok)== AutoDischarge.V3.Flow.ETrayStatus.Loaded) + if(TakeTrayFlow.Instance.TakeStatus== ETakeStatus.TakeOK && StockManager.Instance.GetStockStatus( EStockType.Ok)== ETrayStatus.Loaded) { flowStep = restoreFlowStep; restoreFlowStep = EWorkFlowStep.IDLE; } break; case EWorkFlowStep.等待Ng料仓收料完成: - if (StockManager.Instance.GetStockStatus(EStockType.Ng) == AutoDischarge.V3.Flow.ETrayStatus.Unloaded) + if (StockManager.Instance.GetStockStatus(EStockType.Ng) == ETrayStatus.Unloaded) { flowStep = EWorkFlowStep.等待Ng料盘搬运完成; TakeTrayFlow.Instance.Take(EStockType.Empty2, EStockType.Ng); } break; case EWorkFlowStep.等待Ng料盘搬运完成: - if (TakeTrayFlow.Instance.TakeStatus == ETakeStatus.TakeOK && StockManager.Instance.GetStockStatus(EStockType.Ng) == AutoDischarge.V3.Flow.ETrayStatus.Loaded) + if (TakeTrayFlow.Instance.TakeStatus == ETakeStatus.TakeOK && StockManager.Instance.GetStockStatus(EStockType.Ng) == ETrayStatus.Loaded) { flowStep = restoreFlowStep; restoreFlowStep = EWorkFlowStep.IDLE; } break; case EWorkFlowStep.等待Multi料仓收料完成: - if (StockManager.Instance.GetStockStatus(EStockType.Multi) == AutoDischarge.V3.Flow.ETrayStatus.Unloaded) + if (StockManager.Instance.GetStockStatus(EStockType.Multi) == ETrayStatus.Unloaded) { flowStep = EWorkFlowStep.等待Multi料盘搬运完成; TakeTrayFlow.Instance.Take(EStockType.Empty2, EStockType.Multi); } break; case EWorkFlowStep.等待Multi料盘搬运完成: - if (TakeTrayFlow.Instance.TakeStatus == ETakeStatus.TakeOK && StockManager.Instance.GetStockStatus(EStockType.Multi) == AutoDischarge.V3.Flow.ETrayStatus.Loaded) + if (TakeTrayFlow.Instance.TakeStatus == ETakeStatus.TakeOK && StockManager.Instance.GetStockStatus(EStockType.Multi) == ETrayStatus.Loaded) { flowStep = restoreFlowStep; restoreFlowStep = EWorkFlowStep.IDLE; diff --git a/Rs.SkyLine/SysConfig/StartPosConfig.cs b/Rs.SkyLine/SysConfig/StartPosConfig.cs index 675d534..2cd5052 100644 --- a/Rs.SkyLine/SysConfig/StartPosConfig.cs +++ b/Rs.SkyLine/SysConfig/StartPosConfig.cs @@ -81,15 +81,32 @@ namespace Rs.MotionPlat.SysConfig private void button9_Click_1(object sender, EventArgs e) { - TestCenterMessageBox box = new TestCenterMessageBox(); Dictionary buttonText = new Dictionary(); buttonText.Add(ETipButton.Yes, "继续|Continue"); buttonText.Add(ETipButton.Cancel, "跳过|Skip"); buttonText.Add(ETipButton.Retry, "重试|Retry"); buttonText.Add(ETipButton.No, "结束上料|EndInput"); - box.Show(111,"fasdf", (ETipButton.Yes| ETipButton.No| ETipButton.Retry|ETipButton.Cancel),buttonText); - SchedulingMessageBox msgbox = box.WaitResult(); - Msg.ShowInfo(msgbox.Button.ToString()); + // TestCenterMessageBox.Show(111,"fasdf", (ETipButton.Yes| ETipButton.No| ETipButton.Retry|ETipButton.Cancel),buttonText); + + TestCenterMessageBox.Show(AlarmConstID.TrayTakeFailAlarm, $"吸嘴次失败报警,请处理后点击确定", (ETipButton.Retry | ETipButton.Skip | ETipButton.Yes | ETipButton.No), buttonText); + //TestCenterMessageBox.Show(AlarmConstID.TurnoverTakeFailAlarm, $"请处理后点击确定", (ETipButton.Retry | ETipButton.Skip | ETipButton.Yes | ETipButton.No), buttonText); + Task.Run(() => { + while (true) + { + SchedulingMessageBox box1 = TestCenterMessageBox.WaitResult(AlarmConstID.TrayTakeFailAlarm); + Msg.ShowInfo(box1.Button.ToString()); + break; + } + }); + //Task.Run(() => { + // while (true) + // { + // SchedulingMessageBox box2 = TestCenterMessageBox.WaitResult(AlarmConstID.TurnoverTakeFailAlarm); + // Msg.ShowInfo(box2.Button.ToString()); + // break; + // } + //}); + } } }