wxr
2022-04-08 271c46f52e74845dac76fa5ece4eb8b94d9168f4
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs
@@ -305,6 +305,15 @@
                };
                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);
@@ -362,6 +371,16 @@
        {
            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;
@@ -381,6 +400,16 @@
            };
            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;
@@ -398,19 +427,23 @@
                d.Add(FunctionAttributeKey.SetTemp, temp.ToString());
                Control.Ins.SendWriteCommand(device, d);
            };
            arcBar.OnStopTrackingTouchEvent = (sender, e) =>
            //if (device.online)
            {
                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();
            };
                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>
        /// 控制模式事件
@@ -460,9 +493,9 @@
            Application.RunOnMainThread(() =>
            {
                btnTemp.Text = device.GetAttrState(FunctionAttributeKey.SetTemp);
                btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp))) + "°C";
                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)));
                arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")));
                if (device.trait_on_off.curValue.ToString() == "on")
                {
                    arcBar.IsOffline = false;