From 3fcb73db484d2bed5ee993702913a7eaea68068c Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期五, 18 八月 2023 18:01:23 +0800 Subject: [PATCH] 2.1.2 --- HDL-ON_Android/Properties/AndroidManifest.xml | 2 HDL_ON/UI/UI2/1-HomePage/HomePage.cs | 1 HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulSettingPage.cs | 31 ++- HDL-ON_Android/AgreementActivity.cs | 95 +++++---- HDL-ON_Android/Assets/Language.ini | 8 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs | 16 + HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs | 10 HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs | 2 HDL_ON/DAL/Mqtt/MqttClient.cs | 4 HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs | 5 HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs | 2 HDL-ON_Android/SplashActivity.cs | 3 HDL-ON_iOS/Info.plist | 4 HDL-ON_iOS/Resources/Language.ini | 8 HDL_ON/Common/HDLCommon.cs | 2 HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs | 190 ++++++++++---------- HDL_ON/DAL/DriverLayer/Control.cs | 5 HDL_ON/UI/MainPage.cs | 6 HDL_ON/UI/UI1-Login/LoginPage.cs | 8 HDL_ON/Entity/Function/Scene.cs | 1 HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs | 17 + HDL_ON/UI/UI2/2-Classification/SeriesFunctionListPage.cs | 4 HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs | 14 - HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs | 59 ++++++ HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs | 15 + HDL_ON/Common/R.cs | 4 HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 18 + HDL_ON/DAL/Server/HttpServerRequest.cs | 2 28 files changed, 325 insertions(+), 211 deletions(-) diff --git a/HDL-ON_Android/AgreementActivity.cs b/HDL-ON_Android/AgreementActivity.cs index 9dcf435..74b520d 100644 --- a/HDL-ON_Android/AgreementActivity.cs +++ b/HDL-ON_Android/AgreementActivity.cs @@ -16,54 +16,61 @@ { protected override void OnCreate(Bundle savedInstanceState) { - base.OnCreate(savedInstanceState); - - // Create your application here - SetContentView(Resource.Layout.activity_splash); - - Android.Widget.TextView tvPrivacyPolicy = FindViewById<Android.Widget.TextView>(Resource.Id.privacy_policy_btn); - Android.Widget.TextView tvServiceAgreement = FindViewById<Android.Widget.TextView>(Resource.Id.service_agreement_btn); - - Android.Widget.Button btnDisagree = FindViewById<Android.Widget.Button>(Resource.Id.disagree_btn); - Android.Widget.Button btnAgree = FindViewById<Android.Widget.Button>(Resource.Id.agree_btn); - - tvPrivacyPolicy.Click += (sender, e) => + try { - Intent i = new Intent(this, typeof(WebviewActivity)); + base.OnCreate(savedInstanceState); - i.PutExtra("url", HDL_ON.Constant.URL_PRIVACYPOLICY); - StartActivity(i); - Intent data = new Intent(); - data.PutExtra("data", "disagree"); - SetResult(Result.Canceled, Intent); - }; - tvServiceAgreement.Click += (sender, e) => + // Create your application here + SetContentView(Resource.Layout.activity_splash); + + Android.Widget.TextView tvPrivacyPolicy = FindViewById<Android.Widget.TextView>(Resource.Id.privacy_policy_btn); + Android.Widget.TextView tvServiceAgreement = FindViewById<Android.Widget.TextView>(Resource.Id.service_agreement_btn); + + Android.Widget.Button btnDisagree = FindViewById<Android.Widget.Button>(Resource.Id.disagree_btn); + Android.Widget.Button btnAgree = FindViewById<Android.Widget.Button>(Resource.Id.agree_btn); + + tvPrivacyPolicy.Click += (sender, e) => + { + Intent i = new Intent(this, typeof(WebviewActivity)); + + i.PutExtra("url", HDL_ON.Constant.URL_PRIVACYPOLICY); + StartActivity(i); + Intent data = new Intent(); + data.PutExtra("data", "disagree"); + SetResult(Result.Canceled, Intent); + }; + tvServiceAgreement.Click += (sender, e) => + { + Intent i = new Intent(this, typeof(WebviewActivity)); + + i.PutExtra("url", HDL_ON.Constant.URL_USERAGREEMENT); + + StartActivity(i); + Intent data = new Intent(); + data.PutExtra("data", "disagree"); + SetResult(Result.Canceled, Intent); + }; + btnDisagree.Click += (sender, e) => + { + //Java.Lang.JavaSystem.Exit(0); + FinishAffinity(); + }; + btnAgree.Click += (sender, e) => + { + OnAppConfig.Instance.isAgreePrivacyPolicy = true; + OnAppConfig.Instance.FirstRunApp = false; + OnAppConfig.Instance.SaveConfig(); + + Intent data = new Intent(); + data.PutExtra("data", "agree"); + SetResult(Result.Ok, Intent); + Finish(); + }; + }catch(Exception ex) { - Intent i = new Intent(this, typeof(WebviewActivity)); + Console.WriteLine("AgreementActivity----------------------------1"+ex.Message); - i.PutExtra("url",HDL_ON.Constant.URL_USERAGREEMENT); - - StartActivity(i); - Intent data = new Intent(); - data.PutExtra("data", "disagree"); - SetResult(Result.Canceled, Intent); - }; - btnDisagree.Click += (sender, e) => - { - //Java.Lang.JavaSystem.Exit(0); - FinishAffinity(); - }; - btnAgree.Click += (sender, e) => - { - OnAppConfig.Instance.isAgreePrivacyPolicy = true; - OnAppConfig.Instance.FirstRunApp = false; - OnAppConfig.Instance.SaveConfig(); - - Intent data = new Intent(); - data.PutExtra("data", "agree"); - SetResult(Result.Ok, Intent); - Finish(); - }; + } } } } \ No newline at end of file diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index f20bc1e..a734f1f 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -681,6 +681,7 @@ 694=Hourly electricity consumption in the past 24 hours 695=Daily data of the past month 696=Monthly data of the past year +697=prompt: The closer the starting color selection is to the edge of the color ring, the more obvious the dazzling effect. The closer to the white center, the less noticeable the dazzling effect. @@ -2039,6 +2040,7 @@ 694=杩囧幓24灏忔椂鐨勬瘡灏忔椂鐢ㄧ數閲� 695=杩囧幓涓�涓湀鐨勬瘡鏃ユ暟鎹� 696=杩囧幓涓�骞寸殑姣忔湀鏁版嵁 +697=鎻愮ず锛氳捣濮嬮鑹查�夋嫨瓒婇潬杩戣壊鐜竟缂橈紝鐐僵鏁堟灉瓒婃槑鏄俱�傝秺闈犺繎鐧借壊涓績锛岀偒褰╂晥鏋滆秺涓嶆槑鏄俱�� @@ -3398,7 +3400,7 @@ 694=Hourly electricity consumption in the past 24 hours 695=Daily data of the past month 696=Monthly data of the past year - +697=prompt: The closer the starting color selection is to the edge of the color ring, the more obvious the dazzling effect. The closer to the white center, the less noticeable the dazzling effect. @@ -4750,7 +4752,7 @@ 694=Hourly electricity consumption in the past 24 hours 695=Daily data of the past month 696=Monthly data of the past year - +697=prompt: The closer the starting color selection is to the edge of the color ring, the more obvious the dazzling effect. The closer to the white center, the less noticeable the dazzling effect. @@ -6087,7 +6089,7 @@ 694=Hourly electricity consumption in the past 24 hours 695=Daily data of the past month 696=Monthly data of the past year - +697=prompt: The closer the starting color selection is to the edge of the color ring, the more obvious the dazzling effect. The closer to the white center, the less noticeable the dazzling effect. diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml index 24f5cd7..eac25b1 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="2.1.0" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202308091"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.1.2" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202308171"> <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> <uses-permission android:name="android.permission.RECEIVE_SMS" /> <!--鍙嬬洘--> diff --git a/HDL-ON_Android/SplashActivity.cs b/HDL-ON_Android/SplashActivity.cs index 76007c4..6b6401d 100644 --- a/HDL-ON_Android/SplashActivity.cs +++ b/HDL-ON_Android/SplashActivity.cs @@ -59,6 +59,9 @@ //StartActivityForResult(i, 1); //OverridePendingTransition(0, 0); //initAll(); +#if DEBUG + HDL_ON.OnAppConfig.Instance.isAgreePrivacyPolicy = true; +#endif if (HDL_ON.OnAppConfig.Instance.FirstRunApp || !HDL_ON.OnAppConfig.Instance.isAgreePrivacyPolicy) { //OnAppConfig.Instance.FirstRunApp = false; diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist index 45b7d47..e9a471c 100644 --- a/HDL-ON_iOS/Info.plist +++ b/HDL-ON_iOS/Info.plist @@ -11,7 +11,7 @@ <key>CFBundleName</key> <string>On Pro</string> <key>CFBundleShortVersionString</key> - <string>2.1.0</string> + <string>2.1.2</string> <key>CFBundleURLTypes</key> <array> <dict> @@ -36,7 +36,7 @@ </dict> </array> <key>CFBundleVersion</key> - <string>2.1.0</string> + <string>2.1.2</string> <key>LSApplicationQueriesSchemes</key> <array> <string>weixinULAPI</string> diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini index f20bc1e..a734f1f 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -681,6 +681,7 @@ 694=Hourly electricity consumption in the past 24 hours 695=Daily data of the past month 696=Monthly data of the past year +697=prompt: The closer the starting color selection is to the edge of the color ring, the more obvious the dazzling effect. The closer to the white center, the less noticeable the dazzling effect. @@ -2039,6 +2040,7 @@ 694=杩囧幓24灏忔椂鐨勬瘡灏忔椂鐢ㄧ數閲� 695=杩囧幓涓�涓湀鐨勬瘡鏃ユ暟鎹� 696=杩囧幓涓�骞寸殑姣忔湀鏁版嵁 +697=鎻愮ず锛氳捣濮嬮鑹查�夋嫨瓒婇潬杩戣壊鐜竟缂橈紝鐐僵鏁堟灉瓒婃槑鏄俱�傝秺闈犺繎鐧借壊涓績锛岀偒褰╂晥鏋滆秺涓嶆槑鏄俱�� @@ -3398,7 +3400,7 @@ 694=Hourly electricity consumption in the past 24 hours 695=Daily data of the past month 696=Monthly data of the past year - +697=prompt: The closer the starting color selection is to the edge of the color ring, the more obvious the dazzling effect. The closer to the white center, the less noticeable the dazzling effect. @@ -4750,7 +4752,7 @@ 694=Hourly electricity consumption in the past 24 hours 695=Daily data of the past month 696=Monthly data of the past year - +697=prompt: The closer the starting color selection is to the edge of the color ring, the more obvious the dazzling effect. The closer to the white center, the less noticeable the dazzling effect. @@ -6087,7 +6089,7 @@ 694=Hourly electricity consumption in the past 24 hours 695=Daily data of the past month 696=Monthly data of the past year - +697=prompt: The closer the starting color selection is to the edge of the color ring, the more obvious the dazzling effect. The closer to the white center, the less noticeable the dazzling effect. diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs index 9d98174..8f2739d 100644 --- a/HDL_ON/Common/HDLCommon.cs +++ b/HDL_ON/Common/HDLCommon.cs @@ -689,7 +689,7 @@ if (internetStatus == 0)//娌℃湁缃戠粶杩炴帴 0 { MainPage.InternetStatus = 0; - DAL.Mqtt.MqttClient.InitState(); + //DAL.Mqtt.MqttClient.DisConnectRemote();//.InitState(); } else if (internetStatus == 1)//3,4G鐨勭綉缁滆繛鎺� 1 { diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index 008a8ef..168c05e 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -5,6 +5,10 @@ public static class StringId { /// <summary> + /// 鎻愮ず锛氳捣濮嬮鑹查�夋嫨瓒婇潬杩戣壊鐜竟缂橈紝鐐僵鏁堟灉瓒婃槑鏄俱�傝秺闈犺繎鐧借壊涓績锛岀偒褰╂晥鏋滆秺涓嶆槑鏄俱�� + /// </summary> + public const int ColorfulSetTip = 697; + /// <summary> /// 杩囧幓涓�骞寸殑姣忔湀鏁版嵁 /// </summary> public const int AirSwitchP3HistroyTip3 = 696; diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index a1af398..c95823d 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -641,7 +641,10 @@ System.Threading.Thread.Sleep(100); } } - var pack = pm.ControlDevice(actionObjs); + if (actionObjs.Count > 0) + { + var pack = pm.ControlDevice(actionObjs); + } } } diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs index f4e129f..3b1d20a 100644 --- a/HDL_ON/DAL/Mqtt/MqttClient.cs +++ b/HDL_ON/DAL/Mqtt/MqttClient.cs @@ -133,6 +133,10 @@ new System.Threading.Thread(async () => { while (true) { + if (!UserInfo.Current.IsLogin) + { + return; + } try { System.Threading.Thread.Sleep(2000); diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index ffb4986..25c2273 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -2288,7 +2288,7 @@ d.Add("actions", actionObjs); var requestJson = HttpUtil.GetSignRequestJson(d); - MainPage.Log($"api鍔熻兘鎺у埗锛歿requestJson}"); + MainPage.Log($"api鍙戦�佹帶鍒讹細{requestJson}"); return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlDevice, requestJson); } /// <summary> diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs index 9239353..04888ab 100644 --- a/HDL_ON/Entity/Function/Scene.cs +++ b/HDL_ON/Entity/Function/Scene.cs @@ -151,6 +151,7 @@ /// 閰嶅悎璞嗚眴淇敼浜戠鏁版嵁 /// 璋冭瘯瀹濄�乷n pro鍜屽钩鍙板搴� /// </summary> + [Newtonsoft.Json.JsonIgnore] public List<SceneImageInfo> OssSceneImages = new List<SceneImageInfo>() { new SceneImageInfo diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs index faf0875..76549d3 100644 --- a/HDL_ON/UI/MainPage.cs +++ b/HDL_ON/UI/MainPage.cs @@ -26,7 +26,7 @@ /// <summary> /// 鐗堟湰鍙� /// </summary> - public static string VersionString = "2.0.0"; + public static string VersionString = "2.1.2"; ///// <summary> ///// 瀹㈡埛绔被鍨� ///// </summary> @@ -629,8 +629,8 @@ { #if DEBUG if (msg.Contains("鏀跺埌鏁版嵁") - || msg.Contains("api鍔熻兘鎺у埗") - //|| msg.Contains("鎺ユ敹鍒版帹閫�") + || msg.Contains("鍙戦��") + || msg.Contains("璇诲彇鍔熻兘鐘舵��") //|| true ) Console.WriteLine(msg); diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs index c7a2ca5..ebf1170 100644 --- a/HDL_ON/UI/UI1-Login/LoginPage.cs +++ b/HDL_ON/UI/UI1-Login/LoginPage.cs @@ -323,9 +323,9 @@ etAccount.Text = "13375012446";//娴嬭瘯鏈嶅姟鍣� etAccount.Text = "15855403939"; etAccount.Text = "15006564444"; - etAccount.Text = "jeremy@ruma.my"; + etAccount.Text = "pjh@hdlchina.com.cn"; //etAccount.Text = "12345678904";//2.0 娴嬭瘯 钀ょ煶 - //etAccount.Text = "18316672920"; + etAccount.Text = "18316672920"; } else { @@ -357,9 +357,9 @@ } b = !b; etPassword.Text = "123456"; - if(etAccount.Text == "jeremy@ruma.my") + if(etAccount.Text == "pjh@hdlchina.com.cn") { - etPassword.Text = "CEBCWINP"; + etPassword.Text = "hdl123"; } else if(etAccount.Text == "13143792049") { diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs index db57943..67e453b 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs @@ -1090,7 +1090,6 @@ #region ContextView gcFunctionView.RemoveAll(); - functionViews.Clear(); var rowView = new FrameLayout(); try { diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs index c5fc92d..c032a6e 100644 --- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs +++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs @@ -755,10 +755,6 @@ break; case ShowFunction.SecurityCenter: functionCount = FunctionList.List.securities.Count; - //if (DB_ResidenceData.Instance.GatewayType == 1) - //{ - // functionCount = 1; - //} break; case ShowFunction.Acst: functionCount = FunctionList.List.GetAcstParentList().Count; @@ -766,14 +762,10 @@ break; case ShowFunction.VideoDoorLock: functionCount = FunctionList.List.GetVideoDoorLockList().Count; -#if DEBUG - //functionCount = 1; -#endif - functionOnCount = 1; + functionOnCount = FunctionList.List.GetAcstParentList().FindAll((obj) => obj.GetAttrState("status").ToString() == "open" + || obj.GetAttrState("status").ToString() == "normal_open").Count; + break; - - - } if (functionCount == 0) diff --git a/HDL_ON/UI/UI2/2-Classification/SeriesFunctionListPage.cs b/HDL_ON/UI/UI2/2-Classification/SeriesFunctionListPage.cs index e9b11a2..4f1e19e 100644 --- a/HDL_ON/UI/UI2/2-Classification/SeriesFunctionListPage.cs +++ b/HDL_ON/UI/UI2/2-Classification/SeriesFunctionListPage.cs @@ -78,10 +78,6 @@ TextColor = CSS_Color.MainColor, Text =Language.StringByID( StringId.HorseRaceLampGroup )+ " "+ oidList.Count.ToString(), }; - if(Language.CurrentLanguage == "Chinese") - { - btnTitle.Text = Language.StringByID(StringId.HorseRaceLampGroup) + oidList.Count.ToString(); - } titleView.AddChidren(btnTitle); #endregion diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs index 26c55dc..623df1d 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs @@ -164,6 +164,21 @@ #endregion } break; + case SPK.CommonSeries: + #region 鐣岄潰 + ///寮�鍏� + LogicView.FunTypeView SerriesSwitchView = new LogicView.FunTypeView(); + SerriesSwitchView.btnText.TextID = StringId.switchLogic; + fLayout.AddChidren(SerriesSwitchView.FLayoutView()); + + #endregion + ///寮�鍏崇偣鍑讳簨浠� + SerriesSwitchView.btnClick.MouseUpEventHandler += (sender, e) => + { + SwitchViewMethod(device, SerriesSwitchView.btnState, 2); + }; + + break; //寮�鍏崇伅鍏� case SPK.AirSwitch: case SPK.LightSwitch: diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs index a161414..61a1d85 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs @@ -468,10 +468,16 @@ EventHandler<MouseEventArgs> skipEvent= (sender, e) => { - var ssf = new SceneFunctionInfoEditPage(scene, scenefunction.localFunction.ConvertSceneFunction(), refreshFunctionRowAction); - MainPage.BasePageView.AddChidren(ssf); - ssf.LoadPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + try + { + var ssf = new SceneFunctionInfoEditPage(scene, scenefunction.localFunction.ConvertSceneFunction(), refreshFunctionRowAction); + MainPage.BasePageView.AddChidren(ssf); + ssf.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }catch(Exception ex) + { + MainPage.Log($"load SceneFunctionInfoEditPage error : {ex.Message}"); + } }; btnFunctionName.MouseUpEventHandler = skipEvent; @@ -542,7 +548,7 @@ var perAngle = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Angle); if (perAngle != null) { - sceneFunctionInfo += " "+ perState.value + "掳"; + sceneFunctionInfo += " "+ perAngle.value + "掳"; } var perColorful = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Colorful); diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs index 0974ade..e730aaa 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs @@ -61,11 +61,18 @@ bodyView.AddChidren(contentView); var onOffStatus = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff); - if(onOffStatus.value == "on") + if (onOffStatus != null) + { + if (onOffStatus.value == "on") + { + isOnStatus = true; + } + LoadFunctionRow(onOffStatus); + } + else { isOnStatus = true; } - LoadFunctionRow(onOffStatus); if (sceneFunction.localFunction.spk == SPK.LightRGB || sceneFunction.localFunction.spk == SPK.GroupControl) { @@ -179,8 +186,11 @@ } else { - sceneFunction.status.Clear(); - sceneFunction.status.Add(new SceneFunctionStatus() { key = FunctionAttributeKey.OnOff, value = "off" }); + if (sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff) != null) + { + sceneFunction.status.Clear(); + sceneFunction.status.Add(new SceneFunctionStatus() { key = FunctionAttributeKey.OnOff, value = "off" }); + } } } var temp = scene.functions.Find((obj) => obj.sid == sceneFunction.sid); diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs index 2aaa1dd..351bee9 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs @@ -4,6 +4,7 @@ using HDL_ON.DAL.Server; using HDL_ON.Entity; using HDL_ON.UI.CSS; +using Newtonsoft.Json; using Shared; namespace HDL_ON.UI @@ -29,7 +30,10 @@ var page = new AddGroupControlPage(null, (newGC) => { - ReadGroupControlList(); + Application.RunOnMainThread(() => + { + LoadGroupControlView(); + }); }, () => { }); MainPage.BasePageView.AddChidren(page); page.LoadPage(); @@ -71,8 +75,57 @@ { try { - FunctionList.List.groupControls.Clear(); - FunctionList.List.groupControls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); + //FunctionList.List.groupControls.Clear(); + //FunctionList.List.groupControls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); + + try + { + var groupControlList = JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); + var readSidList = new List<string>(); + foreach (var temp in groupControlList) + { + FunctionList.List.groupControls.Clear(); + readSidList.Add(temp.userDeviceGroupControlId); + if (readSidList.Count >= 20) + { + var data = ApiUtlis.Ins.HttpRequest.GetGroupControInfo(readSidList); + if (data != null) + { + if (data.Code == StateCode.SUCCESS) + { + var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString()); + FunctionList.List.groupControls.AddRange(groupControlInfoList); + } + else + { + IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); + } + } + readSidList.Clear(); + } + } + if (readSidList.Count > 0) + { + var data = ApiUtlis.Ins.HttpRequest.GetGroupControInfo(readSidList); + if (data != null) + { + if (data.Code == StateCode.SUCCESS) + { + var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString()); + FunctionList.List.groupControls.AddRange(groupControlInfoList); + } + else + { + IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); + } + } + readSidList.Clear(); + } + } + catch (Exception ex) + { + MainPage.Log($"璇诲彇缁勬帶鍒楄〃澶辫触:{ex.Message}"); + } Application.RunOnMainThread(() => { diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs index 113b140..ad7b605 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs @@ -81,7 +81,7 @@ function.SetAttrState(FunctionAttributeKey.FadeTime, e.ToString()); var d = new System.Collections.Generic.Dictionary<string, string>(); d.Add(FunctionAttributeKey.FadeTime, e.ToString()); - Control.Ins.SendWriteCommand(function, d); + //Control.Ins.SendWriteCommand(function, d); function.SaveFunctionFile(); }; } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulSettingPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulSettingPage.cs index 3775e43..bb89eec 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulSettingPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorfulSettingPage.cs @@ -313,21 +313,28 @@ contentView.AddChidren(new Button() { - Height = Application.GetRealHeight(30) + Height = Application.GetRealHeight(12) }); - - var btnSelectColorTip = new Button() + if (isSatrtColor) { - Height = Application.GetRealWidth(35), - Width = Application.GetRealWidth(300), - TextAlignment = TextAlignment.CenterLeft, - TextSize = 12, - TextColor = 0x21000000, - Text = "鎻愮ず锛氳捣濮嬮鑹查�夋嫨瓒婇潬杩戣壊鐜竟缂橈紝鐐僵鏁堟灉瓒婃槑鏄俱�傝秺闈犺繎鐧借壊涓績锛岀偒褰╂晥鏋滆秺涓嶆槑鏄俱��", - IsMoreLines = true, - }; - contentView.AddChidren(btnSelectColorTip); + var btnSelectColorTip = new Button() + { + X = Application.GetRealWidth(16), + Height = Application.GetRealWidth(35), + Width = Application.GetRealWidth(300), + TextAlignment = TextAlignment.CenterLeft, + TextSize = 12, + TextColor = 0x21000000, + TextID = StringId.ColorfulSetTip,// = "鎻愮ず锛氳捣濮嬮鑹查�夋嫨瓒婇潬杩戣壊鐜竟缂橈紝鐐僵鏁堟灉瓒婃槑鏄俱�傝秺闈犺繎鐧借壊涓績锛岀偒褰╂晥鏋滆秺涓嶆槑鏄俱��", + IsMoreLines = true, + }; + contentView.AddChidren(btnSelectColorTip); + contentView.AddChidren(new Button() + { + Height = Application.GetRealHeight(12) + }); + } #region 淇濆瓨 var btnConfrim = new Button() { diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs index 58c4a31..7904d1d 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs @@ -220,11 +220,6 @@ Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, }; controlView.AddChidren(barFadeTime); - barFadeTime.OnStopTrackingTouchEvent = (sender, e) => - { - function.SetAttrState(FunctionAttributeKey.FadeTime, e.ToString()); - function.UpdataFuncitonInfo(); - }; var btnGradualChangeMaxValuesText = new Button() { diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs index 4df1a68..4a6cf52 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs @@ -69,7 +69,7 @@ function.SetAttrState(FunctionAttributeKey.FadeTime, e.ToString()); var d = new System.Collections.Generic.Dictionary<string, string>(); d.Add(FunctionAttributeKey.FadeTime, e.ToString()); - Control.Ins.SendWriteCommand(function, d); + //Control.Ins.SendWriteCommand(function, d); function.SaveFunctionFile(); }; } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs index f51e8a3..4a05b7c 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage_V2.cs @@ -4,6 +4,7 @@ using HDL_ON.DriverLayer; using HDL_ON.Entity; using HDL_ON.UI.CSS; +using Java.Util.Functions; using Shared; namespace HDL_ON.UI @@ -209,31 +210,39 @@ attrView.AddChidren(new Button() { Height = Application.GetRealHeight(18) }); - btnSwitch = new Button() + var btnOn = new Button() { - Gravity = Gravity.CenterHorizontal, + X = Application.GetRealWidth(100), + Y = Application.GetRealHeight(466), + Width = Application.GetMinRealAverage(32), + Height = Application.GetMinRealAverage(32), + //UnSelectedImagePath = "Public/PowerClose.png", + UnSelectedImagePath = "Public/PowerOpen.png", + }; + controlView.AddChidren(btnOn); + + var btnOff = new Button() + { + X = Application.GetRealWidth(180), Y = Application.GetRealHeight(466), Width = Application.GetMinRealAverage(32), Height = Application.GetMinRealAverage(32), UnSelectedImagePath = "Public/PowerClose.png", - SelectedImagePath = "Public/PowerOpen.png", + //UnSelectedImagePath = "Public/PowerOpen.png", }; - controlView.AddChidren(btnSwitch); - btnSwitch.MouseUpEventHandler = (sender, e) => { - if (btnSwitch.IsSelected) - { - btnSwitch.IsSelected = false; - var d = new Dictionary<string, string>(); - d.Add(FunctionAttributeKey.OnOff, "off"); - function.Control(d); - } - else - { - btnSwitch.IsSelected = true; - var d = new Dictionary<string, string>(); - d.Add(FunctionAttributeKey.OnOff, "on"); - function.Control(d); - } + controlView.AddChidren(btnOff); + btnOn.MouseUpEventHandler = (sender, e) => + { + var d = new Dictionary<string, string>(); + d.Add(FunctionAttributeKey.OnOff, "on"); + function.Control(d); + }; + + btnOff.MouseUpEventHandler = (sender, e) => + { + var d = new Dictionary<string, string>(); + d.Add(FunctionAttributeKey.OnOff, "off"); + function.Control(d); }; @@ -267,21 +276,16 @@ btnSwitchIcon.MouseUpEventHandler = (sender, e) => { if (btnSwitchIcon.IsSelected) { - btnSwitchIcon.IsSelected = btnSwitch.IsSelected = false; var d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.OnOff, "off"); function.Control(d); } else { - btnSwitchIcon.IsSelected = btnSwitch.IsSelected = true; var d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.OnOff, "on"); function.Control(d); } - }; - btnSwitch.MouseUpEventHandler += (sender, e) => { - btnSwitchIcon.IsSelected = btnSwitch.IsSelected; }; } @@ -289,7 +293,6 @@ } - Button btnSwitch; /// <summary> /// 鍔犺浇璋冨厜灞炴�ц缃帶浠� @@ -337,18 +340,26 @@ }; dimmerView.AddChidren(btnBrightnessText); + dimmerBar.OnStopTrackingTouchEvent = (sender, e) => { + new System.Threading.Thread(() => + { + var d = new Dictionary<string, string>(); + d.Add(FunctionAttributeKey.Brightness, e.ToString()); + function.Control(d); + }) + { IsBackground = true }.Start(); + }; + dimmerBar.OnProgressChangedEvent = (sender, e) => { if (e == 0 && lastBrightness != 0) { - btnSwitch.IsSelected = false; lastBrightness = 0; } else { if (lastBrightness == 0) lastBrightness = e; - btnSwitch.IsSelected = true; } if (e == 0 || e == 100) { @@ -373,19 +384,6 @@ } - btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); - btnBrightnessText.Text = dimmerBar.Progress + "%"; - }; - - btnSwitch.MouseUpEventHandler += (sender, e) => { - if (btnSwitch.IsSelected) - { - dimmerBar.Progress = 100; - } - else - { - dimmerBar.Progress = 0; - } btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); btnBrightnessText.Text = dimmerBar.Progress + "%"; }; @@ -436,18 +434,26 @@ }; dimmerView.AddChidren(btnBrightnessText); + dimmerBar.OnStopTrackingTouchEvent = (sender, e) => { + new System.Threading.Thread(() => + { + var d = new Dictionary<string, string>(); + d.Add(FunctionAttributeKey.Brightness, e.ToString()); + function.Control(d); + }) + { IsBackground = true }.Start(); + }; + dimmerBar.OnProgressChangedEvent = (sender, e) => { if (e == 0 && lastBrightness != 0) { - btnSwitch.IsSelected = false; lastBrightness = 0; } else { if (lastBrightness == 0) lastBrightness = e; - btnSwitch.IsSelected = true; } if (e == 0 || e == 100) @@ -477,19 +483,7 @@ btnBrightnessText.Text = dimmerBar.Progress + "%"; }; - btnSwitch.MouseUpEventHandler += (sender, e) => { - if (btnSwitch.IsSelected) - { - dimmerBar.Progress = 100; - } - else - { - dimmerBar.Progress = 0; - } - btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100); - btnBrightnessText.Text = dimmerBar.Progress + "%"; - }; - + //attrView.AddChidren(new Button() { Height = Application.GetRealHeight(10) }); #region 鑹叉俯 @@ -628,10 +622,10 @@ ColorImagePath = "FunctionIcon/Light/ColorWheel.png", }; framePickerBack.AddChidren(colorPicker); - if (function.trait_on_off.curValue.ToString() == "off") - { - colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png"; - } + //if (function.trait_on_off.curValue.ToString() == "off") + //{ + // colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png"; + //} //colorPicker.MouseDownEventHandler = (sender, e) => { // MainPage.BasePageView.ScrollEnabled = false; //}; @@ -668,7 +662,22 @@ }; colorPicker.ColorChaged += (sender2, e2) => { + if ( pointIsRight == false) + { + return; + } + //if (colorPicker.ColorImagePath == "FunctionIcon/Light/ColorWheelGray.png") + //{ + // return; + //} + if (function.refreshTime.AddMilliseconds(350) > DateTime.Now) + { + MainPage.Log("棰戠箒鎺у埗锛岄��鍑�"); + return; + } + function.refreshTime = DateTime.Now; rgbString = (e2[0] + "," + e2[1] + "," + e2[2]).ToString(); + btnCurColor.BackgroundColor = (uint)(0xFF000000 + rgbTemp.GetRGBcolor(rgbString)); var d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.RGB, rgbString); @@ -677,12 +686,15 @@ colorPicker.MouseDownEventHandler += (sender, e) => { pointIsRight = this.CheckPoint(circleR, colorPicker.Width / 2, colorPicker.Height / 2, (int)e.X, (int)e.Y); - if (function.trait_on_off.curValue.ToString() == "off" || pointIsRight == false) + if (pointIsRight == false) { //pointIsRight:鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐� return; } - + //if (colorPicker.ColorImagePath == "FunctionIcon/Light/ColorWheelGray.png") + //{ + // return; + //} //鏄剧ず鐧界偣 btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2; btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2; @@ -743,19 +755,26 @@ }; controlView.AddChidren(dimmerBar); + dimmerBar.OnStopTrackingTouchEvent = (sender, e) => { + new System.Threading.Thread(() => + { + var d = new Dictionary<string, string>(); + d.Add(FunctionAttributeKey.Brightness, e.ToString()); + function.Control(d); + }) + { IsBackground = true }.Start(); + }; dimmerBar.OnProgressChangedEvent = (sender, e) => { if (e == 0 && lastBrightness != 0) { - btnSwitch.IsSelected = false; lastBrightness = 0; } else { if (lastBrightness == 0) lastBrightness = e; - btnSwitch.IsSelected = true; } if (e == 0 || e == 100) { @@ -778,23 +797,22 @@ { IsBackground = true }.Start(); } } - if (e == 0) - { - if (function.trait_on_off.curValue.ToString() == "on") - { - function.SetAttrState(FunctionAttributeKey.OnOff, "off"); - colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png"; - } - } - else - { - if (function.trait_on_off.curValue.ToString() == "off") - { - function.SetAttrState(FunctionAttributeKey.OnOff, "on"); - colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheel.png"; - } - } + //if (e == 0) + //{ + // if (colorPicker.ColorImagePath != "FunctionIcon/Light/ColorWheelGray.png") + // { + // colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png"; + // } + //} + //else + //{ + // if (colorPicker.ColorImagePath != "FunctionIcon/Light/ColorWheel.png") + // { + // colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheel.png"; + // } + //} }; + var btnMaxValuesText = new Button() @@ -810,20 +828,6 @@ }; controlView.AddChidren(btnMaxValuesText); - btnSwitch.MouseUpEventHandler += (sender, e) => { - if (btnSwitch.IsSelected) - { - dimmerBar.Progress = 100; - function.SetAttrState(FunctionAttributeKey.OnOff, "on"); - colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheel.png"; - } - else - { - dimmerBar.Progress = 0; - function.SetAttrState(FunctionAttributeKey.OnOff, "off"); - colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png"; - } - }; #endregion int heightMore = 375 - magriHeight-20; diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs index bb83402..51f0282 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs @@ -314,11 +314,11 @@ SeekBarPadding = Application.GetRealWidth(20), }; controlView.AddChidren(barFadeTime); - barFadeTime.OnStopTrackingTouchEvent = (sender, e) => - { - function.SetAttrState(FunctionAttributeKey.FadeTime, barFadeTime.Progress); - function.UpdataFuncitonInfo(); - }; + //barFadeTime.OnStopTrackingTouchEvent = (sender, e) => + //{ + // function.SetAttrState(FunctionAttributeKey.FadeTime, barFadeTime.Progress); + // function.UpdataFuncitonInfo(); + //}; var btnGradualChangeMaxValuesText = new Button() { diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs index 224371b..124ed5f 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs @@ -182,7 +182,6 @@ lightTemp.SetRGBcolor(lastColor, function); System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); d.Add(FunctionAttributeKey.RGB, lightTemp.GetRGBcolorString(function)); - d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString()); Control.Ins.SendWriteCommand(function, d,false,0); break; } @@ -224,7 +223,19 @@ }.Show(MainPage.BaseView); return; } - curDimmerStatus = false; + if(dimmerBar.Progress==0|| dimmerBar.Progress == 100) + { + if (dimmerBar.Progress == 0) + { + //瑙e喅閮ㄥ垎瀹夊崜鎵嬫満锛屽埛鏂板浘鐗囨椂浼氬彉灏忛棶棰� + if (bodyView.colorPicker.ColorImagePath != "FunctionIcon/Light/ColorWheelGray.png") + { + bodyView.colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png"; + } + } + return; + } + onDimmerBar = curDimmerStatus = false; function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress); System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString()); @@ -286,7 +297,7 @@ function.SetAttrState(FunctionAttributeKey.FadeTime, e.ToString()); var d = new System.Collections.Generic.Dictionary<string, string>(); d.Add(FunctionAttributeKey.FadeTime, e.ToString()); - Control.Ins.SendWriteCommand(function, d); + //Control.Ins.SendWriteCommand(function, d); function.SaveFunctionFile(); }; } -- Gitblit v1.8.0