HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-12-30 3dcbd186c42c598c0c08d1cd37034cf2baa09e54
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
@@ -26,9 +26,10 @@
        /// 构造函数
        /// </summary>
        /// <param name="doorLock"></param>
        public AddScenePage(ZigBee.Device.Panel key)
        public AddScenePage(ZigBee.Device.Panel key, List<ScenesListInfo> gwScenesList)
        {
            this.currentKey = key;
            gwCurScenesList = gwScenesList;
        }
        #region ◆ 变量申明__________________________
@@ -46,6 +47,7 @@
        Button btnFloorText;
        Dictionary<string, string> dicFloor;//楼层列表
        List<SceneUI> currentKeyAllRoomSceneList = new List<SceneUI>();
        public List<ScenesListInfo> gwCurScenesList = new List<ScenesListInfo>();//网关中的场景列表
        #endregion
        /// <summary>
@@ -76,7 +78,8 @@
                X = Application.GetRealWidth(15),
                Text = Language.StringByID(R.MyInternationalizationString.FirstFloor),
                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                TextSize = 15,
                TextSize = 14,
                IsBold =true,
                TextAlignment = TextAlignment.CenterRight,
            };
            btnAddFrameLayout.AddChidren(btnFloorText);
@@ -143,6 +146,7 @@
                TextID = R.MyInternationalizationString.Save,
                BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                IsBold =true,
                TextSize = 16,
            };
            bottomFrameLayout.AddChidren(btnFinifh);
@@ -558,7 +562,14 @@
            }
            Button oldScene = null;
            int curIndex = 0;
            foreach (var scene in curRoom.SceneUIList)
            var currentSceneUIList = GetMatchSceneUIList(curRoom);
            if (currentSceneUIList.Count == 0)
            {
                btnFinifh.Enable = false;
                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
                return;
            }
            foreach (var scene in currentSceneUIList)
            {
                #region 绑定表UI显(无数据处理)
                var rowLayout = new FrameLayout()
@@ -584,6 +595,7 @@
                    X = devicePic.Right + Application.GetRealWidth(20),
                    TextColor = Shared.Common.ZigbeeColor.Current.TextBlack,
                    TextAlignment = TextAlignment.CenterLeft,
                    TextSize =15,
                };
                rowLayout.AddChidren(btnBindName);
@@ -741,8 +753,9 @@
                Height = Application.GetRealHeight(58),
                X = Application.GetRealWidth(81),
                Y = Application.GetRealHeight(81),
                TextColor = Shared.Common.ZigbeeColor.Current.XMGray3,
                TextColor = Shared.Common.ZigbeeColor.Current.XMBlack,
                TextSize = 14,
                IsBold = true,
                TextAlignment = TextAlignment.CenterLeft,
                TextID = R.MyInternationalizationString.SelectFloor,
            };
@@ -793,6 +806,7 @@
                if (currentKey.currentSelectFloorId == floorId)
                {
                    btnAllMethod.IsSelected = true;
                    btnAllMethod.IsBold = true;
                    btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                }
@@ -820,6 +834,7 @@
                        oldbuttonText = btnMethodText;
                        btnMethodText.IsSelected = true;
                        oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                        oldbuttonText.IsBold = true;
                    }
                    //获取楼层对应的房间
@@ -887,6 +902,20 @@
            }
            return currentKeyAllRoomSceneList;
        }
        //获取网关中存在的本地场景列表
        List<SceneUI> GetMatchSceneUIList(Shared.Common.Room curRoom)
        {
            var tempSceneUIList = new List<SceneUI>();
            foreach (var scene in curRoom.SceneUIList)
            {
                var gwSc = gwCurScenesList.Find(obj => (obj.ScenesId == scene.Id));
                if (gwSc != null)
                {
                    tempSceneUIList.Add(scene);
                }
            }
            return tempSceneUIList;
        }
        public void DeviceInfoChange(CommonDevice common, string typeTag)
        {