黄学彪
2020-03-23 cc0d80c7d86c6d0167269b3408c4b30c24ce84e9
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs
@@ -10,19 +10,8 @@
namespace Shared.Phone.UserCenter.DeviceBind
{
    public class AddScenePage : BindCommonLayout, ZigBee.Common.IStatus
    public class AddScenePage : BindCommonLayout
    {
        /// <summary>
        /// 按键模式接收
        /// </summary>
        /// <param name="common">Common.</param>
        public void Changed(CommonDevice common)
        {
            Shared.Application.RunOnMainThread(() =>
            {
            });
        }
        /// 构造函数
        /// </summary>
        /// <param name="doorLock"></param>
@@ -183,14 +172,15 @@
            #region 数据处理  
            //获取楼层
            dicFloor = Common.Room.CurrentRoom.GetFloorSortList();
            dicFloor = HdlRoomLogic.Current.GetFloorSortList();
            currentKey.currentSelectFloorId = BindInfo.GetCurrentSelectFloorId();
            btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName();
            btnFloorText.Text = BindInfo.GetCurrentSelectFloorIdName();
            var listAllRoom = HdlRoomLogic.Current.GetAllListRooms();
            if (Common.Config.Instance.Home.FloorDics.Count == 0)
            {
                // 获取没有楼层房间
                foreach (var room in Shared.Common.Room.Lists)
                foreach (var room in listAllRoom)
                {
                    if (string.IsNullOrEmpty(room.FloorId))
                    {
@@ -201,7 +191,7 @@
            else
            {
                // 获取楼层对应对房间
                foreach (var room in Shared.Common.Room.Lists)
                foreach (var room in listAllRoom)
                {
                    if (room.FloorId == currentKey.currentSelectFloorId)
                    {
@@ -235,7 +225,7 @@
            int index = 0;
            RefreshRoomList(curRoom, ref index);
            if (curRoom.SceneUIList.Count == 0)
            if (curRoom.ListSceneId.Count == 0)
            {
                btnFinifh.Enable = false;
                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
@@ -479,7 +469,7 @@
                }
                //如果房间中没有场景,则不显示
                if (room.SceneUIList.Count == 0)
                if (room.ListSceneId.Count == 0)
                {
                    continue;
                }
@@ -549,7 +539,7 @@
                    }
                    curRoom = room;
                    currentKey.RoomId = room.Id;
                    if (curRoom.SceneUIList.Count == 0)
                    if (curRoom.ListSceneId.Count == 0)
                    {
                        btnFinifh.Enable = false;
                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
@@ -587,7 +577,7 @@
        void RefreshSceneList(Shared.Common.Room curRoom)
        {
            midVerticalScrolViewLayout.RemoveAll();
            if (curRoom.SceneUIList.Count == 0)
            if (curRoom.ListSceneId.Count == 0)
            {
                return;
            }
@@ -651,7 +641,7 @@
                };
                rowLayout.AddChidren(line2);
                if (curIndex == curRoom.SceneUIList.Count - 1)
                if (curIndex == curRoom.ListSceneId.Count - 1)
                {
                    line2.Visible = false;
                }
@@ -868,10 +858,11 @@
                        btnMethodText.IsSelected = true;
                        oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                        oldbuttonText.IsBold = true;
                    }
                    //获取楼层对应的房间
                    foreach (var room in Shared.Common.Room.Lists)
                    }
                    //获取楼层对应的房间
                    var listAllRoom = HdlRoomLogic.Current.GetAllListRooms();
                    foreach (var room in listAllRoom)
                    {
                        if (room.FloorId == currentKey.currentSelectFloorId)
                        {
@@ -916,9 +907,10 @@
        /// <returns></returns>
        List<SceneUI> GetALlDispalyRoomSceneList()
        {
            currentKeyAllRoomSceneList.Clear();
            // 获取所有房间
            foreach (var room in Shared.Common.Room.Lists)
            currentKeyAllRoomSceneList.Clear();
            // 获取所有房间
            var listAllRoom = HdlRoomLogic.Current.GetAllListRooms();
            foreach (var room in listAllRoom)
            {
                //如果房间为喜爱,则不显示
                if (room.IsLove == true)
@@ -926,13 +918,18 @@
                    continue;
                }
                //如果房间中没有场景,则不显示
                if (room.SceneUIList.Count == 0)
                if (room.ListSceneId.Count == 0)
                {
                    continue;
                }
                foreach (var scene in room.SceneUIList)
                {
                foreach (var sceneId in room.ListSceneId)
                {
                    var scene = HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId);
                    if (scene == null)
                    {
                        continue;
                    }
                    currentKeyAllRoomSceneList.Add(scene);
                }
            }
@@ -946,27 +943,20 @@
        List<SceneUI> GetMatchSceneUIList(Shared.Common.Room curRoom)
        {
            var tempSceneUIList = new List<SceneUI>();
            foreach (var scene in curRoom.SceneUIList)
            foreach (var sceneId in curRoom.ListSceneId)
            {
                var gwSc = gwCurScenesList.Find(obj => (obj.ScenesId == scene.Id));
                var scene = HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId);
                if (scene == null)
                {
                    continue;
                }
                var gwSc = gwCurScenesList.Find(obj => (obj.ScenesId == sceneId));
                if (gwSc != null)
                {
                    tempSceneUIList.Add(scene);
                }
            }
            return tempSceneUIList;
        }
        public void DeviceInfoChange(CommonDevice common, string typeTag)
        {
        }
        public void ChangedILogicStatus(ZigBee.Device.Logic logic)
        {
        }
        public void ChangedISceneStatus(Scene scene)
        {
        }
    }
}