From f748908e5414736eb243ae7ec66a80dc9f5d9d49 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期四, 26 九月 2024 11:37:00 +0800
Subject: [PATCH] 水浸传感器,红外传感器,面板空调

---
 HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorWaterImmersionPage.cs |   41 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 40 insertions(+), 1 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorWaterImmersionPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorWaterImmersionPage.cs
index a4e92e1..0aef0ed 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorWaterImmersionPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorWaterImmersionPage.cs
@@ -47,12 +47,38 @@
             })
             { IsBackground = true }.Start();
         }
-
+        BatteryPersentControl batteryControl;
         /// <summary>
         /// 鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹�
         /// </summary>
         private void InitFrameWhiteContent1()
         {
+            //鐢垫睜鎺т欢
+            this.batteryControl = new BatteryPersentControl();
+            //瀹冩湁涓渶灏忕殑X杞�
+            batteryControl.X = Application.GetRealWidth(104) > base.btnRoomName.Right ? Application.GetRealWidth(104) : base.btnRoomName.Right + Application.GetRealWidth(4);
+            if (batteryControl.Height > base.btnRoomName.Height)
+            {
+                //涓�涓槸25锛屼竴涓槸21锛屽紕涓嶅噯鍒板簳璋佹洿楂�,鍥犱负璁$畻鏂规硶涓嶄竴鏍�
+                batteryControl.Y = base.btnRoomName.Y - (batteryControl.Height - base.btnRoomName.Height) / 2;
+            }
+            else
+            {
+                batteryControl.Y = base.btnRoomName.Y + (batteryControl.Height - base.btnRoomName.Height) / 2;
+            }
+            batteryControl.InitControl(false);
+            batteryControl.SetValue(80);
+            var powerLowTipAttr = device.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState);
+            if (powerLowTipAttr != null)
+            {
+                if(powerLowTipAttr.state.ToLower() == "low")
+                {
+                    batteryControl.SetValue(20);
+                }
+            }
+            FrameWhiteCentet1.AddChidren(batteryControl);
+
+
             btnIcon = new IconViewControl(198)
             {
                 Gravity = Gravity.CenterHorizontal,
@@ -136,6 +162,19 @@
                         btnSuctionView.IsSelected = false;
                     }
                 }
+
+                var powerLowTipAttr = device.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState);
+                if (powerLowTipAttr != null)
+                {
+                    if (powerLowTipAttr.state.ToLower() == "low")
+                    {
+                        batteryControl.SetValue(20);
+                    }
+                    else
+                    {
+                        batteryControl.SetValue(80);
+                    }
+                }
             });
         }
 

--
Gitblit v1.8.0