wxr
2020-12-07 64dbbfe1d6488635e160189a704afccffc7d34d0
HDL_ON/Entity/Function/Function.cs
@@ -30,7 +30,7 @@
        public Function()
        {
        }
        #region base info
        /// <summary>
@@ -43,10 +43,10 @@
        /// 产品时间戳:4bytes   以2020年1月1日算出的时间戳0.1s为单位 
        /// 产品类别:01   调光器、02 继电器、03   干接点模块、04   传感器、05 面板
        /// 物模型类型:
      ///     01   开关类:01 开关、02 插座、03
      ///     02   照明: 01 开关、02   调光、03   色温、04   LED
        ///     01   开关类:01 开关、02 插座、03
        ///     02   照明: 01 开关、02   调光、03   色温、04   LED
        ///     03   遮阳: 01   窗帘电机、02 百叶窗、03 开合帘、04 卷帘
      ///     04   恒温器:01 空调、02 地暖、03 毛细空调
        ///     04   恒温器:01 空调、02 地暖、03 毛细空调
        ///     05   新风      
        ///     06   影音      
        ///     07   音乐      
@@ -125,6 +125,10 @@
        /// 是否收藏
        /// </summary>
        public bool collect = false;
        /// <summary>
        /// 是否在线
        /// </summary>
        public bool online = true;
        /// <summary>
        /// 云端数据创建的时间
        /// </summary>
@@ -230,7 +234,7 @@
        /// </summary>
        public int fixedSerialNumber = int.MaxValue;
        public string GetBusId ()
        public string GetBusId()
        {
            string busId = "";
            if (bus_Data != null)
@@ -247,7 +251,7 @@
        public string GetRoomListName()
        {
            string roomNameList = "";
            foreach(var roomId in roomIds)
            foreach (var roomId in roomIds)
            {
                var findRoom = DB_ResidenceData.residenceData.Rooms.Find(obj => obj.uid == roomId);
                if (findRoom == null)
@@ -283,7 +287,7 @@
        public void SaveFunctionData()
        {
            var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this));
            FileUtils.WriteFileByBytes( savePath, ssd);
            FileUtils.WriteFileByBytes(savePath, ssd);
            MainPage.Log($"Save FunctionData {this.functionType} : {this.sid}");
        }
@@ -319,7 +323,7 @@
            var acd = new AlinkControlData();
            acd.sid = sid;
            var aca = new AlinkControlAttributes();
            foreach(var dic in commandDictionary)
            foreach (var dic in commandDictionary)
            {
                aca.key = dic.Key;
                aca.value = dic.Value;
@@ -334,7 +338,7 @@
        /// 获取Api控制数据
        /// </summary>
        /// <returns></returns>
        public ApiAlinkControlActionObj GetApiControlData(Dictionary<string,string> keyValues)
        public ApiAlinkControlActionObj GetApiControlData(Dictionary<string, string> keyValues)
        {
            ApiAlinkControlActionObj aaao = new ApiAlinkControlActionObj();
            aaao.deviceId = this.deviceId;
@@ -368,6 +372,8 @@
        public string spk = "";
        public List<AlinkControlAttributes> attributes = new List<AlinkControlAttributes>();
        //[Newtonsoft.Json.JsonIgnore]
        public BusData bus = new BusData();
    }
    /// <summary>
@@ -380,6 +386,16 @@
        public string time_stamp = "";
        public string id = "";
    }
    /// <summary>
    /// 本地状态读取
    /// A协议状态读取格式对象
    /// </summary>
    public class GatewayAlinkReadObj
    {
        public string id = "0";
        public List<Dictionary<string, string>> objects = new List<Dictionary<string, string>>();
        public string time_stamp = "";
    }
    /// <summary>
    /// A协议控制数据
@@ -763,6 +779,7 @@
    public class BusData
    {
        public string addresses = "FFFF";
        [Newtonsoft.Json.JsonIgnore]
        public byte SubnetID
        {
            get
@@ -770,6 +787,7 @@
                return Convert.ToByte(addresses.Substring(0, 2), 16);
            }
        }
        [Newtonsoft.Json.JsonIgnore]
        public byte DeviceID
        {
            get