using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
|
namespace HDL_ON
|
{
|
[System.Serializable]
|
public class Common
|
{
|
/// <summary>
|
/// 当前设备类型
|
/// </summary>
|
public DeviceType Type = DeviceType.UnKown;
|
|
public int DeviceTextID = -1;
|
|
/// <summary>
|
/// 备注
|
/// </summary>
|
public string Name;
|
|
public static readonly int Time = 1;
|
/// <summary>
|
/// 最近更新的时间
|
/// </summary>
|
public DateTime LastUpdateTime = System.DateTime.Now.AddMinutes (-Time);
|
|
public string GatewayMAC = "";
|
/// <summary>
|
/// 子网号
|
/// </summary>
|
public byte SubnetID;
|
|
/// <summary>
|
/// 设备号
|
/// </summary>
|
public byte DeviceID;
|
|
/// <summary>
|
/// 回路号
|
/// </summary>
|
public byte LoopID;
|
|
|
[Newtonsoft.Json.JsonIgnore]
|
public virtual string CommonLoopID {
|
get {
|
return SubnetID.ToString () + "_" + DeviceID.ToString () + "_" + LoopID.ToString ();
|
}
|
}
|
|
/// <summary>
|
/// 模块回来总数
|
/// </summary>
|
public byte LoopCount = 1;
|
|
/// <summary>
|
/// 临时参数
|
/// 默认为0,bus传过来时默认为1
|
/// </summary>
|
public byte obj1 = 0;
|
public byte obj2;
|
public byte obj3;
|
public byte obj4;
|
public byte obj5;
|
/// <summary>
|
/// 设备大类
|
/// </summary>
|
[Newtonsoft.Json.JsonIgnore]
|
public byte BigClass {
|
get {
|
return (byte)(((int)this.Type) / 256);
|
}
|
}
|
/// <summary>
|
/// 设备小类
|
/// </summary>
|
[Newtonsoft.Json.JsonIgnore]
|
public virtual byte MinClass {
|
get {
|
return (byte)(((int)this.Type) % 256);
|
}
|
}
|
|
/// <summary>
|
/// 是否为混合模块
|
/// </summary>
|
public bool isMixBox = false;
|
|
public DeviceType MixType = DeviceType.UnKown;
|
|
/// <summary>
|
/// 保存数据时的文件名
|
/// </summary>
|
public string SavePath = "";
|
|
/// <summary>
|
/// 设备MAC
|
/// </summary>
|
public string MAC = string.Empty;
|
|
}
|
}
|