From a91a9388bef8bbc619dee6db5e369f801a2d2864 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期三, 22 三月 2023 17:39:33 +0800 Subject: [PATCH] 群控功能 --- HDL-ON_Android/Properties/AndroidManifest.xml | 2 HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs | 31 HDL-ON_Android/Assets/Language.ini | 32 HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/MechanicalArmPage.cs | 9 HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs | 146 ++- HDL_ON/HDL_ON.projitems | 2 HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs | 4 HDL-ON_iOS/Resources/Language.ini | 4 HDL_ON/UI/UI2/2-Classification/FunctionPage.cs | 2 HDL_ON/DAL/Server/HttpUtil.cs | 7 HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs | 1541 +++++++++++++++++++++++++++++++++++ HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupChooseRoomPage.cs | 244 +++++ HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs | 115 +- HDL_ON/Common/R.cs | 21 HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 17 HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddCombineDimmingPage.cs | 385 +++++-- HDL_ON/DAL/Server/HttpServerRequest.cs | 3 HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFaceManagementPage.cs | 13 HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/AddMemberScanPage.cs | 13 HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs | 4 20 files changed, 2,342 insertions(+), 253 deletions(-) diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index 4e47611..91e148e 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -20,7 +20,7 @@ 19=The phone number is incorrect. Please re-enter. 20=The password and confirmation you typed do not match. Please re-enter your password. 21=The password format does not comply with the requirements, please enter again. -22=The user has existed, yo24-hour defenseu can sign in directly. +22=The user has existed, you can sign in directly. 23=Incorrect verification code, please re-enter. 24=Incorrect account number, please enter the correct email address. 25=Email address @@ -434,7 +434,7 @@ 448=Fixed deployment 449=*Undo defense does not affect 450=Disaster defense -451=24-hour defense +451=24h defense 452=Burglar alarm 453=Alarm mute 454=Deployment information @@ -580,6 +580,13 @@ 593=Face photo 594=Please enter member name 595=Delete +596=Group Name +597=Please enter +598=Select device +599=Please input name +600=Add combined dimming + + 2532=Visitor Invitation Record @@ -1830,6 +1837,11 @@ 593=浜鸿劯鐓х墖 594=璇疯緭鍏ユ垚鍛樺悕绉� 595=鍒犻櫎浜鸿劯鏁版嵁 +596=缁勫悕绉� +597=璇疯緭鍏� +598=閫夋嫨缇ゆ帶璁惧 +599=璇疯緭鍏ョ粍鍚嶇О +600=娣诲姞缁勫悎璋冨厜 @@ -3057,6 +3069,11 @@ 593=Face photo 594=Please enter member name 595=Delete +596=Group Name +597=Please enter +598=Select device +599=Please input name +600=Add combined dimming @@ -4287,7 +4304,11 @@ 593=Face photo 594=Please enter member name 595=Delete - +596=Group Name +597=Please enter +598=Select device +599=Please input name +600=Add combined dimming 2532=Visitor Invitation Record @@ -5502,6 +5523,11 @@ 593=Face photo 594=Please enter member name 595=Delete +596=Group Name +597=Please enter +598=Select device +599=Please input name +600=Add combined dimming 1000=袙谢邪卸薪芯褋褌 胁 褋褌邪褟褌邪 diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml index da74dbf..3b360ad 100644 --- a/HDL-ON_Android/Properties/AndroidManifest.xml +++ b/HDL-ON_Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.6.6" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202303211"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.6.6" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202303221"> <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> <!--鍙嬬洘--> <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>--> diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini index 4e47611..4b73348 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -20,7 +20,7 @@ 19=The phone number is incorrect. Please re-enter. 20=The password and confirmation you typed do not match. Please re-enter your password. 21=The password format does not comply with the requirements, please enter again. -22=The user has existed, yo24-hour defenseu can sign in directly. +22=The user has existed, you can sign in directly. 23=Incorrect verification code, please re-enter. 24=Incorrect account number, please enter the correct email address. 25=Email address @@ -434,7 +434,7 @@ 448=Fixed deployment 449=*Undo defense does not affect 450=Disaster defense -451=24-hour defense +451=24h defense 452=Burglar alarm 453=Alarm mute 454=Deployment information diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index 73dc6b3..ac5cd29 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -4,6 +4,27 @@ { public static class StringId { + + /// <summary> + /// 娣诲姞缁勫悎璋冨厜 + /// </summary> + public const int AddGroupControl = 600; + /// <summary> + /// 璇疯緭鍏ョ粍鍚嶇О + /// </summary> + public const int PlsEntryGroupName = 599; + /// <summary> + /// 閫夋嫨缇ゆ帶璁惧 + /// </summary> + public const int SelectGroupControlFunction = 598; + /// <summary> + /// 璇疯緭鍏� + /// </summary> + public const int PlsEntry = 597; + /// <summary> + /// 缁勫悕绉� + /// </summary> + public const int GroupNmae = 596; /// <summary> /// 鍒犻櫎浜鸿劯鏁版嵁 /// </summary> diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index 3b85c15..96af58c 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -3195,11 +3195,12 @@ /// </summary> /// <param name="spk"></param> /// <returns></returns> - public ResponsePackNew AddGroupControl() + public ResponsePackNew AddGroupControl(List<GroupControl> groupControls) { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); + d.Add("infos", groupControls); var requestJson = HttpUtil.GetSignRequestJson(d); var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlListByHome, requestJson); return pack; diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index ce601c8..14e83b1 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -6,6 +6,7 @@ using System.Text; using HDL_ON.Entity; using RestSharp; +using Shared; namespace HDL_ON.DAL.Server { @@ -17,8 +18,8 @@ /// 鍥哄畾鍩熷悕,姝e紡鐜 /// 鍏叡鍩熷悕灏辫繎瑙f瀽 /// </summary> - public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; - //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; + //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; + public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; const string APP_KEY = "HDL-HOME-APP-TEST"; const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm @@ -172,6 +173,7 @@ RestRequest request = new RestRequest(method); request.Timeout = mTimeout * 1000; request.AddHeader("content-type", "application/json"); + request.AddHeader("language", Language.CurrentLanguage == "Chinese" ? "cn" : "en");//澧炲姞璇█鏍囪瘑 wxr 2023-03-22 17:03:34 if (string.IsNullOrEmpty(replaceToken)) { @@ -184,6 +186,7 @@ { request.AddHeader("Authorization", replaceToken); } + if (bodyParameterJson != null) { diff --git a/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs b/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs index f64b239..387964a 100644 --- a/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs +++ b/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs @@ -131,6 +131,10 @@ /// 浜や粯閾炬帴 /// </summary> public string deliverUrl; + /// <summary> + /// 鏄惁鏀寔缇ゆ帶 + /// </summary> + public bool isSupportGroupControl = false; } } diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems index aa302be..5ae2b38 100644 --- a/HDL_ON/HDL_ON.projitems +++ b/HDL_ON/HDL_ON.projitems @@ -536,6 +536,8 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\CombinedDimming\GroupControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\CombinedDimming\AddCombineDimmingPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\FreeviewMemberInfo.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\CombinedDimming\GroupChooseRoomPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\CombinedDimming\AddGroupControlPage.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" /> diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs index 64abe60..2a74a67 100644 --- a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs +++ b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs @@ -39,7 +39,7 @@ { bodyView.BackgroundColor = CSS_Color.BackgroundColor; - if (titleId == StringId.Lights) + if (titleId == StringId.Lights && !DB_ResidenceData.Instance.CurrentRegion.isSupportGroupControl) { Action action = () => { diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs index 6f695e2..cb55326 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs @@ -25,7 +25,13 @@ sceneFunction = fc.localFunction.ConvertSceneFunction(); foreach(var ll in sceneFunction.status) { - ll.value = fc.status.Find((obj) => obj.key == ll.key).value; + try + { + var temp = fc.status.Find((obj) => obj.key == ll.key); + if (temp != null) + ll.value = temp.value; + } + catch { } } //sceneFunction = fc; refreshAction = action; @@ -148,15 +154,6 @@ btnConfrim.MouseUpEventHandler = (sender, e) => { var temp = scene.functions.Find((obj) => obj.sid == sceneFunction.sid); - //if (sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness) != null) - //{ - // try - // { - // //涓�绔彛涓嶆敮鎸佸紑鍏冲�间笌浜害鍊间竴璧峰鐞嗭紝闇�瑕佸皢寮�鍏冲�肩Щ闄ゆ帀 - // sceneFunction.status.Remove(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff)); - // } - // catch { } - //} if (temp != null) { diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddCombineDimmingPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddCombineDimmingPage.cs index 9779f31..b5611fd 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddCombineDimmingPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddCombineDimmingPage.cs @@ -1,127 +1,264 @@ -锘縰sing System; -using Shared; -using HDL_ON.Entity; -using HDL_ON.UI.CSS; +锘�//using System; +//using Shared; +//using HDL_ON.Entity; +//using HDL_ON.UI.CSS; -namespace HDL_ON.UI -{ - public class AddCombineDimmingPage : FrameLayout - { - FrameLayout bodyView; - - public AddCombineDimmingPage() - { - bodyView = this; - } - - public void LoadPage() - { - new TopViewDiv(bodyView, Language.StringByID(StringId.CombinedDimming)).LoadTopView(); - - var contentView = new FrameLayout() - { - Y = Application.GetRealHeight(64), - BackgroundColor = CSS_Color.MainBackgroundColor, - Height = Application.GetRealHeight(550), - }; - bodyView.AddChidren(contentView); - - #region 浣忓畢鍚嶇О - FrameLayout residenceNameRow; - residenceNameRow = new FrameLayout() - { - Y = Application.GetRealHeight(72), - Height = Application.GetRealHeight(50), - BackgroundColor = CSS_Color.MainBackgroundColor, - }; - contentView.AddChidren(residenceNameRow); - Button btnResidenceNameTitle = new Button() - { - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(78), - TextID = StringId.ResidenceName, - TextAlignment = TextAlignment.CenterLeft, - TextSize = CSS_FontSize.SubheadingFontSize, - TextColor = CSS_Color.FirstLevelTitleColor, - }; - residenceNameRow.AddChidren(btnResidenceNameTitle); - - var btnResidenceName = new Button() - { - X = Application.GetRealWidth(2) + btnResidenceNameTitle.Right, - Width = Application.GetRealWidth(200), - Text = DB_ResidenceData.Instance.CurrentRegion.homeName, - TextSize = CSS_FontSize.TextFontSize, - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.TextualColor, - }; - residenceNameRow.AddChidren(btnResidenceName); - - var btnEditResidenceNameIcon = new Button() - { - X = Application.GetRealWidth(333), - Gravity = Gravity.CenterVertical, - Width = Application.GetMinRealAverage(28), - Height = Application.GetMinRealAverage(28), - UnSelectedImagePath = "Public/Edit.png", - }; - residenceNameRow.AddChidren(btnEditResidenceNameIcon); - - #endregion - residenceNameRow.AddChidren( - new Button() - { - Gravity = Gravity.CenterHorizontal, - Y = Application.GetRealHeight(49), - Height = Application.GetRealHeight(1), - Width = Application.GetRealWidth(343), - BackgroundColor = CSS_Color.DividingLineColor, - }); - #region 浣忓畢鍦板潃 - var residenceAddressRow = new FrameLayout() - { - Y = residenceNameRow.Bottom, - Height = Application.GetRealHeight(50), - BackgroundColor = CSS_Color.MainBackgroundColor, - }; - contentView.AddChidren(residenceAddressRow); - - var btnResidenceAddressTitle = new Button() - { - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(78), - TextID = StringId.ResidenceAddress, - TextAlignment = TextAlignment.CenterLeft, - TextSize = CSS_FontSize.SubheadingFontSize, - TextColor = CSS_Color.FirstLevelTitleColor, - }; - residenceAddressRow.AddChidren(btnResidenceAddressTitle); - - var btnLocationAddressIcon = new Button() - { - X = Application.GetRealWidth(333), - Gravity = Gravity.CenterVertical, - Width = Application.GetMinRealAverage(28), - Height = Application.GetMinRealAverage(28), - //UnSelectedImagePath = "Public/LocationAddressIcon.png", - UnSelectedImagePath = "Public/Edit.png", - }; - residenceAddressRow.AddChidren(btnLocationAddressIcon); - - var btnResidenceAddress = new Button() - { - X = Application.GetRealWidth(2) + btnResidenceNameTitle.Right, - Width = Application.GetRealWidth(200), - Text = DB_ResidenceData.Instance.CurrentRegion.homeAddress, - TextSize = CSS_FontSize.TextFontSize, - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.TextualColor, - }; - residenceAddressRow.AddChidren(btnResidenceAddress); - #endregion - contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) }); +//namespace HDL_ON.UI +//{ +// public class AddCombineDimmingPage : FrameLayout +// { +// FrameLayout bodyView; - } - } -} +// GroupControl groupControl; + +// public AddCombineDimmingPage() +// { +// bodyView = this; +// groupControl = new GroupControl(); +// } + +// public void LoadPage() +// { +// new TopViewDiv(bodyView, Language.StringByID(StringId.CombinedDimming)).LoadTopView(); + +// var contentView = new FrameLayout() +// { +// Y = Application.GetRealHeight(64), +// BackgroundColor = CSS_Color.MainBackgroundColor, +// Height = Application.GetRealHeight(550), +// }; +// bodyView.AddChidren(contentView); + +// #region 缁勫悕绉� +// FrameLayout groupNameView; +// groupNameView = new FrameLayout() +// { +// Height = Application.GetRealHeight(50), +// BackgroundColor = CSS_Color.MainBackgroundColor, +// }; +// contentView.AddChidren(groupNameView); +// Button btnGroupNameTitle = new Button() +// { +// X = Application.GetRealWidth(16), +// Width = Application.GetRealWidth(78), +// TextID = StringId.GroupNmae, +// TextAlignment = TextAlignment.CenterLeft, +// TextSize = CSS_FontSize.SubheadingFontSize, +// TextColor = CSS_Color.FirstLevelTitleColor, +// }; +// groupNameView.AddChidren(btnGroupNameTitle); + +// var btnGroupName = new EditText() +// { +// X = Application.GetRealWidth(155), +// Width = Application.GetRealWidth(200), +// PlaceholderText =Language.StringByID( StringId.PlsEntry), +// TextSize = CSS_FontSize.TextFontSize, +// TextAlignment = TextAlignment.CenterRight, +// TextColor = CSS_Color.TextualColor, +// }; +// groupNameView.AddChidren(btnGroupName); + +// groupNameView.AddChidren( +// new Button() +// { +// Gravity = Gravity.CenterHorizontal, +// Y = Application.GetRealHeight(49), +// Height = Application.GetRealHeight(1), +// Width = Application.GetRealWidth(343), +// BackgroundColor = CSS_Color.DividingLineColor, +// }); +// #endregion +// #region 浣嶇疆绠$悊 +// var locationMagtView = new FrameLayout() +// { +// Height = Application.GetRealHeight(55), +// BackgroundColor = CSS_Color.MainBackgroundColor, +// }; +// contentView.AddChidren(locationMagtView); + +// var btnLocationMagtTitle = new Button() +// { +// X = Application.GetRealWidth(16), +// Width = Application.GetRealWidth(160), +// TextAlignment = TextAlignment.CenterLeft, +// TextColor = CSS_Color.FirstLevelTitleColor, +// TextSize = CSS_FontSize.SubheadingFontSize, +// TextID = StringId.LocationManagement, +// }; +// locationMagtView.AddChidren(btnLocationMagtTitle); + +// var btnLocationValues = new Button() +// { +// X = Application.GetRealWidth(86), +// Width = Application.GetRealWidth(237), +// TextAlignment = TextAlignment.CenterRight, +// TextColor = CSS_Color.PromptingColor1, +// TextSize = CSS_FontSize.TextFontSize, +// Text = groupControl.GetRoomListName(), +// }; +// locationMagtView.AddChidren(btnLocationValues); + +// var btnLocationInfoRight = new Button() +// { +// X = Application.GetRealWidth(339), +// Gravity = Gravity.CenterVertical, +// Width = Application.GetMinRealAverage(16), +// Height = Application.GetMinRealAverage(16), +// UnSelectedImagePath = "Public/RightIcon.png", +// }; +// locationMagtView.AddChidren(btnLocationInfoRight); +// EventHandler<MouseEventArgs> eventHandler = (sender, e) => +// { +// //淇敼鍔熻兘鎵�灞炴埧闂翠箣鍚庣殑鍥炶皟浜嬩欢 +// Action chooseRoomBackAction = () => { +// try +// { +// btnLocationValues.Text = groupControl.GetRoomListName(); +// } +// catch { } +// }; +// var view = new GroupChooseRoomPage(groupControl, chooseRoomBackAction); +// MainPage.BasePageView.AddChidren(view); +// view.LoadPage(); +// MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; +// }; +// if (btnLocationInfoRight != null) +// { +// btnLocationInfoRight.MouseUpEventHandler = eventHandler; +// } +// if (btnLocationValues != null) +// { +// btnLocationValues.MouseUpEventHandler = eventHandler; +// } + +// locationMagtView.AddChidren( +// new Button() +// { +// Gravity = Gravity.CenterHorizontal, +// BackgroundColor = CSS_Color.DividingLineColor, +// Width = Application.GetRealWidth(343), +// Height = Application.GetRealHeight(1) +// }); +// #endregion + +// #region 璁惧閫夋嫨 +// contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) }); + +// var chooseFunctionTitleView = new FrameLayout() +// { +// Height = Application.GetRealHeight(44), +// BackgroundColor = CSS_Color.MainBackgroundColor, +// }; +// contentView.AddChidren(chooseFunctionTitleView); +// contentView.AddChidren( +// new Button() +// { +// Gravity = Gravity.CenterHorizontal, +// Y = Application.GetRealHeight(49), +// Height = Application.GetRealHeight(1), +// Width = Application.GetRealWidth(343), +// BackgroundColor = CSS_Color.DividingLineColor, +// }); + +// var btnChooseFunctionTitle = new Button() +// { +// X = Application.GetRealWidth(16), +// TextAlignment = TextAlignment.CenterLeft, +// TextColor = CSS_Color.MainColor, +// TextSize = CSS_FontSize.SubheadingFontSize, +// IsBold = true, +// TextID = StringId.SelectGroupControlFunction, +// }; +// chooseFunctionTitleView.AddChidren(btnChooseFunctionTitle); + +// var deviceListView = new VerticalScrolViewLayout() +// { +// Height = Application.GetRealHeight(387), +// }; +// contentView.AddChidren(deviceListView); + +// foreach(var function in FunctionList.List.GetLightList()) +// { +// var functionRow = new FrameLayout() +// { +// Height = Application.GetRealHeight(65), +// BackgroundColor = CSS_Color.MainBackgroundColor, +// }; +// deviceListView.AddChidren(functionRow); + +// var btnFunctionName = new Button() +// { +// X = Application.GetRealWidth(16), +// Y = Application.GetRealHeight(10), +// Width = Application.GetRealWidth(308), +// Height = Application.GetRealHeight(24), +// TextAlignment = TextAlignment.CenterLeft, +// TextSize = CSS_FontSize.SubheadingFontSize, +// TextColor = CSS_Color.FirstLevelTitleColor, +// Text = function.name, +// }; +// functionRow.AddChidren(btnFunctionName); + +// var btnFunctionLocationInfo = new Button() +// { +// X = Application.GetRealWidth(16), +// Y = btnFunctionName.Bottom, +// Width = Application.GetRealWidth(308), +// Height = Application.GetRealHeight(21), +// TextAlignment = TextAlignment.CenterLeft, +// TextSize = CSS_FontSize.PromptFontSize_FirstLevel, +// TextColor = CSS_Color.PromptingColor1, +// Text = function.GetRoomListName(), +// }; +// functionRow.AddChidren(btnFunctionLocationInfo); + + + + +// } + + +// #endregion + +// #region 搴曢儴纭鎸夐挳 + + + +// var bottomView = new FrameLayout() +// { +// Y = Application.GetRealHeight(591), +// Height = Application.GetRealHeight(106), +// BackgroundColor = CSS_Color.MainBackgroundColor, +// Radius = (uint)Application.GetRealWidth(16), +// }; +// bodyView.AddChidren(bottomView); + +// var btnConfrim = new Button() +// { +// Gravity = Gravity.CenterHorizontal, +// Y = Application.GetRealHeight(12), +// Width = Application.GetRealWidth(220), +// Height = Application.GetRealWidth(44), +// TextAlignment = TextAlignment.Center, +// TextColor = CSS_Color.MainBackgroundColor, +// BackgroundColor = CSS_Color.MainColor, +// TextSize = CSS_FontSize.SubheadingFontSize, +// IsBold = true, +// Radius = (uint)Application.GetRealWidth(22), +// TextID = StringId.Complete +// }; +// bottomView.AddChidren(btnConfrim); + +// btnConfrim.MouseUpEventHandler = (sender, e) => +// { + +// }; + +// #endregion + + +// } +// } +//} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs new file mode 100644 index 0000000..2d893bc --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs @@ -0,0 +1,1541 @@ +锘� +using System; +using System.Collections.Generic; +using System.Threading; +using HDL_ON.DAL.Server; +using HDL_ON.DriverLayer; +using HDL_ON.Entity; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI +{ + public class AddGroupControlPage : FrameLayout + { + #region 鎺т欢鍒楄〃 + /// <summary> + /// 褰撳墠绐椾綋 + /// </summary> + FrameLayout bodyView; + /// <summary> + /// 妤煎眰閫夋嫨涓嬫媺鍥炬爣 + /// </summary> + Button btnFloorDownIcon; + /// <summary> + /// 妤煎眰鏄剧ず + /// </summary> + Button btnFloor; + /// <summary> + /// 鍏ㄩ�夋寜閽� + /// </summary> + Button btnChooseAll; + /// <summary> + /// 鍔熻兘鍒楄〃闆嗗悎鏄剧ず鍖哄煙 + /// </summary> + VerticalScrolViewLayout functionListView; + /// <summary> + /// 瀹屾垚鎸夐挳 + /// </summary> + Button btnConfrim; + + #endregion + /// <summary> + /// 鍔熻兘鍒楄〃 + /// </summary> + List<Function> groupControlLightList; + /// <summary> + /// 鏈湴鐨勭伅鍏夊垪琛� + /// </summary> + List<Function> lightList; + /// <summary> + /// 鍥炶皟鍒锋柊 + /// </summary> + Action backActon; + + + GroupControl groupControl; + + + + public AddGroupControlPage(List<Function> functions, GroupControl groupControl, Action action) + { + bodyView = this; + groupControlLightList = functions; + backActon = action; + lightList = FunctionList.List.GetLightList(); + this.groupControl = groupControl; + } + + public void LoadPage() + { + bodyView.BackgroundColor = CSS_Color.BackgroundColor; + new TopViewDiv(bodyView, Language.StringByID(StringId.CombinedDimming)).LoadTopView(); + + var contentView = new FrameLayout() + { + Y = Application.GetRealHeight(64), + Height = Application.GetRealHeight(550), + }; + bodyView.AddChidren(contentView); + + #region 缁勫悕绉� + FrameLayout groupNameView; + groupNameView = new FrameLayout() + { + Height = Application.GetRealHeight(50), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(groupNameView); + Button btnGroupNameTitle = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(78), + TextID = StringId.GroupNmae, + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.SubheadingFontSize, + TextColor = CSS_Color.FirstLevelTitleColor, + }; + groupNameView.AddChidren(btnGroupNameTitle); + + var etGroupName = new EditText() + { + X = Application.GetRealWidth(155), + Width = Application.GetRealWidth(200), + PlaceholderText = Language.StringByID(StringId.PlsEntry), + TextSize = CSS_FontSize.TextFontSize, + TextAlignment = TextAlignment.CenterRight, + TextColor = CSS_Color.TextualColor, + }; + groupNameView.AddChidren(etGroupName); + + groupNameView.AddChidren( + new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(49), + Height = Application.GetRealHeight(1), + Width = Application.GetRealWidth(343), + BackgroundColor = CSS_Color.DividingLineColor, + }); + #endregion + #region 浣嶇疆绠$悊 + var locationMagtView = new FrameLayout() + { + Y = Application.GetRealHeight(50), + Height = Application.GetRealHeight(50), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(locationMagtView); + + var btnLocationMagtTitle = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(160), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.LocationManagement, + }; + locationMagtView.AddChidren(btnLocationMagtTitle); + + var btnLocationValues = new Button() + { + X = Application.GetRealWidth(86), + Width = Application.GetRealWidth(237), + TextAlignment = TextAlignment.CenterRight, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.TextFontSize, + Text = groupControl.GetRoomListName(), + }; + locationMagtView.AddChidren(btnLocationValues); + + var btnLocationInfoRight = new Button() + { + X = Application.GetRealWidth(339), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/RightIcon.png", + }; + locationMagtView.AddChidren(btnLocationInfoRight); + EventHandler<MouseEventArgs> eventHandler = (sender, e) => + { + //淇敼鍔熻兘鎵�灞炴埧闂翠箣鍚庣殑鍥炶皟浜嬩欢 + Action chooseRoomBackAction = () => { + try + { + btnLocationValues.Text = groupControl.GetRoomListName(); + } + catch { } + }; + var view = new GroupChooseRoomPage(groupControl, chooseRoomBackAction); + MainPage.BasePageView.AddChidren(view); + view.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + btnLocationInfoRight.MouseUpEventHandler = eventHandler; + btnLocationValues.MouseUpEventHandler = eventHandler; + + + //locationMagtView.AddChidren( + // new Button() + // { + // Y = Application.GetRealHeight(49), + // Gravity = Gravity.CenterHorizontal, + // BackgroundColor = CSS_Color.DividingLineColor, + // Width = Application.GetRealWidth(343), + // Height = Application.GetRealHeight(1) + // }); + #endregion + + //contentView.AddChidren(new Button() + //{ + // Y = Application.GetRealHeight(164), + // BackgroundColor = CSS_Color.BackgroundColor, + //}); + + /// <summary> + /// 鎴块棿鍐呭鏄剧ず鍖哄煙 + /// </summary> + var roomFloorChangeView = new FrameLayout() + { + Y = Application.GetRealHeight(172), + Height = Application.GetRealHeight(52), + BackgroundColor = CSS_Color.BackgroundColor, + }; + bodyView.AddChidren(roomFloorChangeView); + #region 鎴块棿椤堕儴鍒囨崲鏄剧ず鍖哄煙 + btnFloorDownIcon = new Button() + { + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + X = Application.GetRealWidth(16), + Y = Application.GetRealHeight(18), + UnSelectedImagePath = "Public/DownIcon.png", + }; + roomFloorChangeView.AddChidren(btnFloorDownIcon); + + btnFloor = new Button() + { + X = btnFloorDownIcon.Right, + Width = Application.GetRealWidth(200), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextAlignment = TextAlignment.CenterLeft, + Text = DB_ResidenceData.Instance.CurFloor.roomName, + }; + roomFloorChangeView.AddChidren(btnFloor); + + btnChooseAll = new Button() + { + X = Application.GetRealWidth(245), + Width = Application.GetRealWidth(109), + TextAlignment = TextAlignment.CenterRight, + TextSize = CSS_FontSize.TextFontSize, + TextColor = CSS_Color.FirstLevelTitleColor, + TextID = StringId.SelectedAll, + }; + if (groupControlLightList.Count > 0) + { + btnChooseAll.TextID = StringId.Cancel; + } + roomFloorChangeView.AddChidren(btnChooseAll); + btnChooseAll.MouseUpEventHandler = (sender, e) => { + if (groupControlLightList.Count > 0) + { + groupControlLightList.Clear(); + btnChooseAll.TextID = StringId.SelectAll; + btnConfrim.IsSelected = false; + } + else + { + groupControlLightList.AddRange(lightList); + btnChooseAll.TextID = StringId.Cancel; + btnConfrim.IsSelected = true; + } + LoadLightRow(lightList); + }; + + #endregion + + functionListView = new VerticalScrolViewLayout() + { + Y = Application.GetRealHeight(220), + Height = Application.GetRealHeight(640 - 12 - 52 - 100 -100), + }; + bodyView.AddChidren(functionListView); + + + LoadLightRow(lightList); + functionListView.AddChidren(new Button() + { + Height = Application.GetRealHeight(10), + }); + + #region 搴曢儴view + var bottomView = new FrameLayout() + { + Y = Application.GetRealHeight(591), + Height = Application.GetRealHeight(100), + BackgroundColor = CSS_Color.MainBackgroundColor, + Radius = (uint)Application.GetRealWidth(12), + }; + this.AddChidren(bottomView); + + btnConfrim = new Button() + { + Y = Application.GetRealHeight(12), + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(220), + Height = Application.GetRealHeight(44), + Radius = (uint)Application.GetRealHeight(22), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.MainBackgroundColor, + BackgroundColor = CSS_Color.BackgroundColor, + TextID = StringId.Confirm, + TextSize = CSS_FontSize.SubheadingFontSize, + SelectedTextColor = CSS_Color.MainBackgroundColor, + SelectedBackgroundColor = CSS_Color.MainColor, + }; + bottomView.AddChidren(btnConfrim); + btnConfrim.MouseUpEventHandler = (sender, e) => { + if (btnConfrim.IsSelected) + { + //淇濆瓨缇ゆ帶鏁版嵁 + var name = etGroupName.Text.Trim(); + if (string.IsNullOrEmpty(name)) + { + new PublicAssmebly().TipMsg(StringId.Tip, StringId.PlsEntryGroupName); + return; + } + groupControl.name = name; + groupControl.sids.Clear(); + foreach (var light in groupControlLightList) + { + try + { + var gc = new GroupControlFunction(); + gc.sid = light.sid; + gc.spk = light.spk; + groupControl.sids.Add(gc); + } + catch (Exception ex) + { + MainPage.Log($"鏂板缇ゆ帶杞崲鏁版嵁寮傚父:{ex.Message}"); + } + } + try + { + var http = new HttpServerRequest(); + var pack = http.AddGroupControl(new List<GroupControl>() { groupControl }); + if (pack != null) + { + if(pack.Code == StateCode.SUCCESS) + { + backActon?.Invoke(); + this.RemoveFromParent(); + } + else + { + IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); + } + } + } + catch (Exception ex) + { + MainPage.Log($"鏂板缇ゆ帶寮傚父:{ex.Message}"); + } + } + }; + + #endregion + + //鍔犺浇鍔熻兘绛涢�夌粍浠� + LoadDialog_ChangeFloor(); + } + + /// <summary> + /// 鏄剧ず鐨勮澶囩殑鎬绘暟 + /// </summary> + int showCount = 0; + + /// <summary> + /// 鍔犺浇鍔熻兘row + /// </summary> + /// <param name="lightList"></param> + void LoadLightRow(List<Function> functions, bool isAppend = false) + { + var waitPage = new Loading(); + bodyView.AddChidren(waitPage); + waitPage.Start(""); + + new Thread(() => + { + try + { + Application.RunOnMainThread(() => + { + if (!isAppend) + { + showCount = 0; + functionListView.RemoveAll(); + } + int i = 0; + foreach (var function in functions) + { + i++; + if (i > 100) + { + break; + } + showCount++; + var functionDiv = new LightRow(function) + { + Gravity = Gravity.CenterHorizontal, + //Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(62), + BorderColor = 0x00FFFFFF, + BorderWidth = 1, + BackgroundColor = CSS_Color.MainBackgroundColor, + Tag = function.spk + function.sid + }; + functionDiv.AddChidren(new Button() + { + Y = Application.GetRealHeight(61), + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealWidth(1), + BackgroundColor = CSS_Color.DividingLineColor, + }); + + Action setAction = () => + { + if (groupControlLightList.Count > 0) + { + btnConfrim.IsSelected = true; + } + else + { + btnConfrim.IsSelected = false; + } + }; + + functionDiv.LoadDiv(groupControlLightList, setAction); + functionListView.AddChidren(functionDiv); + } + + if (functions.Count > showCount) + { + var btnAppend = new Button() + { + Height = Application.GetRealHeight(60), + TextAlignment = TextAlignment.Center, + TextSize = CSS_FontSize.SubheadingFontSize, + TextColor = CSS_Color.FirstLevelTitleColor, + Text = "鍔犺浇鏇村", + }; + if (Language.CurrentLanguage != "Chinese") + { + btnAppend.Text = "Load more"; + } + functionListView.AddChidren(btnAppend); + btnAppend.MouseUpEventHandler = (sender, e) => + { + btnAppend.RemoveFromParent(); + LoadLightRow(functions, true); + }; + } + }); + } + catch (Exception ex) + { + MainPage.Log("ShowFunctionRowError : " + ex.Message); + } + finally + { + Application.RunOnMainThread(() => + { + if (waitPage != null) + { + waitPage.RemoveFromParent(); + waitPage = null; + } + }); + } + }) + { IsBackground = true }.Start(); + + } + + + /// <summary> + /// 浣忓畢鍒楄〃鐐瑰嚮浜嬩欢 + /// </summary> + void LoadDialog_ChangeFloor() + { + string nowSelectId = null; + btnFloor.MouseUpEventHandler += (sender, e) => + { + //鏄剧ず涓嬫媺鍒楄〃 + var form = new FloorRoomSelectPopupView(); + form.ShowDeviceFunctionView(btnFloor, this.lightList, (selectId, listFunc) => + { + btnChooseAll.MouseUpEventHandler = (sender2, e2) => { + if (groupControlLightList.Count > 0) + { + groupControlLightList.Clear(); + btnChooseAll.TextID = StringId.SelectAll; + btnConfrim.IsSelected = false; + } + else + { + groupControlLightList.AddRange(listFunc); + btnChooseAll.TextID = StringId.Cancel; + btnConfrim.IsSelected = true; + } + LoadLightRow(listFunc); + }; + nowSelectId = selectId; + //閲嶆柊鍔犺浇鐣岄潰 + LoadLightRow(listFunc); + }, nowSelectId); + }; + } + + } + + + //public class LightRow : FrameLayout + //{ + // #region 鍖哄煙鎺т欢 + // static FrameLayout bodyDiv; + // /// <summary> + // /// 鍔熻兘/鍦烘櫙icon + // /// </summary> + // Button btnIcon; + // /// <summary> + // /// 鍔熻兘鍚嶇О/鍦烘櫙鍚嶇О + // /// </summary> + // Button btnName; + // /// <summary> + // /// 妤煎眰淇℃伅鏄剧ず鎸夐挳 + // /// </summary> + // Button btnFromFloor; + // /// <summary> + // /// 閫変腑鎸夐挳 + // /// </summary> + // Button btnSelect; + // #endregion + + // #region 鍖哄煙鍙橀噺 + // Function function; + // #endregion + // public LightRow(Function func) + // { + // bodyDiv = this; + // bodyDiv.Tag = func.sid; + // function = func; + // } + + + // /// <summary> + // /// 鍔犺浇鎺у埗鍗$墖鍖哄煙 + // /// </summary> + // public void LoadDiv(List<Function> functions, Action action) + // { + // btnIcon = new Button() + // { + // X = Application.GetRealWidth(10), + // Y = Application.GetRealHeight(15), + // Width = Application.GetRealWidth(32), + // Height = Application.GetRealWidth(32), + // UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png" + // }; + // bodyDiv.AddChidren(btnIcon); + + // btnName = new Button() + // { + // X = Application.GetRealWidth(8 + 10 + 32), + // Y = Application.GetRealHeight(10), + // Width = Application.GetRealWidth(200), + // Height = Application.GetRealHeight(24), + // Text = function.name, + // TextAlignment = TextAlignment.CenterLeft, + // TextColor = CSS_Color.FirstLevelTitleColor, + // TextSize = CSS_FontSize.TextFontSize, + // }; + // bodyDiv.AddChidren(btnName); + + // btnFromFloor = new Button() + // { + // X = Application.GetRealWidth(8 + 10 + 32), + // Y = Application.GetRealHeight(10 + 24), + // Width = Application.GetRealWidth(200), + // Height = Application.GetRealHeight(18), + // Text = function.GetRoomListName(), + // TextAlignment = TextAlignment.CenterLeft, + // TextColor = CSS_Color.PromptingColor1, + // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + // }; + // bodyDiv.AddChidren(btnFromFloor); + + // btnSelect = new Button() + // { + // X = Application.GetRealWidth(303), + // Gravity = Gravity.CenterVertical, + // Width = Application.GetRealWidth(32), + // Height = Application.GetRealWidth(32), + // UnSelectedImagePath = "FunctionIcon/Light/LightScene/CheckIcon.png", + // SelectedImagePath = "FunctionIcon/Light/LightScene/CheckOnIcon.png", + // IsSelected = functions.Find((obj) => obj.deviceId == function.deviceId) != null + // }; + // bodyDiv.AddChidren(btnSelect); + + // btnSelect.MouseUpEventHandler = (sender, e) => { + // btnSelect.IsSelected = !btnSelect.IsSelected; + // if (btnSelect.IsSelected) + // { + // var addTemp = functions.Find((obj) => obj.deviceId == function.deviceId); + // if (addTemp == null) + // { + // functions.Add(function); + // } + // } + // else + // { + // var removeTemp = functions.Find((obj) => obj.deviceId == function.deviceId); + // if (removeTemp != null) + // { + // functions.Remove(removeTemp); + // } + // } + // ///鍒锋柊鐣岄潰 + // if (functions.Count == 0 || functions.Count == 1) + // { + // action(); + // } + // }; + + // } + + + //} + + ///// <summary> + ///// 鐏厜鍦烘櫙缂栬緫寮圭獥 + ///// </summary> + //public class LightSceneEditDialog : Dialog + //{ + + + // Dictionary<string, string> d = new Dictionary<string, string>(); + // List<Function> listSwitch = new List<Function>(); + // List<Function> lightDimming = new List<Function>(); + // List<Function> lightCCT = new List<Function>(); + // List<Function> lightRGB = new List<Function>(); + + // /// <summary> + // /// 浼犲叆鐨勭伅鍏夊垪琛� + // /// 鍔犲叆鍦烘櫙鎺у埗鍔熻兘鍒楄〃 + // /// </summary> + // List<Function> lights; + // /// <summary> + // /// 涓存椂鐏厜瀵硅薄 + // /// 澶勭悊鐏厜鏂规硶 + // /// </summary> + // Light tempLight = new Light(); + // //鍙戦�佹暟鎹敹闆� + // Dictionary<string, string> commandDic = new Dictionary<string, string>(); + + // Scene scene; + // Action<Scene> backAction; + // public LightSceneEditDialog(List<Function> functions, Scene inParScene, Action<Scene> action) + // { + // lights = functions; + // scene = inParScene; + // backAction = action; + // } + + + // public void ShowDialog() + // { + // commandDic.Clear(); + // commandDic.Add(FunctionAttributeKey.OnOff, "off"); + + // listSwitch = lights.FindAll((obj) => obj.spk == SPK.LightSwitch); + // lightDimming = lights.FindAll((obj) => obj.spk == SPK.LightDimming); + // lightCCT = lights.FindAll((obj) => obj.spk == SPK.LightCCT); + // lightRGB = lights.FindAll((obj) => obj.spk == SPK.LightRGB); + + + + // var hadDimming = lightDimming.Count > 0; + // var hadCCT = lightCCT.Count > 0; + // var hadRGB = lightRGB.Count > 0; + // if (hadRGB) + // { + // commandDic.Add(FunctionAttributeKey.RGB, lightRGB[0].GetAttrState(FunctionAttributeKey.RGB)); + // commandDic.Add(FunctionAttributeKey.Brightness, lightRGB[0].GetAttrState(FunctionAttributeKey.Brightness)); + // } + // if (hadCCT) + // { + // commandDic.Add(FunctionAttributeKey.CCT, lightCCT[0].GetAttrState(FunctionAttributeKey.CCT)); + // if (!commandDic.ContainsKey(FunctionAttributeKey.Brightness)) + // { + // commandDic.Add(FunctionAttributeKey.Brightness, lightCCT[0].GetAttrState(FunctionAttributeKey.Brightness)); + // } + // } + // if (hadDimming) + // { + // if (!commandDic.ContainsKey(FunctionAttributeKey.Brightness)) + // { + // commandDic.Add(FunctionAttributeKey.Brightness, lightDimming[0].GetAttrState(FunctionAttributeKey.Brightness)); + // } + // } + + // var bodyView = new FrameLayout(); + // this.AddChidren(bodyView); + // bodyView.MouseUpEventHandler = (sender, e) => { + // this.Close(); + // }; + + // var contentView = new FrameLayout() + // { + // BackgroundColor = CSS_Color.MainBackgroundColor, + // Width = Application.GetRealWidth(343), + // Radius = (uint)Application.GetRealWidth(12), + // }; + // bodyView.AddChidren(contentView); + + // #region 鏍囬鍖� + // var titleView = new FrameLayout() + // { + // Width = Application.GetRealWidth(343), + // Height = Application.GetRealHeight(52), + // }; + // contentView.AddChidren(titleView); + + // var btnTitle = new Button() + // { + // Height = Application.GetRealHeight(52), + // Gravity = Gravity.Center, + // TextSize = CSS_FontSize.SubheadingFontSize, + // TextColor = CSS_Color.MainColor, + // TextID = StringId.CombinedDimming, + // TextAlignment = TextAlignment.Center, + // }; + // if (btnTitle.GetTextWidth() > Application.GetRealWidth(197))//247 + // { + // btnTitle.Width = Application.GetRealWidth(197); + // btnTitle.IsMoreLines = true; + // } + // else + // { + // btnTitle.Width = btnTitle.GetTextWidth() + Application.GetRealWidth(10); + // btnTitle.IsMoreLines = false; + // } + // titleView.AddChidren(btnTitle); + + // var btnEditIcon = new Button() + // { + // Width = Application.GetRealWidth(24), + // Height = Application.GetRealWidth(24), + // X = Application.GetRealWidth(12) + btnTitle.Right, + // Gravity = Gravity.CenterVertical, + // UnSelectedImagePath = "Public/Edit.png", + // }; + // if (string.IsNullOrEmpty(scene.userSceneId)) + // { + // titleView.AddChidren(btnEditIcon); + // } + // else + // { + // btnTitle.Text = scene.name; + // btnTitle.Width = btnTitle.GetTextWidth() + Application.GetRealWidth(10); + // btnTitle.Gravity = Gravity.Center; + // } + + // Action<string> callBack = (str) => + // { + // //鍚嶇О涓嶈兘涓虹┖ + // if (string.IsNullOrEmpty(str)) + // { + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.NameCannotBeEmpty), + // Direction = AMPopTipDirection.None, + // }.Show(bodyView); + // return; + // } + // btnTitle.Text = str; + // scene.name = str; + + + // if (btnTitle.GetTextWidth() > Application.GetRealWidth(197))//247 + // { + // btnTitle.Width = Application.GetRealWidth(197); + // } + // else + // { + // btnTitle.Width = btnTitle.GetTextWidth(); + // } + + // }; + // EventHandler<MouseEventArgs> eventHandler = (sender, e) => + // { + // List<string> sceneNameList = new List<string>(); + // foreach (var tempScene in FunctionList.List.scenes) + // { + // sceneNameList.Add(tempScene.name); + // } + // new PublicAssmebly().LoadDialog_EditParater(StringId.SceneName, scene.name, callBack, StringId.SceneNameCannotBeEmpty, StringId.SceneNameAlreadyExists, sceneNameList); + // }; + // btnTitle.MouseUpEventHandler = eventHandler; + // btnEditIcon.MouseUpEventHandler = eventHandler; + + // titleView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor, Y = Application.GetRealHeight(51) }); + + // #endregion + + + // //var dimmingLight = lights.Find((obj) => obj.spk == SPK.LightDimming); + // //var cctLight = lights.Find((obj) => obj.spk == SPK.LightCCT); + // //var rgbLight = lights.Find((obj) => obj.spk == SPK.LightRGB); + // var dimmingLight = scene.functions.Find((obj) => obj.localFunction.spk == SPK.LightDimming); + // var cctLight = scene.functions.Find((obj) => obj.localFunction.spk == SPK.LightCCT); + // var rgbLight = scene.functions.Find((obj) => obj.localFunction.spk == SPK.LightRGB); + + // var brightnessValue = 0; + // var cctValue = 27; + // //if(rgbLight!= null) + // //{ + // // int.TryParse(rgbLight.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness).value, out brightnessValue); + // //} + // //if (cctLight != null) + // //{ + // // int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness).value, out brightnessValue); + // // int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.CCT).value, out cctValue); + // //} + // //if(dimmingLight!=null) + // //{ + // // int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.CCT).value, out brightnessValue); + // //} + + + // //灞炴�ц缃尯鍩� + // var attrView = new VerticalScrolViewLayout() + // { + // Y = Application.GetRealHeight(52), + // Width = Application.GetRealWidth(343), + // ScrollEnabled = false, + // }; + // //灞炴�ц缃尯鍩熼珮搴� + // int attrViewHight = Application.GetRealHeight(18 + 22); + + + // //鍙湁缁х數鍣� + // if (!hadDimming && !hadCCT && !hadRGB) + // { + // attrViewHight += Application.GetRealHeight(50); + // attrView.Height = attrViewHight; + // contentView.AddChidren(attrView); + // attrView.AddChidren(new Button() { Height = Application.GetRealHeight(18) }); + + // var view = new FrameLayout() + // { + // Width = Application.GetRealWidth(343), + // Height = Application.GetRealHeight(50), + // }; + // attrView.AddChidren(view); + + + // var btnClose = new Button() + // { + // X = Application.GetRealWidth(50), + // Gravity = Gravity.CenterVertical, + // Width = Application.GetRealWidth(98), + // Height = Application.GetRealHeight(40), + // TextColor = CSS_Color.TextualColor, + // SelectedBackgroundColor = CSS_Color.MainColor, + // SelectedTextColor = CSS_Color.MainBackgroundColor, + // BackgroundColor = CSS_Color.DividingLineColor, + // TextID = StringId.OFF, + // TextSize = CSS_FontSize.TextFontSize, + // Radius = (uint)Application.GetRealWidth(5), + // IsSelected = true, + // //BorderWidth = 1, + // //BorderColor = 0x00000000 + // }; + // view.AddChidren(btnClose); + + // var btnOpen = new Button() + // { + // X = Application.GetRealWidth(100 + 98), + // Gravity = Gravity.CenterVertical, + // Width = Application.GetRealWidth(98), + // Height = Application.GetRealHeight(40), + // TextColor = CSS_Color.TextualColor, + // SelectedBackgroundColor = CSS_Color.MainColor, + // SelectedTextColor = CSS_Color.MainBackgroundColor, + // BackgroundColor = CSS_Color.DividingLineColor, + // TextID = StringId.On, + // TextSize = CSS_FontSize.TextFontSize, + // Radius = (uint)Application.GetRealWidth(5), + // }; + // view.AddChidren(btnOpen); + + // btnClose.MouseUpEventHandler = (sender, e) => + // { + // btnClose.IsSelected = true; + // btnOpen.IsSelected = false; + // commandDic[FunctionAttributeKey.OnOff] = "off"; + // d.Clear(); + // d.Add(FunctionAttributeKey.OnOff, "off"); + // foreach (var light in lights) + // { + // Control.Ins.SendWriteCommand(light, d); + // } + // }; + // btnOpen.MouseUpEventHandler = (sender, e) => + // { + // btnClose.IsSelected = false; + // btnOpen.IsSelected = true; + // commandDic[FunctionAttributeKey.OnOff] = "on"; + // d.Clear(); + // d.Add(FunctionAttributeKey.OnOff, "on"); + // foreach (var light in lights) + // { + // Control.Ins.SendWriteCommand(light, d); + // } + // }; + + // } + + // else + // { + // if (hadRGB) + // { + // attrViewHight += Application.GetRealHeight(248); + // hadDimming = true; + // } + // if (hadCCT) + // { + // attrViewHight += Application.GetRealHeight(54 + 11); + // hadDimming = true; + // } + // if (hadDimming) + // { + // attrViewHight += Application.GetRealHeight(54 + 11); + // } + // attrView.Height = attrViewHight; + // contentView.AddChidren(attrView); + // attrView.AddChidren(new Button() { Height = Application.GetRealHeight(18) }); + + + // if (hadDimming) + // { + // LoadDimmingAttrView(attrView); + // } + // if (hadCCT) + // { + // LoadCctAttrView(attrView); + // } + // if (hadRGB) + // { + // LoadRgbAttrView(attrView); + // } + // } + + // contentView.Height = Application.GetRealHeight(52 + 44) + attrViewHight; + // contentView.Gravity = Gravity.Center; + + + + + // #region bottom View + // var bottomView = new FrameLayout() + // { + // Y = Application.GetRealHeight(52) + attrViewHight, + // Height = Application.GetRealHeight(46), + // }; + // contentView.AddChidren(bottomView); + // bottomView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); + + // if (string.IsNullOrEmpty(scene.userSceneId)) + // { + // var btnCacel = new Button() + // { + // Width = Application.GetRealWidth(172), + // Height = Application.GetRealHeight(44), + // TextAlignment = TextAlignment.Center, + // TextSize = CSS_FontSize.SubheadingFontSize, + // TextColor = CSS_Color.TextualColor, + // TextID = StringId.Cancel, + // }; + // bottomView.AddChidren(btnCacel); + + // var btnSave = new Button() + // { + // X = Application.GetRealWidth(172), + // Width = Application.GetRealWidth(172), + // Height = Application.GetRealHeight(46), + // BackgroundColor = CSS_Color.MainColor, + // TextColor = CSS_Color.MainBackgroundColor, + // TextAlignment = TextAlignment.Center, + // TextSize = CSS_FontSize.SubheadingFontSize, + // TextID = StringId.Save + // }; + // bottomView.AddChidren(btnSave); + + // //渚嬶細鍙充笅鍦嗚 澶у皬涓�50 + // int mRectCornerID = HDLUtils.RectCornerBottomRight; + // btnSave.SetCornerWithSameRadius((uint)Application.GetRealWidth(14), mRectCornerID); + + // btnCacel.MouseUpEventHandler = (sender, e) => + // { + // this.Close(); + + // //var waitPage = new Loading(); + // //MainPage.BaseView.AddChidren(waitPage); + // //waitPage.Start(Language.StringByID(StringId.PleaseWait)); + // //new Thread(() => + // //{ + // // try + // // { + // // foreach (var light in lights) + // // { + // // Dictionary<string, string> sendDate = new Dictionary<string, string>(); + // // //璧嬪�煎満鏅姛鑳芥暟鎹� + // // foreach (var attr in light.GetAttributes()) + // // { + // // if (commandDic.ContainsKey(attr)) + // // { + // // try + // // { + // // sendDate.Add(attr, commandDic[attr]); + // // } + // // catch { } + // // } + + // // } + // // Control.Ins.SendWriteCommand(light, sendDate); + // // Thread.Sleep(50); + // // } + // // } + // // catch + // // { } + // // finally + // // { + // // Application.RunOnMainThread(() => + // // { + // // waitPage.Hide(); + // // new PublicAssmebly().TipMsgAutoClose("缁勫悎鎺у埗宸叉墽琛�", true); + // // if (waitPage != null) + // // { + // // //backAction(null); + // // waitPage.RemoveFromParent(); + // // } + // // }); + // // } + // //}) + // //{ IsBackground = true }.Start(); + // }; + + // btnSave.MouseUpEventHandler = (sender, e) => + // { + // if (string.IsNullOrEmpty(scene.name)) + // { + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.NameCannotBeEmpty), + // Direction = AMPopTipDirection.None, + // }.Show(bodyView); + // return; + // } + // foreach (var tempRoom in FunctionList.List.scenes) + // { + // if (scene.name == tempRoom.name) + // { + // new PublicAssmebly().TipMsg(StringId.Tip, StringId.NameAlreadyExists); + // return; + // } + // } + // var waitPage = new Loading(); + // MainPage.BaseView.AddChidren(waitPage); + // waitPage.Start(Language.StringByID(StringId.PleaseWait)); + // new Thread(() => + // { + // try + // { + // var serverScene = new Scene(); + // for (int i = 0; i < lights.Count; i++) + // { + // var light = lights[i]; + // //璧嬪�煎満鏅姛鑳芥暟鎹� + // foreach (var attr in light.GetAttributes()) + // { + // if (commandDic.ContainsKey(attr)) + // { + // try + // { + // light.SetAttrState(attr, commandDic[attr]); + // } + // catch { } + // } + // } + // //杞崲鍦烘櫙鐨勫姛鑳藉璞� + // var sceneFunction = light.ConvertSceneFunction(); + // //鏌ヨ鏈夋病鏈夊瓨鍦� + // var temp = scene.functions.Find((obj) => obj.sid == sceneFunction.sid); + // //璧嬪�� + // if (temp != null) + // { + // temp = sceneFunction; + // } + // else + // { + // scene.functions.Add(sceneFunction); + // } + // } + // var result = FunctionList.List.AddScene(scene, out serverScene); + // Application.RunOnMainThread(() => + // { + // if (result == StateCode.SUCCESS) + // { + // scene.userSceneId = serverScene.userSceneId; + // FunctionList.List.scenes.Add(scene); + // backAction?.Invoke(scene); + // this.Close(); + // } + // else + // { + // if (result == "124005") + // IMessageCommon.Current.ShowErrorInfoAlter(Language.StringByID(StringId.GatewayOffline)); + // else + // IMessageCommon.Current.ShowErrorInfoAlter(result); + // } + // }); + // } + // catch { } + // finally + // { + // Application.RunOnMainThread(() => + // { + // waitPage.Hide(); + // waitPage.RemoveFromParent(); + // }); + // } + // }) + // { IsBackground = true, Priority = ThreadPriority.AboveNormal }.Start(); + // }; + // } + // else + // { + // var btnCacel = new Button() + // { + // Height = Application.GetRealHeight(44), + // TextAlignment = TextAlignment.Center, + // TextSize = CSS_FontSize.SubheadingFontSize, + // TextColor = CSS_Color.TextualColor, + // TextID = StringId.Close, + // }; + // bottomView.AddChidren(btnCacel); + + + // //渚嬶細鍙充笅鍦嗚 澶у皬涓�50 + // //int mRectCornerID = HDLUtils.RectCornerBottomRight; + // //btnSave.SetCornerWithSameRadius((uint)Application.GetRealWidth(14), mRectCornerID); + + // btnCacel.MouseUpEventHandler = (sender, e) => + // { + // this.Close(); + // }; + + // } + + + + + + // #endregion + + + // this.Show(); + + // } + + // /// <summary> + // /// 鍔犺浇璋冨厜灞炴�ц缃帶浠� + // /// </summary> + // /// <param name="attrView"></param> + // void LoadDimmingAttrView(VerticalScrolViewLayout attrView) + // { + // string briValue = ""; + // commandDic.TryGetValue(FunctionAttributeKey.Brightness, out briValue); + + // var dimmingView = new FrameLayout() + // { + // Height = Application.GetRealHeight(54 + 11) + // }; + // attrView.AddChidren(dimmingView); + + // #region 浜害璋冭妭 + // var btnBrightnessText = new Button() + // { + // X = Application.GetRealWidth(35), + // Y = Application.GetRealHeight(1), + // Width = Application.GetRealWidth(224), + // Height = Application.GetRealHeight(25), + // TextAlignment = TextAlignment.CenterLeft, + // TextColor = CSS_Color.FirstLevelTitleColor, + // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + // TextID = StringId.Brightness, + // }; + // btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + commandDic[FunctionAttributeKey.Brightness] + "%"; + // dimmingView.AddChidren(btnBrightnessText); + + + // var btnMinValuesText = new Button() + // { + // X = Application.GetRealWidth(35), + // Y = btnBrightnessText.Bottom, + // Width = Application.GetRealWidth(40), + // Height = Application.GetRealHeight(21), + // Text = "0%", + // TextAlignment = TextAlignment.CenterLeft, + // TextColor = CSS_Color.PromptingColor1, + // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + // }; + // dimmingView.AddChidren(btnMinValuesText); + + // var dimmerBar = new DiyImageSeekBar() + // { + // X = Application.GetRealWidth(45 + 10), + // Y = Application.GetRealHeight(11), + // Width = Application.GetRealWidth(220), + // Height = Application.GetRealHeight(54), + // SeekBarViewHeight = Application.GetRealHeight(8), + // ThumbImagePath = "Public/ThumbImage.png", + // ThumbImageHeight = Application.GetRealHeight(54), + // ProgressTextColor = CSS_Color.FirstLevelTitleColor, + // ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, + // ProgressBarColor = CSS_Color.AuxiliaryColor1, + // MaxValue = 100, + // Progress = Convert.ToInt32(commandDic[FunctionAttributeKey.Brightness]), + // SeekBarPadding = Application.GetRealWidth(20), + // IsProgressTextShow = false, + // ProgressChangeDelayTime = 0, + // }; + // dimmingView.AddChidren(dimmerBar); + // dimmerBar.OnProgressChangedEvent = (sender, e) => { + // btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + e + "%"; + // }; + // dimmerBar.OnStopTrackingTouchEvent = (sender, e) => { + // commandDic[FunctionAttributeKey.Brightness] = dimmerBar.Progress.ToString(); + // btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + e + "%"; + + // foreach (var light in lights) + // { + // if (light.spk == SPK.LightSwitch) + // { + // d.Clear(); + // d.Add(FunctionAttributeKey.OnOff, e > 0 ? "on" : "off"); + // Control.Ins.SendWriteCommand(light, d); + // } + // else + // { + // d.Clear(); + // d.Add(FunctionAttributeKey.Brightness, e.ToString()); + // Control.Ins.SendWriteCommand(light, d); + // } + // } + // }; + + + // var btnMaxValuesText = new Button() + // { + // X = dimmerBar.Right, + // Y = btnBrightnessText.Bottom, + // Width = Application.GetRealWidth(55), + // Height = Application.GetRealHeight(21), + // Text = "100%", + // TextAlignment = TextAlignment.CenterLeft, + // TextColor = CSS_Color.PromptingColor1, + // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + // }; + // dimmingView.AddChidren(btnMaxValuesText); + // #endregion + + // } + + // /// <summary> + // /// 鍔犺浇cct灞炴�ц缃帶浠� + // /// </summary> + // /// <param name="attrView"></param> + // void LoadCctAttrView(VerticalScrolViewLayout attrView) + // { + // #region 鑹叉俯 + + // string valueStr = "2700"; + // commandDic.TryGetValue(FunctionAttributeKey.CCT, out valueStr); + // int value = Convert.ToInt32(valueStr) / 100; + + // var cctView = new FrameLayout() + // { + // Height = Application.GetRealHeight(54 + 11) + // }; + // attrView.AddChidren(cctView); + + + // //鑹叉俯 + // var btnTempClolor = new Button(); + // btnTempClolor.X = Application.GetRealWidth(35); + // btnTempClolor.Y = Application.GetRealHeight(1); + // btnTempClolor.Width = Application.GetRealWidth(224); + // btnTempClolor.Height = Application.GetRealHeight(21); + // btnTempClolor.TextAlignment = TextAlignment.CenterLeft; + // btnTempClolor.TextColor = CSS_Color.FirstLevelTitleColor; + // btnTempClolor.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; + // btnTempClolor.TextID = StringId.ColorTemperature; + // cctView.AddChidren(btnTempClolor); + + // //2700K + // var btnTempClolorMin = new Button() + // { + // X = Application.GetRealWidth(35), + // Y = btnTempClolor.Bottom, + // Width = Application.GetRealWidth(40), + // Height = Application.GetRealHeight(21), + // }; + // btnTempClolorMin.Width = Application.GetRealWidth(54); + // btnTempClolorMin.Height = Application.GetRealHeight(21); + // btnTempClolorMin.Text = "2700K"; + // btnTempClolorMin.TextAlignment = TextAlignment.CenterLeft; + // btnTempClolorMin.TextColor = CSS_Color.PromptingColor1; + // btnTempClolorMin.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; + // cctView.AddChidren(btnTempClolorMin); + + // //婊戝姩鏉$殑鑳屾櫙鍥剧墖 + // var btnColorTemplatrueBack = new Button() + // { + // X = Application.GetRealWidth(55 + 22 + 15), + // Y = Application.GetRealHeight(11), + // Width = Application.GetRealWidth(180), + // Height = Application.GetRealHeight(54), + // }; + // btnColorTemplatrueBack.UnSelectedImagePath = "FunctionIcon/Light/ColorTemperatureBar.png"; + // btnColorTemplatrueBack.Height = Application.GetRealHeight(8); + // btnColorTemplatrueBack.Gravity = Gravity.CenterHorizontal; + // cctView.AddChidren(btnColorTemplatrueBack); + // //婊戝姩鏉℃帶浠� + // var barColorTemplatrue = new CCTSeekBarControl() + // { + // X = Application.GetRealWidth(55 + 22), + // Y = Application.GetRealHeight(11), + // Width = Application.GetRealWidth(220), + // Height = Application.GetRealHeight(54), + // }; + // barColorTemplatrue.MinValue = 27; + // barColorTemplatrue.MaxValue = 65; + // barColorTemplatrue.ProgressBarColor = 0x00000000;//鍏ㄩ儴閫忔槑 + // barColorTemplatrue.ProgressBarUnEnableColor = 0x00000000; + // barColorTemplatrue.SeekBarBackgroundColor = 0x00000000; + // cctView.AddChidren(barColorTemplatrue); + // barColorTemplatrue.Y = btnTempClolorMin.Y - (barColorTemplatrue.Height - btnTempClolorMin.Height) / 2; + // barColorTemplatrue.Progress = value; + // //璁剧疆鍒濆鍊� + // btnTempClolor.Text = Language.StringByID(StringId.ColorTemperature) + " " + (barColorTemplatrue.Progress * 100 + "K"); + // barColorTemplatrue.OnProgressChangedEvent = (sender, e) => + // { + // btnTempClolor.Text = Language.StringByID(StringId.ColorTemperature) + " " + (barColorTemplatrue.Progress * 100 + "K"); + // }; + // barColorTemplatrue.OnStopTrackingTouchEvent = (sender, e) => + // { + // commandDic[FunctionAttributeKey.CCT] = (barColorTemplatrue.Progress * 100).ToString(); + + // d.Clear(); + // d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString()); + // foreach (var light in lightCCT) + // { + // if (light.spk == SPK.LightCCT) + // { + // Control.Ins.SendWriteCommand(light, d); + // } + // } + // }; + // //鍙樻洿鑳屾櫙鍥剧殑Y杞村潗鏍� + // btnColorTemplatrueBack.Y = barColorTemplatrue.Y + (barColorTemplatrue.Height - btnColorTemplatrueBack.Height) / 2; + + // //6500K + // var btnTempClolorMax = new Button(); + // btnTempClolorMax.Y = btnTempClolorMin.Y; + // btnTempClolorMax.X = barColorTemplatrue.Right - Application.GetRealWidth(30); + // btnTempClolorMax.Width = Application.GetRealWidth(54); + // btnTempClolorMax.Height = Application.GetRealHeight(21); + // btnTempClolorMax.Text = "6500K"; + // btnTempClolorMax.TextAlignment = TextAlignment.CenterRight; + // btnTempClolorMax.TextColor = CSS_Color.PromptingColor1; + // btnTempClolorMax.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; + // cctView.AddChidren(btnTempClolorMax); + + // #endregion + + + // } + + // /// <summary> + // /// 鍔犺浇rgb灞炴�ц缃帶浠� + // /// </summary> + // /// <param name="attrView"></param> + // void LoadRgbAttrView(VerticalScrolViewLayout attrView) + // { + + // #region RGB + + // string value = "255,255,255"; + // commandDic.TryGetValue(FunctionAttributeKey.RGB, out value); + + // var rgbView = new FrameLayout() + // { + // Height = Application.GetRealHeight(248) + // }; + // attrView.AddChidren(rgbView); + + + // var btnCurColor = new Button() + // { + // X = Application.GetRealWidth(24), + // Y = Application.GetRealHeight(10), + // Width = Application.GetMinRealAverage(24), + // Height = Application.GetMinRealAverage(24), + // Radius = (uint)Application.GetMinRealAverage(8), + // BorderColor = CSS_Color.PromptingColor2, + // BorderWidth = 1, + // BackgroundColor = (uint)(0xFF000000 + tempLight.GetRGBcolor(commandDic[FunctionAttributeKey.RGB])) + // }; + // rgbView.AddChidren(btnCurColor); + + // //鑹茬洏鐨勬甯冩帶浠�(闄愬埗閭d釜鐧借壊婊戝姩鐞冧娇鐢�) + // var framePickerBack = new FrameLayout(); + // framePickerBack.Gravity = Gravity.CenterHorizontal; + // framePickerBack.Y = Application.GetRealHeight(20); + // framePickerBack.Width = Application.GetMinRealAverage(198); + // framePickerBack.Height = Application.GetMinRealAverage(198); + // rgbView.AddChidren(framePickerBack); + + // var colorPicker = new ColorPicker() + // { + // ColorImagePath = "FunctionIcon/Light/ColorWheel.png", + // }; + // framePickerBack.AddChidren(colorPicker); + + + + + + + // //鐧界偣鎺т欢 + // var btnWhiteRound = new Button(); + // btnWhiteRound.Width = Application.GetRealWidth(24); + // btnWhiteRound.Height = Application.GetRealWidth(24); + // btnWhiteRound.UnSelectedImagePath = "FunctionIcon/Light/ColorWheelTip.png"; + // btnWhiteRound.Visible = false; + // framePickerBack.AddChidren(btnWhiteRound); + + + // //褰撳墠鐐瑰嚮鐨勩�愮偣銆戞槸鍚︽纭� + // bool pointIsRight = false; + // //鍦嗙殑鍗婂緞(鑰冭檻杈圭晫,闇�瑕佽缃畠鐨勫崐寰勬瘮杈冨皬涓�鐐�) + // int circleR = colorPicker.Width / 2 - Application.GetRealWidth(12); + + // colorPicker.MouseUpEventHandler = (sender2, e) => { + // d.Clear(); + // d.Add(FunctionAttributeKey.RGB, commandDic[FunctionAttributeKey.RGB]); + // foreach (var light in lightCCT) + // { + // if (light.spk == SPK.LightCCT) + // { + // Control.Ins.SendWriteCommand(light, d); + // } + // } + // }; + // colorPicker.ColorChaged += (sender2, e2) => { + // string rgbString = (e2[0] + "," + e2[1] + "," + e2[2]).ToString(); + // commandDic[FunctionAttributeKey.RGB] = rgbString; + // btnCurColor.BackgroundColor = (uint)(0xFF000000 + tempLight.GetRGBcolor(rgbString)); + // foreach (var rgbTemp in lightRGB) + // { + // rgbTemp.SetAttrState(FunctionAttributeKey.RGB, rgbString); + // } + // }; + // colorPicker.MouseDownEventHandler += (sender, e) => + // { + // pointIsRight = this.CheckPoint(circleR, colorPicker.Width / 2, colorPicker.Height / 2, (int)e.X, (int)e.Y); + // if (pointIsRight == false) + // { + // //鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐� + // return; + // } + // //鏄剧ず鐧界偣 + // btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2; + // btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2; + // if (btnWhiteRound.Visible == false) + // { + // btnWhiteRound.Visible = true; + // } + // }; + // colorPicker.MouseUpEventHandler = (sender, e) => { + // foreach (var rgbTemp in lightRGB) + // { + // Dictionary<string, string> d = new Dictionary<string, string>(); + // d.Add(FunctionAttributeKey.RGB, tempLight.GetRGBcolorString(rgbTemp)); + // Control.Ins.SendWriteCommand(rgbTemp, d, false, 0); + // } + // }; + + // colorPicker.MouseMoveEventHandler += (sender, e) => + // { + // //褰撻紶鏍囩偣涓嬩簨浠跺鐞� + // colorPicker.MouseDownEventHandler(sender, e); + // }; + + + // #endregion + + // } + + + // /// <summary> + // /// 妫�娴嬬偣鍑荤偣 + // /// </summary> + // /// <param name="circleR">鍦嗙殑鍗婂緞</param> + // /// <param name="circleX">鍦嗗績X杞�</param> + // /// <param name="circleY">鍦嗗績Y杞�</param> + // /// <param name="pointX">鐐瑰嚮鐐圭殑X杞�</param> + // /// <param name="pointY">鐐瑰嚮鐐圭殑Y杞�</param> + // /// <returns></returns> + // private bool CheckPoint(int circleR, int circleX, int circleY, int pointX, int pointY) + // { + // int dwidth = circleX - pointX; + // if (dwidth < 0) { dwidth *= -1; } + + // int dHeight = circleY - pointY; + // if (dHeight < 0) { dHeight *= -1; } + + // //鏍规嵁涓夎鍑芥暟,姹備笁瑙掑舰鐨勬枩杈归暱 + // int dlength = dwidth * dwidth + dHeight * dHeight; + // //鍗婂緞闀垮害(涓嶅紑鏂�,鎵�浠ユ槸鎸夊钩鏂圭畻) + // circleR *= circleR; + // if (dlength < circleR) + // { + // //濡傛灉缁勬垚鐨勪笁瑙掑舰骞舵病鏈夐暱杩囧崐寰�,鍒欎唬琛ㄨ繕鍦ㄥ渾鍐�(涓嶅厑璁哥偣杈圭晫) + // return true; + // } + // return false; + // } + + //} + +} \ No newline at end of file diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs index ec63191..770551c 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs @@ -1,4 +1,5 @@ 锘縰sing System; +using System.Collections.Generic; using HDL_ON.DAL.Server; using HDL_ON.Entity; using HDL_ON.UI.CSS; @@ -9,6 +10,7 @@ public class CombinedDimmingListPage : FrameLayout { FrameLayout bodyView; + VerticalScrolViewLayout contentView; public CombinedDimmingListPage() { @@ -20,10 +22,20 @@ new TopViewDiv(bodyView, Language.StringByID(StringId.CombinedDimming)).LoadTopView_AddIcon("CombinedDimming", (s,c)=>{ + try + { + var page = new AddGroupControlPage(new System.Collections.Generic.List<Function>(),new GroupControl(), + ()=> { + }); + MainPage.BasePageView.AddChidren(page); + page.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + } + catch { } }); - var contentView = new VerticalScrolViewLayout() + contentView = new VerticalScrolViewLayout() { Y = Application.GetRealHeight(64), Height = Application.GetRealHeight(550), @@ -37,9 +49,21 @@ var pack = http.GetGroupControlList(); if(pack != null) { - if(pack.Code == StateCode.SUCCESS) + if(pack.Code == StateCode.SUCCESS ) { - var data = Newtonsoft.Json.JsonConvert.DeserializeObject<GroupControl>(pack.Data.ToString()); + try + { + var groupControlList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); + LoadGroupControlView(groupControlList); + } + catch (Exception ex) + { + MainPage.Log($"璇诲彇缁勬帶鍒楄〃澶辫触:{ex.Message}"); + } + } + else + { + IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); } } @@ -47,60 +71,76 @@ #region contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) }); - var row = new FrameLayout() - { - Height = Application.GetRealHeight(65), - BackgroundColor = CSS_Color.MainBackgroundColor, - }; - var btnTitle = new Button() - { - X = Application.GetRealWidth(16), - Y = Application.GetRealHeight(10), - Width = Application.GetRealWidth(308), - Height = Application.GetRealHeight(24), - TextID = StringId.AdministratorPermissionMigration, - TextAlignment = TextAlignment.CenterLeft, - TextSize = CSS_FontSize.SubheadingFontSize, - TextColor = CSS_Color.FirstLevelTitleColor, - }; - row.AddChidren(btnTitle); + - var btnAdministratorPermissionMigrationExplan = new Button() - { - X = Application.GetRealWidth(16), - Y = btnTitle.Bottom, - Width = Application.GetRealWidth(308), - Height = Application.GetRealHeight(21), - TextID = StringId.AdministratorPermissionMigrationExPlan, - TextAlignment = TextAlignment.CenterLeft, - TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - TextColor = CSS_Color.PromptingColor1, - }; - row.AddChidren(btnAdministratorPermissionMigrationExplan); - - - var btnAdministratorPermissionMigrationSkinIcon = new Button() - { - X = Application.GetRealWidth(343), - Gravity = Gravity.CenterVertical, - Width = Application.GetMinRealAverage(16), - Height = Application.GetMinRealAverage(16), - UnSelectedImagePath = "Public/RightIcon.png", - }; - row.AddChidren(btnAdministratorPermissionMigrationSkinIcon); - - row.AddChidren( - new Button() - { - Gravity = Gravity.CenterHorizontal, - Y = Application.GetRealHeight(64), - Height = Application.GetRealHeight(1), - Width = Application.GetRealWidth(343), - BackgroundColor = CSS_Color.DividingLineColor, - }); #endregion } + + + private void LoadGroupControlView(List<GroupControl> list) + { + if(list.Count == 0) + { + + } + else + { + contentView.RemoveAll(); + + foreach (var function in list) + { + var functionRow = new FrameLayout() + { + Height = Application.GetRealHeight(65), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(functionRow); + + var btnFunctionName = new Button() + { + X = Application.GetRealWidth(16), + Y = Application.GetRealHeight(10), + Width = Application.GetRealWidth(308), + Height = Application.GetRealHeight(24), + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.SubheadingFontSize, + TextColor = CSS_Color.FirstLevelTitleColor, + Text = function.name, + }; + functionRow.AddChidren(btnFunctionName); + + var btnFunctionLocationInfo = new Button() + { + X = Application.GetRealWidth(16), + Y = btnFunctionName.Bottom, + Width = Application.GetRealWidth(308), + Height = Application.GetRealHeight(21), + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextColor = CSS_Color.PromptingColor1, + Text = function.GetRoomListName(), + }; + functionRow.AddChidren(btnFunctionLocationInfo); + + + + functionRow.AddChidren( + new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(64), + Height = Application.GetRealHeight(1), + Width = Application.GetRealWidth(343), + BackgroundColor = CSS_Color.DividingLineColor, + }); + + } + + } + } + + } } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupChooseRoomPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupChooseRoomPage.cs new file mode 100644 index 0000000..e62de92 --- /dev/null +++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupChooseRoomPage.cs @@ -0,0 +1,244 @@ +锘� +using System; +using HDL_ON.DAL.Server; +using HDL_ON.Entity; +using HDL_ON.UI.CSS; +using Shared; + +namespace HDL_ON.UI +{ + /// <summary> + /// 鍔熻兘鍒嗛厤鎴块棿鐣岄潰 + /// </summary> + public partial class GroupChooseRoomPage : FrameLayout + { + #region 鎺т欢鍒楄〃 + FrameLayout bodyView; + /// <summary> + /// 鍐呭鍔犺浇鍖哄煙 + /// </summary> + VerticalScrolViewLayout contentView; + + Button btnAllRoomText; + Button btnChooseAll; + + #endregion + + #region 灞�閮ㄥ彉閲� + + GroupControl function + ; + /// <summary> + /// 鍥炶皟浜嬩欢 + /// </summary> + Action backAction; + #endregion + + public GroupChooseRoomPage(GroupControl groupControl, Action action) + { + bodyView = this; + this.function = groupControl; + backAction = action; + } + + public override void RemoveFromParent() + { + new System.Threading.Thread(() => + { + Application.RunOnMainThread(() => + { + backAction?.Invoke(); + }); + }) + { IsBackground = true }.Start(); + base.RemoveFromParent(); + } + + /// <summary> + /// 鍔犺浇椤甸潰 + /// </summary> + public void LoadPage() + { + bodyView.BackgroundColor = CSS_Color.BackgroundColor; + new TopViewDiv(bodyView, Language.StringByID(StringId.CombinedDimming)).LoadTopView(); + + + + var contentView = new VerticalScrolViewLayout() + { + Y = Application.GetRealHeight(64), + Height = Application.GetRealHeight(667 - 64), + }; + bodyView.AddChidren(contentView); + + var allRoomView = new FrameLayout() + { + Height = Application.GetRealHeight(50), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + contentView.AddChidren(allRoomView); + + btnChooseAll = new Button() + { + X = Application.GetRealWidth(331), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(28), + Height = Application.GetMinRealAverage(28), + UnSelectedImagePath = "Public/ChooseIcon.png", + SelectedImagePath = "Public/ChooseOnIcon.png", + IsSelected = true + }; + allRoomView.AddChidren(btnChooseAll); + + btnAllRoomText = new Button() + { + X = Application.GetRealWidth(16), + TextID = StringId.All, + TextSize = CSS_FontSize.SubheadingFontSize, + TextColor = CSS_Color.FirstLevelTitleColor, + TextAlignment = TextAlignment.CenterLeft, + }; + allRoomView.AddChidren(btnAllRoomText); + + + foreach (var room in SpatialInfo.CurrentSpatial.RoomList) + { + var roomView = new FrameLayout() + { + Height = Application.GetRealHeight(50), + BackgroundColor = CSS_Color.MainBackgroundColor, + Tag = "row" + }; + contentView.AddChidren(roomView); + + var btnLine = new Button() + { + Gravity = Gravity.CenterHorizontal, + Height = Application.GetMinReal(1), + Width = Application.GetRealWidth(343), + BackgroundColor = CSS_Color.DividingLineColor, + }; + roomView.AddChidren(btnLine); + + Button btnChoose = new Button() + { + X = Application.GetRealWidth(331), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(28), + Height = Application.GetMinRealAverage(28), + UnSelectedImagePath = "Public/ChooseIcon.png", + SelectedImagePath = "Public/ChooseOnIcon.png", + IsSelected = function.roomIds.Contains(room.roomId), + Tag = "ChooseIcon" + }; + roomView.AddChidren(btnChoose); + + Button btnRoomText = new Button() + { + X = Application.GetRealWidth(16), + //Width = Application.GetRealWidth(280), + TextSize = CSS_FontSize.SubheadingFontSize, + TextColor = CSS_Color.FirstLevelTitleColor, + TextAlignment = TextAlignment.CenterLeft, + Text = room.floorName + room.roomName, + }; + roomView.AddChidren(btnRoomText); + btnRoomText.MouseUpEventHandler = (sender, e) => { + btnChoose.IsSelected = !btnChoose.IsSelected; + LoadEvent_RoomSelected(room, btnChoose.IsSelected); + }; + + if (!function.roomIds.Contains(room.roomId) && btnChooseAll.IsSelected) + { + btnChooseAll.IsSelected = false; + } + + } + + LoadEventLoad(); + } + } + /// <summary> + /// 鍔熻兘鍒嗛厤鎴块棿BLL + /// </summary> + public partial class GroupChooseRoomPage + { + /// <summary> + /// 鍔犺浇浜嬩欢鍒楄〃 + /// </summary> + void LoadEventLoad() + { + LoadMethod_AllElection(); + } + + /// <summary> + /// 鍏ㄩ�夋寜閽簨浠� + /// </summary> + void LoadMethod_AllElection() + { + btnAllRoomText.MouseUpEventHandler += (sender, e) => + { + btnChooseAll.IsSelected = !btnChooseAll.IsSelected; + + for (int i = 0; i < contentView.ChildrenCount; i++) + { + var view = contentView.GetChildren(i); + if (view.GetType() == typeof(FrameLayout)) + { + if (view.Tag != null && view.Tag.ToString() == "row") + { + for (int j = 0; j < (view as FrameLayout).ChildrenCount; j++) + { + var btn = (view as FrameLayout).GetChildren(j); + if (btn.GetType() == typeof(Button)) + { + if (btn.Tag != null && btn.Tag.ToString() == "ChooseIcon") + { + (btn as Button).IsSelected = btnChooseAll.IsSelected; + } + } + } + } + } + } + function.roomIds.Clear(); + if (btnChooseAll.IsSelected) + { + foreach (var room in Entity.SpatialInfo.CurrentSpatial.RoomList) + { + if (btnChooseAll.IsSelected) + { + function.roomIds.Add(room.roomId); + } + } + } + }; + } + + /// <summary> + /// 鎴块棿閫変腑浜嬩欢 + /// </summary> + void LoadEvent_RoomSelected(Entity.Room room, bool isAdd) + { + if (isAdd) + { + function.roomIds.Add(room.roomId); + } + else + { + function.roomIds.Remove(room.roomId); + } + + + if (function.roomIds.Count == SpatialInfo.CurrentSpatial.RoomList.Count) + { + btnChooseAll.IsSelected = true; + } + else + { + btnChooseAll.IsSelected = false; + } + } + + } +} \ No newline at end of file diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs index 932bb37..28dea93 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs @@ -1,5 +1,6 @@ 锘縰sing System; using System.Collections.Generic; +using Shared; namespace HDL_ON.Entity { @@ -24,10 +25,40 @@ /// 鎴块棿uid /// </summary> public List<String> uids = new List<string>(); + public List<String> roomIds = new List<string>(); /// <summary> /// 缇ゆ帶鍔熻兘sid閰嶇疆 /// </summary> public List<GroupControlFunction> sids = new List<GroupControlFunction>(); + + + + /// <summary> + /// 鑾峰彇璁惧娣诲姞鍒版埧闂寸殑鎴块棿鍚嶇О + /// </summary> + /// <returns></returns> + public string GetRoomListName() + { + string roomNameList = ""; + foreach (var roomId in roomIds) + { + var findRoom = SpatialInfo.CurrentSpatial.RoomList.Find(obj => obj.roomId == roomId); + if (findRoom == null) + { + continue; + } + if (roomNameList != "") + { + roomNameList += ","; + } + roomNameList += findRoom.floorName + "-" + findRoom.roomName; + } + if (roomNameList == "") + { + roomNameList = Language.StringByID(StringId.WholeZone); + } + return roomNameList; + } } public class GroupControlFunction diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/AddMemberScanPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/AddMemberScanPage.cs index 5a069c5..bc53c1a 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/AddMemberScanPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/AddMemberScanPage.cs @@ -193,6 +193,10 @@ Text = " 涓轰繚鎶ゆ偍鐨勪釜浜洪殣绉佹潈鐩婏紝鐗瑰悜鎮ㄩ�氱煡骞剁敵璇锋槑纭悓鎰忔巿鏉冦�傝浣犱粩缁嗛槄璇�", IsMoreLines = true, }; + if(Language.CurrentLanguage != "Chinese") + { + btnMsg.Text = " In order to protect your personal privacy rights, we hereby notify you and apply for explicit consent authorization. Please read it carefully"; + } contentView.AddChidren(btnMsg); Button btnMsg1 = new Button() @@ -207,6 +211,11 @@ Text = " 銆奜n Pro浜鸿劯淇℃伅閲囬泦鍗忚銆�", IsMoreLines = true, }; + if (Language.CurrentLanguage != "Chinese") + { + btnMsg1.Text = " 'On Pro Face Information Collection Protocol'"; + } + contentView.AddChidren(btnMsg1); Button btnMsg2 = new Button() @@ -221,6 +230,10 @@ Text = " 鑻ュ悓鎰忚鍗忚锛岃鐐瑰嚮銆愬悓鎰忋�戞寜閿紝琛ㄧず鎮ㄥ凡缁忕悊瑙e苟鍚屾剰浜鸿劯淇℃伅閲囬泦鍗忚銆�", IsMoreLines = true, }; + if (Language.CurrentLanguage != "Chinese") + { + btnMsg2.Text = " If you agree to this agreement, please click the [Agree] button to indicate that you have understood and agreed to the face information collection agreement."; + } contentView.AddChidren(btnMsg2); Button btnLine2 = new Button() diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFaceManagementPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFaceManagementPage.cs index c69920d..c5a8ad0 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFaceManagementPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberFaceManagementPage.cs @@ -112,6 +112,10 @@ Text = " 涓轰繚鎶ゆ偍鐨勪釜浜洪殣绉佹潈鐩婏紝鐗瑰悜鎮ㄩ�氱煡骞剁敵璇锋槑纭悓鎰忔巿鏉冦�傝浣犱粩缁嗛槄璇�", IsMoreLines = true, }; + if (Language.CurrentLanguage != "Chinese") + { + btnMsg.Text = " In order to protect your personal privacy rights, we hereby notify you and apply for explicit consent authorization. Please read it carefully"; + } contentView.AddChidren(btnMsg); Button btnMsg1 = new Button() @@ -126,6 +130,11 @@ Text = " 銆奜n Pro浜鸿劯淇℃伅閲囬泦鍗忚銆�", IsMoreLines = true, }; + if (Language.CurrentLanguage != "Chinese") + { + btnMsg1.Text = " 'On Pro Face Information Collection Protocol'"; + } + contentView.AddChidren(btnMsg1); Button btnMsg2 = new Button() @@ -140,6 +149,10 @@ Text = " 鑻ュ悓鎰忚鍗忚锛岃鐐瑰嚮銆愬悓鎰忋�戞寜閿紝琛ㄧず鎮ㄥ凡缁忕悊瑙e苟鍚屾剰浜鸿劯淇℃伅閲囬泦鍗忚銆�", IsMoreLines = true, }; + if (Language.CurrentLanguage != "Chinese") + { + btnMsg2.Text = " If you agree to this agreement, please click the [Agree] button to indicate that you have understood and agreed to the face information collection agreement."; + } contentView.AddChidren(btnMsg2); Button btnLine = new Button() diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs index 09e95f4..4ca2bdf 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs @@ -294,21 +294,23 @@ var residenceFunctionCount = 0; #region 浣忓畢淇℃伅鍖哄煙 - //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare && DB_ResidenceData.Instance.GatewayType == 1) - //{ - // residenceInfoView = new FrameLayout() - // { - // Gravity = Gravity.CenterHorizontal, - // Width = Application.GetRealWidth(343), - // Height = Application.GetRealHeight(213), - // BackgroundColor = CSS_Color.MainBackgroundColor, - // Radius = (uint)Application.GetRealHeight(12), - // BorderColor = 0x00FFFFFF, - // BorderWidth = 0, - // }; - // contentView.AddChidren(residenceInfoView); - //} - //else + if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare + && DB_ResidenceData.Instance.GatewayType == 1 + && DB_ResidenceData.Instance.CurrentRegion.isSupportGroupControl) + { + residenceInfoView = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(213), + BackgroundColor = CSS_Color.MainBackgroundColor, + Radius = (uint)Application.GetRealHeight(12), + BorderColor = 0x00FFFFFF, + BorderWidth = 0, + }; + contentView.AddChidren(residenceInfoView); + } + else { residenceInfoView = new FrameLayout() { @@ -584,48 +586,51 @@ residenceAddFunctionView.AddChidren(btnResidenceAddFunctionText); #endregion - residenceFunctionCount++; - #region ---缁勫悎璋冨厜 - //var faceManagementView = new FrameLayout() - //{ - // X = Application.GetRealWidth(28 - 24), - // Y = residenceManageView.Bottom, - // Width = Application.GetRealWidth(64 + 48), - // Height = Application.GetRealWidth(64), - //}; - //residenceInfoView.AddChidren(faceManagementView); + if (DB_ResidenceData.Instance.CurrentRegion.isSupportGroupControl) + { + residenceFunctionCount++; + #region ---缁勫悎璋冨厜 + var faceManagementView = new FrameLayout() + { + X = Application.GetRealWidth(28 - 24), + Y = residenceManageView.Bottom, + Width = Application.GetRealWidth(64 + 48), + Height = Application.GetRealWidth(64), + }; + residenceInfoView.AddChidren(faceManagementView); - //var btnFaceManagementIcon = new Button - //{ - // Gravity = Gravity.CenterHorizontal, - // Y = Application.GetRealHeight(5), - // Width = Application.GetMinRealAverage(30), - // Height = Application.GetMinRealAverage(30), - // UnSelectedImagePath = "PersonalCenter/CombinedDimmingIcon.png", - //}; - //faceManagementView.AddChidren(btnFaceManagementIcon); - //var btnFaceManagementText = new Button() - //{ - // Y = btnResidenceManageIcon.Bottom, - // Height = Application.GetRealHeight(29), - // TextID = StringId.CombinedDimming, - // TextAlignment = TextAlignment.Center, - // TextColor = CSS_Color.FirstLevelTitleColor, - // TextSize = CSS_FontSize.PromptFontSize_FirstLevel - //}; - //faceManagementView.AddChidren(btnFaceManagementText); + var btnFaceManagementIcon = new Button + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(5), + Width = Application.GetMinRealAverage(30), + Height = Application.GetMinRealAverage(30), + UnSelectedImagePath = "PersonalCenter/CombinedDimmingIcon.png", + }; + faceManagementView.AddChidren(btnFaceManagementIcon); + var btnFaceManagementText = new Button() + { + Y = btnResidenceManageIcon.Bottom, + Height = Application.GetRealHeight(29), + TextID = StringId.CombinedDimming, + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel + }; + faceManagementView.AddChidren(btnFaceManagementText); - //EventHandler<MouseEventArgs> eventHandler = (sender, e) => { - // var page = new CombinedDimmingListPage(); - // MainPage.BasePageView.AddChidren(page); - // page.LoadPage(); - // MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - //}; - //faceManagementView.MouseUpEventHandler = eventHandler; - //btnFaceManagementText.MouseUpEventHandler = eventHandler; - //btnFaceManagementIcon.MouseUpEventHandler = eventHandler; - #endregion - + EventHandler<MouseEventArgs> eventHandler = (sender, e) => + { + var page = new CombinedDimmingListPage(); + MainPage.BasePageView.AddChidren(page); + page.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + faceManagementView.MouseUpEventHandler = eventHandler; + btnFaceManagementText.MouseUpEventHandler = eventHandler; + btnFaceManagementIcon.MouseUpEventHandler = eventHandler; + #endregion + } } } else diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/MechanicalArmPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/MechanicalArmPage.cs index 93f3500..ff748b3 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/MechanicalArmPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/MechanicalArmPage.cs @@ -138,6 +138,13 @@ { tipMsg = "纭畾鍏抽棴?"; } + if (Language.CurrentLanguage != "Chinese") + { + + tipMsg = "Are you sure to close?"; + if (this.btnSwitch.IsSelected) + tipMsg = "Are you sure to open it?"; + } Action action = () => { this.btnPictrue.CanClick = false; @@ -155,7 +162,7 @@ }); }); }; - new PublicAssmebly().TipOptionMsg(StringId.EmptyString, tipMsg, action); + new PublicAssmebly().TipOptionMsg(StringId.Tip, tipMsg, action); } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs index b108f57..0eb7ff8 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs @@ -421,6 +421,10 @@ SelectedImagePath = "FunctionIcon/Light/LightScene/CheckOnIcon.png", IsSelected = functions.Find((obj) => obj.deviceId == function.deviceId) != null }; + if (DB_ResidenceData.Instance.CurrentRegion.isSupportGroupControl) + { + btnSelect.X = Application.GetRealWidth(323); + } bodyDiv.AddChidren(btnSelect); btnSelect.MouseUpEventHandler = (sender, e) => { -- Gitblit v1.8.0