From a5b3c4bae726ef6770d4bfcbf2f4b50a37ed4a15 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期五, 06 三月 2020 15:31:36 +0800
Subject: [PATCH] 删除了郭雪城的 DeviceUi 这个类

---
 ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs |   55 ++++++++++++++++++++++++++++---------------------------
 1 files changed, 28 insertions(+), 27 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
index 36efb69..f2442bc 100755
--- a/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
+++ b/ZigbeeApp/Shared/Phone/Device/AC/ACControl.cs
@@ -13,7 +13,7 @@
         /// <summary>
         /// The action.
         /// </summary>
-        public Action<DeviceUI, Common.Room> action;
+        public Action<CommonDevice, Common.Room> action;
 
         /// <summary>
         /// 鏀惰棌鎸夐挳
@@ -22,7 +22,7 @@
         /// <summary>
         /// 浼犺繃鏉ョ殑璁惧
         /// </summary>
-        private DeviceUI device;
+        private CommonDevice device;
         /// <summary>
         /// 浼犺繃鏉ョ殑鎴块棿
         /// </summary>
@@ -153,11 +153,11 @@
                     try
                     {
                         var deviceUI = device;
-                        if (deviceUI.CommonDevice == null)
+                        if (deviceUI == null)
                         {
                             return;
                         }
-                        if (deviceUI.CommonDevice.DeviceEpoint != common.DeviceEpoint || deviceUI.CommonDevice.DeviceAddr != common.DeviceAddr)
+                        if (deviceUI.DeviceEpoint != common.DeviceEpoint || deviceUI.DeviceAddr != common.DeviceAddr)
                         {
                             return;
                         }
@@ -169,20 +169,18 @@
                             {
                                 return;
                             }
-                            deviceUI.CommonDevice.DeviceStatusReport = common.DeviceStatusReport;
+                            deviceUI.DeviceStatusReport = common.DeviceStatusReport;
                             foreach(var attList in attriButeList)
                             {
-                                var curTemp = (attList.AttriButeData / 100 < ACControlBase.Temperature_High && attList.AttriButeData / 100 > ACControlBase.Temperature_Low) ? attList.AttriButeData / 100 : ACControlBase.Temperature_Default;
                                 switch (attList.AttributeId)
                                 {
                                     case 0:
-                                        ac.currentLocalTemperature = curTemp;
+                                        ac.currentLocalTemperature = attList.AttriButeData / 100;
                                         ac.LastDateTime = DateTime.Now;
                                         indoorTemperatureBtn.Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {ac.currentLocalTemperature} 鈩�";
-                                        //currentTemperatureBtn.Text = $"{ac.currentLocalTemperature} 鈩�";
                                         break;
                                     case 17:
-                                        ac.currentCoolingSetpoint = curTemp;
+                                        ac.currentCoolingSetpoint = attList.AttriButeData / 100;
                                         if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8)
                                         {
                                             mArcScaleSeekBar.Progress = ac.currentCoolingSetpoint;
@@ -190,7 +188,7 @@
                                         ac.LastDateTime = DateTime.Now;
                                         break;
                                     case 18:
-                                        ac.currentHeatingSetpoint = curTemp;
+                                        ac.currentHeatingSetpoint = attList.AttriButeData / 100;
                                         if (ac.currentSystemMode == 4)
                                         {
                                             mArcScaleSeekBar.Progress = ac.currentHeatingSetpoint;
@@ -198,7 +196,7 @@
                                         ac.LastDateTime = DateTime.Now;
                                         break;
                                     case 4096:
-                                        ac.currentAutoSetpoint = curTemp;
+                                        ac.currentAutoSetpoint = attList.AttriButeData / 100;
                                         if (ac.currentSystemMode == 1)
                                         {
                                             mArcScaleSeekBar.Progress = ac.currentAutoSetpoint;
@@ -217,6 +215,8 @@
                                             fanModeBtn.IsSelected = false;
                                             FanSwingModeBtn.IsSelected = false;
                                             mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor);
+                                            //濡傛灉鏄叧闂┖璋冪殑璇�,鐩存帴鍙樻殫鍗冲彲
+                                            return;
                                         }
                                         else if (ac.currentSystemMode == 1 || ac.currentSystemMode == 3 || ac.currentSystemMode == 4 || ac.currentSystemMode == 7 || ac.currentSystemMode == 8)
                                         {
@@ -291,16 +291,16 @@
                     {
                         var deviceUI = device;
                         //璁惧涓虹┖
-                        if (deviceUI.CommonDevice == null)
+                        if (deviceUI == null)
                         {
                             return;
                         }
                         //鏄惁涓哄綋鍓嶈澶�
-                        if (deviceUI.CommonDevice.DeviceEpoint != common.DeviceEpoint || deviceUI.CommonDevice.DeviceAddr != common.DeviceAddr)
+                        if (deviceUI.DeviceEpoint != common.DeviceEpoint || deviceUI.DeviceAddr != common.DeviceAddr)
                         {
                             return;
                         }
-                        if (deviceUI.CommonDevice.Type == DeviceType.Thermostat)
+                        if (deviceUI.Type == DeviceType.Thermostat)
                         {
                             ac.IsOnline = common.IsOnline;
                             ac.LastDateTime = DateTime.Now;
@@ -374,12 +374,12 @@
         /// </summary>
         /// <param name="dev">Device.</param>
         /// <param name="room">Room.</param>
-        public void Show(DeviceUI dev, Shared.Common.Room room)
+        public void Show(CommonDevice dev, Shared.Common.Room room)
         {
             device = dev;
-            zbGateway = this.device.CommonDevice.Gateway;
+            zbGateway = this.device.Gateway;
             this.room = room;
-            this.ac = device.CommonDevice as ZigBee.Device.AC;
+            this.ac = device as ZigBee.Device.AC;
             AddTop();
 
             AddBodyView(device);
@@ -393,7 +393,7 @@
                 //鍙戦�佽鍙栫姸鎬佸懡浠�
                 UserView.UserHomeView.ReadStatus(ac, () =>
                 {
-                    ReadDeviceAttributeLogic.Instance.SendACStatuComand(device.CommonDevice);
+                    ReadDeviceAttributeLogic.Instance.SendACStatuComand(device);
                 });
             }
             else
@@ -401,11 +401,11 @@
                 //闃叉鐭椂闂村唴澶氭璇诲彇璁惧鐘舵��
                 if ((DateTime.Now - ac.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan)
                 {
-                    ReadDeviceAttributeLogic.Instance.SendACStatuComand(device.CommonDevice);
+                    ReadDeviceAttributeLogic.Instance.SendACStatuComand(device);
                 }
             }
 
-            if (Common.Room.CurrentRoom.IsCollectInRoom(device.FileName)==false)
+            if (UserCenter.HdlRoomLogic.Current.IsCollectInRoom(device)==false)
             {
                 collectionBtn.IsSelected = false;
             }
@@ -449,7 +449,7 @@
         /// <summary>
         /// AddBodyView
         /// </summary>
-        public void AddBodyView(DeviceUI device)
+        public void AddBodyView(CommonDevice device)
         {
             bodyFrameLayout = new FrameLayout()
             {
@@ -492,7 +492,7 @@
                 Width = Application.GetRealWidth(600),
                 Height = Application.GetRealHeight(60),
                 Gravity = Gravity.CenterHorizontal,
-                Text = Common.LocalDevice.Current.GetDeviceEpointName(device.CommonDevice),
+                Text = Common.LocalDevice.Current.GetDeviceEpointName(device),
                 TextColor = ZigbeeColor.Current.GXCTextBlackColor,
                 TextSize = 15,
                 IsBold=true
@@ -1080,9 +1080,10 @@
                 ACControlBase.ShowACIsCloseTip();
                 return;
             }
-            modeBtn.IsSelected = true;
+
             modeBtn.SelectedImagePath = ACControlBase.GetModeSelectedImagePathByMode(acMode);
-            modeBtn.UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByMode(acMode);
+            modeBtn.UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByMode(acMode);
+            modeBtn.IsSelected = true;
             currentModeBtn.Text = ACControlBase.GetModeNameByMode(acMode);
             ac.currentSystemMode = (int)acMode;
             mArcScaleSeekBar.Progress = ACControlBase.GetCurrentModeTemperature(ac);
@@ -1403,7 +1404,7 @@
                 return;
             }
             var tempDevice = (CommonDevice)objValue;
-            if (tempDevice.DeviceEpoint != this.device.CommonDevice.DeviceEpoint || tempDevice.DeviceAddr != this.device.CommonDevice.DeviceAddr)
+            if (tempDevice.DeviceEpoint != this.device.DeviceEpoint || tempDevice.DeviceAddr != this.device.DeviceAddr)
             {
                 //涓嶆槸褰撳墠璁惧鐨勬帹閫侊紝鍒欎笉澶勭悊
                 return;
@@ -1459,12 +1460,12 @@
         {
             if (collectionBtn.IsSelected)
             {
-                Shared.Common.Room.Lists[0].DeleteDevice(device.FileName);
+                UserCenter.HdlRoomLogic.Current.DeleteLoveDevice(device);
                 collectionBtn.IsSelected = false;
             }
             else
             {
-                Shared.Common.Room.Lists[0].AddDevice(device.FileName);
+                UserCenter.HdlRoomLogic.Current.AddLoveDevice(device);
                 collectionBtn.IsSelected = true;
             }
         }

--
Gitblit v1.8.0