wxr
2024-10-28 505effa88b17ce8c3c7ac5403b76d9e5d0cfc2a5
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs
@@ -19,11 +19,17 @@
                    {
                        return;
                    }
                    var outinTemp = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp)));
                    if (updateTemp.sid != bodyView.function.sid)
                    {
                        return;
                    }
                    var outinTemp = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")));
                    bodyView.btnTemp.Text = outinTemp.ToString();
                    bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.RoomTemp))) + "°C";
                    //bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "°C";
                    bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTempOutdoorTemp).Replace("{1}", Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))).ToString()).Replace("{0}", MainPage.cityInfo.temperature);
                    bodyView.btnMode.SelectedImagePath = bodyView.fhTemp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode));
                    bodyView.btnMode.UnSelectedImagePath = bodyView.fhTemp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode),false);
                    bodyView.btnMode.UnSelectedImagePath = bodyView.fhTemp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode), false);
                    bodyView.arcBar.Progress = outinTemp;
                    //if (updateTemp.trait_on_off.curValue.ToString() == "on")
                    //{
@@ -37,6 +43,14 @@
                    //    bodyView.btnSwitch.IsSelected = false;
                    //    bodyView.arcBar.IsOffline = true;
                    //}
                    if (bodyView.btnTemp.Text.Length > 2)
                    {
                        bodyView.btnTemp.TextSize = 44;
                    }
                    else
                    {
                        bodyView.btnTemp.TextSize = 56;
                    }
                    //app自己控制的不用更新,会造成跳动
@@ -74,14 +88,13 @@
                        bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png";
                    }
                    //自动模式不允许调温度 2021-10-27 09:41:35 wxr 陈琳反馈
                    if (updateTemp.GetAttrState(FunctionAttributeKey.Mode) == "auto"|| updateTemp.GetAttrState(FunctionAttributeKey.Mode) == "timer")
                    if (updateTemp.GetAttrState(FunctionAttributeKey.Mode) == "auto" || updateTemp.GetAttrState(FunctionAttributeKey.Mode) == "timer")
                    {
                        bodyView.btnPlus.Enable = false;
                        bodyView.btnMinus.Enable = false;
                        bodyView.arcBar.IsClickable = false;
                        bodyView.arcBar.IsOffline = true;
                    }
                });
            }
            catch (Exception ex)
@@ -102,6 +115,7 @@
                btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
                //function.SaveFunctionData(true);
            };
            //自动模式不允许调温度 2021-10-27 09:41:35 wxr 陈琳反馈
            if (function.GetAttrState(FunctionAttributeKey.Mode) == "auto" || function.GetAttrState(FunctionAttributeKey.Mode) == "timer")
            {
@@ -129,14 +143,24 @@
        /// </summary>
        void LoadEvent_TempChange()
        {
            if (!function.isOnline())
            {
                new Tip()
                {
                    CloseTime = 1,
                    Text = Language.StringByID(StringId.DeviceOfflineCannotOption),
                    Direction = AMPopTipDirection.None,
                }.Show(MainPage.BaseView);
                return;
            }
            btnMinus.MouseUpEventHandler = (sender, e) =>
            {
                if(function.trait_on_off.curValue.ToString() == "off")
                if (function.trait_on_off.curValue.ToString() == "off")
                {
                    return;
                }
                var temp = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp));
                var temp = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."));
                if (temp <= Convert.ToInt32(function.GetAttribute(FunctionAttributeKey.SetTemp).min))
                {
                    return;
@@ -156,7 +180,7 @@
                {
                    return;
                }
                var temp =(int) Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp));
                var temp = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."));
                if (temp >= Convert.ToDouble(function.GetAttribute(FunctionAttributeKey.SetTemp).max))
                {
                    return;
@@ -172,7 +196,7 @@
            };
            arcBar.OnStopTrackingTouchEvent = (sender, e) =>
            {
                function.SetAttrState(FunctionAttributeKey.SetTemp,arcBar.Progress);
                function.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress);
                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());
@@ -181,7 +205,15 @@
            arcBar.OnProgressChangedEvent = (sender, e) =>
            {
                function.SetAttrState(FunctionAttributeKey.SetTemp, e);
                btnTemp.Text = Convert.ToDouble( function.GetAttrState(FunctionAttributeKey.SetTemp)).ToString();
                btnTemp.Text = Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")).ToString();
                if (btnTemp.Text.Length > 2)
                {
                    btnTemp.TextSize = 44;
                }
                else
                {
                    btnTemp.TextSize = 56;
                }
            };
        }
        /// <summary>
@@ -219,7 +251,7 @@
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                Control.Ins.SendWriteCommand(function, d);
            };
        }
@@ -236,7 +268,7 @@
            EventHandler<MouseEventArgs> eventHandler1 = (sender, e) =>
            {
                btn1.IsSelected = btn2.IsSelected = true;
                function.SetAttrState(FunctionAttributeKey.Mode,curMode);
                function.SetAttrState(FunctionAttributeKey.Mode, curMode);
                btnMode.UnSelectedImagePath = btn1.SelectedImagePath;
                //byte pro = 6;//不处理温度显示,等待回复数据再处理
                //function.Fh_Mode_Temp.TryGetValue(curMode, out pro);
@@ -250,5 +282,7 @@
            btn2.MouseUpEventHandler = eventHandler1;
            dialogView.MouseUpEventHandler = eventHandler;
        }
    }
}
}