From e4b44efc61133a217ddc89c2dfc83fde8325a905 Mon Sep 17 00:00:00 2001 From: ZhaoGang <15196688790@163.com> Date: Tue, 16 May 2023 10:15:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=85=AE=E9=9D=A2=E6=9C=BA=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E7=89=88=EF=BC=9A=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E7=95=8C=E9=9D=A2=E5=92=8C=E7=85=AE=E9=9D=A2=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=86=99=E5=85=A5=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Control_MorkSUpgradedVer.cs | 18 ++- .../Model/MorksPar.cs | 1 + .../View/ParSet.xaml | 152 ++++++++++++++++-- .../ViewModel/ParSetViewModel.cs | 14 +- 4 files changed, 166 insertions(+), 19 deletions(-) diff --git a/BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs b/BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs index ee6177cb..f0c793d8 100644 --- a/BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs +++ b/BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs @@ -647,10 +647,20 @@ namespace BPASmartClient.MorkSUpgradedVer if (mORKS.RBTakeNoodleTask.TryDequeue(out OrderLocInfo orderLocInfo)) { //写入煮面时间 - List values = new List(); - values.Add(Json.Data.parSets.ElementAt(loc).Minute); - values.Add(Json.Data.parSets.ElementAt(loc).Second); - WriteData($"VW{324 + (loc * 4)}", values.ToArray()); + //List values = new List(); + //values.Add(Json.Data.parSets.ElementAt(loc).Minute); + //values.Add(Json.Data.parSets.ElementAt(loc).Second); + //WriteData($"VW{324 + (loc * 4)}", values.ToArray()); + if (mORKS.CurrentFeedbackLoc >= 1 && mORKS.CurrentFeedbackLoc <= 5) { + var x = Json.Data.DishLibraryParSets.FirstOrDefault(p => p.TextBlockContext == mORKS.CurrentFeedbackLoc.ToString()); + if (x != null) { + List values = new List(); + values.Add(x.Minute); + values.Add(x.Second); + WriteData($"VW{324 + (loc * 4)}", values.ToArray()); + DeviceProcessLogShow($"转盘位置[{mORKS.CurrentFeedbackLoc}]:写入煮面时间{x.Minute}分{x.Second}秒。"); + } + } mORKS.CurrentLoc = 0; mORKS.CookNodelId[loc] = orderLocInfo.SuborderId; diff --git a/BPASmartClient.MorkSUpgradedVer/Model/MorksPar.cs b/BPASmartClient.MorkSUpgradedVer/Model/MorksPar.cs index ef2c0cb5..4b50dfa5 100644 --- a/BPASmartClient.MorkSUpgradedVer/Model/MorksPar.cs +++ b/BPASmartClient.MorkSUpgradedVer/Model/MorksPar.cs @@ -12,5 +12,6 @@ namespace BPASmartClient.MorkSUpgradedVer.Model internal class MorksPar { public ObservableCollection parSets { get; set; } = new ObservableCollection(); + public ObservableCollection DishLibraryParSets { get; set; } = new ObservableCollection(); } } diff --git a/BPASmartClient.MorkSUpgradedVer/View/ParSet.xaml b/BPASmartClient.MorkSUpgradedVer/View/ParSet.xaml index eb833a3a..d06c0166 100644 --- a/BPASmartClient.MorkSUpgradedVer/View/ParSet.xaml +++ b/BPASmartClient.MorkSUpgradedVer/View/ParSet.xaml @@ -76,12 +76,13 @@ - - - - - - + + + + + + - - + - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BPASmartClient.MorkSUpgradedVer/ViewModel/ParSetViewModel.cs b/BPASmartClient.MorkSUpgradedVer/ViewModel/ParSetViewModel.cs index 0aa320c6..03a8c2b4 100644 --- a/BPASmartClient.MorkSUpgradedVer/ViewModel/ParSetViewModel.cs +++ b/BPASmartClient.MorkSUpgradedVer/ViewModel/ParSetViewModel.cs @@ -19,12 +19,24 @@ namespace BPASmartClient.MorkSUpgradedVer.ViewModel SaveInfoCommand = new RelayCommand(SaveSettingData); ActionManage.GetInstance.Register(SaveSettingData, "初始化设定煮面时间"); - + + if (Json.Data.DishLibraryParSets.Count < 5) { + Json.Data.DishLibraryParSets.Clear(); + for (int i = 0; i < 5; i++) { + Json.Data.DishLibraryParSets.Add(new ParSet() { + Minute = 2, + Second = 0, + TextBlockContext = $"{i + 1}" + }); + } + } + } public RelayCommand SaveInfoCommand { get; set; } public ObservableCollection parSets { get; set; } = Json.Data.parSets; + public ObservableCollection DishLibraryParSets { get; set; } = Json.Data.DishLibraryParSets; private void SaveSettingData() {