From b318a0d47ab51711b359074584495d28bae4dca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Wed, 27 Dec 2023 10:54:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=8A=E5=8C=96=E6=9C=BA=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=89=8B=E5=8A=A8=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entity/HslControlsEntity.cs | 12 ++++++ .../MainDetailControlAction.cs | 10 +++++ .../Util/ControlsImprot.cs | 17 ++++++++ DataBlockHelper/DBHelpers/DB2105Helper.cs | 15 +++++++ .../Data/MCProject/nodeForm/MainDetail.xml | 40 +++++++++++++++++++ 5 files changed, 94 insertions(+) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/Entity/HslControlsEntity.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/Entity/HslControlsEntity.cs index 5157769..6006700 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/Entity/HslControlsEntity.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/Entity/HslControlsEntity.cs @@ -115,6 +115,18 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl.Entity public HslLanternSimple FeededPDG8 { get; set; } + public HslLanternSimple FeededCW1 { get; set; } + public HslLanternSimple FeededCW2 { get; set; } + public HslLanternSimple FeededCW3 { get; set; } + public HslLanternSimple FeededCW4 { get; set; } + public HslLanternSimple FeededCW5 { get; set; } + public HslLanternSimple FeededCW6 { get; set; } + public HslLanternSimple FeededCW7 { get; set; } + public HslLanternSimple FeededCW8 { get; set; } + + + + } public class HslSwitchEntity diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs index 4ad9948..55f86f3 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs @@ -42,6 +42,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl private DB2103Helper DB2103 = new DB2103Helper(); private DB2107Helper DB2107 = new DB2107Helper(); private DB2119Helper DB2119 = new DB2119Helper(); + private ConcurrentDictionary conCurrentCache = new ConcurrentDictionary(); private Timer timer; @@ -420,6 +421,15 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl ControlsHelper.SetHsl(HslLanternSimpleE.FeededPDG7, ch.G7); ControlsHelper.SetHsl(HslLanternSimpleE.FeededPDG8, ch.G8); + var db2105=new DB2105Helper(); + ControlsHelper.SetHslFeededCW1(HslLanternSimpleE.FeededCW1, db2105.FeededCW1); + ControlsHelper.SetHslFeededCW1(HslLanternSimpleE.FeededCW2, db2105.FeededCW2); + ControlsHelper.SetHslFeededCW1(HslLanternSimpleE.FeededCW3, db2105.FeededCW3); + ControlsHelper.SetHslFeededCW1(HslLanternSimpleE.FeededCW4, db2105.FeededCW4); + ControlsHelper.SetHslFeededCW1(HslLanternSimpleE.FeededCW5, db2105.FeededCW5); + ControlsHelper.SetHslFeededCW1(HslLanternSimpleE.FeededCW6, db2105.FeededCW6); + ControlsHelper.SetHslFeededCW1(HslLanternSimpleE.FeededCW7, db2105.FeededCW7); + ControlsHelper.SetHslFeededCW1(HslLanternSimpleE.FeededCW8, db2105.FeededCW8); ControlsHelper.SetHslLanternSimple(HslLanternSimpleE.HslLanternSimpleM1, MinAnPlc.ReqD1); diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/ControlsImprot.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/ControlsImprot.cs index 8d88cef..8028393 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/ControlsImprot.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Util/ControlsImprot.cs @@ -372,6 +372,23 @@ namespace Mesnac.Action.ChemicalWeighing.Util } } + //FeededCW1 + + + public static void SetHslFeededCW1(HslLanternSimple lanternSimple, bool su) + { + + if (su == true) + { + lanternSimple.LanternBackground = Color.Yellow; + } + else + { + + lanternSimple.LanternBackground = Color.LimeGreen; + } + } + /// /// 紫色胡工小灯 /// diff --git a/DataBlockHelper/DBHelpers/DB2105Helper.cs b/DataBlockHelper/DBHelpers/DB2105Helper.cs index 9c46bb2..c263c72 100644 --- a/DataBlockHelper/DBHelpers/DB2105Helper.cs +++ b/DataBlockHelper/DBHelpers/DB2105Helper.cs @@ -118,7 +118,15 @@ namespace DataBlockHelper.DBHelpers public bool FeededPdG8 => FeededPdG(108); + public bool FeededCW1 => FeededCW(94); + public bool FeededCW2 => FeededCW(96); + public bool FeededCW3 => FeededCW(98); + public bool FeededCW4 => FeededCW(100); + public bool FeededCW5 => FeededCW(102); + public bool FeededCW6 => FeededCW(104); + public bool FeededCW7 => FeededCW(106); + public bool FeededCW8 => FeededCW(108); public List ReadReadyG1 => ReadReady(94); @@ -218,6 +226,13 @@ namespace DataBlockHelper.DBHelpers return pd; } + public bool FeededCW(int start) + { + var first = bytes.Skip(start).Take(1).First(); + var pd = first.GetBit(7); + return pd; + } + public bool ReadReadyM(int start) { var first = bytes.Skip(start).Take(1).First(); diff --git a/Main/MCEdit/Data/MCProject/nodeForm/MainDetail.xml b/Main/MCEdit/Data/MCProject/nodeForm/MainDetail.xml index 310c028..216bbaf 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/MainDetail.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/MainDetail.xml @@ -1,6 +1,46 @@ + + 1858, 492 + FeededCW8 + 7, 7 + + + 1700, 492 + FeededCW7 + 7, 7 + + + 1545, 492 + FeededCW6 + 7, 7 + + + 1383, 491 + FeededCW5 + 7, 7 + + + 1308, 491 + FeededCW4 + 7, 7 + + + 1142, 491 + FeededCW3 + 7, 7 + + + 993, 491 + FeededCW2 + 7, 7 + + + 832, 491 + FeededCW1 + 7, 7 +