From 38df05b600e7a41106f710a3e4287e37fbf35d03 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 27 十月 2022 09:10:34 +0800
Subject: [PATCH] 备份

---
 HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs |   47 +++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs
index 593a132..c0490ed 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs
@@ -33,16 +33,31 @@
             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;
+                double dd = 0;
+                double.TryParse(temp.GetAttrState(AcstSub_AttrEnum.set_temp.ToString(), "--"), out dd);
+                setTempValue = Convert.ToInt32(dd);
+                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(AcstSub_AttrEnum.set_temp.ToString()), out progress);
+                bodyView.tempBar.Progress = setTempValue - 16;
                 if(temp.trait_on_off.curValue.ToString() == "on")
                 {
                     bodyView.btnPowerControl.IsSelected = true;
+                    bodyView.tempBar.ProgressBarColor = bodyView.curColor;
                     bodyView.tempBar.IsOffline = false;
+
                 }
                 else
                 {
                     bodyView.btnPowerControl.IsSelected = false;
+                    bodyView.tempBar.ProgressBarColor = CSS_Color.DividingLineColor;
                     bodyView.tempBar.IsOffline = true;
                 }
             });
@@ -68,9 +83,9 @@
             bodyView = this;
         }
 
-        public void LoadPage()
+        public void LoadPage(Action action)
         {
-            new TopViewDiv(bodyView, function.GetRoomListName()).LoadTopView();
+            new TopViewDiv(bodyView, function.name).LoadTopView_FunctionTop(function,action);
 
             var contentView = new FrameLayout()
             {
@@ -185,7 +200,7 @@
             {
                 Gravity = Gravity.CenterHorizontal,
                 Y = Application.GetRealHeight(260),
-                Width = Application.GetRealWidth(71),
+                Width = Application.GetRealWidth(77),
                 Height = Application.GetRealHeight(90),
                 TextAlignment = TextAlignment.TopRight,
                 TextColor = CSS.CSS_Color.FirstLevelTitleColor,
@@ -194,6 +209,15 @@
                 Text = function.GetAttrState(AcstSub_AttrEnum.set_temp.ToString(), "--")
             };
             contentView.AddChidren(btnSetTempValues);
+            int setTempValue = 0;
+            double dd = 0;
+            double.TryParse(function.GetAttrState(AcstSub_AttrEnum.set_temp.ToString(), "--"), out dd);
+            setTempValue = Convert.ToInt32(dd);
+            if (setTempValue != 0)
+                btnSetTempValues.Text = setTempValue.ToString();
+            //bodyView.btnSetTempValues.Width = bodyView.btnSetTempValues.GetTextWidth() + Application.GetRealWidth(10);
+
+
 
             var btnSetTempUnit = new Button()
             {
@@ -223,6 +247,10 @@
             };
             contentView.AddChidren(btnMinValuesText);
 
+
+            int progress = 0;
+            int.TryParse(function.GetAttrState(FunctionAttributeKey.SetTemp),out progress);
+
             tempBar = new DiyImageSeekBar()
             {
                 Gravity = Gravity.CenterHorizontal,
@@ -234,11 +262,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) => {
@@ -247,7 +276,7 @@
             tempBar.OnStopTrackingTouchEvent = (sender, e) => {
                 new System.Threading.Thread(() => {
                     var d = new Dictionary<string, string>();
-                    d.Add(FunctionAttributeKey.SetTemp, e.ToString());
+                    d.Add(FunctionAttributeKey.SetTemp, (e+16).ToString());
                     Control.Ins.SendWriteCommand(function, d);
                 })
                 { IsBackground = true }.Start();
@@ -288,12 +317,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