From ad209b9bf57c833702bdc61eab25bd6741f08be8 Mon Sep 17 00:00:00 2001 From: lhiven Date: Fri, 14 Nov 2025 08:38:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=99=E7=9B=98=E6=90=AC?= =?UTF-8?q?=E8=BF=90=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.DeweyTester/Entitys/AlarmEntity.cs | 21 ++++++++++++++++++ .../Flow/NormalFlow/TakeTrayFlow.cs | 22 ++++++++++--------- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/Rs.DeweyTester/Entitys/AlarmEntity.cs b/Rs.DeweyTester/Entitys/AlarmEntity.cs index f10ceea..0634781 100644 --- a/Rs.DeweyTester/Entitys/AlarmEntity.cs +++ b/Rs.DeweyTester/Entitys/AlarmEntity.cs @@ -144,7 +144,28 @@ namespace Rs.MotionPlat.Entitys Msg.ShowError("Alarm file cann't find 系统异常报警 item"); } } + + public static void ShowMsg(int alarmID, Action act) + { + while (true) + { + AlarmEntity alarmEntity = AlarmCollection.Get(alarmID); + if (alarmEntity != null) + { + Msgbox.ShowDialog(alarmEntity, EButtonType.Retry, true); + act.Invoke(); + break; + } + else + { + Msg.ShowError($"The alarmID = {alarmID} was not found in the translation file."); + AlarmCollection.Load(); + } + } + } } + + public class AlarmEntity { /// diff --git a/Rs.DeweyTester/Flow/NormalFlow/TakeTrayFlow.cs b/Rs.DeweyTester/Flow/NormalFlow/TakeTrayFlow.cs index 852b5b5..04fa182 100644 --- a/Rs.DeweyTester/Flow/NormalFlow/TakeTrayFlow.cs +++ b/Rs.DeweyTester/Flow/NormalFlow/TakeTrayFlow.cs @@ -239,6 +239,7 @@ namespace Rs.MotionPlat.Flow { TakeTrayModule.CylinderGoDown(GetClassName()); stopwatch.Restart(); + step = ETakeTrayFlowStep.等待运动到取料位下方; } break; case ETakeTrayFlowStep.等待运动到取料位下方: @@ -257,16 +258,17 @@ namespace Rs.MotionPlat.Flow } else if (stopwatch.ElapsedMilliseconds > 5000) { - alarmEntity = AlarmCollection.Get(AlarmConstID.料盘搬运气缸动位异常); - if (alarmEntity != null) - { - Msgbox.ShowDialog(alarmEntity, EButtonType.Retry, true); - step = ETakeTrayFlowStep.等待运动到取料位下方; - } - else - { - Msg.ShowError("翻译文件中未找到料盘搬运气缸动位异常"); - } + AlarmCollection.ShowMsg(AlarmConstID.料盘搬运气缸动位异常, () => { step = ETakeTrayFlowStep.等待运动到取料位下方; }); + //alarmEntity = AlarmCollection.Get(AlarmConstID.料盘搬运气缸动位异常); + //if (alarmEntity != null) + //{ + // Msgbox.ShowDialog(alarmEntity, EButtonType.Retry, true); + // step = ETakeTrayFlowStep.等待运动到取料位下方; + //} + //else + //{ + // Msg.ShowError("翻译文件中未找到料盘搬运气缸动位异常"); + //} //stopwatch.Restart(); } }