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/SensorPirPage.cs | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 40 insertions(+), 2 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorPirPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorPirPage.cs index 9655256..ebeb336 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorPirPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SensorPirPage.cs @@ -46,11 +46,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, @@ -133,8 +160,6 @@ btnSuctionView.IsSelected = false; } } - - else { temp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.AlarmStatus); @@ -151,6 +176,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