From f630ddeaa6486ad93886bfbfc2023a9ade3ba916 Mon Sep 17 00:00:00 2001 From: lhiven Date: Fri, 23 May 2025 08:51:06 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0Input=E6=96=99?= =?UTF-8?q?=E4=BB=93=E5=8F=96=E6=96=99=E5=A4=B1=E8=B4=A5=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=B7=B3=E8=BF=87=E5=8A=9F=E8=83=BD=E3=80=82=202=E3=80=81?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0Input=E6=96=99=E7=9B=98=E5=8F=96=E6=96=99?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=90=AC=E8=BF=90=E5=88=B0Empty=E5=89=8D?= =?UTF-8?q?=E6=8A=A5=E8=AD=A6=E6=A3=80=E6=9F=A5=E6=98=AF=E5=90=A6=E6=9C=89?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E3=80=82=203=E3=80=81=E8=BF=90=E5=8A=A8?= =?UTF-8?q?=E5=89=8D=E5=A2=9E=E5=8A=A0=E5=AF=B9=20=E2=80=9C=E4=B8=8A?= =?UTF-8?q?=E4=B8=8B=E6=96=99=E5=85=89=E6=BA=90=E4=B8=8A=EF=BC=88=E5=8E=9F?= =?UTF-8?q?=E4=BD=8D=EF=BC=89=E2=80=9D=E7=9A=84=E6=A3=80=E6=B5=8B=EF=BC=8C?= =?UTF-8?q?=E5=8E=9F=E4=BD=8D=E4=B8=8D=E4=BA=AE=E5=88=99=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=81=9C=E6=AD=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.DeweyTester/Commom/GlobalVar.cs | 13 +++++ .../Flow/NormalFlow/DischargeFlow.cs | 51 ++++++++++++------- Rs.DeweyTester/Flow/SafeControl.cs | 15 ++++-- Rs.DeweyTester/FormMain.cs | 6 +-- Rs.DeweyTester/Properties/AssemblyInfo.cs | 2 +- 5 files changed, 61 insertions(+), 26 deletions(-) diff --git a/Rs.DeweyTester/Commom/GlobalVar.cs b/Rs.DeweyTester/Commom/GlobalVar.cs index d028dbb..6593a37 100644 --- a/Rs.DeweyTester/Commom/GlobalVar.cs +++ b/Rs.DeweyTester/Commom/GlobalVar.cs @@ -22,6 +22,19 @@ namespace Rs.Framework { #region newpro + /// + /// 料仓取料拍照失败自动跳过 + /// + [ParameterInit("bool", "true", "system", "料仓取料拍照失败自动跳过")] + public static bool BinTakeGrabFailSkip + { + get + { + return SysConfigParam.GetValue(nameof(BinTakeGrabFailSkip)); + } + } + + /// /// 料仓取料失败是否跳过 /// diff --git a/Rs.DeweyTester/Flow/NormalFlow/DischargeFlow.cs b/Rs.DeweyTester/Flow/NormalFlow/DischargeFlow.cs index a49f12c..1a9d31c 100644 --- a/Rs.DeweyTester/Flow/NormalFlow/DischargeFlow.cs +++ b/Rs.DeweyTester/Flow/NormalFlow/DischargeFlow.cs @@ -490,33 +490,46 @@ namespace Rs.MotionPlat.Flow } else if (fixtureret != null && fixtureret.Result == EOneGrabSixteenResult.Slant) { - //报警弹框 - alarmEntity = AlarmCollection.Get(AlarmConstID.取料定位失败报警).Transform(ret.SlotIndex); - EButtonType buttonSelect = Msgbox.ShowDialog(alarmEntity, EButtonType.Skip | EButtonType.Retry | EButtonType.EndInput, true); - //EButtonType buttonSelect = Msgbox.ShowDialog(EButtonType.Skip | EButtonType.Retry | EButtonType.EndInput, $"穴位{ret.SlotIndex}定位失败,请把产品手动取走后点击跳过","tip",true); - if (buttonSelect == EButtonType.Retry) + if(GlobalVar.BinTakeGrabFailSkip) { - logInfo = GetClassName() + "选择了重试"; - MessageQueue.Instance.Insert(logInfo); - } - else if (buttonSelect == EButtonType.Skip) - { - logInfo = GetClassName() + "选择了跳过"; + logInfo = GetClassName() + "系统设置了取料拍照失败自动跳过"; MessageQueue.Instance.Insert(logInfo); exit = true; - GlobalTray.InputTray.ChangeStatus(ret.SlotIndex, ESlotStatus.NotHave); + //GlobalTray.InputTray.ChangeStatus(ret.SlotIndex, ESlotStatus.NotHave); takeSlotIndex++; flowStep = EDischargeFlowStep.判断是否需要从料仓取料; } - else if (buttonSelect == EButtonType.EndInput) + else { - logInfo = GetClassName() + "选择了结束上料"; - MessageQueue.Instance.Insert(logInfo); - exit = true; - GlobalVar.Clear = true; - takeSlotIndex++; - flowStep = EDischargeFlowStep.判断是否需要从料仓取料; + //报警弹框 + alarmEntity = AlarmCollection.Get(AlarmConstID.取料定位失败报警).Transform(ret.SlotIndex); + EButtonType buttonSelect = Msgbox.ShowDialog(alarmEntity, EButtonType.Skip | EButtonType.Retry | EButtonType.EndInput, true); + //EButtonType buttonSelect = Msgbox.ShowDialog(EButtonType.Skip | EButtonType.Retry | EButtonType.EndInput, $"穴位{ret.SlotIndex}定位失败,请把产品手动取走后点击跳过","tip",true); + if (buttonSelect == EButtonType.Retry) + { + logInfo = GetClassName() + "选择了重试"; + MessageQueue.Instance.Insert(logInfo); + } + else if (buttonSelect == EButtonType.Skip) + { + logInfo = GetClassName() + "选择了跳过"; + MessageQueue.Instance.Insert(logInfo); + exit = true; + GlobalTray.InputTray.ChangeStatus(ret.SlotIndex, ESlotStatus.NotHave); + takeSlotIndex++; + flowStep = EDischargeFlowStep.判断是否需要从料仓取料; + } + else if (buttonSelect == EButtonType.EndInput) + { + logInfo = GetClassName() + "选择了结束上料"; + MessageQueue.Instance.Insert(logInfo); + exit = true; + GlobalVar.Clear = true; + takeSlotIndex++; + flowStep = EDischargeFlowStep.判断是否需要从料仓取料; + } } + } //else if (fixtureret.Result == EOneGrabSixteenResult.NoHaveProdut) //{ diff --git a/Rs.DeweyTester/Flow/SafeControl.cs b/Rs.DeweyTester/Flow/SafeControl.cs index 9bef3f9..aeef7f4 100644 --- a/Rs.DeweyTester/Flow/SafeControl.cs +++ b/Rs.DeweyTester/Flow/SafeControl.cs @@ -32,12 +32,12 @@ namespace Rs.MotionPlat.Flow AxisControl.LoadX.FunSafeCheck += LoadX_FunSafeCheck; } - if (AxisControl.LoadX != null) + if (AxisControl.LoadY1 != null) { AxisControl.LoadY1.FunSafeCheck += LoadY_FunSafeCheck; } - if (AxisControl.LoadX != null) + if (AxisControl.LoadY2 != null) { AxisControl.LoadY2.FunSafeCheck += LoadY_FunSafeCheck; } @@ -95,6 +95,11 @@ namespace Rs.MotionPlat.Flow } } + if (Ops.IsOff("上下料光源上(原位)")) + { + MessageQueue.Instance.Warn($"上下料光源上(原位)不亮"); + return false; + } } else { @@ -122,7 +127,11 @@ namespace Rs.MotionPlat.Flow return false; } } - + if(Ops.IsOff("上下料光源上(原位)")) + { + MessageQueue.Instance.Warn($"上下料光源上(原位)不亮"); + return false; + } } else { diff --git a/Rs.DeweyTester/FormMain.cs b/Rs.DeweyTester/FormMain.cs index d82bffa..34a6a4d 100644 --- a/Rs.DeweyTester/FormMain.cs +++ b/Rs.DeweyTester/FormMain.cs @@ -865,7 +865,7 @@ namespace Rs.MotionPlat StringBuilder msg = new StringBuilder(); //string reg = "[\\w,&,\\.]"; //string reg = "([a-z 0-9 A-Z]*_{0,1})"; - string reg = "\\w"; + string reg = "[a-z A-Z \\d \\- _]"; TextBox textBox = (TextBox)sender; string text = textBox.Text; char[] charData = text.ToCharArray(); @@ -873,9 +873,9 @@ namespace Rs.MotionPlat { if (Regex.IsMatch(charData[i].ToString(), reg)) { - if(i>0 && charData[i]=='_') + if(i>0 && (charData[i]=='_' || charData[i]=='-')) { - if (charData[i] != charData[i-1]) + if (charData[i-1] != '_' && charData[i-1]!='-') { msg.Append(charData[i].ToString()); } diff --git a/Rs.DeweyTester/Properties/AssemblyInfo.cs b/Rs.DeweyTester/Properties/AssemblyInfo.cs index bdcd4a7..94c946a 100644 --- a/Rs.DeweyTester/Properties/AssemblyInfo.cs +++ b/Rs.DeweyTester/Properties/AssemblyInfo.cs @@ -31,6 +31,6 @@ using System.Runtime.InteropServices; // //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: - [assembly: AssemblyVersion("20.25.35.1")] + [assembly: AssemblyVersion("20.25.37.1")] //[assembly: AssemblyVersion("1.0.0.0")] //[assembly: AssemblyFileVersion("1.0.0.0")]