From b7b3e92bed9c4553e30e2901a1877f088a5f8823 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期一, 04 十一月 2019 17:20:52 +0800
Subject: [PATCH] 2019.11.4

---
 ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs |   91 ++++++++++++++++++++++++++-------------------
 1 files changed, 53 insertions(+), 38 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs b/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs
old mode 100755
new mode 100644
index 1d35185..ca472eb
--- a/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/UserHomeView.cs
@@ -72,8 +72,11 @@
         private readonly int sleepSpan = 300;
 
 
-        private FrameLayout itemView;
-
+        private FrameLayout itemView=new FrameLayout();
+        /// <summary>
+        /// floorBtn
+        /// </summary>
+        private Button floorBtn;
         #endregion
 
         #region 鈼� 鎺ュ彛____________________________
@@ -128,10 +131,10 @@
                             {
                                 case DeviceType.OnOffOutput:
                                     //寮�鍏冲姛鑳�
-                                    if (common.DeviceStatusReport.CluterID == 6)
+                                    if ((common as ZigBee.Device.ToggleLight).DeviceStatusReport.CluterID == 6)
                                     {
                                         var onOffOutputLight = deviceUI.CommonDevice as ZigBee.Device.ToggleLight;
-                                        onOffOutputLight.DeviceStatusReport = common.DeviceStatusReport;
+                                        onOffOutputLight.DeviceStatusReport = (common as ZigBee.Device.ToggleLight).DeviceStatusReport;
 
                                         //璁板綍銆佹洿鏂扮姸鎬�
                                         if (onOffOutputLight.DeviceStatusReport.AttriBute == null || onOffOutputLight.DeviceStatusReport.AttriBute.Count == 0)
@@ -149,10 +152,10 @@
 
                                 case DeviceType.AirSwitch:
                                     //寮�鍏冲姛鑳�
-                                    if (common.DeviceStatusReport.CluterID == 6)
+                                    if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 6)
                                     {
                                         var airSwitch = deviceUI.CommonDevice as ZigBee.Device.AirSwitch;
-                                        airSwitch.DeviceStatusReport = common.DeviceStatusReport;
+                                        airSwitch.DeviceStatusReport = (common as ZigBee.Device.AirSwitch).DeviceStatusReport;
                                         for (int j = 0; j < frameLayout.ChildrenCount; j++)
                                         {
                                             var tempView = frameLayout.GetChildren(j);
@@ -175,7 +178,7 @@
                                         }
                                     }
                                     //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
-                                    if (common.DeviceStatusReport.CluterID == 3)
+                                    if ((common as ZigBee.Device.AirSwitch).DeviceStatusReport.CluterID == 3)
                                     {
                                         var airSwitch = deviceUI.CommonDevice as AirSwitch;
                                         airSwitch.IsOnline = 1;
@@ -197,18 +200,18 @@
                                     break;
 
                                 case DeviceType.WindowCoveringDevice:
-                                    if (common.DeviceStatusReport.CluterID == 258)
+                                    if ((common as Rollershade).DeviceStatusReport.CluterID == 258)
                                     {
-                                        if (common.DeviceStatusReport.AttriBute[0].AttributeId == 0)
+                                        if ((common as Rollershade).DeviceStatusReport.AttriBute[0].AttributeId == 0)
                                         {
                                             //绐楀笜绫诲瀷
                                             var rollerShade = deviceUI.CommonDevice as Rollershade;
-                                            rollerShade.DeviceStatusReport = common.DeviceStatusReport;
-                                            rollerShade.WcdType = common.DeviceStatusReport.AttriBute[0].AttriButeData;
+                                            rollerShade.DeviceStatusReport = (common as Rollershade).DeviceStatusReport;
+                                            rollerShade.WcdType = (common as Rollershade).DeviceStatusReport.AttriBute[0].AttriButeData;
                                             rollerShade.LastDateTime = DateTime.Now;
                                         }
                                     }
-                                    if (common.DeviceStatusReport.CluterID == 3)
+                                    if ((common as ZigBee.Device.Rollershade).DeviceStatusReport.CluterID == 3)
                                     {
                                         var rollershade = deviceUI.CommonDevice as ZigBee.Device.Rollershade;
                                         rollershade.IsOnline = 1;
@@ -231,10 +234,10 @@
 
                                 case DeviceType.Thermostat:
                                     //AC鍔熻兘
-                                    if (common.DeviceStatusReport.CluterID == 513)
+                                    if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 513)
                                     {
                                         var ac = deviceUI.CommonDevice as ZigBee.Device.AC;
-                                        ac.DeviceStatusReport = common.DeviceStatusReport;
+                                        ac.DeviceStatusReport = (common as ZigBee.Device.AC).DeviceStatusReport;
                                         var attriButeList = ac.DeviceStatusReport.AttriBute;
                                         if (attriButeList == null || attriButeList.Count == 0)
                                         {
@@ -297,7 +300,7 @@
 
                                     }
                                     //褰揅luterID=3,灏辫瘉鏄庤璁惧鍦ㄧ嚎锛岀洿鎺ユ爣璁�
-                                    if (common.DeviceStatusReport.CluterID == 3)
+                                    if ((common as ZigBee.Device.AC).DeviceStatusReport.CluterID == 3)
                                     {
                                         var ac = deviceUI.CommonDevice as AC;
                                         ac.IsOnline = 1;
@@ -322,10 +325,10 @@
                                 case DeviceType.DimmableLight:
                                     //璋冨厜鐏姛鑳�
                                     //寮�鍏冲姛鑳�
-                                    if (common.DeviceStatusReport.CluterID == 6)
+                                    if ((common as DimmableLight).DeviceStatusReport.CluterID == 6)
                                     {
                                         var dimmableLight = deviceUI.CommonDevice as DimmableLight;
-                                        dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
+                                        dimmableLight.DeviceStatusReport = (common as DimmableLight).DeviceStatusReport;
                                         //璁板綍銆佹洿鏂扮姸鎬�
                                         if (dimmableLight.DeviceStatusReport.AttriBute == null || dimmableLight.DeviceStatusReport.AttriBute.Count == 0)
                                         {
@@ -339,10 +342,10 @@
                                     }
 
                                     //浜害
-                                    if (common.DeviceStatusReport.CluterID == 8)
+                                    if ((common as ZigBee.Device.DimmableLight).DeviceStatusReport.CluterID == 8)
                                     {
                                         var dimmableLight = deviceUI.CommonDevice as ZigBee.Device.DimmableLight;
-                                        dimmableLight.DeviceStatusReport = common.DeviceStatusReport;
+                                        dimmableLight.DeviceStatusReport = (common as ZigBee.Device.DimmableLight).DeviceStatusReport;
                                         var attriButeList = dimmableLight.DeviceStatusReport.AttriBute;
                                         if (attriButeList == null || attriButeList.Count == 0)
                                         {
@@ -452,7 +455,7 @@
             };
             topFrameLayout.AddChidren(floor);
 
-            var floorBtn = new Button
+            floorBtn = new Button
             {
                 X=floor.Right,
                 Width=Application.GetRealWidth(500),
@@ -492,18 +495,8 @@
             }
             AddChidren(residecneName);
 
-            EventHandler<MouseEventArgs> selectFloor = (send, e) =>
-              {
-                  var floorFL = new Phone.Device.Category.SelectFloor();
-                  AddChidren(floorFL);
-                  floorFL.Init(35,153);
-                  floorFL.FloorAction = (floorName) =>
-                  {
-                      floorBtn.Text = floorName;
-                  };
-              };
-            floor.MouseUpEventHandler += selectFloor;
-            floorBtn.MouseUpEventHandler += selectFloor;
+            floor.MouseUpEventHandler += SelectFloor;
+            floorBtn.MouseUpEventHandler += SelectFloor;
             //鍒囨崲浣忓畢
             residecneName.MouseLongEventHandler += (send, e) =>
             {
@@ -684,7 +677,7 @@
                 {
                     //Room.CurrentRoom = Room.CurrentRoom == null ? Room.Lists[0] : Room.CurrentRoom;
                     Room.CurrentRoom = Room.Lists[0];
-                    foreach (var room in Room.Lists)
+                    foreach (var room in Room.CurrentRoom.GetRoomsByCurrentFloorIdAppendLoveRoom())
                     {
                         var roomBackView = new FrameLayout()
                         {
@@ -729,7 +722,10 @@
                             //{
                             //    Show();
                             //};
-
+                            if(room.IsLove)
+                            {
+                                return;
+                            }
                             var editRoom = new Device.Room.EditRoom();
                             HomePage.Instance.AddChidren(editRoom);
                             HomePage.Instance.PageIndex += 1;
@@ -853,13 +849,15 @@
             {
                 ShowNoGatewayTip();
             }
-
+
         }
 
         #endregion
 
         #region 鈼� 鍒锋柊____________________________
-
+        /// <summary>
+        /// RefreshBodyView
+        /// </summary>
         public void RefreshBodyView()
         {
             if (Room.CanInitAllRoom == false)
@@ -875,6 +873,23 @@
             {
                 ShowScene();
             }
+        }
+
+        /// <summary>
+        /// SelectFloor
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="mouseEventArgs"></param>
+        public void SelectFloor(object sender,MouseEventArgs mouseEventArgs)
+        {
+            var floorFL = new Phone.Device.Category.SelectFloor();
+            AddChidren(floorFL);
+            floorFL.Init(35, 153);
+            floorFL.FloorAction = (floorName) =>
+            {
+                floorBtn.Text = floorName;
+                Show();
+            };
         }
 
         #endregion
@@ -975,8 +990,8 @@
         /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
         private void GoToAddGateWay(object sender, MouseEventArgs mouseEventArgs)
         {
-            var selectNewGateWayForm = new UserCenter.GatewayAdd.NewGateWayMenuSelectForm { };
-            selectNewGateWayForm.AddForm();
+            var selectNewGateWayForm = new UserCenter.GatewayAdd.NewGateWaySelectForm { };
+            selectNewGateWayForm.AddForm(selectNewGateWayForm);
         }
 
         #endregion

--
Gitblit v1.8.0