From 46dee93ff58a4c50b23fd42ffa8db9bf612b497c Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 05 七月 2022 10:39:53 +0800 Subject: [PATCH] 梦幻帘对接完成 --- HDL_ON/Entity/Function/Scene.cs | 11 ++ HDL-ON_Android/Properties/AndroidManifest.xml | 2 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs | 9 + HDL-ON_iOS/HDL-ON_iOS.csproj | 3 HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/curtaindream.png | 0 HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/HomeIcon/curtaindream_white.png | 0 HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/curtaindream_blue.png | 0 HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/HomeIcon/curtaindream_blue.png | 0 HDL-ON_Android/HDL-ON_Android.csproj | 3 HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs | 2 HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs | 60 +++++++++------ HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/curtaindream.png | 0 HDL_ON/Entity/Function/Function.cs | 5 + HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 1 HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/curtaindream_white.png | 0 HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 119 +++++++++++++++++++++++++++++ HDL_ON/DAL/DriverLayer/Control.cs | 8 ++ HDL_ON/UI/UI1-Login/LoginPage.cs | 5 SiriIntents/Server/HttpUtil.cs | 4 19 files changed, 198 insertions(+), 34 deletions(-) diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/HomeIcon/curtaindream_blue.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/HomeIcon/curtaindream_blue.png new file mode 100644 index 0000000..bfdc82b --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/HomeIcon/curtaindream_blue.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/HomeIcon/curtaindream_white.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/HomeIcon/curtaindream_white.png new file mode 100644 index 0000000..da11a9d --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/HomeIcon/curtaindream_white.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/curtaindream.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/curtaindream.png new file mode 100644 index 0000000..8ea9e15 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/curtaindream.png Binary files differ diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj index 08dd1f0..118473d 100644 --- a/HDL-ON_Android/HDL-ON_Android.csproj +++ b/HDL-ON_Android/HDL-ON_Android.csproj @@ -248,6 +248,9 @@ <AndroidAsset Include="Assets\Phone\MusicIcon\order.png" /> <AndroidAsset Include="Assets\Phone\MusicIcon\single_cycle.png" /> <AndroidAsset Include="Assets\Phone\Public\ThumbImage2.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\curtaindream_blue.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\curtaindream_white.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\curtaindream.png" /> </ItemGroup> <ItemGroup> <AndroidResource Include="Resources\values\colors.xml" /> diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml index c76bbb6..218c92d 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.5.9" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202207011"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.5.9" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202207041"> <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> <!--鍙嬬洘--> <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>--> diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj index 56e980e..bc99078 100644 --- a/HDL-ON_iOS/HDL-ON_iOS.csproj +++ b/HDL-ON_iOS/HDL-ON_iOS.csproj @@ -1410,6 +1410,9 @@ <BundleResource Include="Resources\Phone\MusicIcon\order.png" /> <BundleResource Include="Resources\Phone\MusicIcon\single_cycle.png" /> <BundleResource Include="Resources\Phone\Public\ThumbImage2.png" /> + <BundleResource Include="Resources\Phone\FunctionIcon\Icon\curtaindream.png" /> + <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\curtaindream_blue.png" /> + <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\curtaindream_white.png" /> </ItemGroup> <ItemGroup> <ITunesArtwork Include="iTunesArtwork" /> diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/curtaindream_blue.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/curtaindream_blue.png new file mode 100644 index 0000000..bfdc82b --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/curtaindream_blue.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/curtaindream_white.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/curtaindream_white.png new file mode 100644 index 0000000..da11a9d --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/curtaindream_white.png Binary files differ diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/curtaindream.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/curtaindream.png new file mode 100644 index 0000000..8ea9e15 --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/curtaindream.png Binary files differ diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index 333d101..5714db0 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -1127,6 +1127,14 @@ localFunction.lastState = localFunction.trait_on_off.curValue.ToString() == "on" ? Language.StringByID(StringId.Open) : Language.StringByID(StringId.Close); CurtainModulePage.UpdataState(localFunction); break; + case SPK.CurtainDream: + if(localFunction.GetAttrState(FunctionAttributeKey.Percent) == "0") + { + localFunction.SetAttrState(FunctionAttributeKey.OnOff, "off"); + } + localFunction.lastState = localFunction.trait_on_off.curValue.ToString() == "on" ? Language.StringByID(StringId.Open) : Language.StringByID(StringId.Close); + CurtainDreamPage.UpdataState(localFunction); + break; case SPK.CurtainTrietex: localFunction.lastState = Language.StringByID(StringId.Open) + localFunction.GetAttrState(FunctionAttributeKey.Percent) + "%"; MotorCurtainPage.UpdataState(localFunction); diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index c706201..2b47116 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -686,6 +686,7 @@ case FunctionAttributeKey.Percent: case FunctionAttributeKey.CCT: case FunctionAttributeKey.RGB: + case FunctionAttributeKey.Angle: //case FunctionAttributeKey.FadeTime: if (attr.curValue.ToString() == "{}") { @@ -1012,6 +1013,10 @@ /// </summary> public const string Percent = "percent"; /// <summary> + /// 瑙掑害 + /// </summary> + public const string Angle = "angle"; + /// <summary> /// 瀹ゅ唴娓╁害 /// </summary> public const string RoomTemp = "room_temp"; diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs index 2f2d49c..e5abff0 100644 --- a/HDL_ON/Entity/Function/Scene.cs +++ b/HDL_ON/Entity/Function/Scene.cs @@ -522,6 +522,13 @@ { //sceneFunctionInfo += new cctState.value + "%" + " "; } + + + var perAngle = status.Find((obj) => obj.key == FunctionAttributeKey.Angle); + if (perAngle != null) + { + sceneFunctionInfo += " " + perState.value + "掳"; + } return sceneFunctionInfo; } @@ -617,6 +624,9 @@ case FunctionAttributeKey.CCT: us = "K"; break; + case FunctionAttributeKey.Angle: + us = "掳"; + break; } return us; } @@ -643,6 +653,7 @@ case FunctionAttributeKey.RoomTemp: case FunctionAttributeKey.Brightness: case FunctionAttributeKey.Percent: + case FunctionAttributeKey.Angle: int outT = 0; int.TryParse(catchString,out outT); if (outT < 0) diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs index 1b5166a..3655638 100644 --- a/HDL_ON/UI/UI1-Login/LoginPage.cs +++ b/HDL_ON/UI/UI1-Login/LoginPage.cs @@ -218,7 +218,6 @@ //etAccount.Text = "13450425807";//榛勭婧� knx椤圭洰 etAccount.Text = "18244942707"; etAccount.Text = "tf@smarttech.com.ua"; - etAccount.Text = ""; } else { @@ -245,8 +244,8 @@ //etAccount.Text = "13375012441"; //etAccount.Text = "info@smartlife-ks.com"; //etAccount.Text = "551775569@qq.com";//wcf - //etAccount.Text = "15626203746"; - etAccount.Text = "18244942707"; + etAccount.Text = "15626203746"; + //etAccount.Text = "18244942707"; //etAccount.Text = "zhangquansongjava@163.com"; //etAccount.Text = "s.savinov@hdlautomation.ru"; } diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs index 342d1d5..3f85a44 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs @@ -395,7 +395,7 @@ var state = false; if (function.spk == SPK.CurtainRoller || function.spk == SPK.CurtainShades || function.spk == SPK.CurtainTrietex || - function.spk == SPK.CurtainSwitch)//绐楀笜璁惧鏍规嵁鐧惧垎姣斿垽鏂紑鍏崇姸鎬� + function.spk == SPK.CurtainSwitch || function.spk == SPK.CurtainDream)//绐楀笜璁惧鏍规嵁鐧惧垎姣斿垽鏂紑鍏崇姸鎬� { if (function.GetAttribute(FunctionAttributeKey.Percent) != null) { diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs index b6334d8..8957959 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs @@ -634,6 +634,7 @@ functionTypeList.Add(SPK.HvacCac); functionTypeList.Add(SPK.SensorHelp); functionTypeList.Add(SPK.DoorLock); + functionTypeList.Add(SPK.CurtainDream); } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs index ee6432c..6043907 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs @@ -532,12 +532,17 @@ var briState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); if (briState != null) { - sceneFunctionInfo += briState.value + "%"; + sceneFunctionInfo += " " + briState.value + "%"; } var perState = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent); if (perState != null) { - sceneFunctionInfo += perState.value + "%"; + sceneFunctionInfo += " " + perState.value + "%"; + } + var perAngle = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Angle); + if (perAngle != null) + { + sceneFunctionInfo += " "+ perState.value + "掳"; } return sceneFunctionInfo; diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs index b82e1f8..b0b6876 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs @@ -358,6 +358,7 @@ break; case "angle": //鍛堢幇鐨勫脊绐� + LoadEditDialog_Angle(sceneStatus, btnFunctionText); break; case "cct": @@ -638,7 +639,8 @@ var btnConfrim = new Button() { - Width = Application.GetRealWidth(320), + X = Application.GetRealWidth(160), + Width = Application.GetRealWidth(160), TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.MainColor, TextSize = CSS_FontSize.TextFontSize, @@ -686,6 +688,120 @@ }; } + + /// <summary> + /// 鍔犺浇娓╁害閫夋嫨寮圭獥 + /// </summary> + /// <param name="function"></param> + /// <param name="btn"></param> + void LoadEditDialog_Angle (SceneFunctionStatus trait, Button btn) + { + double temp = trait.min; + double.TryParse(trait.value, out temp); + trait.value = temp.ToString(); + + List<string> pickerItems = new List<string>(); + if (trait == null) + { + return; + } + + Dialog dialog = new Dialog(); + + var pView = new FrameLayout() + { + BackgroundColor = CSS_Color.DialogTransparentColor1, + }; + dialog.AddChidren(pView); + + var optionBaseView = new FrameLayout() + { + Y = Application.GetRealHeight(456 - 60), + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(260), + AnimateSpeed = 0.3f, + Animate = Animate.DownToUp, + BackgroundColor = CSS_Color.MainBackgroundColor, + Radius = (uint)Application.GetRealWidth(12), + }; + pView.AddChidren(optionBaseView); + + var topView = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(40), + BackgroundColor = CSS_Color.MainBackgroundColor, + Radius = (uint)Application.GetRealWidth(12), + }; + optionBaseView.AddChidren(topView); + topView.AddChidren(new Button() { Y = Application.GetRealHeight(39), Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor }); + + var btnCancel = new Button() + { + X = Application.GetRealWidth(21), + Width = Application.GetRealWidth(100), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.TextFontSize, + TextID = StringId.Cancel, + }; + topView.AddChidren(btnCancel); + + + var btnConfrim = new Button() + { + X = Application.GetRealWidth(160), + Width = Application.GetRealWidth(160), + TextAlignment = TextAlignment.CenterRight, + TextColor = CSS_Color.MainColor, + TextSize = CSS_FontSize.TextFontSize, + TextID = StringId.Confirm, + }; + topView.AddChidren(btnConfrim); + + UIPickerView uIPickerView = new UIPickerView() + { + Y = Application.GetRealHeight(40), + Height = Application.GetRealHeight(210), + Radius = (uint)Application.GetRealWidth(12), + }; + for (int i = trait.min; i <= trait.max; i += 1) + { + pickerItems.Add(i.ToString() + trait.GetUintString()); + } + uIPickerView.setNPicker(pickerItems, null, null); + optionBaseView.AddChidren(uIPickerView); + uIPickerView.setCurrentItems(pickerItems.IndexOf(trait.value.ToString()+ "掳"), 0, 0); + + string selectItem = pickerItems[pickerItems.IndexOf(trait.value.ToString() + "掳")]; + if (pickerItems.Contains(trait.value + trait.GetUintString())) + { + selectItem = trait.value.ToString() + trait.GetUintString(); + } + //uIPickerView.setCurrentItems + dialog.Show(); + + pView.MouseUpEventHandler = (sender, e) => { + dialog.Close(); + }; + + btnCancel.MouseUpEventHandler = (sender, e) => { + dialog.Close(); + }; + uIPickerView.OnSelectChangeEvent = (int1, int2, int3) => { + selectItem = pickerItems[int1]; + }; + btnConfrim.MouseUpEventHandler = (sender, e) => { + dialog.Close(); + btn.Text = selectItem; + //sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.value.ToString() ; + trait.value = selectItem.Replace(trait.GetUintString(), ""); + }; + + } + /// <summary> /// 鍔犺浇浜害閫夋嫨寮圭獥 @@ -843,6 +959,7 @@ }; } + /// <summary> /// 鍔犺浇cct閫夋嫨寮圭獥 /// </summary> diff --git a/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs index 28e9b86..9602f7c 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs @@ -33,6 +33,18 @@ /// 杩涘害鍊� /// </summary> Button btnProgress; + /// <summary> + /// 瑙掑害鎺т欢闆� + /// </summary> + List<Button> buttons; + /// <summary> + /// 瑙掑害鏂囨湰鎸夐挳 + /// </summary> + Button btnAngle; + /// <summary> + /// 瑙掑害婊戝姩鎺т欢 + /// </summary> + DiyImageSeekBar angleBar; /// <summary> @@ -158,7 +170,7 @@ controlView.AddChidren(curtainSeekBar); - int angleValut = Convert.ToInt32(function.GetAttrState("angle")); + int angleValut = Convert.ToInt32(function.GetAttrState("angle")) - 90; var angleView = new FrameLayout() { Gravity = Gravity.CenterHorizontal, @@ -169,7 +181,7 @@ }; controlView.AddChidren(angleView); - List<Button> buttons = new List<Button>(); + buttons = new List<Button>(); for (int i = 0; i < 18; i++) { var btn = new Button() @@ -185,7 +197,7 @@ buttons.Add(btn); }; - var btnAngle = new Button() + btnAngle = new Button() { TextAlignment = TextAlignment.CenterRight, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, @@ -194,13 +206,14 @@ }; angleView.AddChidren(btnAngle); - var angleBar = new DiyImageSeekBar() + angleBar = new DiyImageSeekBar() { Width = Application.GetRealWidth(220), Height = Application.GetRealHeight(30), - SeekBarViewHeight = Application.GetRealHeight(0), + SeekBarViewHeight = Application.GetRealHeight(20), + SeekBarBackgroundColor = 0x00000000, ThumbImagePath = "Public/ThumbImage2.png", - ThumbImageHeight = Application.GetRealHeight(20), + ThumbImageHeight = Application.GetRealHeight(40), ProgressBarColor = 0x00000000, ProgressTextColor = 0x00000000, ProgressTextSize = 0, @@ -211,26 +224,12 @@ angleView.AddChidren(angleBar); angleBar.OnProgressChangedEvent = (sender, e) => { - float angle = e; - btnAngle.Text = angle + "掳"; + float angle = (e - 90); + btnAngle.Text = e + "掳"; foreach (var btn in buttons) { - btn.SetRotation(angle); Console.WriteLine(angle); + btn.SetRotation(angle); } - //if (100 < (DateTime.Now - function.refreshTime).TotalMilliseconds) - //{ - // function.refreshTime = DateTime.Now; - // foreach (var btn in buttons) - // { - // new System.Threading.Thread(() => - // { - // Application.RunOnMainThread(() => - // { - // btn.SetRotation(angle); Console.WriteLine(angle); - // }); - // }); - // } - //} }; angleBar.OnStopTrackingTouchEvent = (sende, e) => { @@ -305,7 +304,20 @@ { if (!bodyView.onCurtainAnimation) { - bodyView.CurtainAnimation(Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.Percent))); + var percent = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.Percent)); + bodyView.CurtainAnimation(percent); + bodyView.btnProgress.Text = percent + "%"; + + var e = Convert.ToInt32( updateTemp.GetAttrState(FunctionAttributeKey.Angle)); + bodyView.angleBar.Progress = e; + float angle = e - 90; + bodyView.btnAngle.Text = (e - 0) + "掳"; + foreach (var btn in bodyView.buttons) + { + btn.SetRotation(angle); + } + + } } catch { } diff --git a/SiriIntents/Server/HttpUtil.cs b/SiriIntents/Server/HttpUtil.cs index f61de04..56a78a0 100644 --- a/SiriIntents/Server/HttpUtil.cs +++ b/SiriIntents/Server/HttpUtil.cs @@ -16,8 +16,8 @@ /// 鍥哄畾鍩熷悕,姝e紡鐜 /// 鍏叡鍩熷悕灏辫繎瑙f瀽 /// </summary> - public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; - //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm + //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; + public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm /// <summary> /// RegionMark /// </summary> -- Gitblit v1.8.0