| | |
| | | /// 构造函数 |
| | | /// </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 ◆ 变量申明__________________________ |
| | |
| | | Button btnFloorText; |
| | | Dictionary<string, string> dicFloor;//楼层列表 |
| | | List<SceneUI> currentKeyAllRoomSceneList = new List<SceneUI>(); |
| | | public List<ScenesListInfo> gwCurScenesList = new List<ScenesListInfo>();//网关中的场景列表 |
| | | #endregion |
| | | |
| | | /// <summary> |
| | |
| | | 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); |
| | |
| | | TextID = R.MyInternationalizationString.Save, |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack, |
| | | TextColor = Shared.Common.ZigbeeColor.Current.XMWhite, |
| | | IsBold =true, |
| | | TextSize = 16, |
| | | }; |
| | | bottomFrameLayout.AddChidren(btnFinifh); |
| | |
| | | } |
| | | 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() |
| | |
| | | X = devicePic.Right + Application.GetRealWidth(20), |
| | | TextColor = Shared.Common.ZigbeeColor.Current.TextBlack, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize =15, |
| | | }; |
| | | rowLayout.AddChidren(btnBindName); |
| | | |
| | |
| | | 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, |
| | | }; |
| | |
| | | if (currentKey.currentSelectFloorId == floorId) |
| | | { |
| | | btnAllMethod.IsSelected = true; |
| | | btnAllMethod.IsBold = true; |
| | | btnMethodText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | } |
| | | |
| | |
| | | oldbuttonText = btnMethodText; |
| | | btnMethodText.IsSelected = true; |
| | | oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; |
| | | oldbuttonText.IsBold = true; |
| | | } |
| | | |
| | | //获取楼层对应的房间 |
| | |
| | | } |
| | | 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) |
| | | { |