wei
2021-07-09 068c68295cad1967f7aafb4e5e951260ef03d4ce
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs
@@ -13,29 +13,54 @@
        {
            try
            {
                Application.RunOnMainThread(() =>
                Application.RunOnMainThread((Action)(() =>
                {
                    if (bodyView == null)
                    {
                        return;
                    }
                    bodyView.btnTemp.Text = updateTemp.GetAttrState(FunctionAttributeKey.SetTemp);
                    bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.IndoorTemp))) + "°C";
                    var outinTemp = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp)));
                    bodyView.btnTemp.Text = outinTemp.ToString();
                    bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.RoomTemp))) + "°C";
                    bodyView.btnMode.UnSelectedImagePath = bodyView.fhTemp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode));
                    bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp)));
                    if (updateTemp.trait_on_off.curValue.ToString() == "on")
                    bodyView.arcBar.Progress = outinTemp;
                    //if (updateTemp.trait_on_off.curValue.ToString() == "on")
                    //{
                    //    bodyView.arcBar.ThumbImagePath = "FunctionIcon/FloorHeating/DiyThumbIconOn.png";
                    //    bodyView.btnSwitch.IsSelected = true;
                    //    bodyView.arcBar.IsOffline = false;
                    //}
                    //else
                    //{
                    //    bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png";
                    //    bodyView.btnSwitch.IsSelected = false;
                    //    bodyView.arcBar.IsOffline = true;
                    //}
                    if (updateTemp.trait_on_off.state.ToString() == "on")
                    {
                        bodyView.arcBar.ThumbImagePath = "FunctionIcon/FloorHeating/DiyThumbIconOn.png";
                        bodyView.btnSwitch.IsSelected = true;
                        bodyView.arcBar.IsOffline = false;
                        bodyView.btnSwitch.IsSelected = true;
                        bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png";
                        if (updateTemp.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                        {
                            bodyView.arcBar.IsClickable = false;
                        }
                        else
                        {
                            bodyView.arcBar.IsClickable = true;
                        }
                    }
                    else
                    {
                        bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png";
                        bodyView.btnSwitch.IsBold = false;
                        bodyView.arcBar.IsOffline = true;
                        bodyView.btnSwitch.IsSelected = false;
                        bodyView.arcBar.IsClickable = false;
                        bodyView.arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png";
                    }
                });
                }));
            }
            catch (Exception ex)
            {
@@ -76,7 +101,7 @@
        {
            btnMinus.MouseUpEventHandler = (sender, e) =>
            {
                if(function.trait_on_off.curValue.ToString() == "off")
                if(function.trait_on_off.state.ToString() == "off")
                {
                    return;
                }
@@ -96,12 +121,12 @@
            };
            btnPlus.MouseUpEventHandler = (sender, e) =>
            {
                if (function.trait_on_off.curValue.ToString() == "off")
                if (function.trait_on_off.state.ToString() == "off")
                {
                    return;
                }
                var temp = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp));
                if (temp > Convert.ToInt32(function.GetAttribute(FunctionAttributeKey.SetTemp).max))
                var temp =(int) Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp));
                if (temp > Convert.ToDouble(function.GetAttribute(FunctionAttributeKey.SetTemp).max))
                {
                    return;
                }
@@ -124,7 +149,7 @@
            arcBar.OnProgressChangedEvent = (sender, e) =>
            {
                function.SetAttrState(FunctionAttributeKey.SetTemp, e);
                btnTemp.Text = function.GetAttrState(FunctionAttributeKey.SetTemp);
                btnTemp.Text = Convert.ToDouble( function.GetAttrState(FunctionAttributeKey.SetTemp)).ToString();
            };
        }
        /// <summary>
@@ -134,7 +159,7 @@
        {
            btnMode.MouseUpEventHandler = (sender, e) =>
            {
                if (function.trait_on_off.curValue.ToString() == "off")
                if (function.trait_on_off.state.ToString() == "off")
                {
                    return;
                }
@@ -144,8 +169,8 @@
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                btnSwitch.IsSelected = !btnSwitch.IsSelected;
                function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                if (function.trait_on_off.curValue.ToString() == "on")
                function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                if (function.trait_on_off.state.ToString() == "on")
                {
                    //arcBar.ProgressBarColor = CSS_Color.MainColor;
                    arcBar.ThumbImagePath = "FunctionIcon/FloorHeating/DiyThumbIconOn.png";
@@ -160,7 +185,7 @@
                    arcBar.IsOffline = true;
                }
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                Control.Ins.SendWriteCommand(function, d);
               
            };