From c84878f3881ffe2479644d180d1811618afc6276 Mon Sep 17 00:00:00 2001 From: nodyang Date: Fri, 27 Oct 2023 16:22:37 +0800 Subject: [PATCH] =?UTF-8?q?2105=20=E5=87=86=E5=A4=87=E4=BF=A1=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Test/TestAction.cs | 25 ++++++-- DataBlockHelper/DBHelpers/DB2105Helper.cs | 60 +++++++++++++++++++ 2 files changed, 80 insertions(+), 5 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs index c153315..8b3411c 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs @@ -37,12 +37,27 @@ namespace Mesnac.Action.ChemicalWeighing.Test { - - - - - var yw= Db3000Helper.ReadModel(); + DB2105Helper db2105Helper = new DB2105Helper(); + var lis = db2105Helper.ReadReadyG1; + lis = db2105Helper.ReadReadyG2; + lis = db2105Helper.ReadReadyG3; + lis = db2105Helper.ReadReadyG4; + lis = db2105Helper.ReadReadyG5; + lis = db2105Helper.ReadReadyG6; + lis = db2105Helper.ReadReadyG7; + lis = db2105Helper.ReadReadyG8; + var liss = db2105Helper.ReadReadyM1; + liss = db2105Helper.ReadReadyM2; + liss = db2105Helper.ReadReadyM3; + liss = db2105Helper.ReadReadyM4; + liss = db2105Helper.ReadReadyM5; + liss = db2105Helper.ReadReadyM6; + liss = db2105Helper.ReadReadyM7; + liss = db2105Helper.ReadReadyM8; + + + var yw= Db3000Helper.ReadModel(); } diff --git a/DataBlockHelper/DBHelpers/DB2105Helper.cs b/DataBlockHelper/DBHelpers/DB2105Helper.cs index c64570d..e590fef 100644 --- a/DataBlockHelper/DBHelpers/DB2105Helper.cs +++ b/DataBlockHelper/DBHelpers/DB2105Helper.cs @@ -105,6 +105,66 @@ namespace DataBlockHelper.DBHelpers return ls; } } + + + public List ReadReadyG1 => ReadReady(94); + + public List ReadReadyG2 => ReadReady(96); + + public List ReadReadyG3 => ReadReady(98); + + public List ReadReadyG4 => ReadReady(100); + + public List ReadReadyG5 => ReadReady(102); + + + public List ReadReadyG6 => ReadReady(104); + + + public List ReadReadyG7 => ReadReady(106); + + public List ReadReadyG8 => ReadReady(108); + + + + public bool ReadReadyM1 => ReadReadyM(110); + + public bool ReadReadyM2 => ReadReadyM(112); + + public bool ReadReadyM3 => ReadReadyM(114); + + public bool ReadReadyM4 => ReadReadyM(116); + + + public bool ReadReadyM5 => ReadReadyM(118); + + public bool ReadReadyM6 => ReadReadyM(120); + + public bool ReadReadyM7 => ReadReadyM(122); + + public bool ReadReadyM8 => ReadReadyM(124); + + //94 + public List ReadReady(int start) + { + var first = bytes.Skip(start).Take(1).First(); + List ls = new List(3); + var pd = first.GetBit(3); + var cw = first.GetBit(4); + var hw = first.GetBit(5); + + ls.Add(pd); + ls.Add(cw); + ls.Add(hw); + return ls; + + } + + public bool ReadReadyM(int start) + { + var first = bytes.Skip(start).Take(1).First(); + return first.GetBit(1); + } }