| | |
| | | |
| | | 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 数据刷新失败."); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |