OBDItem OBDItemCopy(OBDItem source)
{
OBDItem item = new OBDItem();
var members = AssemblyHelper.GetMembers(typeof(OBDItem), System.Reflection.MemberTypes.Field);
foreach (var member in members)
{
System.Reflection.FieldInfo field = (System.Reflection.FieldInfo)member;
Object fieldValue = field.GetValue(source);
field.SetValue(item, fieldValue);
}
return item;
}
public class OBDItem
{
public DateTime 时间;
public string 终端编号;
/// <summary>
/// 单位:rpm
/// </summary>
public int 转速;
public double 扭矩;
public double 蓄电池电压;
public double 发动机机油温度;
public double 发动机燃油温度;
/// <summary>
/// 单位:℃
/// </summary>
public double 发动机冷却剂温度;
public int 机油压力;
}