From dc0309e64f02227d8e1468b7326c07955f804612 Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期三, 22 六月 2022 11:22:18 +0800
Subject: [PATCH] 修改引用路径

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SafetySensorStatuControl.cs |  163 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 163 insertions(+), 0 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SafetySensorStatuControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SafetySensorStatuControl.cs
new file mode 100644
index 0000000..d7e93fe
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/SafetySensorStatuControl.cs
@@ -0,0 +1,163 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter
+{
+    /// <summary>
+    /// 瀹夐槻浼犳劅鍣ㄧ姸鎬佺殑鑷畾涔夋帶浠�
+    /// </summary>
+    public class SafetySensorStatuControl : FrameLayout
+    {
+        #region 鈻� 鍙橀噺澹版槑___________________________
+
+        /// <summary>
+        /// 鍦ㄧ嚎鐘舵��
+        /// </summary>
+        private NormalViewControl btnOnline = null;
+        /// <summary>
+        /// 淇℃伅鎻愮ず鍥炬爣
+        /// </summary>
+        private IconViewControl btnMsgIcon = null;
+        /// <summary>
+        /// 淇℃伅
+        /// </summary>
+        private NormalViewControl btnMsg = null;
+
+        #endregion
+
+        #region 鈻� 鍒濆鍖朹____________________________
+
+        /// <summary>
+        /// 瀹夐槻浼犳劅鍣ㄧ姸鎬佺殑鑷畾涔夋帶浠�
+        /// </summary>
+        public SafetySensorStatuControl()
+        {
+            this.Height = Application.GetRealHeight(256);
+            this.Width = Application.GetRealWidth(968);
+            this.Gravity = Gravity.CenterHorizontal;
+            this.BackgroundColor = UserCenterColor.Current.White;
+            this.Radius = (uint)Application.GetRealHeight(17);
+        }
+
+        /// <summary>
+        /// 鍒濆鍖栨帶浠�
+        /// </summary>
+        /// <param name="device">璁惧瀵硅薄</param>
+        public void InitControl(CommonDevice device)
+        {
+            //鍖哄煙
+            var btnArea = new NormalViewControl(400, 49, true);
+            btnArea.Y = Application.GetRealHeight(40);
+            btnArea.X = Application.GetRealWidth(46);
+            btnArea.TextSize = 12;
+            btnArea.TextColor = UserCenterColor.Current.TextGrayColor3;
+            btnArea.Text = HdlRoomLogic.Current.GetRoomNameByDevice(device);
+            this.AddChidren(btnArea);
+            //鐘舵��
+            var btnStatu = new NormalViewControl(200, 49, true);
+            btnStatu.Y = btnArea.Y;
+            btnStatu.X = this.Width - Application.GetRealWidth(200 + 46);
+            btnStatu.TextSize = 12;
+            btnStatu.TextAlignment = TextAlignment.CenterRight;
+            btnStatu.TextColor = UserCenterColor.Current.TextGrayColor1;
+            btnStatu.TextID = R.MyInternationalizationString.uStatu;
+            this.AddChidren(btnStatu);
+            //绾�
+            var btnLine = new NormalViewControl(Application.GetRealWidth(876), ControlCommonResourse.BottomLineHeight, false);
+            btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
+            btnLine.X = Application.GetRealWidth(46);
+            btnLine.Y = Application.GetRealHeight(104);
+            this.AddChidren(btnLine);
+            //璁惧鍚嶇О
+            var btnDeviceName = new NormalViewControl(400, 58, true);
+            btnDeviceName.X = Application.GetRealWidth(46);
+            btnDeviceName.Y = Application.GetRealHeight(141);
+            btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device);
+            this.AddChidren(btnDeviceName);
+            //鍦ㄧ嚎鐘舵��
+            btnOnline = new NormalViewControl(200, 58, true);
+            btnOnline.X = this.Width - Application.GetRealWidth(200 + 46);
+            btnOnline.Y = btnDeviceName.Y;
+            btnOnline.TextAlignment = TextAlignment.CenterRight;
+            this.SetOnlineStatu(Common.LocalDevice.Current.CheckDeviceIsOnline(device));
+            this.AddChidren(btnOnline);
+        }
+
+        #endregion
+
+        #region 鈻� 涓�鑸柟娉昣__________________________
+
+        /// <summary>
+        /// 璁剧疆鍦ㄧ嚎鐘舵��
+        /// </summary>
+        /// <param name="online"></param>
+        public void SetOnlineStatu(bool online)
+        {
+            if (online == false)
+            {
+                //绂荤嚎
+                btnOnline.TextID = R.MyInternationalizationString.uOffLine;
+                btnOnline.TextColor = UserCenterColor.Current.TextGrayColor1;
+            }
+            else
+            {
+                //鍦ㄧ嚎
+                btnOnline.TextID = R.MyInternationalizationString.uOnline;
+                btnOnline.TextColor = UserCenterColor.Current.TextColor1;
+            }
+        }
+
+        /// <summary>
+        /// 璁剧疆浼犳劅鍣ㄦ姤璀︿俊鎭�
+        /// </summary>
+        /// <param name="reportInfo"></param>
+        public void SetSensoReportInfo(IASZoneReportInfo reportInfo)
+        {
+            if (reportInfo == null)
+            {
+                return;
+            }
+            string strMsg = reportInfo.AlarmMsg;
+            if (reportInfo.DemolishmenMsg != null)
+            {
+                //琚媶鎶ヨ
+                strMsg = reportInfo.DemolishmenMsg;
+            }
+            else if (reportInfo.BatteryMsg != null)
+            {
+                //鐢垫睜鎶ヨ
+                strMsg = reportInfo.BatteryMsg;
+            }
+            if (strMsg == null || strMsg == string.Empty)
+            {
+                //涓嶆槸鍦ㄥ唽鐨勬姤璀︽秷鎭�
+                return;
+            }
+
+            //鍦ㄧ嚎鐘舵�佺殑鎺т欢闅愯棌
+            btnOnline.Visible = false;
+
+            if (btnMsg == null)
+            {
+                //鍥炬爣
+                btnMsgIcon = new IconViewControl(58);
+                btnMsgIcon.X = Application.GetRealWidth(864);
+                btnMsgIcon.Y = Application.GetRealHeight(141);
+                btnMsgIcon.UnSelectedImagePath = "Item/Tips.png";
+                this.AddChidren(btnMsgIcon);
+                //淇℃伅
+                btnMsg = new NormalViewControl(400, 58, true);
+                btnMsg.TextAlignment = TextAlignment.CenterRight;
+                btnMsg.TextColor = 0xfff34747;
+                btnMsg.X = this.Width - Application.GetRealWidth(400 + 115);
+                btnMsg.Y = Application.GetRealHeight(141);
+                this.AddChidren(btnMsg);
+            }
+            btnMsg.Text = strMsg;
+        }
+
+        #endregion
+    }
+}

--
Gitblit v1.8.0