From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 09:07:13 +0800
Subject: [PATCH] 新云端Ver1.3

---
 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs |   44 +++++++++++++++++++++++++++++++-------------
 1 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs
index 69f42ef..9322e2d 100755
--- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs
+++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs
@@ -101,22 +101,22 @@
             //璁惧鍥炬爣鎺т欢
             this.btnDeviceIcon = new IconViewControl(78);
             btnDeviceIcon.Gravity = Gravity.Center;
-            Common.LocalDevice.Current.SetDeviceIconToControl(btnDeviceIcon, i_device);
+            HdlDeviceCommonLogic.Current.SetDeviceIconToControl(btnDeviceIcon, i_device);
             frameIconBackGroud.AddChidren(btnDeviceIcon);
             //閲嶆柊缁戝畾浜嬩欢
             this.frameTable.ChangedChidrenBindMode(frameIconBackGroud, ChidrenBindMode.BindEvent);
 
             //璁惧鍚嶅瓧
             this.btnDeviceName = new NormalViewControl(600, 60, true);
-            if (this.device.Type == DeviceType.WindowCoveringDevice)
+            if (this.device.Type == DeviceType.WindowCoveringDevice || this.device.Type == DeviceType.Airer)
             {
-                //绐楀笜鍥犱负鍙宠竟鏈変笁涓寜閽�,鎵�浠ラ渶瑕佹墍鏈夊悕瀛楃殑瀹藉害
+                //绐楀笜鍥犱负鍙宠竟鏈変笁涓寜閽�,鎵�浠ラ渶瑕佺缉灏忓悕瀛楃殑瀹藉害
                 this.btnDeviceName.Width = Application.GetRealWidth(360);
             }
             btnDeviceName.X = Application.GetRealWidth(181);
             //褰撴寚瀹氬疄闄呭潗鏍囨椂,杩欓噷闇�瑕佺殑鍋忕Щ閲忎负2鍊�
             btnDeviceName.Y = Application.GetRealHeight(16) + this.chidrenYaxis * 2;
-            btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(i_device);
+            btnDeviceName.Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(i_device);
             btnDeviceName.SelectedTextColor = Common.ZigbeeColor.Current.GXCTextSelectedColor;
             this.frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEvent);
             
@@ -140,9 +140,9 @@
             }
 
             //搴曠嚎
-            var btnBottomLine = new NormalViewControl(Application.GetRealWidth(841), ControlCommonResourse.BottomLineHeight, false);
+            var btnBottomLine = new NormalViewControl(Application.GetRealWidth(841), HdlControlResourse.BottomLineHeight, false);
             btnBottomLine.X = Application.GetRealWidth(181);
-            btnBottomLine.Y = this.Height - ControlCommonResourse.BottomLineHeight;
+            btnBottomLine.Y = this.Height - HdlControlResourse.BottomLineHeight;
             btnBottomLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
             this.frameTable.AddChidren(btnBottomLine, ChidrenBindMode.NotBind);
 
@@ -224,6 +224,8 @@
                         //鍥炶皟鎺т欢琚Щ闄ょ殑浜嬩欢
                         this.RowNeedRemoveEvent?.Invoke();
                         this.RemoveFromParent();
+                        //涓婁紶绌洪棿鍖哄煙淇℃伅
+                        HdlRoomLogic.Current.SetRoomInfoToGateway();
                     };
                 };
             }
@@ -243,7 +245,7 @@
         {
             this.frameTable.AddChidren(this.btnSwitch, ChidrenBindMode.NotBind);
             btnSwitch.InitControl();
-            btnSwitch.X -= ControlCommonResourse.XXLeft;
+            btnSwitch.X -= HdlControlResourse.XXLeft;
             btnSwitch.Y += this.chidrenYaxis;
 
             return btnSwitch;
@@ -260,9 +262,9 @@
         public virtual void RefreshControlInfo(CommonDevice i_device)
         {
             //璁惧鍥炬爣涔熷埛鏂�
-            Common.LocalDevice.Current.SetDeviceIconToControl(btnDeviceIcon, i_device);
+            HdlDeviceCommonLogic.Current.SetDeviceIconToControl(btnDeviceIcon, i_device);
             //璁惧鍚嶅瓧
-            this.btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(i_device);
+            this.btnDeviceName.Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(i_device);
             //妫�娴嬭澶囨槸鍚︽槸鎵撳紑鐘舵��
             bool isOpen = this.CheckIsOpenStatu(i_device);
             if (this.isHadOpenSwitch == true && i_device.HadReadDeviceStatu == false)
@@ -271,6 +273,13 @@
                 //绛夊緟缃戝叧鍥炲鍚庝細閲嶆柊鍒锋柊,涓嶇劧涓�鐩存槸鍏抽棴鐘舵��
                 isOpen = false;
             }
+            //濡傛灉鏄紶鎰熷櫒绫�,鍒欓粯璁ゆ槸鍏崇殑鏁堟灉
+            if (this.device.Type == DeviceType.PMSensor || this.device.Type == DeviceType.IASZone
+                || this.device.Type == DeviceType.TemperatureSensor)
+            {
+                isOpen = false;
+            }
+
             this.SetRowOpenStatu(isOpen);
         }
 
@@ -283,7 +292,7 @@
             //璁惧鐘舵�佸繀椤诲埛鏂�
             if (this.btnStatu != null)
             {
-                this.btnStatu.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device);
+                this.btnStatu.Text = HdlDeviceCommonLogic.Current.GetMainPageDeviceStatuText(this.device);
             }
             //寮�鍏虫帶浠�
             if (this.btnSwitch != null && this.btnSwitch.IsSelected != isOpen)
@@ -346,7 +355,7 @@
             //濡傛灉杩欎釜鍑芥暟琚噸鍐欑殑璇�,鍒欎唬琛ㄨ繖涓澶囨湁寮�鍏冲姛鑳�
             this.isHadOpenSwitch = false;
             //榛樿鐢ㄥ湪绾跨姸鎬佹潵鍒ゆ柇
-            return Common.LocalDevice.Current.CheckDeviceIsOnline(i_device);
+            return HdlDeviceCommonLogic.Current.CheckDeviceIsOnline(i_device);
         }
 
 
@@ -443,6 +452,15 @@
             this.ResponeResult = 1;
         }
 
+        /// <summary>
+        /// 鎺ユ敹缃戝叧鍥炲鐨勭姸鎬�(true:宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍥炲 false:杩樻病鏈夋帴鏀跺埌缃戝叧鍥炲)
+        /// </summary>
+        /// <returns></returns>
+        public bool ReceiveResponeResultStatu()
+        {
+            return this.ResponeResult == 1;
+        }
+
         #endregion
 
         #region 鈻� 鏄剧ず浣庣數閲廮________________________
@@ -508,7 +526,7 @@
         public void StartRowLightAppeal()
         {
             //璁惧鐘舵�佸繀椤诲埛鏂�
-            this.btnStatu.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device);
+            this.btnStatu.Text = HdlDeviceCommonLogic.Current.GetMainPageDeviceStatuText(this.device);
 
             if (this.isAppeal == true) { return; }
             this.isAppeal = true;
@@ -545,7 +563,7 @@
         /// <summary>
         /// 鍒囨崲鍗$墖鐘舵�佺壒鏁�
         /// </summary>
-        private void SwitchRowStatuAppeal(bool isOpen)
+        public void SwitchRowStatuAppeal(bool isOpen)
         {
             if (this.btnDeviceName.IsSelected == isOpen)
             {

--
Gitblit v1.8.0