| | |
| | | using System; |
| | | using System.Collections.Generic;
|
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | |
| | | /// 场景内容显示区域 |
| | | /// </summary> |
| | | FrameLayout floorChangeView; |
| | | /// <summary>
|
| | | /// 楼层房间选择的下拉对象
|
| | | /// </summary> |
| | | FloorRoomSelectPopupView floorRoomSelectView = null; |
| | | Button btnSceneTilte; |
| | | |
| | | #region 场景底部切换显示区域 |
| | |
| | | bodyView.AddChidren(topView); |
| | | |
| | | //不是A网关或者是成员 只允许添加场景隐藏自动化 |
| | | if (DB_ResidenceData.Instance.GatewayType != 1 || DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) |
| | | var HideAutoPage = DB_ResidenceData.Instance.GatewayType != 1 || DB_ResidenceData.Instance.CurrentRegion.IsOthreShare; |
| | | //判断是否需要隐藏自动化 |
| | | if (HideAutoPage) |
| | | { |
| | | btnSceneTilte = new Button() |
| | | { |
| | |
| | | bodyView.AddChidren(contentPageView); |
| | | |
| | | LoadScenePageView(); |
| | | LoadAutomationPageView(); |
| | | //判断是否需要隐藏自动化 |
| | | if (!HideAutoPage) |
| | | { |
| | | LoadAutomationPageView(); |
| | | } |
| | | LoadEventList(); |
| | | |
| | | } |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = DB_ResidenceData.Instance.CurFloor.roomName, |
| | | }; |
| | | floorChangeView.AddChidren(btnFloor); |
| | | floorChangeView.AddChidren(btnFloor);
|
| | |
|
| | | string nowSelectId = null;
|
| | | btnFloor.MouseUpEventHandler += (sender, e) =>
|
| | | {
|
| | | if (this.floorRoomSelectView == null)
|
| | | {
|
| | | //先初始化
|
| | | this.floorRoomSelectView = new FloorRoomSelectPopupView();
|
| | | }
|
| | | //显示下拉列表
|
| | | this.floorRoomSelectView.ShowSceneView(btnFloor, (selectId, listScene) =>
|
| | | {
|
| | | nowSelectId = selectId;
|
| | | //重新刷新场景列表
|
| | | this.LoadSceneFunctionControlZone(listScene);
|
| | | }, nowSelectId);
|
| | | }; |
| | | |
| | | #endregion |
| | | |
| | |
|
| | | sceneFunctionView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = floorChangeView.Bottom, |
| | | Height = Application.GetRealHeight(667 - 64 - 49 - 52 + 30), |
| | | }; |
| | | scenePageView.AddChidren(sceneFunctionView); |
| | | LoadSceneFunctionControlZone(); |
| | | LoadSceneFunctionControlZone(null); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载场景功能显示区域 |
| | | /// </summary> |
| | | void LoadSceneFunctionControlZone() |
| | | void LoadSceneFunctionControlZone(List<Scene> listScene) |
| | | { |
| | | //topView.AddChidren(btnAddIcon); |
| | | |
| | |
| | | try |
| | | { |
| | | int index = 0; |
| | | foreach (var scene in FunctionList.List.scenes) |
| | | //获取能够显示的场景 |
| | | if (listScene == null)
|
| | | {
|
| | | //初始值
|
| | | if (this.floorRoomSelectView == null)
|
| | | {
|
| | | //先初始化
|
| | | this.floorRoomSelectView = new FloorRoomSelectPopupView();
|
| | | }
|
| | | listScene = this.floorRoomSelectView.GetCanShowListScene();
|
| | | } |
| | | foreach (var scene in listScene) |
| | | { |
| | | //if (scene.roomIds.Count == 0)//如何在房间已经移除了这个功能,则收藏界面也不会再显示 |
| | | //{ |
| | |
| | | LoadEvent_ControlScene(btnCoverd,btnName,btnZone, scene); |
| | | btnSettingIcon.MouseUpEventHandler = (sender, e) => { |
| | | Action backAction = () => { |
| | | LoadSceneFunctionControlZone(); |
| | | LoadSceneFunctionControlZone(null); |
| | | }; |
| | | Action refreshAction = () => { |
| | | btnName.Text = scene.name; |
| | |
| | | contentPageView.AddChidren(automationPage); |
| | | UI2.Intelligence.Automation.MainView.automationPage = automationPage; |
| | | UI2.Intelligence.Automation.MainView.MainShow(); |
| | | } |
| | | }
|
| | | #endregion |
| | | } |
| | | |
| | |
| | | |
| | | Action action = () => |
| | | { |
| | | LoadSceneFunctionControlZone(); |
| | | LoadSceneFunctionControlZone(null); |
| | | }; |
| | | var aep = new NewSceneMenuListPage(action); |
| | | MainPage.BasePageView.AddChidren(aep); |