From 8fd6a1a209cdace6202ee7bec73861c048d59d0b Mon Sep 17 00:00:00 2001
From: ZhaoGang <15196688790@163.com>
Date: Fri, 2 Jun 2023 09:42:08 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E6=96=99=E7=AB=99=E6=96=B0=E5=A2=9E?=
=?UTF-8?q?=E6=89=8B=E5=8A=A8=E4=B8=8B=E5=8F=91=E8=AE=A2=E5=8D=95=E5=90=8E?=
=?UTF-8?q?=EF=BC=8C=E9=9C=80=E5=BB=B6=E6=97=B610S=E6=89=8D=E5=8F=AF?=
=?UTF-8?q?=E7=82=B9=E5=87=BBAGV=E9=80=81=E6=89=98=E7=9B=98=E5=AE=8C?=
=?UTF-8?q?=E6=88=90=E5=8A=9F=E8=83=BD=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 | 32 ++++++++++++++-----
.../ViewModel/RecipeReceiveViewModel.cs | 1 +
3 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs b/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs
index 47d8ffe4..4ec45a75 100644
--- a/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs
+++ b/BPASmartClient.JXJFoodSmallStation/Model/GVL_SmallStation.cs
@@ -352,6 +352,11 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
/// 机器人的程序号
///
public byte RobotProgramNum { get; set; } = 0;
+ ///
+ /// 手动下发订单。
+ ///
+ [VarComm("Global","手动下发订单")]
+ public bool ManualIssueRecipe { get; set; }=false;
#endregion
}
public enum IssueRecipeCondition
diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs
index 4291b762..987180b1 100644
--- a/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs
+++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs
@@ -37,8 +37,9 @@ 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送托盘完成");
- });
+ }, () => CanManualGetTray());
Test2Command = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("PLCWrite", new HKDeviceWrite() { Address = "DB4.DBX4.0", PlcVarType = PlcVarType.Bool, Value = true });
@@ -147,12 +148,16 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
//MessageNotify.GetInstance.ShowUserLog($"手动点击按钮,清除所有手动配料完成信号");
//NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"清除所有手动配料完成信号");
});
- CancelRecipeCommand = new RelayCommand(() => {
+ CancelRecipeCommand = new RelayCommand(() =>
+ {
string cancelRecipeCode = CancelRecipeCode.Trim();
- if (!String.IsNullOrEmpty(cancelRecipeCode) &&MessageNotify.GetInstance.ShowDialog($"请确认,是否进行删除订单【{cancelRecipeCode}】操作?")) {
- if (Json.Data.Recipes != null) {
+ if (!String.IsNullOrEmpty(cancelRecipeCode) && MessageNotify.GetInstance.ShowDialog($"请确认,是否进行删除订单【{cancelRecipeCode}】操作?"))
+ {
+ if (Json.Data.Recipes != null)
+ {
int index = Array.FindIndex(Json.Data.Recipes.ToArray(), p => p.RecipeCode == cancelRecipeCode);
- if (index >= 0) {
+ if (index >= 0)
+ {
GVL_SmallStation.GetInstance.Order_Cancel = true;
GVL_SmallStation.GetInstance.Order_CancelRecipeCode = cancelRecipeCode;
MessageNotify.GetInstance.ShowUserLog($"手动删除订单【{cancelRecipeCode}】。");
@@ -163,10 +168,11 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
}
}
-
+
});
- CompletedNumResetCommand = new RelayCommand(() => {
- if (MessageNotify.GetInstance.ShowDialog("请确认,是否将配方完成数目清零?",DialogType.Warning))
+ CompletedNumResetCommand = new RelayCommand(() =>
+ {
+ if (MessageNotify.GetInstance.ShowDialog("请确认,是否将配方完成数目清零?", DialogType.Warning))
{
GVL_SmallStation.GetInstance.RecipeDosingCompleNum = 0;
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", "配方完成数目清零成功!");
@@ -368,5 +374,15 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
public string _CancelRecipeCode { get; set; }
private static Visibility _VisibilityBtn3 = Visibility.Hidden;
+
+ //延迟10s后才可以执行手动点击送托盘完成操作。
+ private bool CanManualGetTray()
+ {
+ if (Delay.GetInstance("CanManualGetTray").Start(GVL_SmallStation.GetInstance.ManualIssueRecipe,10))
+ {
+ return true;
+ }
+ return false;
+ }
}
}
diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs
index 0663f2f8..302a7fce 100644
--- a/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs
+++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs
@@ -96,6 +96,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"{res.RecipeName}配方下发成功!");
MessageNotify.GetInstance.ShowUserLog($"下发本地模拟配方——{res.RecipeName}");
}
+ GVL_SmallStation.GetInstance.ManualIssueRecipe = true;
}
}
}