From 8b4d79ca03495e522a1953e04ca17527f33c853a Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 28 十月 2019 13:22:17 +0800
Subject: [PATCH] 合并完成代码

---
 ZigbeeApp/Shared/Phone/UserView/UserPage.cs |  134 ++++++++++++++++++++++++++------------------
 1 files changed, 80 insertions(+), 54 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
index 2166285..bcfbb8e 100755
--- a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using Shared.Common;
 using ZigBee.Device;
+using Shared.Phone.Device.AC;
 
 namespace Shared.Phone.UserView
 {
@@ -20,25 +21,25 @@
         /// </summary>
         private static readonly int tabBarEnum_Width = CommonPage.AppRealWidth / 3;
         /// <summary>
-        /// 搴曢儴鎸夐挳鍥剧墖鐨勯珮搴�-110
+        /// 搴曢儴鎸夐挳鍥剧墖鐨勯珮搴�
         /// </summary>
-        private static readonly int tabBarEnumIMG_Height = 110;
+        private static readonly int tabBarEnumIMG_Height = 98;
         /// <summary>
-        /// 搴曢儴鎸夐挳鍥剧墖鐨勫搴�-110
+        /// 搴曢儴鎸夐挳鍥剧墖鐨勫搴�
         /// </summary>
-        private static readonly int tabBarEnumIMG_Width = 110;
+        private static readonly int tabBarEnumIMG_Width = 138;
         /// <summary>
-        /// 搴曢儴鎸夐挳鍥剧墖鐨刌鍊� -5
+        /// 搴曢儴鎸夐挳鍥剧墖鐨刌鍊�
         /// </summary>
-        private static readonly int tabBarEnumIMG_Y = 5;
+        private static readonly int tabBarEnumIMG_Y = 3;
         /// <summary>
-        /// 搴曢儴鎸夐挳鏂囧瓧鐨勯珮搴� -50
+        /// 搴曢儴鎸夐挳鏂囧瓧鐨勯珮搴�
         /// </summary>
-        private static readonly int tabBarEnumName_Height = 50;
+        private static readonly int tabBarEnumName_Height = 40;
         /// <summary>
-        /// 搴曢儴鎸夐挳鏂囧瓧鐨刌鍊� 100
+        /// 搴曢儴鎸夐挳鏂囧瓧鐨刌鍊�
         /// </summary>
-        private static readonly int tabBarEnumName_Y = tabBarEnumIMG_Height - 10;
+        private static readonly int tabBarEnumName_Y = 104;
         #endregion
 
         #region 鈼� 鎺ュ彛____________________________
@@ -88,10 +89,10 @@
                         {
                             case DeviceType.OnOffOutput:
                                 //寮�鍏冲姛鑳�
-                                if ((common as ZigBee.Device.ToggleLight).DeviceStatusReport.CluterID == 6)
+                                if (common.DeviceStatusReport.CluterID == 6)
                                 {
                                     var onOffOutputLight = deviceUI.CommonDevice as ZigBee.Device.ToggleLight;
-                                    onOffOutputLight.DeviceStatusReport = (common as ZigBee.Device.ToggleLight).DeviceStatusReport;
+                                    onOffOutputLight.DeviceStatusReport = common.DeviceStatusReport;
                                     //璁板綍銆佹洿鏂扮姸鎬�
                                     if (onOffOutputLight.DeviceStatusReport.AttriBute == null || onOffOutputLight.DeviceStatusReport.AttriBute.Count == 0)
                                     {
@@ -102,7 +103,7 @@
                                     onOffOutputLight.LastDateTime = DateTime.Now;
                                 }
                                 //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
-                                if ((common as ZigBee.Device.ToggleLight).DeviceStatusReport.CluterID == 3)
+                                if (common.DeviceStatusReport.CluterID == 3)
                                 {
                                     var onOffOutputLight = deviceUI.CommonDevice as ToggleLight;
                                     onOffOutputLight.IsOnline = 1;
@@ -113,10 +114,10 @@
 
                             case DeviceType.AirSwitch:
                                 //寮�鍏冲姛鑳�
-                                if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 6)
+                                if (common.DeviceStatusReport.CluterID == 6)
                                 {
                                     var airSwitch = deviceUI.CommonDevice as ZigBee.Device.AirSwitch;
-                                    airSwitch.DeviceStatusReport = (common as ZigBee.Device.AirSwitch).DeviceStatusReport;
+                                    airSwitch.DeviceStatusReport = common.DeviceStatusReport;
                                     //璁板綍銆佹洿鏂扮姸鎬�
                                     if (airSwitch.DeviceStatusReport.AttriBute == null || airSwitch.DeviceStatusReport.AttriBute.Count == 0)
                                     {
@@ -128,7 +129,7 @@
 
                                 }
                                 //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
-                                if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 3)
+                                if (common.DeviceStatusReport.CluterID == 3)
                                 {
                                     var airSwitch = deviceUI.CommonDevice as AirSwitch;
                                     airSwitch.IsOnline = 1;
@@ -138,7 +139,24 @@
                                 break;
 
                             case DeviceType.WindowCoveringDevice:
-                                if ((common as ZigBee.Device.Rollershade).DeviceStatusReport.CluterID == 3)
+                                if (common.DeviceStatusReport.CluterID == 258)
+                                {
+                                    var rollershade = deviceUI.CommonDevice as ZigBee.Device.Rollershade;
+                                    rollershade.DeviceStatusReport = common.DeviceStatusReport;
+                                    var attriButeList = rollershade.DeviceStatusReport.AttriBute;
+                                    if (attriButeList == null || attriButeList.Count == 0)
+                                    {
+                                        continue;
+                                    }
+                                    switch (attriButeList[0].AttributeId)
+                                    {
+                                        case 0:
+                                            rollershade.WcdType = attriButeList[0].AttriButeData;
+                                            rollershade.LastDateTime = DateTime.Now;
+                                            break;
+                                    }
+                                }
+                                if (common.DeviceStatusReport.CluterID == 3)
                                 {
                                     var rollershade = deviceUI.CommonDevice as ZigBee.Device.Rollershade;
                                     rollershade.IsOnline = 1;
@@ -149,10 +167,10 @@
 
                             case DeviceType.Thermostat:
                                 //AC鍔熻兘
-                                if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 513)
+                                if (common.DeviceStatusReport.CluterID == 513)
                                 {
                                     var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
-                                    ac.DeviceStatusReport = (common as ZigBee.Device.AC).DeviceStatusReport;
+                                    ac.DeviceStatusReport = common.DeviceStatusReport;
                                     var attriButeList = ac.DeviceStatusReport.AttriBute;
                                     if (attriButeList == null || attriButeList.Count == 0)
                                     {
@@ -178,6 +196,12 @@
                                             ac.LastDateTime = DateTime.Now;
                                             break;
 
+                                        case 4096:
+                                            //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勮嚜鍔ㄦ俯搴︼紝瀹為檯娓╁害涓衡�淎utoSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
+                                            ac.currentAutoSetpoint = (attriButeList[0].AttriButeData / 100 > ACControlBase.Temperature_High || attriButeList[0].AttriButeData / 100 < ACControlBase.Temperature_Low) ? attriButeList[0].AttriButeData / 100 : ACControlBase.Temperature_Default;
+                                            ac.LastDateTime = DateTime.Now;
+                                            break;
+
                                         case 28:
                                             //姝ゅ睘鎬ф弿杩版亽娓╄澶囨澶勪簬鍝妯″紡
                                             //Off = 0  Auto = 1 Cool = 3 Heat = 4 FanOnly = 7  Dry = 8
@@ -189,7 +213,7 @@
 
                                 }
                                 //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
-                                if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 3)
+                                if (common.DeviceStatusReport.CluterID == 3)
                                 {
                                     var ac = deviceUI.CommonDevice as AC;
                                     ac.IsOnline = 1;
@@ -202,10 +226,10 @@
                             case DeviceType.DimmableLight:
                                 //璋冨厜鐏姛鑳�
                                 //寮�鍏冲姛鑳�
-                                if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 6)
+                                if (common.DeviceStatusReport.CluterID == 6)
                                 {
                                     var dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight;
-                                    dimmableLight.DeviceStatusReport = (common as ZigBee.Device.DimmableLight).DeviceStatusReport;
+                                    dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
                                     //璁板綍銆佹洿鏂扮姸鎬�
                                     if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0)
                                     {
@@ -216,10 +240,10 @@
                                     dimmableLight.LastDateTime = DateTime.Now;
                                 }
                                 //浜害
-                                if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 8)
+                                if (common.DeviceStatusReport.CluterID == 8)
                                 {
                                     var dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight;
-                                    dimmableLight.DeviceStatusReport = (common as ZigBee.Device.DimmableLight).DeviceStatusReport;
+                                    dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
                                     var attriButeList = dimmableLight.DeviceStatusReport.AttriBute;
                                     if (attriButeList == null || attriButeList.Count == 0)
                                     {
@@ -235,7 +259,7 @@
                                     }
                                 }
                                 //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
-                                if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 3)
+                                if (common.DeviceStatusReport.CluterID == 3)
                                 {
                                     var dimmableLight = deviceUI.CommonDevice as DimmableLight;
                                     dimmableLight.IsOnline = 1;
@@ -273,31 +297,31 @@
                         {
                             case DeviceType.OnOffOutput:
                                 var onOffOutputLight = deviceUI.CommonDevice as ToggleLight;
-                                onOffOutputLight.IsOnline = (common as ToggleLight).IsOnline;
+                                onOffOutputLight.IsOnline = common.IsOnline;
                                 //璁板綍鍥炲鏃堕棿
                                 onOffOutputLight.LastDateTime = DateTime.Now;
                                 break;
                             case DeviceType.AirSwitch:
                                 var airSwitch = deviceUI.CommonDevice as AirSwitch;
-                                airSwitch.IsOnline = (common as AirSwitch).IsOnline;
+                                airSwitch.IsOnline = common.IsOnline;
                                 //璁板綍鍥炲鏃堕棿
                                 airSwitch.LastDateTime = DateTime.Now;
                                 break;
                             case DeviceType.WindowCoveringDevice:
                                 var rollershade = deviceUI.CommonDevice as ZigBee.Device.Rollershade;
-                                rollershade.IsOnline = (common as Rollershade).IsOnline;
+                                rollershade.IsOnline = common.IsOnline;
                                 //璁板綍鍥炲鏃堕棿
                                 rollershade.LastDateTime = DateTime.Now;
                                 break;
                             case DeviceType.Thermostat:
                                 var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
-                                ac.IsOnline = (common as ZigBee.Device.AC).IsOnline;
+                                ac.IsOnline = common.IsOnline;
                                 //璁板綍鍥炲鏃堕棿
                                 ac.LastDateTime = DateTime.Now;
                                 break;
                             case DeviceType.DimmableLight:
                                 var dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight;
-                                dimmableLight.IsOnline = (common as ZigBee.Device.DimmableLight).IsOnline;
+                                dimmableLight.IsOnline = common.IsOnline;
                                 //璁板綍鍥炲鏃堕棿
                                 dimmableLight.LastDateTime = DateTime.Now;
                                 break;
@@ -368,8 +392,18 @@
         {
             Y = Application.GetRealHeight(CommonPage.AppRealHeight - CommonPage.TabbarHeight),
             Height = Application.GetRealHeight(CommonPage.TabbarHeight),
-            BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor,
+            BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCBottomColor,
         };
+
+        #region 鍒嗗壊绾�
+
+        private Button bottomLine = new Button
+        {
+            Height = 1,
+            BackgroundColor = ZigbeeColor.Current.GXCBottomLineColor
+        };
+
+        #endregion
 
         #region 搴曢儴-涓婚〉鎸夐挳
         /// <summary>
@@ -402,10 +436,11 @@
             Y = Application.GetRealHeight(tabBarEnumName_Y),
             Height = Application.GetRealHeight(tabBarEnumName_Height),
             TextID = R.MyInternationalizationString.HomePage,
-            TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor,
-            SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlueColor,
+            TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor,
+            SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2,
             IsSelected = true,
-            Gravity = Gravity.CenterHorizontal
+            Gravity = Gravity.CenterHorizontal,
+            TextSize = 10
         };
         #endregion
 
@@ -439,10 +474,11 @@
             Y = Application.GetRealHeight(tabBarEnumName_Y),
             Height = Application.GetRealHeight(tabBarEnumName_Height),
             TextID = R.MyInternationalizationString.Category,
-            TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor,
-            SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlueColor,
+            TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor,
+            SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2,
             IsSelected = false,
-            Gravity = Gravity.CenterHorizontal
+            Gravity = Gravity.CenterHorizontal,
+            TextSize=10
         };
         #endregion
 
@@ -476,27 +512,17 @@
             Y = Application.GetRealHeight(tabBarEnumName_Y),
             Height = Application.GetRealHeight(tabBarEnumName_Height),
             TextID = R.MyInternationalizationString.Me,
-            TextColor = ZigbeeColor.Current.GXCTextBlackColor,
-            SelectedTextColor = ZigbeeColor.Current.GXCTextBlueColor,
+            TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor,
+            SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2,
             IsSelected = false,
-            Gravity = Gravity.CenterHorizontal
+            Gravity = Gravity.CenterHorizontal,
+            TextSize = 10
         };
         #endregion
 
-        #region 鍒嗗壊绾�
-
-        private FrameLayout bottomLine = new FrameLayout
-        {
-            Height = 3,
-            BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
-        };
-
-        #endregion
 
         EventHandler<MouseEventArgs> BottomEventHandler = (sender, e) =>
         {
-            Room.GetAllRoomDeviceUIList();
-
             Instance.homePageName.IsSelected = false;
             Instance.homePageIMG.IsSelected = false;
 
@@ -530,7 +556,7 @@
                  //涓汉涓績
                 Instance.settingName.IsSelected = true;
                 Instance.settingIMG.IsSelected = true;
-                var form = new UserCenter.User.UserMainForm();
+                var form = new UserCenter.UserMain.UserMainForm();
                 Instance.BodyView.AddChidren(form);
                 form.ShowForm();
             }
@@ -557,6 +583,8 @@
             AddChidren(BodyView);
             AddChidren(BottomMenuView);
 
+            BottomMenuView.AddChidren(Instance.bottomLine);
+
             Instance.homePageFL.AddChidren(Instance.homePageIMG);
             Instance.homePageFL.AddChidren(Instance.homePageName);
             BottomMenuView.AddChidren(Instance.homePageFL);
@@ -568,8 +596,6 @@
             Instance.settingFL.AddChidren(Instance.settingIMG);
             Instance.settingFL.AddChidren(Instance.settingName);
             BottomMenuView.AddChidren(Instance.settingFL);
-
-            BottomMenuView.AddChidren(Instance.bottomLine);
 
             homePageIMG.MouseUpEventHandler += BottomEventHandler;
             homePageName.MouseUpEventHandler += BottomEventHandler;

--
Gitblit v1.8.0