From bed12edef27367e7ad050cba6074945c9bf95490 Mon Sep 17 00:00:00 2001 From: NXX <447201003@qq> Date: Fri, 18 Nov 2022 17:12:04 +0800 Subject: [PATCH] morkBF --- .../BPASmartClient.Business.csproj | 2 +- .../BPASmartClient.CustomResource.csproj | 2 +- .../BPASmartClient.Device.csproj | 2 +- .../BPASmartClient.JXJFoodSmallStation.csproj | 2 +- .../BPASmartClient.Model.csproj | 2 +- BPASmartClient.MorkBF/Control_MorkBF.cs | 63 ++++++++++++++++++- BPASmartClient.MorkBF/GVL_MorkBF.cs | 1 + BPASmartClient.MorkBF/Model/DataReport.cs | 49 +++++++++++++++ .../BPASmartClient.MorkF.csproj | 2 +- .../BPASmartClient.MorkS.csproj | 4 +- .../BPASmartClient.MorkTHQ.csproj | 2 +- .../BPASmartClient.DosingSystem.csproj | 2 +- 12 files changed, 120 insertions(+), 13 deletions(-) create mode 100644 BPASmartClient.MorkBF/Model/DataReport.cs diff --git a/BPASmartClient.Business/BPASmartClient.Business.csproj b/BPASmartClient.Business/BPASmartClient.Business.csproj index 7e88a063..39f36251 100644 --- a/BPASmartClient.Business/BPASmartClient.Business.csproj +++ b/BPASmartClient.Business/BPASmartClient.Business.csproj @@ -9,7 +9,7 @@ - + diff --git a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj index 874b83ef..68a96d9a 100644 --- a/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj +++ b/BPASmartClient.CustomResource/BPASmartClient.CustomResource.csproj @@ -410,7 +410,7 @@ - + diff --git a/BPASmartClient.Device/BPASmartClient.Device.csproj b/BPASmartClient.Device/BPASmartClient.Device.csproj index 456f5bbb..34e40440 100644 --- a/BPASmartClient.Device/BPASmartClient.Device.csproj +++ b/BPASmartClient.Device/BPASmartClient.Device.csproj @@ -7,7 +7,7 @@ - + diff --git a/BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj b/BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj index cdb1d4f7..fc69dd26 100644 --- a/BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj +++ b/BPASmartClient.JXJFoodSmallStation/BPASmartClient.JXJFoodSmallStation.csproj @@ -8,7 +8,7 @@ - + diff --git a/BPASmartClient.Model/BPASmartClient.Model.csproj b/BPASmartClient.Model/BPASmartClient.Model.csproj index 6237674c..5c60f04d 100644 --- a/BPASmartClient.Model/BPASmartClient.Model.csproj +++ b/BPASmartClient.Model/BPASmartClient.Model.csproj @@ -17,7 +17,7 @@ - + diff --git a/BPASmartClient.MorkBF/Control_MorkBF.cs b/BPASmartClient.MorkBF/Control_MorkBF.cs index 0cee5160..16ecee41 100644 --- a/BPASmartClient.MorkBF/Control_MorkBF.cs +++ b/BPASmartClient.MorkBF/Control_MorkBF.cs @@ -23,6 +23,7 @@ namespace BPASmartClient.MorkBF public class Control_MorkBF : BaseDevice { GVL_MorkBF morkBF = new GVL_MorkBF(); + DataReport dataReport = new DataReport(); public override DeviceClientType DeviceType => DeviceClientType.MORKCS; @@ -549,6 +550,23 @@ namespace BPASmartClient.MorkBF } }), 1); + GetStatus("VW2250", new Action((o) => + { + if (o == null) return; + if (o is int[] values && values.Length == 1) + { + dataReport.FirePot1_PotState = values[0]; + } + }), 1); + GetStatus("VW2350", new Action((o) => + { + if (o == null) return; + if (o is int[] values && values.Length == 1) + { + dataReport.FirePot2_PotState = values[0]; + } + }), 1); + } public override void ResetProgram() @@ -1104,9 +1122,10 @@ namespace BPASmartClient.MorkBF StatsCount = statsModels, MaxWok_Dishes_1 = "满汉全席", MaxWok_Dishes_2 = "海鲜大餐", - MaxWok_Task_1 = "无", - MaxWok_Task_2 = "无", - MaxWok_Process_1 = new List(), + MaxWok_Task_1 = ((PotState)dataReport.FirePot1_PotState).ToString(), + MaxWok_Task_2 = ((PotState)dataReport.FirePot2_PotState).ToString(), + MaxWok_Process_1 = SetFirePotPorcess(new Random().Next(0,6)), + MaxWok_Process_2 = SetFirePotPorcess(dataReport.FirePot2_PotState), MaxWok_HeatGear_1 = morkBF.FirePot1_FireGear.ToString(), MaxWok_HeatGear_2 = morkBF.FirePot2_FireGear.ToString(), MaxWok_StirGear_1 = morkBF.FirePot1_StirGear.ToString(), @@ -1127,5 +1146,43 @@ namespace BPASmartClient.MorkBF }), "大屏数据上报"); } + + private List SetFirePotPorcess(int potState) + { + + if (potState > 0) + { + if(potState <=3) + { + SetState(2); + } + else if(potState>3&&potState < 9) SetState(3); + else if(potState == 9) SetState(4); + else if (potState == 10) SetState(5); + } + else + { + foreach(var item in dataReport.processModels) + { + item.Status = ProcessStatus.未执行; + } + } + return dataReport.processModels; + + + } + + public void SetState(int c ) + { + for (int i = 0; i < dataReport.processModels.Count; i++) + { + if (i == c - 1) + { + dataReport.processModels[i].Status = ProcessStatus.正在执行; + } + else if( i c - 1) dataReport.processModels[i].Status = ProcessStatus.未执行; + } + } } } diff --git a/BPASmartClient.MorkBF/GVL_MorkBF.cs b/BPASmartClient.MorkBF/GVL_MorkBF.cs index e3a4d48c..54762ca4 100644 --- a/BPASmartClient.MorkBF/GVL_MorkBF.cs +++ b/BPASmartClient.MorkBF/GVL_MorkBF.cs @@ -388,3 +388,4 @@ namespace BPASmartClient.MorkBF public DateTime FirePan2_Date; } } +#endregion \ No newline at end of file diff --git a/BPASmartClient.MorkBF/Model/DataReport.cs b/BPASmartClient.MorkBF/Model/DataReport.cs new file mode 100644 index 00000000..61852698 --- /dev/null +++ b/BPASmartClient.MorkBF/Model/DataReport.cs @@ -0,0 +1,49 @@ +using BPA.Message; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.MorkBF.Model +{ + public class DataReport + { + /// + /// 炒锅1工艺状态 + /// + public int FirePot1_PotState { get; set; } = 0; + /// + /// 炒锅2工艺状态 + /// + public int FirePot2_PotState { get; set; } = 0; + + public List processModels = new List(); + + public DataReport() + { + processModels.Add( new ProcessModel() { Id = 1, Name = "开始制作", Status = ProcessStatus.未执行 }); + processModels.Add(new ProcessModel() { Id = 2, Name = "热油", Status = ProcessStatus.未执行 }); + processModels.Add(new ProcessModel() { Id = 3, Name = "炒制中", Status = ProcessStatus.未执行 }); + processModels.Add(new ProcessModel() { Id = 4, Name = "制作完成", Status = ProcessStatus.未执行 }); + processModels.Add(new ProcessModel() { Id = 5, Name = "出餐完成", Status = ProcessStatus.未执行 }); + + } + + } + + public enum PotState + { + 无任务=0, + 炒锅预热中 =1, + 开始抽油=2, + 油预热中=3, + 荤菜炒制中 =4, + 调料炒制中=5, + 素菜炒制中=6, + 辅料炒制中=7, + 关火焖制中=8, + 炒制完成=9, + 出餐完成=10, + } +} diff --git a/BPASmartClient.MorkF/BPASmartClient.MorkF.csproj b/BPASmartClient.MorkF/BPASmartClient.MorkF.csproj index ea0b7fa5..2984a36c 100644 --- a/BPASmartClient.MorkF/BPASmartClient.MorkF.csproj +++ b/BPASmartClient.MorkF/BPASmartClient.MorkF.csproj @@ -10,7 +10,7 @@ - + diff --git a/BPASmartClient.MorkS/BPASmartClient.MorkS.csproj b/BPASmartClient.MorkS/BPASmartClient.MorkS.csproj index 12a32132..29579c01 100644 --- a/BPASmartClient.MorkS/BPASmartClient.MorkS.csproj +++ b/BPASmartClient.MorkS/BPASmartClient.MorkS.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/BPASmartClient.MorkT_HQ/BPASmartClient.MorkTHQ.csproj b/BPASmartClient.MorkT_HQ/BPASmartClient.MorkTHQ.csproj index e311fa43..59beb016 100644 --- a/BPASmartClient.MorkT_HQ/BPASmartClient.MorkTHQ.csproj +++ b/BPASmartClient.MorkT_HQ/BPASmartClient.MorkTHQ.csproj @@ -9,7 +9,7 @@ - + diff --git a/DosingSystem/BPASmartClient.DosingSystem.csproj b/DosingSystem/BPASmartClient.DosingSystem.csproj index 1227607a..eed6b381 100644 --- a/DosingSystem/BPASmartClient.DosingSystem.csproj +++ b/DosingSystem/BPASmartClient.DosingSystem.csproj @@ -22,7 +22,7 @@ - +