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