From 25fad3cb08bd745c6b22bbc0533cccfd6464fb25 Mon Sep 17 00:00:00 2001 From: ZhaoGang <15196688790@163.com> Date: Thu, 8 Jun 2023 17:09:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E6=96=B9=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E6=98=BE=E7=A4=BA=EF=BC=8C=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E6=9A=82=E6=97=B6=E7=A7=BB=E9=99=A4AGV=E9=80=81=E6=89=98?= =?UTF-8?q?=E7=9B=98=E5=91=BD=E4=BB=A4=E9=AA=8C=E8=AF=81=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/RecipeInfosView.xaml | 10 ++--- .../ViewModel/ManualFlowViewModel.cs | 8 +++- .../ViewModel/NewLocalRecipeViewModel.cs | 2 +- .../ViewModel/RecipeInfosViewModel.cs | 38 ++++++++++++++++++- 4 files changed, 49 insertions(+), 9 deletions(-) diff --git a/BPASmartClient.JXJFoodSmallStation/View/RecipeInfosView.xaml b/BPASmartClient.JXJFoodSmallStation/View/RecipeInfosView.xaml index 5dfcccfe..3338ebca 100644 --- a/BPASmartClient.JXJFoodSmallStation/View/RecipeInfosView.xaml +++ b/BPASmartClient.JXJFoodSmallStation/View/RecipeInfosView.xaml @@ -199,35 +199,35 @@ Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Top" - FontSize="20" + FontSize="16" Foreground="#FF2AB2E7" Text="{Binding RawMaterialName}" /> diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs index 64c5a242..8ff56f43 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs @@ -28,6 +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; + //} + 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 }); @@ -40,7 +46,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel GVL_SmallStation.GetInstance.ManualIssueRecipe = false; NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"手动点击按钮,AGV送托盘完成"); - }, () => { return Delay.GetInstance("CanManualGetTray").Start(GVL_SmallStation.GetInstance.ManualIssueRecipe, 10); }); + }); Test2Command = new RelayCommand(() => { diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/NewLocalRecipeViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/NewLocalRecipeViewModel.cs index e3c90415..8acdb26e 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/NewLocalRecipeViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/NewLocalRecipeViewModel.cs @@ -58,7 +58,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel var res = Json.Data.windSendRawMaterial.FirstOrDefault(p => p.Location == item1.Location); if (res != null) { - item1.RawMaterialName = res.RawMaterialName; + item1.RawMaterialName = res.RawMaterialChineseName; } AllRawMaterial.Add(new RemoteRecipeRawMaterial() diff --git a/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeInfosViewModel.cs b/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeInfosViewModel.cs index 94751f12..807a7733 100644 --- a/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeInfosViewModel.cs +++ b/BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeInfosViewModel.cs @@ -27,11 +27,45 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel TrayCode = rm.TrayCode; foreach (var item in rm.RawMaterial) { - RawMaterialsInfo.Add(item); + //RawMaterialsInfo.Add(item); + + var res = Json.Data.rawMaterialStockBin.FirstOrDefault(p => p.RawMaterialLocation == item.RawMaterialLocation); + if (res != null && !string.IsNullOrEmpty(res.RawMaterialName)) + { + var temp = Json.Data.BomMaterial.FirstOrDefault(p => p.MaterialCode == res.RawMaterialName); + if (temp != null && !string.IsNullOrEmpty(temp.MaterialName)) + { + item.RawMaterialName = temp.MaterialName; + } + } + RawMaterialsInfo.Add(new RemoteRecipeRawMaterial() + { + RawMaterialType = item.RawMaterialType, + RawMaterialName = item.RawMaterialName, + RawMaterialWeight = item.RawMaterialWeight, + RawMaterialLocation = item.RawMaterialLocation, + RawMaterialBarrelNum = item.RawMaterialBarrelNum, + }); } foreach (var item1 in rm.WindSend) { - RawMaterialsInfo.Add(new RemoteRecipeRawMaterial() { RawMaterialName= item1.RawMaterialName, RawMaterialLocation= item1.Location,RawMaterialBarrelNum= item1.RawMaterialBarrelNum,RawMaterialWeight= item1.RawMaterialWeight,RawMaterialType=item1.RawMaterialType}); + // RawMaterialsInfo.Add(new RemoteRecipeRawMaterial() { RawMaterialName= item1.RawMaterialName, RawMaterialLocation= item1.Location,RawMaterialBarrelNum= item1.RawMaterialBarrelNum,RawMaterialWeight= item1.RawMaterialWeight,RawMaterialType=item1.RawMaterialType}); + + var res = Json.Data.windSendRawMaterial.FirstOrDefault(p => p.Location == item1.Location); + if (res != null) + { + item1.RawMaterialName = res.RawMaterialChineseName; + } + + RawMaterialsInfo.Add(new RemoteRecipeRawMaterial() + { + RawMaterialType = item1.RawMaterialType, + RawMaterialName = item1.RawMaterialName, + RawMaterialWeight = item1.RawMaterialWeight, + RawMaterialLocation = item1.Location, + RawMaterialBarrelNum = item1.RawMaterialBarrelNum, + }); + } } }), "RecipeInfo");