From b78a4d0ca90416d37fcbaf5e54b00f7eaab53919 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期一, 14 十月 2019 17:03:58 +0800
Subject: [PATCH] 2019-10-14-2

---
 ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs |   64 ++++++++++++++++++++++++--------
 1 files changed, 48 insertions(+), 16 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs
index 67c2a14..710c0fd 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs
@@ -87,7 +87,8 @@
                 Width = Application.GetRealWidth(400),
                 Height = Application.GetRealHeight(69),
                 Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.customroom,
+                //TextID = MyInternationalizationString.customroom,
+                Text = Config.Instance.Home.GetCurrentFloorName,
             };
             topRowLayout.AddChidren(foolrname);
             var dropdown = new Button
@@ -162,7 +163,7 @@
 
 
             ///妤煎眰鐐瑰嚮浜嬩欢
-            foolrname.MouseUpEventHandler += (sender, e) =>
+            EventHandler<MouseEventArgs> foorlclick = (sender, e) =>
             {
 
                 var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
@@ -173,6 +174,7 @@
                 };
                 var foolrbj = new VerticalScrolViewLayout
                 {
+
                     Width = Application.GetRealWidth(400),
                     Height = Application.GetRealHeight(600),
                     X = Application.GetRealWidth(1080 - 400 - 60),
@@ -181,11 +183,9 @@
                     Radius = (uint)Application.GetRealHeight(30),
                 };
                 flMain.AddChidren(foolrbj);
-                ///榛樿璋冭瘯
-                List<string> foolrlist = new List<string> { "涓�妤�", "浜屾ゼ", "涓夋ゼ" };
-
-                foreach (var foolr in foolrlist)
+                foreach (var foolr in Config.Instance.Home.FloorDics)
                 {
+
                     var foolrRowLayout = new FrameLayout
                     {
                         Height = Application.GetRealHeight(150),
@@ -196,34 +196,58 @@
                     {
                         Width = Application.GetRealWidth(250),
                         Height = Application.GetRealHeight(160),
-                        Text = foolr,
+                        Text = foolr.Value,
                         TextAlignment = TextAlignment.Center,
                         TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                         //SelectedTextColor=0xfffc744b,
+                        Tag = foolr.Key,
                     };
                     foolrRowLayout.AddChidren(btnfoolrname);
 
 
-                    EventHandler<MouseEventArgs> foolrclick = (sender13, e13) =>
+                    EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) =>
                     {
                         roomhorizontalScrol.RemoveAll();
                         foolrname.Text = btnfoolrname.Text;
                         flMain.RemoveFromParent();
-                        ///澶囨敞锛氭樉绀洪�変腑妤煎眰鐨勬墍鏈夋埧闂�
-                        AllRoomView(Common.Room.Lists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
-
+                        var list = Send.GetRoomList(btnfoolrname.Tag.ToString());
+                        AllRoomView(list, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
                     };
-                    foolrRowLayout.MouseUpEventHandler += foolrclick;
-                    btnfoolrname.MouseUpEventHandler += foolrclick;
+                    foolrRowLayout.MouseUpEventHandler += foolrnameclick;
+                    btnfoolrname.MouseUpEventHandler += foolrnameclick;
 
 
                 }
 
-
-
             };
+            foolrname.MouseUpEventHandler += foorlclick;
+            dropdown.MouseUpEventHandler += foorlclick;
             ///绗竴娆¤繘鏉�
-            AllRoomView(Common.Room.Lists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
+            var roomlists = new List<Common.Room>();
+            roomlists.Clear();
+            if (Config.Instance.Home.FloorDics.Count < 1)
+            {
+                foolrname.Visible = false;
+                dropdown.Visible = false;
+                if (Config.Instance.Home.FloorDics.Count == 0)
+                {
+                    roomlists.AddRange(Common.Room.Lists);
+                }
+                else
+                {
+                    roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
+                }
+            }
+            else
+            {
+                roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
+
+            }
+
+
+            AllRoomView(roomlists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
+
+
         }
         /// <summary>
         /// 鍔犺浇鎵�鏈夋埧闂寸殑瑙嗗浘鏂规硶
@@ -275,6 +299,10 @@
                     var list = new List<DeviceUI>();
                     foreach (var device in room.DeviceUIList)
                     {
+                        if (device.CommonDevice == null)
+                        {
+                            continue;
+                        }
                         if (!deviceTypeList.Contains(device.CommonDevice.Type))
                         {
                             continue;
@@ -298,6 +326,10 @@
                     var list = new List<DeviceUI>();
                     foreach (var device in room.DeviceUIList)
                     {
+                        if (device.CommonDevice == null)
+                        {
+                            continue;
+                        }
                         if (!deviceTypeList.Contains(device.CommonDevice.Type))
                         {
                             continue;

--
Gitblit v1.8.0