From 31a506542ad99a556e1c90fd510469c918e16099 Mon Sep 17 00:00:00 2001 From: ZhaoGang <15196688790@163.com> Date: Thu, 8 Jun 2023 14:06:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E6=96=99=E7=AB=99=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E5=8A=9F=E8=83=BD=E5=8F=8A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=85=8D=E6=96=B9=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BPASmartClient.JXJFoodSmallStation.csproj | 3 + .../Model/ProcessControl.cs | 39 +++- .../Model/Siemens/LocalRecipeDataColl.cs | 4 + .../View/RecipeReceiveView.xaml | 6 +- .../View/SelectRecipesView.xaml | 221 ++++++++++++++++++ .../View/SelectRecipesView.xaml.cs | 31 +++ .../ViewModel/NewLocalRecipeViewModel.cs | 17 +- .../ViewModel/RecipeReceiveViewModel.cs | 33 ++- .../ViewModel/SelectRecipesViewModel.cs | 115 +++++++++ 9 files changed, 462 insertions(+), 7 deletions(-) create mode 100644 BPASmartClient.JXJFoodSmallStation/View/SelectRecipesView.xaml create mode 100644 BPASmartClient.JXJFoodSmallStation/View/SelectRecipesView.xaml.cs create mode 100644 BPASmartClient.JXJFoodSmallStation/ViewModel/SelectRecipesViewModel.cs diff --git a/BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj b/BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj index 6c3c8aaa..53a1f31f 100644 --- a/BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj +++ b/BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj @@ -35,6 +35,9 @@ Code + + Code + Code diff --git a/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs b/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs index 2912495d..a7a6fbdf 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs @@ -1340,9 +1340,44 @@ namespace BPASmartClient.JXJFoodSmallStation.Model //将本地配方发送到西门子配方里,执行配料 ActionManage.GetInstance.Register(new Action((res) => { - if (res != null && res is RemoteRecipeData recipe) + if (res != null && res is RemoteRecipeData rm) { - Json.Data.Recipes.Add(recipe); + //Json.Data.Recipes.Add(rm); + var newRecipe=new RemoteRecipeData(); + newRecipe.RecipeName = rm.RecipeName; + newRecipe.RecipeCode = rm.RecipeCode; + newRecipe.TrayCode = rm.TrayCode; + + foreach (var item in rm.RawMaterial) + { + newRecipe.RawMaterial.Add(new RemoteRecipeRawMaterial() + { + DeviceIp = item.DeviceIp, + RawMaterialName = item.RawMaterialName, + RawMaterialBarrelNum = item.RawMaterialBarrelNum, + RawMaterialType = item.RawMaterialType, + RawMaterialWeight = item.RawMaterialWeight, + Laying_Off_Weight = item.Laying_Off_Weight, + StockBinRemainingWeight = item.StockBinRemainingWeight, + RawMaterialLocation = item.RawMaterialLocation, + IsDosingComple = item.IsDosingComple + }); + } + foreach (var item in rm.WindSend) + { + newRecipe.WindSend.Add(new WindSendRawMaterial() + { + DeviceIp = item.DeviceIp, + Location=item.Location, + RawMaterialChineseName = item.RawMaterialChineseName, + RawMaterialName = item.RawMaterialName, + RawMaterialWeight = item.RawMaterialWeight, + DosingCompleWeight = item.DosingCompleWeight, + RawMaterialBarrelNum = item.RawMaterialBarrelNum, + RawMaterialType = item.RawMaterialType, + }); + } + Json.Data.Recipes.Add(newRecipe); } }), "LocalSimulationRecipeIssue", true); diff --git a/BPASmartClient.JXJFoodSmallStation/Model/Siemens/LocalRecipeDataColl.cs b/BPASmartClient.JXJFoodSmallStation/Model/Siemens/LocalRecipeDataColl.cs index 90e6184c..1405375d 100644 --- a/BPASmartClient.JXJFoodSmallStation/Model/Siemens/LocalRecipeDataColl.cs +++ b/BPASmartClient.JXJFoodSmallStation/Model/Siemens/LocalRecipeDataColl.cs @@ -10,5 +10,9 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens internal class LocalRecipeDataColl { public ObservableCollection Recipes { get; set; } = new ObservableCollection(); + /// + /// 筛选后的配方显示集合。 + /// + public ObservableCollection SelectedRecipes { get; set; } = new ObservableCollection(); } } diff --git a/BPASmartClient.JXJFoodSmallStation/View/RecipeReceiveView.xaml b/BPASmartClient.JXJFoodSmallStation/View/RecipeReceiveView.xaml index 07b8ba80..e6a4227a 100644 --- a/BPASmartClient.JXJFoodSmallStation/View/RecipeReceiveView.xaml +++ b/BPASmartClient.JXJFoodSmallStation/View/RecipeReceiveView.xaml @@ -46,6 +46,7 @@ + @@ -111,13 +112,14 @@ IsEnabled="True" Style="{StaticResource IcoButtonStyle}" /> - +