From dfcb2a1844fd55b57bae23e290b30ec6380e8508 Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期五, 26 八月 2022 15:04:22 +0800
Subject: [PATCH] 更新全视通dll

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs |  280 +++++++++++++++++++++++++++++++------------------------
 1 files changed, 159 insertions(+), 121 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs
old mode 100755
new mode 100644
index 91b3a36..1ad53b0
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DeviceControls/DeviceInfoIconControl.cs
@@ -1,121 +1,159 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Text;
-using ZigBee.Device;
-
-namespace Shared.Phone.UserCenter
-{
-    /// <summary>
-    /// 璁惧淇℃伅鐣岄潰鐨勮澶囧浘鏍囨帶浠�(鍏煎缃戝叧)
-    /// </summary>
-    public class DeviceInfoIconControl : FrameLayout
-    {
-        #region 鈻� 鍙橀噺澹版槑___________________________
-
-        /// <summary>
-        /// 璁惧Mac鍦板潃
-        /// </summary>
-        private string deviceMac = null;
-        /// <summary>
-        /// 缃戝叧瀵硅薄
-        /// </summary>
-        private ZbGateway zbGateway = null;
-        /// <summary>
-        /// 鍥炬爣鎺т欢
-        /// </summary>
-        private NormalViewControl btnIcon = null;
-
-        #endregion
-
-        #region 鈻� 鍒濆鍖朹____________________________
-
-        /// <summary>
-        /// 璁惧淇℃伅鐣岄潰鐨勮澶囧浘鏍囨帶浠�
-        /// </summary>
-        public DeviceInfoIconControl()
-        {
-            //绗竴灞傚簳鑹�
-            this.Height = Application.GetMinRealAverage(207);
-            this.Width = Application.GetMinRealAverage(207);
-            this.BackgroundColor = UserCenterColor.Current.White;
-            this.Radius = (uint)Application.GetMinRealAverage(207) / 2;
-        }
-
-        /// <summary>
-        /// 鍒濆鍖�(璁惧)
-        /// </summary>
-        /// <param name="i_device">璁惧瀵硅薄</param>
-        public void InitControl(CommonDevice i_device)
-        {
-            this.deviceMac = i_device.DeviceAddr;
-            //绗簩灞傚簳鑹�
-            var btnIcon2 = new NormalViewControl(Application.GetMinRealAverage(184), Application.GetMinRealAverage(184), false);
-            btnIcon2.BackgroundColor = 0xfffef1ed;
-            btnIcon2.Radius = (uint)Application.GetMinRealAverage(184) / 2;
-            btnIcon2.Gravity = Gravity.Center;
-            this.AddChidren(btnIcon2);
-
-            //璁惧鍥炬爣
-            var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
-            if (listDevice.Count == 0)
-            {
-                //瀵瑰簲鍗曠函鍙湁200鍥炶矾鐨勮澶�
-                listDevice.Add(Common.LocalDevice.Current.GetOTADevice(deviceMac));
-            }
-            btnIcon = new NormalViewControl(Application.GetMinRealAverage(121), Application.GetMinRealAverage(121), false);
-            btnIcon.Gravity = Gravity.Center;
-            Common.LocalDevice.Current.SetDeviceObjectIconToControl(btnIcon, listDevice);
-            this.AddChidren(btnIcon);
-        }
-
-        /// <summary>
-        /// 鍒濆鍖�(缃戝叧)
-        /// </summary>
-        /// <param name="i_gateway">缃戝叧瀵硅薄</param>
-        public void InitControl(ZbGateway i_gateway)
-        {
-            this.zbGateway = i_gateway;
-            //绗簩灞傚簳鑹�
-            var btnIcon2 = new NormalViewControl(Application.GetMinRealAverage(184), Application.GetMinRealAverage(184), false);
-            btnIcon2.BackgroundColor = 0xfffef1ed;
-            btnIcon2.Radius = (uint)Application.GetMinRealAverage(184) / 2;
-            btnIcon2.Gravity = Gravity.Center;
-            this.AddChidren(btnIcon2);
-
-            //璁惧鍥炬爣
-            btnIcon = new NormalViewControl(Application.GetMinRealAverage(121), Application.GetMinRealAverage(121), false);
-            btnIcon.Gravity = Gravity.Center;
-            HdlGatewayLogic.Current.SetGatewayIcon(btnIcon, i_gateway);
-            this.AddChidren(btnIcon);
-        }
-
-        #endregion
-
-        #region 鈻� 涓�鑸柟娉昣__________________________
-
-        /// <summary>
-        /// 閲嶆柊鍒锋柊鎺т欢
-        /// </summary>
-        public void RefreshControl()
-        {
-            if (this.deviceMac != null)
-            {
-                //鍒锋柊鍥炬爣
-                var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
-                if (listDevice.Count == 0)
-                {
-                    //瀵瑰簲鍗曠函鍙湁200鍥炶矾鐨勮澶�
-                    listDevice.Add(Common.LocalDevice.Current.GetOTADevice(deviceMac));
-                }
-                Common.LocalDevice.Current.SetDeviceObjectIconToControl(btnIcon, listDevice);
-            }
-            else
-            {
-                //鍒锋柊鍥炬爣
-                HdlGatewayLogic.Current.SetGatewayIcon(btnIcon, this.zbGateway);
-            }
-        }
-
-        #endregion
-    }
-}
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter
+{
+    /// <summary>
+    /// 璁惧淇℃伅鐣岄潰鐨勮澶囧浘鏍囨帶浠�(鍏煎缃戝叧)
+    /// </summary>
+    public class DeviceInfoIconControl : FrameLayoutStatuControl
+    {
+        #region 鈻� 鍙橀噺澹版槑___________________________
+
+        /// <summary>
+        /// 璁惧Mac鍦板潃
+        /// </summary>
+        private string deviceMac = null;
+        /// <summary>
+        /// 璁惧绔偣
+        /// </summary>
+        private int deviceEpoint = -1;
+        /// <summary>
+        /// 缃戝叧瀵硅薄
+        /// </summary>
+        private ZbGateway zbGateway = null;
+        /// <summary>
+        /// 鍥炬爣鎺т欢
+        /// </summary>
+        private NormalViewControl btnIcon = null;
+
+        #endregion
+
+        #region 鈻� 鍒濆鍖朹____________________________
+
+        /// <summary>
+        /// 璁惧淇℃伅鐣岄潰鐨勮澶囧浘鏍囨帶浠�
+        /// </summary>
+        public DeviceInfoIconControl()
+        {
+            //绗竴灞傚簳鑹�
+            this.Height = this.GetPictrueRealSize(207);
+            this.Width = this.GetPictrueRealSize(207);
+            this.BackgroundColor = UserCenterColor.Current.White;
+            this.Radius = (uint)this.GetPictrueRealSize(207) / 2;
+            this.UseClickStatu = false;
+        }
+
+        /// <summary>
+        /// 鍒濆鍖�(璁惧)
+        /// </summary>
+        /// <param name="i_device">璁惧瀵硅薄</param>
+        public void InitControl(CommonDevice i_device)
+        {
+            this.deviceMac = i_device.DeviceAddr;
+            //闃叉鍑虹幇璇樊
+            int iconWidth = this.GetPictrueRealSize(207) - this.GetPictrueRealSize(12) - this.GetPictrueRealSize(12);
+            //绗簩灞傚簳鑹�
+            var btnIcon2 = new NormalViewControl(iconWidth, iconWidth, false);
+            btnIcon2.BackgroundColor = 0xfffef1ed;
+            btnIcon2.Radius = (uint)iconWidth / 2;
+            btnIcon2.Gravity = Gravity.Center;
+            this.AddChidren(btnIcon2, ChidrenBindMode.BindEvent);
+
+            //璁惧鍥炬爣
+            var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
+            if (listDevice.Count == 0)
+            {
+                //瀵瑰簲鍗曠函鍙湁200鍥炶矾鐨勮澶�
+                listDevice.Add(Common.LocalDevice.Current.GetOTADevice(deviceMac));
+            }
+            btnIcon = new NormalViewControl(this.GetPictrueRealSize(121), this.GetPictrueRealSize(121), false);
+            btnIcon.Gravity = Gravity.Center;
+            Common.LocalDevice.Current.SetDeviceObjectIconToControl(btnIcon, listDevice);
+            this.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
+        }
+
+        /// <summary>
+        /// 鍒濆鍖�(璁惧绔偣)
+        /// </summary>
+        /// <param name="i_device">璁惧瀵硅薄</param>
+        public void InitControl(string deviceMacAddr, int epoint)
+        {
+            this.deviceMac = deviceMacAddr;
+            this.deviceEpoint = epoint;
+            //闃叉鍑虹幇璇樊
+            int iconWidth = this.GetPictrueRealSize(207) - this.GetPictrueRealSize(12) - this.GetPictrueRealSize(12);
+            //绗簩灞傚簳鑹�
+            var btnIcon2 = new NormalViewControl(iconWidth, iconWidth, false);
+            btnIcon2.BackgroundColor = 0xfffef1ed;
+            btnIcon2.Radius = (uint)iconWidth / 2;
+            btnIcon2.Gravity = Gravity.Center;
+            this.AddChidren(btnIcon2, ChidrenBindMode.BindEvent);
+
+            //璁惧鍥炬爣
+            btnIcon = new NormalViewControl(this.GetPictrueRealSize(121), this.GetPictrueRealSize(121), false);
+            btnIcon.Gravity = Gravity.Center;
+            Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, Common.LocalDevice.Current.GetDevice(deviceMacAddr, epoint));
+            this.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
+        }
+
+        /// <summary>
+        /// 鍒濆鍖�(缃戝叧)
+        /// </summary>
+        /// <param name="i_gateway">缃戝叧瀵硅薄</param>
+        public void InitControl(ZbGateway i_gateway)
+        {
+            this.zbGateway = i_gateway;
+            //闃叉鍑虹幇璇樊
+            int iconWidth = this.GetPictrueRealSize(207) - this.GetPictrueRealSize(12) - this.GetPictrueRealSize(12);
+            //绗簩灞傚簳鑹�
+            var btnIcon2 = new NormalViewControl(iconWidth, iconWidth, false);
+            btnIcon2.BackgroundColor = 0xfffef1ed;
+            btnIcon2.Radius = (uint)iconWidth / 2;
+            btnIcon2.Gravity = Gravity.Center;
+            this.AddChidren(btnIcon2, ChidrenBindMode.BindEvent);
+
+            //璁惧鍥炬爣
+            btnIcon = new NormalViewControl(this.GetPictrueRealSize(121), this.GetPictrueRealSize(121), false);
+            btnIcon.Gravity = Gravity.Center;
+            HdlGatewayLogic.Current.SetGatewayIcon(btnIcon, i_gateway);
+            this.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
+        }
+
+        #endregion
+
+        #region 鈻� 涓�鑸柟娉昣__________________________
+
+        /// <summary>
+        /// 閲嶆柊鍒锋柊鎺т欢
+        /// </summary>
+        public void RefreshControl()
+        {
+            if (this.deviceEpoint != -1)
+            {
+                //鍒锋柊鍥炬爣
+                Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, Common.LocalDevice.Current.GetDevice(this.deviceMac, this.deviceEpoint));
+            }
+            else if (this.deviceMac != null)
+            {
+                //鍒锋柊鍥炬爣
+                var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
+                if (listDevice.Count == 0)
+                {
+                    //瀵瑰簲鍗曠函鍙湁200鍥炶矾鐨勮澶�
+                    listDevice.Add(Common.LocalDevice.Current.GetOTADevice(deviceMac));
+                }
+                Common.LocalDevice.Current.SetDeviceObjectIconToControl(btnIcon, listDevice);
+            }
+            else
+            {
+                //鍒锋柊鍥炬爣
+                HdlGatewayLogic.Current.SetGatewayIcon(btnIcon, this.zbGateway);
+            }
+        }
+
+        #endregion
+    }
+}

--
Gitblit v1.8.0