wxr
2020-04-14 06696e6f225733a60b03eea4a7c6374053d92c1d
HDL_ON/Entity/Function/Function.cs
@@ -19,7 +19,7 @@
        /// <summary>
        /// 属性的值
        /// </summary>
        public string value;
        public List<string> value;
        /// <summary>
        /// 最大值
        /// </summary>
@@ -108,8 +108,16 @@
        {
            get
            {
                var _functionCategoryString = sid.Substring(22, 2);
                try
                {
                    var _functionCategoryString = sid.Substring(24, 2);
                return (FunctionCategory)Enum.ToObject(typeof(FunctionCategory), Convert.ToInt32(_functionCategoryString));
                }
                catch (Exception ex)
                {
                    MainPage.Log($"get FunctionCategory error : {ex.Message}");
                    return FunctionCategory.UnKown;
                }
            }
        }
@@ -135,7 +143,7 @@
            {
                string vendorCode = "HDL";
                var code = sid.Substring(0, 4);
                if (code == "00001")
                if (code == "0001")
                    vendorCode = "HDL";
                return vendorCode;
            }
@@ -196,7 +204,12 @@
        /// <summary>
        /// 使用频率
        /// </summary>
        public double usageFrequency = 0;
        public double usageFrequency {
            get
            {
                return usageCount / 7;
            }
        }
        /// <summary>
        /// 固定的序号
        /// </summary>
@@ -213,12 +226,16 @@
                {
                    if (trait == null)
                        return new List<string>();
                    var proArr = trait.Split(',').ToList();
                    foreach (var pro in proArr)
                    var proArr = new List<string>();
                    foreach (var pro in trait)
                    {
                        if (!dicPropert.ContainsKey(pro))
                        if (!dicPropert.ContainsKey(pro.attri))
                        {
                            dicPropert.TryAdd(pro, "0");
                            dicPropert.TryAdd(pro.attri, "0");
                        }
                        if (!proArr.Contains(pro.attri))
                        {
                            proArr.Add(pro.attri);
                        }
                    }
                    return proArr;
@@ -236,9 +253,9 @@
        /// </summary>
        /// <param name="command">控制命令:write,read</param>
        /// <returns></returns>
        public virtual JObject GetSendJObject(string command)
        public virtual JObject GetSendJObject(CommandType_A command)
        {
            var sendJob = new JObject { { "vendor_code", vendor_code }, { "Command", command }, { "Type", "device" }, };
            var sendJob = new JObject { { "vendor_code", vendor_code }, { "Command", command.ToString() }, { "Type", "device" }, };
            var data = new JObject { { "sid", sid } };
            sendJob.Add("objects", data);
            return sendJob;
@@ -272,5 +289,11 @@
            }
            return roomNameList;
        }
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime refreshTime = DateTime.MinValue;
    }
}