| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.Entity |
| | | { |
| | |
| | | |
| | | /// <summary> |
| | | /// 获取模式的icon路径 |
| | | /// <param name="lightingIcon">获取的图标类型,默认是点亮</param> |
| | | /// </summary> |
| | | public string GetModeImage(Function function) |
| | | public string GetModeIconPath(string modeValue, bool lighting = true) |
| | | { |
| | | var imagePath = "FunctionIcon/AC/HeatingIcon.png"; |
| | | var key = function.GetAttrState(FunctionAttributeKey.Mode); |
| | | switch (key) |
| | | //var key = function.GetAttrState(FunctionAttributeKey.Mode); |
| | | if (lighting) |
| | | { |
| | | case "day": |
| | | imagePath = "FunctionIcon/AC/HeatingIcon.png"; |
| | | break; |
| | | case "night": |
| | | imagePath = "FunctionIcon/FloorHeating/NightIcon.png"; |
| | | break; |
| | | case "away": |
| | | imagePath = "FunctionIcon/FloorHeating/AwayIcon.png"; |
| | | break; |
| | | case "timer": |
| | | imagePath = "FunctionIcon/AC/AutoIcon.png"; |
| | | break; |
| | | case "normal": |
| | | imagePath = "FunctionIcon/FloorHeating/OrdinaryIcon.png"; |
| | | break; |
| | | default: |
| | | imagePath = "FunctionIcon/AC/HeatingIcon.png"; |
| | | break; |
| | | switch (modeValue) |
| | | { |
| | | case "day": |
| | | imagePath = "FunctionIcon/AC/HeatingIcon.png"; |
| | | break; |
| | | case "night": |
| | | imagePath = "FunctionIcon/FloorHeating/NightIcon.png"; |
| | | break; |
| | | case "away": |
| | | imagePath = "FunctionIcon/FloorHeating/AwayIcon.png"; |
| | | break; |
| | | case "timer": |
| | | imagePath = "FunctionIcon/AC/AutoIcon.png"; |
| | | break; |
| | | case "normal": |
| | | imagePath = "FunctionIcon/FloorHeating/OrdinaryIcon.png"; |
| | | break; |
| | | default: |
| | | imagePath = "FunctionIcon/AC/HeatingIcon.png"; |
| | | break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | switch (modeValue) |
| | | { |
| | | case "day": |
| | | imagePath = "FunctionIcon/AC/HeatingIconGray.png"; |
| | | break; |
| | | case "night": |
| | | imagePath = "FunctionIcon/FloorHeating/NightIconGray.png"; |
| | | break; |
| | | case "away": |
| | | imagePath = "FunctionIcon/FloorHeating/AwayIconGray.png"; |
| | | break; |
| | | case "timer": |
| | | imagePath = "FunctionIcon/AC/AutoIconGray.png"; |
| | | break; |
| | | case "normal": |
| | | imagePath = "FunctionIcon/FloorHeating/OrdinaryIconGray.png"; |
| | | break; |
| | | } |
| | | } |
| | | return imagePath; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取模式属性文本 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string GetModeAttrText(string value) |
| | | { |
| | | string text = ""; |
| | | switch (value) |
| | | { |
| | | case "day": |
| | | text = Language.StringByID(StringId.Day); |
| | | break; |
| | | case "night": |
| | | text = Language.StringByID(StringId.Night); |
| | | break; |
| | | case "away": |
| | | text = Language.StringByID(StringId.Away); |
| | | break; |
| | | case "timer": |
| | | text = Language.StringByID(StringId.Auto); |
| | | break; |
| | | case "normal": |
| | | text = Language.StringByID(StringId.Normal); |
| | | break; |
| | | } |
| | | return text; |
| | | } |
| | | } |
| | | } |