From e37cdac9c10e37dd9bbdf81c69a886b1fa281978 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期一, 08 三月 2021 10:08:45 +0800 Subject: [PATCH] 2021-3-8-3 --- HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs | 482 ++++++++++++++++++++++++++--------------------------- 1 files changed, 237 insertions(+), 245 deletions(-) diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs index f333a9b..63256f0 100644 --- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs +++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs @@ -373,7 +373,14 @@ roomView.RemoveFromParent(); }; - var view = new RoomPage(room, ReloadRoomName, deleteAction); + //鎴块棿鑳屾櫙鍥句慨鏀逛簨浠跺洖璋� + Action modifyImageAction = () => + { + //roomViewbg.ImagePath = room.backgroundImage; + ImageUtlis.Current.LoadLocalOrNetworkImages(room.backgroundImage, roomViewbg); + }; + + var view = new RoomPage(room, ReloadRoomName, deleteAction, modifyImageAction); MainPage.BasePageView.AddChidren(view); view.LoadPage(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; @@ -423,6 +430,7 @@ var lastY1 = Application.GetRealWidth(16); var lastY2 = Application.GetRealWidth(16); + var functionContentViewHeight = Application.GetRealWidth(16); var functionCategoryCount = 0; @@ -434,41 +442,41 @@ { case ShowFunction.Light: #region Light - functionCount = FunctionList.List.lights.Count; - functionOnCount = FunctionList.List.lights.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; + functionCount = FunctionList.List.GetLightList().Count; + functionOnCount = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; #endregion break; case ShowFunction.AC: #region AC - functionCount = FunctionList.List.aCs.Count; - functionOnCount = FunctionList.List.aCs.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; + functionCount = FunctionList.List.GetAcList().Count; + functionOnCount = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; #endregion break; case ShowFunction.Curtain: #region Curtain - functionCount = FunctionList.List.curtains.Count; - functionOnCount = FunctionList.List.curtains.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; + functionCount = FunctionList.List.GetCurtainList().Count; + functionOnCount = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; #endregion break; case ShowFunction.FloorHeating: #region 鍦扮儹 - functionCount = FunctionList.List.floorHeatings.Count; - functionOnCount = FunctionList.List.floorHeatings.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; + functionCount = FunctionList.List.GetFloorHeatingList().Count; + functionOnCount = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; #endregion break; case ShowFunction.DoorLock: break; case ShowFunction.Electric: #region 鐢靛櫒 - functionCount = FunctionList.List.electricals.Count; - functionOnCount = FunctionList.List.electricals.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; + functionCount = FunctionList.List.GetElectricals().Count; + functionOnCount = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; #endregion break; case ShowFunction.EnergyMonitoring: break; case ShowFunction.Environmental: #region 鐜鏁版嵁 - functionCount = FunctionList.List.sensorsEnvironmentalScience.Count; + functionCount = FunctionList.List.GetEnvirSensorsList().Count; #endregion break; case ShowFunction.FreshAir: @@ -480,39 +488,23 @@ case ShowFunction.Panel: break; case ShowFunction.SecurityMonitoring: + functionCount = 1; break; case ShowFunction.Sensor: + functionCount = FunctionList.List.GetArmSensorList().Count; break; case ShowFunction.VideoIntercom: break; } - if (functionCount == 0 && item != ShowFunction.Music) + if(functionCount == 0) { continue; } + functionCategoryCount++; - //FunctionType ft = FunctionType.A31Music - //switch (item) - //{ - // case FunctionType.FloorHeating: - // break; - // case FunctionType.AC: - // break; - // case FunctionType.MotorCurtain: - // case FunctionType.Curtain: - // case FunctionType.RollingShutter: - // break; - // case FunctionType.Relay: - // case FunctionType.Dimmer: - // case FunctionType.RGB: - // case FunctionType.ColorTemperature: - // break; - // case FunctionType.Socket: - // break; - //} FrameLayout functionView = new FrameLayout() { Height = Application.GetRealWidth(161), @@ -543,6 +535,7 @@ { s2View.AddChidren(functionView); } + functionContentViewHeight = functionView.Bottom; Button btnName = new Button() @@ -557,212 +550,9 @@ }; functionView.AddChidren(btnName); - - Button btnFunctionViewBg; - btnFunctionViewBg = new Button() - { - Height = Application.GetRealWidth(161), - UnSelectedImagePath = "FunctionIcon/FunctionBg/" + item + "FunctionBg.png", - }; - functionView.AddChidren(btnFunctionViewBg); - - int functionPageTitleId = 0; - switch (item) - { - case ShowFunction.Light: - #region Light - btnName.TextID = StringId.Lights; - functionCount = FunctionList.List.lights.Count; - functionOnCount = FunctionList.List.lights.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; - Button btnLightPower = new Button() - { - X = Application.GetRealWidth(120), - Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117), - Width = Application.GetRealWidth(32), - Height = Application.GetRealWidth(32), - SelectedImagePath = "Public/PowerOpen.png", - UnSelectedImagePath = "Public/PowerClose.png", - IsSelected = functionOnCount > 0, - Tag = item + "_AllControl", - }; - functionView.AddChidren(btnLightPower); - - btnLightPower.MouseUpEventHandler = (sender, e) => - { - LoadEvent_SwitchFunction(btnLightPower, item); - }; - functionPageTitleId = StringId.Lights; - - #endregion - break; - case ShowFunction.AC: - #region AC - btnName.TextID = StringId.AC; - functionCount = FunctionList.List.aCs.Count; - functionOnCount = FunctionList.List.aCs.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; - Button btnAcPower = new Button() - { - X = Application.GetRealWidth(120), - Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117), - Width = Application.GetRealWidth(32), - Height = Application.GetRealWidth(32), - SelectedImagePath = "Public/PowerOpen.png", - UnSelectedImagePath = "Public/PowerClose.png", - Tag = item + "_AllControl", - IsSelected = functionOnCount > 0, - }; - functionView.AddChidren(btnAcPower); - btnAcPower.MouseUpEventHandler = (sender, e) => - { - LoadEvent_SwitchFunction(btnAcPower, item); - }; - functionPageTitleId = StringId.AC; - #endregion - break; - case ShowFunction.Curtain: - #region Curtain - btnName.TextID = StringId.Curtain; - functionCount = FunctionList.List.curtains.Count; - functionOnCount = FunctionList.List.curtains.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; - Button btnClose; - btnClose = new Button() - { - X = Application.GetRealWidth(72), - Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117), - Width = Application.GetRealWidth(32), - Height = Application.GetRealWidth(32), - UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png", - SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png", - //Tag = item + "_AllControl", - IsSelected = !DB_ResidenceData.Instance.GlobalCurtainStatus, - }; - functionView.AddChidren(btnClose); - - Button btnOpen; - btnOpen = new Button() - { - X = Application.GetRealWidth(120), - Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117), - Width = Application.GetRealWidth(32), - Height = Application.GetRealWidth(32), - UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png", - SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png", - IsSelected = DB_ResidenceData.Instance.GlobalCurtainStatus, - }; - functionView.AddChidren(btnOpen); - LoadEvent_CurtainSwitch(btnClose, btnOpen); - - functionPageTitleId = StringId.Curtain; - #endregion - break; - case ShowFunction.FloorHeating: - #region 鍦扮儹 - btnName.TextID = StringId.FloorHeating; - functionCount = FunctionList.List.floorHeatings.Count; - functionOnCount = FunctionList.List.floorHeatings.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; - Button btnFhPower = new Button() - { - X = Application.GetRealWidth(120), - Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117), - Width = Application.GetRealWidth(32), - Height = Application.GetRealWidth(32), - SelectedImagePath = "Public/PowerOpen.png", - UnSelectedImagePath = "Public/PowerClose.png", - Tag = item + "_AllControl", - IsSelected = functionOnCount > 0 - }; - functionView.AddChidren(btnFhPower); - btnFhPower.MouseUpEventHandler = (sender, e) => - { - LoadEvent_SwitchFunction(btnFhPower, item); - }; - functionPageTitleId = StringId.FloorHeating; - #endregion - break; - case ShowFunction.DoorLock: - btnName.TextID = StringId.DoorLock; - break; - case ShowFunction.Electric: - #region 鐢靛櫒 - btnName.TextID = StringId.Electric; - functionCount = FunctionList.List.electricals.Count; - functionOnCount = FunctionList.List.electricals.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; - Button btnElectricPower = new Button() - { - X = Application.GetRealWidth(120), - Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117), - Width = Application.GetRealWidth(32), - Height = Application.GetRealWidth(32), - SelectedImagePath = "Public/PowerOpen.png", - UnSelectedImagePath = "Public/PowerClose.png", - Tag = item + "_AllControl", - IsSelected = functionOnCount > 0, - }; - functionView.AddChidren(btnElectricPower); - btnElectricPower.MouseUpEventHandler = (sender, e) => - { - LoadEvent_SwitchFunction(btnElectricPower, item); - }; - functionPageTitleId = StringId.Electric; - #endregion - break; - case ShowFunction.EnergyMonitoring: - btnName.TextID = StringId.EnergyMonitoring; - break; - case ShowFunction.Environmental: - #region 鐜鏁版嵁 - btnName.TextID = StringId.EnvironmentalData; - btnFunctionViewBg.MouseUpEventHandler = (sender, e) => - { - var skipView = new EnvironmentalSciencePage(); - MainPage.BasePageView.AddChidren(skipView); - skipView.LoadPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }; - #endregion - break; - case ShowFunction.FreshAir: - btnName.TextID = StringId.FreshAir; - break; - case ShowFunction.Music: - btnName.TextID = StringId.Music; - functionCount = Music.A31MusicModel.A31MusicModelList.Count; - functionOnCount = Music.A31MusicModel.A31MusicModelList.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; - btnFunctionViewBg.MouseUpEventHandler = (sender, e) => - { - var musicMain = new Music.MusicMain(); - MainPage.BasePageView.AddChidren(musicMain); - musicMain.Show(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }; - break; - case ShowFunction.Panel: - btnName.TextID = StringId.Panel; - break; - case ShowFunction.SecurityMonitoring: - btnName.TextID = StringId.SecurityMonitoring; - break; - case ShowFunction.Sensor: - btnName.TextID = StringId.Sensor; - - break; - case ShowFunction.VideoIntercom: - btnName.TextID = StringId.VideoIntercom; - break; - - } - //鐣岄潰璺宠浆--闊充箰璺宠浆鑷繁鐨勭晫闈�--鐜璺宠浆鑷繁鐨勭晫闈� - if (item != ShowFunction.Music && item != ShowFunction.Environmental) - { - btnFunctionViewBg.MouseUpEventHandler = (sender, e) => - { - var skipView = new FunctionPage(); - MainPage.BasePageView.AddChidren(skipView); - skipView.LoadPage(functionPageTitleId); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }; - } - if (item != ShowFunction.Environmental && functionCount != 0) + if (item != ShowFunction.Environmental && item != ShowFunction.Sensor && item != ShowFunction.VideoIntercom + && item != ShowFunction.SecurityMonitoring + && functionCount != 0) { Button btnFunctionCount = new Button() { @@ -791,19 +581,221 @@ }; functionView.AddChidren(btnOpenCount); } + + + Button btnFunctionViewBg; + btnFunctionViewBg = new Button() + { + Height = Application.GetRealWidth(161), + UnSelectedImagePath = "FunctionIcon/FunctionBg/" + item + "FunctionBg.png", + }; + functionView.AddChidren(btnFunctionViewBg); + + int functionPageTitleId = 0; + switch (item) + { + case ShowFunction.Light: + #region Light + btnName.TextID = StringId.Lights; + Button btnLightPower = new Button() + { + X = Application.GetRealWidth(120), + Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117), + Width = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), + SelectedImagePath = "Public/PowerOpen.png", + UnSelectedImagePath = "Public/PowerClose.png", + IsSelected = functionOnCount > 0, + Tag = item + "_AllControl", + }; + functionView.AddChidren(btnLightPower); + + btnLightPower.MouseUpEventHandler = (sender, e) => + { + LoadEvent_SwitchFunction(btnLightPower, item, functionView); + }; + functionPageTitleId = StringId.Lights; + + #endregion + break; + case ShowFunction.AC: + #region AC + btnName.TextID = StringId.AC; + Button btnAcPower = new Button() + { + X = Application.GetRealWidth(120), + Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117), + Width = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), + SelectedImagePath = "Public/PowerOpen.png", + UnSelectedImagePath = "Public/PowerClose.png", + Tag = item + "_AllControl", + IsSelected = functionOnCount > 0, + }; + functionView.AddChidren(btnAcPower); + btnAcPower.MouseUpEventHandler = (sender, e) => + { + LoadEvent_SwitchFunction(btnAcPower, item, functionView); + }; + functionPageTitleId = StringId.AC; + #endregion + break; + case ShowFunction.Curtain: + #region Curtain + btnName.TextID = StringId.Curtain; + Button btnClose; + btnClose = new Button() + { + X = Application.GetRealWidth(72), + Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117), + Width = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), + UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png", + SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png", + IsSelected = !DB_ResidenceData.Instance.GlobalCurtainStatus, + }; + functionView.AddChidren(btnClose); + + Button btnOpen; + btnOpen = new Button() + { + X = Application.GetRealWidth(120), + Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117), + Width = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), + UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png", + SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png", + IsSelected = DB_ResidenceData.Instance.GlobalCurtainStatus, + }; + functionView.AddChidren(btnOpen); + LoadEvent_CurtainSwitch(btnClose, btnOpen, functionView); + + functionPageTitleId = StringId.Curtain; + #endregion + break; + case ShowFunction.FloorHeating: + #region 鍦扮儹 + btnName.TextID = StringId.FloorHeating; + Button btnFhPower = new Button() + { + X = Application.GetRealWidth(120), + Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117), + Width = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), + SelectedImagePath = "Public/PowerOpen.png", + UnSelectedImagePath = "Public/PowerClose.png", + Tag = item + "_AllControl", + IsSelected = functionOnCount > 0 + }; + functionView.AddChidren(btnFhPower); + btnFhPower.MouseUpEventHandler = (sender, e) => + { + LoadEvent_SwitchFunction(btnFhPower, item, functionView); + }; + functionPageTitleId = StringId.FloorHeating; + #endregion + break; + case ShowFunction.DoorLock: + btnName.TextID = StringId.DoorLock; + break; + case ShowFunction.Electric: + #region 鐢靛櫒 + btnName.TextID = StringId.Electric; + Button btnElectricPower = new Button() + { + X = Application.GetRealWidth(120), + Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117), + Width = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), + SelectedImagePath = "Public/PowerOpen.png", + UnSelectedImagePath = "Public/PowerClose.png", + Tag = item + "_AllControl", + IsSelected = functionOnCount > 0, + }; + functionView.AddChidren(btnElectricPower); + btnElectricPower.MouseUpEventHandler = (sender, e) => + { + LoadEvent_SwitchFunction(btnElectricPower, item, functionView); + }; + functionPageTitleId = StringId.Electric; + #endregion + break; + case ShowFunction.EnergyMonitoring: + btnName.TextID = StringId.EnergyMonitoring; + break; + case ShowFunction.Environmental: + #region 鐜鏁版嵁 + btnName.TextID = StringId.EnvironmentalData; + btnFunctionViewBg.MouseUpEventHandler = (sender, e) => + { + var skipView = new EnvironmentalSciencePage(); + MainPage.BasePageView.AddChidren(skipView); + skipView.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + #endregion + break; + case ShowFunction.FreshAir: + btnName.TextID = StringId.FreshAir; + break; + case ShowFunction.Music: + btnName.TextID = StringId.Music; + btnFunctionViewBg.MouseUpEventHandler = (sender, e) => + { + var musicMain = new Music.MusicMain(); + MainPage.BasePageView.AddChidren(musicMain); + musicMain.Show(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + break; + case ShowFunction.Panel: + btnName.TextID = StringId.Panel; + break; + case ShowFunction.SecurityMonitoring: + btnName.TextID = StringId.SecurityMonitoring; + btnFunctionViewBg.MouseUpEventHandler = (sender, e) => + { + +#if __IOS__ + EZSDK.IOS.EZSDK.Go2EZvizMonitor(); +#else //瀹夊崜鎽勫儚澶� + HDLCommon.Current.Go2EZvizMonitor(bodyView); +#endif + }; + break; + case ShowFunction.Sensor: + btnName.TextID = StringId.Sensor; + functionPageTitleId = StringId.Sensor; + break; + case ShowFunction.VideoIntercom: + btnName.TextID = StringId.VideoIntercom; + break; + + } + //鐣岄潰璺宠浆--闊充箰璺宠浆鑷繁鐨勭晫闈�--鐜璺宠浆鑷繁鐨勭晫闈� + if (item != ShowFunction.Music && item != ShowFunction.Environmental && item != ShowFunction.SecurityMonitoring) + { + btnFunctionViewBg.MouseUpEventHandler = (sender, e) => + { + var skipView = new FunctionPage(); + MainPage.BasePageView.AddChidren(skipView); + skipView.LoadPage(functionPageTitleId); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + } index++; } - if (functionCategoryCount > 4) + //if (functionCategoryCount > 4) { - functionContentView.Height = Application.GetRealHeight((220 * functionCategoryCount / 2) + 20); - s1View.Height = s2View.Height = functionContentView.Height; + //functionContentView.Height = functionContentViewHeight;// Application.GetRealWidth((240 * (functionCategoryCount / 2))); + s1View.Height = s2View.Height = functionContentView.Height = functionContentViewHeight+ Application.GetRealWidth(40); } - #endregion +#endregion } - #region 鍒囨崲妤煎眰 +#region 鍒囨崲妤煎眰 /// <summary> /// 妤煎眰鏄剧ず鍒囨崲 /// </summary> @@ -921,7 +913,7 @@ Text = floor.roomName, TextSize = CSS_FontSize.SubheadingFontSize, IsSelected = floor.roomId == DB_ResidenceData.Instance.ClassificationChooseFloor.roomId, - IsMoreLines = true, + //IsMoreLines = true, }; contentView.AddChidren(btnHomeName); @@ -960,6 +952,6 @@ { } - #endregion +#endregion } } \ No newline at end of file -- Gitblit v1.8.0