2106 报表

dep
我叫锄头 11 months ago
parent f6c30743da
commit 9a0faaf3de

@ -289,6 +289,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
Timer1_Tick();
try
{
ReportReadDb.ReadReport();
if (UserJudge.IsNormalUser())
{
ReportReadDb.ReadReport();

@ -149,6 +149,9 @@ namespace Mesnac.Action.ChemicalWeighing.Report
public static void ReadReport()
{
DB2107Helper dB2107Helper = new DB2107Helper();
NormalStatusEntity normal = dB2107Helper.NormalStatus;
if (normal.RdyRpt_D1)

@ -12,10 +12,10 @@ namespace DataBlockHelper.DBHelpers
{
public DB2106Helper()
{
this.bytes = PlcConnect.Instance.Read("DB2106.0.0", 5648).Content;
this.bytes = PlcConnect.Instance.Read("DB2106.0.0", 6440).Content;
}
public DryerReportEntity DryReport => new DryerReportEntity(0, bytes);
public GelReportEntity GelReport => new GelReportEntity(1072, bytes);
public WetMixingEntity WetReport => new WetMixingEntity(3568, bytes);
public DryerReportEntity DryReport => new DryerReportEntity(bytes);
public GelReportEntity GelReport => new GelReportEntity(1864, bytes);
public WetMixingEntity WetReport => new WetMixingEntity(4360, bytes);
}
}

@ -11,31 +11,63 @@ namespace DataBlockHelper.Entity.DB2106Entity
{
public class DryerReportEntity
{
private int StartSet;
byte[] Bytes;
public DryerReportEntity(int startSet, byte[] bytes)
public DryerReportEntity( byte[] bytes)
{
this.StartSet = startSet;
this.Bytes = bytes;
}
public Dryer_ Dryer_A => new Dryer_(StartSet, Bytes);
public Dryer_ Dryer_B => new Dryer_(StartSet + 268, Bytes);
public Dryer_ Dryer_C => new Dryer_(StartSet + 536, Bytes);
public Dryer_ Dryer_D => new Dryer_(StartSet + 804, Bytes);
public Dryer_ Dryer_A => new Dryer_(0, Bytes);
public Dryer_ Dryer_B => new Dryer_(466, Bytes);
public Dryer_ Dryer_C => new Dryer_(932, Bytes);
public Dryer_ Dryer_D => new Dryer_(1398, Bytes);
}
public class Dryer_
{
private int StartSet;
private byte[] Bytes;
public Dryer_(int startSet, byte[] bytes)
int start;
public Dryer_(int start, byte[] bytes)
{
this.StartSet = startSet;
this.start = start;
this.Bytes = bytes;
}
public List<Report_DosE> Dos => new ReportArrayManager(4, StartSet, 22, Bytes).GetReport_DosEList();
public List<Report_MixE> Mix => new ReportArrayManager(10, StartSet + 88, 18, Bytes).GetReport_MixEList();
public List<Report_DosE> Dos
{
get
{
List<Report_DosE> ListE = new List<Report_DosE>();
var content = Bytes.Skip(start).Take(286).ToArray();
for (int i = 0; i < 13; i++)
{
var singleBlock = content.Skip(i*22).Take(22).ToArray();
ListE.Add(new Report_DosE(singleBlock));
}
return ListE;
}
}
public List<Report_MixE> Mix
{
get
{
List<Report_MixE> ListE = new List<Report_MixE>();
var content = Bytes.Skip(start).Take(180).ToArray();
for (int i = 0; i < 10; i++)
{
var singleBlock = content.Skip(i * 18).Take(18).ToArray();
ListE.Add(new Report_MixE(singleBlock));
}
return ListE;
}
}
}
public class Report_DosE
@ -65,6 +97,8 @@ namespace DataBlockHelper.Entity.DB2106Entity
ActToler = PlcConnect.Instance.ByteTransform.TransSingle(content, 18);
}
public short EqNo { get; private set; }
public short Batch { get; private set; }
public short MatCode { get; private set; }
@ -114,7 +148,7 @@ namespace DataBlockHelper.Entity.DB2106Entity
public List<Report_MixE> GetReport_MixEList()
{
List<Report_MixE> ListE = new List<Report_MixE>(Length);
List<Report_MixE> ListE = new List<Report_MixE>();
//var getListE = PlcConnect.Instance.Read("DB2106." + StartSet + ".0", Convert.ToUInt16(Length * SLength));
var content = Bytes.Skip(StartSet).Take(Length * SLength).ToArray();

Loading…
Cancel
Save