From bc7b96690fd87d0dd07a84e46dec6b191e6c9ed6 Mon Sep 17 00:00:00 2001 From: fyf Date: Thu, 10 Nov 2022 10:21:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=A4=A7=E5=B1=8F=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../炒锅/ScreenMaxWokControl.xaml | 46 +++++++++++-- .../炒锅/ScreenMaxWokControlViewModel.cs | 47 +++++++++++++ .../炒锅/ScreenMinWokControl.xaml | 31 +++++++-- .../炒锅/ScreenMinWokControlViewModel.cs | 33 ++++++++++ .../煮面机/ScreenMorksControl.xaml | 66 ++++++++++--------- 5 files changed, 181 insertions(+), 42 deletions(-) diff --git a/BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControl.xaml b/BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControl.xaml index 4607acfb..041c90d6 100644 --- a/BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControl.xaml +++ b/BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControl.xaml @@ -77,8 +77,26 @@ + + @@ -97,12 +115,19 @@ + + + + + + + @@ -117,11 +142,13 @@ + + @@ -129,11 +156,12 @@ + - + @@ -272,7 +300,7 @@ @@ -291,12 +319,19 @@ + + + + + + + @@ -311,11 +346,13 @@ + + @@ -323,11 +360,12 @@ + - + diff --git a/BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControlViewModel.cs b/BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControlViewModel.cs index 9a42628a..08932c92 100644 --- a/BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControlViewModel.cs +++ b/BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControlViewModel.cs @@ -1,6 +1,7 @@ using BPA.Helper; using BPA.Message; using BPA.Message.Enum; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -19,6 +20,7 @@ namespace BPASmartClient.ScreenLib /// public Uri GgAdder { get { return _GgAdder; } set { _GgAdder = value; OnPropertyChanged(); } } private Uri _GgAdder = new Uri(System.Configuration.ConfigurationManager.AppSettings["GgAdder"].ToString()); + /// /// 界面数据绑定 /// @@ -33,6 +35,34 @@ namespace BPASmartClient.ScreenLib } private ScreenModelMaxWok _ViewData = new ScreenModelMaxWok(); + /// + /// 1号炒锅流程 + /// + public ObservableCollection ProcessModel1 + { + get { return _ProcessModel1; } + set + { + _ProcessModel1 = value; + OnPropertyChanged(); + } + } + private ObservableCollection _ProcessModel1 = new ObservableCollection(); + + /// + /// 2号炒锅流程 + /// + public ObservableCollection ProcessModel2 + { + get { return _ProcessModel2; } + set + { + _ProcessModel2 = value; + OnPropertyChanged(); + } + } + private ObservableCollection _ProcessModel2 = new ObservableCollection(); + /// /// 当前刷新数据类型 /// @@ -50,6 +80,11 @@ namespace BPASmartClient.ScreenLib ScreenModelMaxWok modelMaxWok= Main.GetInstance.mqttDatasDic[type] as ScreenModelMaxWok; if(modelMaxWok != null && modelMaxWok.Alarm!=null) modelMaxWok.Alarm= modelMaxWok.Alarm?.OrderByDescending(k =>DateTime.Parse(k.AlarmTime)).ToList(); + + ProcessModel1=JsonConvert.DeserializeObject>(JsonConvert.SerializeObject(modelMaxWok.MaxWok_Process_1)); + ProcessModel2 = JsonConvert.DeserializeObject>(JsonConvert.SerializeObject(modelMaxWok.MaxWok_Process_2)); + ProcessModel1?.ToList().ForEach(par => { if (par.Id+1 == ProcessModel1.Count) { par.IsLast = 1; } else { par.IsLast = 0; } }); + ProcessModel2?.ToList().ForEach(par => { if (par.Id+1 == ProcessModel2.Count) { par.IsLast = 1; } else { par.IsLast = 0; } }); ViewData = modelMaxWok; } })); @@ -57,4 +92,16 @@ namespace BPASmartClient.ScreenLib }), $"{DateTime.Now},线程服务"); } } + + /// + /// 是否最后 + /// + public class ProcessModelForm: ProcessModel + { + public int IsLast + { + get; + set; + } + } } diff --git a/BPASmartClient.ScreenLib/炒锅/ScreenMinWokControl.xaml b/BPASmartClient.ScreenLib/炒锅/ScreenMinWokControl.xaml index 08f2522f..591790d0 100644 --- a/BPASmartClient.ScreenLib/炒锅/ScreenMinWokControl.xaml +++ b/BPASmartClient.ScreenLib/炒锅/ScreenMinWokControl.xaml @@ -78,7 +78,7 @@ @@ -97,12 +97,19 @@ + + + + + + + @@ -117,11 +124,13 @@ + + @@ -129,17 +138,17 @@ + - - + @@ -273,7 +282,7 @@ @@ -292,12 +301,19 @@ + + + + + + + @@ -312,11 +328,13 @@ + + @@ -324,11 +342,12 @@ + - + diff --git a/BPASmartClient.ScreenLib/炒锅/ScreenMinWokControlViewModel.cs b/BPASmartClient.ScreenLib/炒锅/ScreenMinWokControlViewModel.cs index 4500b69a..18329714 100644 --- a/BPASmartClient.ScreenLib/炒锅/ScreenMinWokControlViewModel.cs +++ b/BPASmartClient.ScreenLib/炒锅/ScreenMinWokControlViewModel.cs @@ -1,6 +1,7 @@ using BPA.Helper; using BPA.Message; using BPA.Message.Enum; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -19,6 +20,7 @@ namespace BPASmartClient.ScreenLib /// public Uri GgAdder { get { return _GgAdder; } set { _GgAdder = value; OnPropertyChanged(); } } private Uri _GgAdder = new Uri(System.Configuration.ConfigurationManager.AppSettings["GgAdder"].ToString()); + /// /// 界面数据绑定 /// @@ -32,7 +34,34 @@ namespace BPASmartClient.ScreenLib } } private ScreenModelMinWok _ViewData = new ScreenModelMinWok(); + + /// + /// 1号炒锅流程 + /// + public ObservableCollection ProcessModel1 + { + get { return _ProcessModel1; } + set + { + _ProcessModel1 = value; + OnPropertyChanged(); + } + } + private ObservableCollection _ProcessModel1 = new ObservableCollection(); + /// + /// 2号炒锅流程 + /// + public ObservableCollection ProcessModel2 + { + get { return _ProcessModel2; } + set + { + _ProcessModel2 = value; + OnPropertyChanged(); + } + } + private ObservableCollection _ProcessModel2 = new ObservableCollection(); /// /// 当前刷新数据类型 /// @@ -50,6 +79,10 @@ namespace BPASmartClient.ScreenLib ScreenModelMinWok modelMaxWok = Main.GetInstance.mqttDatasDic[type] as ScreenModelMinWok; if (modelMaxWok != null && modelMaxWok.Alarm != null) modelMaxWok.Alarm = modelMaxWok.Alarm?.OrderByDescending(k => DateTime.Parse(k.AlarmTime)).ToList(); + ProcessModel1 = JsonConvert.DeserializeObject>(JsonConvert.SerializeObject(modelMaxWok.MinWok_Process_1)); + ProcessModel2 = JsonConvert.DeserializeObject>(JsonConvert.SerializeObject(modelMaxWok.MinWok_Process_2)); + ProcessModel1?.ToList().ForEach(par => { if (par.Id + 1 == ProcessModel1.Count) { par.IsLast = 1; } else { par.IsLast = 0; } }); + ProcessModel2?.ToList().ForEach(par => { if (par.Id + 1 == ProcessModel2.Count) { par.IsLast = 1; } else { par.IsLast = 0; } }); ViewData = modelMaxWok; } })); diff --git a/BPASmartClient.ScreenLib/煮面机/ScreenMorksControl.xaml b/BPASmartClient.ScreenLib/煮面机/ScreenMorksControl.xaml index d5951f16..7c3f0e90 100644 --- a/BPASmartClient.ScreenLib/煮面机/ScreenMorksControl.xaml +++ b/BPASmartClient.ScreenLib/煮面机/ScreenMorksControl.xaml @@ -194,11 +194,11 @@ @@ -211,11 +211,11 @@ @@ -235,11 +235,11 @@ @@ -252,11 +252,11 @@ @@ -276,11 +276,11 @@ @@ -293,11 +293,11 @@ @@ -323,7 +323,7 @@ - + @@ -332,49 +332,51 @@ 温度状态 - - 料仓位置 - - - - - - - - - - 料仓物料检测 + 缺碗检测 + + + + + + + + + + + + + 料仓位置 - 落碗机构缺碗检测 + 料仓物料检测