From 691dbe24f5724f153e07947c7b75bdfea5f0b6d5 Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期二, 24 九月 2024 16:15:15 +0800 Subject: [PATCH] 离线控制模式 --- HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs | 160 +++++++++++++++++++++++++++++++---------------------- 1 files changed, 93 insertions(+), 67 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs b/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs index 230d2f6..8893874 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs @@ -76,53 +76,54 @@ #region top topView = new FrameLayout() { - Height = Application.GetRealHeight(64), + Height = Application.GetRealHeight(74), BackgroundColor = CSS_Color.TopViewColor, }; bodyView.AddChidren(topView); //涓嶆槸A缃戝叧鎴栬�呮槸鎴愬憳 鍙厑璁告坊鍔犲満鏅殣钘忚嚜鍔ㄥ寲 var HideAutoPage = DB_ResidenceData.Instance.CurrentRegion.isOtherShare; + bool hideSecurity = true; //鍒ゆ柇鏄惁闇�瑕侀殣钘忚嚜鍔ㄥ寲 if (HideAutoPage) { - if (false && DB_ResidenceData.Instance.GatewayType == 1)//缃戝叧闇�瑕佸姞杞藉畨闃�--2021-11-28 19:56:53 鍒樻檽杈夊皢瀹夐槻鏀惧叆鏀圭晫闈� - { - btnSceneTilte = new Button() - { - Y = Application.GetRealHeight(30), - Width = Application.GetRealWidth(170), - Height = Application.GetRealHeight(25), - TextAlignment = TextAlignment.CenterRight, - TextSize = CSS_FontSize.HeadlineFontSize, - TextColor = CSS_Color.PromptingColor1, - SelectedTextColor = CSS_Color.MainColor, - TextID = StringId.Scenes, - IsSelected = true - }; - topView.AddChidren(btnSceneTilte); + //if (DB_ResidenceData.Instance.GatewayType == 1)//缃戝叧闇�瑕佸姞杞藉畨闃�--2021-11-28 19:56:53 鍒樻檽杈夊皢瀹夐槻鏀惧叆璇ョ晫闈� + //{ + // btnSceneTilte = new Button() + // { + // Y = Application.GetRealHeight(30), + // Width = Application.GetRealWidth(170), + // Height = Application.GetRealHeight(25), + // TextAlignment = TextAlignment.CenterRight, + // TextSize = CSS_FontSize.HeadlineFontSize, + // TextColor = CSS_Color.PromptingColor1, + // SelectedTextColor = CSS_Color.MainColor, + // TextID = StringId.Scenes, + // IsSelected = true + // }; + // topView.AddChidren(btnSceneTilte); - btnSecurityTitle = new Button() - { - X = Application.GetRealWidth(209), - Y = Application.GetRealHeight(30), - Width = Application.GetRealWidth(170), - Height = Application.GetRealHeight(25), - TextAlignment = TextAlignment.CenterLeft, - TextSize = CSS_FontSize.TextFontSize, - TextColor = CSS_Color.PromptingColor1, - SelectedTextColor = CSS_Color.MainColor, - TextID = StringId.anfang, - }; - topView.AddChidren(btnSecurityTitle); - btnAutomationTitle = new Button(); - } - else + // btnSecurityTitle = new Button() + // { + // X = Application.GetRealWidth(209), + // Y = Application.GetRealHeight(30), + // Width = Application.GetRealWidth(170), + // Height = Application.GetRealHeight(25), + // TextAlignment = TextAlignment.CenterLeft, + // TextSize = CSS_FontSize.TextFontSize, + // TextColor = CSS_Color.PromptingColor1, + // SelectedTextColor = CSS_Color.MainColor, + // TextID = StringId.anfang, + // }; + // topView.AddChidren(btnSecurityTitle); + // btnAutomationTitle = new Button(); + //} + //else { btnSceneTilte = new Button() { - Y = Application.GetRealHeight(30), + Y = Application.GetRealHeight(40), //Width = Application.GetRealWidth(170), Height = Application.GetRealHeight(25), TextAlignment = TextAlignment.Center, @@ -139,11 +140,11 @@ } else { - if (false && DB_ResidenceData.Instance.GatewayType == 1)//缃戝叧闇�瑕佸姞杞藉畨闃�--2021-11-28 19:56:53 鍒樻檽杈夊皢瀹夐槻鏀惧叆鏀圭晫闈� + if (DB_ResidenceData.Instance.GatewayType == 1) { btnAutomationTitle = new Button() { - Y = Application.GetRealHeight(30), + Y = Application.GetRealHeight(40), Gravity = Gravity.CenterHorizontal, Height = Application.GetRealHeight(25), TextAlignment = TextAlignment.Center, @@ -159,10 +160,9 @@ var otherWidth = (Application.GetRealWidth(375) - btnAutomationTitle.Width) / 2; btnAutomationTitle.X = otherWidth; - btnSceneTilte = new Button() { - Y = Application.GetRealHeight(30), + Y = Application.GetRealHeight(40), Width = otherWidth, Height = Application.GetRealHeight(25), TextAlignment = TextAlignment.CenterRight, @@ -174,11 +174,10 @@ }; topView.AddChidren(btnSceneTilte); - btnSecurityTitle = new Button() { X = btnAutomationTitle.Right, - Y = Application.GetRealHeight(30), + Y = Application.GetRealHeight(40), Width = otherWidth, Height = Application.GetRealHeight(25), TextAlignment = TextAlignment.CenterLeft, @@ -188,12 +187,13 @@ TextID = StringId.anfang, }; topView.AddChidren(btnSecurityTitle); + hideSecurity = false; } else { btnSceneTilte = new Button() { - Y = Application.GetRealHeight(30), + Y = Application.GetRealHeight(40), Width = Application.GetRealWidth(170), Height = Application.GetRealHeight(25), TextAlignment = TextAlignment.CenterRight, @@ -208,7 +208,7 @@ btnAutomationTitle = new Button() { X = Application.GetRealWidth(209), - Y = Application.GetRealHeight(30), + Y = Application.GetRealHeight(40), Width = Application.GetRealWidth(170), Height = Application.GetRealHeight(25), TextAlignment = TextAlignment.CenterLeft, @@ -223,7 +223,7 @@ btnAddIconBg = new Button() { X = Application.GetRealWidth(337), - Y = Application.GetRealHeight(29), + Y = Application.GetRealHeight(39), Width = Application.GetMinRealAverage(28), Height = Application.GetMinRealAverage(28), UnSelectedImagePath = "Public/AddIcon.png", @@ -240,8 +240,8 @@ contentPageView = new PageLayout() { - Y = Application.GetRealHeight(64), - Height = Application.GetRealHeight(667 - 64 - 49 + 30), + Y = Application.GetRealHeight(74), + Height = Application.GetRealHeight(667 - 74 - 49 + 30), BackgroundColor = CSS_Color.BackgroundColor, IsShowPoint = false }; @@ -253,7 +253,10 @@ { LoadAutomationPageView(); } - LoadSecurityPageView(); + if (!hideSecurity) + { + LoadSecurityPageView(); + } LoadEventList(); } @@ -399,28 +402,49 @@ var rowView = new FrameLayout(); new System.Threading.Thread(() => { - foreach (var scene in listScene) + try { - System.Threading.Thread.Sleep(10); + foreach (var scene in listScene) + { + if (scene == null) + { + continue; + } + if (scene.sceneType == SceneType.LightScene) + { + continue; + } + System.Threading.Thread.Sleep(10); + Application.RunOnMainThread(() => + { + if (index % 2 == 0) + { + rowView = new FrameLayout() + { + Height = Application.GetRealWidth(122), + }; + sceneFunctionView.AddChidren(rowView); + sceneFunctionView.AddChidren(new Button() + { + Height = Application.GetRealHeight(7 + 7), + }); + } + var functionView_X = Application.GetRealWidth((16 + 164) * (index % 2) + 16); + + var functionView = LoadSceneFunctionDiv(functionView_X, scene); + rowView.AddChidren(functionView); + index++; + }); + } + }catch(Exception ex) + { + MainPage.Log($"鍔犺浇鍦烘櫙鍒楄〃寮傚父锛歿ex.Message}"); + } + finally + { Application.RunOnMainThread(() => { - if (index % 2 == 0) - { - rowView = new FrameLayout() - { - Height = Application.GetRealWidth(122), - }; - sceneFunctionView.AddChidren(rowView); - sceneFunctionView.AddChidren(new Button() - { - Height = Application.GetRealHeight(7 + 7), - }); - } - var functionView_X = Application.GetRealWidth((16 + 164) * (index % 2) + 16); - - var functionView = LoadSceneFunctionDiv(functionView_X, scene); - rowView.AddChidren(functionView); - index++; + sceneFunctionView.AddChidren(new Button { Height = Application.GetRealHeight(30) }); }); } }) @@ -431,8 +455,6 @@ { MainPage.Log("homepage erorr : " + ex.Message); } - sceneFunctionView.AddChidren(new Button { Height = Application.GetRealHeight(30) }); - } /// <summary> @@ -695,7 +717,7 @@ btnAutomationTitle.TextSize = CSS_FontSize.TextFontSize; btnSceneTilte.IsSelected = false; btnSceneTilte.TextSize = CSS_FontSize.TextFontSize; - contentPageView.PageIndex = 2; + contentPageView.PageIndex = contentPageView.ChildrenCount - 1; }; } } @@ -708,6 +730,10 @@ { btnAddIcon.MouseUpEventHandler = (sender, e) => { + if (btnSecurityTitle != null && btnSecurityTitle.IsSelected) + { + return; + } if (!btnAutomationTitle.IsSelected) { //濡傛灉鏄垚鍛� -- Gitblit v1.8.0