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; } } }