wxr
2023-09-11 ec5a167e0366a75642e45dbd30817c1c8ae57e79
OnPro/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs
@@ -458,15 +458,6 @@
                };
                EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
                {
                    if (!device.isOnline())
                    {
                        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);
@@ -524,15 +515,6 @@
        {
            btnMinus.MouseUpEventHandler = (sender, e) =>
            {
                if (!device.isOnline())
                {
                    new Tip()
                    {
                        CloseTime = 1,
                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
                        Direction = AMPopTipDirection.None,
                    }.Show(MainPage.BaseView);
                }
                if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                {
                    return;
@@ -552,15 +534,6 @@
            };
            btnPlus.MouseUpEventHandler = (sender, e) =>
            {
                if (!device.isOnline())
                {
                    new Tip()
                    {
                        CloseTime = 1,
                        Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
                        Direction = AMPopTipDirection.None,
                    }.Show(MainPage.BaseView);
                }
                if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                {
                    return;
@@ -579,22 +552,19 @@
                Control.Ins.SendWriteCommand(device, d);
            };
            if (!device.isOnline())
            arcBar.OnStopTrackingTouchEvent = (sender, e) =>
            {
                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();
                };
            }
                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>
        /// 控制模式事件