wei
2021-07-09 068c68295cad1967f7aafb4e5e951260ef03d4ce
HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs
@@ -13,7 +13,7 @@
        {
            try
            {
                Application.RunOnMainThread((() =>
                Application.RunOnMainThread((Action)(() =>
                {
                    if (bodyView == null)
                    {
@@ -25,12 +25,12 @@
                    }
                    AC temp = new AC();
                    updataTime = DateTime.Now;
                    bodyView.btnTemp.Text = updateTemp.GetAttrState(FunctionAttributeKey.SetTemp);
                    bodyView.btnTemp.Text = Convert.ToDouble( updateTemp.GetAttrState(FunctionAttributeKey.SetTemp)).ToString();
                    bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState((string)FunctionAttributeKey.RoomTemp))) + "°C";
                    bodyView.btnMode.UnSelectedImagePath = temp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode));
                    bodyView.btnWindSpeed.UnSelectedImagePath = temp.GetFanIconPath(updateTemp.GetAttrState(FunctionAttributeKey.FanSpeed));
                    bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp)));
                    if (updateTemp.trait_on_off.curValue.ToString() == "on")
                    if (updateTemp.trait_on_off.state.ToString() == "on")
                    {
                        bodyView.arcBar.IsOffline = false;
                        bodyView.btnSwitch.IsSelected = true;
@@ -92,11 +92,11 @@
        {
            btnMinus.MouseUpEventHandler = (sender, e) =>
            {
                if (function.trait_on_off.curValue.ToString() == "off" || function.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                if (function.trait_on_off.state.ToString() == "off" || function.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                {
                    return;
                }
                var temp = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp));
                var temp = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp));
                if (temp <= function.GetAttribute(FunctionAttributeKey.Mode).min)
                {
                    return;
@@ -112,11 +112,11 @@
            };
            btnPlus.MouseUpEventHandler = (sender, e) =>
            {
                if (function.trait_on_off.curValue.ToString() == "off" || function.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                if (function.trait_on_off.state.ToString() == "off" || function.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                {
                    return;
                }
                var temp = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp));
                var temp = (int)Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp));
                if (temp >= function.GetAttribute(FunctionAttributeKey.SetTemp).max)
                {
                    return;
@@ -152,7 +152,7 @@
        {
            btnMode.MouseUpEventHandler = (sender, e) =>
            {
                if (function.trait_on_off.curValue.ToString() == "off")
                if (function.trait_on_off.state.ToString() == "off")
                {
                    return;
                }
@@ -160,7 +160,7 @@
            };
            btnWindSpeed.MouseUpEventHandler = (sender, e) =>
            {
                if (function.trait_on_off.curValue.ToString() == "off")
                if (function.trait_on_off.state.ToString() == "off")
                {
                    return;
                }
@@ -170,8 +170,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.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png";
                    btnSwitch.IsSelected = true;
@@ -184,7 +184,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);
            };
        }