using DataBlockHelper.Entity.DB2102Entity; using DataBlockHelper.Entity.DB2119Entity; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DataBlockHelper.DBHelpers { public class DB2119Helper : DBHelper { public DB2119Helper() { bytes = PlcConnect.Instance.Read("DB2119.0.0", 14).Content; var a=bytes.First(); VesselA = a.GetBit(0); VesselB = a.GetBit(1); VesselC = a.GetBit(2); VesselD = a.GetBit(3); VesselE = a.GetBit(4); PD3 = PlcConnect.Instance.ByteTransform.TransSingle(bytes, 2); PD3 = PlcConnect.Instance.ByteTransform.TransSingle(bytes, 6); a= bytes.Skip(10).Take(1).First(); PD3Alarm=a.GetBit(0); HR3Alarm=a.GetBit(1); Finish1 = a.GetBit(2); Finish2 = a.GetBit(3); Finish3 = a.GetBit(4); Finish4 = a.GetBit(5); Finish5 = a.GetBit(6); Finish6 = a.GetBit(7); a = bytes.Skip(11).Take(1).First(); Finish7 = a.GetBit(0); Finish8 = a.GetBit(1); RP2PcA = a.GetBit(2); RP2PcB=a.GetBit(3); RP2PcC=a.GetBit(4); RP2PcD=a.GetBit(5); } public bool VesselA { get; set; } public bool VesselB { get; set; } public bool VesselC { get; set; } public bool VesselD { get; set; } public bool VesselE { get; set; } public float PD3 { get; set; } public float HR3 { get; set; } public bool PD3Alarm { get; set; } public bool HR3Alarm { get; set; } public bool Finish1 { get; set; } public bool Finish2 { get; set; } public bool Finish3 { get; set; } public bool Finish4 { get; set; } public bool Finish5 { get; set; } public bool Finish6{ get; set; } public bool Finish7 { get; set; } public bool Finish8 { get; set; } public bool RP2PcA { get; set; } public bool RP2PcB { get; set; } public bool RP2PcC { get; set; } public bool RP2PcD { get; set; } } }