|
|
|
|
namespace WorkerSynReport.Plc;
|
|
|
|
|
|
|
|
|
|
public class WetMixingEntity
|
|
|
|
|
{
|
|
|
|
|
private int StartSet;
|
|
|
|
|
private byte[] bytes;
|
|
|
|
|
public WetMixingEntity(int startSet, byte[] bytes)
|
|
|
|
|
{
|
|
|
|
|
this.StartSet = startSet;
|
|
|
|
|
this.bytes = bytes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Report_WMixE> WetMixing_A => new WetReportArrayManager(10, StartSet, 26, bytes).GetList();
|
|
|
|
|
public List<Report_WMixE> WetMixing_B => new WetReportArrayManager(10, StartSet + 260, 26, bytes).GetList();
|
|
|
|
|
public List<Report_WMixE> WetMixing_C => new WetReportArrayManager(10, StartSet + 520, 26, bytes).GetList();
|
|
|
|
|
public List<Report_WMixE> WetMixing_D => new WetReportArrayManager(10, StartSet + 780, 26, bytes).GetList();
|
|
|
|
|
public List<Report_WMixE> WetMixing_E => new WetReportArrayManager(10, StartSet + 1040, 26, bytes).GetList();
|
|
|
|
|
public List<Report_WMixE> WetMixing_F => new WetReportArrayManager(10, StartSet + 1300, 26, bytes).GetList();
|
|
|
|
|
public List<Report_WMixE> WetMixing_G => new WetReportArrayManager(10, StartSet + 1560, 26, bytes).GetList();
|
|
|
|
|
public List<Report_WMixE> WetMixing_H => new WetReportArrayManager(10, StartSet + 1820, 26, bytes).GetList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class Report_WMixE
|
|
|
|
|
{
|
|
|
|
|
public Report_WMixE(byte[] content)
|
|
|
|
|
{
|
|
|
|
|
EqNo = PlcConnect.Instance.ByteTransform.TransInt16(content, 0);
|
|
|
|
|
MixBatch = PlcConnect.Instance.ByteTransform.TransInt16(content, 2);
|
|
|
|
|
MixStep = PlcConnect.Instance.ByteTransform.TransInt16(content, 4);
|
|
|
|
|
ActCode = PlcConnect.Instance.ByteTransform.TransInt16(content, 6);
|
|
|
|
|
MixTime = PlcConnect.Instance.ByteTransform.TransInt16(content, 8);
|
|
|
|
|
MixTemp = PlcConnect.Instance.ByteTransform.TransSingle(content, 10);
|
|
|
|
|
MixSpeed = PlcConnect.Instance.ByteTransform.TransSingle(content, 14);
|
|
|
|
|
ActWeight = PlcConnect.Instance.ByteTransform.TransSingle(content, 18);
|
|
|
|
|
ActTolerence = PlcConnect.Instance.ByteTransform.TransSingle(content, 22);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public short EqNo { get; private set; }
|
|
|
|
|
public short MixBatch { get; private set; }
|
|
|
|
|
public short MixStep { get; private set; }
|
|
|
|
|
public short ActCode { get; private set; }
|
|
|
|
|
public short MixTime { get; private set; }
|
|
|
|
|
public float MixTemp { get; private set; }
|
|
|
|
|
public float MixSpeed { get; private set; }
|
|
|
|
|
public float ActWeight { get; private set; }
|
|
|
|
|
public float ActTolerence { get; private set; }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class WetReportArrayManager
|
|
|
|
|
{
|
|
|
|
|
private int Length;
|
|
|
|
|
private int StartSet;
|
|
|
|
|
private int SLength;
|
|
|
|
|
private byte[] Bytes;
|
|
|
|
|
|
|
|
|
|
public WetReportArrayManager(ushort length, int startSet, int sLength, byte[] bytes)
|
|
|
|
|
{
|
|
|
|
|
Length = length;
|
|
|
|
|
StartSet = startSet;
|
|
|
|
|
SLength = sLength;
|
|
|
|
|
Bytes = bytes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Report_WMixE> GetList()
|
|
|
|
|
{
|
|
|
|
|
List<Report_WMixE> ListE = new List<Report_WMixE>(Length);
|
|
|
|
|
//var getListE = PlcConnect.Instance.Read("DB2106." + StartSet + ".0", Convert.ToUInt16(Length * SLength));
|
|
|
|
|
var content = Bytes.Skip(StartSet).Take(Length * SLength).ToArray();
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < Length; i++)
|
|
|
|
|
{
|
|
|
|
|
var singleBlock = content.Skip(SLength * i).Take(SLength).ToArray();
|
|
|
|
|
ListE.Add(new Report_WMixE(singleBlock));
|
|
|
|
|
}
|
|
|
|
|
return ListE;
|
|
|
|
|
}
|
|
|
|
|
}
|