xm
2021-12-01 6d73bf6e816570291865674bef8bce8972e4de3f
HDL_ON/Entity/Function/Fan.cs
old mode 100755 new mode 100644
@@ -3,61 +3,12 @@
namespace HDL_ON.Entity
{
    public class Fan : Function
    public class Fan
    {
        public Fan()
        {
        }
        [Newtonsoft.Json.JsonIgnore]
        public FunctionAttributes trait_openLevel;
        /// <summary>
        /// 档位
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public int openLevel
        {
            get
            {
                try
                {
                    if (trait_openLevel == null)
                    {
                        trait_openLevel = attributes.Find((obj) => obj.key == "openLevel");
                        if (trait_openLevel == null)
                        {
                            trait_openLevel = new FunctionAttributes()
                            {
                                key = "openLevel",
                                value = new List<string> { "up", "down" },
                                max = 7,
                                min = 0,
                                curValue = 0
                            };
                        }
                        if (trait_openLevel.curValue.ToString() == "{}")
                            trait_openLevel.curValue = 0;
                    }
                    return Convert.ToInt32(trait_openLevel.curValue);
                }
                catch
                {
                    MainPage.Log("openLevel 数据获取失败.");
                    return 0;
                }
            }
            set
            {
                try
                {
                    trait_openLevel.curValue = value;
                }
                catch
                {
                    MainPage.Log("openLevel 数据刷新失败.");
                }
            }
        }
    }
}