INT89DB_26/INT89DB_26/InModbus/Modbus_30000_LaneData.cs

164 lines
4.1 KiB
C#

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
namespace INT89DB_26.Int_Modbus
{
public class Modbus_30000_LaneData
{
#region Field
private ushort m_Update;
private ushort m_Grade;
private double m_Weight;
private UInt32 m_UnderCount;
private UInt32 m_PassCount;
private UInt32 m_OverCount;
private UInt32 m_ExNGCount;
#endregion
#region Constructor
public Modbus_30000_LaneData()
{
this.Initialization();
}
#endregion
#region Property
public ushort Update
{
get { return this.m_Update; }
set { this.m_Update = value; }
}
public ushort Grade
{
get { return this.m_Grade; }
set { this.m_Grade = value; }
}
public double Weight
{
get { return this.m_Weight; }
set { this.m_Weight = value; }
}
public UInt32 UnderCount
{
get { return this.m_UnderCount; }
set { this.m_UnderCount = value; }
}
public UInt32 PassCount
{
get { return this.m_PassCount; }
set { this.m_PassCount = value; }
}
public UInt32 OverCount
{
get { return this.m_OverCount; }
set { this.m_OverCount = value; }
}
public UInt32 ExNGCount
{
get { return this.m_ExNGCount; }
set { this.m_ExNGCount = value; }
}
public UInt32 NGCount
{
get { return this.m_UnderCount + this.m_OverCount + this.m_ExNGCount; }
}
public UInt32 TotalCount
{
get { return this.m_UnderCount + this.m_PassCount + this.m_OverCount + this.m_ExNGCount; }
}
public string HexStringUpdate
{
get
{
string hexString = this.Update.ToString("X8");
return hexString;
}
}
public string HexStringGrade
{
get
{
string hexString = this.Grade.ToString("X8");
return hexString;
}
}
public string HexStringWeight
{
get
{
byte[] bytes = BitConverter.GetBytes((float)this.Weight);
Array.Reverse(bytes);
string hexString = BitConverter.ToString(bytes);
hexString = hexString.Replace("-", "");
return hexString;
}
}
public string HexStringUnderCount
{
get
{
string hexString = this.UnderCount.ToString("X8");
return hexString;
}
}
public string HexStringPassCount
{
get
{
string hexString = this.PassCount.ToString("X8");
return hexString;
}
}
public string HexStringOverCount
{
get
{
string hexString = this.OverCount.ToString("X8");
return hexString;
}
}
public string HexStringExNGCount
{
get
{
string hexString = this.ExNGCount.ToString("X8");
return hexString;
}
}
public string HexStringNGCount
{
get
{
string hexString = this.NGCount.ToString("X8");
return hexString;
}
}
public string HexStringTotalCount
{
get
{
string hexString = this.TotalCount.ToString("X8");
return hexString;
}
}
#endregion
#region Method
public void Initialization()
{
this.Update = 0;
this.Grade = 0;
this.Weight = 0.0;
this.UnderCount = 0;
this.PassCount = 0;
this.OverCount = 0;
this.ExNGCount = 0;
}
#endregion
}
}