From 60d1e4fe729277415d46d1dde07efa051cb4e748 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期五, 14 五月 2021 16:41:58 +0800 Subject: [PATCH] 2021-5-14-1 --- HDL-ON_Android/Properties/AndroidManifest.xml | 2 HDL-ON_Android/Assets/Language.ini | 17 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/PirView.cs | 2 HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs | 2 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs | 250 +++++++++++ HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs | 18 HDL_ON/DAL/Mqtt/MqttClient.cs | 4 HDL_ON/HDL_ON.projitems | 2 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs | 23 DLL/IOS/Shared.IOS.JLCountryCode.dll | 0 HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs | 64 +- /dev/null | 693 --------------------------------- HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/SetPir.cs | 10 HDL-ON_iOS/Resources/Language.ini | 17 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs | 6 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs | 4 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs | 14 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/EditControl.cs | 6 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs | 13 HDL_ON/Common/R.cs | 16 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs | 6 HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs | 2 .vs/HDL_APP_Project/xs/UserPrefs.xml | 52 +- HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs | 6 24 files changed, 420 insertions(+), 809 deletions(-) diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml index e3724b4..1b3095f 100644 --- a/.vs/HDL_APP_Project/xs/UserPrefs.xml +++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml @@ -1,23 +1,15 @@ 锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.FE1D0763-7181-4B0C-AB18-E30AA773A6FA" /> - <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/3-Intelligence/Automation/AirQuality.cs"> + <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs"> <Files> - <File FileName="HDL-ON_Android/Application.cs" Line="356" Column="1" /> - <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs" /> - <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs" /> - <File FileName="HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs" /> - <File FileName="HDL_ON/Common/HDLCommon.cs" /> - <File FileName="HDL-ON_Android/Other/JPush/JPushReceiver.cs" /> - <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs" Line="82" Column="41" /> - <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs" Line="365" Column="29" /> - <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs" Line="49" Column="23" /> - <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs" /> - <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs" /> - <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs" Line="1" Column="1" /> - <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/Weather.cs" Line="78" Column="50" /> - <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/OutdoorEnvironment.cs" Line="205" Column="38" /> - <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/WeatherCondition.cs" Line="8" Column="16" /> - <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AirQuality.cs" Line="8" Column="16" /> + <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs" Line="185" Column="33" /> + <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs" Line="186" Column="45" /> + <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs" Line="271" Column="50" /> + <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs" Line="14" Column="10" /> + <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs" Line="140" Column="51" /> + <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs" Line="43" Column="23" /> + <File FileName="HDL_ON/UI/UI2/FuntionControlView/Music/View/DialogView.cs" Line="901" Column="22" /> + <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/LogicMethod.cs" Line="35" Column="68" /> </Files> <Pads> <Pad Id="ProjectPad"> @@ -25,19 +17,35 @@ <Node name="HDL_APP_Project" expanded="True"> <Node name="HDL_ON" expanded="True"> <Node name="Common" expanded="True" /> - <Node name="DAL" expanded="True"> - <Node name="ThirdPartySdk" expanded="True" /> + <Node name="DAL" expanded="True" /> + <Node name="Entity" expanded="True"> + <Node name="Function" expanded="True" /> </Node> <Node name="UI" expanded="True"> <Node name="UI2" expanded="True"> <Node name="3-Intelligence" expanded="True"> <Node name="Automation" expanded="True"> - <Node name="AirQuality.cs" selected="True" /> + <Node name="LogicMethod.cs" selected="True" /> </Node> </Node> - <Node name="FuntionControlView" expanded="True" /> + <Node name="4-PersonalCenter" expanded="True"> + <Node name="AddFunction" expanded="True" /> + <Node name="PirDevice" expanded="True" /> + </Node> + <Node name="FuntionControlView" expanded="True"> + <Node name="Music" expanded="True"> + <Node name="View" expanded="True" /> + </Node> + </Node> </Node> </Node> + </Node> + <Node name="HDL-ON_Android" expanded="True"> + <Node name="Assets" expanded="True" /> + <Node name="Other" expanded="True" /> + </Node> + <Node name="HDL-ON_iOS" expanded="True"> + <Node name="Resources" expanded="True" /> </Node> </Node> </State> @@ -51,7 +59,7 @@ <String>Shared.IOS/Shared.IOS.csproj</String> </DisabledProjects> <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" /> - <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" /> + <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.4b65c4650918" /> <MonoDevelop.Ide.DebuggingService.Breakpoints> <BreakpointStore /> </MonoDevelop.Ide.DebuggingService.Breakpoints> diff --git a/DLL/IOS/Shared.IOS.JLCountryCode.dll b/DLL/IOS/Shared.IOS.JLCountryCode.dll index 064a922..80ddf8b 100644 --- a/DLL/IOS/Shared.IOS.JLCountryCode.dll +++ b/DLL/IOS/Shared.IOS.JLCountryCode.dll Binary files differ diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index 7cdb1eb..88c6f2a 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -1367,7 +1367,7 @@ 6006=鐢佃 6007=椋庢墖 6008=鏈洪《鐩� -6009=DVD/EVD/VCD +6009=DVD 6010=鎶曞奖浠� 6011=鑷畾涔� 6012=绾㈠閬ユ帶 @@ -1437,6 +1437,21 @@ 6078=绯荤粺缁存姢涓瓇璇风◢鍚庡啀璇晘 6079=鑾峰彇鏁版嵁澶辫触 6080=鏆傛椂涓嶆敮鎸佽鍔熻兘 +6081=閫夋嫨绾㈠鍝佺墝 +6082=鎽囧ご +6083=浣庨�� +6084=涓�� +6085=楂橀�� +6086=鑷姩 +6087=娓╁害+ +6088=娓╁害- +6089=绌烘皵鍑�鍖栧櫒 +6090=鐑按鍣� +6091=涓嶅瓨鍦ㄧ殑浜у搧 +6092=璁惧涓嶅瓨鍦� +6093=璁惧涓嶅湪绾� + + 7000=鏂板缓鑷姩鍖� 7001=缂栬緫鑷姩鍖� diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml index b929bdc..61753da 100644 --- a/HDL-ON_Android/Properties/AndroidManifest.xml +++ b/HDL-ON_Android/Properties/AndroidManifest.xml @@ -1,6 +1,6 @@ 锘�<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202103302" android:versionName="1.1.202103302" package="com.hdl.onpro"> - <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="26" /> + <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="26" /> <!-- 鍙瀵硅鏉冮檺--> <uses-permission android:name="android.permission.CAMERA" /> <uses-feature android:name="android.hardware.camera" /> diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini index 32fd9da..68df652 100644 --- a/HDL-ON_iOS/Resources/Language.ini +++ b/HDL-ON_iOS/Resources/Language.ini @@ -1363,7 +1363,7 @@ 6006=鐢佃 6007=椋庢墖 6008=鏈洪《鐩� -6009=DVD/EVD/VCD +6009=DVD 6010=鎶曞奖浠� 6011=鑷畾涔� 6012=绾㈠閬ユ帶 @@ -1433,6 +1433,21 @@ 6078=绯荤粺缁存姢涓瓇璇风◢鍚庡啀璇晘 6079=鑾峰彇鏁版嵁澶辫触 6080=鏆傛椂涓嶆敮鎸佽鍔熻兘 +6081=閫夋嫨绾㈠鍝佺墝 +6082=鎽囧ご +6083=浣庨�� +6084=涓�� +6085=楂橀�� +6086=鑷姩 +6087=娓╁害+ +6088=娓╁害- +6089=绌烘皵鍑�鍖栧櫒 +6090=鐑按鍣� +6091=涓嶅瓨鍦ㄧ殑浜у搧 +6092=璁惧涓嶅瓨鍦� +6093=璁惧涓嶅湪绾� + + 7000=鏂板缓鑷姩鍖� 7001=缂栬緫鑷姩鍖� diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index 2163dd8..12b3d5f 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -927,9 +927,19 @@ public const int xitongweihuzhong = 6078; public const int huoqushujushibao = 6079; public const int zanshibuzhichigaigongneng = 6080; - - - + public const int xuanzehongwaipinpai= 6081; + public const int yaotou = 6082; + public const int disu = 6083; + public const int zhongsu = 6084; + public const int gaosu = 6085; + public const int zidong = 6086; + public const int wendujia = 6087; + public const int wendujian = 6088; + public const int kongqijinghauqi = 6089; + public const int reshuiqi = 6090; + public const int bucunzaichanpin = 6091; + public const int shebeibucunzai = 6092; + public const int shebeibuzaixian = 6093; public const int newAutomation = 7000; diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs index 13fbff6..5fb0c86 100644 --- a/HDL_ON/DAL/Mqtt/MqttClient.cs +++ b/HDL_ON/DAL/Mqtt/MqttClient.cs @@ -330,14 +330,14 @@ { var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey); var revString = Encoding.UTF8.GetString(bytes); - HDL_ON.UI.UI2.PersonalCenter.PirDevice.Method.controldata = revString; + HDL_ON.UI.UI2.PersonalCenter.PirDevice.PirMethod.controldata = revString; } //App璁㈤槄閬ユ帶鍣ㄨ嚜瀛︽寜閿涔犳垚鍔熼�氱煡 else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.RegionID}/app/thing/event/irCodeStudyDone/up") { var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey); var revString = Encoding.UTF8.GetString(bytes); - UI.UI2.PersonalCenter.PirDevice.Method.buttondata = revString; + UI.UI2.PersonalCenter.PirDevice.PirMethod.buttondata = revString; } #region 鏁版嵁鏇存柊鎺ㄩ�佷富棰� //appHomeRefresh锛氫綇瀹呮暟鎹埛鏂伴�氱煡 diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems index a399e18..3500fb8 100644 --- a/HDL_ON/HDL_ON.projitems +++ b/HDL_ON/HDL_ON.projitems @@ -352,7 +352,6 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\PirSend.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\AddControlComplete.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\PatchView.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\Method.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\FailView.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\ReplicationView.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\ClothesHangerSetTimePage.cs" /> @@ -398,6 +397,7 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\InputPushText.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\AirQuality.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\OnePortAutomation.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\PirMethod.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)DAL\" /> diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs index 2543213..65bb8a2 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/MainView.cs @@ -279,7 +279,6 @@ var jay = jArray[a]; //鏁版嵁杩斿簭鍒楀寲涓篖ogic瀵硅薄 var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); - Console.WriteLine("鑾峰彇閫昏緫==="+str); var logic = Newtonsoft.Json.JsonConvert.DeserializeObject<Logic>(str); if (logic != null) { @@ -288,38 +287,39 @@ if (if_logic == null) { - //Logic newlogic = new Logic(); - //newlogic.name = logic.name; - //newlogic.userLogicId = logic.userLogicId; - //newlogic.sid = logic.sid; - //newlogic.relation = logic.relation; - //newlogic.enable = logic.enable; - //newlogic.cycle = logic.cycle; - //for (int i = 0; i < logic.input.Count; i++) - //{ - // if (logic.input[i] == null || string.IsNullOrEmpty(logic.input[i].condition_type)) - // { - // //闃叉璋冭瘯杞欢涔变紶涓滆タ涓婃潵; - // //闃叉鏈夌┖瀵硅薄锛� - // //姝e父鎯呭喌涓嬩笉浼氬嚭鐜扮殑鐜拌薄锛� - // continue; - // } - // newlogic.input.Add(logic.input[i]); - //} - //for (int i = 0; i < logic.output.Count; i++) - //{ - // if (logic.output[i] == null || string.IsNullOrEmpty(logic.output[i].target_type)) - // { - // //闃叉璋冭瘯杞欢涔变紶涓滆タ涓婃潵; - // //闃叉鏈夌┖瀵硅薄锛� - // //姝e父鎯呭喌涓嬩笉浼氳鐜拌薄锛� - // continue; - // } - // newlogic.output.Add(logic.output[i]); - //} - + Logic newlogic = new Logic(); + newlogic.name = logic.name; + newlogic.userLogicId = logic.userLogicId; + newlogic.sid = logic.sid; + newlogic.relation = logic.relation; + newlogic.enable = logic.enable; + newlogic.cycle = logic.cycle; + for (int i = 0; i < logic.input.Count; i++) + { + if (logic.input[i] == null || string.IsNullOrEmpty(logic.input[i].condition_type)) + { + //闃叉璋冭瘯杞欢涔变紶涓滆タ涓婃潵; + //闃叉鏈夌┖瀵硅薄锛� + //姝e父鎯呭喌涓嬩笉浼氬嚭鐜扮殑鐜拌薄锛� + continue; + } + newlogic.input.Add(logic.input[i]); + } + for (int i = 0; i < logic.output.Count; i++) + { + if (logic.output[i] == null || string.IsNullOrEmpty(logic.output[i].target_type)) + { + //闃叉璋冭瘯杞欢涔变紶涓滆タ涓婃潵; + //闃叉鏈夌┖瀵硅薄锛� + //姝e父鎯呭喌涓嬩笉浼氳鐜拌薄锛� + continue; + } + newlogic.output.Add(logic.output[i]); + } + newlogic.noticeConfig = logic.noticeConfig; + newlogic.pushConfigs = logic.pushConfigs; //娣诲姞閫昏緫 - Logic.LogicList.Add(logic); + Logic.LogicList.Add(newlogic); } } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs index 00f6588..309b387 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs @@ -152,7 +152,7 @@ switch (device.spk) { case SPK.IrModule: - new UI2.PersonalCenter.PirDevice.Method().MainView(this, device,()=> {}); + new UI2.PersonalCenter.PirDevice.PirMethod().MainView(this, device,()=> {}); break; } }; diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs index 01a45e5..1783c17 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs @@ -151,7 +151,7 @@ //绉婚櫎娣诲姞鎸夐挳鐣岄潰 this.RemoveFromParent(); //绉婚櫎涔嬪墠鍙兘瀛樺湪鐨勭晫闈� - Method.RemoveView("AddControl"); + PirMethod.RemoveView("AddControl"); //鍔犺浇鏁版嵁鐣岄潰 AddControl addControl = new AddControl(); MainPage.BasePageView.AddChidren(addControl); @@ -161,7 +161,7 @@ else { replication.RemView(); - Method method = new Method(); + PirMethod method = new PirMethod(); method.ErrorShow(null,"娣诲姞澶辫触"); } @@ -176,7 +176,7 @@ public override void RemoveFromParent() { //鍒锋柊鎸囧畾鐣岄潰 - Method.RefreshView("PirMain"); + PirMethod.RefreshView("PirMain"); base.RemoveFromParent(); } } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs index b10aae1..fbbb8c7 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs @@ -143,7 +143,7 @@ //绉婚櫎褰撳墠鐣岄潰 this.RemoveFromParent(); //鍙兘涔嬪墠宸茬粡瀛樺湪璇ョ晫闈� - Method.RemoveView("AddControlComplete"); + PirMethod.RemoveView("AddControlComplete"); AddControlComplete addControlComplete = new AddControlComplete(); MainPage.BasePageView.AddChidren(addControlComplete); addControlComplete.Show(control, false); @@ -162,7 +162,7 @@ View.Buttons buttons = new View.Buttons(); buttons.AddButton2(vv, control.status, (obj) => { - Method.ThreadSend(control, (responsePackNew) => + PirMethod.ThreadSend(control, (responsePackNew) => { var buttonObj = control.status.Find((c) => c.value == obj.value); if (buttonObj != null) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs index ba1829d..dd7c026 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControlComplete.cs @@ -113,11 +113,11 @@ //娣诲姞鎵�鏈夐仴鎺у悕绉板垪琛� list.Add(Pir.currPir.FunctioList[i].name); } - Method method = new Method(); + PirMethod method = new PirMethod(); method.EditControlName(StringId.editName, list, control.name, (name, dialog) => { //鍙戦�佹洿鏂板悕绉板懡浠� - Method.ThreadSend(new Control { deviceId = control.deviceId, name = name }, (responsePackNew) => + PirMethod.ThreadSend(new Control { deviceId = control.deviceId, name = name }, (responsePackNew) => { //鍏抽棴绐楀彛 dialog.Close(); @@ -133,7 +133,7 @@ //鎵�灞炲尯鍩熺偣鍑讳簨浠� quyuPatchView.btnClick.MouseUpEventHandler += (sender, e) => { - Method method = new Method(); + PirMethod method = new PirMethod(); method.ManagementPosition(GetFunction(control.deviceId), () => { //鏇存柊鍖哄煙 @@ -145,12 +145,12 @@ { if (bool_library) {//缁х画娣诲姞搴撶殑閬ユ帶鍣� - Method.RefreshView("PirMain");//鍒锋柊鎸囩偣鐣岄潰 + PirMethod.RefreshView("PirMain");//鍒锋柊鎸囩偣鐣岄潰 this.RemoveFromParent(); } else {//缁х画娣诲姞鑷畾涔夌殑閬ユ帶鍣� - Method method = new Method(); + PirMethod method = new PirMethod(); method.AddControl(this, (controlDevice) => { AddButton addButton = new AddButton(); @@ -164,7 +164,7 @@ saveView.btnClick.MouseUpEventHandler += (sender, e) => { //鍒锋柊鎸囩偣鐣岄潰 - Method.RefreshView("PirMain"); + PirMethod.RefreshView("PirMain"); //绉婚櫎鎵�鏈夌晫闈� MainPage.BasePageView.RemoveViewByTag("PirView"); }; @@ -191,7 +191,7 @@ public override void RemoveFromParent() { //鍒锋柊鎸囧畾鐣岄潰 - Method.RefreshView("PirMain"); + PirMethod.RefreshView("PirMain"); base.RemoveFromParent(); } } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs index 92d6fe4..1299e74 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/BrandList.cs @@ -18,7 +18,8 @@ string s = brandList[str].brandName; strList.Add(s); } - JLCountrycode.CountryCodeView.Current.ShowSortSelection("閫夋嫨绾㈠鍝佺墝", GetDateList(strList), (countryName) => + var dicList = GetDateList(strList); + JLCountrycode.CountryCodeView.Current.ShowSortSelection(Language.StringByID(StringId.xuanzehongwaipinpai), dicList, (countryName) => { var brandObj = brandList.Find((c) => c.brandName == countryName); @@ -60,6 +61,7 @@ { if (libraryList.Count < 40) { + //闄愬埗40涓簱锛� libraryList.Add(library); } } @@ -68,7 +70,7 @@ } else { - Method method = new Method(); + PirMethod method = new PirMethod(); method.ErrorShow(responsePackNew, ""); } }, id, "鍝佺墝绾㈠鐮佸簱鍒楄〃"); diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/EditControl.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/EditControl.cs index 09c130c..0c14256 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/EditControl.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/EditControl.cs @@ -57,10 +57,10 @@ { list.Add(Pir.currPir.FunctioList[i].name); } - Method method = new Method(); + PirMethod method = new PirMethod(); method.EditControlName(StringId.editName,list, control.name, (name, dialog) => { - Method.ThreadSend(new Control { deviceId = control.deviceId, name = name }, (responsePackNew) => + PirMethod.ThreadSend(new Control { deviceId = control.deviceId, name = name }, (responsePackNew) => { dialog.Close(); editNameFLayout.btnEditText.Text = name; @@ -73,7 +73,7 @@ //閬ユ帶鍣ㄦ墍灞炲尯鍩熼�変腑浜嬩欢 areaFLayout.btnClick.MouseUpEventHandler += (sender, e) => { - Method method = new Method(); + PirMethod method = new PirMethod(); method.ManagementPosition(control, () => { //鏇存柊鍖哄煙 diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs index 1a97eef..cf58a30 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs @@ -176,14 +176,13 @@ code = 1; GetBtnText(testBtn, code, spk); }; - //娴嬭瘯Text testBtn.MouseUpEventHandler += (sender, e) => { var library = libraryList[index - 1]; var control = GetControl(spk, testBtn.TextID, library); //鍙戦�佹祴璇曠爜鍛戒护 - Method.ThreadSend(control, (responsePackNew) => { }, "搴撶爜娴嬭瘯", "frame", this, null); + PirMethod.ThreadSend(control, (responsePackNew) => { }, "搴撶爜娴嬭瘯", "frame", this, null); if (code == 3) { //鏍囪鏈�鍚庨偅涓爜 if_bool = true; @@ -216,7 +215,7 @@ { var library = libraryList[index-1]; var control = GetControl(spk, testBtn.TextID, library); - Method method = new Method(); + PirMethod method = new PirMethod(); //鍙戦�佸簱娣诲姞閬ユ帶鍣ㄥ懡浠� method.ThreadAddControl(control, this, (device) => { @@ -295,6 +294,136 @@ } } break; + case SPK.FanIr: + { + switch (textInt) + { + case StringId.dianyuan: + { + key = "on_off"; + value = "on"; + } + break; + case StringId.zhongsu: + { + key = "middle"; + value = ""; + } + break; + case StringId.yaotou: + { + key = "swing"; + value = ""; + } + break; + } + } + break; + case SPK.PjtIr: + { + switch (textInt) + { + case StringId.dianyuan: + { + key = "on_off"; + value = "on"; + } + break; + case StringId.yinliangjia: + { + key = "volume+"; + value = ""; + } + break; + case StringId.yinliangjian: + { + key = "volume-"; + value = ""; + } + break; + } + } + break; + case SPK.StbIr: + { + switch (textInt) + { + case StringId.dianyuan: + { + key = "on_off"; + value = "on"; + } + break; + case StringId.yinliangjia: + { + key = "volume+"; + value = ""; + } + break; + case StringId.yinliangjian: + { + key = "volume-"; + value = ""; + } + break; + } + } + break; + case SPK.DvDIr: + { + + } + break; + case SPK.PurifierIr: + { + switch (textInt) + { + case StringId.dianyuan: + { + key = "on_off"; + value = "on"; + } + break; + case StringId.zidong: + { + key = "auto"; + value = ""; + } + break; + case StringId.jingyin: + { + key = "mute"; + value = "0"; + } + break; + } + } + break; + case SPK.HeaterIr: + { + switch (textInt) + { + case StringId.dianyuan: + { + key = "on_off"; + value = "on"; + } + break; + case StringId.wendujia: + { + key = "temp+"; + value = ""; + } + break; + case StringId.wendujian: + { + key = "temp-"; + value = ""; + } + break; + } + } + break; } AttributesStatus buttonObj = new AttributesStatus(); buttonObj.key = key; @@ -373,6 +502,121 @@ } } break; + case SPK.FanIr: + { + switch (code) + { + case 1: + { + textValue = StringId.dianyuan; + } + break; + case 2: + { + textValue = StringId.zhongsu; + } + break; + case 3: + { + textValue = StringId.yaotou; + } + break; + } + } + break; + case SPK.PjtIr: + { + switch (code) + { + case 1: + { + textValue = StringId.dianyuan; + } + break; + case 2: + { + textValue = StringId.yinliangjia; + } + break; + case 3: + { + textValue = StringId.yinliangjian; + } + break; + } + } + break; + case SPK.StbIr: + { + switch (code) + { + case 1: + { + textValue = StringId.dianyuan; + } + break; + case 2: + { + textValue = StringId.yinliangjia; + } + break; + case 3: + { + textValue = StringId.yinliangjian; + } + break; + } + } + break; + case SPK.DvDIr: + { + + } + break; + case SPK.PurifierIr: + { + switch (code) + { + case 1: + { + textValue = StringId.dianyuan; + } + break; + case 2: + { + textValue = StringId.zidong; + } + break; + case 3: + { + textValue = StringId.jingyin; + } + break; + } + } + break; + case SPK.HeaterIr: + { + switch (code) + { + case 1: + { + textValue = StringId.dianyuan; + } + break; + case 2: + { + textValue = StringId.wendujia; + } + break; + case 3: + { + textValue = StringId.wendujian; + } + break; + } + } + break; } testBtn.TextID = textValue; } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs deleted file mode 100644 index 064080f..0000000 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs +++ /dev/null @@ -1,693 +0,0 @@ -锘縰sing System; -using HDL_ON.DAL.Server; -using Shared; -using System.Collections.Generic; -using Newtonsoft.Json.Linq; - -namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice -{ - public class Method - { - - /// <summary> - /// 绾㈠瀹濈▼搴忎富鍏ュ彛 - /// </summary> - /// <param name="frame"></param> - /// <param name="function"></param> - public void MainView(FrameLayout frame, Entity.Function function, Action action) - { - Pir pirDevice = new Pir(); - if (function != null) - {//鏁版嵁杞崲 - pirDevice.name = function.name; - pirDevice.deviceId = function.deviceId; - pirDevice.sid = function.sid; - pirDevice.online = function.online; - pirDevice.versions = function.versions; - } - Pir.currPir = pirDevice; - GetControlList(frame, () => - { - Application.RunOnMainThread(() => - { - var page = new PirMain(); - MainPage.BasePageView.AddChidren(page); - page.Show(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - PirMain.BackAction += () => - { - action?.Invoke(); - PirMain.BackAction = null; - }; - }); - }, Pir.currPir); - } - - /// <summary> - /// 绠$悊浣嶇疆 - /// </summary> - /// <param name="control">褰撳墠璁惧</param> - /// <param name="action">鍥炶皟鍑芥暟</param> - public void ManagementPosition(Entity.Function control, Action action) - { - var view = new ChooseRoomPage(control, action); - MainPage.BasePageView.AddChidren(view); - view.LoadPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - /// <summary> - /// 淇敼鍚嶇О - /// </summary> - /// <param name="tipText">鎻愮ず鏍囬鏂囨湰</param> - /// <param name="list">褰撳墠瀛樺湪鍚嶇О鍒楄〃</param> - /// <param name="currName">褰撳墠鍚嶇О</param> - /// <param name="action">鍥炶皟鍑芥暟</param> - public void EditControlName(int tipText, List<string> list, string currName, Action<string, Dialog> action, Action actionCancel, bool tag = false) - { - new View.TipView().InputBox(tipText, currName, StringId.nameNull, StringId.NameAlreadyExists, list, (text, view - ) => - { - action(text, view); - }, () => { actionCancel(); }, tag); - } - /// <summary> - /// 娣诲姞閬ユ帶鍣ㄧ殑鏂规硶 - /// </summary> - /// <param name="frameLayout">log鍥炬爣鍔犺浇鐣岄潰</param> - /// <param name="action">鍥炶皟鍑芥暟</param> - public void AddControl(FrameLayout frameLayout, Action<Control> action) - { - View.TipView tipView = new View.TipView(); - tipView.InputBox(frameLayout, "", (name, frame) => - { - if (Pir.currPir != null && Pir.currPir.FunctioList.Count < 10) - { - Control control = new Control(); - control.name = name; - control.type = "learn"; - control.spk = "ir.learn"; - control.deviceId = Pir.currPir.deviceId; - ThreadAddControl(control, frame, action); - } - else - { - View.TipView tt = new View.TipView(); - tt.TipBox(StringId.tip, StringId.bunengchaoguo10); - } - }, false); - - } - /// <summary> - /// 鍙戦�侀仴鎺у櫒鍛戒护鏂规硶 - /// </summary> - /// <param name="control">鍙戦�佸弬鏁板璞�</param> - /// <param name="frame">log鍥炬爣鍔犺浇鐣岄潰</param> - /// <param name="action">鍥炶皟鍑芥暟</param> - public void ThreadAddControl(Control control, FrameLayout frame, Action<Control> action) - { - Cloud mqttdate = null; - Loading loading = new Loading(); - frame.AddChidren(loading); - loading.Start(); - new System.Threading.Thread(() => - { - try - { - //鍙戦�佹坊鍔犲懡浠� - var responsePackNew = PirSend.Add(control); - if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") - { - string sid = responsePackNew.Data.ToString(); - controldata = ""; - mqttdate = MqttDate("閬ユ帶鍣�", sid); - if (mqttdate != null) - { - control.sid = sid; - } - } - - } - catch { } - finally - { - Application.RunOnMainThread(() => - { - loading.Hide(); - ///杩欓噷锛氱洃鍚琈TTP鎺ㄩ�佷笅鏉ヤ富棰�; - if (mqttdate != null) - { - //浼戠湢1000姣锛屼负绛夊緟浜戠鍒涘缓deviceid锛� - System.Threading.Thread.Sleep(1000); - //璇诲彇娣诲姞閬ユ帶鍣╠eviceID锛屾墠鐭ラ亾鏄惁娣诲姞鎴愬姛锛� - GetControl(frame, control, (device) => - { - if (device != null) - { - - control.deviceId = device.deviceId; - //閬ユ帶鍣ㄦ坊鍔犲埌鍒楄〃锛� - if (null == Pir.currPir.FunctioList.Find((c) => c.deviceId == device.deviceId)) - { - Pir.currPir.FunctioList.Add(device); - } - frame.RemoveFromParent();//娣诲姞鎴愬姛鍏抽棴寮圭獥 - action(control); - } - else - { - //鐩戝惉Mqtt鎺ㄩ�佷笅鏉ョ姸鎬佺爜鍋氭彁绀� - View.FailView failView = new View.FailView(); - failView.ShouError((view) => - { - view.Close(); - ThreadAddControl(control, frame, action); - }); - - } - - }); - } - else - { - //鐩戝惉Mqtt鎺ㄩ�佷笅鏉ョ姸鎬佺爜鍋氭彁绀� - View.FailView failView = new View.FailView(); - failView.ShouError((view) => - { - view.Close(); - ThreadAddControl(control, frame, action); - }); - } - - - }); - - } - }) - { IsBackground = true }.Start(); - - } - /// <summary> - /// 鑾峰彇绾㈠璁惧鍒楄〃 - /// </summary> - /// <param name="frame">log鍥炬爣鍔犺浇鐣岄潰</param> - /// <param name="action">鍥炶皟鍑芥暟</param> - public static void GetPirDeviceList(FrameLayout frame, Action action) - { - //娓呴櫎涔嬪墠鍒楄〃; - Pir.pirDeviceList.Clear(); - //鍔犺浇log - Loading loading = new Loading(); - frame.AddChidren(loading); - loading.Start(); - new System.Threading.Thread(() => - { - try - { - var responsePackNew = PirSend.GetDeviceList("ir.module"); - if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") - { - var jobject = Newtonsoft.Json.Linq.JObject.Parse(responsePackNew.Data.ToString()); - string list = jobject["list"].ToString(); - - var jArray = Newtonsoft.Json.Linq.JArray.Parse(list); - for (int a = 0; a < jArray.Count; a++) - { - var jay = jArray[a]; - string spk = jay["spk"].ToString(); - if (spk == "ir.module") - { - //鏁版嵁杩斿簭鍒楀寲涓篖ogic瀵硅薄 - var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); - var pirJosn = Newtonsoft.Json.JsonConvert.DeserializeObject<Pir>(str); - if (pirJosn != null) - { - - if (null == PirDevice.Pir.pirDeviceList.Find((c) => c.deviceId == pirJosn.deviceId)) - { - PirDevice.Pir.pirDeviceList.Add(pirJosn); - } - } - } - - } - - } - } - catch { } - finally - { - Application.RunOnMainThread(() => - { - try - { - if (Pir.pirDeviceList.Count != 0) - { - GetControlList(() => - { - loading.Hide(); - action(); - - }); - } - else - { - loading.Hide(); - Method method = new Method(); - method.ErrorShow(null, "璇诲彇绾㈠瀹濆垪琛ㄥけ璐�"); - } - } - catch { } - - }); - } - - }) - { IsBackground = true }.Start(); - - } - /// <summary> - /// 鑾峰彇鎵�鏈夌孩澶栧疂閬ユ帶鍣ㄥ垪琛� - /// </summary> - /// <param name="action">鍥炶皟鍑芥暟</param> - public static void GetControlList(Action action) - { - - new System.Threading.Thread(() => - { - try - { - for (int i = 0; i < Pir.pirDeviceList.Count; i++) - { - var pirDevice = Pir.pirDeviceList[i]; - try - { - var responsePackNew = PirSend.ControlList(pirDevice.deviceId); - if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") - { - var jArray = JArray.Parse(responsePackNew.Data.ToString()); - for (int a = 0; a < jArray.Count; a++) - { - var jay = jArray[a]; - //鏁版嵁杩斿簭鍒楀寲涓篖ogic瀵硅薄 - var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); - var pirJosn = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.Function>(str); - if (pirJosn != null) - { - if (null == pirDevice.FunctioList.Find((c) => c.sid == pirJosn.sid)) - { - pirDevice.FunctioList.Add(pirJosn); - } - } - - } - } - - } - catch { } - - } - } - catch { } - finally - { - - Application.RunOnMainThread(() => - { - action(); - }); - } - - }) - { IsBackground = true }.Start(); - - } - - /// <summary> - /// 鑾峰彇鍗曚釜绾㈠瀹濋仴鎺у櫒鍒楄〃 - /// </summary> - /// <param name="action">鍥炶皟鍑芥暟</param> - public static void GetControlList(FrameLayout frame, Action action, Pir pirDevice) - { - ThreadSend(new Control { deviceId = pirDevice.deviceId }, (responsePackNew) => - { - var jArray = JArray.Parse(responsePackNew.Data.ToString()); - for (int a = 0; a < jArray.Count; a++) - { - var jay = jArray[a]; - //鏁版嵁杩斿簭鍒楀寲涓篖ogic瀵硅薄 - var str = Newtonsoft.Json.JsonConvert.SerializeObject(jay); - var pirJosn = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.Function>(str); - if (pirJosn != null) - { - if (null == pirDevice.FunctioList.Find((c) => c.deviceId == pirJosn.deviceId)) - { - pirDevice.FunctioList.Add(pirJosn); - } - } - } - action(); - }, "鑾峰彇閬ユ帶鍣ㄥ垪琛�", "frame", frame, null); - - } - /// <summary> - /// 鑾峰彇璁惧璇︽儏閫氳繃(spk,sid) - /// </summary> - /// <param name="frame">log鍥炬爣鍔犺浇鐣岄潰</param> - /// <param name="control">鍙戦�佸弬鏁板璞�</param> - /// <param name="action">鍥炶皟鍑芥暟</param> - public void GetControl(FrameLayout frame, Control control, Action<Entity.Function> action) - { - ThreadSend(control, (responsePackNew) => - { - var function = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.Function>(responsePackNew.Data.ToString()); - action(function); - }, "鑾峰彇璁惧璇︽儏", "frame", frame, null); - } - /// <summary> - /// 鍙戦�佸懡浠ょ嚎绋� - /// </summary> - /// <param name="control">鍙戦�佹暟鎹璞�</param> - /// <param name="action">鍥炶皟鍑芥暟</param> - /// <param name="str">鍒ゆ柇瀛楃</param> - /// <param name="view">鍒ゆ柇log鐖舵帶浠�</param> - /// <param name="frame">log鐖舵帶浠�</param> - /// <param name="dialog">log鐖舵帶浠�</param> - /// <param name="attributesStatus">瀛︿範鎸夐敭</param> - public static void ThreadSend(Control control, Action<ResponsePackNew> action, string str, string view, FrameLayout frame, Dialog dialog, Entity.AttributesStatus attributesStatus=null) - { - - //鍔犺浇log - Loading loading = new Loading(); - if (view == "dialog") - { - dialog.AddChidren(loading); - } - else - { - frame.AddChidren(loading); - } - loading.Start(); - ResponsePackNew responsePackNew = null; - new System.Threading.Thread(() => - { - try - { - if (str == "鍒犻櫎") - { - responsePackNew = PirSend.DeleteDevice(control.deviceId); - } - else if (str == "淇敼鍚嶇О") - { - - responsePackNew = PirSend.DeviceRename(control.deviceId, control.name); - } - else if (str == "鍒犻櫎鎸夐敭") - { - if (attributesStatus != null) - { - responsePackNew = PirSend.CodeRemove(attributesStatus, control.deviceId); - } - } - else if (str == "鑾峰彇璁惧璇︽儏") - { - // 鑾峰彇璁惧璇︽儏閫氳繃(spk,sid) - responsePackNew = PirSend.GetinfoBySid(control); - } - else if (str == "鑾峰彇閬ユ帶鍣ㄥ垪琛�") - { - responsePackNew = PirSend.ControlList(control.deviceId); - } - else if (str == "搴撶爜娴嬭瘯") - { - responsePackNew = PirSend.CodeTest(control); - } - } - catch { } - finally - { - Application.RunOnMainThread(() => - { - loading.Hide(); - if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") - { - action(responsePackNew); - } - else - { - Method method = new Method(); - //鑷畾涔夐敊璇彁绀烘枃鏈� - string eorroText = ""; - if (str == "鍒犻櫎") - { - } - else if (str == "淇敼鍚嶇О") - { - - } - else if (str == "鍒犻櫎鎸夐敭") - { - } - else if (str == "鑾峰彇璁惧璇︽儏") - { - } - else if (str == "鑾峰彇閬ユ帶鍣ㄥ垪琛�") - { - } - else if (str == "搴撶爜娴嬭瘯") - { - } - method.ErrorShow(responsePackNew, eorroText); - } - - }); - } - - }) - { IsBackground = true }.Start(); - - - } - /// <summary> - /// MQTT涓婚鎺ㄩ�佷笅鏉ョ殑閬ユ帶鍣ㄦ暟鎹� - /// </summary> - public static string controldata = ""; - /// <summary> - /// MQTT涓婚鎺ㄩ�佷笅鏉ユ寜閿殑鏁版嵁 - /// </summary> - public static string buttondata = ""; - /// <summary> - /// 鍒ゆ柇杩欎釜涓婚鏄惁鏄坊鍔犻仴鎺у櫒涓婚 - /// </summary> - /// <param name="text">琛ㄧず涓嶅悓涓婚鏁版嵁</param> - /// <param name="sid">鍞竴鏍囪瘑</param> - /// <param name="timeValue">绛夊緟鏃堕棿鍊�</param> - /// <returns></returns> - public Cloud MqttDate(string text, string sid, int timeValue = 10) - { - Cloud cloud = null; - var dateTime = DateTime.Now; - while ((DateTime.Now - dateTime).TotalMilliseconds < timeValue * 1000) - { - string str = ""; - if (text == "閬ユ帶鍣�") - { - str = controldata; - } - else if (text == "鎸夐敭") - { - str = buttondata; - } - - if (!string.IsNullOrEmpty(str)) - { - try - { - var cloudjson = Newtonsoft.Json.JsonConvert.DeserializeObject<Cloud>(str); - for (int i = 0; i < cloudjson.objects.Count; i++) - { - var objects = cloudjson.objects[i]; - if (sid == objects.sid) - { - cloud = cloudjson; - break; - } - } - if (cloud != null) - { - break; - } - } - catch { } - } - - } - return cloud; - } - /// <summary> - /// 閿欒鐮佹彁绀� - /// </summary> - /// <param name="responsePackNew"></param> - /// <param name="text">鑷畾涔夐敊璇枃鏈�</param> - /// <param name="popValue">寮规绫诲瀷锛�1=闂儊寮规锛�</param> - public void ErrorShow(ResponsePackNew responsePackNew, string text, int popValue = 1) - { - string str = ""; - if (text == "鍒犻櫎閬ユ帶鍣�") - { - str = Language.StringByID(StringId.delFail); - } - else if (text == "璇诲彇绾㈠瀹濆垪琛ㄥけ璐�") - { - str = Language.StringByID(StringId.huoqushujushibao); - } - else if (text == "娣诲姞澶辫触") - { - str = Language.StringByID(StringId.tianjiashibai); - } - else - { - if (responsePackNew != null) - { - - switch (responsePackNew.Code) - { - - case "14005": - { - str = Language.StringByID(StringId.gatewayNotOnline); - - } - break; - case "10807": - { - str = Language.StringByID(StringId.bunengchaoguo10); - - - } - break; - case "2": - { - str = Language.StringByID(StringId.xitongweihuzhong); - } - break; - default: - { - str = Language.StringByID(StringId.huoqushujushibao); - } - break; - - } - } - } - switch (popValue) - { - case 1: - { - new Intelligence.Automation.LogicView.TipPopView().FlashingBox(str); - } - break; - case 2: { } break; - case 3: { } break; - } - } - /// <summary> - ///鎸囧畾鍒锋柊鐣岄潰 - /// </summary> - /// <param name="strView">鍒ゆ柇瀛楃</param> - public static void RefreshView(string strView) - { - //鏍囪鏄笉鏄凡缁忓埛鏂板畬鎴� - bool if_bool = false; - for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--) - { - var view = MainPage.BasePageView.GetChildren(i); - if (strView == "PirMain") - { - if (view.GetType() == typeof(PirMain)) - { - //寮哄埗杞崲瀵硅薄 - var f = (PirMain)view; - //绉婚櫎鎵�鏈夊瓙鎺т欢 - f.RemoveAll(); - //閲嶆柊鍔犺浇UI - f.Show(); - //閫�鍑篺or寰幆 - //break; - if_bool = true; - } - } - if (if_bool) - { - //閫�鍑篺or寰幆 - break; - } - } - } - /// <summary> - /// 鎸囧畾鍒犻櫎鐣岄潰 - /// </summary> - /// <param name="strView">鍒ゆ柇瀛楃</param> - public static void RemoveView(string strView) - { - - for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--) - { - var view = MainPage.BasePageView.GetChildren(i); - if (strView == "PirMain") - { - if (view.GetType() == typeof(PirMain)) - { - //绉婚櫎鐣岄潰 - view.RemoveFromParent(); - } - - } - else if (strView == "AddControl") - { - - if (view.GetType() == typeof(AddControl)) - { - //鎵惧埌绉婚櫎 - view.RemoveFromParent(); - } - } - else if (strView == "AddControlComplete") - { - - if (view.GetType() == typeof(AddControlComplete)) - { - //鎵惧埌绉婚櫎 - view.RemoveFromParent(); - } - } - - } - } - - } - [Serializable] - public class Cloud - { - public string id = ""; - public List<Objects> objects = new List<Objects>(); - public string time_stamp = string.Empty; - - - } - [Serializable] - public class Objects - { - - public string sid = string.Empty; - public string spk = string.Empty; - public List<Attributes> attributes = new List<Attributes>(); - } - [Serializable] - public class Attributes - { - public string key = ""; - public string data_type = ""; - public List<string> value = new List<string>(); - - } -} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs index a7ced2e..e6c1598 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs @@ -76,7 +76,7 @@ ////鍏抽棴鍒锋柊View锛� vv.EndHeaderRefreshing(); - Method.GetControlList(this, () => + PirMethod.GetControlList(this, () => { Application.RunOnMainThread(() => { @@ -108,7 +108,7 @@ //1=绌鸿皟;2=鐢佃;3=椋庢墖;4=鏈洪《鐩�;5=DVD/EVD/VCD;6=鎶曞奖浠�;7=鑷畾涔�; if (if_value == 7) { - Method method = new Method(); + PirMethod method = new PirMethod(); method.AddControl(this, (control) => { //鎴愬姛鍚庣Щ闄�; @@ -121,7 +121,7 @@ } else { - if (if_value == 3 || if_value == 4 || if_value == 5 || if_value == 6) + if (if_value == 6) { new TipPopView().FlashingBox(Language.StringByID(StringId.zanshibuzhichigaigongneng)); return; @@ -149,7 +149,6 @@ ///鍒濆鍖栫晫闈� UIView(vv); } - /// <summary> /// 鍔犺浇UI鐣岄潰 /// </summary> @@ -209,7 +208,7 @@ TipPopView tipPopView = new TipPopView(); tipPopView.TipBox(StringId.tip, text, (dialog) => { - Method.ThreadSend(new Control { deviceId=control.deviceId}, (responsePackNew) => + PirMethod.ThreadSend(new Control { deviceId=control.deviceId}, (responsePackNew) => { dialog.Close(); var function = Pir.currPir.FunctioList.Find((c) => c.sid == Function.sid); @@ -317,7 +316,7 @@ { if (tag) { - Method method = new Method(); + PirMethod method = new PirMethod(); method.ErrorShow(responsePackNew, ""); } } @@ -364,7 +363,7 @@ } else { - Method method = new Method(); + PirMethod method = new PirMethod(); method.ErrorShow(responsePackNew, ""); } }, id, "鍝佺墝鍒楄〃"); diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs index 8916f55..7016043 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMethod.cs @@ -565,6 +565,21 @@ } break; + case "14002": + { + str = Language.StringByID(StringId.bucunzaichanpin); + } + break; + case "10805": + { + str = Language.StringByID(StringId.shebeibucunzai); + } + break; + case "14006": + { + str = Language.StringByID(StringId.shebeibuzaixian); + } + break; case "2": { str = Language.StringByID(StringId.xitongweihuzhong); @@ -671,13 +686,10 @@ public string id = ""; public List<Objects> objects = new List<Objects>(); public string time_stamp = string.Empty; - - } [Serializable] public class Objects { - public string sid = string.Empty; public string spk = string.Empty; public List<Attributes> attributes = new List<Attributes>(); diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs index 169cad3..4f82c23 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs @@ -171,13 +171,13 @@ var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Ir_CodeStudy); if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") { - Method method = new Method(); - Method.buttondata = ""; + PirMethod method = new PirMethod(); + PirMethod.buttondata = ""; cloud = method.MqttDate("鎸夐敭", control.sid, 25); } else { - Method method = new Method(); + PirMethod method = new PirMethod(); method.ErrorShow(responsePackNew, ""); } } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/SetPir.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/SetPir.cs index 74c6a9e..6d9da0c 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/SetPir.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/SetPir.cs @@ -81,10 +81,10 @@ editNameFLayout.btnClick.MouseUpEventHandler += (sender, e) => { List<string> list = new List<string>(); - Method method = new Method(); + PirMethod method = new PirMethod(); method.EditControlName(StringId.editName, list, Pir.currPir.name, (name, dialog) => { - Method.ThreadSend(new Control { deviceId = Pir.currPir.deviceId, name = name }, (responsePackNew) => + PirMethod.ThreadSend(new Control { deviceId = Pir.currPir.deviceId, name = name }, (responsePackNew) => { dialog.Close(); editNameFLayout.btnEditText.Text = name; @@ -102,7 +102,7 @@ tipPopView.TipBox(StringId.tip, text, (dialog) => { - Method.ThreadSend(new Control { deviceId = Pir.currPir.deviceId }, (responsePackNew) => + PirMethod.ThreadSend(new Control { deviceId = Pir.currPir.deviceId }, (responsePackNew) => { var pir = Pir.pirDeviceList.Find((c) => c.deviceId == Pir.currPir.deviceId); if (pir != null) @@ -111,7 +111,7 @@ } dialog.Close(); this.RemoveFromParent(); - Method.RemoveView("PirMain"); + PirMethod.RemoveView("PirMain"); }, "鍒犻櫎", "dialog", null, dialog); }, () => @@ -131,7 +131,7 @@ public override void RemoveFromParent() { //鍒锋柊PirMain鐣岄潰 - Method.RefreshView("PirMain"); + PirMethod.RefreshView("PirMain"); base.RemoveFromParent(); } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs index 6a79288..139d2a6 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs @@ -265,14 +265,14 @@ break; case 5: { - iconPath = "PirIcon/dvd.png"; - deviceNameIndex = StringId.dvd; + iconPath = "PirIcon/projector.png"; + deviceNameIndex = StringId.touyingyi; } break; case 6: { - iconPath = "PirIcon/projector.png"; - deviceNameIndex = StringId.touyingyi; + iconPath = "PirIcon/dvd.png"; + deviceNameIndex = StringId.dvd; } break; case 7: @@ -310,29 +310,28 @@ case 3: { //椋庢墖 - // type = "fan-" + SPK.ElectricFan; + type = "fan-" + SPK.FanIr; } break; case 4: { //鏈洪《鐩� - // type = "set_top_box-" + SPK.ElectricTV; + type = "set_top_box-" + SPK.StbIr; } break; case 5: { - //褰辩鏈� - // type = "dvd-" + SPK.ElectricTV; + //鎶曞奖浠� + type = "projector-" + SPK.PjtIr; } break; case 6: { - //鎶曞奖浠� - // type = "projector-" + SPK.ElectricTV; + //褰辩鏈� + type = "dvd-" + SPK.DvDIr; + } break; - - } return type; } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/PirView.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/PirView.cs index d2fe09a..109b77c 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/PirView.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/PirView.cs @@ -38,7 +38,7 @@ { Y = Application.GetRealHeight(16), X = Application.GetRealWidth(72), - Width = Application.GetRealWidth(120), + Width = Application.GetRealWidth(120+80), Height = Application.GetRealHeight(20), //Text = pirDevice.name, TextAlignment = TextAlignment.CenterLeft, diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs index b08335b..f5f140a 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs @@ -189,7 +189,7 @@ } else { - Method method = new Method(); + PirMethod method = new PirMethod(); //鑷畾涔夐敊璇彁绀烘枃鏈� string eorroText = ""; if (str == "鑾峰彇鍙瀵硅") -- Gitblit v1.8.0