From 5eeafe3af80bfd88306bd8ad9e76c8f4b51ca35f Mon Sep 17 00:00:00 2001 From: hxb <hxb@hdlchina.com.cn> Date: 星期四, 17 十二月 2020 14:16:20 +0800 Subject: [PATCH] 增加本地发送的重发机制 --- HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs | 162 ++++++++++++++++++++++++++++++----------------------- 1 files changed, 92 insertions(+), 70 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs b/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs index db28d94..6aa31b3 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs @@ -4,7 +4,7 @@ using HDL_ON.UI.CSS; using Shared; -namespace HDL_ON.UI +namespace HDL_ON.UI { public partial class IntelligencePage : FrameLayout { @@ -69,41 +69,69 @@ }; bodyView.AddChidren(topView); - btnSceneTilte = new Button() + if (DB_ResidenceData.Instance.GatewayType == 0 || DB_ResidenceData.Instance.CurrentRegion.IsOthreShare) { - 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); - - btnAutomationTitle = new Button() + btnSceneTilte = new Button() + { + Y = Application.GetRealHeight(30), + //Width = Application.GetRealWidth(170), + Height = Application.GetRealHeight(25), + TextAlignment = TextAlignment.Center, + TextSize = CSS_FontSize.HeadlineFontSize, + TextColor = CSS_Color.PromptingColor1, + SelectedTextColor = CSS_Color.MainColor, + TextID = StringId.Scenes, + IsSelected = true + }; + topView.AddChidren(btnSceneTilte); + btnAutomationTitle = new Button(); + } + else { - 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.Automation, - }; - topView.AddChidren(btnAutomationTitle); - btnAddIcon = new Button() + 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); + + btnAutomationTitle = 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.Automation, + }; + topView.AddChidren(btnAutomationTitle); + } + var btnAddIconBg = new Button() { X = Application.GetRealWidth(337), Y = Application.GetRealHeight(29), Width = Application.GetMinRealAverage(28), Height = Application.GetMinRealAverage(28), UnSelectedImagePath = "Public/AddIcon.png", + }; + topView.AddChidren(btnAddIconBg); + + btnAddIcon = new Button() + { + X = Application.GetRealWidth(337-20), + Width = Application.GetMinRealAverage(28+30), + Height = Application.GetMinRealAverage(28+29), }; topView.AddChidren(btnAddIcon); #endregion @@ -171,13 +199,14 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextAlignment = TextAlignment.CenterLeft, - Text = DB_ResidenceData.residenceData.CurFoor, + Text = DB_ResidenceData.Instance.CurFloor.roomName, }; floorChangeView.AddChidren(btnFloor); #endregion - sceneFunctionView = new VerticalScrolViewLayout() { + sceneFunctionView = new VerticalScrolViewLayout() + { Y = floorChangeView.Bottom, Height = Application.GetRealHeight(667 - 64 - 49 - 52 + 30), }; @@ -197,13 +226,13 @@ try { int index = 0; - foreach (var scene in DB_ResidenceData.functionList.scenes) + foreach (var scene in FunctionList.List.scenes) { - if (scene.roomIds.Count == 0)//濡備綍鍦ㄦ埧闂村凡缁忕Щ闄や簡杩欎釜鍔熻兘锛屽垯鏀惰棌鐣岄潰涔熶笉浼氬啀鏄剧ず - { - scene.collect = false; - continue; - } + //if (scene.roomIds.Count == 0)//濡備綍鍦ㄦ埧闂村凡缁忕Щ闄や簡杩欎釜鍔熻兘锛屽垯鏀惰棌鐣岄潰涔熶笉浼氬啀鏄剧ず + //{ + // scene.collect = false; + // continue; + //} if (index % 2 == 0) { sceneFunctionView.AddChidren(new Button() { Height = Application.GetRealHeight(7) }); @@ -222,9 +251,11 @@ Width = Application.GetRealWidth(164), Height = Application.GetRealWidth(122), Tag = scene.sid, - BackgroundImagePath = (scene as Scene).ImagePath, + //BackgroundImagePath = (scene as Scene).ImagePath, }; rowView.AddChidren(functionView); + //2020-12-03 淇敼鍥剧墖鍔犺浇鏂规硶 + ImageUtlis.Current.LoadLocalOrNetworkImages((scene as Scene).ImagePath, functionView); LoadSceneFunctionDiv(functionView, scene); index++; @@ -307,7 +338,6 @@ }; view.AddChidren(btnZone); - Button btnSettingIcon; btnSettingIcon = new Button() { @@ -333,7 +363,7 @@ view.AddChidren(btnCollection); btnCollection.MouseUpEventHandler = (sender, e) => { scene.collect = btnCollection.IsSelected = !btnCollection.IsSelected; - scene.SaveSceneData(); + scene.CollectScene(); }; LoadEvent_ControlScene(btnCoverd,btnName,btnZone, scene); btnSettingIcon.MouseUpEventHandler = (sender, e) => { @@ -343,11 +373,12 @@ Action refreshAction = () => { btnName.Text = scene.name; btnZone.Text = scene.GetRoomListName(); - view.BackgroundImagePath = scene.ImagePath; + //2020-12-03 淇敼鍥剧墖鍔犺浇鏂规硶 + ImageUtlis.Current.LoadLocalOrNetworkImages((scene as Scene).ImagePath, view); }; var aep = new SceneEditPage(scene, backAction); MainPage.BasePageView.AddChidren(aep); - aep.LoadPage(StringId.EditScene, refreshAction); + aep.LoadPage(refreshAction); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; } @@ -365,30 +396,10 @@ void LoadAutomationPageView() { //btnAddIcon.RemoveFromParent(); - automationPage = new FrameLayout(); contentPageView.AddChidren(automationPage); - - Button btnTipNot = new Button() - { - Gravity = Gravity.CenterHorizontal, - Y = Application.GetRealHeight(120), - Width = Application.GetRealWidth(180), - Height = Application.GetRealWidth(180), - UnSelectedImagePath = "TipNot.png", - }; - automationPage.AddChidren(btnTipNot); - - Button btnTipNotText = new Button() - { - Y = btnTipNot.Bottom, - Height = Application.GetRealWidth(100), - TextID = StringId.TipNotOpen, - TextAlignment = TextAlignment.Center, - TextColor = CSS_Color.TextualColor, - TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - }; - automationPage.AddChidren(btnTipNotText); + UI2.Intelligence.Automation.MainView.automationPage = automationPage; + UI2.Intelligence.Automation.MainView.MainShow(); } #endregion } @@ -441,9 +452,9 @@ btnSceneTilte.TextSize = CSS_FontSize.HeadlineFontSize; btnAutomationTitle.IsSelected = false; btnAutomationTitle.TextSize = CSS_FontSize.TextFontSize; - contentPageView.PageIndex = 0; }; + //閫昏緫鐐瑰嚮浜嬩欢 btnAutomationTitle.MouseUpEventHandler = (sender, e) => { if (btnAutomationTitle.IsSelected) { @@ -454,6 +465,7 @@ btnSceneTilte.IsSelected = false; btnSceneTilte.TextSize = CSS_FontSize.TextFontSize; contentPageView.PageIndex = 1; + }; } #endregion @@ -465,13 +477,22 @@ { btnAddIcon.MouseUpEventHandler = (sender, e) => { - Action action = () => { - LoadSceneFunctionControlZone(); - }; - var aep = new NewSceneMenuListPage(action); - MainPage.BasePageView.AddChidren(aep); - aep.LoadPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + if (!btnAutomationTitle.IsSelected) + { + Action action = () => + { + LoadSceneFunctionControlZone(); + }; + var aep = new NewSceneMenuListPage(action); + MainPage.BasePageView.AddChidren(aep); + aep.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + } + else + { + //璺宠浆鍒伴�昏緫鐣岄潰 + UI2.Intelligence.Automation.MainView.SkipAddLogicPage(); + } }; } @@ -492,6 +513,7 @@ btnName.MouseUpEventHandler = eventHandler; btnZone.MouseUpEventHandler = eventHandler; } + } } -- Gitblit v1.8.0