From ab05fa182c317b62ff8b61489aac86162fab9e25 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 19 十月 2022 17:13:13 +0800
Subject: [PATCH] 人居环境更新

---
 HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs |   36 ++++++++++++++++++++++++++++++------
 1 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs
index 593a132..90f1464 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs
@@ -33,17 +33,27 @@
             Application.RunOnMainThread(() => {
                 bodyView.btnTempValues.Text = temp.GetAttrState(AcstSub_AttrEnum.room_temp.ToString());
                 bodyView.btnHumiValues.Text = temp.GetAttrState(AcstSub_AttrEnum.room_humidity.ToString());
+
+
+                int setTempValue = 0;
+                int.TryParse(temp.GetAttrState(AcstSub_AttrEnum.set_temp.ToString(), "--"), out setTempValue);
+                if (setTempValue != 0)
+                    bodyView.btnSetTempValues.Text = setTempValue.ToString();
+
                 bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10);
-                bodyView.tempBar.Progress = Convert.ToInt32(temp.GetAttrState(FunctionAttributeKey.SetTemp)) + 16;
+
+                int progress = 0;
+                int.TryParse(temp.GetAttrState(FunctionAttributeKey.SetTemp), out progress);
+                bodyView.tempBar.Progress = progress + 16;
                 if(temp.trait_on_off.curValue.ToString() == "on")
                 {
                     bodyView.btnPowerControl.IsSelected = true;
-                    bodyView.tempBar.IsOffline = false;
+                    bodyView.tempBar.Enable = false;
                 }
                 else
                 {
                     bodyView.btnPowerControl.IsSelected = false;
-                    bodyView.tempBar.IsOffline = true;
+                    bodyView.tempBar.Enable = true;
                 }
             });
 
@@ -194,6 +204,13 @@
                 Text = function.GetAttrState(AcstSub_AttrEnum.set_temp.ToString(), "--")
             };
             contentView.AddChidren(btnSetTempValues);
+            int setTempValue = 0;
+            int.TryParse(function.GetAttrState(AcstSub_AttrEnum.set_temp.ToString(), "--"), out setTempValue);
+            if (setTempValue != 0)
+                btnSetTempValues.Text = setTempValue.ToString();
+            bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10);
+
+
 
             var btnSetTempUnit = new Button()
             {
@@ -223,6 +240,10 @@
             };
             contentView.AddChidren(btnMinValuesText);
 
+
+            int progress = 0;
+            int.TryParse(function.GetAttrState(FunctionAttributeKey.SetTemp),out progress);
+
             tempBar = new DiyImageSeekBar()
             {
                 Gravity = Gravity.CenterHorizontal,
@@ -234,11 +255,12 @@
                 ThumbImageHeight = Application.GetRealHeight(51),
                 ProgressBarColor = function.trait_on_off.curValue.ToString() == "on" ? curColor : CSS_Color.DividingLineColor,
                 MaxValue = 14,
-                Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp)) + 16,
+                Progress = progress + 16,
                 SeekBarPadding = Application.GetRealWidth(20),
                 IsProgressTextShow = false,
                 ProgressChangeDelayTime = 0,
-                IsOffline = function.trait_on_off.curValue.ToString() == "off",
+                Enable = function.trait_on_off.curValue.ToString() == "off",
+                //IsOffline = function.trait_on_off.curValue.ToString() == "off",
             };
             contentView.AddChidren(tempBar);
             tempBar.OnProgressChangedEvent = (sender, e) => {
@@ -288,12 +310,14 @@
 
                 new System.Threading.Thread(() => {
                     Dictionary<string, string> d = new Dictionary<string, string>();
-                    d.Add("onoff", btnPowerControl.IsSelected ? "on" : "off");
+                    d.Add(FunctionAttributeKey.OnOff, btnPowerControl.IsSelected ? "on" : "off");
                     Control.Ins.SendWriteCommand(function, d);
                 })
                 { IsBackground = true }.Start();
             };
 
+            Control.Ins.SendReadCommand(function);
+
         }
     }
 }

--
Gitblit v1.8.0