using System; 
 | 
using HDL_ON.DriverLayer; 
 | 
using HDL_ON.Entity; 
 | 
using HDL_ON.Stan; 
 | 
using HDL_ON.UI.CSS; 
 | 
using Shared; 
 | 
namespace HDL_ON.UI 
 | 
{ 
 | 
    public class FhContentView : FrameLayout 
 | 
    { 
 | 
        #region ■ 变量声明___________________________ 
 | 
        /// <summary> 
 | 
        /// 空调温度控制控件 
 | 
        /// </summary> 
 | 
        DiyArcSeekBar arcBar; 
 | 
        /// <summary> 
 | 
        /// 减号按钮 
 | 
        /// </summary> 
 | 
        Button btnMinus; 
 | 
        /// <summary> 
 | 
        /// 加号按钮 
 | 
        /// </summary> 
 | 
        Button btnPlus; 
 | 
        /// <summary> 
 | 
        /// 温度按钮 
 | 
        /// </summary> 
 | 
        Button btnTemp; 
 | 
        Button btnTempUint; 
 | 
        /// <summary> 
 | 
        /// 室内温度按钮 
 | 
        /// </summary> 
 | 
        Button btnIndoorTemp; 
 | 
        /// <summary> 
 | 
        /// 模式按钮 
 | 
        /// </summary> 
 | 
        Button btnMode; 
 | 
        /// <summary> 
 | 
        /// 开关按钮 
 | 
        /// </summary> 
 | 
        Button btnSwitch; 
 | 
  
 | 
        FloorHeating fhTemp = new FloorHeating(); 
 | 
  
 | 
        Function device; 
 | 
  
 | 
        #endregion 
 | 
  
 | 
        public FhContentView(Function function) 
 | 
        { 
 | 
            device = function; 
 | 
        } 
 | 
  
 | 
        #region ■ 初始化_____________________________ 
 | 
  
 | 
        /// <summary> 
 | 
        /// 初始化白色区域的内容 
 | 
        /// </summary> 
 | 
        public void InitContentView(bool initStandard) 
 | 
        { 
 | 
  
 | 
            if (initStandard) 
 | 
            { 
 | 
                //设备名字 
 | 
                var btnDeviceName = new NormalViewControl(270, 37, true); 
 | 
                btnDeviceName.X = Application.GetRealWidth(16); 
 | 
                btnDeviceName.Y = Application.GetRealHeight(18); 
 | 
                btnDeviceName.TextColor = CSS_Color.FirstLevelTitleColor; 
 | 
                btnDeviceName.TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel; 
 | 
                btnDeviceName.Text = device.name; 
 | 
                btnDeviceName.Width = btnDeviceName.GetRealWidthByText(); 
 | 
                AddChidren(btnDeviceName); 
 | 
                //房间名字 
 | 
                var btnRoomName = new NormalViewControl(270, 21, true); 
 | 
                btnRoomName.X = Application.GetRealWidth(16); 
 | 
                btnRoomName.Y = btnDeviceName.Bottom; 
 | 
                btnRoomName.TextColor = CSS_Color.PromptingColor1; 
 | 
                btnRoomName.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; 
 | 
                btnRoomName.Text = device.GetRoomListName(); 
 | 
                btnRoomName.Width = btnRoomName.GetRealWidthByText(); 
 | 
                AddChidren(btnRoomName); 
 | 
  
 | 
            } 
 | 
            //初始化第一个索引页的内容 
 | 
            this.InitFrameWhiteContent1(); 
 | 
  
 | 
            //刷新界面状态 
 | 
            this.RefreshFormStatu(); 
 | 
            //读取状态 
 | 
            new System.Threading.Thread(() => 
 | 
            { 
 | 
                Control.Ins.SendReadCommand(device); 
 | 
            }) 
 | 
            { IsBackground = true }.Start(); 
 | 
        } 
 | 
  
 | 
        /// <summary> 
 | 
        /// 初始化第一个索引页的内容 
 | 
        /// </summary> 
 | 
        private void InitFrameWhiteContent1() 
 | 
        { 
 | 
  
 | 
            arcBar = new DiyArcSeekBar() 
 | 
            { 
 | 
                Gravity = Gravity.CenterHorizontal, 
 | 
                OpenAngle = 160, 
 | 
                //ThumbImagePath = device.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/FloorHeating/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png", 
 | 
                ThumbImageHeight = Application.GetRealWidth(50), 
 | 
                ProgressBarColor = CSS_Color.AuxiliaryColor1, // 0xFFFC9C04, 
 | 
                OfflineProgressBarColor = CSS_Color.PromptingColor2, 
 | 
                MinValue = device.GetAttribute(FunctionAttributeKey.SetTemp).min, 
 | 
                MaxValue = device.GetAttribute(FunctionAttributeKey.SetTemp).max, 
 | 
                ArcColor = CSS_Color.BackgroundColor, 
 | 
                Progress = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp)), 
 | 
#if __IOS__ 
 | 
                Y = Application.GetRealHeight(120 + 25), 
 | 
                Width = Application.GetRealWidth(260 - 40), 
 | 
                Height = Application.GetRealWidth(260 - 40), 
 | 
                SeekBarPadding = Application.GetRealWidth(8), 
 | 
#else 
 | 
                Y = Application.GetRealHeight(120 + 40), 
 | 
                Width = Application.GetRealWidth(260 - 40), 
 | 
                Height = Application.GetRealWidth(260 - 40), 
 | 
                SeekBarPadding = Application.GetRealWidth(7), 
 | 
#endif 
 | 
  
 | 
            }; 
 | 
            AddChidren(arcBar); 
 | 
  
 | 
  
 | 
            arcBar.ThumbImagePath = device.GetAttrState(FunctionAttributeKey.OnOff) == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png"; 
 | 
            arcBar.IsOffline = device.GetAttrState(FunctionAttributeKey.OnOff) == "off"; 
 | 
            arcBar.MinValue = device.GetAttribute(FunctionAttributeKey.SetTemp).min; 
 | 
            arcBar.MaxValue = device.GetAttribute(FunctionAttributeKey.SetTemp).max; 
 | 
            arcBar.Progress = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp)); 
 | 
  
 | 
  
 | 
  
 | 
            btnTemp = new Button() 
 | 
            { 
 | 
                Gravity = Gravity.CenterHorizontal, 
 | 
                Y = Application.GetRealHeight(200), 
 | 
                Width = Application.GetRealWidth(80), 
 | 
                Height = Application.GetRealWidth(60), 
 | 
                TextColor = CSS_Color.FirstLevelTitleColor, 
 | 
                TextSize = 56, 
 | 
                IsBold = true, 
 | 
                Text = device.GetAttrState(FunctionAttributeKey.SetTemp), 
 | 
                TextAlignment = TextAlignment.Center, 
 | 
            }; 
 | 
            AddChidren(btnTemp); 
 | 
  
 | 
            btnTempUint = new Button() 
 | 
            { 
 | 
                X = btnTemp.Right, 
 | 
                Y = btnTemp.Y, 
 | 
                Width = Application.GetRealWidth(30), 
 | 
                Height = Application.GetRealWidth(25), 
 | 
                TextColor = CSS_Color.FirstLevelTitleColor, 
 | 
                TextSize = CSS_FontSize.EmphasisFontSize_Secondary, 
 | 
                IsBold = true, 
 | 
                TextAlignment = TextAlignment.CenterLeft, 
 | 
                Text = fhTemp.GetTempUnitString(device) 
 | 
            }; 
 | 
            AddChidren(btnTempUint); 
 | 
  
 | 
            btnIndoorTemp = new Button() 
 | 
            { 
 | 
                Gravity = Gravity.CenterHorizontal, 
 | 
                Y = btnTemp.Bottom + Application.GetRealWidth(10), 
 | 
                Width = Application.GetRealWidth(100), 
 | 
                Height = Application.GetRealHeight(20), 
 | 
                Text = Language.StringByID(StringId.IndoorTemp) + "20°C", 
 | 
                TextColor = CSS_Color.PromptingColor1, 
 | 
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel, 
 | 
            }; 
 | 
            AddChidren(btnIndoorTemp); 
 | 
  
 | 
            btnMinus = new Button() 
 | 
            { 
 | 
                X = Application.GetRealWidth(21), 
 | 
                Y = Application.GetRealHeight(263), 
 | 
                Width = Application.GetRealWidth(32), 
 | 
                Height = Application.GetRealWidth(32), 
 | 
                UnSelectedImagePath = "Public/MinusSignIcon.png", 
 | 
            }; 
 | 
            AddChidren(btnMinus); 
 | 
  
 | 
            btnPlus = new Button() 
 | 
            { 
 | 
                X = Application.GetRealWidth(275), 
 | 
                Y = Application.GetRealHeight(263), 
 | 
                Width = Application.GetRealWidth(32), 
 | 
                Height = Application.GetRealWidth(32), 
 | 
                UnSelectedImagePath = "Public/PlusSignIcon.png", 
 | 
            }; 
 | 
            AddChidren(btnPlus); 
 | 
  
 | 
            if (device.GetAttribute(FunctionAttributeKey.Mode) != null) 
 | 
            { 
 | 
                btnMode = new Button() 
 | 
                { 
 | 
                    X = Application.GetRealWidth(235), 
 | 
                    Y = Application.GetRealHeight(337), 
 | 
                    Width = Application.GetRealWidth(30), 
 | 
                    Height = Application.GetRealWidth(30), 
 | 
                    UnSelectedImagePath = fhTemp.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)) 
 | 
                }; 
 | 
                AddChidren(btnMode); 
 | 
                if (device.GetAttribute(FunctionAttributeKey.Mode).value.Count > 1) 
 | 
                { 
 | 
                    btnMode.MouseUpEventHandler = (sender, e) => 
 | 
                    { 
 | 
                        LoadDiv_ChangeModeView(); 
 | 
                    }; 
 | 
                } 
 | 
            } 
 | 
  
 | 
            btnSwitch = new Button() 
 | 
            { 
 | 
                Gravity = Gravity.CenterHorizontal, 
 | 
                Y = Application.GetRealHeight(466), 
 | 
                Width = Application.GetRealWidth(32), 
 | 
                Height = Application.GetRealWidth(32), 
 | 
                UnSelectedImagePath = "Public/PowerClose.png", 
 | 
                SelectedImagePath = "Public/PowerOpen.png", 
 | 
                IsSelected = device.trait_on_off.curValue.ToString() == "on" 
 | 
            }; 
 | 
            AddChidren(btnSwitch); 
 | 
  
 | 
            LoadEvent_TempChange(); 
 | 
            LoadEvent_AcStatesChange(); 
 | 
  
 | 
        } 
 | 
  
 | 
        /// <summary> 
 | 
        /// 加载修改模式区域 
 | 
        /// </summary> 
 | 
        void LoadDiv_ChangeModeView() 
 | 
        { 
 | 
            Dialog dialog = new Dialog(); 
 | 
  
 | 
            FrameLayout dialogView = new FrameLayout() 
 | 
            { 
 | 
                BackgroundColor = CSS_Color.DialogTransparentColor1, 
 | 
            }; 
 | 
            dialog.AddChidren(dialogView); 
 | 
  
 | 
            FrameLayout modeChangeView; 
 | 
            modeChangeView = new FrameLayout() 
 | 
            { 
 | 
                X = Application.GetRealWidth(30), 
 | 
                Y = Application.GetRealHeight(128), 
 | 
                Width = Application.GetRealWidth(160), 
 | 
                Height = Application.GetRealHeight(287), 
 | 
                BackgroundImagePath = "FunctionIcon/AC/DivBg1.png", 
 | 
            }; 
 | 
            dialogView.AddChidren(modeChangeView); 
 | 
  
 | 
            Button btnTitle; 
 | 
            btnTitle = new Button() 
 | 
            { 
 | 
                X = Application.GetRealWidth(8 + 16), 
 | 
                Y = Application.GetRealHeight(8), 
 | 
                Width = Application.GetRealWidth(112), 
 | 
                Height = Application.GetRealHeight(44), 
 | 
                TextID = StringId.ChooseMode, 
 | 
                TextAlignment = TextAlignment.CenterLeft, 
 | 
                TextColor = CSS_Color.FirstLevelTitleColor, 
 | 
                TextSize = CSS_FontSize.EmphasisFontSize_Secondary, 
 | 
            }; 
 | 
            modeChangeView.AddChidren(btnTitle); 
 | 
  
 | 
            Button btnLine = new Button() 
 | 
            { 
 | 
                X = btnTitle.X, 
 | 
                Y = btnTitle.Bottom, 
 | 
                Width = Application.GetRealWidth(112), 
 | 
                Height = Application.GetRealHeight(1), 
 | 
                BackgroundColor = CSS_Color.BackgroundColor, 
 | 
            }; 
 | 
            modeChangeView.AddChidren(btnLine); 
 | 
  
 | 
            var modeList = device.GetAttribute(FunctionAttributeKey.Mode).value; 
 | 
            foreach (var m in modeList) 
 | 
            { 
 | 
                Button btnModeIcon = new Button() 
 | 
                { 
 | 
                    X = btnTitle.X, 
 | 
                    Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8), 
 | 
                    Width = Application.GetRealWidth(24), 
 | 
                    Height = Application.GetRealWidth(24), 
 | 
                    IsSelected = device.GetAttrState(FunctionAttributeKey.Mode) == m, 
 | 
                }; 
 | 
                modeChangeView.AddChidren(btnModeIcon); 
 | 
  
 | 
                Button btnModeText = new Button() 
 | 
                { 
 | 
                    X = Application.GetRealWidth(12) + btnModeIcon.Right, 
 | 
                    Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 8), 
 | 
                    Height = Application.GetRealHeight(44), 
 | 
                    Width = Application.GetRealWidth(90), 
 | 
                    TextAlignment = TextAlignment.CenterLeft, 
 | 
                    TextColor = CSS_Color.FirstLevelTitleColor, 
 | 
                    SelectedTextColor = CSS_Color.MainColor, 
 | 
                    IsSelected = device.GetAttrState(FunctionAttributeKey.Mode) == m, 
 | 
                    TextSize = CSS_FontSize.TextFontSize, 
 | 
                }; 
 | 
                modeChangeView.AddChidren(btnModeText); 
 | 
  
 | 
                btnModeIcon.UnSelectedImagePath = fhTemp.GetModeIconPath(m, false); 
 | 
                btnModeIcon.SelectedImagePath = fhTemp.GetModeIconPath(m); 
 | 
                btnModeText.Text = fhTemp.GetModeAttrText(m); 
 | 
  
 | 
                if (modeList.IndexOf(m) < modeList.Count - 1) 
 | 
                { 
 | 
                    modeChangeView.AddChidren(new Button() 
 | 
                    { 
 | 
                        X = btnTitle.X, 
 | 
                        Y = btnModeText.Bottom, 
 | 
                        Width = Application.GetRealWidth(112), 
 | 
                        Height = Application.GetRealHeight(1), 
 | 
                        BackgroundColor = CSS_Color.BackgroundColor, 
 | 
                    }); 
 | 
                } 
 | 
                EventHandler<MouseEventArgs> eventHandler = (sender, e) => 
 | 
                { 
 | 
                    dialog.Close(); 
 | 
                }; 
 | 
                EventHandler<MouseEventArgs> eventHandler1 = (sender, e) => 
 | 
                { 
 | 
                    //if (!device.online) 
 | 
                    //{ 
 | 
                    //    new Tip() 
 | 
                    //    { 
 | 
                    //        CloseTime = 1, 
 | 
                    //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption), 
 | 
                    //        Direction = AMPopTipDirection.None, 
 | 
                    //    }.Show(MainPage.BaseView); 
 | 
                    //} 
 | 
                    btnModeIcon.IsSelected = btnModeText.IsSelected = true; 
 | 
                    device.SetAttrState(FunctionAttributeKey.Mode, m); 
 | 
                    btnMode.UnSelectedImagePath = fhTemp.GetModeIconPath(m); 
 | 
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); 
 | 
                    btnMode.UnSelectedImagePath = btnModeIcon.UnSelectedImagePath; 
 | 
                    d.Add(FunctionAttributeKey.Mode, m); 
 | 
                    Control.Ins.SendWriteCommand(device, d); 
 | 
                    dialog.Close(); 
 | 
                    if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan") 
 | 
                    { 
 | 
                        arcBar.IsClickable = false; 
 | 
                    } 
 | 
                    else 
 | 
                    { 
 | 
                        arcBar.IsClickable = true; 
 | 
                    } 
 | 
                }; 
 | 
                btnModeIcon.MouseUpEventHandler = eventHandler1; 
 | 
                btnModeText.MouseUpEventHandler = eventHandler1; 
 | 
                dialogView.MouseUpEventHandler = eventHandler; 
 | 
  
 | 
            } 
 | 
  
 | 
            dialogView.MouseUpEventHandler = (sender, e) => { 
 | 
                dialog.Close(); 
 | 
            }; 
 | 
            dialog.Show(); 
 | 
        } 
 | 
  
 | 
        #endregion 
 | 
  
 | 
  
 | 
        #region ■ 发送各种命令_______________________ 
 | 
  
 | 
        /// <summary> 
 | 
        /// 温度改变模式 
 | 
        /// </summary> 
 | 
        void LoadEvent_TempChange() 
 | 
        { 
 | 
            btnMinus.MouseUpEventHandler = (sender, e) => 
 | 
            { 
 | 
                //if (!device.online) 
 | 
                //{ 
 | 
                //    new Tip() 
 | 
                //    { 
 | 
                //        CloseTime = 1, 
 | 
                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption), 
 | 
                //        Direction = AMPopTipDirection.None, 
 | 
                //    }.Show(MainPage.BaseView); 
 | 
                //    return; 
 | 
                //} 
 | 
                if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") 
 | 
                { 
 | 
                    return; 
 | 
                } 
 | 
                var temp = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp)); 
 | 
                if (temp <= device.GetAttribute(FunctionAttributeKey.Mode).min) 
 | 
                { 
 | 
                    return; 
 | 
                } 
 | 
                temp--; 
 | 
                arcBar.Progress = temp; 
 | 
                btnTemp.Text = temp.ToString(); 
 | 
                device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString()); 
 | 
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); 
 | 
                d.Add(FunctionAttributeKey.SetTemp, temp.ToString()); 
 | 
                Control.Ins.SendWriteCommand(device, d); 
 | 
            }; 
 | 
            btnPlus.MouseUpEventHandler = (sender, e) => 
 | 
            { 
 | 
                //if (!device.online) 
 | 
                //{ 
 | 
                //    new Tip() 
 | 
                //    { 
 | 
                //        CloseTime = 1, 
 | 
                //        Text = Language.StringByID(StringId.DeviceOfflineCannotOption), 
 | 
                //        Direction = AMPopTipDirection.None, 
 | 
                //    }.Show(MainPage.BaseView); 
 | 
                //    return; 
 | 
                //} 
 | 
                if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") 
 | 
                { 
 | 
                    return; 
 | 
                } 
 | 
                var temp = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp)); 
 | 
                if (temp >= device.GetAttribute(FunctionAttributeKey.SetTemp).max) 
 | 
                { 
 | 
                    return; 
 | 
                } 
 | 
                temp++; 
 | 
                arcBar.Progress = temp; 
 | 
                btnTemp.Text = temp.ToString(); 
 | 
                device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString()); 
 | 
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); 
 | 
                d.Add(FunctionAttributeKey.SetTemp, temp.ToString()); 
 | 
                Control.Ins.SendWriteCommand(device, d); 
 | 
            }; 
 | 
  
 | 
            //if (device.online) 
 | 
            { 
 | 
                arcBar.OnStopTrackingTouchEvent = (sender, e) => 
 | 
                { 
 | 
                    device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); 
 | 
                    btnTemp.Text = arcBar.Progress.ToString(); 
 | 
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); 
 | 
                    d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); 
 | 
                    Control.Ins.SendWriteCommand(device, d); 
 | 
                }; 
 | 
                arcBar.OnProgressChangedEvent = (sender, e) => 
 | 
                { 
 | 
                    device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString()); 
 | 
                    btnTemp.Text = e.ToString(); 
 | 
                }; 
 | 
            } 
 | 
        } 
 | 
        /// <summary> 
 | 
        /// 控制模式事件 
 | 
        /// </summary> 
 | 
        void LoadEvent_AcStatesChange() 
 | 
        { 
 | 
            btnMode.MouseUpEventHandler = (sender, e) => 
 | 
            { 
 | 
                if (device.trait_on_off.curValue.ToString() == "off") 
 | 
                { 
 | 
                    return; 
 | 
                } 
 | 
                LoadDiv_ChangeModeView(); 
 | 
            }; 
 | 
  
 | 
            btnSwitch.MouseUpEventHandler = (sender, e) => 
 | 
            { 
 | 
                btnSwitch.IsSelected = !btnSwitch.IsSelected; 
 | 
                device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; 
 | 
                if (device.trait_on_off.curValue.ToString() == "on") 
 | 
                { 
 | 
                    arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; 
 | 
                    btnSwitch.IsSelected = true; 
 | 
                    arcBar.IsOffline = false; 
 | 
                } 
 | 
                else 
 | 
                { 
 | 
                    arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; 
 | 
                    btnSwitch.IsBold = false; 
 | 
                    arcBar.IsOffline = true; 
 | 
                } 
 | 
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); 
 | 
                d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.curValue.ToString()); 
 | 
                Control.Ins.SendWriteCommand(device, d); 
 | 
            }; 
 | 
        } 
 | 
  
 | 
        #endregion 
 | 
  
 | 
        #region ■ 刷新界面状态_______________________ 
 | 
  
 | 
        /// <summary> 
 | 
        /// 刷新界面状态 
 | 
        /// </summary> 
 | 
        private void RefreshFormStatu() 
 | 
        { 
 | 
            Application.RunOnMainThread(() => 
 | 
            { 
 | 
                btnTemp.Text = device.GetAttrState(FunctionAttributeKey.SetTemp); 
 | 
                btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "°C"; 
 | 
                btnMode.UnSelectedImagePath = fhTemp.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)); 
 | 
                arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."))); 
 | 
                if (device.trait_on_off.curValue.ToString() == "on") 
 | 
                { 
 | 
                    arcBar.IsOffline = false; 
 | 
                    btnSwitch.IsSelected = true; 
 | 
                    arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; 
 | 
                    if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan") 
 | 
                    { 
 | 
                        arcBar.IsClickable = false; 
 | 
                    } 
 | 
                    else 
 | 
                    { 
 | 
                        arcBar.IsClickable = true; 
 | 
                    } 
 | 
                } 
 | 
                else 
 | 
                { 
 | 
                    arcBar.IsOffline = true; 
 | 
                    btnSwitch.IsSelected = false; 
 | 
                    arcBar.IsClickable = false; 
 | 
                    arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; 
 | 
                } 
 | 
                //自动模式不允许调温度 2021-10-27 09:41:35 wxr 陈琳反馈 
 | 
                if (device.GetAttrState(FunctionAttributeKey.Mode) == "auto") 
 | 
                { 
 | 
                    btnPlus.Enable = false; 
 | 
                    btnMinus.Enable = false; 
 | 
                    arcBar.IsClickable = false; 
 | 
                    arcBar.IsOffline = true; 
 | 
                } 
 | 
            }); 
 | 
        } 
 | 
  
 | 
        #endregion 
 | 
    } 
 | 
} 
 |