From d99b65c58745a77b6ff2b709d5dbc930bab7134d Mon Sep 17 00:00:00 2001 From: ZhaoGang <15196688790@163.com> Date: Fri, 9 Jun 2023 09:56:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E6=96=99=E7=AB=99=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E6=89=8B=E5=8A=A8AGV=E9=80=81=E6=89=98=E7=9B=98=E8=A6=81?= =?UTF-8?q?=E6=B1=82=E5=88=A4=E5=AE=9A=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Model/GVL_SmallStation.cs | 5 ++--- .../ViewModel/ManualFlowViewModel.cs | 13 ++++++------- .../ViewModel/RecipeReceiveViewModel.cs | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs b/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs index 4ec45a75..b8660926 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs @@ -353,10 +353,9 @@ namespace BPASmartClient.JXJFoodSmallStation.Model /// public byte RobotProgramNum { get; set; } = 0; /// - /// 手动下发订单。 + /// 最近一次下发订单的时间 /// - [VarComm("Global","手动下发订单")] - public bool ManualIssueRecipe { get; set; }=false; + public DateTime LatestIssueRecipe { get; set; } = new DateTime(2023, 5, 1, 00, 00, 00); #endregion } public enum IssueRecipeCondition diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs index 8ff56f43..61a5c88c 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs @@ -28,12 +28,12 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel time = GVL_SmallStation.GetInstance.Time; Test1Command = new RelayCommand(() => { - //if (!Delay.GetInstance("CanManualGetTray").Start(GVL_SmallStation.GetInstance.ManualIssueRecipe, 10)) - //{ - // NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"手动下发订单间隔不足10秒,请稍后再点击。"); - // return; - //} - + if (DateTime.Now.Subtract(GVL_SmallStation.GetInstance.LatestIssueRecipe).TotalSeconds<=10) + { + NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"最后一次手动下发订单间隔不足10秒,请稍后再点击。"); + return; + } + ActionManage.GetInstance.Send("PLCWrite", new HKDeviceWrite() { Address = "DB4.DBX8.0", PlcVarType = PlcVarType.Bool, Value = true }); //Thread.Sleep(200); //ActionManage.GetInstance.Send("PLCWrite", new HKDeviceWrite() { Address = "DB4.DBX8.0", PlcVarType = PlcVarType.Bool, Value = false }); @@ -43,7 +43,6 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel VisibilityBtn1 = Visibility.Hidden; VisibilityBtn2 = Visibility.Visible; VisibilityBtn3 = Visibility.Hidden; - GVL_SmallStation.GetInstance.ManualIssueRecipe = false; NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"手动点击按钮,AGV送托盘完成"); }); diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs index fc0e185e..0b012811 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs @@ -97,7 +97,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"{res.RecipeName}配方下发成功!"); MessageNotify.GetInstance.ShowUserLog($"下发本地模拟配方——{res.RecipeName}"); } - GVL_SmallStation.GetInstance.ManualIssueRecipe = true; + GVL_SmallStation.GetInstance.LatestIssueRecipe=DateTime.Now; } } }