From 0b5b6ec781a8cb3400ad34693792bad07e97a00c Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期四, 30 六月 2022 09:32:54 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/release0123' into wjc --- HDL-ON_Android/Properties/AndroidManifest.xml | 4 HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs | 5 HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs | 6 HDL_ON/UI/UI2/1-HomePage/HomePage.cs | 58 +- HDL-ON_Android/Assets/Language.ini | 12 HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs | 21 HDL-ON_iOS/HDL-ON_iOS.csproj | 1 HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs | 24 + HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs | 76 +- HDL_ON/DAL/Mqtt/MqttClient.cs | 7 HDL_ON/Entity/Function/FloorHeating.cs | 20 HDL_ON/HDL_ON.projitems | 1 HDL-ON_iOS/Resources/Phone/Public/ThumbImage2.png | 0 HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs | 27 + HDL_ON/Entity/Function/Sensor.cs | 2 HDL-ON_Android/HDL-ON_Android.csproj | 3 HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs | 543 +++++++++++++++++++++++ HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs | 73 +- HDL-ON_Android/Assets/Phone/Public/ThumbImage2.png | 0 HDL-ON_Android/SplashActivity.cs | 30 + HDL-ON_iOS/Info.plist | 4 HDL-ON_iOS/Resources/Language.ini | 18 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs | 1 HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs | 162 +++++++ HDL_ON/DAL/DriverLayer/Packet.cs | 1 HDL_ON/DAL/DriverLayer/Control.cs | 6 HDL_ON/UI/MainPage.cs | 4 HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs | 50 +- SiriIntents/Server/HttpUtil.cs | 4 HDL_ON/Entity/Function/Scene.cs | 7 HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs | 33 + HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs | 4 HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs | 74 +- HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs | 8 HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs | 9 HDL_ON/Entity/DB_ResidenceData.cs | 4 HDL-ON_Android/Assets/Phone/FunctionIcon/FloorHeating/EconomicIcon.png | 0 HDL_ON/DAL/DriverLayer/Control_Udp.cs | 1 HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs | 3 HDL_ON/DAL/Server/NewAPI.cs | 2 HDL_ON/Entity/Function/Function.cs | 16 HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs | 34 + HDL_ON/Common/R.cs | 5 HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 7 HDL-ON_Android/Assets/Phone/FunctionIcon/FloorHeating/EconomicIconGray.png | 0 45 files changed, 1,169 insertions(+), 201 deletions(-) diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index c11cb59..4bd96bc 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -40,7 +40,7 @@ 39=Individual 40=Log-in failed, incorrect account number or password 41=Fail to send the verification code -42=Network error +42=Disconnected from gateway 43=Fail to sign up, please try again. 44=Confirm resetting 45=The account number does not exist, please make sure it is registered. @@ -529,6 +529,7 @@ 541=Monitoring 542=Wandering alarm 543=Get more +544=Angle 1000=Room Humidity @@ -1209,7 +1210,7 @@ 39=涓汉 40=鐧诲綍澶辫触锛岃处鍙锋垨瀵嗙爜閿欒銆� 41=楠岃瘉鐮佸彂閫佸け璐ャ�� -42=缃戠粶寮傚父 +42=涓庣綉鍏虫柇寮�浜嗚繛鎺� 43=娉ㄥ唽澶辫触锛岃閲嶈瘯銆� 44=纭閲嶇疆 45=璐﹀彿涓嶅瓨鍦�,璇风‘璁よ处鍙锋槸鍚︽敞鍐屻�� @@ -1694,6 +1695,7 @@ 541=鐩戞帶涓� 542=寰樺緤鎶ヨ 543=鑾峰彇鏇村 +544=瑙掑害 1000=瀹ゅ唴婀垮害 1001=绔ラ攣 @@ -2350,7 +2352,7 @@ 39=袠薪写懈胁懈写褍邪谢褜薪褘泄 40=袧械褍褋锌械褕薪邪褟 邪胁褌芯褉懈蟹邪褑懈褟, 薪械胁械褉薪邪 褍褔械褌薪邪褟 蟹邪锌懈褋褜 懈谢懈 锌邪褉芯谢褜 41=袧械 褍写邪谢芯褋褜 芯褌锌褉邪胁懈褌褜 锌褉芯胁械褉芯褔薪褘泄 泻芯写 -42=袨褕懈斜泻邪 褋械褌懈 +42=Disconnected from gateway 43=袧械 褍写邪谢芯褋褜 蟹邪褉械谐懈褋褌褉懈褉芯胁邪褌褜褋褟 44=袩芯写褌胁械褉写懈褌械 褋斜褉芯褋 45=校褔械褌薪邪褟 蟹邪锌懈褋褜 薪械 褋褍褖械褋褌胁褍械褌, 锌褉芯胁械褉褜褌械 褔褌芯 芯薪邪 蟹邪褉械谐懈褋褌褉懈褉芯胁邪薪邪 @@ -2834,6 +2836,7 @@ 541=Monitoring 542=Wandering alarm 543=Get more +544=Angle 1000=袙谢邪卸薪芯褋褌褜 胁 袩芯屑械褖械薪懈懈 @@ -3500,7 +3503,7 @@ 39=Individual 40=Inicio de sesi贸n fallido, n煤mero de cuenta o contrase帽a incorrectos 41=Error al enviar el codigo de verificaci贸n -42=Error de red +42=Disconnected from gateway 43=Error en el registo, int茅ntelo de nuevo 44=Confirmar reinicio 45=El numero de cuenta no existe, por favor aseg煤rese de estar registrado @@ -3990,6 +3993,7 @@ 541=Monitoring 542=Wandering alarm 543=Get more +544=Angle 1000=Humedad de ambiente 1001=V-chip diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/FloorHeating/EconomicIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/FloorHeating/EconomicIcon.png new file mode 100644 index 0000000..0848837 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/FloorHeating/EconomicIcon.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/FloorHeating/EconomicIconGray.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/FloorHeating/EconomicIconGray.png new file mode 100644 index 0000000..74300b8 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/FloorHeating/EconomicIconGray.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/Public/ThumbImage2.png b/HDL-ON_Android/Assets/Phone/Public/ThumbImage2.png new file mode 100644 index 0000000..0639f3b --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/Public/ThumbImage2.png Binary files differ diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj index 933d606..08dd1f0 100644 --- a/HDL-ON_Android/HDL-ON_Android.csproj +++ b/HDL-ON_Android/HDL-ON_Android.csproj @@ -243,8 +243,11 @@ <AndroidAsset Include="Assets\Phone\FunctionIcon\Panel\PanelHelpNormalBgIcon.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\screenpanel.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Panel\PanelEnviBg.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\FloorHeating\EconomicIcon.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\FloorHeating\EconomicIconGray.png" /> <AndroidAsset Include="Assets\Phone\MusicIcon\order.png" /> <AndroidAsset Include="Assets\Phone\MusicIcon\single_cycle.png" /> + <AndroidAsset Include="Assets\Phone\Public\ThumbImage2.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 eabdc56..fef2fce 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.6" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202205241"> +<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="202206291"> <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> <!--鍙嬬洘--> <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>--> @@ -88,7 +88,7 @@ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.READ_LOGS" /> <!-- 鏋佸厜鎺ㄩ�佺粨鏉� --> - <application android:allowBackup="true" android:debuggable="false" android:icon="@drawable/Icon" android:networkSecurityConfig="@xml/network_security_config" android:largeHeap="true" android:label="On Pro"> + <application android:allowBackup="true" android:debuggable="false" android:icon="@drawable/Icon" android:requestLegacyExternalStorage="true" android:networkSecurityConfig="@xml/network_security_config" android:largeHeap="true" android:label="On Pro"> <!--/鎵弿浜岀淮鐮乤ctivity--> <!--<activity android:name="com.journeyapps.barcodescanner.CaptureActivity" diff --git a/HDL-ON_Android/SplashActivity.cs b/HDL-ON_Android/SplashActivity.cs index ac78c22..3c6626e 100644 --- a/HDL-ON_Android/SplashActivity.cs +++ b/HDL-ON_Android/SplashActivity.cs @@ -46,6 +46,8 @@ { base.OnCreate(savedInstanceState); + + //Intent i = new Intent(this, typeof(BaseActivity));//Intent intent=new Intent( 璧峰缁勪欢瀵硅薄 , 鐩爣 Service.class); //StartActivityForResult(i, 1); //OverridePendingTransition(0, 0); @@ -107,6 +109,9 @@ BaseActivity.KeepScreenON = false; //闅愯棌铏氭嫙鎸夐敭 BaseActivity.IsHideVirualButtons = true; + + + //瀹炵幇瀹夊崜杩斿洖鎸夐敭 BaseActivity.BackKeyAction = () => { @@ -138,6 +143,7 @@ Language.CurrentLanguage = "Chinese"; Locale locale1 = Locale.Default; var localeList = Resources.Configuration.Locale; + Console.WriteLine("999999999999999999999999999999999999999999999"+ localeList.Language); if (localeList.Language == "zh") { Language.CurrentLanguage = "Chinese"; @@ -145,6 +151,10 @@ else if(localeList.Language == "es") { Language.CurrentLanguage = "Spanish"; + } + else if (localeList.Language == "ru") + { + Language.CurrentLanguage = "russian"; } else { @@ -175,6 +185,26 @@ }; BaseActivity.RefreshUIAction = (activity) => { + Language.CurrentLanguage = "Chinese"; + Locale locale1 = Locale.Default; + var localeList = Resources.Configuration.Locale; + Console.WriteLine("999999999999999999999999999999999999999999999" + localeList.Language); + if (localeList.Language == "zh") + { + Language.CurrentLanguage = "Chinese"; + } + else if (localeList.Language == "es") + { + Language.CurrentLanguage = "Spanish"; + } + else if (localeList.Language == "ru") + { + Language.CurrentLanguage = "russian"; + } + else + { + Language.CurrentLanguage = "English"; + } MainPage.Show(); checkSomeInfo(); }; diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj index c72dc16..78e6c1e 100644 --- a/HDL-ON_iOS/HDL-ON_iOS.csproj +++ b/HDL-ON_iOS/HDL-ON_iOS.csproj @@ -1406,6 +1406,7 @@ <BundleResource Include="Resources\Phone\FunctionIcon\Panel\PanelEnviBg.png" /> <BundleResource Include="Resources\Phone\MusicIcon\order.png" /> <BundleResource Include="Resources\Phone\MusicIcon\single_cycle.png" /> + <BundleResource Include="Resources\Phone\Public\ThumbImage2.png" /> </ItemGroup> <ItemGroup> <ITunesArtwork Include="iTunesArtwork" /> diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist index bdc5402..9c3d4b3 100644 --- a/HDL-ON_iOS/Info.plist +++ b/HDL-ON_iOS/Info.plist @@ -100,9 +100,9 @@ <key>UIStatusBarStyle</key> <string>UIStatusBarStyleLightContent</string> <key>CFBundleShortVersionString</key> - <string>1.5.502205201</string> + <string>1.5.502206271</string> <key>CFBundleVersion</key> - <string>1.5.505201</string> + <string>1.5.506271</string> <key>NSLocationWhenInUseUsageDescription</key> <string>Use geographic location to provide services such as weather</string> <key>NSAppleMusicUsageDescription</key> diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini index fc701ae..55ffaab 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -40,7 +40,7 @@ 39=Individual 40=Log-in failed, incorrect account number or password 41=Fail to send the verification code -42=Network error +42=Disconnected from gateway 43=Fail to sign up, please try again. 44=Confirm resetting 45=The account number does not exist, please make sure it is registered. @@ -529,6 +529,7 @@ 541=Monitoring 542=Wandering alarm 543=Get more +544=Angle 1000=Room Humidity @@ -738,7 +739,7 @@ 5015=Bluetooth 5016=Line input 5017=Revise the name -5018=Single loop +5018=Single loop 5019=Random play 5020=List 5021=Has shifted to @@ -770,6 +771,7 @@ 5047="QQ music" has not installed in your cell phone, please proceed in App center. 5048= Progressive cycle 5049=Single play + 6000=normal 6001=Device status @@ -1054,6 +1056,7 @@ + 9000=Please sign in with new cell phone number. 9001=Please sign in with new email address. @@ -1206,7 +1209,7 @@ 39=涓汉 40=鐧诲綍澶辫触锛岃处鍙锋垨瀵嗙爜閿欒銆� 41=楠岃瘉鐮佸彂閫佸け璐ャ�� -42=缃戠粶寮傚父 +42=涓庣綉鍏虫柇寮�浜嗚繛鎺� 43=娉ㄥ唽澶辫触锛岃閲嶈瘯銆� 44=纭閲嶇疆 45=璐﹀彿涓嶅瓨鍦�,璇风‘璁よ处鍙锋槸鍚︽敞鍐屻�� @@ -1691,6 +1694,7 @@ 541=鐩戞帶涓� 542=寰樺緤鎶ヨ 543=鑾峰彇鏇村 +544=瑙掑害 1000=瀹ゅ唴婀垮害 1001=绔ラ攣 @@ -1932,7 +1936,7 @@ 5046=璋冭妭闊抽噺 5047=浣犳墜鏈烘殏鏈畨瑁�"QQ闊充箰"{\r\n}璇峰墠寰�鎵嬫満鍟嗗満瀹夎 5048=寰簭寰幆 -5049=鍗曟洸寰幆 +5049=鍗曟洸鎾斁 6000=姝e父 @@ -2347,7 +2351,7 @@ 39=袠薪写懈胁懈写褍邪谢褜薪褘泄 40=袧械褍褋锌械褕薪邪褟 邪胁褌芯褉懈蟹邪褑懈褟, 薪械胁械褉薪邪 褍褔械褌薪邪褟 蟹邪锌懈褋褜 懈谢懈 锌邪褉芯谢褜 41=袧械 褍写邪谢芯褋褜 芯褌锌褉邪胁懈褌褜 锌褉芯胁械褉芯褔薪褘泄 泻芯写 -42=袨褕懈斜泻邪 褋械褌懈 +42=Disconnected from gateway 43=袧械 褍写邪谢芯褋褜 蟹邪褉械谐懈褋褌褉懈褉芯胁邪褌褜褋褟 44=袩芯写褌胁械褉写懈褌械 褋斜褉芯褋 45=校褔械褌薪邪褟 蟹邪锌懈褋褜 薪械 褋褍褖械褋褌胁褍械褌, 锌褉芯胁械褉褜褌械 褔褌芯 芯薪邪 蟹邪褉械谐懈褋褌褉懈褉芯胁邪薪邪 @@ -2831,6 +2835,7 @@ 541=Monitoring 542=Wandering alarm 543=Get more +544=Angle 1000=袙谢邪卸薪芯褋褌褜 胁 袩芯屑械褖械薪懈懈 @@ -3497,7 +3502,7 @@ 39=Individual 40=Inicio de sesi贸n fallido, n煤mero de cuenta o contrase帽a incorrectos 41=Error al enviar el codigo de verificaci贸n -42=Error de red +42=Disconnected from gateway 43=Error en el registo, int茅ntelo de nuevo 44=Confirmar reinicio 45=El numero de cuenta no existe, por favor aseg煤rese de estar registrado @@ -3987,6 +3992,7 @@ 541=Monitoring 542=Wandering alarm 543=Get more +544=Angle 1000=Humedad de ambiente 1001=V-chip diff --git a/HDL-ON_iOS/Resources/Phone/Public/ThumbImage2.png b/HDL-ON_iOS/Resources/Phone/Public/ThumbImage2.png new file mode 100644 index 0000000..0639f3b --- /dev/null +++ b/HDL-ON_iOS/Resources/Phone/Public/ThumbImage2.png Binary files differ diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index a58eae0..21c027a 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -4,7 +4,10 @@ { public static class StringId { - + /// <summary> + /// 瑙掑害 + /// </summary> + public const int Angle = 544; /// <summary> /// 鑾峰彇鏇村 /// </summary> diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index 5672c7a..c5cd85e 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -280,7 +280,8 @@ } if (DB_ResidenceData.Instance.GatewayType == 0) { - new Control_Udp().ControlBytesSend(Command.ReadGateway, 255, 255, new byte[] { (byte)new Random().Next(255), (byte)new Random().Next(255) }); + new Control_Udp().ControlBytesSend(Command.ReadGateway, 255, 255, + new byte[] { (byte)new Random().Next(255), (byte)new Random().Next(255) }); } else if (DB_ResidenceData.Instance.GatewayType == 1) { @@ -1051,9 +1052,6 @@ } } } - - - var localFunction = allLocalFuntion.Find((obj) => obj.sid == updateTemp.sid); if (localFunction == null) diff --git a/HDL_ON/DAL/DriverLayer/Control_Udp.cs b/HDL_ON/DAL/DriverLayer/Control_Udp.cs index 6991ad8..e6eba3b 100644 --- a/HDL_ON/DAL/DriverLayer/Control_Udp.cs +++ b/HDL_ON/DAL/DriverLayer/Control_Udp.cs @@ -162,7 +162,6 @@ /// <summary> /// 鎺у埗bus鍦烘櫙 - /// todo /// </summary> public void ControlBusScenes(Scene scene) { diff --git a/HDL_ON/DAL/DriverLayer/Packet.cs b/HDL_ON/DAL/DriverLayer/Packet.cs index 3e07ff2..19e93d7 100644 --- a/HDL_ON/DAL/DriverLayer/Packet.cs +++ b/HDL_ON/DAL/DriverLayer/Packet.cs @@ -111,7 +111,6 @@ /// <summary> /// 鏁版嵁鍖呭鐞� - /// ps:鐢眂ommonpage杞Щ杩囨潵锛岃繕闇�瑕佽浆绉诲悎閫傜殑浣嶇疆绠$悊 /// </summary> /// <param name="subnetID"></param> /// <param name="deviceID"></param> diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs index 882cf3b..f5abbf2 100644 --- a/HDL_ON/DAL/Mqtt/MqttClient.cs +++ b/HDL_ON/DAL/Mqtt/MqttClient.cs @@ -483,7 +483,8 @@ { try { - var securityBytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, DB_ResidenceData.Instance.HomeGateway.aesKey); + var securityBytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, + DB_ResidenceData.Instance.HomeGateway.aesKey); var securityString = Encoding.UTF8.GetString(securityBytes); var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityStatusObj>(securityString); MainPage.Log($"瀹夐槻鐘舵�佸彉鍖栵細{securityString}"); @@ -519,7 +520,6 @@ MainPage.Log($"mqtt 鐘舵�佹洿鏂�:{revString}"); Control.Ins.UpdataFunctionStatus(revString, null, true); //Control.Ins.MsgInfoList.Add($"mqtt 鐘舵�佹洿鏂�:{revString}"); - //Control.Ins.MsgInfoList.Add(revString + "\r\n"); } //涓�绔彛鏁版嵁瑙f瀽 @@ -532,7 +532,8 @@ if (!string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.aesKey)) { - packet.Bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, DB_ResidenceData.Instance.HomeGateway.aesKey); + packet.Bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, + DB_ResidenceData.Instance.HomeGateway.aesKey); } else { diff --git a/HDL_ON/DAL/Server/NewAPI.cs b/HDL_ON/DAL/Server/NewAPI.cs index b569143..817e699 100644 --- a/HDL_ON/DAL/Server/NewAPI.cs +++ b/HDL_ON/DAL/Server/NewAPI.cs @@ -587,7 +587,7 @@ /// <summary> /// 绾㈠瀹濅笅鐨勯仴鎺у櫒鍒楄〃 /// </summary> - public const string API_POST_Ir_List = ":/home-wisdom/app/device/ir/list"; + public const string API_POST_Ir_List = "/home-wisdom/app/device/ir/list"; /// <summary> /// 閬ユ帶鍣ㄧ孩澶栫爜瀛︿範 /// </summary> diff --git a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs index abbdbd3..5a6cd33 100644 --- a/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs +++ b/HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs @@ -457,6 +457,8 @@ mHDLCallVideoInfo.DeviceSipAccount = mESVideoInfo.deviceSipAccount; InitCallInfo(mHDLCallVideoInfo); + + if (isHdlLinphone) { //褰撳墠鍛煎彨鏉ョ數鐨勪綇瀹呭拰涔嬪墠娉ㄥ唽鐧诲綍鐨勪綇瀹呬竴鑷寸殑鎯呭喌涓� @@ -539,7 +541,8 @@ var intent = new Intent(Shared.Application.Activity, typeof(Com.Hdl.Hdllinphonesdk.Activity.HDLLinphoneIntercomActivity)); if (mHDLCallVideoInfo != null) { - intent.PutExtra(HDLLinphoneKit.KeyTitleName, mHDLCallVideoInfo.DeviceName); + //intent.PutExtra(HDLLinphoneKit.KeyTitleName, mHDLCallVideoInfo.DeviceName); + intent.PutExtra(HDLLinphoneKit.KeyTitleName, mHDLCallVideoInfo.CallId); } Shared.Application.Activity.StartActivity(intent); #endif diff --git a/HDL_ON/Entity/DB_ResidenceData.cs b/HDL_ON/Entity/DB_ResidenceData.cs index 7e9c6f8..e05e640 100644 --- a/HDL_ON/Entity/DB_ResidenceData.cs +++ b/HDL_ON/Entity/DB_ResidenceData.cs @@ -453,6 +453,10 @@ #endregion + /// <summary> + /// 鍦烘櫙绛涢�夋椂锛岄�夋嫨鐨勬埧闂� + /// </summary> + public string sceneChooseRoomId = ""; /// <summary> diff --git a/HDL_ON/Entity/Function/FloorHeating.cs b/HDL_ON/Entity/Function/FloorHeating.cs index 30ef6c0..1eb0352 100644 --- a/HDL_ON/Entity/Function/FloorHeating.cs +++ b/HDL_ON/Entity/Function/FloorHeating.cs @@ -150,6 +150,26 @@ /// </summary> public byte timeFlag = 0; + public string GetWrokModeIconPath(string value, bool lighting = true) + { + var imagePath = "FunctionIcon/AC/HeatingIcon.png"; + + switch (value) + { + case "heat": + imagePath = lighting ? "FunctionIcon/AC/HeatingIcon.png" : "FunctionIcon/AC/HeatingIconGray.png"; + break; + case "cool": + imagePath = lighting ? "FunctionIcon/AC/CoolIcon.png" : "FunctionIcon/AC/CoolIconGray.png"; + break; + case "economic": + imagePath = lighting ? "FunctionIcon/FloorHeating/EconomicIcon.png" : "FunctionIcon/FloorHeating/EconomicIconGray.png"; + break; + } + + return imagePath; + } + /// <summary> /// 鑾峰彇妯″紡鐨刬con璺緞 /// <param name="lightingIcon">鑾峰彇鐨勫浘鏍囩被鍨嬶紝榛樿鏄偣浜�</param> diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index a142825..747df45 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -361,7 +361,7 @@ switch (key) { case "pm2.5": - + // break; } } @@ -1196,14 +1196,19 @@ public string loopId; } - + /// <summary> + /// Tag 鍔熻兘SPK + /// </summary> public static class SPK { /// <summary> /// 闂ㄩ攣 /// </summary> public const string DoorLock = "security.door"; - + /// <summary> + /// 闂ㄩ攣spk鍒楄〃 + /// </summary> + /// <returns></returns> public static List<string> GetDoorLockSPKList() { var list = new List<string>(); @@ -1267,6 +1272,10 @@ /// 锛堝嵎甯橈級 /// </summary> public const string CurtainRoller = "curtain.roller"; + /// <summary> + /// 姊﹀够甯� + /// </summary> + public const string CurtainDream = "curtain.dream"; /// <summary> /// 绐楀笜spk鍒楄〃 @@ -1279,6 +1288,7 @@ spkList.Add(CurtainSwitch); spkList.Add(CurtainShades); spkList.Add(CurtainTrietex); + spkList.Add(CurtainDream); return spkList; } #endregion diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs index 86309f8..2f2d49c 100644 --- a/HDL_ON/Entity/Function/Scene.cs +++ b/HDL_ON/Entity/Function/Scene.cs @@ -540,6 +540,10 @@ public int min = 0; /// <summary> + /// 灞炴�х殑鍊煎垪琛� + /// </summary> + public List<string> valueList = new List<string>(); + /// <summary> /// 灞炴�у悕绉版樉绀烘枃鏈� /// 涓嫳鏂囨樉绀� /// </summary> @@ -581,6 +585,9 @@ case FunctionAttributeKey.FadeTime: text = Language.StringByID(StringId.FadeSpeed); break; + case "angle": + text = Language.StringByID(StringId.Angle); + break; } return text; } diff --git a/HDL_ON/Entity/Function/Sensor.cs b/HDL_ON/Entity/Function/Sensor.cs index f07f304..0ad5cc8 100644 --- a/HDL_ON/Entity/Function/Sensor.cs +++ b/HDL_ON/Entity/Function/Sensor.cs @@ -161,7 +161,7 @@ { if (function.spk.Replace(".", "").Contains(attrKey.key.Replace(".", ""))) { - if (string.IsNullOrEmpty(attrKey.unit)) + if (!string.IsNullOrEmpty(attrKey.unit)) return attrKey.unit; } } diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems index 948c13d..d4c650b 100644 --- a/HDL_ON/HDL_ON.projitems +++ b/HDL_ON/HDL_ON.projitems @@ -499,6 +499,7 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ContentView\FhContentView.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ContentView\AcContentView.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\WanderingAlarmPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Curtain\CurtainDreamPage.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" /> diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs index b9b9bb8..71591b3 100644 --- a/HDL_ON/UI/MainPage.cs +++ b/HDL_ON/UI/MainPage.cs @@ -26,7 +26,7 @@ /// <summary> /// 鐗堟湰鍙� /// </summary> - public static string VersionString = "1.5.6"; + public static string VersionString = "1.5.9"; ///// <summary> ///// 瀹㈡埛绔被鍨� ///// </summary> @@ -105,7 +105,7 @@ /// </summary> public static List<string> SceneSupportFunctionList = new List<string> { SPK.LightCCT,SPK.LightDimming,SPK.LightSwitch,SPK.LightRGB, - SPK.CurtainRoller,SPK.CurtainSwitch,SPK.CurtainTrietex, + SPK.CurtainRoller,SPK.CurtainSwitch,SPK.CurtainTrietex,SPK.CurtainDream, SPK.AcIr,SPK.AcStandard,SPK.HvacAC, SPK.FloorHeatStandard,SPK.HvacFloorHeat, SPK.AirFreshStandard,SPK.HvacAirFresh, diff --git a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs index 736410b..cc2d317 100644 --- a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs +++ b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs @@ -62,6 +62,12 @@ rollingShutterView.LoadPage(btnCollectionIcon, btnName, btnFromFloor); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; break; + case SPK.CurtainDream: + var curtainDreamView = new CurtainDreamPage(function); + MainPage.BasePageView.AddChidren(curtainDreamView); + curtainDreamView.LoadPage(btnCollectionIcon, btnName, btnFromFloor); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + break; case SPK.FloorHeatStandard: case SPK.HvacFloorHeat: var fhView = new FloorHeatingPage(function); diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs index fc4e748..d4c6a4c 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs @@ -566,6 +566,17 @@ #if DEBUG + FunctionList.List.Functions.Add(new Function + { + name = "娴嬭瘯姊﹀够绐楀笜", + spk = SPK.CurtainDream, + sid = "1234577", + attributes = new List<FunctionAttributes> { + new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, + new FunctionAttributes(){ key = "percent",curValue= "100",state = "100" }, + new FunctionAttributes(){ key = "angle",curValue= "0",state = "0" }, + } + }); //FunctionList.List.Functions.Add(new Function //{ @@ -627,28 +638,28 @@ // }, //}); - FunctionList.List.Functions.Add(new Function() - { - spk = SPK.SensorPm25, - name = "娴嬭瘯Pm2.5", - attributes = new List<FunctionAttributes>() - { - new FunctionAttributes(){ key = "pm25",curValue= "70",state = "70" }, - }, - attrKeyConfigs = new List<AttrKeyConfig>() - { - new AttrKeyConfig (){ - key = "pm2.5", - type = "interval" , - unit = "ug/m虏", - configs = new List<AttrKeyInfo>(){ - new AttrKeyInfo(){ start = "0",end = "75",color = "0xFFADE764", desc = "鑹ソ"}, - new AttrKeyInfo(){ start = "76",end = "150",color = "0xFFFFD154",desc = "杞�/涓害姹℃煋"}, - new AttrKeyInfo(){ start = "151",end = "500",color = "0xFFFF9D54",desc = "閲嶅害/涓ラ噸姹℃煋"}, - } - } - }, - }); + //FunctionList.List.Functions.Add(new Function() + //{ + // spk = SPK.SensorPm25, + // name = "娴嬭瘯Pm2.5", + // attributes = new List<FunctionAttributes>() + // { + // new FunctionAttributes(){ key = "pm25",curValue= "70",state = "70" }, + // }, + // attrKeyConfigs = new List<AttrKeyConfig>() + // { + // new AttrKeyConfig (){ + // key = "pm2.5", + // type = "interval" , + // unit = "ug/m虏", + // configs = new List<AttrKeyInfo>(){ + // new AttrKeyInfo(){ start = "0",end = "75",color = "0xFFADE764", desc = "鑹ソ"}, + // new AttrKeyInfo(){ start = "76",end = "150",color = "0xFFFFD154",desc = "杞�/涓害姹℃煋"}, + // new AttrKeyInfo(){ start = "151",end = "500",color = "0xFFFF9D54",desc = "閲嶅害/涓ラ噸姹℃煋"}, + // } + // } + // }, + //}); //FunctionList.List.Functions.Add(new Function() //{ @@ -1151,10 +1162,8 @@ }; view.AddChidren(btnIcon); - btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_blue.png"; btnIcon.SelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_white.png"; - Button btnName; btnName = new Button() @@ -1226,6 +1235,7 @@ LoadEvent_FunctionCollection(btnCollection, function); if (//SPK.CurtainSpkList().Contains(function.spk)) function.spk == SPK.CurtainRoller || function.spk == SPK.CurtainShades || + function.spk == SPK.CurtainDream || function.spk == SPK.CurtainSwitch || function.spk == SPK.CurtainTrietex ) { btnIcon.UnSelectedImagePath = "FunctionIcon/Curtain/CurtainIcon.png"; diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs index d243d7d..422e4b2 100644 --- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs +++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs @@ -159,32 +159,32 @@ }; dimmerControlBar.OnProgressChangedEvent = (sender, e) => { dimmerControlBar.ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1; - //light.brightness = e; - //light.trait_on_off.curValue = e > 0 ? "on" : "off"; + function.SetAttrState(FunctionAttributeKey.Brightness, e); + function.trait_on_off.curValue = e > 0 ? "on" : "off"; - //if (e == 0 || e == 100) - //{ - // //Control.Send(CommandType_A.write, light); - // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - // d.Add("brightness", light.brightness.ToString()); - // Control.Ins.SendWriteCommand(light, d); - //} - //else - //{ - // var tm = (DateTime.Now - light.refreshTime).TotalMilliseconds; - // Console.WriteLine("skip time "+tm); - // if (300 < tm) - // { - // light.refreshTime = DateTime.Now; - // new System.Threading.Thread(() => - // { - // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - // d.Add("brightness", light.brightness.ToString()); - // Control.Ins.SendWriteCommand(light, d); - // }) - // { IsBackground = true }.Start(); - // } - //} + if (e == 0 || e == 100) + { + //Control.Send(CommandType_A.write, light); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add("brightness", e.ToString()); + Control.Ins.SendWriteCommand(function, d); + } + else + { + var tm = (DateTime.Now - function.refreshTime).TotalMilliseconds; + Console.WriteLine("skip time " + tm); + if (500 < tm) + { + function.refreshTime = DateTime.Now; + new System.Threading.Thread(() => + { + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add("brightness", e.ToString()); + Control.Ins.SendWriteCommand(function, d); + }) + { IsBackground = true }.Start(); + } + } }; } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs index 33d43d1..c988fc3 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs @@ -631,7 +631,6 @@ functionTypeList.Add(SPK.HvacCac); functionTypeList.Add(SPK.SensorHelp); functionTypeList.Add(SPK.DoorLock); - } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs index df83a81..0196aa6 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs @@ -98,6 +98,7 @@ public void LoadPage(Action backRefresh) { + //DB_ResidenceData.Instance.sceneChooseRoomId new TopViewDiv(bodyView, Language.StringByID(StringId.EditScene)).LoadTopView(backRefresh); initPage(); } @@ -481,6 +482,13 @@ scene.functions.Remove(scenefunction); continue; } + //灏唖pk瀹炰綋閲岄潰鐨刴in max鍊兼斁鍏ュ満鏅姛鑳藉疄浣撻噷锛岃涓嶇劧鏁版嵁浼氫涪澶� 2022-06-21 16:06:45 + foreach (var tt in scenefunction.status) { + tt.min = scenefunction.localFunction.GetAttribute(tt.key).min; + tt.max = scenefunction.localFunction.GetAttribute(tt.key).max; + tt.valueList = scenefunction.localFunction.GetAttribute(tt.key).value; + } + i++; var row = new RowLayout() { diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs index 5f4966d..cc40903 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs @@ -156,9 +156,39 @@ { unallocatedList.Add(function); } + + } + if (string.IsNullOrEmpty(DB_ResidenceData.Instance.sceneChooseRoomId)) + { + LoadFunctionListRow(null); + } + else + { + var selectedRoom = Room.CurrentSpatial.RoomList.Find((obj) => obj.uid == DB_ResidenceData.Instance.sceneChooseRoomId); + if (selectedRoom == null) + { + LoadFunctionListRow(null); + } + else + { + + var listAllFun = new List<Function>(); + var listFun = new List<Function>(); + listAllFun.AddRange(unallocatedList); + listAllFun.AddRange(allocatedList); + + btnFloor.Text = selectedRoom.floorRoomName; + foreach (var funtion in listAllFun) + { + if (funtion.roomIds.Contains(selectedRoom.roomId)) + { + listFun.Add(funtion); + } + } + LoadFunctionListRow(listFun); + } } - LoadFunctionListRow(null); LoadEventList(); } @@ -278,6 +308,7 @@ form.ShowDeviceFunctionView(btnFloor, listAllFun, (selectId, listFun) => { nowSelectId = selectId; + DB_ResidenceData.Instance.sceneChooseRoomId = selectId; //閲嶆柊鍒锋柊璁惧鍒楄〃 this.LoadFunctionListRow(listFun); }, nowSelectId); diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs index 97d6306..b82e1f8 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs @@ -70,6 +70,9 @@ case FunctionAttributeKey.RGB: LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.RGB)); break; + case "angle"://瑙掑害 + LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == "angle")); + break; } } @@ -353,6 +356,10 @@ case FunctionAttributeKey.FadeTime: break; + case "angle": + //鍛堢幇鐨勫脊绐� + + break; case "cct": LoadEditDialog_CCT(sceneStatus, btnFunctionText); break; diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs index 58570c9..e4382e4 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs @@ -573,7 +573,9 @@ }) { IsBackground = true }.Start(); } - catch { } + catch (Exception ex) { + MainPage.Log(ex.Message); + } } diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs index b05b80e..100e277 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs @@ -36,6 +36,11 @@ /// </summary> Button btnMode; /// <summary> + /// 宸ヤ綔妯″紡鎸夐挳 + /// </summary> + Button btnWrokMode; + + /// <summary> /// 寮�鍏虫寜閽� /// </summary> Button btnSwitch; @@ -172,6 +177,25 @@ }; FrameWhiteCentet1.AddChidren(btnPlus); + if (device.GetAttribute("mode_work") != null) + { + btnWrokMode = new Button() + { + X = Application.GetRealWidth(60), + Y = Application.GetRealHeight(334), + Width = Application.GetRealWidth(30), + Height = Application.GetRealWidth(30), + UnSelectedImagePath = fhTemp.GetWrokModeIconPath(device.GetAttrState("mode_work")), + }; + FrameWhiteCentet1.AddChidren(btnWrokMode); + if (device.GetAttribute("mode_work").value.Count > 1) + { + btnMode.MouseUpEventHandler = (sender, e) => + { + LoadDiv_ChangeModeView(); + }; + } + } if (device.GetAttribute(FunctionAttributeKey.Mode) != null) { btnMode = new Button() @@ -208,6 +232,135 @@ LoadEvent_AcStatesChange(); } + + + /// <summary> + /// 鍔犺浇淇敼妯″紡鍖哄煙 + /// </summary> + void LoadDiv_ChangeWorkModeView() + { + Dialog dialog = new Dialog(); + + FrameLayout dialogView = new FrameLayout() + { + BackgroundColor = CSS_Color.DialogTransparentColor1, + }; + dialog.AddChidren(dialogView); + + FrameLayout modeChangeView; + modeChangeView = new FrameLayout() + { + X = Application.GetRealWidth(30), + Y = Application.GetRealHeight(128), + Width = Application.GetRealWidth(160), + Height = Application.GetRealHeight(287), + BackgroundImagePath = "FunctionIcon/AC/DivBg1.png", + }; + dialogView.AddChidren(modeChangeView); + + Button btnTitle; + btnTitle = new Button() + { + X = Application.GetRealWidth(8 + 16), + Y = Application.GetRealHeight(8), + Width = Application.GetRealWidth(112), + Height = Application.GetRealHeight(44), + TextID = StringId.ChooseMode, + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.EmphasisFontSize_Secondary, + }; + modeChangeView.AddChidren(btnTitle); + + Button btnLine = new Button() + { + X = btnTitle.X, + Y = btnTitle.Bottom, + Width = Application.GetRealWidth(112), + Height = Application.GetRealHeight(1), + BackgroundColor = CSS_Color.BackgroundColor, + }; + modeChangeView.AddChidren(btnLine); + + var modeList = device.GetAttribute(FunctionAttributeKey.WorkMode).value; + foreach (var m in modeList) + { + Button btnModeIcon = new Button() + { + X = btnTitle.X, + Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8), + Width = Application.GetRealWidth(24), + Height = Application.GetRealWidth(24), + IsSelected = device.GetAttrState(FunctionAttributeKey.WorkMode) == m, + }; + modeChangeView.AddChidren(btnModeIcon); + + Button btnModeText = new Button() + { + X = Application.GetRealWidth(12) + btnModeIcon.Right, + Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 8), + Height = Application.GetRealHeight(44), + Width = Application.GetRealWidth(90), + TextAlignment = TextAlignment.CenterLeft, + TextColor = CSS_Color.FirstLevelTitleColor, + SelectedTextColor = CSS_Color.MainColor, + IsSelected = device.GetAttrState(FunctionAttributeKey.Mode) == m, + TextSize = CSS_FontSize.TextFontSize, + }; + modeChangeView.AddChidren(btnModeText); + + btnModeIcon.UnSelectedImagePath = fhTemp.GetModeIconPath(m, false); + btnModeIcon.SelectedImagePath = fhTemp.GetModeIconPath(m); + btnModeText.Text = fhTemp.GetModeAttrText(m); + + if (modeList.IndexOf(m) < modeList.Count - 1) + { + modeChangeView.AddChidren(new Button() + { + X = btnTitle.X, + Y = btnModeText.Bottom, + Width = Application.GetRealWidth(112), + Height = Application.GetRealHeight(1), + BackgroundColor = CSS_Color.BackgroundColor, + }); + } + EventHandler<MouseEventArgs> eventHandler = (sender, e) => + { + dialog.Close(); + }; + EventHandler<MouseEventArgs> eventHandler1 = (sender, e) => + { + //if (!device.online) + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + //} + btnModeIcon.IsSelected = btnModeText.IsSelected = true; + device.SetAttrState(FunctionAttributeKey.WorkMode, m); + btnMode.UnSelectedImagePath = fhTemp.GetWrokModeIconPath(m); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + btnMode.UnSelectedImagePath = btnModeIcon.UnSelectedImagePath; + d.Add(FunctionAttributeKey.WorkMode, m); + Control.Ins.SendWriteCommand(device, d); + dialog.Close(); + + }; + btnModeIcon.MouseUpEventHandler = eventHandler1; + btnModeText.MouseUpEventHandler = eventHandler1; + dialogView.MouseUpEventHandler = eventHandler; + + } + + dialogView.MouseUpEventHandler = (sender, e) => { + dialog.Close(); + }; + dialog.Show(); + } + /// <summary> /// 鍔犺浇淇敼妯″紡鍖哄煙 @@ -525,6 +678,15 @@ arcBar.IsClickable = false; arcBar.IsOffline = true; } + + if(btnWrokMode!=null){ + var dd = device.GetAttrState("mode_work"); + if (dd != "0") + { + btnWrokMode.UnSelectedImagePath = fhTemp.GetWrokModeIconPath(dd); + } + } + }); } diff --git a/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs index 1e56bf0..23b4816 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs @@ -1,5 +1,7 @@ 锘縰sing System; using System.Collections.Generic; +using HDL_ON.Common; +using HDL_ON.DAL.Server; using Shared; namespace HDL_ON.UI @@ -79,7 +81,37 @@ function.roomIds.Remove(room.roomId); //room.RemoveRoomFunction(function); } - function.UpdataRoomIds(); + //function.UpdataRoomIds(); + + new System.Threading.Thread(() => + { + try + { + var pack = ApiUtlis.Ins.HttpRequest.UpdataDevcieBindRoomInfo(function); + //鐩存帴淇濆瓨鏈湴锛� + function.SaveFunctionFile(); + if (pack.Code == StateCode.SUCCESS) + { + if (UI.RoomPage.bodyView != null) + { + Application.RunOnMainThread(() => + { + UI.RoomPage.bodyView.ReLoadPage(); + }); + } + } + else + { + IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); + } + } + catch (Exception ex){ + MainPage.Log("鎴块棿缁戝畾璁惧寮傚父" + ex.Message); + } + }) + { IsBackground = true }.Start(); + + if (function.roomIds.Count == Entity.SpatialInfo.CurrentSpatial.RoomList.Count) { btnChooseAll.IsSelected = true; diff --git a/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs new file mode 100644 index 0000000..58044ad --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs @@ -0,0 +1,543 @@ +锘縰sing System; +using HDL_ON.Entity; +using Shared; +using HDL_ON.Entity; +using HDL_ON.UI.CSS; +using System.Collections.Generic; +using HDL_ON.DriverLayer; + +namespace HDL_ON.UI +{ + public class CurtainDreamPage : FrameLayout + { + + #region 鎺т欢闆嗗悎 + static CurtainDreamPage bodyView; + /// <summary> + /// 鍔熻兘鍚嶇О鎸夐挳 + /// </summary> + Button btnFunctionName; + /// <summary> + /// 鎴块棿妤煎眰淇℃伅鎸夐挳 + /// </summary> + Button btnFromFoorAndRoom; + /// <summary> + /// 鏀惰棌鎸夐挳 + /// </summary> + Button btnCollection; + /// <summary> + /// 绐楀笜鍔ㄦ�佹帶浠� + /// </summary> + CurtainSeekBarOn curtainSeekBar; + /// <summary> + /// 杩涘害鍊� + /// </summary> + Button btnProgress; + + + /// <summary> + /// 绐楀笜鍏抽棴鎸夐挳 + /// </summary> + Button btnCurtainClose; + /// <summary> + /// 绐楀笜鍋滄鎸夐挳 + /// </summary> + Button btnCurtainStop; + /// <summary> + /// 绐楀笜鎵撳紑鎸夐挳 + /// </summary> + Button btnCurtainOpen; + #endregion + + #region 鍖哄煙鍙橀噺 + Entity.Curtain curtainTemp = new Entity.Curtain(); + + Function function; + Button btnCollection_Out; + Button btnFunctionName_Out; + Button btnFromFloor_Out; + /// <summary> + /// 鍒锋柊鏄剧ず淇℃伅 + /// </summary> + Action actionRefresh; + #endregion + /// <summary> + /// 姝e湪鎺у埗 + /// </summary> + bool onControl = false; + + public CurtainDreamPage(Function func) + { + bodyView = this; + function = func; + } + + public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut) + { + bodyView.BackgroundColor = CSS_Color.BackgroundColor; + btnCollection_Out = btnCollectionIcon; + btnFunctionName_Out = btnFunctionNameOut; + btnFromFloor_Out = btnFromFloorOut; + + + FrameLayout controlView = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(88), + Width = Application.GetRealWidth(327), + Height = Application.GetRealHeight(526), + BackgroundImagePath = "Public/Fragmentbg.png", + }; + bodyView.AddChidren(controlView); + + btnFunctionName = new Button() + { + X = Application.GetRealWidth(16), + Y = Application.GetRealHeight(14), + Width = Application.GetRealWidth(270), + Height = Application.GetRealHeight(37), + TextColor = CSS_Color.FirstLevelTitleColor, + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel, + Text = function.name, + }; + controlView.AddChidren(btnFunctionName); + + btnFromFoorAndRoom = new Button() + { + X = Application.GetRealWidth(16), + Y = btnFunctionName.Bottom, + Width = Application.GetRealWidth(270), + Height = Application.GetRealHeight(21), + TextColor = CSS_Color.PromptingColor1, + TextAlignment = TextAlignment.CenterLeft, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + Text = function.GetRoomListName() + }; + controlView.AddChidren(btnFromFoorAndRoom); + + btnCollection = new Button() + { + X = Application.GetRealWidth(273), + Y = Application.GetRealHeight(14), + Width = Application.GetMinRealAverage(40), + Height = Application.GetMinRealAverage(40), + SelectedImagePath = "Collection/CollectionIcon.png", + UnSelectedImagePath = "Collection/CollectionGrayIcon.png", + IsSelected = function.collect + }; + controlView.AddChidren(btnCollection); + //2020-12-16 濡傛灉鏄垚鍛橀殣钘忔敹钘忓姛鑳� + //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) + //{ + // controlView.AddChidren(btnCollection); + //} + + + btnProgress = new Button() + { + Y = Application.GetRealHeight(80), + Height = Application.GetRealHeight(50), + TextSize = CSS_FontSize.TextFontSize, + TextColor = CSS_Color.PromptingColor1, + Text = curtainTemp.GetPercent(function).ToString() + "%", + }; + controlView.AddChidren(btnProgress); + + + curtainSeekBar = new CurtainSeekBarOn() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(130), + Width = Application.GetRealWidth(250), + Height = Application.GetRealWidth(177), + Progress = curtainTemp.GetPercent(function), + ProgressTextColor = 0x00000000, + //IsInvertedProgress = true, + }; + controlView.AddChidren(curtainSeekBar); + + + int angleValut = Convert.ToInt32(function.GetAttrState("angle")); + var angleView = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(300),//414,璁捐鏁版嵁 + Width = Application.GetRealWidth(250), + Height = Application.GetRealWidth(30), + BackgroundColor = 0x00ff0000 + }; + controlView.AddChidren(angleView); + + List<Button> buttons = new List<Button>(); + for (int i = 0; i < 18; i++) + { + var btn = new Button() + { + X = Application.GetRealWidth(12 * i + 4), + Y = Application.GetRealHeight(5), + Width = Application.GetRealWidth(4), + Height = Application.GetRealHeight(20), + BackgroundColor = 0xFFDFE1E6, + }; + btn.SetRotation(angleValut); + angleView.AddChidren(btn); + buttons.Add(btn); + }; + + var btnAngle = new Button() + { + TextAlignment = TextAlignment.CenterRight, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextColor = CSS_Color.PromptingColor1, + Text = function.GetAttrState("angle") + "掳" + }; + angleView.AddChidren(btnAngle); + + var angleBar = new DiyImageSeekBar() + { + Width = Application.GetRealWidth(220), + Height = Application.GetRealHeight(30), + SeekBarViewHeight = Application.GetRealHeight(0), + ThumbImagePath = "Public/ThumbImage2.png", + ThumbImageHeight = Application.GetRealHeight(20), + ProgressBarColor = 0x00000000, + ProgressTextColor = 0x00000000, + ProgressTextSize = 0, + MaxValue = 180, + Progress = 90, + ProgressChangeDelayTime = 0 + }; + angleView.AddChidren(angleBar); + angleBar.OnProgressChangedEvent = (sender, e) => + { + float angle = (e - 90); + btnAngle.Text = angle + "掳"; + foreach (var btn in buttons) + { + btn.SetRotation(angle); Console.WriteLine(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) => + { + function.refreshTime = DateTime.Now; + new System.Threading.Thread(() => + { + Dictionary<string, string> dic = new Dictionary<string, string>(); + dic.Add("angle", e.ToString()); + Control.Ins.SendWriteCommand(function, dic); + }) + { IsBackground = true }.Start(); + }; + + + btnCurtainClose = new Button() + { + X = Application.GetRealWidth(84), + Y = Application.GetRealHeight(466), + Width = Application.GetMinRealAverage(32), + Height = Application.GetMinRealAverage(32), + UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png", + SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png", + }; + controlView.AddChidren(btnCurtainClose); + + btnCurtainStop = new Button() + { + X = Application.GetRealWidth(148), + Y = Application.GetRealHeight(466), + Width = Application.GetMinRealAverage(32), + Height = Application.GetMinRealAverage(32), + UnSelectedImagePath = "FunctionIcon/Curtain/CurtainStopIcon.png", + SelectedImagePath = "FunctionIcon/Curtain/CurtainStopOnIcon.png", + }; + controlView.AddChidren(btnCurtainStop); + + btnCurtainOpen = new Button() + { + X = Application.GetRealWidth(212), + Y = Application.GetRealHeight(466), + Width = Application.GetMinRealAverage(32), + Height = Application.GetMinRealAverage(32), + UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png", + SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png", + }; + controlView.AddChidren(btnCurtainOpen); + + LoadEventList(); + new TopViewDiv(bodyView, Language.StringByID(StringId.Curtain)).LoadTopView_FunctionTop(function, actionRefresh); + new System.Threading.Thread(() => + { + Control.Ins.SendReadCommand(function); + }) + { IsBackground = true }.Start(); + } + + /// <summary> + /// 鏇存柊绐楀笜 + /// </summary> + /// <param name="updateTemp"></param> + public static void UpdataState(Function updateTemp) + { + Application.RunOnMainThread((Action)(() => + { + if (bodyView == null) + return; + if (bodyView.onControl) + return; + if (updateTemp.spk == bodyView.function.spk && updateTemp.sid == bodyView.function.sid) + { + try + { + if (!bodyView.onCurtainAnimation) + { + bodyView.CurtainAnimation(Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.Percent))); + } + } + catch { } + } + })); + } + + /// <summary> + /// 姝e湪鎵ц绐楀笜鍔ㄧ敾 + /// </summary> + bool onCurtainAnimation = false; + /// <summary> + /// 绐楀笜鍔ㄧ敾 + /// </summary> + /// <param name="progress"></param> + void CurtainAnimation(int progress) + { + onCurtainAnimation = true; + //杩愯鏂瑰悜 鎵撳紑锛堝姞杩涘害锛夛細鍏抽棴锛堝噺杩涘害锛� + bool runningDirection = progress > curtainSeekBar.Progress; + int curBarProgress = curtainSeekBar.Progress; + btnProgress.Text = progress + "%"; + new System.Threading.Thread(() => + { + try + { + while (progress != curBarProgress && onCurtainAnimation) + { + Application.RunOnMainThread(() => + { + if (runningDirection) + { + if (curtainSeekBar.Progress + 5 > progress) + { + curtainSeekBar.Progress = progress; + } + else + { + curtainSeekBar.Progress = curtainSeekBar.Progress + 5; + } + } + else + { + if (curtainSeekBar.Progress - 5 < progress) + { + curtainSeekBar.Progress = progress; + } + else + { + curtainSeekBar.Progress = curtainSeekBar.Progress - 5; + } + } + curBarProgress = curtainSeekBar.Progress; + }); + System.Threading.Thread.Sleep(100); + } + } + catch { } + finally + { + new System.Threading.Thread(() => + { + System.Threading.Thread.Sleep(3000); + onCurtainAnimation = false; + }) + { IsBackground = true, Priority = System.Threading.ThreadPriority.Lowest }.Start(); + } + }).Start(); + } + + + /// <summary> + /// 鍔犺浇浜嬩欢鍒楄〃 + /// </summary> + void LoadEventList() + { + LoadEvent_ControlEvent(); + LoadCollectionEvent(); + + //鍥為��鍒锋柊淇℃伅浜嬩欢 + actionRefresh = () => + { + btnFunctionName.Text = btnFunctionName_Out.Text = function.name; + btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName(); + //function.SaveFunctionData(true); + }; + } + /// <summary> + /// 鏀惰棌鍔熻兘鎸夐挳浜嬩欢 + /// </summary> + void LoadCollectionEvent() + { + btnCollection.MouseUpEventHandler += (sender, e) => + { + btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected; + function.CollectFunction(); + }; + } + + /// <summary> + /// 鍔犺浇绐楀笜鎺у埗浜嬩欢 + /// </summary> + void LoadEvent_ControlEvent() + { + btnCurtainClose.MouseUpEventHandler = (sender, e) => + { + //if (!function.online) + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + // return; + //} + new System.Threading.Thread(() => + { + System.Threading.Thread.Sleep(2000); + Application.RunOnMainThread(() => + { + btnCurtainClose.IsSelected = false; + }); + }) + { IsBackground = true }.Start(); + function.trait_on_off.curValue = "off"; + function.SetAttrState(FunctionAttributeKey.Percent, 0); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString()); + DriverLayer.Control.Ins.SendWriteCommand(function, d); + CurtainAnimation(0); + }; + + btnCurtainStop.MouseUpEventHandler = (sender, e) => + { + //if (!function.online) + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + // return; + //} + onCurtainAnimation = false; + new System.Threading.Thread(() => + { + System.Threading.Thread.Sleep(2000); + Application.RunOnMainThread(() => + { + btnCurtainStop.IsSelected = false; + }); + }) + { IsBackground = true }.Start(); + function.trait_on_off.curValue = "stop"; + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString()); + DriverLayer.Control.Ins.SendWriteCommand(function, d); + }; + + btnCurtainOpen.MouseUpEventHandler = (sender, e) => + { + //if (!function.online) + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + // return; + //} + new System.Threading.Thread(() => + { + System.Threading.Thread.Sleep(2000); + Application.RunOnMainThread(() => + { + btnCurtainOpen.IsSelected = false; + }); + }) + { IsBackground = true }.Start(); + function.trait_on_off.curValue = "on"; + function.SetAttrState(FunctionAttributeKey.Percent, 100); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString()); + DriverLayer.Control.Ins.SendWriteCommand(function, d); + CurtainAnimation(100); + }; + + //if (function.online) + { + btnCurtainStop.MouseDownEventHandler = (sender, e) => + { + btnCurtainStop.IsSelected = true; + btnCurtainClose.IsSelected = false; + btnCurtainOpen.IsSelected = false; + }; + btnCurtainOpen.MouseDownEventHandler = (sender, e) => + { + btnCurtainOpen.IsSelected = true; + btnCurtainClose.IsSelected = false; + btnCurtainStop.IsSelected = false; + }; + btnCurtainClose.MouseDownEventHandler = (sender, e) => + { + btnCurtainClose.IsSelected = true; + btnCurtainOpen.IsSelected = false; + btnCurtainStop.IsSelected = false; + }; + + curtainSeekBar.OnProgressChangedEvent = (sender, e) => + { + btnProgress.Text = curtainSeekBar.Progress + "%"; + }; + curtainSeekBar.OnStopTrackingTouchEvent = (sender, e) => + { + btnProgress.Text = curtainSeekBar.Progress + "%"; + //controlBar.Progress = curtainSeekBar.Progress; + new System.Threading.Thread(() => + { + function.SetAttrState(FunctionAttributeKey.Percent, e); + function.refreshTime = DateTime.Now; + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.Percent, e.ToString()); + DriverLayer.Control.Ins.SendWriteCommand(function, d); + }) + { IsBackground = true }.Start(); + }; + + } + } + + } +} \ No newline at end of file diff --git a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs index 5608ce8..04f939c 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs @@ -84,6 +84,15 @@ public FloorHeatingPage(Function func) { bodyView = this; + var tempAttr = func.GetAttribute(FunctionAttributeKey.SetTemp); + if (tempAttr != null) + { + if(tempAttr.min == 0 && tempAttr.max == 0) + { + tempAttr.min = 16; + tempAttr.max = 30; + } + } function = func; } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs index a40ee00..d82a852 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs @@ -349,6 +349,27 @@ { DriverLayer.Control.Ins.SendReadCommand(function); }) + { IsBackground = true }.Start(); + + new System.Threading.Thread(() => { + while (true) + { + System.Threading.Thread.Sleep(1000); + if (curDimmerStatus) + { + continue; + } + if (onDimmerBar) + { + continue; + } + else + { + DriverLayer.Control.Ins.SendReadCommand(function); + curDimmerStatus = true; + } + } + }) { IsBackground = true }.Start(); } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs index fc62ae0..4ab9b83 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs @@ -27,8 +27,11 @@ { bodyView.dimmerBar.Progress = Convert.ToInt32(updataTemp.GetAttrState(FunctionAttributeKey.Brightness)); } - bodyView.btnBrightnessText.Text = updataTemp.GetAttrState(FunctionAttributeKey.Brightness) + "%"; - bodyView.btnBrightnessText.Y = ((100 - Convert.ToInt32(updataTemp.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(222 - 16) / 100) + Application.GetRealWidth(80); + if (updataTemp.GetAttrState(FunctionAttributeKey.Brightness) != "0") + { + bodyView.btnBrightnessText.Text = updataTemp.GetAttrState(FunctionAttributeKey.Brightness) + "%"; + bodyView.btnBrightnessText.Y = ((100 - Convert.ToInt32(updataTemp.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(222 - 16) / 100) + Application.GetRealWidth(80); + } } else { @@ -134,6 +137,7 @@ }; } + bool curDimmerStatus = false; /// <summary> /// 鐏厜璋冨厜浜嬩欢 /// </summary> @@ -151,7 +155,8 @@ // }.Show(MainPage.BaseView); // return; //} - onDimmerBar = false; + //onDimmerBar = false; + 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()); @@ -170,45 +175,41 @@ { dimmerBar.OnStartTrackingTouchEvent = (sender, e) => { - onDimmerBar = true; + curDimmerStatus = onDimmerBar = true; }; dimmerBar.OnProgressChangedEvent = (sender, e) => { - dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); - //function.fadeTime = 0; - //if (!btnSwitch.IsSelected) - //{ - // dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); - //} - //btnSwitch.IsSelected = e > 0 ? true : false; - //function.brightness = e; - //function.trait_on_off.curValue = e > 0 ? "on" : "off"; + //dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); + if (!btnSwitch.IsSelected) + { + dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); + } + btnSwitch.IsSelected = e > 0 ? true : false; + function.trait_on_off.curValue = e > 0 ? "on" : "off"; - //if (e == 0 || e == 100) - //{ - // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - // d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString()); - // Control.Ins.SendWriteCommand(function, d); - //} - //else - //{ - // if (200 < (DateTime.Now - function.refreshTime).TotalMilliseconds) - // { - // function.refreshTime = DateTime.Now; - // new System.Threading.Thread(() => - // { - // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - // d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString()); - // Control.Ins.SendWriteCommand(function, d); - // }) - // { IsBackground = true }.Start(); - // } - //} + if (e == 0 || e == 100) + { + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.Brightness, e.ToString()); + Control.Ins.SendWriteCommand(function, d); + } + else + { + if (350 < (DateTime.Now - function.refreshTime).TotalMilliseconds) + { + function.refreshTime = DateTime.Now; + new System.Threading.Thread(() => + { + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.Brightness, e.ToString()); + Control.Ins.SendWriteCommand(function, d); + }) + { IsBackground = true }.Start(); + } + } - //btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16 - 16) / 100) + Application.GetRealWidth(40); - //btnBrightnessText.Text = function.brightness + "%"; - btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100) + Application.GetRealWidth(80); + btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16) / 100) + Application.GetRealWidth(80); btnBrightnessText.Text = dimmerBar.Progress + "%"; }; diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs index 52f25af..58c4a31 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs @@ -262,9 +262,36 @@ DriverLayer.Control.Ins.SendReadCommand(function); }) { IsBackground = true }.Start(); + + + new System.Threading.Thread(() => { + while (true) + { + System.Threading.Thread.Sleep(2000); + if (curDimmerStatus) + { + continue; + } + if (onDimmerBar) + { + onDimmerBar = false; + continue; + } + else + { + DriverLayer.Control.Ins.SendReadCommand(function); + curDimmerStatus = true; + } + } + }) + { IsBackground = true }.Start(); + } } + + + } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs index 3205232..f8bcb69 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs @@ -21,13 +21,13 @@ if (updataTemp.spk == bodyView.function.spk && updataTemp.sid == bodyView.function.sid) { bodyView.btnBrightnessText.Text = updataTemp.GetAttrState(FunctionAttributeKey.Brightness) + "%"; - bodyView.btnBrightnessText.Y = ((100 - Convert.ToInt32( updataTemp.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(288 - 16 - 16) / 100) + Application.GetRealWidth(40); if (updataTemp.trait_on_off.curValue.ToString() == "on") { bodyView.dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); if (!bodyView.onDimmerBar) { bodyView.dimmerBar.Progress = Convert.ToInt32(updataTemp.GetAttrState(FunctionAttributeKey.Brightness)); + bodyView.btnBrightnessText.Y = ((100 - Convert.ToInt32(updataTemp.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(288 - 16 - 16) / 100) + Application.GetRealWidth(40); } } else @@ -83,6 +83,8 @@ }; } + bool curDimmerStatus = false; + /// <summary> /// 鐏厜璋冨厜浜嬩欢 /// </summary> @@ -92,19 +94,20 @@ { dimmerBar.OnStartTrackingTouchEvent = (sender, e) => { - onDimmerBar = true; + curDimmerStatus = onDimmerBar = true; dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); }; dimmerBar.OnStopTrackingTouchEvent = (sender, e) => { - onDimmerBar = false; + + 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()); - if(dimmerBar.Progress > 0) - { - d.Add(FunctionAttributeKey.OnOff, "on"); - } + //if(dimmerBar.Progress > 0) + //{ + // d.Add(FunctionAttributeKey.OnOff, "on"); + //} Control.Ins.SendWriteCommand(function, d); btnBrightnessText.Text = dimmerBar.Progress + "%"; }; @@ -112,36 +115,35 @@ dimmerBar.OnProgressChangedEvent = (sender, e) => { - //function.fadeTime = 0; - //if (!btnSwitch.IsSelected) - //{ - // dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); - //} - //btnSwitch.IsSelected = e > 0 ? true : false; - //function.brightness = e; - //function.trait_on_off.curValue = e > 0 ? "on" : "off"; - //if (e == 0 || e == 100) - //{ - // //Control.Send(CommandType_A.write, this.function); - // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - // d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString()); - // Control.Ins.SendWriteCommand(function, d); - //} - //else - //{ - // if (200 < (DateTime.Now - function.refreshTime).TotalMilliseconds) - // { - // function.refreshTime = DateTime.Now; - // new System.Threading.Thread(() => - // { - // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - // d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString()); - // Control.Ins.SendWriteCommand(function, d); - // }) - // { IsBackground = true }.Start(); - // } - //} - btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(288 - 16 - 16) / 100) + Application.GetRealWidth(40); + if (!btnSwitch.IsSelected) + { + dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1); + } + btnSwitch.IsSelected = e > 0 ? true : false; + function.SetAttrState(FunctionAttributeKey.Brightness, e); + function.trait_on_off.curValue = e > 0 ? "on" : "off"; + if (e == 0 || e == 100) + { + //Control.Send(CommandType_A.write, this.function); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.Brightness, e.ToString()); + Control.Ins.SendWriteCommand(function, d); + } + else + { + if (350 < (DateTime.Now - function.refreshTime).TotalMilliseconds) + { + function.refreshTime = DateTime.Now; + new System.Threading.Thread(() => + { + System.Collections.Generic.Dictionary<string, string> dic = new System.Collections.Generic.Dictionary<string, string>(); + dic.Add(FunctionAttributeKey.Brightness, e.ToString()); + Control.Ins.SendWriteCommand(function, dic); + }) + { IsBackground = true }.Start(); + } + } + btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(288 - 16 - 16) / 100) + Application.GetRealWidth(40); btnBrightnessText.Text = dimmerBar.Progress + "%"; }; } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs index 45ef832..84f44bd 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs @@ -349,6 +349,30 @@ DriverLayer.Control.Ins.SendReadCommand(function); }) { IsBackground = true }.Start(); + + + + new System.Threading.Thread(() => { + while (true) + { + System.Threading.Thread.Sleep(1000); + if (curDimmerStatus) + { + continue; + } + if (onDimmerBar) + { + continue; + } + else + { + DriverLayer.Control.Ins.SendReadCommand(function); + curDimmerStatus = true; + } + } + }) + { IsBackground = true }.Start(); + } } } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs index 4826777..023c828 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs @@ -207,6 +207,7 @@ }; } + bool curDimmerStatus = false; /// <summary> /// 鐏厜璋冨厜浜嬩欢 /// </summary> @@ -225,12 +226,7 @@ // }.Show(MainPage.BaseView); // return; //} - new System.Threading.Thread(() => - { - System.Threading.Thread.Sleep(200); - onDimmerBar = false; - }) - { IsBackground = true }.Start(); + 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()); @@ -241,44 +237,42 @@ { dimmerBar.OnStartTrackingTouchEvent = (sender, e) => { - onDimmerBar = true; + curDimmerStatus = onDimmerBar = true; }; dimmerBar.OnProgressChangedEvent = (sender, e) => { - //function.fadeTime = 0; - //if (!btnSwitch.IsSelected) - //{ - // dimmerBar.ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1; - //} - //btnSwitch.IsSelected = e > 0 ? true : false; - //function.brightness = e; - //function.trait_on_off.curValue = e > 0 ? "on" : "off"; + if (!btnSwitch.IsSelected) + { + dimmerBar.ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1; + } + btnSwitch.IsSelected = e > 0 ? true : false; + function.trait_on_off.curValue = e > 0 ? "on" : "off"; - //if (e == 0 || e == 100) - //{ - // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - // d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString()); - // Control.Ins.SendWriteCommand(function, d); - //} - //else - //{ - // if (200 < (DateTime.Now - function.refreshTime).TotalMilliseconds) - // { - // function.refreshTime = DateTime.Now; - // new System.Threading.Thread(() => - // { - // //Control.Send(CommandType_A.write, function); - // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - // d.Add(FunctionAttributeKey.Brightness, function.brightness.ToString()); - // Control.Ins.SendWriteCommand(function, d); - // }) - // { IsBackground = true }.Start(); - // } - // else - // { - // MainPage.Log("skip dimmer control!!"); - // } - //} + if (e == 0 || e == 100) + { + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.Brightness, e.ToString()); + Control.Ins.SendWriteCommand(function, d); + } + else + { + if (350 < (DateTime.Now - function.refreshTime).TotalMilliseconds) + { + function.refreshTime = DateTime.Now; + new System.Threading.Thread(() => + { + //Control.Send(CommandType_A.write, function); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.Brightness, e.ToString()); + Control.Ins.SendWriteCommand(function, d); + }) + { IsBackground = true }.Start(); + } + else + { + MainPage.Log("skip dimmer control!!"); + } + } }; } } diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs index 86d183f..410e738 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs @@ -1,4 +1,5 @@ 锘縰sing System; +using System.Collections.Generic; using HDL_ON.Entity; using Shared; @@ -76,7 +77,7 @@ new System.Threading.Thread(() => { function.trait_on_off.curValue = btnSwitchIcon.IsSelected ? "on" : "off"; - System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + Dictionary<string, string> d = new Dictionary<string, string>(); d.Add("on_off", function.trait_on_off.curValue.ToString()); DriverLayer.Control.Ins.SendWriteCommand(function, d); }) diff --git a/SiriIntents/Server/HttpUtil.cs b/SiriIntents/Server/HttpUtil.cs index 56a78a0..f61de04 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