From 99da2604f81af29afc6b3c6f4f128b4e5a8a5649 Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期三, 13 五月 2020 12:00:54 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev-tzy' into dev-2020xm --- ZigbeeApp/GateWay.Droid/Assets/Language.ini | 19 ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs | 101 ZigbeeApp/Shared/Phone/ZigBee/Device/BindObj.cs | 108 ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs | 91 ZigbeeApp/GateWay.Droid/Assets/Phone/PM2.5Sensor/HumidityPic.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs | 2 ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirQualitySensorEpointSelected2.png | 0 ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMemoryListDeviceForm.cs | 79 ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj | 24 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs | 6 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs | 6 ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs | 45 ZigbeeApp/Shared/Common/CommonPage.cs | 2 ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs | 14 ZigbeeApp/Shared/Phone/Device/Logic/Send.cs | 9 ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirQualitySensorEpointSelected.png | 0 ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs | 4 ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs | 50 ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs | 810 +----- ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs | 34 ZigbeeApp/Shared/Phone/ZigBee/Device/Rollershade.cs | 83 ZigbeeApp/Shared/Phone/UserView/UserPage.cs | 23 ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs | 341 ++ ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs | 2 ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs | 172 - ZigbeeApp/Shared/Phone/ZigBee/Device/IASZone.cs | 90 ZigbeeApp/Shared/Common/SceneUI.cs | 2 ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml | 2 ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceFreshAirDetailCardForm.cs | 12 ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs | 537 --- ZigbeeApp/Shared/Phone/ZigBee/Device/AC.cs | 63 ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs | 1462 ++++-------- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs | 6 ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs | 3 ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs | 6 ZigbeeApp/Shared/Phone/ZigBee/Device/DimmableLight.cs | 1 ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/nextIconSone.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs | 3 ZigbeeApp/Shared/Phone/ZigBee/Device/PMSensor.cs | 15 ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TipView.cs | 27 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs | 2 ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs | 301 -- ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs | 2 ZigbeeApp/Home.Ios/Resources/Language.ini | 198 ZigbeeApp/GateWay.Droid/Assets/Phone/PM2.5Sensor/PmPic.png | 0 ZigbeeApp/Home.Ios/Home.IOS.csproj | 8 ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetAddMenuForm.cs | 2 ZigbeeApp/Shared/R.cs | 174 ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs | 2 ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs | 4 ZigbeeApp/Shared/Phone/ZigBee/Device/LigthtBase.cs | 14 ZigbeeApp/Shared/Phone/ZigBee/Device/FreshAir.cs | 7 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs | 26 ZigbeeApp/Shared/Common/Device.cs | 58 ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs | 38 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs | 18 ZigbeeApp/GateWay.Droid/Assets/Phone/PM2.5Sensor/TemperaturePic.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs | 4 ZigbeeApp/Shared/Phone/MainPage/ControlForm/DevicePmSensorDetailCardForm.cs | 4 ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirQualitySensorEpoint.png | 0 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs | 2 ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/nextIconSone.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs | 10 ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs | 227 - ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs | 13 ZigbeeApp/Shared/Shared.projitems | 6 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/DeviceFunctionTypeRowControl.cs | 8 ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs | 6 /dev/null | 40 ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs | 58 ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs | 4 ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs | 1304 ++--------- ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs | 1 ZigbeeApp/GateWay.Droid/Assets/Phone/RealDevice/SensorPMTwoPointFive.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs | 2 ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorPMTwoPointFive.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs | 4 ZigbeeApp/Shared/Common/House.cs | 5 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs | 1 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayUpdateLogic.cs | 10 82 files changed, 2,334 insertions(+), 4,487 deletions(-) diff --git a/ZigbeeApp/GateWay.Droid/Assets/Language.ini b/ZigbeeApp/GateWay.Droid/Assets/Language.ini index 6c4e455..4b50e52 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Language.ini +++ b/ZigbeeApp/GateWay.Droid/Assets/Language.ini @@ -237,12 +237,12 @@ 231=鎺ヨ繎鎰熷簲 232=鎺ヨ繎鎰熷簲鍔熻兘璁剧疆缃け璐� 233=鑾峰彇鎺ヨ繎鎰熷簲鍔熻兘澶辫触 -235=鎸変綇闈㈡澘妯″紡鎸夐敭5绉掞紝缁胯壊鎸囩ず鐏棯鐑亄0}杩涘叆閰嶇綉鐘舵�侊紱闂儊鍋滄{0}鎸囩ず鐏彉鐧借壊琛ㄧず閰嶇綉鎴愬姛 +235=鎸変綇闈㈡澘妯″紡鎸夐敭5绉掞紝缁胯壊鎸囩ず鐏棯鐑亄0}杩涘叆閰嶇綉鐘舵�侊紱闂儊鍋滄{0}鎸囩ず鐏彉鐧借壊琛ㄧず閰嶇綉鎴愬姛 236=缁胯壊鎸囩ず鐏棯鐑� 237=鎸囩ず鐏� 238=闀挎寜5绉掞紙鎸夐敭锛� 239=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑亄0}杩涘叆閰嶇綉鐘舵�併�傜豢鐏唲鐏垯閰嶇綉鎴愬姛 -241=璁剧疆甯稿紑妯″紡鍚庯紝鎮ㄧ殑闂ㄩ攣灏嗗缁坽0}澶勪簬鎵撳紑鐘舵�侊紝纭寮�鍚紵 +241=璁剧疆甯稿紑妯″紡鍚庯紝鎮ㄧ殑闂ㄩ攣灏嗗缁坽0}澶勪簬鎵撳紑鐘舵�侊紝纭寮�鍚紵 242=鐢甸噺 243=甯稿紑妯″紡宸插紑鍚� 244=澶辨晥璁剧疆 @@ -263,10 +263,10 @@ 259=澶辨晥鏃堕棿涓嶅悎娉曪紝璇烽噸鍐欒缃� 260=闊抽噺璁剧疆澶辫触 261=闊抽噺璁剧疆鎴愬姛 -262=褰撳墠鏃跺尯 +262=褰撳墠鏃跺尯 263=鍖� 264=涓� -265=瑗� +265=瑗� 266=褰撳墠璁惧涓嶅湪绾� 267=鑾峰彇闊抽噺澶辫触 268=纭畾鍙栨秷璇ユ垚鍛樼殑杩滅▼寮�閿佹潈闄� @@ -315,6 +315,8 @@ 312= 鑳屽厜鐏鑹� 313=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝淇″彿鍥炬爣{0}蹇棯锛� 杩涘叆閰嶇綉鐘舵�併�備俊鍙峰浘鏍囧父浜垯閰嶇綉鎴愬姛 314=鑷姩妯″紡涓嶆敮鎸佹搷浣� +315=绌烘皵璐ㄩ噺 +316=绌烘皵璐ㄩ噺浼犳劅鍣� 5097=鍙栨秷 5098=纭畾 @@ -582,7 +584,7 @@ 5390=澶辨晥璁剧疆 5391=灏忔椂 5392=闂ㄩ攣濮嬬粓鎵撳紑 -5393=璁剧疆甯稿紑妯″紡鍚庯紝鎮ㄧ殑闂ㄩ攣灏嗗缁坽0}澶勪簬鎵撳紑鐘舵�侊紝纭寮�鍚紵 +5393=璁剧疆甯稿紑妯″紡鍚庯紝鎮ㄧ殑闂ㄩ攣灏嗗缁坽0}澶勪簬鎵撳紑鐘舵�侊紝纭寮�鍚紵 5394=涓嶈兘灏忎簬1灏忔椂 5395=澶т簬12灏忔椂 5396=鎴� @@ -590,8 +592,8 @@ 5398=鍙敮鎸佹暟瀛楄緭鍏� 5399=鍏抽棴澶辫触 -5400=寮�鍚け璐� -5401=娣诲姞澶辫触 +5400=寮�鍚父寮�妯″紡澶辫触 +5401=娣诲姞鏃舵晥鎬у父寮�璁剧疆澶辫触 5402=鏃舵晥鎬у父寮�璁剧疆 5403=鏃跺叧闂� @@ -1994,6 +1996,7 @@ 40016=鐏厜 40017=骞叉帴鐐� 40018=鏂伴 +40019=绌烘皵璐ㄩ噺 ;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄ā鍧桰D鐨勮澶囬粯璁ゅ娉ㄥ悕瀛�,浠�50000寮�濮�.娉�:瀹冨苟涓嶉渶瑕佸啀R.cs鏂囦欢涓畾涔夆槄鈽呪槄鈽� 50000=绱ф�ユ寜閽� @@ -2079,4 +2082,4 @@ 70023=涓户鍣� 70024=鏅鸿兘绌哄紑 70025=鍚搁《鐕冩皵浼犳劅鍣� -70026=PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� \ No newline at end of file +70026=PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirQualitySensorEpoint.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirQualitySensorEpoint.png new file mode 100755 index 0000000..45505ef --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirQualitySensorEpoint.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirQualitySensorEpointSelected.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirQualitySensorEpointSelected.png new file mode 100755 index 0000000..1b29393 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirQualitySensorEpointSelected.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirQualitySensorEpointSelected2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirQualitySensorEpointSelected2.png new file mode 100755 index 0000000..ea2a043 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/AirQualitySensorEpointSelected2.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorPMTwoPointFive.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorPMTwoPointFive.png index 32335b9..c565f13 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorPMTwoPointFive.png +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Device/SensorPMTwoPointFive.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/PM2.5Sensor/HumidityPic.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/PM2.5Sensor/HumidityPic.png new file mode 100755 index 0000000..41c0a55 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/PM2.5Sensor/HumidityPic.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/PM2.5Sensor/PmPic.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/PM2.5Sensor/PmPic.png new file mode 100755 index 0000000..dda5009 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/PM2.5Sensor/PmPic.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/PM2.5Sensor/TemperaturePic.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/PM2.5Sensor/TemperaturePic.png new file mode 100755 index 0000000..72cf579 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/PM2.5Sensor/TemperaturePic.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/RealDevice/SensorPMTwoPointFive.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/RealDevice/SensorPMTwoPointFive.png new file mode 100755 index 0000000..de0004d --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/RealDevice/SensorPMTwoPointFive.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/nextIconSone.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/nextIconSone.png new file mode 100755 index 0000000..0551bca --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/nextIconSone.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj index 9a06d03..f74407e 100644 --- a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj +++ b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj @@ -2137,6 +2137,30 @@ <ItemGroup> <AndroidAsset Include="Assets\Phone\Instruct\SensorPMTwoPointFive.png" /> </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\ZigeeLogic\nextIconSone.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Device\AirQualitySensorEpoint.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Device\AirQualitySensorEpointSelected.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Device\AirQualitySensorEpointSelected2.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\RealDevice\SensorPMTwoPointFive.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\PM2.5Sensor\HumidityPic.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\PM2.5Sensor\PmPic.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\PM2.5Sensor\TemperaturePic.png" /> + </ItemGroup> <Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> <Import Project="..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Annotations.26.0.2\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets')" /> diff --git a/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml b/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml index 4bd5c4d..06662d7 100644 --- a/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml +++ b/ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2020050601" android:installLocation="auto" android:versionName="1.0.20050601"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2020050901" android:installLocation="auto" android:versionName="1.0.20050901"> <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="26" /> <permission android:name="com.hdl.home.permission.JPUSH_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> diff --git a/ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs b/ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs index 2c814cd..1a094aa 100644 --- a/ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs +++ b/ZigbeeApp/GateWay.Droid/Resources/Resource.designer.cs @@ -13,159 +13,178 @@ namespace GateWay.Droid { - - + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] public partial class Resource { - + static Resource() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } - + public static void UpdateIdValues() { } - + public partial class Attribute { - + static Attribute() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } - + private Attribute() { } } - + public partial class Drawable { - + // aapt resource value: 0x7F010000 public const int Icon = 2130771968; - + // aapt resource value: 0x7F010001 public const int Loading = 2130771969; - + static Drawable() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } - + private Drawable() { } } - + public partial class Id { - + // aapt resource value: 0x7F020000 public const int myButton = 2130837504; - + // aapt resource value: 0x7F020001 public const int tv_zxing_back = 2130837505; - + // aapt resource value: 0x7F020002 public const int tv_zxing_flash = 2130837506; - + // aapt resource value: 0x7F020003 public const int tv_zxing_scan = 2130837507; - + static Id() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } - + private Id() { } } - + public partial class Layout { - + // aapt resource value: 0x7F030000 public const int Main = 2130903040; - + // aapt resource value: 0x7F030001 public const int zxing_layout = 2130903041; - + static Layout() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } - + private Layout() { } } - + public partial class Mipmap { - + // aapt resource value: 0x7F040000 public const int Icon = 2130968576; - + static Mipmap() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } - + private Mipmap() { } } - + public partial class String { - + // aapt resource value: 0x7F050000 public const int app_name = 2131034112; - + // aapt resource value: 0x7F050001 public const int hello = 2131034113; - + static String() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } - + private String() { } } - + public partial class Style { - + // aapt resource value: 0x7F060000 public const int MyTheme = 2131099648; - + static Style() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } - + private Style() { } } - + public partial class Xml { - + // aapt resource value: 0x7F070000 public const int file_paths = 2131165184; - + static Xml() { global::Android.Runtime.ResourceIdManager.UpdateIdValues(); } - + + private Xml() + { + } + } + + public partial class Xml + { + + // aapt resource value: 0x7F100000 + public const int file_paths = 2131755008; + + // aapt resource value: 0x7F100001 + public const int hdl_filepaths = 2131755009; + + static Xml() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + private Xml() { } diff --git a/ZigbeeApp/Home.Ios/Home.IOS.csproj b/ZigbeeApp/Home.Ios/Home.IOS.csproj index 6fe6758..1b79083 100644 --- a/ZigbeeApp/Home.Ios/Home.IOS.csproj +++ b/ZigbeeApp/Home.Ios/Home.IOS.csproj @@ -594,6 +594,9 @@ <BundleResource Include="Resources\Phone\Item\SelectHouse.png" /> <BundleResource Include="Resources\Phone\Item\ScanQRcodeIconSelected.png" /> <BundleResource Include="Resources\Phone\Item\InputAccountIconSelected.png" /> + <BundleResource Include="Resources\Phone\PM2.5Sensor\PmPic.png" /> + <BundleResource Include="Resources\Phone\PM2.5Sensor\TemperaturePic.png" /> + <BundleResource Include="Resources\Phone\PM2.5Sensor\HumidityPic.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\deviceselectedbackgroundcolor.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\add.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\sensor0.png" /> @@ -670,6 +673,7 @@ <BundleResource Include="Resources\Phone\ZigeeLogic\selectedac.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\openMode.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\selectedsensor21.png" /> + <BundleResource Include="Resources\Phone\ZigeeLogic\nextIconSone.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\3.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\back.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\selectedtemperature.png" /> @@ -704,6 +708,7 @@ <BundleResource Include="Resources\Phone\Device\IntelligentLocksH06CSelected.png" /> <BundleResource Include="Resources\Phone\Device\CurtainSelected2.png" /> <BundleResource Include="Resources\Phone\Device\Relay.png" /> + <BundleResource Include="Resources\Phone\Device\AirQualitySensorEpoint.png" /> <BundleResource Include="Resources\Phone\Device\SensorWaterSelected.png" /> <BundleResource Include="Resources\Phone\Device\SensorInfrared.png" /> <BundleResource Include="Resources\Phone\Device\ButtonPanelFangyueFreshAir.png" /> @@ -742,6 +747,7 @@ <BundleResource Include="Resources\Phone\Device\AirSwitchSelected2.png" /> <BundleResource Include="Resources\Phone\Device\ConverterSelected2.png" /> <BundleResource Include="Resources\Phone\Device\AirSwitchSelected.png" /> + <BundleResource Include="Resources\Phone\Device\AirQualitySensorEpointSelected.png" /> <BundleResource Include="Resources\Phone\Device\IntelligentLocksSelected.png" /> <BundleResource Include="Resources\Phone\Device\RelaySelected.png" /> <BundleResource Include="Resources\Phone\Device\Socket1Selected.png" /> @@ -770,6 +776,7 @@ <BundleResource Include="Resources\Phone\Device\SensorFireSelected.png" /> <BundleResource Include="Resources\Phone\Device\ColorLight.png" /> <BundleResource Include="Resources\Phone\Device\AirConditionerZbGatewaySelected.png" /> + <BundleResource Include="Resources\Phone\Device\AirQualitySensorEpointSelected2.png" /> <BundleResource Include="Resources\Phone\Device\Switch.png" /> <BundleResource Include="Resources\Phone\Device\AirConditionerSelected.png" /> <BundleResource Include="Resources\Phone\Device\ButtonPanel.png" /> @@ -1004,6 +1011,7 @@ <BundleResource Include="Resources\Phone\RealDevice\ButtonPanelFangyueEight.png" /> <BundleResource Include="Resources\Phone\RealDevice\SensorFire.png" /> <BundleResource Include="Resources\Phone\RealDevice\ButtonPanelThree.png" /> + <BundleResource Include="Resources\Phone\RealDevice\SensorPMTwoPointFive.png" /> <BundleResource Include="Resources\Phone\RealDevice\SensorCarbonMonoxide.png" /> <BundleResource Include="Resources\Phone\RealDevice\DimmableLightOneLoad.png" /> <BundleResource Include="Resources\Phone\RealDevice\ButtonPanelFangyueTwo.png" /> diff --git a/ZigbeeApp/Home.Ios/Resources/Language.ini b/ZigbeeApp/Home.Ios/Resources/Language.ini index cf448d2..77667b9 100755 --- a/ZigbeeApp/Home.Ios/Resources/Language.ini +++ b/ZigbeeApp/Home.Ios/Resources/Language.ini @@ -237,12 +237,12 @@ 231=鎺ヨ繎鎰熷簲 232=鎺ヨ繎鎰熷簲鍔熻兘璁剧疆缃け璐� 233=鑾峰彇鎺ヨ繎鎰熷簲鍔熻兘澶辫触 -235=鎸変綇闈㈡澘妯″紡鎸夐敭5绉掞紝缁胯壊鎸囩ず鐏棯鐑亄0}杩涘叆閰嶇綉鐘舵�侊紱闂儊鍋滄{0}鎸囩ず鐏彉鐧借壊琛ㄧず閰嶇綉鎴愬姛 +235=鎸変綇闈㈡澘妯″紡鎸夐敭5绉掞紝缁胯壊鎸囩ず鐏棯鐑亄0}杩涘叆閰嶇綉鐘舵�侊紱闂儊鍋滄{0}鎸囩ず鐏彉鐧借壊琛ㄧず閰嶇綉鎴愬姛 236=缁胯壊鎸囩ず鐏棯鐑� 237=鎸囩ず鐏� 238=闀挎寜5绉掞紙鎸夐敭锛� 239=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑亄0}杩涘叆閰嶇綉鐘舵�併�傜豢鐏唲鐏垯閰嶇綉鎴愬姛 -241=璁剧疆甯稿紑妯″紡鍚庯紝鎮ㄧ殑闂ㄩ攣灏嗗缁坽0}澶勪簬鎵撳紑鐘舵�侊紝纭寮�鍚紵 +241=璁剧疆甯稿紑妯″紡鍚庯紝鎮ㄧ殑闂ㄩ攣灏嗗缁坽0}澶勪簬鎵撳紑鐘舵�侊紝纭寮�鍚紵 242=鐢甸噺 243=甯稿紑妯″紡宸插紑鍚� 244=澶辨晥璁剧疆 @@ -263,10 +263,10 @@ 259=澶辨晥鏃堕棿涓嶅悎娉曪紝璇烽噸鍐欒缃� 260=闊抽噺璁剧疆澶辫触 261=闊抽噺璁剧疆鎴愬姛 -262=褰撳墠鏃跺尯 +262=褰撳墠鏃跺尯 263=鍖� 264=涓� -265=瑗� +265=瑗� 266=褰撳墠璁惧涓嶅湪绾� 267=鑾峰彇闊抽噺澶辫触 268=纭畾鍙栨秷璇ユ垚鍛樼殑杩滅▼寮�閿佹潈闄� @@ -584,7 +584,7 @@ 5390=澶辨晥璁剧疆 5391=灏忔椂 5392=闂ㄩ攣濮嬬粓鎵撳紑 -5393=璁剧疆甯稿紑妯″紡鍚庯紝鎮ㄧ殑闂ㄩ攣灏嗗缁坽0}澶勪簬鎵撳紑鐘舵�侊紝纭寮�鍚紵 +5393=璁剧疆甯稿紑妯″紡鍚庯紝鎮ㄧ殑闂ㄩ攣灏嗗缁坽0}澶勪簬鎵撳紑鐘舵�侊紝纭寮�鍚紵 5394=涓嶈兘灏忎簬1灏忔椂 5395=澶т簬12灏忔椂 5396=鎴� @@ -592,8 +592,8 @@ 5398=鍙敮鎸佹暟瀛楄緭鍏� 5399=鍏抽棴澶辫触 -5400=寮�鍚け璐� -5401=娣诲姞澶辫触 +5400=寮�鍚父寮�妯″紡澶辫触 +5401=娣诲姞鏃舵晥鎬у父寮�璁剧疆澶辫触 5402=鏃舵晥鎬у父寮�璁剧疆 5403=鏃跺叧闂� @@ -1847,95 +1847,95 @@ 16115=甯稿紑鑷姩鍖栨墜鍔ㄥ彇娑� 16116=娓稿浣撻獙 -;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� -18004=鎸囧畾缃戝叧宸茬粡琚粦瀹� -18005=鐢ㄦ埛涓嶅瓨鍦ㄤ簬姝や綇瀹� -18006=璐﹀彿宸茬粡瀛樺湪浜庢浣忓畢 -18009=鎿嶄綔鏉冮檺涓嶈冻 -18010=琚粦瀹氱殑瀛愯处鍙蜂笉瀛樺湪锛岃娉ㄥ唽鍚庡啀璇� -18011=鎿嶄綔鐨勫瓙璐﹀彿涓嶅瓨鍦� -18012=瑙i櫎缁戝畾鐨勫瓙璐﹀彿涓嶅瓨鍦� -18013=楠岃瘉鐮佸彂閫佸け璐� -18015=璐﹀彿宸茬粡瀛樺湪 -18016=楠岃瘉鐮侀敊璇� -18017=楠岃瘉鐮佸凡澶辨晥 -18018=缁戝畾鐨勮处鍙蜂笉瀛樺湪 -18019=鎸囧畾璐﹀彿宸插瓨鍦� -18022=楠岃瘉鐮佸彂閫佸け璐� -18024=鎸囧畾璐﹀彿涓嶅瓨鍦� -18025=鍘熷瘑鐮佸拰鏂板瘑鐮佺浉鍚� -18026=鍘熷瘑鐮侀敊璇� -18034=璐﹀彿鏈敞鍐� -18035=璇锋眰鍙傛暟閿欒 -18036=鏃犳晥鐨勭櫥褰曞瘑鍖� -18039=褰撳墠缂栬緫鐨勪綇瀹呭悕绉板凡缁忓瓨鍦� -18040=褰撳墠娣诲姞鐨勪綇瀹呭悕绉板凡缁忓瓨鍦� -18041=鎸囧畾鐨勪綇瀹呬笉瀛樺湪 -18042=褰撳墠澶囦唤涓嶅睘浜庢偍褰撳墠鐨勪綇瀹� -18043=澶囨敞鍚嶇О宸茬粡瀛樺湪,璇锋洿鎹㈠悗閲嶈瘯锛� -18044=鎸囧畾鐨勭綉鍏矷D骞朵笉瀛樺湪 -18045=褰撳墠浣忓畢涓嬪苟娌℃湁缁戝畾鎸囧畾鐨勭綉鍏� -18046=褰撳墠浣忓畢杩樺瓨鍦ㄧ潃鏈В闄ょ粦瀹氱殑缃戝叧 -18047=鍏变韩鏁版嵁涓嶅瓨鍦� -18048=鍒嗕韩鐨勭洰鏍囪处鍙蜂笉瀛樺湪 -18049=鍒嗕韩鏁版嵁鎿嶄綔澶辫触 -18050=涓嶈兘鎶婅嚜宸辨坊鍔犱负鎴愬憳 -18051=涓嶈兘鎶婁富璐﹀彿娣诲姞涓烘垚鍛� - - -;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄澶囩殑鍏ョ綉姝ラ,浠�21000寮�濮嬧槄鈽呪槄鈽� -;鏅鸿兘闂ㄩ攣鍏ョ綉鎿嶄綔鎸囩ず -21000=鍞ら啋闂ㄩ攣锛岃緭鍏モ��*鈥濄�佲��#鈥濄�佲�滅鐞嗗憳瀵嗙爜鈥漿0}鎸夎闊虫彁绀猴紝杈撳叆鈥�4鈥濋�夋嫨鍔熻兘鑿滃崟{0}杈撳叆鈥�1鈥濓紝纭璁惧鍏ョ綉 -;3璺户鐢靛櫒鍏ョ綉鎿嶄綔鎸囩ず -21001=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑亄0}杩涘叆閰嶇綉鐘舵�併�傜豢鐏唲鐏垯閰嶇綉鎴愬姛 -;1璺皟鍏夊櫒灏忔ā鍧楀叆缃戞搷浣滄寚绀� -21002=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑亄0}杩涘叆閰嶇綉鐘舵�併�傜豢鐏唲鐏垯閰嶇綉鎴愬姛 -;浜屾寜閿潰鏉垮叆缃戞搷浣滄寚绀� -21003=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑亄0}杩涘叆閰嶇綉鐘舵�併�傜豢鐏揩闂�3绉掑垯閰嶇綉鎴愬姛 -;涓夋寜閿潰鏉垮叆缃戞搷浣滄寚绀� -21004=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑亄0}杩涘叆閰嶇綉鐘舵�併�傜豢鐏揩闂�3绉掑垯閰嶇綉鎴愬姛 -;鍥涙寜閿潰鏉垮叆缃戞搷浣滄寚绀� -21005=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑亄0}杩涘叆閰嶇綉鐘舵�併�傜豢鐏揩闂�3绉掑垯閰嶇綉鎴愬姛 -;Zigbee鏅鸿兘寮�鍚堝笜鐢垫満鍏ョ綉鎿嶄綔鎸囩ず -21006=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏瘂0}鍙樼豢闂儊锛屽垯杩涘叆閰嶇綉鐘舵�亄0}缁跨伅鐔勭伃鍒欓厤缃戞垚鍔� -;Zigbee鏅鸿兘绠$姸鐢垫満鍏ョ綉鎿嶄綔鎸囩ず -21007=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏瘂0}鍙樼豢闂儊锛屽垯杩涘叆閰嶇綉鐘舵�亄0}缁跨伅鐔勭伃鍒欓厤缃戞垚鍔� -;绾㈠浼犳劅鍣ㄥ叆缃戞搷浣滄寚绀� -21008=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝缁胯壊蹇棯{0}杩涘叆閰嶇綉鐘舵�侊紝缁跨伅甯镐寒鍒欏叆缃戞垚鍔� -;闂ㄧ獥浼犳劅鍣ㄥ叆缃戞搷浣滄寚绀� -21009=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝缁胯壊蹇棯{0}杩涘叆閰嶇綉鐘舵�侊紝缁跨伅甯镐寒鍒欏叆缃戞垚鍔� -;鐕冩皵浼犳劅鍣ㄥ叆缃戞搷浣滄寚绀� -21010=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝缁胯壊蹇棯{0}杩涘叆閰嶇綉鐘舵�侊紝缁跨伅甯镐寒鍒欏叆缃戞垚鍔� -;鐑熼浘浼犳劅鍣ㄥ叆缃戞搷浣滄寚绀� -21011=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝缁胯壊蹇棯{0}杩涘叆閰嶇綉鐘舵�侊紝缁跨伅甯镐寒鍒欏叆缃戞垚鍔� -;姘存蹈浼犳劅鍣ㄥ叆缃戞搷浣滄寚绀� -21012=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝缁胯壊蹇棯{0}杩涘叆閰嶇綉鐘舵�侊紝缁跨伅甯镐寒鍒欏叆缃戞垚鍔� -;绌烘皵寮�鍏冲叆缃戞搷浣滄寚绀� -21013=鎸夐敭浠庡伐浣滄ā寮忔嫧鍒伴厤瀵规ā寮�,5绉掑悗绾㈢伅{0}鎱㈤棯鐑佹椂鎷ㄥ洖宸ヤ綔妯″紡,{0}杩涘叆閰嶇綉妯″紡,绾㈢伅甯镐寒鍒欓厤缃戞垚鍔� -;涓户鍣ㄥ叆缃戞搷浣滄寚绀� -21014=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁块棯鐑亄0}杩涘叆閰嶇綉鐘舵�侊紝缁跨伅鐔勭伃鍒欏叆缃戞垚鍔� -;绌鸿皟鍏ョ綉鎿嶄綔鎸囩ず -21015=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏瘂0}鍙樼豢闂儊,杩涘叆閰嶇綉鐘舵�亄0}缁跨伅姣�5绉掗棯鐑佷竴娆″垯鍏ョ綉鎴愬姛 -;pir浼犳劅鍣ㄥ叆缃戞搷浣滄寚绀� -21016=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�亄0}闂儊杩涘叆閰嶇綉鐘舵�併�傜豢鐏唲鐏垯閰嶇綉鎴愬姛 -;娓╂箍搴︿紶鎰熷櫒鍏ョ綉鎿嶄綔鎸囩ず -21017=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝淇″彿鍥炬爣{0}蹇棯锛� 杩涘叆閰嶇綉鐘舵�併�傚浘鏍囧父浜垯閰嶇綉鎴愬姛 -;鏂规偊2鎸夐敭杞昏Е寮忛潰鏉垮叆缃戞搷浣滄寚绀� -21018=闀挎寜BUTTON1鎸夐敭5绉掞紝鎵�鏈夋寚绀虹伅{0}鍙樹负缁胯壊骞堕棯鐑侊紝杩涘叆閰嶇綉鐘舵�� -;鏂规偊4鎸夐敭杞昏Е寮忛潰鏉垮叆缃戞搷浣滄寚绀� -21019=闀挎寜BUTTON1鎸夐敭5绉掞紝鎵�鏈夋寚绀虹伅{0}鍙樹负缁胯壊骞堕棯鐑侊紝杩涘叆閰嶇綉鐘舵�� -;鏂规偊8鎸夐敭杞昏Е寮忛潰鏉垮叆缃戞搷浣滄寚绀� -21020=闀挎寜BUTTON1鎸夐敭5绉掞紝鎵�鏈夋寚绀虹伅{0}鍙樹负缁胯壊骞堕棯鐑侊紝杩涘叆閰嶇綉鐘舵�� -;鏂规偊鐜闈㈡澘鍏ョ綉鎿嶄綔鎸囩ず -21021=鎸変綇闈㈡澘鍔熻兘(function)鎸夐敭锛屾墍鏈夋寜閿畕0}鎸囩ず鐏寒璧凤紝鍒欓厤缃戞垚鍔� -;绐楀笜闈㈡澘鐨勫叆缃戞搷浣滄寚绀� -21022=闀挎寜闈㈡澘宸︿笂瑙掓寜閿紝鎵�鏈夋寜閿畕0}鎸囩ず鐏寒璧凤紝鍒欓厤缃戞垚鍔� -;鍚搁《鐕冩皵浼犳劅鍣ㄧ殑鍏ョ綉鎿嶄綔鎸囩ず -21023=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝缁胯壊蹇棯{0}杩涘叆閰嶇綉鐘舵�侊紝缁跨伅甯镐寒鍒欏叆缃戞垚鍔� - -;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄ā鍧桰D鐨勫畼鏂瑰悕瀛�,浠�30000寮�濮嬧槄鈽呪槄鈽� -30000=绱ф�ユ寜閽� -30001=鐕冩皵浼犳劅鍣� +;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� +18004=鎸囧畾缃戝叧宸茬粡琚粦瀹� +18005=鐢ㄦ埛涓嶅瓨鍦ㄤ簬姝や綇瀹� +18006=璐﹀彿宸茬粡瀛樺湪浜庢浣忓畢 +18009=鎿嶄綔鏉冮檺涓嶈冻 +18010=琚粦瀹氱殑瀛愯处鍙蜂笉瀛樺湪锛岃娉ㄥ唽鍚庡啀璇� +18011=鎿嶄綔鐨勫瓙璐﹀彿涓嶅瓨鍦� +18012=瑙i櫎缁戝畾鐨勫瓙璐﹀彿涓嶅瓨鍦� +18013=楠岃瘉鐮佸彂閫佸け璐� +18015=璐﹀彿宸茬粡瀛樺湪 +18016=楠岃瘉鐮侀敊璇� +18017=楠岃瘉鐮佸凡澶辨晥 +18018=缁戝畾鐨勮处鍙蜂笉瀛樺湪 +18019=鎸囧畾璐﹀彿宸插瓨鍦� +18022=楠岃瘉鐮佸彂閫佸け璐� +18024=鎸囧畾璐﹀彿涓嶅瓨鍦� +18025=鍘熷瘑鐮佸拰鏂板瘑鐮佺浉鍚� +18026=鍘熷瘑鐮侀敊璇� +18034=璐﹀彿鏈敞鍐� +18035=璇锋眰鍙傛暟閿欒 +18036=鏃犳晥鐨勭櫥褰曞瘑鍖� +18039=褰撳墠缂栬緫鐨勪綇瀹呭悕绉板凡缁忓瓨鍦� +18040=褰撳墠娣诲姞鐨勪綇瀹呭悕绉板凡缁忓瓨鍦� +18041=鎸囧畾鐨勪綇瀹呬笉瀛樺湪 +18042=褰撳墠澶囦唤涓嶅睘浜庢偍褰撳墠鐨勪綇瀹� +18043=澶囨敞鍚嶇О宸茬粡瀛樺湪,璇锋洿鎹㈠悗閲嶈瘯锛� +18044=鎸囧畾鐨勭綉鍏矷D骞朵笉瀛樺湪 +18045=褰撳墠浣忓畢涓嬪苟娌℃湁缁戝畾鎸囧畾鐨勭綉鍏� +18046=褰撳墠浣忓畢杩樺瓨鍦ㄧ潃鏈В闄ょ粦瀹氱殑缃戝叧 +18047=鍏变韩鏁版嵁涓嶅瓨鍦� +18048=鍒嗕韩鐨勭洰鏍囪处鍙蜂笉瀛樺湪 +18049=鍒嗕韩鏁版嵁鎿嶄綔澶辫触 +18050=涓嶈兘鎶婅嚜宸辨坊鍔犱负鎴愬憳 +18051=涓嶈兘鎶婁富璐﹀彿娣诲姞涓烘垚鍛� + + +;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄澶囩殑鍏ョ綉姝ラ,浠�21000寮�濮嬧槄鈽呪槄鈽� +;鏅鸿兘闂ㄩ攣鍏ョ綉鎿嶄綔鎸囩ず +21000=鍞ら啋闂ㄩ攣锛岃緭鍏モ��*鈥濄�佲��#鈥濄�佲�滅鐞嗗憳瀵嗙爜鈥漿0}鎸夎闊虫彁绀猴紝杈撳叆鈥�4鈥濋�夋嫨鍔熻兘鑿滃崟{0}杈撳叆鈥�1鈥濓紝纭璁惧鍏ョ綉 +;3璺户鐢靛櫒鍏ョ綉鎿嶄綔鎸囩ず +21001=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑亄0}杩涘叆閰嶇綉鐘舵�併�傜豢鐏唲鐏垯閰嶇綉鎴愬姛 +;1璺皟鍏夊櫒灏忔ā鍧楀叆缃戞搷浣滄寚绀� +21002=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑亄0}杩涘叆閰嶇綉鐘舵�併�傜豢鐏唲鐏垯閰嶇綉鎴愬姛 +;浜屾寜閿潰鏉垮叆缃戞搷浣滄寚绀� +21003=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑亄0}杩涘叆閰嶇綉鐘舵�併�傜豢鐏揩闂�3绉掑垯閰嶇綉鎴愬姛 +;涓夋寜閿潰鏉垮叆缃戞搷浣滄寚绀� +21004=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑亄0}杩涘叆閰嶇綉鐘舵�併�傜豢鐏揩闂�3绉掑垯閰嶇綉鎴愬姛 +;鍥涙寜閿潰鏉垮叆缃戞搷浣滄寚绀� +21005=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�侀棯鐑亄0}杩涘叆閰嶇綉鐘舵�併�傜豢鐏揩闂�3绉掑垯閰嶇綉鎴愬姛 +;Zigbee鏅鸿兘寮�鍚堝笜鐢垫満鍏ョ綉鎿嶄綔鎸囩ず +21006=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏瘂0}鍙樼豢闂儊锛屽垯杩涘叆閰嶇綉鐘舵�亄0}缁跨伅鐔勭伃鍒欓厤缃戞垚鍔� +;Zigbee鏅鸿兘绠$姸鐢垫満鍏ョ綉鎿嶄綔鎸囩ず +21007=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏瘂0}鍙樼豢闂儊锛屽垯杩涘叆閰嶇綉鐘舵�亄0}缁跨伅鐔勭伃鍒欓厤缃戞垚鍔� +;绾㈠浼犳劅鍣ㄥ叆缃戞搷浣滄寚绀� +21008=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝缁胯壊蹇棯{0}杩涘叆閰嶇綉鐘舵�侊紝缁跨伅甯镐寒鍒欏叆缃戞垚鍔� +;闂ㄧ獥浼犳劅鍣ㄥ叆缃戞搷浣滄寚绀� +21009=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝缁胯壊蹇棯{0}杩涘叆閰嶇綉鐘舵�侊紝缁跨伅甯镐寒鍒欏叆缃戞垚鍔� +;鐕冩皵浼犳劅鍣ㄥ叆缃戞搷浣滄寚绀� +21010=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝缁胯壊蹇棯{0}杩涘叆閰嶇綉鐘舵�侊紝缁跨伅甯镐寒鍒欏叆缃戞垚鍔� +;鐑熼浘浼犳劅鍣ㄥ叆缃戞搷浣滄寚绀� +21011=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝缁胯壊蹇棯{0}杩涘叆閰嶇綉鐘舵�侊紝缁跨伅甯镐寒鍒欏叆缃戞垚鍔� +;姘存蹈浼犳劅鍣ㄥ叆缃戞搷浣滄寚绀� +21012=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝缁胯壊蹇棯{0}杩涘叆閰嶇綉鐘舵�侊紝缁跨伅甯镐寒鍒欏叆缃戞垚鍔� +;绌烘皵寮�鍏冲叆缃戞搷浣滄寚绀� +21013=鎸夐敭浠庡伐浣滄ā寮忔嫧鍒伴厤瀵规ā寮�,5绉掑悗绾㈢伅{0}鎱㈤棯鐑佹椂鎷ㄥ洖宸ヤ綔妯″紡,{0}杩涘叆閰嶇綉妯″紡,绾㈢伅甯镐寒鍒欓厤缃戞垚鍔� +;涓户鍣ㄥ叆缃戞搷浣滄寚绀� +21014=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁块棯鐑亄0}杩涘叆閰嶇綉鐘舵�侊紝缁跨伅鐔勭伃鍒欏叆缃戞垚鍔� +;绌鸿皟鍏ョ綉鎿嶄綔鎸囩ず +21015=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏瘂0}鍙樼豢闂儊,杩涘叆閰嶇綉鐘舵�亄0}缁跨伅姣�5绉掗棯鐑佷竴娆″垯鍏ョ綉鎴愬姛 +;pir浼犳劅鍣ㄥ叆缃戞搷浣滄寚绀� +21016=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝鎸囩ず鐏彉缁裤�亄0}闂儊杩涘叆閰嶇綉鐘舵�併�傜豢鐏唲鐏垯閰嶇綉鎴愬姛 +;娓╂箍搴︿紶鎰熷櫒鍏ョ綉鎿嶄綔鎸囩ず +21017=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝淇″彿鍥炬爣{0}蹇棯锛� 杩涘叆閰嶇綉鐘舵�併�傚浘鏍囧父浜垯閰嶇綉鎴愬姛 +;鏂规偊2鎸夐敭杞昏Е寮忛潰鏉垮叆缃戞搷浣滄寚绀� +21018=闀挎寜BUTTON1鎸夐敭5绉掞紝鎵�鏈夋寚绀虹伅{0}鍙樹负缁胯壊骞堕棯鐑侊紝杩涘叆閰嶇綉鐘舵�� +;鏂规偊4鎸夐敭杞昏Е寮忛潰鏉垮叆缃戞搷浣滄寚绀� +21019=闀挎寜BUTTON1鎸夐敭5绉掞紝鎵�鏈夋寚绀虹伅{0}鍙樹负缁胯壊骞堕棯鐑侊紝杩涘叆閰嶇綉鐘舵�� +;鏂规偊8鎸夐敭杞昏Е寮忛潰鏉垮叆缃戞搷浣滄寚绀� +21020=闀挎寜BUTTON1鎸夐敭5绉掞紝鎵�鏈夋寚绀虹伅{0}鍙樹负缁胯壊骞堕棯鐑侊紝杩涘叆閰嶇綉鐘舵�� +;鏂规偊鐜闈㈡澘鍏ョ綉鎿嶄綔鎸囩ず +21021=鎸変綇闈㈡澘鍔熻兘(function)鎸夐敭锛屾墍鏈夋寜閿畕0}鎸囩ず鐏寒璧凤紝鍒欓厤缃戞垚鍔� +;绐楀笜闈㈡澘鐨勫叆缃戞搷浣滄寚绀� +21022=闀挎寜闈㈡澘宸︿笂瑙掓寜閿紝鎵�鏈夋寜閿畕0}鎸囩ず鐏寒璧凤紝鍒欓厤缃戞垚鍔� +;鍚搁《鐕冩皵浼犳劅鍣ㄧ殑鍏ョ綉鎿嶄綔鎸囩ず +21023=闀挎寜鍥剧ず鎸夐敭5绉掍互涓婏紝缁胯壊蹇棯{0}杩涘叆閰嶇綉鐘舵�侊紝缁跨伅甯镐寒鍒欏叆缃戞垚鍔� + +;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄ā鍧桰D鐨勫畼鏂瑰悕瀛�,浠�30000寮�濮嬧槄鈽呪槄鈽� +30000=绱ф�ユ寜閽� +30001=鐕冩皵浼犳劅鍣� 30002=鐑熼浘浼犳劅鍣� 30003=姘翠镜浼犳劅鍣� 30004=閽ュ寵鎵� @@ -1996,7 +1996,7 @@ 40016=鐏厜 40017=骞叉帴鐐� 40018=鏂伴 -40019=PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� +40019=绌烘皵璐ㄩ噺 ;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄ā鍧桰D鐨勮澶囬粯璁ゅ娉ㄥ悕瀛�,浠�50000寮�濮�.娉�:瀹冨苟涓嶉渶瑕佸啀R.cs鏂囦欢涓畾涔夆槄鈽呪槄鈽� 50000=绱ф�ユ寜閽� @@ -2053,7 +2053,7 @@ 60008=杞崲鍣� 60009=绌鸿皟妯″潡 60010=鏅鸿兘闂ㄩ攣 -60011=鏂伴妯″潡 +60011=鏂伴妯″潡 ;//鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄坊鍔犳柊璁惧鐣岄潰閭i噷鏄剧ず鐨勫悕瀛�,浠�70000寮�濮嬧槄鈽呪槄鈽� 70000=2鎸夐敭闈㈡澘 @@ -2082,4 +2082,4 @@ 70023=涓户鍣� 70024=鏅鸿兘绌哄紑 70025=鍚搁《鐕冩皵浼犳劅鍣� -70026=PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� \ No newline at end of file +70026=PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/nextIconSone.png b/ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/nextIconSone.png new file mode 100755 index 0000000..0551bca --- /dev/null +++ b/ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/nextIconSone.png Binary files differ diff --git a/ZigbeeApp/Shared/Common/CommonPage.cs b/ZigbeeApp/Shared/Common/CommonPage.cs index 14d2409..89f2577 100755 --- a/ZigbeeApp/Shared/Common/CommonPage.cs +++ b/ZigbeeApp/Shared/Common/CommonPage.cs @@ -57,7 +57,7 @@ /// <summary> /// 鐗堟湰鍙� /// </summary> - public static string CodeIDString = "1.0.20050701"; + public static string CodeIDString = "1.0.20050901"; /// <summary> /// 娉ㄥ唽鏉ユ簮(0:HDL On 1:Zigbee) /// </summary> diff --git a/ZigbeeApp/Shared/Common/Device.cs b/ZigbeeApp/Shared/Common/Device.cs index 53787a6..85962cc 100644 --- a/ZigbeeApp/Shared/Common/Device.cs +++ b/ZigbeeApp/Shared/Common/Device.cs @@ -271,7 +271,7 @@ //娣诲姞缂撳瓨 this.AddDeviceToMemory(ref device); - //绉婚櫎瀛樺湪鐨勮澶囧唴瀛� + //绉婚櫎瀛樺湪鐨勮澶囧唴瀛� string maikey = this.GetDeviceMainKeys(device); if (dicExist.ContainsKey(maikey) == true) { @@ -441,6 +441,8 @@ //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { + //淇敼璁惧鍚嶅瓧鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂� + Phone.UserView.UserPage.Instance.RefreshForm = true; return true; } @@ -465,6 +467,8 @@ //澶囦唤鏁版嵁 await HdlGatewayLogic.Current.UpLoadDeviceBackupDataToGateway(device, GatewayBackupEnum.A绔偣鍚嶇О, newName); } + //淇敼璁惧鍚嶅瓧鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂� + Phone.UserView.UserPage.Instance.RefreshForm = true; return true; } @@ -1327,7 +1331,7 @@ } /// <summary> - /// 璁剧疆銆愯澶囩被鍨嬨�戠殑鍥炬爣鍒版寚瀹氱殑鎺т欢 + /// 璁剧疆銆愯澶囩被鍨嬨�戠殑鍥炬爣鍒版寚瀹氱殑鎺т欢(姝ゆ柟娉曚笉鑳界敤鍦ㄨ澶囧姛鑳界被鍨嬭彍鍗曠殑鍥炬爣) /// </summary> /// <param name="btnIcon">鎺т欢瀵硅薄</param> /// <param name="listdevice">璁惧瀵硅薄</param> @@ -1349,7 +1353,7 @@ } /// <summary> - /// 鑾峰彇銆愯澶囩被鍨嬨�戠殑鍥炬爣 + /// 鑾峰彇銆愯澶囩被鍨嬨�戠殑鍥炬爣(姝ゆ柟娉曚笉鑳界敤鍦ㄨ澶囧姛鑳界被鍨嬭彍鍗曠殑鍥炬爣) /// </summary> /// <param name="listdevice">璁惧瀵硅薄</param> /// <param name="unSelectPath">鍥剧墖鍦板潃</param> @@ -1365,13 +1369,42 @@ } /// <summary> - /// 鑾峰彇銆愯澶囩被鍨嬨�戠殑鍥炬爣 + /// 鑾峰彇銆愯澶囧姛鑳界被鍨嬨�戠殑鑿滃崟鍥炬爣 /// </summary> /// <param name="specificType">鑷畾涔夎澶囩被鍨�</param> /// <param name="unSelectPath">鍥剧墖鍦板潃</param> /// <param name="selectPath">鍥剧墖鍦板潃</param> /// <returns></returns> - public void GetDeviceObjectIcon(DeviceConcreteType specificType, ref string unSelectPath, ref string selectPath) + public void GetDeviceFunctionTypeMenuIcon(DeviceConcreteType specificType, ref string unSelectPath, ref string selectPath) + { + //鏂伴灏忔ā鍧� + if (specificType == DeviceConcreteType.Relay_FangyueFreshAirModul) + { + unSelectPath = "Device/FreshAirEpoint.png"; + selectPath = "Device/FreshAirEpointSelected.png"; + return; + } + //PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� + else if (specificType == DeviceConcreteType.Sensor_PMTwoPointFive) + { + unSelectPath = "Device/AirQualitySensorEpoint.png"; + selectPath = "Device/AirQualitySensorEpointSelected.png"; + return; + } + //涓婇潰闇�瑕佺壒娈婂鐞� + + //鑾峰彇銆愯澶囩被鍨嬨�戠殑鍥炬爣 + this.GetDeviceObjectIcon(specificType, ref unSelectPath, ref selectPath); + } + + /// <summary> + /// 鑾峰彇銆愯澶囩被鍨嬨�戠殑鍥炬爣 2020.05.13:娆″嚱鏁颁笉鍐嶅叕寮� + /// </summary> + /// <param name="specificType">鑷畾涔夎澶囩被鍨�</param> + /// <param name="unSelectPath">鍥剧墖鍦板潃</param> + /// <param name="selectPath">鍥剧墖鍦板潃</param> + /// <returns></returns> + private void GetDeviceObjectIcon(DeviceConcreteType specificType, ref string unSelectPath, ref string selectPath) { //灏嗗叿浣撶被鍨嬭浆瀛楃涓� string strSpecific = Enum.GetName(typeof(DeviceConcreteType), specificType); @@ -1408,6 +1441,7 @@ unSelectPath = imageFilePath; selectPath = imageSelectFilePath; } + #endregion @@ -1818,7 +1852,7 @@ else if (dicType.ContainsKey(DeviceType.PMSensor) == true) { info.ConcreteTextId = R.MyInternationalizationString.uDeviceModelId1307; - info.BeloneType = DeviceBeloneType.A浼犳劅鍣�; + info.BeloneType = DeviceBeloneType.APM2鐐�5绌烘皵璐ㄩ噺浼犳劅鍣�; info.ConcreteType = DeviceConcreteType.Sensor_PMTwoPointFive; info.ObjectTypeNameId = 60000;//浼犳劅鍣� } @@ -2150,7 +2184,7 @@ /// <returns></returns> public bool CheckDeviceIsOnline(CommonDevice i_device) { - //0:绂荤嚎 1:鍦ㄧ嚎 2:姝e湪鍒锋柊鐘舵�� + //0:绂荤嚎 1:鍦ㄧ嚎 2:姝e湪鍒锋柊鐘舵�� return i_device.IsOnline == 1 || i_device.IsOnline == 2; } @@ -2533,8 +2567,6 @@ mainDevice.InClusterList.AddRange(device.DeviceInfo.InClusterList); mainDevice.OutClusterList.Clear(); mainDevice.OutClusterList.AddRange(device.DeviceInfo.OutClusterList); - mainDevice.AttributeStatus.Clear(); - mainDevice.AttributeStatus.AddRange(device.DeviceInfo.AttributeStatus); //濡傛灉鏄俯搴︿紶鎰熷櫒 if (mainDevice.Type == DeviceType.TemperatureSensor) @@ -2642,11 +2674,9 @@ public void SetNewDeviceMainKeys(CommonDevice device, Newtonsoft.Json.Linq.JObject jobject) { //璁剧疆璁惧涓婚敭绫� - device.Time = jobject.Value<int>("Time"); device.DeviceID = jobject.Value<int>("Device_ID"); device.DeviceAddr = jobject.Value<string>("DeviceAddr"); device.DeviceEpoint = jobject.Value<int>("Epoint"); - device.DataID = jobject.Value<int>("Data_ID"); } #endregion @@ -2731,7 +2761,7 @@ this.dicDeviceModelIdEnum["MGCD01/ZB.10"] = "1306-1200-60000";//鍚搁《鐕冩皵浼犳劅鍣� //PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� 銆愯璁惧灞炰簬绗笁鏂硅澶囷紝娌℃湁闀滃儚ID銆� - this.dicDeviceModelIdEnum["SZ_PM100"] = "1307-1200-60000";//PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� + this.dicDeviceModelIdEnum["SZ_PM100"] = "1307-1200-60000";//PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� //=========鈽呪槄缁х數鍣ㄧ被(2300-2499)鈽呪槄========= this.dicDeviceModelIdEnum["MPR0310-ZB.10"] = "2300-2300-60001";//3璺户鐢靛櫒灏忔ā鍧� @@ -3079,6 +3109,10 @@ /// </summary> A浼犳劅鍣� = 1200, /// <summary> + /// PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� + /// </summary> + APM2鐐�5绌烘皵璐ㄩ噺浼犳劅鍣� = 1307, + /// <summary> /// 缁х數鍣�(2300-2499) /// </summary> A缁х數鍣� = 2300, diff --git a/ZigbeeApp/Shared/Common/House.cs b/ZigbeeApp/Shared/Common/House.cs index dbb051f..96aeddc 100755 --- a/ZigbeeApp/Shared/Common/House.cs +++ b/ZigbeeApp/Shared/Common/House.cs @@ -173,7 +173,9 @@ return; } home.Name = houseName; - home.Save(); + home.Save(); + //浣忓畢淇敼鍚嶇О鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂� + Phone.UserView.UserPage.Instance.RefreshForm = true; } #endregion @@ -399,6 +401,7 @@ /// GetCurrentFloorName /// </summary> /// <returns></returns> + [Newtonsoft.Json.JsonIgnore] public string GetCurrentFloorName { get diff --git a/ZigbeeApp/Shared/Common/SceneUI.cs b/ZigbeeApp/Shared/Common/SceneUI.cs index 4ca5160..556a4e7 100755 --- a/ZigbeeApp/Shared/Common/SceneUI.cs +++ b/ZigbeeApp/Shared/Common/SceneUI.cs @@ -8,7 +8,7 @@ /// 鍦烘櫙 /// </summary> [System.Serializable] - public class SceneUI : ZigBee.Device.CommonDevice + public class SceneUI { #region 鈻� 鍙橀噺澹版槑_________________________ /// <summary> diff --git a/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs b/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs index d89aea9..4ff409d 100755 --- a/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs +++ b/ZigbeeApp/Shared/Phone/Category/AddOrEditorSceneForm.cs @@ -822,6 +822,9 @@ this.editorScene.IconPath = this.cloneScene.IconPath; this.editorScene.Save(); + //鏂板缓鍦烘櫙,涓婚〉闇�瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshForm = true; + HdlThreadLogic.Current.RunMain(() => { //璋冪敤鍥炶皟鍑芥暟 @@ -889,6 +892,9 @@ this.editorScene.IconPath = this.cloneScene.IconPath; this.editorScene.Save(); + //缂栬緫鍦烘櫙,涓婚〉闇�瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshForm = true; + HdlThreadLogic.Current.RunMain(() => { //璋冪敤鍥炶皟鍑芥暟 diff --git a/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs b/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs index 80f6792..df30573 100755 --- a/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs +++ b/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDeviceForm.cs @@ -517,7 +517,7 @@ string path1 = string.Empty; string path2 = string.Empty; //鑾峰彇鍥剧墖 - LocalDevice.Current.GetDeviceObjectIcon(typeInfo.ConcreteType, ref path1, ref path2); + LocalDevice.Current.GetDeviceFunctionTypeMenuIcon(typeInfo.ConcreteType, ref path1, ref path2); dic[typeInfo.BeloneTextId].IconPath = path1; dic[typeInfo.BeloneTextId].IconPathSelected = path2; dic[typeInfo.BeloneTextId].TextId = typeInfo.BeloneTextId; diff --git a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs index 9ca95fc..1141503 100644 --- a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs +++ b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs @@ -316,7 +316,7 @@ functionSceneBodyView.Height = functionSceneAutoBodyView.Height - roomSwitchContr.Bottom; functionSceneAutoBodyView.AddChidren(functionSceneBodyView); - //鎵ц鍒濆鍖� + //鎵ц鍒濆鍖� roomSwitchContr.InitControl(); } @@ -759,16 +759,9 @@ { //鍒锋柊鍗$墖淇℃伅 var locadevice = LocalDevice.Current.GetDevice(mainKeys); - if (report.DeviceStatusReport.CluterID == 513 && report.DeviceStatusReport.AttriBute[0].AttributeId == 28) - { - //绌鸿皟鏄壒娈婄殑,瀹冪殑寮�鍏虫槸灞炴�т笂鎶ユ潵鐫�.宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉 - this.dicDeviceRowControl[mainKeys].SetHadGetResponeResultStatu(); - } - if (report.DeviceStatusReport.CluterID == 514 && report.DeviceStatusReport.AttriBute[0].AttributeId == 0) - { - //鏂伴鏄壒娈婄殑,瀹冪殑寮�鍏虫槸灞炴�т笂鎶ユ潵鐫�.宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉 - this.dicDeviceRowControl[mainKeys].SetHadGetResponeResultStatu(); - } + //宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉 2020.05.09:鍒犻櫎Ack涓婚 + this.dicDeviceRowControl[mainKeys].SetHadGetResponeResultStatu(); + //鍒锋柊鎺т欢 this.dicDeviceRowControl[mainKeys].RefreshControlInfo(locadevice); } }, ShowErrorMode.NO); @@ -786,23 +779,6 @@ bool bolOnline = LocalDevice.Current.CheckDeviceIsOnline(report); this.dicDeviceRowControl[mainKeys].SetRowOnlineStatu(bolOnline); return; - } - - }, ShowErrorMode.NO); - }); - - //璁惧鎺у埗鍙嶉涓婃姤 - HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceRespone", ReceiveComandDiv.A鑺傜偣鎺у埗鍙嶉, (report) => - { - HdlThreadLogic.Current.RunMain(() => - { - string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report); - if (this.dicDeviceRowControl.ContainsKey(mainKeys) == true) - { - //璁惧鍗$墖 - var deviceCardContr = this.dicDeviceRowControl[mainKeys]; - //宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉 - deviceCardContr.SetHadGetResponeResultStatu(); } }, ShowErrorMode.NO); @@ -873,22 +849,10 @@ string path1 = string.Empty; string path2 = string.Empty; //鑾峰彇鍥剧墖 - LocalDevice.Current.GetDeviceObjectIcon(typeInfo.ConcreteType, ref path1, ref path2); + LocalDevice.Current.GetDeviceFunctionTypeMenuIcon(typeInfo.ConcreteType, ref path1, ref path2); dic[typeInfo.BeloneTextId].IconPath = path1; - dic[typeInfo.BeloneTextId].IconPathSelected = path2; - dic[typeInfo.BeloneTextId].TextId = typeInfo.BeloneTextId; - if (device.Type == DeviceType.FreshAir) - { - dic[typeInfo.BeloneTextId].IconPath = "Device/FreshAirEpoint.png"; - dic[typeInfo.BeloneTextId].IconPathSelected = "Device/FreshAirEpointSelected.png"; - } - if (device.Type == DeviceType.PMSensor) - { - // PM2.5 - dic[typeInfo.BeloneTextId].IconPath = "Device/AirQualitySensorEpoint.png"; - dic[typeInfo.BeloneTextId].IconPathSelected = "Device/AirQualitySensorEpointSelected.png"; - dic[typeInfo.BeloneTextId].TextId = R.MyInternationalizationString.AirQualitySensor; - } + dic[typeInfo.BeloneTextId].IconPathSelected = path2; + dic[typeInfo.BeloneTextId].TextId = typeInfo.BeloneTextId; } dic[typeInfo.BeloneTextId].listDeviceKeys.Add(LocalDevice.Current.GetDeviceMainKeys(device)); } diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs index 7c8bd89..2812dda 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs @@ -264,8 +264,8 @@ accounts.Add("Account", Config.Instance.Guid); accounts.Add("AccountName",accountName); ///mac+绔彛鏄负璇嗗埆鏄偅涓棬閿�; - accounts.Add("MacAddr", Send.CurrentDoorLock.DeviceAddr); - accounts.Add("Epoint", Send.CurrentDoorLock.DeviceEpoint.ToString()); + accounts.Add("Option4", Send.CurrentDoorLock.DeviceAddr); + accounts.Add("Option2", Send.CurrentDoorLock.DeviceEpoint.ToString()); accounts.Add("UserId", userId); if (SelectedDeviceStatuscondition != "") { diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs index c593a35..742b6f6 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs @@ -21,17 +21,27 @@ this.AddChidren(view.TopRowView()); view.toptitleNameBtn.TextID = MyInternationalizationString.linkageevent; view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); }; + //鍔犲ぇ鐐瑰嚮鐑敭 + var addiocnclick = new Button + { + Width = Application.GetRealWidth(108+58), + Height = Application.GetRealHeight(72+20), + X = Application.GetRealWidth(1080 - 108 - 58), + Y = Application.GetRealHeight(184 - 72), + }; + view.topRowLayout.AddChidren(addiocnclick); var addiocn = new Button { - Width = Application.GetRealWidth(72), - Height = Application.GetRealHeight(72), + Width = Application.GetMinRealAverage(72), + Height = Application.GetMinRealAverage(72), X = Application.GetRealWidth(1080 - 108 - 58), UnSelectedImagePath = "ZigeeLogic/lockadd.png", Y = Application.GetRealHeight(184 - 72 - 20), }; view.topRowLayout.AddChidren(addiocn); - addiocn.MouseUpEventHandler += (sender, e) => + + EventHandler<MouseEventArgs> addclick = (sender, e) => { //new涓�涓柊閫昏緫瀵硅薄锛� Common.Logic.CurrentLogic = new Common.Logic(); @@ -44,6 +54,10 @@ UserView.HomePage.Instance.PageIndex += 1; lockLogicCommunalPage.Show(() => { }); }; + + addiocnclick.MouseUpEventHandler += addclick; + addiocn.MouseUpEventHandler += addclick; + #endregion middle = new VerticalRefreshLayout { @@ -68,8 +82,12 @@ /// </summary> public async void Read() { + + + + CommonPage.Loading.Start(); - if (Common.Logic.LockLogicList.Count == 0) + if (!BoolExist()) { var Idlist = await Send.GetLogicId(1); if (Idlist.Count != 0) @@ -86,7 +104,8 @@ bool yes = false; for (int a = 0; a < logic.Accounts.Count; a++) { - if (logic.Accounts[a]["MacAddr"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[a]["Epoint"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString()) + //Option4鏄澶噈ac锛汷ption2鏄澶囩鍙o紱 + if (logic.Accounts[a]["Option4"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[a]["Option2"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString()) { //鏌ユ壘鏄惁鏄偅涓棬閿侊紱 //濡傛灉涓嶆槸璇ラ棬閿佽仈鍔ㄤ簨浠朵笉鏄剧ず鍑烘潵; @@ -117,7 +136,8 @@ { middle.RemoveAll(); - if (Common.Logic.LockLogicList.Count == 0) + //if (Common.Logic.LockLogicList.Count == 0) + if (!BoolExist()) { //灏辨槸涓轰簡鏄剧ず寮曞娣诲姞鍥炬爣; var noFrameLayout = new FrameLayout @@ -156,6 +176,11 @@ for (int i = 0; i < Common.Logic.LockLogicList.Count; i++) { var logic = Common.Logic.LockLogicList[i]; + if (!Exist(logic)) + { + continue; + } + var logicRowlayout = new RowLayout { Width = Application.GetRealWidth(1080), @@ -259,5 +284,59 @@ } } + + + /// <summary> + /// 鏌ユ壘璇ラ棬閿佹槸鍚﹀瓨鍦ㄨ嚜鍔ㄥ寲 + /// </summary> + /// <returns></returns> + private bool BoolExist() + { + bool yes = false; + for (int i = 0; i < Common.Logic.LockLogicList.Count; i++) + { + var logic = Common.Logic.LockLogicList[i]; + if (logic.LogicType != 1) + { + continue; + } + + if (Exist(logic)) + { + yes = true; + //瀛樺湪灏遍��鍑� + break; + } + } + return yes; + } + + /// <summary> + /// 鏌ユ壘杩欎竴鏉¤嚜鍔ㄥ寲鏄惁灞炰簬璇ラ棬閿� + /// </summary> + /// <returns></returns> + private bool Exist(Common.Logic logic) + { + bool yes = false; + for (int j = 0; j < logic.Accounts.Count; j++) + { + //Option4鏄澶噈ac锛汷ption2鏄澶囩鍙o紱 + if (logic.Accounts[j]["Option4"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[j]["Option2"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString()) + { + //鏌ユ壘鏄惁鏄偅涓棬閿侊紱 + //濡傛灉涓嶆槸璇ラ棬閿佽仈鍔ㄤ簨浠朵笉鏄剧ず鍑烘潵; + yes = false; + break; + } + if (logic.Accounts[j]["Account"].ToString() == Config.Instance.Guid) + { + //鏌ユ壘鑷繁璐﹀彿涓嬬殑鍒涘缓鑱斿姩浜嬩欢锛� + yes = true; + break; + } + + } + return yes; + } } } diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TipView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TipView.cs index e45f7e8..0bb7c0b 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TipView.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TipView.cs @@ -71,7 +71,8 @@ { Y = topFrame.Bottom, Width = Application.GetRealWidth(792), - Height = Application.GetRealHeight(127), + Height = Application.GetRealHeight(127), + Gravity = Gravity.BottomCenter, }; tipFLayout.AddChidren(bottomFrame); @@ -81,10 +82,10 @@ TextAlignment = TextAlignment.Center, TextColor = ZigbeeColor.Current.LogicBtnCancelColor, TextSize = 14, - Height = Application.GetRealHeight(127), + Height = bottomFrame.Height, Width = Application.GetRealWidth(397), BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, - TextID = R.MyInternationalizationString.cancel, + TextID = R.MyInternationalizationString.cancel, }; bottomFrame.AddChidren(cancelBtn); cancelBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomLeft); @@ -95,7 +96,7 @@ TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, TextSize = 14, X = cancelBtn.Right, - Height = Application.GetRealHeight(127), + Height = bottomFrame.Height, Width = bottomFrame.Width - cancelBtn.Width, BackgroundColor = ZigbeeColor.Current.LogicBtnTypeColor, TextID = R.MyInternationalizationString.confrim, @@ -156,7 +157,7 @@ Y = Application.GetRealHeight(69), X = Application.GetRealWidth(150), Height = Application.GetRealHeight(63), - Width = Application.GetRealWidth(492), + Width = Application.GetRealWidth(492), TextID = R.MyInternationalizationString.invalidSetting, TextAlignment = TextAlignment.Center, TextColor = ZigbeeColor.Current.LogicTipColor, @@ -215,6 +216,7 @@ Y = topFrame.Bottom, Width = Application.GetRealWidth(792), Height = Application.GetRealHeight(127), + Gravity=Gravity.BottomCenter, }; tipFLayout.AddChidren(bottomFrame); ///鍙栨秷鎺т欢 @@ -223,7 +225,7 @@ TextAlignment = TextAlignment.Center, TextColor = ZigbeeColor.Current.LogicBtnCancelColor, TextSize = 14, - Height = Application.GetRealHeight(127), + Height = bottomFrame.Height, Width = Application.GetRealWidth(397), BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, TextID = R.MyInternationalizationString.cancel, @@ -236,14 +238,14 @@ TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, TextSize = 14, X = cancelBtn.Right, - Height = Application.GetRealHeight(127), + Height = bottomFrame.Height, Width = bottomFrame.Width - cancelBtn.Width, BackgroundColor = ZigbeeColor.Current.LogicBtnTypeColor, TextID = R.MyInternationalizationString.confrim, }; bottomFrame.AddChidren(okBtn); - if (_if) { + if (_if) { cancelBtn.X = Application.GetRealWidth(0); cancelBtn.Width = Application.GetRealWidth(0); okBtn.X = Application.GetRealWidth(0); @@ -355,6 +357,7 @@ Y = topFrame.Bottom, Width = Application.GetRealWidth(792), Height = Application.GetRealHeight(127), + Gravity = Gravity.BottomCenter, }; tipFLayout.AddChidren(bottomFrame); ///鍙栨秷鎺т欢 @@ -363,7 +366,7 @@ TextAlignment = TextAlignment.Center, TextColor = ZigbeeColor.Current.LogicBtnCancelColor, TextSize = 14, - Height = Application.GetRealHeight(127), + Height = bottomFrame.Height, Width = Application.GetRealWidth(397), BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, TextID = R.MyInternationalizationString.cancel, @@ -376,7 +379,7 @@ TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, TextSize = 14, X = cancelBtn.Right, - Height = Application.GetRealHeight(127), + Height = bottomFrame.Height, Width = bottomFrame.Width - cancelBtn.Width, BackgroundColor = ZigbeeColor.Current.LogicBtnTypeColor, TextID = R.MyInternationalizationString.confrim, @@ -465,8 +468,8 @@ TextColor = ZigbeeColor.Current.LogicBtnCancelColor, TextSize = 14, }; - tipFLayout.AddChidren(Text1Btn); - + tipFLayout.AddChidren(Text1Btn); + new System.Threading.Thread(() => { System.Threading.Thread.Sleep(timeValue*1000); diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs index 9b3974a..b1b086f 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs @@ -499,6 +499,15 @@ ["AccountName"] = dictionary["AccountName"], }; + + if (dictionary.ContainsKey("Option4")) + { + accounts1.Add("Option4",dictionary["Option4"]); + } + if (dictionary.ContainsKey("Option2")) + { + accounts1.Add("Option2", int.Parse(dictionary["Option2"])); + } accounts.Add(accounts1); } } diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs index f2a23d6..2e68b30 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs @@ -72,7 +72,7 @@ /// </summary> public static void ShowAutotionView(FrameLayout functionSceneAutoBodyView) { - // functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; + //functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; #region ---鎺ㄨ崘妯℃澘鐨勭粍浠� //鎺ㄨ崘妯℃澘鑳屾櫙鎺т欢 var bjFrameLayout = new FrameLayout @@ -703,7 +703,7 @@ /// <param name="timeVlaue">鏃堕棿鍊�</param> /// <param name="common">璁惧</param> /// <returns></returns> - public static async System.Threading.Tasks.Task<bool> LockAddModifyLogic(int timeVlaue, CommonDevice common) + public static async System.Threading.Tasks.Task<int> LockAddModifyLogic(int timeVlaue, CommonDevice common) { //璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒� var h = DateTime.Now.ToString("HH"); @@ -736,9 +736,9 @@ { //娣诲姞闂ㄩ攣澶辨晥鏃堕棿鐨勫巻鍙茶褰� UserCenter.HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog((DoorLock)common, 9003, timeVlaue.ToString()); - return true;//琛ㄧず娣诲姞鎴愬姛; + return logicIfon.LogicId;//琛ㄧず娣诲姞鎴愬姛; } - return false;//琛ㄧず娣诲姞澶辫触; + return 0;//琛ㄧず娣诲姞澶辫触; } @@ -759,7 +759,7 @@ } return exist; } - + ///<summary> ///鑾峰彇閫昏緫淇℃伅 /// 杩斿洖鍊硷細null涓嶅瓨鍦�;鍏跺畠鍊奸兘瀛樺湪; @@ -799,7 +799,9 @@ } return _if; } - + + + } } diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs index c78f7f4..05328f5 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs @@ -8,28 +8,29 @@ { public class SoneLogicList : FrameLayout { - public static SoneLogicList soneLogicList; public SoneLogicList() { Tag = "SoneLogic"; soneLogicList = this; + } /// 缁欏緪姊呭埛鏂扮晫闈㈢敤鐨� - public Action<bool> action; + public Action<bool> action; ///绗簩鍧楃涓�绾х埗鎺т欢 FrameLayout fLayout = new FrameLayout(); - ///甯稿紑妯″紡鍥炬爣 - Button modeIconBtn = new Button(); - ///绗簩鍧楃浜岀骇鐖舵帶浠� - FrameLayout modeFl = new FrameLayout(); - Button button1 = new Button(); - Button button2= new Button(); ///绗笁鍧楃涓�绾х埗鎺т欢 FrameLayout listLogicFl = new FrameLayout(); ///甯稿紑鑷姩鍖栧垪琛ㄤ笂涓嬫粦鍔ㄧ殑鎺т欢 VerticalRefreshLayout verticalRefresh = new VerticalRefreshLayout(); - + /// <summary> + /// 璁板綍閫昏緫id + /// </summary> + public int logicId = 0; + /// <summary> + /// 璁板綍閫変腑鏃堕棿 + /// </summary> + public int timeValue = 0; public async void Show() { @@ -41,10 +42,6 @@ view.clickBtn.MouseDownEventHandler += (sender, e) => { UserView.HomePage.Instance.ScrollEnabled = true; - if (updateThread != null && updateThread.IsAlive) - { - updateThread.Abort(); - } //鎶婇潤鎬佸彉閲忕殑杩欎釜涓滆タ缃┖ soneLogicList = null; this.RemoveFromParent(); @@ -62,6 +59,23 @@ }; this.AddChidren(middle); #endregion + //鏄父寮�妯″紡鍐嶅幓璇诲彇 + if (Send.CurrentDoorLock.IsDoorLockNormallyMode) + { + //杩涙潵鏇存柊涓�娆� + //鏌ユ壘鏄惁瀛樺湪鏃舵晥鎬ц嚜鍔ㄥ寲锛涙湁鐨勮瘽灏辫繑鍥炶嚜鍔ㄥ寲瀵硅薄; + var logic = await SkipView.GetLogicIfon(); + if (logic != null) + { + try + { + //杩涙潵鏇存柊涓�娆″�� + logicId = logic.LogicId; + timeValue = int.Parse(logic.Conditions[0]["DoorLockOpenDelayTime"]); + } + catch { } + } + } #region 甯稿紑妯″紡鍥炬爣 鏃舵晥鎬у父寮�璁剧疆 ///绗簩鍧楃涓�绾х埗鎺т欢 @@ -72,33 +86,8 @@ BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, }; middle.AddChidren(fLayout); - ///甯稿紑妯″紡鍥炬爣 - modeIconBtn = new Button - { - X = Application.GetRealWidth(395), - Y = Application.GetRealHeight(92), - Width = Application.GetMinRealAverage(294), - Height = Application.GetMinRealAverage(294), - }; - fLayout.AddChidren(modeIconBtn); - ///绗簩鍧楃浜岀骇鐖舵帶浠� - modeFl = new FrameLayout - { - }; - fLayout.AddChidren(modeFl); - - button1 = new Button - { - }; - modeFl.AddChidren(button1); - - button2 = new Button - { - }; - modeFl.AddChidren(button2); ModeView(); #endregion - #region 甯稿紑鑷姩鍖� ///绗笁鍧楃涓�绾х埗鎺т欢 listLogicFl = new FrameLayout @@ -143,10 +132,10 @@ UnSelectedImagePath = "ZigeeLogic/add.png", }; addLogicfL.AddChidren(addIconBtn); - + ///鍔犲ぇ鐐瑰嚮鐑敭 var addIconclickBtn = new Button { - Width = Application.GetRealWidth(90+69+63), + Width = Application.GetRealWidth(90 + 69 + 63), Height = Application.GetRealHeight(69), X = Application.GetRealWidth(800), Y = Application.GetRealHeight(60), @@ -207,6 +196,238 @@ }; Read(true); #endregion + + UserCenter.DoorLock.DoorLockCommonInfo.LogicAction = (_bool) => + { + + try + { + Application.RunOnMainThread(() => + { + Send.CurrentDoorLock.IsDoorLockNormallyMode = _bool; + ModeView(); + }); + } + catch { } + }; + + } + /// <summary> + /// 甯稿紑妯″紡寮�鍏冲垏鎹㈠浘鏍囩晫闈� + /// </summary> + public void ModeView() + { + + fLayout.RemoveAll(); + ///甯稿紑妯″紡鍥炬爣 + Button modeIconBtn = new Button + { + X = Application.GetRealWidth(395), + Y = Application.GetRealHeight(92), + Width = Application.GetMinRealAverage(294), + Height = Application.GetMinRealAverage(294), + }; + fLayout.AddChidren(modeIconBtn); + if (Send.CurrentDoorLock.IsDoorLockNormallyMode) + { + + fLayout.Height = Application.GetRealHeight(780);//鏀瑰彉楂樺害 + modeIconBtn.UnSelectedImagePath = "ZigeeLogic/openMode.png";//鏀瑰彉鍥炬爣鐘舵�� + ///绗簩绾х埗鎺т欢 + var openModeFl = new FrameLayout + { + Y = Application.GetRealHeight(455), + Height = Application.GetRealHeight(127 + 199), + Width = Application.GetRealWidth(1080), + }; + fLayout.AddChidren(openModeFl); + ///鍏抽棴鏃舵晥鎬ц嚜鍔ㄥ寲 + Button closeBtn = new Button + { + X = Application.GetRealWidth(86), + Height = Application.GetRealHeight(127), + Width = Application.GetRealWidth(907), + Radius = (uint)Application.GetRealHeight(58), + BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor, + TextID = MyInternationalizationString.closeUp, + TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor, + TextSize = 16, + }; + openModeFl.AddChidren(closeBtn); + closeBtn.MouseUpEventHandler += async (sender, e) => + { + CommonPage.Loading.Start(); + try + { + var result = await UserCenter.DoorLock.DoorLockCommonInfo.DelNormallyOpenMode(Send.CurrentDoorLock); + if (result) + { + if (logicId != 0) + { + ///鏈夊彲鑳藉彧鏈夊父寮�妯″紡锛屾病鏈夋椂鏁堟�ц嚜鍔ㄥ寲 + Send.DelLogic(logicId); + } + Send.CurrentDoorLock.IsDoorLockNormallyMode = false; + ModeView(); + } + else + { + LogicView.TipView.ShowFlashTip(Language.StringByID(MyInternationalizationString.closeFailed)); + } + } + catch { } + finally + { + Application.RunOnMainThread(() => + { + CommonPage.Loading.Hide(); + + }); + } + }; + + ///鏄剧ず澶辨晥璁剧疆鏃堕棿鏂囨湰鎺т欢 + var timeTextBtn = new Button + { + Y = Application.GetRealHeight(127 + 69), + X = Application.GetRealWidth(125), + Width = Application.GetRealWidth(634 + 200), + Height = Application.GetRealHeight(60), + TextSize = 15, + TextColor = ZigbeeColor.Current.LogicTextBlackColor, + }; + if (logicId != 0) + { + openModeFl.AddChidren(timeTextBtn); + ///鏈夋椂鏁堟�у父寮�鎵嶆樉绀烘椂闂存潯浠舵枃鏈� + var y = DateTime.Now.Year.ToString();//閭d竴骞� + var m = DateTime.Now.Month.ToString();//閭d竴鏈� + var d = DateTime.Now.ToString("dd");//閭d竴澶� + var h = int.Parse(DateTime.Now.ToString("HH"));//褰撳墠绯荤粺鏃堕棿 + int dayInt = (h + timeValue) / 24;//绠楀嚭鍑犲ぉ鍚庢墽琛� + int hour = (h + timeValue) % 24;//绠楀嚭鍑犲ぉ鍚庨偅涓椂闂存墽琛� + int days = int.Parse(d) + dayInt; + string text1 = Language.StringByID(MyInternationalizationString.timeSensitive); + string text2 = Language.StringByID(MyInternationalizationString.yearSone); + string text3 = Language.StringByID(MyInternationalizationString.monthSone); + string text4 = Language.StringByID(MyInternationalizationString.numberSone); + string text5 = Language.StringByID(MyInternationalizationString.executeSone); + timeTextBtn.Text = text1 + y + text2 + m + text3 + days.ToString() + text4 + hour.ToString() + text5; + } + + + button1 = new Button + { + fLayout.Height = Application.GetRealHeight(645);//鏀瑰彉楂樺害 + modeIconBtn.UnSelectedImagePath = "ZigeeLogic/noMode.png";//鏀瑰彉鍥炬爣鐘舵�� + ///绗簩绾х埗鎺т欢 + var modeFl = new FrameLayout + { + Y = Application.GetRealHeight(478), + X = Application.GetRealWidth(58), + Height = Application.GetRealHeight(138), + Width = Application.GetRealWidth(1022), + BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, + }; + fLayout.AddChidren(modeFl); + modeFl.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft); + ///鏃舵晥鎬у父寮�璁剧疆鏄剧ず鏂囨湰鎺т欢 + var modeTextBtn = new Button + { + + Y = Application.GetRealHeight(40), + X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(600), + Height = Application.GetRealHeight(60), + TextSize = 15, + TextColor = ZigbeeColor.Current.LogicTextBlackColor, + TextAlignment = TextAlignment.CenterLeft, + // Text = "鏃舵晥鎬у父寮�璁剧疆", + TextID = MyInternationalizationString.timeSetSone, + }; + modeFl.AddChidren(modeTextBtn); + ///涓嬩竴绾ц彍鍗曞浘鏍囨帶浠� + var nextIconBtn = new Button + { + Width = Application.GetMinRealAverage(104), + Height = Application.GetMinRealAverage(104), + X = Application.GetRealWidth(861), + Y = Application.GetRealHeight(17), + UnSelectedImagePath = "ZigeeLogic/nextIconSone.png", + }; + modeFl.AddChidren(nextIconBtn); + + ///鍔犲ぇ鐐瑰嚮鐑敭 + var clickBtn = new Button + { + Width = Application.GetRealWidth(104 + 161 + 30), + Height = Application.GetRealHeight(138), + X = Application.GetRealWidth(700), + }; + modeFl.AddChidren(clickBtn); + clickBtn.MouseUpEventHandler += (sender, e) => + { + + LogicView.TipView.ShowConfrimTip(() => + + {///鍐嶆纭 + LogicView.TipView.ShowInputTip(true, async (str) => + {///纭鍙戦�佸懡浠� + CommonPage.Loading.Start(); + try + { + ///xm + var result = await UserCenter.DoorLock.DoorLockCommonInfo.SetNormallyOpenModeFuncAsync(Send.CurrentDoorLock); + if (!result) + { + LogicView.TipView.ShowFlashTip(Language.StringByID(MyInternationalizationString.openFailed)); + return; + } + else + { + ///鍥犱负鏈夊父寮�妯″紡涓嬫墠鍙互鍒涘缓澶辨晥閫昏緫锛� + SkipView.GetLogicAll();//鍒犻櫎涔嬪墠鎵�鏈夊け鏁堥�昏緫 + var addResult = await SkipView.LockAddModifyLogic(int.Parse(str), Send.CurrentDoorLock);//娣诲姞涓�鏉″け鏁堥�昏緫 + if (addResult == 0) + { + ///鍙璇村鏋滃父寮�妯″紡寮�锛屽垱寤鸿嚜鍔ㄥ寲澶辫触锛岄偅涔堝皢瑕佸彂涓�鏉″父寮�妯″紡鍏抽棴鍛戒护; + UserCenter.DoorLock.DoorLockCommonInfo.DelNormallyOpenMode(Send.CurrentDoorLock); + ///鎻愮ず澶辫触 + LogicView.TipView.ShowFlashTip(Language.StringByID(MyInternationalizationString.addFailed)); + return; + } + logicId = addResult; + timeValue = int.Parse(str); + Send.CurrentDoorLock.IsDoorLockNormallyMode = true; + ModeView(); + //娣诲姞App寮�鍚父寮�妯″紡鐨勫巻鍙茶褰� + UserCenter.HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(Send.CurrentDoorLock, 9001, string.Empty); + } + } + catch + { + + } + finally + { + Application.RunOnMainThread(() => + { + CommonPage.Loading.Hide(); + + }); + } + }); + + }); + + }; + } + + listLogicFl.Y = fLayout.Bottom; + listLogicFl.X = Application.GetRealWidth(58); + listLogicFl.Height = Application.GetRealHeight(Method.H - 184) - fLayout.Height; + listLogicFl.Width = Application.GetRealWidth(1022); + listLogicFl.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; } /// <summary> /// 甯稿紑妯″紡寮�鍏冲垏鎹㈠浘鏍囩晫闈� @@ -219,7 +440,7 @@ /// 鏌ユ壘鏄惁瀛樺湪鏃舵晥鎬ц嚜鍔ㄥ寲锛涙湁鐨勮瘽灏辫繑鍥炶嚜鍔ㄥ寲瀵硅薄; var logic = await SkipView.GetLogicIfon(); - fLayout.Height = Application.GetRealHeight(780);//鏀瑰彉楂樺害 + fLayout.Height = Application.GetRealHeight(780);//鏀瑰彉楂樺害 modeIconBtn.UnSelectedImagePath = "ZigeeLogic/openMode.png";//鏀瑰彉鍥炬爣鐘舵�� modeFl.Y = modeIconBtn.Bottom + Application.GetRealHeight(64); modeFl.X = Application.GetRealWidth(0); @@ -427,8 +648,13 @@ } } - + RowLayout selectedRow = new RowLayout() { Tag = "0" };//璁板綍宸︽粦鐘舵�� + int a = 1; + /// <summary> + /// 璁板綍宸︽粦鐘舵�� + /// </summary> + RowLayout selectedRow = new RowLayout() { Tag = "0" }; int a = 1; /// <summary> /// 鍔犺浇鑷姩鍖栧垪琛� @@ -528,10 +754,7 @@ TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor, }; logicRow.AddRightView(edit); - if (logic.LogicType == 2) - { - edit.TextID = MyInternationalizationString.look; - } + ///鍒犻櫎 var del = new Button { @@ -597,32 +820,6 @@ }; } } - - /// <summary> - /// 瀹氭椂鏇存柊甯稿紑妯″紡(闃叉閫氳繃闂ㄩ攣鍏抽棴娌″強鏃跺埛鏂扮姸鎬�) - /// </summary> - System.Threading.Thread updateThread; - public void UpdateModeIcon() - { - updateThread = new System.Threading.Thread(() => - { - while (this.Parent != null) - { - System.Threading.Thread.Sleep(1000); - Application.RunOnMainThread(() => - { - try - { - ModeView(); - } - catch { } - - }); - } - }); - updateThread.Start(); - } - } } diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceFreshAirDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceFreshAirDetailCardForm.cs index 914d62e..b947b03 100644 --- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceFreshAirDetailCardForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceFreshAirDetailCardForm.cs @@ -11,7 +11,7 @@ /// </summary> public class DeviceFreshAirDetailCardForm : DeviceDetailCardCommonForm { - #region 鈻� 鍙橀噺澹版槑___________________________ + #region 鈻� 鍙橀噺澹版槑___________________________ /// <summary> /// 鐣岄潰涓婂彲浠ユ搷浣滅殑鎺т欢 /// </summary> @@ -244,7 +244,7 @@ this.SetFanComand(15); } } - #endregion + #endregion #region 鈻� 鏄惁鑾峰彇缃戝叧鍙嶉鐨勭粨鏋淿____________ @@ -286,7 +286,7 @@ } #endregion - #region 鈻� 璁剧疆鏂规硶 + #region 鈻� 璁剧疆鏂规硶 /// <summary> ///鍛戒护 ///0:Off @@ -295,7 +295,7 @@ ///4:On ///5:Auto /// 15:Manual - /// </summary> + /// </summary> private void SetFanComand(int command) { //妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅 @@ -343,7 +343,7 @@ this.listControl[5].Enable = true; //鎵撳紑 this.listControl[5].IsSelected = true; - //璁剧疆鐘舵�佹枃瀛� + //璁剧疆鐘舵�佹枃瀛� this.SetStatuText(Language.StringByID(R.MyInternationalizationString.uOpen1)); } if (freshAirDev.currentFanStatus == 0) @@ -359,7 +359,7 @@ this.listControl[5].IsSelected = false; this.listControl[6].IsSelected = false; this.listControl[5].Enable = true; - //璁剧疆鐘舵�佹枃瀛� + //璁剧疆鐘舵�佹枃瀛� this.SetStatuText(Language.StringByID(R.MyInternationalizationString.Close)); return; } diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DevicePmSensorDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DevicePmSensorDetailCardForm.cs index 2f582e3..c238832 100644 --- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DevicePmSensorDetailCardForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DevicePmSensorDetailCardForm.cs @@ -11,7 +11,7 @@ /// </summary> public class DevicePmSensorDetailCardForm : DeviceDetailCardCommonForm { - #region 鈻� 鍙橀噺澹版槑___________________________ + #region 鈻� 鍙橀噺澹版槑___________________________ /// <summary> /// 鐣岄潰涓婂彲浠ユ搷浣滅殑鎺т欢 /// </summary> @@ -166,7 +166,7 @@ btnPmUnit.TextAlignment = TextAlignment.CenterLeft; framePmPic.AddChidren(btnPmUnit); } - #endregion + #endregion #region 鈻� 鏄惁鑾峰彇缃戝叧鍙嶉鐨勭粨鏋淿____________ diff --git a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs index 4ff8420..e1a5808 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs @@ -1054,7 +1054,9 @@ Application.RunOnMainThread(() => { - ShowForm(); + //鍒锋柊鐣岄潰 + this.ShowForm(); + CommonPage.Loading.Hide(); }); }) @@ -1090,16 +1092,9 @@ { //鍒锋柊鍗$墖淇℃伅 var locadevice = LocalDevice.Current.GetDevice(mainKeys); - if (report.DeviceStatusReport.CluterID == 513 && report.DeviceStatusReport.AttriBute[0].AttributeId == 28) - { - //绌鸿皟鏄壒娈婄殑,瀹冪殑寮�鍏虫槸灞炴�т笂鎶ユ潵鐫�.宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉 - this.dicDeviceCardControl[mainKeys].SetHadGetResponeResultStatu(); - } - if (report.DeviceStatusReport.CluterID == 514 && report.DeviceStatusReport.AttriBute[0].AttributeId == 0) - { - //鏂伴鏄壒娈婄殑,瀹冪殑寮�鍏虫槸灞炴�т笂鎶ユ潵鐫�.宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉 - this.dicDeviceCardControl[mainKeys].SetHadGetResponeResultStatu(); - } + //宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉 2020.05.09:鍒犻櫎Ack涓婚 + this.dicDeviceCardControl[mainKeys].SetHadGetResponeResultStatu(); + //鍒锋柊鎺т欢 this.dicDeviceCardControl[mainKeys].RefreshControlInfo(locadevice); } }, ShowErrorMode.NO); @@ -1117,23 +1112,6 @@ bool bolOnline = Common.LocalDevice.Current.CheckDeviceIsOnline(report); this.dicDeviceCardControl[mainKeys].SetCardOnlineStatu(bolOnline); return; - } - - }, ShowErrorMode.NO); - }); - - //璁惧鎺у埗鍙嶉涓婃姤 - HdlGatewayReceiveLogic.Current.AddAttributeEvent("UserHomeViewDeviceRespone", ReceiveComandDiv.A鑺傜偣鎺у埗鍙嶉, (report) => - { - HdlThreadLogic.Current.RunMain(() => - { - string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report); - if (this.dicDeviceCardControl.ContainsKey(mainKeys) == true) - { - //璁惧鍗$墖 - var deviceCardContr = this.dicDeviceCardControl[mainKeys]; - //宸茬粡鎺ユ敹鍒扮綉鍏崇殑鍙嶉 - deviceCardContr.SetHadGetResponeResultStatu(); } }, ShowErrorMode.NO); diff --git a/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs b/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs index 11df64c..1347cbe 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs @@ -27,7 +27,6 @@ //鍒濆鍖栧乏婊戣彍鍗� roomManagement = new ListRoomViewFrom(); CommonPage.Instance.AddLeftView(roomManagement); - roomManagement.ShowForm(); } return roomManagement; } @@ -37,6 +36,10 @@ /// 鏄惁鍙互瑙﹀彂鐐瑰嚮浜嬩欢--鏄惁鍙互璺宠浆涓婚〉鎴块棿 /// </summary> public bool CanClick = true; + /// <summary> + /// 鏄惁鍒濆鍖栧畬鎴� + /// </summary> + private bool isInitFinish = false; /// <summary> /// 褰撳墠妤煎眰id /// </summary> @@ -58,8 +61,7 @@ /// 鐢婚潰鏄剧ず /// </summary> public void ShowForm() - { - roomManagement = this; + { //鍒濆鍖栧ご閮ㄤ俊鎭� this.InitTopFrame(); //鍒濆鍖栦腑閮ㄦ帶浠� @@ -90,10 +92,8 @@ }; //鑾峰彇妤煎眰 - if (this.curFloorId == string.Empty) - { - this.curFloorId = Config.Instance.Home.CurrentFloorId; - } + this.curFloorId = Config.Instance.Home.CurrentFloorId; + var dicFloor = HdlRoomLogic.Current.GetFloorSortList(); if (dicFloor.Count == 0) { @@ -124,8 +124,8 @@ { this.curFloorId = floorId; btnFloor.Text = dicFloor[floorId]; - //鍒锋柊鎴块棿鍒楄〃 - this.RefreshListRoom(); + //鍒锋柊Body瀹瑰櫒 + this.RefreshBodyFrame(); }; }; } @@ -139,8 +139,8 @@ listView.Height = bodyFrameLayout.Height; listView.Width = bodyFrameLayout.Width; bodyFrameLayout.AddChidren(listView); - //鍒锋柊鎴块棿鍒楄〃 - this.RefreshListRoom(); + //鍒锋柊Body瀹瑰櫒 + this.RefreshBodyFrame(); } #endregion @@ -152,11 +152,27 @@ /// </summary> public void RefreshListRoom() { + //濡傛灉杩樻病鏈夊垵濮嬪寲瀹屾垚鐣岄潰鐨勮瘽 + if (this.isInitFinish == false) + { + this.ShowForm(); + this.isInitFinish = true; + return; + } //鎶婂ご閮ㄤ篃涓�璧峰垵濮嬪寲浜� this.topFrameLayout.RemoveAll(); //鍒濆鍖栧ご閮ㄤ俊鎭� this.InitTopFrame(); + //鍒锋柊Body瀹瑰櫒 + this.RefreshBodyFrame(); + } + + /// <summary> + /// 鍒锋柊Body瀹瑰櫒 + /// </summary> + private void RefreshBodyFrame() + { //鍏堟竻绌� this.listView.frameTable.RemoveAll(); this.listView.frameTable.Height = Application.GetRealHeight(100); diff --git a/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs b/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs index 81d6f2a..a238bb8 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs @@ -635,7 +635,7 @@ string path1 = string.Empty; string path2 = string.Empty; //鑾峰彇鍥剧墖 - Common.LocalDevice.Current.GetDeviceObjectIcon(typeInfo.ConcreteType, ref path1, ref path2); + Common.LocalDevice.Current.GetDeviceFunctionTypeMenuIcon(typeInfo.ConcreteType, ref path1, ref path2); dic[typeInfo.BeloneTextId].IconPath = path1; dic[typeInfo.BeloneTextId].IconPathSelected = path2; dic[typeInfo.BeloneTextId].TextId = typeInfo.BeloneTextId; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/DeviceFunctionTypeRowControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/DeviceFunctionTypeRowControl.cs index c401d8c..ba5e19d 100644 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/DeviceFunctionTypeRowControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/RowLayoutControls/DeviceFunctionTypeRowControl.cs @@ -111,6 +111,11 @@ form.AddForm(title, listText, nowSelectNo); form.FinishSelectEvent += (selectNo) => { + if (selectNo == nowSelectNo) + { + //閫夋嫨鐨勬槸鐩稿悓鐨� + return; + } //-1:閫夋嫨鍙栨秷 this.Text = selectNo == -1 ? string.Empty : listText[selectNo]; nowSelectNo = selectNo; @@ -118,6 +123,9 @@ //璁板綍璧峰綋鍓嶉�夋嫨鐨勫姛鑳界被鍨� this.RefreshDfunctionType(); + //璁惧鏀瑰彉鍔熻兘绫诲瀷鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshForm = true; + //璋冪敤鍥炶皟鍑芥暟 this.FinishSelectEvent?.Invoke(nowSelectNo); }; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs index edd1c9e..c221ffc 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs @@ -248,18 +248,17 @@ if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new ReadACFirewareVersionResponAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); if (command == "0259") { @@ -412,18 +411,17 @@ if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new ResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); if (command == "025b") { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs index bc94bb7..2083d28 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs @@ -65,7 +65,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { d = new CommonDevice.SetWritableValueResponAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs index c44215c..bfb0ab6 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceUpdateLogic.cs @@ -204,7 +204,7 @@ return; } var tempZb = (ZbGateway)objValue; - if (tempZb.CurrentGateWayId != HdlGatewayLogic.Current.GetGatewayId(this.zbGateway)) + if (HdlGatewayLogic.Current.GetGatewayId(tempZb) != HdlGatewayLogic.Current.GetGatewayId(this.zbGateway)) { //涓嶆槸鑷繁鐨勭綉鍏虫帹閫侊紝鍒欎笉澶勭悊 return; @@ -363,7 +363,7 @@ return; } var tempZb = (ZbGateway)objValue; - if (tempZb.CurrentGateWayId != HdlGatewayLogic.Current.GetGatewayId(this.zbGateway)) + if (HdlGatewayLogic.Current.GetGatewayId(tempZb) != HdlGatewayLogic.Current.GetGatewayId(this.zbGateway)) { //涓嶆槸鑷繁鐨勭綉鍏虫帹閫侊紝鍒欎笉澶勭悊 return; @@ -412,7 +412,7 @@ /// </summary> /// <param name="statusData"></param> /// <returns></returns> - private bool CheckStatusCode(ZbGatewayData.OTAScheduleResponData statusData) + private bool CheckStatusCode(CommonDevice.OTAScheduleResponData statusData) { if (statusData == null) { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayUpdateLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayUpdateLogic.cs index d6e9dea..82b77b8 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayUpdateLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayUpdateLogic.cs @@ -240,7 +240,7 @@ return; } var tempZb = (ZbGateway)objValue; - if (tempZb.CurrentGateWayId != HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway)) + if (HdlGatewayLogic.Current.GetGatewayId(tempZb) != HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway)) { //涓嶆槸鑷繁鐨勭綉鍏虫帹閫侊紝鍒欎笉澶勭悊 return; @@ -343,7 +343,7 @@ return; } var tempZb = (ZbGateway)objValue; - if (tempZb.CurrentGateWayId != HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway)) + if (HdlGatewayLogic.Current.GetGatewayId(tempZb) != HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway)) { //涓嶆槸鑷繁鐨勭綉鍏虫帹閫侊紝鍒欎笉澶勭悊 return; @@ -445,7 +445,7 @@ return; } var tempZb = (ZbGateway)objValue; - if (tempZb.CurrentGateWayId != HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway)) + if (HdlGatewayLogic.Current.GetGatewayId(tempZb) != HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway)) { //涓嶆槸鑷繁鐨勭綉鍏虫帹閫侊紝鍒欎笉澶勭悊 return; @@ -543,7 +543,7 @@ } var tempZb = (ZbGateway)objValue; - if (tempZb.CurrentGateWayId != HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway)) + if (HdlGatewayLogic.Current.GetGatewayId(tempZb) != HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway)) { //涓嶆槸鑷繁鐨勭綉鍏虫帹閫侊紝鍒欎笉澶勭悊 return; @@ -643,7 +643,7 @@ return; } var tempZb = (ZbGateway)objValue; - if (tempZb.CurrentGateWayId != HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway)) + if (HdlGatewayLogic.Current.GetGatewayId(tempZb) != HdlGatewayLogic.Current.GetGatewayId(this.upDatezbGateway)) { //涓嶆槸鑷繁鐨勭綉鍏虫帹閫侊紝鍒欎笉澶勭悊 return; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs index 8daca3a..2edc90e 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs @@ -143,7 +143,7 @@ { Application.RunOnMainThread(() => { - MainPage.ListRoomViewFrom.Instance?.ShowForm(); + MainPage.ListRoomViewFrom.Instance?.RefreshListRoom(); }); } @@ -582,6 +582,8 @@ { //浠庡師鏉ョ殑鎴块棿绉婚櫎璁惧 this.DeleteDevice(device); + //璁惧鏀瑰彉鎴块棿鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshForm = true; return; } //鎴块棿鏄惁淇敼 @@ -598,6 +600,8 @@ { this.AddDevice(room, device, saveRealRoom); } + //璁惧鏀瑰彉鎴块棿鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshForm = true; } /// <summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs index d1d8ec5..0dcb055 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs @@ -104,7 +104,7 @@ { var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZigBee.Device.Safeguard.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp != null) { string msg = HdlCheckLogic.Current.CheckCommonErrorCode(temp.Error); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs index 76799e9..e4997c7 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs @@ -487,7 +487,7 @@ alert.Show(); //Log鍑哄姏 - HdlLogLogic.Current.WriteLog(ex, "鐣岄潰閲嶆柊婵�娲诲紓甯�"); + HdlLogLogic.Current.WriteLog(ex, "鐣岄潰閲嶆柊婵�娲诲紓甯� " + UserCenterResourse.NowActionFormID); } } } @@ -832,6 +832,8 @@ /// <returns></returns> public async static Task<bool> InitUserCenterMenmoryAndThread(bool ShowPrompted = true) { + //璋冪敤杩欎釜鏂规硶,閮介渶瑕侀噸鏂板埛鏂颁富椤� + UserView.UserPage.Instance.RefreshForm = true; //濡傛灉鏄櫄鎷熶綇瀹� if (Config.Instance.Home.IsVirtually == true) { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs index 1685d91..d272cde 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddDevicePage.cs @@ -416,7 +416,6 @@ curentOldRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png"; } curRoom = room; - currentKey.RoomId = room.Id; RefreshDeviceList(curRoom); if (curTypeDeviceList.Count == 0) { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs index 3cf0c4f..e5976fd 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/AddScenePage.cs @@ -36,7 +36,11 @@ /// <summary> /// 鎸夐敭閰嶇疆鐨勭洰鏍囧垪琛� /// </summary> - List<CommonDevice> targetList = new List<CommonDevice>(); + List<CommonDevice> targetListDevice = new List<CommonDevice>(); + /// <summary> + /// 鎸夐敭閰嶇疆鐨勫満鏅洰鏍囧垪琛� + /// </summary> + List<SceneUI> targetListScene = new List<SceneUI>(); /// <summary> /// 鏈湴鎴块棿鍒楄〃 /// </summary> @@ -224,7 +228,7 @@ var sc = currentKey.bindList.Find(obj => (obj != null) && (obj.BindScenesId == scTemp.Id)); if (sc != null) { - targetList.Add(scTemp); + targetListScene.Add(scTemp); } } } @@ -244,7 +248,7 @@ btnFinifh.Enable = true; btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; } - if (targetList.Count == 0) + if (targetListDevice.Count == 0 && targetListScene.Count == 0) { btnFinifh.Enable = false; btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; @@ -259,7 +263,7 @@ bool isFinish = false; try { - if (targetList.Count == 0) + if (targetListDevice.Count == 0 && targetListScene.Count == 0) { Application.RunOnMainThread(() => { @@ -348,7 +352,7 @@ var addBindeDev = new AddBindData(); addBindeDev.DeviceAddr = currentKey.DeviceAddr; addBindeDev.Epoint = currentKey.DeviceEpoint; - foreach (var de in targetList) + foreach (var de in targetListDevice) { if (de.DeviceAddr != null) { @@ -359,15 +363,14 @@ addBindInfo.BindEpoint = de.DeviceEpoint; addBindeDev.BindList.Add(addBindInfo); } - else - { - var addBindInfo = new AddBindListObj(); - addBindInfo.BindType = 1; - addBindInfo.BindCluster = 6; - var sc1 = (SceneUI)de; - addBindInfo.BindScenesId = sc1.Id; - addBindeDev.BindList.Add(addBindInfo); - } + } + foreach (var de in targetListScene) + { + var addBindInfo = new AddBindListObj(); + addBindInfo.BindType = 1; + addBindInfo.BindCluster = 6; + addBindInfo.BindScenesId = de.Id; + addBindeDev.BindList.Add(addBindInfo); } var dev = new AddedDeviceBindResponseAllData(); @@ -377,7 +380,8 @@ if (dev.addedDeviceBindResponseData.Result == 0) { currentKey.bindList = dev.addedDeviceBindResponseData.BindList; - targetList.Clear(); + targetListDevice.Clear(); + targetListScene.Clear(); isFinish = true; if (isFinish) { @@ -547,7 +551,6 @@ curentOldRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png"; } curRoom = room; - currentKey.RoomId = room.Id; if (curRoom.ListSceneId.Count == 0) { btnFinifh.Enable = false; @@ -558,7 +561,7 @@ btnFinifh.Enable = true; btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; } - if (targetList.Count == 0) + if (targetListDevice.Count == 0 && targetListScene.Count == 0) { btnFinifh.Enable = false; btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; @@ -665,7 +668,7 @@ { btnBindName.Text = scene.Name; } - if (targetList.Count == 0) + if (targetListDevice.Count == 0 && targetListScene.Count == 0) { foreach (var bindedSc in currentKey.bindList) { @@ -674,16 +677,15 @@ btnChoose.IsSelected = true; btnChoose.Visible = true; oldScene = btnChoose; - targetList.Add(scene); + targetListScene.Add(scene); } } } else { - foreach (var bindedSc in targetList) + foreach (var bindedSc in targetListScene) { - var sc1 = (SceneUI)bindedSc; - if (scene.Id == sc1.Id) + if (scene.Id == bindedSc.Id) { btnChoose.IsSelected = true; btnChoose.Visible = true; @@ -719,11 +721,11 @@ oldScene = btnChoose; oldScene.IsSelected = true; oldScene.Visible = true; - currentKey.curSelectSceneID = scene.Id.ToString(); - targetList.Clear(); - targetList.Add(scene); + targetListDevice.Clear(); + targetListScene.Clear(); + targetListScene.Add(scene); } - if (targetList.Count == 0) + if (targetListDevice.Count == 0 && targetListScene.Count == 0) { btnFinifh.Enable = false; btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; @@ -740,7 +742,7 @@ btnChoose.MouseUpEventHandler += hander; curIndex++; } - if (targetList.Count == 0) + if (targetListDevice.Count == 0 && targetListScene.Count == 0) { btnFinifh.Enable = false; btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; @@ -893,7 +895,7 @@ int index = 0; RefreshRoomList(curRoom, ref index); RefreshSceneList(roomList[0]); - if (targetList.Count == 0) + if (targetListDevice.Count == 0 && targetListScene.Count == 0) { btnFinifh.Enable = false; btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs index 14d3e84..4f40b43 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs @@ -691,7 +691,6 @@ currentKey.bindList.Clear(); RefreshList(); //濡傛灉鏄満鏅紝鐢ㄦ埛鍒犻櫎娓呯┖褰撳墠鍒版埧闂村垪琛� - currentKey.RoomId = ""; currentKey.ReSave(); } CommonPage.Loading.Hide(); @@ -1196,7 +1195,6 @@ { currentKey.panelMode = 65535; } - currentKey.RoomId = ""; currentKey.ReSave(); return 0; break; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs index 7fd5ff7..919a812 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs @@ -712,7 +712,6 @@ oldMode = btnChoose; oldMode.IsSelected = true; oldMode.Visible = true; - currentKey.CurrentSwitchMode = btnModeText.Text; if (btnModeText.Text == Language.StringByID(R.MyInternationalizationString.OnOffOn)) { currentModeID = 100; @@ -888,7 +887,6 @@ oldMode = btnChoose; oldMode.IsSelected = true; oldMode.Visible = true; - currentKey.CurrentSwitchMode = btnModeText.Text; if (btnModeText.Text == Language.StringByID(R.MyInternationalizationString.DimmerMode1)) { currentModeID = 200; @@ -1062,7 +1060,6 @@ oldMode = btnChoose; oldMode.IsSelected = true; oldMode.Visible = true; - currentKey.CurrentSwitchMode = btnModeText.Text; if (btnModeText.Text == Language.StringByID(R.MyInternationalizationString.WcdUp)) { currentModeID = 300; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs index 774d509..0ae952d 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceAddSuccessForm.cs @@ -189,6 +189,8 @@ //鏀瑰悕瀛� btnNote.txtInput.FinishInputEvent(); + this.CloseForm(); + var form = new DeviceMacInfoEditorForm(); form.AddForm(this.listNewDevice[0].DeviceAddr); }; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs index d097672..fc78718 100644 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceFunctionSettionForm.cs @@ -343,6 +343,19 @@ frameBack.Y = Application.GetRealHeight(153); frameBack.Gravity = Gravity.Center; } + + //濡傛灉鏄疨M2.5 + if (deviceObj.Type == DeviceType.PMSensor) + { + frame.RemoveFromParent(); + frameBorder.Y = Application.GetRealHeight(0); + frameBorder.Height = Application.GetRealHeight(708); + frameBack.BackgroundImagePath = "RealDevice/SensorPMTwoPointFive.png"; + frameBack.Width = this.GetPictrueRealSize(418); + frameBack.Height = this.GetPictrueRealSize(403); + frameBack.Y = Application.GetRealHeight(153); + frameBack.Gravity = Gravity.Center; + } } else { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs index b98b37a..8f904cd 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs @@ -912,7 +912,7 @@ #region 鈻� 瀹炵幇澶栭儴璋冪敤_______________________ /// <summary> - /// 娣诲姞鏂扮殑璁惧鍒扮晫闈㈡甯冧腑 + /// 娣诲姞鏂扮殑璁惧鍒扮晫闈㈡甯冧腑(澶栭儴璋冪敤) /// </summary> /// <param name="deviceAddr">璁惧Mac鍦板潃</param> public void AddDeviceToFormTable(string deviceAddr) @@ -940,6 +940,30 @@ //鍒涘缓鏂扮殑琛� this.AddDeviceMenuRow(deviceAddr); + + //璁板綍褰撳墠鐨勬鍦ㄦ搷浣滅殑璁惧鐨凪ac鍦板潃 + this.nowActionDeviceMac = deviceAddr; + } + } + + /// <summary> + /// 鍒锋柊鎸囧畾璁惧琛岀殑淇℃伅(澶栭儴璋冪敤) + /// </summary> + /// <param name="deviceAddr">璁惧Mac鍦板潃</param> + public void RefreshDeviceRow(string deviceAddr) + { + if (this.dicRowInfo.ContainsKey(deviceAddr) == true) + { + var row = this.dicRowInfo[deviceAddr]; + row.MenuRow?.RefreshControlInfo(true); + //鏄庣粏 + if (row.dicDetailRow != null) + { + foreach (var detailRow in row.dicDetailRow.Values) + { + detailRow.RefreshControlInfo(); + } + } } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs index 291de70..c53372f 100644 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs @@ -1238,6 +1238,12 @@ //绉婚櫎鑾峰彇璁惧纭欢淇℃伅鐨勭洃鍚嚎绋� HdlDeviceHardInfoLogic.Current.RemoveDeviceHardInfoThread(listNewDevice[0]); + //璁惧鏂板叆缃� + if (UserCenterResourse.DicActionForm.ContainsKey("AddDeviceTypeListForm") == true) + { + this.LoadFormMethodByName("DeviceListMainForm", "RefreshDeviceRow", new object[] { listNewDevice[0].DeviceAddr }); + } + base.CloseFormBefore(); } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs index 2cdcbbb..898bda2 100644 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirBackLightSettionForm.cs @@ -69,7 +69,7 @@ listview = new VerticalScrolViewLayout(); listview.Height = Application.GetRealHeight(1981 - 184); - bodyFrameLayout.AddChidren(listview); + bodyFrameLayout.AddChidren(listview); listview.ScrollEnabled = false; HdlThreadLogic.Current.RunMain(() => @@ -97,7 +97,7 @@ #endregion - #region 鈻� 灞忓箷浜害绾у埆_______________________ + #region 鈻� 灞忓箷浜害绾у埆_______________________ /// <summary> /// 娣诲姞灞忓箷浜害绾у埆鎺т欢 /// </summary> @@ -305,7 +305,7 @@ int B1 = Convert.ToInt32(this.keyColorData.OpenColorB, 16); uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1); - //棰滆壊澶栨 + //棰滆壊澶栨 var btnColorLine = new FrameLayoutStatuControl(); btnColorLine.Width = Application.GetRealHeight(79); btnColorLine.Height = this.GetPictrueRealSize(79); @@ -373,7 +373,7 @@ #endregion - #region 鈻� 鑺傝兘妯″紡琛宊________________________ + #region 鈻� 鑺傝兘妯″紡琛宊________________________ /// <summary> /// 娣诲姞鑺傝兘妯″紡琛� /// </summary> @@ -596,7 +596,7 @@ } #endregion - #region 鈻� 琛ュ厖瀹瑰櫒___________________________ + #region 鈻� 琛ュ厖瀹瑰櫒___________________________ /// <summary> /// 琛屾暟瓒呰繃瀹瑰櫒鏃讹紝琛ヤ竴涓┖鐧紽rameLayout锛屼娇涔嬭兘婊戝姩 /// </summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs index c5cd1d6..3988cd9 100644 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs @@ -362,7 +362,6 @@ curentOldRoomFrameLayout.BackgroundImagePath = "Item/RoomIconBackgroundSelected.png"; } curRoom = room; - curControlDev.RoomId = room.Id; //鏂伴闈㈡澘淇濆瓨浣胯兘 btnFinifh.Enable = true; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs index 2fc442e..e1c744d 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs @@ -1348,7 +1348,7 @@ DoorLockCommonInfo.NormallyOpenModeInvalidTime = temp; //榛樿鍒涘缓甯稿紑妯″紡鐨勭壒娈婇�昏緫 var res = await Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock); - if (!res) + if (res == 0) { //榛樿鍒涘缓甯稿紑妯″紡澶辫触 string msg0 = Language.StringByID(R.MyInternationalizationString.AddLogicNormallyModeFailed); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs index dd5e4ed..b032749 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs @@ -32,6 +32,8 @@ /// </summary> private void InitMiddleFrame(string i_file) { + if (i_file == string.Empty) { return; } + if (i_file.EndsWith(".png") == true || i_file.EndsWith(".jpg") == true || i_file.EndsWith(".JPG") == true) { var btnPic = new ImageView(); @@ -46,26 +48,35 @@ else { string textValue = System.Text.Encoding.UTF8.GetString(Shared.IO.FileUtils.ReadFile(i_file)).Trim(); - textValue = textValue.Replace(",", "\r\n"); - if (textValue.StartsWith("{") == true) - { - textValue = "{\r\n" + textValue.Substring(1); - } - if (textValue.EndsWith("}") == true) - { - textValue = textValue.Substring(0, textValue.Length - 1) + "\r\n}"; - } - - var btnText = new EditTextView(); - btnText.Width = bodyFrameLayout.Width; - btnText.Height = bodyFrameLayout.Height; - btnText.TextAlignment = TextAlignment.TopLeft; - btnText.TextColor = UserCenterColor.Current.TextColor1; - btnText.Text = textValue; - bodyFrameLayout.AddChidren(btnText); + this.SetTextContent(textValue); } } + /// <summary> + /// 鑷畾涔夎缃樉绀虹殑鏂囨湰 + /// </summary> + /// <param name="i_text"></param> + public void SetTextContent(string textValue) + { + textValue = textValue.Replace(",", "\r\n"); + if (textValue.StartsWith("{") == true) + { + textValue = "{\r\n" + textValue.Substring(1); + } + if (textValue.EndsWith("}") == true) + { + textValue = textValue.Substring(0, textValue.Length - 1) + "\r\n}"; + } + + var btnText = new EditTextView(); + btnText.Width = bodyFrameLayout.Width; + btnText.Height = bodyFrameLayout.Height; + btnText.TextAlignment = TextAlignment.TopLeft; + btnText.TextColor = UserCenterColor.Current.TextColor1; + btnText.Text = textValue; + bodyFrameLayout.AddChidren(btnText); + } + #endregion #region 鈻� 涓�鑸柟娉昣__________________________ diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs index 84ac290..cd42286 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs @@ -160,9 +160,11 @@ listView.AddChidren(row1); row1.AddLeftCaption("璁惧缂撳瓨鍙橀噺", 500); row1.AddRightArrow(); + row1.AddBottomLine(); row1.ButtonClickEvent += (sender, e) => { - + var form = new HideOptionMemoryListDeviceForm(); + form.AddForm(); }; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMemoryListDeviceForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMemoryListDeviceForm.cs new file mode 100755 index 0000000..0a597b5 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMemoryListDeviceForm.cs @@ -0,0 +1,79 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.HideOption +{ + /// <summary> + /// 鏈湴缂撳瓨璁惧鍒楄〃鐨勭晫闈� + /// </summary> + public class HideOptionMemoryListDeviceForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + public void ShowForm() + { + //璁剧疆澶撮儴淇℃伅 + base.SetTitleText("璁惧鍒楄〃"); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + var listView = new VerticalListControl(23); + listView.BackgroundColor = UserCenterColor.Current.White; + listView.Height = bodyFrameLayout.Height; + bodyFrameLayout.AddChidren(listView); + + var listDevice = Common.LocalDevice.Current.listAllDevice; + for (int i = 0; i < listDevice.Count; i++) + { + this.AddRowControl(listView, listDevice[i], i != listDevice.Count - 1); + } + + listView.AdjustRealHeight(Application.GetRealHeight(23)); + } + + private void AddRowControl(VerticalListControl listView, CommonDevice device, bool addLine) + { + var row1 = new RowLayoutControl(listView.rowSpace / 2); + listView.AddChidren(row1); + row1.frameTable.AddTopView(Common.LocalDevice.Current.GetDeviceEpointName(device), 800); + row1.frameTable.AddBottomView(device.FilePath, 800); + if (addLine == true) + { + row1.frameTable.AddBottomLine(); + } + row1.frameTable.AddRightArrow(); + + row1.frameTable.ButtonClickEvent += (sender, e) => + { + var txtContent = Newtonsoft.Json.JsonConvert.SerializeObject(device); + + var form = new HideOptionFileContentForm(); + form.AddForm(string.Empty); + + form.SetTextContent(txtContent); + }; + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs index 36f760b..911745a 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/AddNewRoomForm.cs @@ -214,6 +214,9 @@ newRoom.Temperatrue = 0; } + //娣诲姞鎴块棿,涓婚〉闇�瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshForm = true; + HdlRoomLogic.Current.AddRoom(newRoom); this.FinishEditorEvent?.Invoke(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs index 79e3f4f..28c511f 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs @@ -313,6 +313,10 @@ //鍒锋柊宸︽粦鐨勬埧闂村垪琛ㄧ晫闈㈢殑鎴块棿鍒楄〃淇℃伅 MainPage.ListRoomViewFrom.Instance.RefreshListRoom(); } + + //绠椾簡,杩欓噷濡傛灉鎸変笅淇濆瓨,鍒欎富椤甸渶瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshForm = true; + this.CloseForm(); }; } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs index 756134f..a32a3e9 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs @@ -248,7 +248,7 @@ string path1 = string.Empty; string path2 = string.Empty; //鑾峰彇鍥剧墖 - Common.LocalDevice.Current.GetDeviceObjectIcon(typeInfo.ConcreteType, ref path1, ref path2); + Common.LocalDevice.Current.GetDeviceFunctionTypeMenuIcon(typeInfo.ConcreteType, ref path1, ref path2); dic[typeInfo.BeloneTextId].IconPath = path1; } dic[typeInfo.BeloneTextId].listDeviceKeys.Add(Common.LocalDevice.Current.GetDeviceMainKeys(device)); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs index 8682058..12f4930 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs @@ -425,6 +425,8 @@ //璋冩暣妗屽竷楂樺害 this.AdjustContrlTableHeight(); } + //鍒犻櫎妤煎眰鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshForm = true; }); }; } @@ -495,6 +497,8 @@ //鏍规嵁鎸囧畾妯″紡,鍒濆鍖栨甯冩帶浠� this.InitFrameTableByMode(); } + //鍒涘缓鎴栬�呬慨鏀规ゼ灞傜殑璇�,涓婚〉闇�瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshForm = true; } }); } @@ -649,6 +653,8 @@ //璋冩暣妗屽竷楂樺害 this.AdjustContrlTableHeight(); } + //鍒犻櫎鎴块棿鐨勮瘽,涓婚〉闇�瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshForm = true; }); }; } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetAddMenuForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetAddMenuForm.cs index 945475a..4ed7043 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetAddMenuForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetAddMenuForm.cs @@ -291,7 +291,7 @@ var typeInfo = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device); //鑾峰彇鍥剧墖 - Common.LocalDevice.Current.GetDeviceObjectIcon(typeInfo.ConcreteType, ref unSelectPath, ref selectPath); + Common.LocalDevice.Current.GetDeviceFunctionTypeMenuIcon(typeInfo.ConcreteType, ref unSelectPath, ref selectPath); if (dicRoomData.ContainsKey(typeInfo.BeloneTextId) == false) { dicRoomData[typeInfo.BeloneTextId] = new uRowInformation(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs index 5799375..1347a57 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/SafetyManagementMainForm.cs @@ -253,6 +253,8 @@ UserCenterResourse.ResidenceOption.SafetyShortcut = false; UserCenterResourse.ResidenceOption.Save(); btnShortCut.IsSelected = false; + //鍙栨秷涓婚〉鐨勩�屽畨闃层�嶆嵎寰勭殑璇�,涓婚〉闇�瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshForm = true; }); } else @@ -263,6 +265,8 @@ UserCenterResourse.ResidenceOption.SafetyShortcut = true; UserCenterResourse.ResidenceOption.Save(); btnShortCut.IsSelected = true; + //鍒涘缓涓婚〉鐨勩�屽畨闃层�嶆嵎寰勭殑璇�,涓婚〉闇�瑕侀噸鏂板埛鏂� + UserView.UserPage.Instance.RefreshForm = true; }); } }; diff --git a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs index 55f5d7d..f143967 100755 --- a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs +++ b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs @@ -329,9 +329,26 @@ //鍏抽棴鍏ㄩ儴鐣岄潰,鐩村埌涓婚〉涓烘 UserCenterLogic.CloseAllOpenForm(); //寮哄埗鏄剧ず鑷姩鍖栧垪琛ㄧ晫闈� - UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex = 2; - - this.BottomMenuClickEvent(MenuSelectEnum.A鍒嗙被, false); + UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex = 2; + + this.nowSelectMenu = MenuSelectEnum.A鍒嗙被; + + //宸︽粦鑿滃崟涓嶅彲 + CommonPage.Instance.IsDrawerLockMode = true; + if (listForm[1] == null) + { + var form = new Category.CategoryMainForm(); + this.bodyFrameView.AddChidren(form); + form.ShowForm(); + //鍔犵紦瀛� + listForm[1] = form; + } + else + { + ((Category.CategoryMainForm)listForm[1]).RefreshBodyView(); + } + //璁剧疆鍏ㄩ儴鎺т欢鐨勫悇绉嶇姸鎬佺姸鎬� + this.SetAllControlStatu(); } #endregion diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs b/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs index 5fb22cb..04c6a57 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs @@ -196,7 +196,6 @@ getGatewayBaseInfo = new ZbGateway.GatewayBaseInfo { IpAddress = ipAddress, - Time = time, GwName = gwName, HomeId = homeID, IsMainGateWay = isMainGateWay, @@ -248,7 +247,6 @@ else { gateWay.PubKey = pubKey; - gateWay.getGatewayBaseInfo.Time = time; gateWay.getGatewayBaseInfo.GwName = gwName; gateWay.getGatewayBaseInfo.HomeId = homeID; await gateWay.StartLocalMqtt(ipAddress); diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/AC.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/AC.cs index daed5b8..ac390e4 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/AC.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/AC.cs @@ -4,7 +4,7 @@ namespace ZigBee.Device { [System.Serializable] - public class AC : ThirdPartyModuleUpgrade + public class AC : CommonDevice { public AC() { @@ -14,35 +14,23 @@ /// <summary> ///褰撳墠瀹ゅ唴娓╁害 /// </summary> + [Newtonsoft.Json.JsonIgnore] public int currentLocalTemperature = 0; - /// <summary> /// 褰撳墠鍔犵儹搴︽暟 /// </summary> + [Newtonsoft.Json.JsonIgnore] public int currentHeatingSetpoint = 0; - /// <summary> /// 褰撳墠鍒跺喎搴︽暟 /// </summary> + [Newtonsoft.Json.JsonIgnore] public int currentCoolingSetpoint = 0; - /// <summary> /// 褰撳墠鑷姩娓╁害 /// </summary> + [Newtonsoft.Json.JsonIgnore] public int currentAutoSetpoint; - - /// <summary> - ///鎭掓俯璁惧绫诲瀷 - /// <para>鎭掓俯璁惧鍏峰鍔熻兘锛孉ttribute Values濡備笅</para> - /// <para>0:(Cooling Only) 鏃燞eat鍜孍mergency鍔熻兘</para> - /// <para>1:(Cooling With Reheat)鏃燞eat鍜孍mergency鍔熻兘</para> - /// <para>2:(Heating Only)鏃燙ool鍜孭recooling鍔熻兘</para> - /// <para>3:(Heating With Reheat)鏃燙ool鍜孭recooling鍔熻兘</para> - /// <para>4:(Cooling and Heating 4-pipes)鍙兘鏈夋墍鏈夊姛鑳�</para> - /// <para>5:(Cooling and Heating 4-pipes with Reheat)鍙兘鏈夋墍鏈夊姛鑳�</para> - /// </summary> - public int currentAcType = 0; - /// <summary> /// 鎭掓俯璁惧褰撳墠妯″紡 /// <para>鎭掓俯璁惧鍏峰鍔熻兘锛孲ystemMode Attribute Values濡備笅</para> @@ -56,8 +44,8 @@ /// <para>8:Dry </para> /// <para>9:Sleep</para> /// </summary> + [Newtonsoft.Json.JsonIgnore] public int currentSystemMode = 0; - /// <summary> /// 椋庢墖褰撳墠妯″紡 /// <para>0:Off </para> @@ -68,8 +56,8 @@ /// <para>5:Auto </para> /// <para>6:Smart</para> /// </summary> + [Newtonsoft.Json.JsonIgnore] public int currentFanMode = 0; - /// <summary> /// 椋庢墖zz鎵褰撳墠妯″紡 /// <para>0:1鎸� </para> @@ -79,18 +67,9 @@ /// <para>4:5 </para> /// <para>7:Auto </para> /// </summary> + [Newtonsoft.Json.JsonIgnore] public int currentFanSwingMode = 0; - /// <summary> - /// 鏀寔鐨勬帶鍒舵ā寮� - /// </summary> - public List<AcMode> acModes = new List<AcMode> { }; - - /// <summary> - /// 鏀寔鐨勯閫熸ā寮� - /// </summary> - public List<FanMode> fanModes = new List<FanMode> { }; - /// <summary> /// <para>鑷畾涔夌┖璋冩敮鎸佺殑妯″紡(榛樿鍏ㄥ紑)</para> /// <para>鏁扮粍绱㈠紩 -> 0:鍒跺喎 1:鍒剁儹 2:閫侀 3:闄ゆ箍 4:鑷姩</para> /// <para>鍊� -> 1:浠h〃浣跨敤 0:浠h〃涓嶄娇鐢�</para> @@ -100,10 +79,10 @@ /// 鏄惁鍚敤鎽嗛鍔熻兘 false:涓嶄娇鐢ㄦ憜椋庡姛鑳� true:浣跨敤鎽嗛鍔熻兘 /// </summary> public bool UseSwingFunction = true; - /// <summary> /// 杩囨护缃戞竻娲楃姸鎬� /// </summary> + [Newtonsoft.Json.JsonIgnore] public bool CleanStatu = false; /// <summary> @@ -261,8 +240,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -276,7 +254,6 @@ if (topic == gatewayID + "/" + "SetWritableValue_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString()); if (tempData == null) @@ -340,8 +317,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -355,7 +331,6 @@ if (topic == gatewayID + "/" + "SetWritableValue_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString()); if (tempData == null) @@ -418,8 +393,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -433,7 +407,6 @@ if (topic == gatewayID + "/" + "SetWritableValue_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString()); if (tempData == null) @@ -496,8 +469,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -511,7 +483,6 @@ if (topic == gatewayID + "/" + "SetWritableValue_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString()); if (tempData == null) @@ -574,8 +545,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -589,7 +559,6 @@ if (topic == gatewayID + "/" + "SetWritableValue_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString()); if (tempData == null) @@ -692,8 +661,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -707,7 +675,6 @@ if (topic == gatewayID + "/" + "SetWritableValue_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString()); if (tempData == null) diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/BindObj.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/BindObj.cs index e852fa5..562405e 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/BindObj.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/BindObj.cs @@ -28,8 +28,7 @@ var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -43,7 +42,6 @@ } else if (topic == gatewayID + "/" + "Bind/SetBind_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID }; var tempResult = Newtonsoft.Json.JsonConvert.DeserializeObject<AddedDeviceBindResponseData>(jobject["Data"].ToString()); if (tempResult == null) { @@ -117,22 +115,9 @@ }); } - /// <summary> - /// 缁戝畾璁惧淇℃伅,缃戝叧鍙嶉淇℃伅 - /// </summary> - public AddedDeviceBindResponseAllData addedDeviceBindResponseAllData; [System.Serializable] - public class AddedDeviceBindResponseAllData + public class AddedDeviceBindResponseAllData : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 缃戝叧鐩存帴鍙嶉缁戝畾璁惧淇℃伅 /// </summary> @@ -143,10 +128,6 @@ public AddBindResultResponseData addBindResultResponseData; } - /// <summary> - /// 缁戝畾璁惧淇℃伅 - /// </summary> - public AddedDeviceBindResponseData addedDeviceBindResponseData; [System.Serializable] public class AddedDeviceBindResponseData { @@ -218,7 +199,6 @@ /// <summary> /// 缁戝畾璁惧鐨勬暟鎹� /// </summary> - public AddBindData addBindData; [System.Serializable] public class AddBindData { @@ -294,8 +274,7 @@ // if (topic == gatewayID + "/" + "Error_Respon") // { - // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); // if (temp == null) // { @@ -309,7 +288,6 @@ // //鍦烘櫙绉婚櫎 // if (topic == gatewayID + "/" + "Bind/RemoveBind_Respon") // { - // var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; // var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelDeviceBindResponseData>(jobject["Data"].ToString()); // if (tempData == null) @@ -325,7 +303,6 @@ // //璁惧绉婚櫎 // if (topic == gatewayID + "/" + "Bind/RemoveBindResult") // { - // var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; // var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveBindResultResponseData>(jobject["Data"].ToString()); // if (tempData != null) @@ -413,8 +390,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -429,7 +405,6 @@ if (topic == gatewayID + "/" + "Bind/RemoveBind_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelDeviceBindResponseData>(jobject["Data"].ToString()); if (tempData == null) @@ -446,7 +421,6 @@ if (topic == gatewayID + "/" + "Bind/RemoveBindResult") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveBindResultResponseData>(jobject["Data"].ToString()); if (tempData != null) @@ -543,22 +517,9 @@ /// <summary> ///瑙i櫎缁戝畾鏁版嵁,缃戝叧鍙嶉淇℃伅 /// </summary> - public DelDeviceBindResponseAllData delDeviceBindResponseAllData; - /// <summary> - ///瑙i櫎缁戝畾鏁版嵁,缃戝叧鍙嶉淇℃伅 - /// </summary> [System.Serializable] - public class DelDeviceBindResponseAllData + public class DelDeviceBindResponseAllData : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 瑙i櫎缁戝畾鏁版嵁淇℃伅 /// </summary> @@ -570,10 +531,6 @@ public RemoveBindResultResponseData removeBindResultResponseData; } - /// <summary> - /// 瑙i櫎缁戝畾鏁版嵁 - /// </summary> - public DelDeviceBindResponseData delDeviceBindResponseData; /// <summary> /// 瑙i櫎缁戝畾鏁版嵁 /// </summary> @@ -634,10 +591,6 @@ public string DeviceName; } - /// <summary> - /// 瑙i櫎缁戝畾鏁版嵁 - /// </summary> - public DelDeviceBindData delDeviceBindData; /// <summary> /// 瑙i櫎缁戝畾鏁版嵁 /// </summary> @@ -713,8 +666,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -728,7 +680,6 @@ if (topic == gatewayID + "/" + "Bind/GetDeviceBind_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<GetDeviceBindResponseData>(jobject["Data"].ToString()); //var tempBindList = Newtonsoft.Json.Linq.JArray.Parse(jobject["Data"]["BindList"].ToString()); if (tempData == null) @@ -775,19 +726,9 @@ /// <summary> ///鑾峰彇鎵�鏈夌粦瀹氭暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> - public GetDeviceBindResponseAllData getAllBindResponseAllData; [System.Serializable] - public class GetDeviceBindResponseAllData + public class GetDeviceBindResponseAllData : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鎺у埗璁惧缁戝畾鐨勮澶囧垪琛ㄥ洖澶嶆暟鎹� /// </summary> @@ -797,7 +738,6 @@ /// <summary> /// 鑾峰彇鎵�鏈夌粦瀹氬洖澶嶇殑鏁版嵁 /// </summary> - public GetDeviceBindResponseData getAllBindResponseData; [System.Serializable] public class GetDeviceBindResponseData { @@ -870,8 +810,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -885,7 +824,6 @@ if (topic == gatewayID + "/" + "Bind/GetDeviceLocalBind_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<GetDeviceLocalBindResponseData>(jobject["Data"].ToString()); if (tempData == null) { @@ -932,19 +870,9 @@ /// <summary> ///浠庤妭鐐硅澶囨湰鍦拌褰曡鍙栫粦瀹氬垪琛ㄤ俊鎭洖澶嶇殑鏁版嵁,缃戝叧鍙嶉淇℃伅 /// </summary> - public GetDeviceLocalBindResponseAllData getDeviceLocalBindResponseAllData; [System.Serializable] - public class GetDeviceLocalBindResponseAllData + public class GetDeviceLocalBindResponseAllData : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 浠庤妭鐐硅澶囨湰鍦拌褰曡鍙栫粦瀹氬垪琛ㄤ俊鎭洖澶嶇殑鏁版嵁 /// </summary> @@ -954,7 +882,6 @@ /// <summary> /// 浠庤妭鐐硅澶囨湰鍦拌褰曡鍙栫粦瀹氬垪琛ㄤ俊鎭洖澶嶇殑鏁版嵁 /// </summary> - public GetDeviceLocalBindResponseData getDeviceLocalBindResponseData; [System.Serializable] public class GetDeviceLocalBindResponseData { @@ -1035,8 +962,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1050,7 +976,6 @@ if (topic == gatewayID + "/" + "Bind/ClearBindInfo_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClearBindInfoResponseData>(jobject["Data"].ToString()); if (tempData == null) { @@ -1097,19 +1022,9 @@ /// <summary> ///鍒犻櫎涓�涓帶鍒惰澶囨墍鏈夌粦瀹氭暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> - public ClearBindInfoResponseAllData clearBindInfoResponseAllData; [System.Serializable] - public class ClearBindInfoResponseAllData + public class ClearBindInfoResponseAllData : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鎺у埗璁惧缁戝畾鐨勮澶囧垪琛ㄥ洖澶嶆暟鎹� /// </summary> @@ -1119,7 +1034,6 @@ /// <summary> /// 鍒犻櫎涓�涓帶鍒惰澶囨墍鏈夌粦瀹氫俊鎭洖澶嶇殑鏁版嵁 /// </summary> - public ClearBindInfoResponseData clearBindInfoResponseData; [System.Serializable] public class ClearBindInfoResponseData { diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs index f78d627..4fe007b 100644 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs @@ -8,36 +8,170 @@ [System.Serializable] public class CommonDevice { + #region 闇�瑕佷繚瀛樼殑鍙橀噺 + + /// <summary> + /// 鏄惁鏄嚜瀹氫箟鍥剧墖 + /// </summary> + public bool IsCustomizeImage = false; + /// <summary> + /// 璁惧鍥剧墖 + /// </summary> + public string IconPath = string.Empty; + /// <summary> + /// 璁惧鍥剧墖--鍦ㄧ嚎鎴栬�呴�変腑鐘舵�� + /// </summary> + /// <value>The online icon path.</value> + [Newtonsoft.Json.JsonIgnore] + public string OnlineIconPath + { + get + { + if (string.IsNullOrEmpty(IconPath)) + { + return string.Empty; + } + var pathArr = IconPath.Split('.'); + if (pathArr == null || string.IsNullOrEmpty(pathArr[0])) + { + return string.Empty; + } + return $"{pathArr[0]}Selected.png"; + } + } + /// <summary> + /// 褰撳墠缃戝叧鐨処D + /// </summary> + public string CurrentGateWayId; + /// <summary> + /// 褰撳墠璁惧绫诲瀷 + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public DeviceType Type = DeviceType.UnKown; + /// <summary> + /// 璁惧鐨勫姛鑳界被鍨�(姝ょ被鍨嬬洰鍓嶅彧閽堝缁х數鍣ㄥ洖璺湁鏁�,榛樿鏈寚瀹�) + /// </summary> + public DeviceFunctionType DfunctionType = DeviceFunctionType.A鏈畾涔�; + /// <summary> + /// MAC鍦板潃 + /// </summary> + public string DeviceAddr; + /// <summary> + /// 璁惧绔彛鍙� + /// </summary> + public int DeviceEpoint; + /// <summary> + /// 璁惧id + /// <para>258:color dimmable light,璋冨叧鐏� </para> + /// <para>10:Door lock,闂ㄩ攣</para> + /// <para>514:Window covering device,绐楀笜</para> + /// <para>515:Window covering controller锛岀獥甯樻帶鍒跺櫒</para> + /// <para>769:Thermostat,鎭掓俯闈㈡澘/绌鸿皟</para> + /// <para>770:Temperature Sensor,娓╁害浼犳劅鍣�</para> + /// <para>775:Temperature Sensor,婀垮害浼犳劅鍣�</para> + /// <para>262:Light sensor,鍏夌収浼犳劅鍣�</para> + /// <para>1026:sensor,浼犳劅鍣紝鍏蜂綋绫诲瀷鐨勪紶鎰熷櫒DeviceType鏉ュ尯鍒�</para> + /// </summary> + public int DeviceID; + /// <summary> + /// 璇ュ瓧娈典富瑕侀拡瀵笽AS瀹夐槻璁惧璁剧珛銆傛墍鏈塈AS瀹夐槻璁惧鍏辩敤涓�涓狣eviceID涓�1026銆傛墍浠ヨ鍖哄垎瀛愯澶囩被鍨嬶紝闇�瑕佽瀛楁銆� + /// 鐬棿鏁版嵁涓婃姤鐨勪紶鎰熷櫒 (MomentStatus=1 TriggerZoneStatus>=1锛滄姤璀︼紴) + /// <para>13:Motion sensor (杩愬姩浼犳劅鍣級</para> + /// <para>40 Fire sensor 鐑熼浘浼犳劅鍣�</para> + /// <para>42 Water sensor 姘翠镜浼犳劅鍣�</para> + /// <para>43 Carbon Monoxide (CO) 鐕冩皵浼犳劅鍣�</para> + /// <para>44 Personal emergency device 绱ф�ユ寜閽�</para> + /// <para>277 Key fob 閽ュ寵鎵�</para> + /// <para>鎸佺画鏁版嵁涓婃姤(MomentStatus=0 TriggerZoneStatus>=1锛滄姤璀︼紴 TriggerZoneStatus=0锛滃彇娑堟姤璀︼紴)</para> + /// <para>21: Door/Window 闂ㄧ獥浼犳劅鍣紙鏈�21鍜�22锛岃繖閲屾病鏈夊啓閿欙級</para> + /// <para>22:Door/Window 闂ㄧ獥浼犳劅鍣紙鏈�21鍜�22锛岃繖閲屾病鏈夊啓閿�</para> + /// </summary> + public int IasDeviceType; + /// <summary> + /// 璁惧鍚嶇О,浠ヨ澶囩殑MAC鍛藉悕 + /// </summary> + public string DeviceName = "UnKown"; + /// <summary> + /// 璁惧绔偣鍚嶇О锛屼互璁惧绔偣鍚嶇О鍛藉悕 + /// </summary> + public string DeviceEpointName = "UnKown"; + /// <summary> + /// 鐢ㄤ簬鍒ゆ柇璁惧鐨剒igbee鍗忚鐗堟湰銆� + ///<para>49246锛歓LL1.0鏍囧噯璁惧銆�</para> + ///<para>260锛� ZHA1.2鏍囧噯璁惧銆� Z3.0鏍囧噯璁惧銆�</para> + ///<para>41440锛歓GP3.0鏍囧噯璁惧銆�</para> + ///<para>265锛歓SE1.4鏍囧噯璁惧銆�</para> + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public int Profile; + /// <summary> + /// 0锛氳澶囦笉鍦ㄧ嚎 + /// <para>1锛氳澶囧湪绾�</para> + /// </summary> + public int IsOnline; + /// <summary> + /// 1锛氳矾鐢辫澶� + /// <para>2锛氱粓绔澶囷紝鐢垫睜璁惧</para> + /// </summary> + public int ZigbeeType; + /// <summary> + /// 褰撳墠杩愯绋嬪簭鐗堟湰淇℃伅銆� 鏈�澶�64瀛楄妭 + /// </summary> + public int ImgVersion; + /// <summary> + /// 纭欢鐗堟湰 + /// </summary> + public int HwVersion; + /// <summary> + /// 褰撳墠闀滃儚绫诲瀷id + /// </summary> + public int ImgTypeId; + /// <summary> + /// 椹卞姩浠g爜銆備负0鏃讹紝琛ㄧずzigbee鍗忚皟鍣ㄨ澶囥�傚叾浠栧�艰〃绀轰负铏氭嫙椹卞姩璁惧 + /// </summary> + public int DriveCode; + /// <summary> + /// 鐢熶骇鍟嗗悕瀛� + /// </summary> + public string ManufacturerName = string.Empty; + /// <summary> + /// 妯″潡ID锛堣繖涓笢瑗夸篃鍙�愬瀷鍙风爜銆戯級 + /// </summary> + public string ModelIdentifier = string.Empty; + /// <summary> + /// 鐢熶骇鏃ユ湡 + /// </summary> + public string ProductionDate = string.Empty; + /// <summary> + /// 鐢垫簮 + /// </summary> + public int PowerSource = -1; + /// <summary> + /// 搴忓垪鍙� + /// </summary> + public string SerialNumber = string.Empty; + /// <summary> + /// 杈撳叆绨囧垪琛� + /// </summary> + public List<InClusterObj> InClusterList = new List<InClusterObj>(); + /// <summary> + /// 杈撳嚭绨囧垪琛� + /// </summary> + public List<OutClusterObj> OutClusterList = new List<OutClusterObj>(); + [Newtonsoft.Json.JsonIgnore] public DateTime LastDateTime = DateTime.MinValue; - /// <summary> - /// 鏄惁宸茬粡璇诲彇浜嗚澶囩姸鎬�(姝ゅ睘鎬ф槸缁欎富椤典娇鐢ㄧ殑) + /// <summary> + /// 鏄惁宸茬粡璇诲彇浜嗚澶囩姸鎬�(姝ゅ睘鎬ф槸缁欎富椤典娇鐢ㄧ殑) /// </summary> [Newtonsoft.Json.JsonIgnore] public bool HadReadDeviceStatu = false; /// <summary> - /// 璋冭瘯鏃舵墦寮�鎵撳嵃淇℃伅锛宼rue:鎵撳嵃锛宖alse:涓嶆墦鍗� - /// </summary> - /// <param name="msg">Message.</param> - /// <param name="flage">If set to <c>true</c> flage.</param> - public static void DebugPrintLog(string msg, bool flage = true) - { -#if DEBUG - if (flage == true) - { - if (msg.Contains("DeviceStatusReport") == false) - { - System.Console.WriteLine(msg + " " + System.DateTime.Now.ToLongTimeString() + " " + System.DateTime.Now.Millisecond); - } - } -#endif - } - - /// <summary> /// 绛夊緟浠庣綉鍏虫帴鏀舵暟鎹殑鏃堕棿 /// </summary> /// <value>The wait receive data time.</value> + [Newtonsoft.Json.JsonIgnore] public virtual int WaitReceiveDataTime { get @@ -50,16 +184,6 @@ { return 3000; } - } - } - - - [Newtonsoft.Json.JsonIgnore] - public bool IsValid - { - get - { - return (DateTime.Now - LastDateTime).TotalSeconds < 10; } } @@ -103,20 +227,9 @@ } } - /// <summary> - /// 鐢辫澶囪矾寰勬仮澶嶈澶囧璞� - /// </summary> - /// <returns>The device by file path.</returns> - /// <param name="deviceFilePath">Device file path.</param> - public static CommonDevice CommonDeviceByFilePath(string deviceFilePath) - { - var v = deviceFilePath.Split('_'); - if (v.Length < 3) - { - return null; - } - return CommonDeviceByByteString(v[1], System.Text.Encoding.UTF8.GetString(Shared.Common.Global.ReadFileByHomeId(deviceFilePath))); - } + #endregion + + #region 璁惧淇濆瓨鍙婄敓鎴� /// <summary> /// 鐢辫澶囧瓧绗︿覆姣旂壒鎭㈠璁惧瀵硅薄 @@ -126,61 +239,62 @@ /// <returns></returns> public static CommonDevice CommonDeviceByByteString(string strDeviceType, string strDeviceByte) { + CommonDevice device = null; if (strDeviceType == ZigBee.Device.DeviceType.DimmableLight.ToString()) { - return Newtonsoft.Json.JsonConvert.DeserializeObject<DimmableLight>(strDeviceByte); + device = Newtonsoft.Json.JsonConvert.DeserializeObject<DimmableLight>(strDeviceByte); } else if (strDeviceType == ZigBee.Device.DeviceType.OnOffOutput.ToString()) { - return Newtonsoft.Json.JsonConvert.DeserializeObject<ToggleLight>(strDeviceByte); + device = Newtonsoft.Json.JsonConvert.DeserializeObject<ToggleLight>(strDeviceByte); } else if (strDeviceType == ZigBee.Device.DeviceType.WindowCoveringDevice.ToString()) { - return Newtonsoft.Json.JsonConvert.DeserializeObject<Rollershade>(strDeviceByte); + device = Newtonsoft.Json.JsonConvert.DeserializeObject<Rollershade>(strDeviceByte); } else if (strDeviceType == ZigBee.Device.DeviceType.OnOffSwitch.ToString()) { - return Newtonsoft.Json.JsonConvert.DeserializeObject<Panel>(strDeviceByte); + device = Newtonsoft.Json.JsonConvert.DeserializeObject<Panel>(strDeviceByte); } else if (strDeviceType == ZigBee.Device.DeviceType.IASZone.ToString()) { - return Newtonsoft.Json.JsonConvert.DeserializeObject<IASZone>(strDeviceByte); + device = Newtonsoft.Json.JsonConvert.DeserializeObject<IASZone>(strDeviceByte); } else if (strDeviceType == ZigBee.Device.DeviceType.OtaDevice.ToString() || strDeviceType == ZigBee.Device.DeviceType.OtaPanelDevice.ToString()) { - return Newtonsoft.Json.JsonConvert.DeserializeObject<OTADevice>(strDeviceByte); + device = Newtonsoft.Json.JsonConvert.DeserializeObject<OTADevice>(strDeviceByte); } else if (strDeviceType == ZigBee.Device.DeviceType.AirSwitch.ToString()) { - return Newtonsoft.Json.JsonConvert.DeserializeObject<AirSwitch>(strDeviceByte); + device = Newtonsoft.Json.JsonConvert.DeserializeObject<AirSwitch>(strDeviceByte); } else if (strDeviceType == ZigBee.Device.DeviceType.Repeater.ToString()) { - return Newtonsoft.Json.JsonConvert.DeserializeObject<Repeater>(strDeviceByte); + device = Newtonsoft.Json.JsonConvert.DeserializeObject<Repeater>(strDeviceByte); } else if (strDeviceType == ZigBee.Device.DeviceType.Thermostat.ToString()) { - return Newtonsoft.Json.JsonConvert.DeserializeObject<AC>(strDeviceByte); + device = Newtonsoft.Json.JsonConvert.DeserializeObject<AC>(strDeviceByte); } else if (strDeviceType == ZigBee.Device.DeviceType.Transverter.ToString()) { - return Newtonsoft.Json.JsonConvert.DeserializeObject<Transverter>(strDeviceByte); + device = Newtonsoft.Json.JsonConvert.DeserializeObject<Transverter>(strDeviceByte); } else if (strDeviceType == ZigBee.Device.DeviceType.DoorLock.ToString()) { - return Newtonsoft.Json.JsonConvert.DeserializeObject<DoorLock>(strDeviceByte); + device = Newtonsoft.Json.JsonConvert.DeserializeObject<DoorLock>(strDeviceByte); } else if (strDeviceType == ZigBee.Device.DeviceType.TemperatureSensor.ToString()) { - return Newtonsoft.Json.JsonConvert.DeserializeObject<TemperatureSensor>(strDeviceByte); + device = Newtonsoft.Json.JsonConvert.DeserializeObject<TemperatureSensor>(strDeviceByte); } else if (strDeviceType == ZigBee.Device.DeviceType.FreshAirHumiditySensor.ToString()) { - return Newtonsoft.Json.JsonConvert.DeserializeObject<HumiditySensor>(strDeviceByte); + device = Newtonsoft.Json.JsonConvert.DeserializeObject<HumiditySensor>(strDeviceByte); } else if (strDeviceType == ZigBee.Device.DeviceType.FreshAir.ToString()) { - return Newtonsoft.Json.JsonConvert.DeserializeObject<FreshAir>(strDeviceByte); + device = Newtonsoft.Json.JsonConvert.DeserializeObject<FreshAir>(strDeviceByte); } else if (strDeviceType == ZigBee.Device.DeviceType.PMSensor.ToString()) { @@ -244,17 +358,17 @@ } else if (this.Type == DeviceType.Thermostat) { - //绌鸿皟 + //绌鸿皟 IconPath = "Device/AirConditionerEpoint.png"; } else if (this.Type == DeviceType.FreshAir) { - //鏂伴 + //鏂伴 IconPath = "Device/FreshAirEpoint.png"; } else if (this.Type == DeviceType.PMSensor) { - //PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� + //PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� IconPath = "Device/AirQualitySensorEpoint.png"; } else if (this.Type == DeviceType.FreshAirHumiditySensor) @@ -287,197 +401,9 @@ } } - /// <summary> - /// 鏄惁鏄嚜瀹氫箟鍥剧墖 - /// </summary> - public bool IsCustomizeImage = false; - /// <summary> - /// 璁惧鍥剧墖 - /// </summary> - public string IconPath = string.Empty; - /// <summary> - /// 璁惧鍥剧墖--鍦ㄧ嚎鎴栬�呴�変腑鐘舵�� - /// </summary> - /// <value>The online icon path.</value> - [Newtonsoft.Json.JsonIgnore] - public string OnlineIconPath - { - get - { - if (string.IsNullOrEmpty(IconPath)) - { - return string.Empty; - } - var pathArr = IconPath.Split('.'); - if (pathArr == null || string.IsNullOrEmpty(pathArr[0])) - { - return string.Empty; - } - return $"{pathArr[0]}Selected.png"; - } - } + #endregion - /// <summary> - /// 褰撳墠缃戝叧鐨処D - /// </summary> - public string CurrentGateWayId; - /// <summary> - /// 褰撳墠璁惧绫诲瀷 - /// </summary> - public DeviceType Type = DeviceType.UnKown; - /// <summary> - /// 璁惧鐨勫姛鑳界被鍨�(姝ょ被鍨嬬洰鍓嶅彧閽堝缁х數鍣ㄥ洖璺湁鏁�,榛樿鏈寚瀹�) - /// </summary> - public DeviceFunctionType DfunctionType = DeviceFunctionType.A鏈畾涔�; - /// <summary> - /// MAC鍦板潃 - /// </summary> - public string DeviceAddr; - - /// <summary> - /// 璁惧绔彛鍙� - /// </summary> - public int DeviceEpoint; - - /// <summary> - /// 璁惧鍛戒护鏍煎紡锛歁ac+绔彛 - /// </summary> - /// <value>The common device address epoint.</value> - public string CommonDeviceAddrEpoint - { - get - { - return DeviceAddr + "_" + DeviceEpoint.ToString(); - } - } - - /// <summary> - /// 缃戝叧鍙嶉鐨勬椂闂存埑 - /// </summary> - public int Time; - - /// <summary> - /// 缃戝叧鍥炲鐨勬暟鎹甀D - /// </summary> - public int DataID; - - /// <summary> - /// 璁惧id - /// <para>258:color dimmable light,璋冨叧鐏� </para> - /// <para>10:Door lock,闂ㄩ攣</para> - /// <para>514:Window covering device,绐楀笜</para> - /// <para>515:Window covering controller锛岀獥甯樻帶鍒跺櫒</para> - /// <para>769:Thermostat,鎭掓俯闈㈡澘/绌鸿皟</para> - /// <para>770:Temperature Sensor,娓╁害浼犳劅鍣�</para> - /// <para>775:Temperature Sensor,婀垮害浼犳劅鍣�</para> - /// <para>262:Light sensor,鍏夌収浼犳劅鍣�</para> - /// <para>1026:sensor,浼犳劅鍣紝鍏蜂綋绫诲瀷鐨勪紶鎰熷櫒DeviceType鏉ュ尯鍒�</para> - /// </summary> - public int DeviceID; - - /// <summary> - /// 璇ュ瓧娈典富瑕侀拡瀵笽AS瀹夐槻璁惧璁剧珛銆傛墍鏈塈AS瀹夐槻璁惧鍏辩敤涓�涓狣eviceID涓�1026銆傛墍浠ヨ鍖哄垎瀛愯澶囩被鍨嬶紝闇�瑕佽瀛楁銆� - /// 鐬棿鏁版嵁涓婃姤鐨勪紶鎰熷櫒 (MomentStatus=1 TriggerZoneStatus>=1锛滄姤璀︼紴) - /// <para>13:Motion sensor (杩愬姩浼犳劅鍣級</para> - /// <para>40 Fire sensor 鐑熼浘浼犳劅鍣�</para> - /// <para>42 Water sensor 姘翠镜浼犳劅鍣�</para> - /// <para>43 Carbon Monoxide (CO) 鐕冩皵浼犳劅鍣�</para> - /// <para>44 Personal emergency device 绱ф�ユ寜閽�</para> - /// <para>277 Key fob 閽ュ寵鎵�</para> - /// <para>鎸佺画鏁版嵁涓婃姤(MomentStatus=0 TriggerZoneStatus>=1锛滄姤璀︼紴 TriggerZoneStatus=0锛滃彇娑堟姤璀︼紴)</para> - /// <para>21: Door/Window 闂ㄧ獥浼犳劅鍣紙鏈�21鍜�22锛岃繖閲屾病鏈夊啓閿欙級</para> - /// <para>22:Door/Window 闂ㄧ獥浼犳劅鍣紙鏈�21鍜�22锛岃繖閲屾病鏈夊啓閿�</para> - /// </summary> - public int IasDeviceType; - - /// <summary> - /// 璁惧鍚嶇О,浠ヨ澶囩殑MAC鍛藉悕 - /// </summary> - public string DeviceName = "UnKown"; - - /// <summary> - /// 璁惧绔偣鍚嶇О锛屼互璁惧绔偣鍚嶇О鍛藉悕 - /// </summary> - public string DeviceEpointName = "UnKown"; - - /// <summary> - /// 鐢ㄤ簬鍒ゆ柇璁惧鐨剒igbee鍗忚鐗堟湰銆� - ///<para>49246锛歓LL1.0鏍囧噯璁惧銆�</para> - ///<para>260锛� ZHA1.2鏍囧噯璁惧銆� Z3.0鏍囧噯璁惧銆�</para> - ///<para>41440锛歓GP3.0鏍囧噯璁惧銆�</para> - ///<para>265锛歓SE1.4鏍囧噯璁惧銆�</para> - /// </summary> - public int Profile; - /// <summary> - /// 0锛氳澶囦笉鍦ㄧ嚎 - /// <para>1锛氳澶囧湪绾�</para> - /// </summary> - public int IsOnline; - /// <summary> - /// 1锛氳矾鐢辫澶� - /// <para>2锛氱粓绔澶囷紝鐢垫睜璁惧</para> - /// </summary> - public int ZigbeeType; - /// <summary> - /// 褰撳墠杩愯绋嬪簭鐗堟湰淇℃伅銆� 鏈�澶�64瀛楄妭 - /// </summary> - public int ImgVersion; - /// <summary> - /// 纭欢鐗堟湰 - /// </summary> - public int HwVersion; - /// <summary> - /// 褰撳墠闀滃儚绫诲瀷id - /// </summary> - public int ImgTypeId; - /// <summary> - /// 椹卞姩浠g爜銆備负0鏃讹紝琛ㄧずzigbee鍗忚皟鍣ㄨ澶囥�傚叾浠栧�艰〃绀轰负铏氭嫙椹卞姩璁惧 - /// </summary> - public int DriveCode; - /// <summary> - /// 鐢熶骇鍟嗗悕瀛� - /// </summary> - public string ManufacturerName = string.Empty; - /// <summary> - /// 妯″潡ID锛堣繖涓笢瑗夸篃鍙�愬瀷鍙风爜銆戯級 - /// </summary> - public string ModelIdentifier = string.Empty; - /// <summary> - /// 鐢熶骇鏃ユ湡 - /// </summary> - public string ProductionDate = string.Empty; - /// <summary> - /// 鐢垫簮 - /// </summary> - public int PowerSource = -1; - /// <summary> - /// 搴忓垪鍙� - /// </summary> - public string SerialNumber = string.Empty; - /// <summary> - /// 鎵�鏈夋寚瀹歝luster鏄惁閮藉凡缁忔垚鍔熺粦瀹氬崗璋冨櫒 - ///<para>0:鏈畬鍏ㄧ粦瀹�</para> - ///<para>1锛氬凡缁忕粦瀹�</para> - /// </summary> - public int ClusterBindZbSuccess = -1; - /// <summary> - /// 鏄惁鑾峰彇鎵�鏈夐粯璁ょ粦瀹氫俊鎭� - ///<para>0锛氬惁</para> - ///<para>1锛氭槸</para> - /// </summary> - public int IsGetAllDefaultBind = -1; - /// <summary> - /// 杈撳叆绨囧垪琛� - /// </summary> - public List<InClusterObj> InClusterList = new List<InClusterObj>(); - /// <summary> - /// 杈撳嚭绨囧垪琛� - /// </summary> - public List<OutClusterObj> OutClusterList = new List<OutClusterObj>(); - /// <summary> - /// 鐢ㄤ簬璁板綍璁惧鏈�鏂颁笂鎶ョ殑灞炴�х姸鎬佷俊鎭�傛渶澶ф敮鎸佽褰�16涓睘鎬х姸鎬侊紝涓斿彧璁板綍灞炴�у�奸暱搴︿笉澶т簬4瀛楄妭鐨勬暟鎹�� - /// </summary> - public List<AttributeStatusObj> AttributeStatus = new List<AttributeStatusObj>(); + #region 杈撳叆杈撳嚭闀炲畾涔� /// <summary> /// 璁惧鏈�鏂颁笂鎶ョ殑灞炴�х姸鎬佷俊鎭� @@ -623,12 +549,15 @@ public int commandId; } - #region 浜屻�佽幏鍙栧凡鍏ョ綉璁惧淇℃伅 + #endregion + + #region 鑾峰彇宸插叆缃戣澶囦俊鎭� /// <summary> /// 缃戝叧涓殑璁惧淇℃伅 /// </summary> - public DeviceInfoData DeviceInfo = new DeviceInfoData(); + [Newtonsoft.Json.JsonIgnore] + public DeviceInfoData DeviceInfo = null; /// <summary> /// 缃戝叧涓殑璁惧淇℃伅 /// </summary> @@ -727,110 +656,15 @@ } + #endregion + + #region 閿欒缁撴灉瀹氫箟 + /// <summary> - /// 鑾峰彇鎵�鏈夌綉鍏崇殑鑺傜偣璁惧淇℃伅锛堢敤浜庝富缃戝叧锛� - /// </summary> - public AllGatewayDeviceInfo getAllGatewayDeviceInfo; - /// <summary> - /// 鑾峰彇鎵�鏈夌綉鍏崇殑鑺傜偣璁惧淇℃伅锛堢敤浜庝富缃戝叧锛� + /// 缃戝叧淇℃伅閿欒鍙嶉鍏遍�� /// </summary> [System.Serializable] - public class AllGatewayDeviceInfo - { - /// <summary> - /// 鍏ョ綉璁惧鎬绘暟銆傜瓑浜�0鏃讹紝琛ㄧず娌℃湁璁惧淇℃伅锛屼笅闈㈠瓧娈靛皢涓嶅瓨鍦ㄣ�� - /// </summary> - public int TotalNum; - /// <summary> - /// 鏍囪瘑褰撳墠璁惧鏄彂閫佺殑鏄鍑犱釜璁惧銆侱eviceNum浠�1寮�濮嬫瘡鍙戦�佷竴涓澶囦俊鎭紝涓嬩竴涓澶囦俊鎭殑DeviceNum灏嗗姞1銆傜洿鍒癉eviceNum绛変簬TotalNum璇存槑鎵�鏈夎澶囦俊鎭彂閫佸畬姣曘�� - /// </summary> - public int DeviceNum; - /// <summary> - /// 璁惧鎵�鍦ㄧ綉鍏崇殑缃戝叧id - /// </summary> - public string GwId; - /// <summary> - /// 鍏ョ綉鐨剈tc鏃堕棿鎴� - /// </summary> - public int JoinTime; - /// <summary> - /// 1:璺敱鍣ㄨ澶� - /// <para>2:缁堢璁惧</para> - /// </summary> - public int ZigbeeType; - /// <summary> - /// 璁惧缃戠粶鍦板潃 - /// </summary> - public int NwkAddr; - /// <summary> - /// 璇ュ瓧娈典富瑕侀拡瀵笽AS瀹夐槻璁惧璁剧珛銆傛墍鏈塈AS瀹夐槻璁惧鍏辩敤涓�涓狣eviceID涓�1026銆傛墍浠ヨ鍖哄垎瀛愯澶囩被鍨嬶紝闇�瑕佽瀛楁銆� - /// <para>13:Motion sensor (杩愬姩浼犳劅鍣級</para> - /// <para>43:Carbon Monoxide sensor (涓�姘у寲纰充紶鎰熷櫒锛�</para> - /// <para>44:Personal emergency device (绱ф�ユ寜閽級</para> - /// </summary> - public int DeviceType; - /// <summary> - /// 鐢ㄤ簬鍒ゆ柇璁惧鐨剒igbee鍗忚鐗堟湰銆� - /// <para>49246锛歓LL1.0鏍囧噯璁惧銆�</para> - /// <para>260锛� ZHA1.2鏍囧噯璁惧銆� Z3.0鏍囧噯璁惧銆�</para> - /// <para>41440锛歓GP3.0鏍囧噯璁惧銆�</para> - /// <para>265锛歓SE1.4鏍囧噯璁惧銆�</para> - /// </summary> - public int Profile; - /// <summary> - /// 璁惧绔偣鍚� - /// </summary> - public string DeviceName; - /// <summary> - /// 璁惧鍚� - /// </summary> - public string MacName; - /// <summary> - /// 0锛氳澶囦笉鍦ㄧ嚎 - /// <para>1锛氳澶囧湪绾�</para> - /// </summary> - public int IsOnline; - /// <summary> - /// 褰撳墠杩愯绋嬪簭鐗堟湰淇℃伅銆� 鏈�澶�64瀛楄妭 - /// </summary> - public int ImgVersion; - /// <summary> - /// 纭欢鐗堟湰 - /// </summary> - public int HwVersion; - /// <summary> - /// 褰撳墠闀滃儚绫诲瀷id - /// </summary> - public int ImgTypeId; - /// <summary> - /// 椹卞姩浠g爜銆備负0鏃讹紝琛ㄧずzigbee鍗忚皟鍣ㄨ澶囥�傚叾浠栧�艰〃绀轰负铏氭嫙椹卞姩璁惧 - /// </summary> - public int DriveCode; - /// <summary> - /// 杈撳叆绨囧垪琛� - /// </summary> - public List<InClusterObj> InClusterList = new List<InClusterObj>(); - - /// <summary> - /// 杈撳嚭绨囧垪琛� - /// </summary> - public List<OutClusterObj> OutClusterList = new List<OutClusterObj>(); - /// <summary> - /// 鐢ㄤ簬璁板綍璁惧鏈�鏂颁笂鎶ョ殑灞炴�х姸鎬佷俊鎭�傛渶澶ф敮鎸佽褰�16涓睘鎬х姸鎬侊紝涓斿彧璁板綍灞炴�у�奸暱搴︿笉澶т簬4瀛楄妭鐨勬暟鎹�� - /// </summary> - public List<AttributeStatusObj> AttributeStatus = new List<AttributeStatusObj>(); - - } - - /// <summary> - /// 鑾峰彇缃戝叧璁板綍鐨勮澶囧睘鎬х姸鎬� - /// </summary> - public GetStatusRecordAllInfo getStatusRecordAllInfo; - /// <summary> - /// 鑾峰彇缃戝叧璁板綍鐨勮澶囧睘鎬х姸鎬� - /// </summary> - [System.Serializable] - public class GetStatusRecordAllInfo + public class ErrorResponCommon { /// <summary> /// 閿欒淇℃伅 @@ -841,269 +675,8 @@ /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> /// </summary> public ErrorResponData errorResponData; - /// <summary> - /// 璁惧鍚嶇О淇敼 - /// </summary> - public GetStatusRecordInfo getStatusRecordInfo; } - /// <summary> - /// 鑾峰彇鎵�鏈夌綉鍏崇殑鑺傜偣璁惧淇℃伅锛堢敤浜庝富缃戝叧锛� - /// </summary> - public GetStatusRecordInfo getStatusRecordInfo; - /// <summary> - /// 鑾峰彇鎵�鏈夌綉鍏崇殑鑺傜偣璁惧淇℃伅锛堢敤浜庝富缃戝叧锛� - /// </summary> - [System.Serializable] - public class GetStatusRecordInfo - { - /// <summary> - /// 璁惧鎵�鍦ㄧ綉鍏崇殑缃戝叧id - /// </summary> - public string GwId; - /// <summary> - /// 鍏ョ綉鐨剈tc鏃堕棿鎴� - /// </summary> - public int JoinTime; - /// <summary> - /// 1:璺敱鍣ㄨ澶� - /// <para>2:缁堢璁惧</para> - /// </summary> - public int ZigbeeType; - /// <summary> - /// 璁惧缃戠粶鍦板潃 - /// </summary> - public int NwkAddr; - /// <summary> - /// 璇ュ瓧娈典富瑕侀拡瀵笽AS瀹夐槻璁惧璁剧珛銆傛墍鏈塈AS瀹夐槻璁惧鍏辩敤涓�涓狣eviceID涓�1026銆傛墍浠ヨ鍖哄垎瀛愯澶囩被鍨嬶紝闇�瑕佽瀛楁銆� - /// <para>13:Motion sensor (杩愬姩浼犳劅鍣級</para> - /// <para>43:Carbon Monoxide sensor (涓�姘у寲纰充紶鎰熷櫒锛�</para> - /// <para>44:Personal emergency device (绱ф�ユ寜閽級</para> - /// </summary> - public int DeviceType; - /// <summary> - /// 鐢ㄤ簬鍒ゆ柇璁惧鐨剒igbee鍗忚鐗堟湰銆� - /// <para>49246锛歓LL1.0鏍囧噯璁惧銆�</para> - /// <para>260锛� ZHA1.2鏍囧噯璁惧銆� Z3.0鏍囧噯璁惧銆�</para> - /// <para>41440锛歓GP3.0鏍囧噯璁惧銆�</para> - /// <para>265锛歓SE1.4鏍囧噯璁惧銆�</para> - /// </summary> - public int Profile; - /// <summary> - /// 璁惧绔偣鍚� - /// </summary> - public string DeviceName; - /// <summary> - /// 璁惧鍚� - /// </summary> - public string MacName; - /// <summary> - /// 0锛氳澶囦笉鍦ㄧ嚎 - /// <para>1锛氳澶囧湪绾�</para> - /// </summary> - public int IsOnline; - /// <summary> - /// 褰撳墠杩愯绋嬪簭鐗堟湰淇℃伅銆� 鏈�澶�64瀛楄妭 - /// </summary> - public int ImgVersion; - /// <summary> - /// 纭欢鐗堟湰 - /// </summary> - public int HwVersion; - /// <summary> - /// 褰撳墠闀滃儚绫诲瀷id - /// </summary> - public int ImgTypeId; - /// <summary> - /// 椹卞姩浠g爜銆備负0鏃讹紝琛ㄧずzigbee鍗忚皟鍣ㄨ澶囥�傚叾浠栧�艰〃绀轰负铏氭嫙椹卞姩璁惧 - /// </summary> - public int DriveCode; - /// <summary> - /// 杈撳叆绨囧垪琛� - /// </summary> - public List<InClusterObj> InClusterList = new List<InClusterObj>(); - /// <summary> - /// 杈撳嚭绨囧垪琛� - /// </summary> - public List<OutClusterObj> OutClusterList = new List<OutClusterObj>(); - /// <summary> - /// 鐢ㄤ簬璁板綍璁惧鏈�鏂颁笂鎶ョ殑灞炴�х姸鎬佷俊鎭�傛渶澶ф敮鎸佽褰�16涓睘鎬х姸鎬侊紝涓斿彧璁板綍灞炴�у�奸暱搴︿笉澶т簬4瀛楄妭鐨勬暟鎹�� - /// </summary> - public List<AttributeStatusObj> AttributeStatus = new List<AttributeStatusObj>(); - } - #endregion - - /// <summary> - /// 鏈夋柊璁惧鍔犲叆zigbee缃戠粶鐨勪俊鎭� - /// </summary> - public DeviceDeviceJoinZbNetResponData deviceDeviceJoinZbNetResponData; - /// <summary> - /// 鏈夋柊璁惧鍔犲叆zigbee缃戠粶鐨勪俊鎭� - /// </summary> - [System.Serializable] - public class DeviceDeviceJoinZbNetResponData - { - /// <summary> - /// 璁惧缃戠粶鍦板潃 - /// </summary> - public int NwkAddr; - /// <summary> - /// 1:璺敱鍣ㄨ澶� - /// <para>2:缁堢璁惧</para> - /// </summary> - public int ZigbeeType; - } - - /// <summary> - /// 鑾峰彇鏂拌澶囨墍鏈夌鐐逛俊鎭槸鍚︽垚鍔熶俊鎭� - /// </summary> - public DeviceIsGetEpointInfoResponData deviceIsGetEpointInfoResponData; - /// <summary> - /// 鑾峰彇鏂拌澶囨墍鏈夌鐐逛俊鎭槸鍚︽垚鍔熶俊鎭� - /// </summary> - [System.Serializable] - public class DeviceIsGetEpointInfoResponData - { - /// <summary> - /// 0锛氭垚鍔熻幏鍙栨墍鏈夌鐐逛俊鎭� - ///<para>1锛氳幏鍙栧け璐�</para> - /// </summary> - public int Result; - } - - /// <summary> - /// 缃戝叧涓柊鎼滅储鍑虹殑璁惧淇℃伅 - /// </summary> - public NewDeviceInfoData getNewDeviceInfo; - /// <summary> - /// 缃戝叧涓柊鎼滅储鍑虹殑璁惧淇℃伅 - /// </summary> - [System.Serializable] - public class NewDeviceInfoData - { - /// <summary> - /// 鍏ョ綉鐨剈tc鏃堕棿鎴� - /// </summary> - public int JoinTime; - /// <summary> - /// 1:璺敱鍣ㄨ澶� - /// <para>2:缁堢璁惧</para> - /// </summary> - public int ZigbeeType; - /// <summary> - /// 璁惧缃戠粶鍦板潃 - /// </summary> - public int NwkAddr; - /// <summary> - /// 璇ュ瓧娈典富瑕侀拡瀵笽AS瀹夐槻璁惧璁剧珛銆傛墍鏈塈AS瀹夐槻璁惧鍏辩敤涓�涓狣eviceID涓�1026銆傛墍浠ヨ鍖哄垎瀛愯澶囩被鍨嬶紝闇�瑕佽瀛楁銆� - /// <para>13:Motion sensor (杩愬姩浼犳劅鍣級</para> - /// <para>43:Carbon Monoxide sensor (涓�姘у寲纰充紶鎰熷櫒锛�</para> - /// <para>44:Personal emergency device (绱ф�ユ寜閽級</para> - /// </summary> - public int DeviceType; - /// <summary> - /// 鐢ㄤ簬鍒ゆ柇璁惧鐨剒igbee鍗忚鐗堟湰銆傚尯鍒�3.0璁惧鍜孼HA璁惧 - /// <para>49246锛歓LL1.0鏍囧噯璁惧銆�</para> - /// <para>260锛� ZHA1.2鏍囧噯璁惧銆� Z3.0鏍囧噯璁惧銆�</para> - /// <para>41440锛歓GP3.0鏍囧噯璁惧銆�</para> - /// <para>265锛歓SE1.4鏍囧噯璁惧銆�</para> - /// </summary> - public int Profile; - /// <summary> - /// 鏄惁鏄柊鍏ョ綉璁惧銆� - /// <para>濡傛灉缃戝叧鍌ㄥ瓨鐨勮澶囧垪琛ㄤ腑鍘熸潵鏄病鏈夎璁惧鍒欎负鏂板叆缃戣澶囥��</para> - /// <para>濡傛灉缃戝叧鍌ㄥ瓨鐨勮澶囧垪琛ㄤ腑鏈夎璁惧鍒欎负鏃ц澶囥��</para> - /// <para>濡傛灉閲嶅叆缃戝悗璁惧淇℃伅宸茬粡鏀瑰彉锛堝璁惧鐨勭綉缁滃湴鍧�锛岃澶嘔D锛宑luster鍒楄〃锛夊垯涔熻涓烘柊璁惧鍏ョ綉銆�</para> - /// <para>璇ュ瓧娈电敤鏉ュ垽鍒敤鎴峰彲鑳介�氳繃鑺傜偣鐨勫疄浣撴寜閿皢璁惧鎭㈠鍑哄巶璁惧鍚庤妭鐐硅澶囬噸鏂板叆缃戠殑鎯呭喌鎴栬妭鐐硅澶囬噸鍚富鍔ㄥ彂閫佸叆缃戜俊鎭殑鎯呭喌銆�</para> - /// <para>0锛氭棫璁惧鍏ョ綉</para> - /// <para>1锛氭柊璁惧鍏ョ綉</para> - /// <para>2锛氳澶囦负鏂拌澶囷紝骞跺湪涓婃姤璇ヤ俊鎭墠宸茬粡閫�缃戯紝鍗宠澶囧叆缃戝悗缃戝叧杩樻潵涓嶅強涓婃姤璇ヨ澶囦俊鎭澶囦究宸茬粡閫�缃戙�傦紙璁惧鍏ョ綉锛屽埌缃戝叧涓婃姤璁惧淇℃伅鏈変竴娈靛欢鏃讹紝濡傛灉鍦ㄦ鏈熼棿濡傛灉璁惧宸茬粡閫�缃戯紝灏嗗弽棣堣鍊笺�傝鍊间负寮傚父鎯呭喌锛屽綋鏀跺埌璇ュ�兼椂鍊欒鏄庤澶囧苟娌″叆缃戯紝鍙涪寮冭繖涓叆缃戜俊鎭級</para> - /// </summary> - public int IsNewDev; - /// <summary> - /// 褰撳墠杩愯绋嬪簭鐗堟湰淇℃伅銆� 鏈�澶�64瀛楄妭 - /// </summary> - public int ImgVersion; - /// <summary> - /// 纭欢鐗堟湰 - /// </summary> - public int HwVersion; - /// <summary> - /// 褰撳墠闀滃儚绫诲瀷id - /// </summary> - public int ImgTypeId; - /// <summary> - /// 椹卞姩浠g爜銆備负0鏃讹紝琛ㄧずzigbee鍗忚皟鍣ㄨ澶囥�傚叾浠栧�艰〃绀轰负铏氭嫙椹卞姩璁惧 - /// </summary> - public int DriveCode; - /// <summary> - /// 璁惧鎵�鍦ㄧ綉鍏崇殑缃戝叧id - /// </summary> - public string GwId; - /// <summary> - /// 璁惧鍚� - /// </summary> - public string MacName; - /// <summary> - /// 璁惧绔偣鍚� - /// </summary> - public string DeviceName; - /// <summary> - /// 0锛氳澶囦笉鍦ㄧ嚎 - /// <para>1锛氳澶囧湪绾�</para> - /// </summary> - public int IsOnline; - /// <summary> - /// 鎵�鏈夋寚瀹歝luster鏄惁閮藉凡缁忔垚鍔熺粦瀹氬崗璋冨櫒 - ///<para>0:鏈畬鍏ㄧ粦瀹�</para> - ///<para>1锛氬凡缁忕粦瀹�</para> - /// </summary> - public int ClusterBindZbSuccess = -1; - /// <summary> - /// 鏄惁鑾峰彇鎵�鏈夐粯璁ょ粦瀹氫俊鎭� - ///<para>0锛氬惁</para> - ///<para>1锛氭槸</para> - /// </summary> - public int IsGetAllDefaultBind = -1; - /// <summary> - /// 鐢熶骇鍟嗗悕瀛� - /// </summary> - public string ManufacturerName = string.Empty; - /// <summary> - /// 妯″潡ID锛堣繖涓笢瑗夸篃鍙�愬瀷鍙风爜銆戯級 - /// </summary> - public string ModelIdentifier = string.Empty; - /// <summary> - /// 鐢熶骇鏃ユ湡 - /// </summary> - public string ProductionDate = string.Empty; - /// <summary> - /// 鐢垫簮 - /// </summary> - public int PowerSource = -1; - /// <summary> - /// 搴忓垪鍙� - /// </summary> - public string SerialNumber = string.Empty; - /// <summary> - /// 杈撳叆绨囧垪琛� - /// </summary> - public List<InClusterObj> InClusterList = new List<InClusterObj>(); - /// <summary> - /// 杈撳嚭绨囧垪琛� - /// </summary> - public List<OutClusterObj> OutClusterList = new List<OutClusterObj>(); - /// <summary> - /// 鐢ㄤ簬璁板綍璁惧鏈�鏂颁笂鎶ョ殑灞炴�х姸鎬佷俊鎭�傛渶澶ф敮鎸佽褰�16涓睘鎬х姸鎬侊紝涓斿彧璁板綍灞炴�у�奸暱搴︿笉澶т簬4瀛楄妭鐨勬暟鎹�� - /// </summary> - public List<AttributeStatusObj> AttributeStatus = new List<AttributeStatusObj>(); - } - - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 缃戝叧淇℃伅閿欒鍙嶉 /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> @@ -1151,6 +724,8 @@ return message; } + #endregion + #region 淇敼璁惧绔彛鍚嶇О ///<summary > /// 淇敼璁惧绔彛锛堟寜閿級鍚嶇О @@ -1173,8 +748,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1231,10 +805,6 @@ /// <summary> /// 閲嶅懡鍚嶈澶�,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public DeviceRenameAllData renameDeviceAllData; - /// <summary> - /// 閲嶅懡鍚嶈澶�,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] public class DeviceRenameAllData { @@ -1253,10 +823,6 @@ public DeviceRenameResponseData deviceRenameData; } - /// <summary> - /// 璁惧鍚嶇О淇敼 - /// </summary> - public DeviceRenameResponseData renameDeviceData; /// <summary> /// 璁惧鍚嶇О淇敼 /// </summary> @@ -1296,8 +862,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1355,32 +920,15 @@ /// <summary> /// 淇敼璁惧mac鍚嶇О鏁版嵁,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public RenameDeviceMacNameAllData renameDeviceMacNameAllData; - /// <summary> - /// 淇敼璁惧mac鍚嶇О鏁版嵁,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] - public class RenameDeviceMacNameAllData + public class RenameDeviceMacNameAllData : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 淇敼璁惧mac鍚嶇О鏁版嵁 /// </summary> public RenameDeviceMacNameData renameDeviceMacNameData; } - /// <summary> - /// 淇敼璁惧mac鍚嶇О鏁版嵁 - /// </summary> - public RenameDeviceMacNameData renameDeviceMacNameData; /// <summary> /// 淇敼璁惧mac鍚嶇О鏁版嵁 /// </summary> @@ -1396,32 +944,6 @@ /// 淇敼鍚庣殑璁惧鍚嶇О /// </summary> public string MacName; - } - #endregion - - #region 璁惧鎭㈠鍑哄巶璁剧疆涓庡嚭缃� - ///<summary > - /// 浣胯澶囨仮澶嶅嚭鍘傝缃� - /// <para>浠呮仮澶嶅嚭鍘傝缃紝涓嶇缃戙�備絾鏈変簺涓嶆爣鍑嗙殑3.0璁惧锛屾仮澶嶅嚭鍘傝缃氨浼氱缃戙�� 瀹㈡埛绔垨浜戠鍒扮綉鍏�</para> - /// </summary> - public async void ResetDeviceFactoryAsync(string deviceAddr, int deviceEpoint) - { - if (Gateway == null) - { - return; - } - //Action<string, string> action = (topic, message) => { }; - //Gateway.Actions += action; - System.Console.WriteLine("FactoryResete_Actions 鍚姩" + "_" + System.DateTime.Now.ToString()); - try - { - var jObject = new JObject { { "DeviceAddr", deviceAddr }, { "Epoint", deviceEpoint }, { "Cluster_ID", 0 }, { "Command", 97 } }; - Gateway.Send("FactoryReset", jObject.ToString()); - } - catch { } - - //Gateway.Actions -= action; - System.Console.WriteLine("FactoryReset_Action閫�鍑�" + System.DateTime.Now.ToString()); } #endregion @@ -1447,8 +969,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1462,16 +983,15 @@ if (topic == gatewayID + "/" + "RemoveDeviceRespon") { - var gatewayTemp = new ZbGateway() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - gatewayTemp.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.RemoveDeviceResponseData>(jobject["Data"].ToString()); + var removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.RemoveDeviceResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.removeDeviceResponseData == null) + if (removeDeviceResponseData == null) { d = new RemoveDeviceResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new RemoveDeviceResponseAllData { removeDeviceResponseData = gatewayTemp.removeDeviceResponseData }; + d = new RemoveDeviceResponseAllData { removeDeviceResponseData = removeDeviceResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } } @@ -1524,10 +1044,6 @@ /// <summary> /// 闇�瑕佸垹闄よ澶囩殑鏁版嵁 /// </summary> - public RemoveDeviceData removeDeviceData; - /// <summary> - /// 闇�瑕佸垹闄よ澶囩殑鏁版嵁 - /// </summary> [System.Serializable] public class RemoveDeviceData { @@ -1557,10 +1073,6 @@ /// <summary> /// 绉婚櫎璁惧,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public RemoveDeviceResponseAllData removeDeviceResponseAllData; - /// <summary> - /// 绉婚櫎璁惧,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] public class RemoveDeviceResponseAllData { @@ -1579,10 +1091,6 @@ public RemoveDeviceResponseData removeDeviceResponseData; } - /// <summary> - /// 鍒犻櫎璁惧鍥炲鏁版嵁 - /// </summary> - public RemoveDeviceResponseData removeDeviceResponseData; /// <summary> /// 鍒犻櫎璁惧鍥炲鏁版嵁 /// <para>杩斿洖缁撴灉Resul=锛屽垹闄ゆ垚鍔�</para> @@ -1623,135 +1131,6 @@ public int Epoint; } - #endregion - - #region 浠庢�昏澶囧垪琛ㄤ腑绉婚櫎涓�涓綉鍏崇殑鎵�鏈夎妭鐐硅澶囷紙鐢ㄤ簬涓荤綉鍏筹級 - ///<summary > - /// 浠庢�昏澶囧垪琛ㄤ腑绉婚櫎涓�涓綉鍏崇殑鎵�鏈夎妭鐐硅澶囷紙鐢ㄤ簬涓荤綉鍏筹級 - /// <para>GwId:瑕佺Щ闄よ妭鐐硅澶囩殑缃戝叧id</para> - /// </summary> - public async System.Threading.Tasks.Task<RemoveGatewayDeviceListAllData> RemoveGatewayDeviceListAsync(string gwId) - { - if (Gateway == null || gwId == null) - { - return null; - } - return await System.Threading.Tasks.Task.Run(async () => - { - RemoveGatewayDeviceListAllData d = null; - Action<string, string> action = (topic, message) => - { - var gatewayID = topic.Split('/')[0]; - var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); - if (topic == gatewayID + "/" + "Error_Respon") - { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); - - if (temp == null) - { - d = new RemoveGatewayDeviceListAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; - } - else - { - d = new RemoveGatewayDeviceListAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; - } - } - if (topic == gatewayID + "/" + "RemoveEqOfGw_Respon") - { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - gatewayTemp.removeGatewayDeviceListData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveGatewayDeviceListData>(jobject["Data"].ToString()); - - if (gatewayTemp.removeGatewayDeviceListData == null) - { - d = new RemoveGatewayDeviceListAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; - } - else - { - d = new RemoveGatewayDeviceListAllData { removeGatewayDeviceListData = gatewayTemp.removeGatewayDeviceListData }; - System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); - } - } - }; - - Gateway.Actions += action; - System.Console.WriteLine("RemoveEqOfGw_Actions 鍚姩" + "_" + System.DateTime.Now.ToString()); - - try - { - var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 81 } }; - var data = new JObject { { "GwId", gwId } }; - jObject.Add("Data", data); - Gateway.Send(("RemoveEqOfGw"), jObject.ToString()); - } - catch { } - - - var dateTime = DateTime.Now; - while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) - { - await System.Threading.Tasks.Task.Delay(10); - if (d != null) - { - break; - } - } - if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) - { - d = new RemoveGatewayDeviceListAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; - } - Gateway.Actions -= action; - System.Console.WriteLine("RemoveEqOfGw_Actions 閫�鍑�" + System.DateTime.Now.ToString()); - - return d; - }); - } - - /// <summary> - /// 绉婚櫎璁惧,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> - public RemoveGatewayDeviceListAllData removeGatewayDeviceListAllData; - /// <summary> - /// 绉婚櫎璁惧,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> - [System.Serializable] - public class RemoveGatewayDeviceListAllData - { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; - /// <summary> - /// 璁惧鍚嶇О淇敼 - /// </summary> - public RemoveGatewayDeviceListData removeGatewayDeviceListData; - } - - /// <summary> - /// 浠庢�昏澶囧垪琛ㄤ腑绉婚櫎涓�涓綉鍏崇殑鎵�鏈夎妭鐐硅澶囷紙鐢ㄤ簬涓荤綉鍏筹級 - /// </summary> - public RemoveGatewayDeviceListData removeGatewayDeviceListData; - /// <summary> - /// 浠庢�昏澶囧垪琛ㄤ腑绉婚櫎涓�涓綉鍏崇殑鎵�鏈夎妭鐐硅澶囷紙鐢ㄤ簬涓荤綉鍏筹級 - /// </summary> - [System.Serializable] - public class RemoveGatewayDeviceListData - { - /// <summary> - /// 瑕佺Щ闄よ妭鐐硅澶囩殑缃戝叧id - /// </summary> - public string GwId; - /// <summary> - /// 琚垹闄よ澶囩殑鏁伴噺 - /// </summary> - public int RemoveNum; - } - #endregion #region 璇嗗埆璁惧 @@ -1831,7 +1210,8 @@ /// <summary> /// 璁惧灞炴�х姸鎬佷笂鎶� /// </summary> - public DeviceStatusReportData DeviceStatusReport = new DeviceStatusReportData { }; + [Newtonsoft.Json.JsonIgnore] + public DeviceStatusReportData DeviceStatusReport = new DeviceStatusReportData(); /// <summary> /// 璁惧灞炴�х姸鎬佷笂鎶� /// </summary> @@ -1896,8 +1276,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1911,7 +1290,6 @@ if (topic == gatewayID + "/" + "SetWritableValue_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString()); if (tempData == null) @@ -1960,22 +1338,9 @@ /// <summary> /// 缃戝叧鐗堟湰淇℃伅,缃戝叧鍙嶉淇℃伅 /// </summary> - public SetWritableValueResponAllData setWritableValueResponAllData; - /// <summary> - /// 缃戝叧鐗堟湰淇℃伅,缃戝叧鍙嶉淇℃伅 - /// </summary> [System.Serializable] - public class SetWritableValueResponAllData + public class SetWritableValueResponAllData : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 缃戝叧鐗堟湰淇℃伅 /// </summary> @@ -2006,10 +1371,6 @@ } - /// <summary> - /// 璁剧疆鍙啓灞炴�х殑鍊肩殑鏁版嵁 - /// </summary> - public SetWritableValueData setWritableValueData; /// <summary> /// 璁剧疆鍙啓灞炴�х殑鍊肩殑鏁版嵁 /// </summary> @@ -2086,8 +1447,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2101,22 +1461,21 @@ if (topic == gatewayID + "/" + "Cluster/OwnAttributes_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; - gatewayTemp.clusterOwnAttributesResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ClusterOwnAttributesResponData>(jobject["Data"].ToString()); + var clusterOwnAttributesResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ClusterOwnAttributesResponData>(jobject["Data"].ToString()); var tempAttributes = Newtonsoft.Json.Linq.JArray.Parse(jobject["Data"]["Attribute"].ToString()); for (int m = 0; tempAttributes != null && m < tempAttributes.Count; m++) { var tempAttribute = tempAttributes[m]; - gatewayTemp.clusterOwnAttributesResponData.AttributeList.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<AttributeObj>(tempAttribute.ToString())); + clusterOwnAttributesResponData.AttributeList.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<AttributeObj>(tempAttribute.ToString())); } - if (gatewayTemp.clusterOwnAttributesResponData == null) + if (clusterOwnAttributesResponData == null) { d = new ClusterOwnAttributesResponAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new ClusterOwnAttributesResponAllData { clusterOwnAttributesResponData = gatewayTemp.clusterOwnAttributesResponData }; + d = new ClusterOwnAttributesResponAllData { clusterOwnAttributesResponData = clusterOwnAttributesResponData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } @@ -2155,32 +1514,15 @@ /// <summary> /// 鍙戠幇灞炴��,缃戝叧鍙嶉淇℃伅 /// </summary> - public ClusterOwnAttributesResponAllData clusterOwnAttributesResponAllData; - /// <summary> - /// 鍙戠幇灞炴��,缃戝叧鍙嶉淇℃伅 - /// </summary> [System.Serializable] - public class ClusterOwnAttributesResponAllData + public class ClusterOwnAttributesResponAllData : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 缃戝叧鐗堟湰淇℃伅 /// </summary> public ClusterOwnAttributesResponData clusterOwnAttributesResponData; } - /// <summary> - /// 鍙戠幇灞炴�ф暟鎹� - /// </summary> - public ClusterOwnAttributesResponData clusterOwnAttributesResponData; [System.Serializable] public class ClusterOwnAttributesResponData { @@ -2219,8 +1561,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2235,17 +1576,16 @@ if (topic == gatewayID + "/" + "Cluster/OwnCommand_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; - gatewayTemp.clusterOwnCommandResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClusterOwnCommandResponData>(jobject["Data"].ToString()); + var clusterOwnCommandResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClusterOwnCommandResponData>(jobject["Data"].ToString()); - if (gatewayTemp.clusterOwnCommandResponData == null) + if (clusterOwnCommandResponData == null) { d = new ClusterOwnCommandResponAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new ClusterOwnCommandResponAllData { clusterOwnCommandResponData = gatewayTemp.clusterOwnCommandResponData }; + d = new ClusterOwnCommandResponAllData { clusterOwnCommandResponData = clusterOwnCommandResponData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } } @@ -2284,32 +1624,15 @@ /// <summary> /// 璁惧鏌恈luster鎵�鏀寔鐨凜ommand鏁版嵁,缃戝叧鍙嶉淇℃伅 /// </summary> - public ClusterOwnCommandResponAllData clusterOwnCommandResponAllData; - /// <summary> - /// 璁惧鏌恈luster鎵�鏀寔鐨凜ommand鏁版嵁,缃戝叧鍙嶉淇℃伅 - /// </summary> [System.Serializable] - public class ClusterOwnCommandResponAllData + public class ClusterOwnCommandResponAllData : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 缃戣澶囨煇cluster鎵�鏀寔鐨凜ommand鏁版嵁 /// </summary> public ClusterOwnCommandResponData clusterOwnCommandResponData; } - /// <summary> - /// 璁惧鏌恈luster鎵�鏀寔鐨凜ommand鏁版嵁 - /// </summary> - public ClusterOwnCommandResponData clusterOwnCommandResponData; /// <summary> /// 璁惧鏌恈luster鎵�鏀寔鐨凜ommand鏁版嵁 /// </summary> @@ -2347,8 +1670,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2363,16 +1685,15 @@ if (topic == gatewayID + "/" + "OTA/SetImage_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.oTASetImageData = Newtonsoft.Json.JsonConvert.DeserializeObject<OTASetImageData>(jobject["Data"].ToString()); + var oTASetImageData = Newtonsoft.Json.JsonConvert.DeserializeObject<OTASetImageData>(jobject["Data"].ToString()); - if (gatewayTemp.oTASetImageData == null) + if (oTASetImageData == null) { d = new OTASetImageResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new OTASetImageResponseAllData { otaSetImageData = gatewayTemp.oTASetImageData }; + d = new OTASetImageResponseAllData { otaSetImageData = oTASetImageData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } } @@ -2412,31 +1733,15 @@ /// <summary> /// 璁惧杩涜OTA鍗囩骇,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public OTASetImageResponseAllData otaSetImageResponseAllData; - /// <summary> - /// 璁惧杩涜OTA鍗囩骇,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] - public class OTASetImageResponseAllData + public class OTASetImageResponseAllData : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 淇濆瓨zigbee鍗忚皟鍣ㄧ粍缃戜俊鎭� /// </summary> public OTASetImageData otaSetImageData; } - /// <summary> - /// 璁惧杩涜OTA鍗囩骇 - /// </summary> - public OTASetImageData oTASetImageData; + [System.Serializable] public class OTASetImageData { @@ -2510,8 +1815,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2526,16 +1830,15 @@ if (topic == gatewayID + "/" + "OTA/StartUpdate_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.startUpdateDeviceData = Newtonsoft.Json.JsonConvert.DeserializeObject<StartDeviceUpdateData>(jobject["Data"].ToString()); + var startUpdateDeviceData = Newtonsoft.Json.JsonConvert.DeserializeObject<StartDeviceUpdateData>(jobject["Data"].ToString()); - if (gatewayTemp.startUpdateDeviceData == null) + if (startUpdateDeviceData == null) { d = new StartDeviceUpdateResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new StartDeviceUpdateResponseAllData { startUpdateDeviceData = gatewayTemp.startUpdateDeviceData }; + d = new StartDeviceUpdateResponseAllData { startUpdateDeviceData = startUpdateDeviceData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } } @@ -2588,10 +1891,6 @@ /// <summary> /// 鍚姩鍗囩骇,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public StartDeviceUpdateResponseAllData startUpdateDeviceResponseAllData; - /// <summary> - /// 鍚姩鍗囩骇,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] public class StartDeviceUpdateResponseAllData { @@ -2609,10 +1908,7 @@ /// </summary> public StartDeviceUpdateData startUpdateDeviceData; } - /// <summary> - /// 鍚姩鍗囩骇 - /// </summary> - public StartDeviceUpdateData startUpdateDeviceData; + [System.Serializable] public class StartDeviceUpdateData { @@ -2653,7 +1949,9 @@ /// <summary> /// 鍚姩鍗囩骇 /// </summary> + [Newtonsoft.Json.JsonIgnore] public OTAScheduleResponData oTAScheduleResponData; + [System.Serializable] public class OTAScheduleResponData { @@ -2674,10 +1972,6 @@ public int Percent = 999; } - /// <summary> - /// 鍚姩鍗囩骇鐨勬暟鎹� - /// </summary> - public StartUpdateData startUpdateData; [System.Serializable] public class StartUpdateData { @@ -2707,8 +2001,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2723,16 +2016,15 @@ if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { d = new ClientDataPassthroughResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new ClientDataPassthroughResponseAllData { clientDataPassthroughResponseData = gatewayTemp.clientDataPassthroughResponseData }; + d = new ClientDataPassthroughResponseAllData { clientDataPassthroughResponseData = clientDataPassthroughResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } } @@ -2772,22 +2064,9 @@ /// <summary> /// 瀹㈡埛绔悜鑺傜偣璁惧閫忎紶鏁版嵁,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public ClientDataPassthroughResponseAllData clientDataPassthroughResponseAllData; - /// <summary> - /// 瀹㈡埛绔悜鑺傜偣璁惧閫忎紶鏁版嵁,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] - public class ClientDataPassthroughResponseAllData + public class ClientDataPassthroughResponseAllData : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 瀹㈡埛绔悜鑺傜偣璁惧閫忎紶鏁版嵁 /// </summary> @@ -2796,7 +2075,9 @@ /// <summary> /// 瀹㈡埛绔悜鑺傜偣璁惧閫忎紶鏁版嵁 /// </summary> - public ClientDataPassthroughResponseData clientDataPassthroughResponseData = new ClientDataPassthroughResponseData { }; + [Newtonsoft.Json.JsonIgnore] + public ClientDataPassthroughResponseData clientDataPassthroughResponseData = new ClientDataPassthroughResponseData(); + [System.Serializable] public class ClientDataPassthroughResponseData { @@ -2809,31 +2090,15 @@ /// <summary> /// 鍚敤鎴栧叧闂妭鐐硅澶囬�忎紶鏁版嵁涓婁紶鎺ュ彛,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public OnZbDataPassthroughResponseAllData onZbDataPassthroughResponseAllData; - /// <summary> - /// 鍚敤鎴栧叧闂妭鐐硅澶囬�忎紶鏁版嵁涓婁紶鎺ュ彛,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] - public class OnZbDataPassthroughResponseAllData + public class OnZbDataPassthroughResponseAllData : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鍚敤鎴栧叧闂妭鐐硅澶囬�忎紶鏁版嵁涓婁紶鎺ュ彛 /// </summary> public OnZbDataPassthroughData onZbDataPassthroughData; } - /// <summary> - /// 鍚敤鎴栧叧闂妭鐐硅澶囬�忎紶鏁版嵁涓婁紶鎺ュ彛 - /// </summary> - public OnZbDataPassthroughData onZbDataPassthroughData; + [System.Serializable] public class OnZbDataPassthroughData { @@ -2868,8 +2133,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2883,16 +2147,15 @@ if (topic == gatewayID + "/" + "DownloadFile_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.downloadFileResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<DownloadFileResponData>(jobject["Data"].ToString()); + var downloadFileResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<DownloadFileResponData>(jobject["Data"].ToString()); - if (gatewayTemp.downloadFileResponData == null) + if (downloadFileResponData == null) { d = new DownloadFileResponAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new DownloadFileResponAllData { downloadFileResponData = gatewayTemp.downloadFileResponData }; + d = new DownloadFileResponAllData { downloadFileResponData = downloadFileResponData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } } @@ -2933,35 +2196,19 @@ }); } - /// <summary> - /// 缃戝叧绯荤粺鍗囩骇,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> - public DownloadFileResponAllData downloadFileResponAllData; + /// <summary> /// 缃戝叧绯荤粺鍗囩骇,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> [System.Serializable] - public class DownloadFileResponAllData + public class DownloadFileResponAllData : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 涓嬭浇浜戠鍥轰欢 /// </summary> public DownloadFileResponData downloadFileResponData; } - /// <summary> - /// 涓嬭浇浜戠鍥轰欢 - /// </summary> - public DownloadFileResponData downloadFileResponData; /// <summary> /// 涓嬭浇浜戠鍥轰欢 /// </summary> @@ -2985,6 +2232,7 @@ /// <summary> /// 涓嬭浇杩涘害 /// </summary> + [Newtonsoft.Json.JsonIgnore] public DownloadFileProgressResponData downloadFileProgressResponData; /// <summary> /// 涓嬭浇杩涘害 @@ -3037,8 +2285,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -3053,16 +2300,15 @@ if (topic == gatewayID + "/" + "OTA/KillUpdate_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.killUpdateData = Newtonsoft.Json.JsonConvert.DeserializeObject<KillUpdateData>(jobject["Data"].ToString()); + var killUpdateData = Newtonsoft.Json.JsonConvert.DeserializeObject<KillUpdateData>(jobject["Data"].ToString()); - if (gatewayTemp.killUpdateData == null) + if (killUpdateData == null) { d = new KillUpdateResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new KillUpdateResponseAllData { killUpdateData = gatewayTemp.killUpdateData }; + d = new KillUpdateResponseAllData { killUpdateData = killUpdateData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } } @@ -3100,31 +2346,15 @@ /// <summary> /// 缁堟璁惧鍗囩骇,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public KillUpdateResponseAllData killUpdateResponseAllData; - /// <summary> - /// 缁堟璁惧鍗囩骇,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] - public class KillUpdateResponseAllData + public class KillUpdateResponseAllData : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 缁堟璁惧鍗囩骇 /// </summary> public KillUpdateData killUpdateData; } - /// <summary> - /// 缁堟璁惧鍗囩骇 - /// </summary> - public KillUpdateData killUpdateData; + [System.Serializable] public class KillUpdateData { @@ -3137,22 +2367,10 @@ #endregion #region 绉佹湁鍗忚缃戝叧鍜岃澶囩殑榛樿鍥炲 - /// <summary> - /// 绉佹湁鍗忚缃戝叧鍜岃澶囩殑榛樿鍥炲 - /// </summary> - public ResponseAllData keyColorDataResponseAllData; + [System.Serializable] - public class ResponseAllData + public class ResponseAllData : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鎸夐敭鎸囩ず鐏鑹蹭俊鎭� /// </summary> @@ -3176,5 +2394,27 @@ public int status = -1; } #endregion + + #region 鈻� 璋冭瘯鎵撳嵃 + + /// <summary> + /// 璋冭瘯鏃舵墦寮�鎵撳嵃淇℃伅锛宼rue:鎵撳嵃锛宖alse:涓嶆墦鍗� + /// </summary> + /// <param name="msg">Message.</param> + /// <param name="flage">If set to <c>true</c> flage.</param> + public static void DebugPrintLog(string msg, bool flage = true) + { +#if DEBUG + if (flage == true) + { + if (msg.Contains("DeviceStatusReport") == false) + { + System.Console.WriteLine(msg + " " + System.DateTime.Now.ToLongTimeString() + " " + System.DateTime.Now.Millisecond); + } + } +#endif + } + + #endregion } } diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/DimmableLight.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/DimmableLight.cs index 4badda8..9edb5f8 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/DimmableLight.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/DimmableLight.cs @@ -12,6 +12,7 @@ /// <summary> ///浜害锛屾暣褰紝鍙栧�艰寖鍥达細0-254琛ㄧず0%-100% /// </summary> + [Newtonsoft.Json.JsonIgnore] public int Level = 0; /// <summary> diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs index 6a54df8..d893657 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs @@ -41,21 +41,23 @@ /// ture:甯稿紑锛� false:鍏抽棴 /// </summary> public bool IsDoorLockNormallyMode = false; + [Newtonsoft.Json.JsonIgnore] public string LocalTempPassword = string.Empty;//鏈湴鐢熸垚鐨勪复鏃跺瘑鐮� public Dictionary<string, bool> IsFreezeAccount = new Dictionary<string, bool> { };//鏄惁鍐荤粨瀛愯处鎴� public Dictionary<string, bool> HasRemoteUnlockAccess = new Dictionary<string, bool> { };//鏄惁缁欏瓙璐︽埛鎷ユ湁杩滅▼寮�閿佺殑鏉′欢 public Dictionary<string, bool> IsFailedToGetDoorLockInfo = new Dictionary<string, bool> { };//鏄惁鑾峰彇闂ㄩ攣鏁版嵁澶辫触 + [Newtonsoft.Json.JsonIgnore] public string RemoteUnlockPassword = string.Empty;//杩滅▼寮�閿佸瘑鐮� public static int RemoteUnlockCount = 5;//杩滅▼寮�閿佹鏁伴檺鍒� public static int failedCount = 3;//杩滅▼寮�閿佸け璐ユ鏁� - public static DateTime maxValue = DateTime.MaxValue; public static DateTime minValue = DateTime.MinValue; #region 涓存椂瀵嗙爜淇℃伅 /// <summary> /// 鐢ㄦ埛绠$悊鍙戦�佹暟鎹洖澶� /// </summary> + [Newtonsoft.Json.JsonIgnore] public TempPasswordObject tempPasswordObject; /// <summary> /// 涓存椂瀵嗙爜鏈湴瀵硅薄 @@ -684,6 +686,7 @@ /// <summary> /// 闂ㄩ攣鎿嶄綔浜嬩欢閫氱煡 /// </summary> + [Newtonsoft.Json.JsonIgnore] public DoorLockOperatingEventNotificationCommand doorLockOperatingEventNotificationCommand; /// <summary> /// 闂ㄩ攣鎿嶄綔浜嬩欢閫氱煡 @@ -927,13 +930,14 @@ /// Unlock鍛戒护锛歟rror,invalid schedule浜嬩欢 /// </summary> UnlockInvalidScheduleEvent = 6, - } + } #endregion - + #region 闂ㄩ攣缂栫▼浜嬩欢閫氱煡 /// <summary> /// 闂ㄩ攣缂栫▼浜嬩欢閫氱煡 /// </summary> + [Newtonsoft.Json.JsonIgnore] public DoorLockProgrammingEventNotificationCommand doorLockProgrammingEventNotificationCommand; /// <summary> /// 闂ㄩ攣缂栫▼浜嬩欢閫氱煡 @@ -1003,8 +1007,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1018,7 +1021,6 @@ if (topic == gatewayID + "/" + "SetWritableValue_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString()); if (tempData == null) @@ -1064,50 +1066,6 @@ }); } - /// <summary> - /// 缃戝叧鐗堟湰淇℃伅,缃戝叧鍙嶉淇℃伅 - /// </summary> - public SetWritableValueResponAllData setWritableValueResponAllData; - /// <summary> - /// 缃戝叧鐗堟湰淇℃伅,缃戝叧鍙嶉淇℃伅 - /// </summary> - [System.Serializable] - public class SetWritableValueResponAllData - { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; - /// <summary> - /// 缃戝叧鐗堟湰淇℃伅 - /// </summary> - public SetWritableValueResponData setWritableValueResponData; - } - - /// <summary> - /// 璁剧疆鍙啓灞炴�х殑鍊肩殑鏁版嵁 - /// </summary> - [System.Serializable] - public class SetWritableValueResponData - { - /// <summary> - /// 閰嶇疆灞炴�ф墍鍦ㄧ殑cluster - /// </summary> - public int Cluster; - /// <summary> - /// 0锛氶厤缃垚鍔燂紙鑻ラ厤缃垚鍔燂紝涓嬮潰鐨凙ttributeId瀛楁涓嶅瓨鍦級 - ///<para>134锛氫笉鏀寔璇ュ睘鎬�</para> - ///<para>135锛氭棤鏁堢殑灞炴�у��</para> - ///<para>141锛氭棤鏁堢殑鏁版嵁绫诲瀷</para> - /// </summary> - public int Status; - - } #endregion #endregion @@ -1135,8 +1093,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1150,18 +1107,17 @@ } if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new DefaultControlResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 16) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -1378,7 +1334,6 @@ /// <summary> /// 鐢ㄦ埛绠$悊鍙戦�佹暟鎹洖澶� /// </summary> - public DefaultControlResponseAllData defaultControlResponseAllData; [System.Serializable] public class DefaultControlResponseAllData { @@ -1476,8 +1431,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1491,18 +1445,17 @@ } if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new VerifyPasswordResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 12) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -1582,7 +1535,6 @@ /// <summary> /// 鐢ㄦ埛绠$悊鍙戦�佹暟鎹洖澶� /// </summary> - public VerifyPasswordResponseAllData verifyPasswordResponseAllData; [System.Serializable] public class VerifyPasswordResponseAllData { @@ -1626,8 +1578,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1652,18 +1603,17 @@ } else if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new RemoteResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 16) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -1756,7 +1706,6 @@ /// <summary> /// 杩滅▼鍥炲鏁版嵁 /// </summary> - public RemoteResponseAllData remoteResponseAllData; [System.Serializable] public class RemoteResponseAllData { @@ -1821,8 +1770,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1836,18 +1784,17 @@ } if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new TempPasswordResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 16) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -1949,7 +1896,6 @@ /// <summary> /// 涓存椂瀵嗙爜鍥炲鏁版嵁 /// </summary> - public TempPasswordResponseAllData tempPasswordResponseAllData; [System.Serializable] public class TempPasswordResponseAllData { @@ -2034,8 +1980,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2050,18 +1995,17 @@ if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new KeyPasswordInfo { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 20) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -2376,8 +2320,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2391,18 +2334,17 @@ } if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new VolumeResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 14) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -2476,8 +2418,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2491,18 +2432,17 @@ } if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new DefaultControlResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 16) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -2610,7 +2550,6 @@ /// <summary> /// 闊抽噺鍥炲鏁版嵁 /// </summary> - public VolumeResponseAllData volumeResponseAllData; [System.Serializable] public class VolumeResponseAllData { @@ -2673,8 +2612,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2688,18 +2626,17 @@ } if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new OpenModeResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 12) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -2771,8 +2708,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2786,18 +2722,17 @@ } if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new DefaultControlResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 16) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -2899,7 +2834,6 @@ /// <summary> /// 甯稿紑妯″紡聽鍥炲鏁版嵁 /// </summary> - public OpenModeResponseAllData openModeResponseAllData; [System.Serializable] public class OpenModeResponseAllData { diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/FreshAir.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/FreshAir.cs index b90f787..25d2391 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/FreshAir.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/FreshAir.cs @@ -20,6 +20,7 @@ /// <para>6:Smart</para> /// <para>15:鎵嬪姩</para> /// </summary> + [Newtonsoft.Json.JsonIgnore] public int currentFanMode = 0; /// <summary> /// 椋庨�熸。浣� @@ -27,12 +28,14 @@ /// <para>2:涓</para> /// <para>3:楂橀 </para> /// </summary> + [Newtonsoft.Json.JsonIgnore] public int currentFanSpeed = 0; /// <summary> /// 椋庢墖鐘舵�� /// <para>0:鍏抽棴 </para> /// <para>4:鎵撳紑 </para> /// </summary> + [Newtonsoft.Json.JsonIgnore] public int currentFanStatus = 0; /// <summary> @@ -109,8 +112,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -124,7 +126,6 @@ if (topic == gatewayID + "/" + "SetWritableValue_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString()); if (tempData == null) diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/IASZone.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/IASZone.cs index 65da172..726efe2 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/IASZone.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/IASZone.cs @@ -11,16 +11,6 @@ { this.Type = DeviceType.IASZone; } - /// <summary> - /// 鍏夋劅绛夌骇涓暟锛圠ux鑳藉姏锛� - /// <para>鏈夊嚑涓瓑绾у氨鏄剧ず鍑犱釜鍒诲害</para> - /// </summary> - public int LightLevelCount = -1; - - /// <summary> - /// 褰撳墠Lux鍊� - /// </summary> - public int PirLux = -1; #region IAS瀹夐槻淇℃伅涓婃姤. /// <summary> @@ -130,8 +120,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -146,18 +135,17 @@ if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new PirLightAbilitySizeInfo { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 12) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -165,7 +153,6 @@ { var cou = data[10].ToString() + data[11].ToString(); int countTemp = Convert.ToInt32(cou, 16); - LightLevelCount = countTemp; result = new PirLightAbilitySizeInfo { LightLevelCount = countTemp }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0303_{ topic}"); } @@ -235,19 +222,9 @@ /// <summary> /// PIR閰嶇疆鍙傛暟鍥炲 /// </summary> - public PirLightAbilitySizeInfo lightLevelSizeInfo; [System.Serializable] - public class PirLightAbilitySizeInfo + public class PirLightAbilitySizeInfo : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鍏夋劅绛夌骇涓暟锛圠ux鑳藉姏锛� /// <para>鏈夊嚑涓瓑绾у氨鏄剧ず鍑犱釜鍒诲害</para> @@ -278,8 +255,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -294,18 +270,17 @@ if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new ResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 16) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -362,29 +337,15 @@ /// <summary> /// PIR閰嶇疆鍙傛暟鍥炲 /// </summary> - public ParamatesInfo paramatesInfo; [System.Serializable] - public class ParamatesInfo + public class ParamatesInfo : ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// PIR閰嶇疆鍙傛暟 /// </summary> public ConfigureParamates configureParamates; } - /// <summary> - /// PIR閰嶇疆鍙傛暟 - /// </summary> - public ConfigureParamates configureParamates; /// <summary> /// PIR閰嶇疆鍙傛暟 /// </summary> @@ -626,8 +587,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -642,18 +602,17 @@ if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new ParamatesInfo { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 34) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -691,7 +650,6 @@ tempD.dimmerOffTime = Convert.ToInt32(data[30].ToString() + data[31].ToString(), 16); tempD.dimmerLevel = Convert.ToInt32(data[32].ToString() + data[33].ToString(), 16); - configureParamates = tempD; result = new ParamatesInfo { configureParamates = tempD }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0301_{ topic}"); @@ -782,8 +740,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -798,18 +755,17 @@ if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new PirLuxAbilitySizeInfo { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 12) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -817,7 +773,6 @@ { var cou = data[10].ToString() + data[11].ToString(); int countTemp = Convert.ToInt32(cou, 16); - PirLux = countTemp; result = new PirLuxAbilitySizeInfo { pirLux = countTemp }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0303_{ topic}"); } @@ -886,7 +841,6 @@ /// <summary> /// PIR閰嶇疆鍙傛暟鍥炲 /// </summary> - public PirLuxAbilitySizeInfo pirLuxAbilitySizeInfo; [System.Serializable] public class PirLuxAbilitySizeInfo { diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/LigthtBase.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/LigthtBase.cs index 6085d62..3a26cac 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/LigthtBase.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/LigthtBase.cs @@ -9,20 +9,8 @@ /// <summary> /// 寮�鍏夌姸鎬�:0=鍏�,1=寮�, /// </summary> + [Newtonsoft.Json.JsonIgnore] public int OnOffStatus = 0; - //{ - // get{ - // if (DeviceStatusReport != null && DeviceStatusReport.CluterID == 6) - // { - // var attriButeList = DeviceStatusReport.AttriBute; - // foreach (var attriBute1 in attriButeList) - // { - // return attriBute1.AttriButeData; - // } - // } - // return 0; - // } - //} #region 寮�鍏� ///<summary > diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/LogicBase.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/LogicBase.cs deleted file mode 100755 index 539af55..0000000 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/LogicBase.cs +++ /dev/null @@ -1,27 +0,0 @@ -锘縰sing System; -using Newtonsoft.Json.Linq; - -namespace ZigBee.Ios.Device -{ - [System.Serializable] - public class LogicBase - { - /// <summary> - /// 鏄惁鏄柊鍏ョ綉璁惧 - /// 0锛氭棫璁惧鍏ョ綉 - ///1锛氭柊璁惧鍏ョ綉 - /// </summary> - public int IsNewDev; - - /// <summary> - /// 寮�鍏夌姸鎬� - /// </summary> - public bool Power; - - /// <summary> - /// 褰撳墠灞炴�х殑鏁版嵁 - /// </summary> - public int CurrentAttriButeData = 0; - - } -} \ No newline at end of file diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/PMSensor.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/PMSensor.cs index 5cb83ef..a3051f6 100644 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/PMSensor.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/PMSensor.cs @@ -11,19 +11,22 @@ public PMSensor() { this.Type = DeviceType.PMSensor; - } - + } + /// <summary> - /// 褰撳墠娓╁害 + /// 褰撳墠娓╁害 /// </summary> - public int currentTemperature = 0; + [Newtonsoft.Json.JsonIgnore] + public int currentTemperature = 0; /// <summary> - /// 褰撳墠婀垮害 + /// 褰撳墠婀垮害 /// </summary> - public int currentHumidity = 0; + [Newtonsoft.Json.JsonIgnore] + public int currentHumidity = 0; /// <summary> /// 褰撳墠PM2.5鍊� /// </summary> + [Newtonsoft.Json.JsonIgnore] public int currentPmData = 0; } } diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs index edd263e..360323a 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/Panel.cs @@ -18,61 +18,23 @@ /// 鎸夐敭妯″紡锛堢鏈夊姛鑳斤級 /// </summary> public int panelMode = 65535; - /// <summary> - ///鎸夐敭寮�鐘舵�侊紙鎸囩ず锛変寒搴� - /// </summary> - public int panelDirectionsLevel = -1; - - /// <summary> - /// 鎸夐敭鍏崇姸鎬侊紙鑳屽厜锛変寒搴� - /// </summary> - public int panelBacklightLevel = -1; /// <summary> /// 褰撳墠閫夋嫨妯″紡 /// </summary> + [Newtonsoft.Json.JsonIgnore] public string currentKeySelectModeText = ""; /// <summary> /// 褰撳墠閫夋嫨鐨勬ゼ灞侷D /// </summary> + [Newtonsoft.Json.JsonIgnore] public string currentSelectFloorId = string.Empty; /// <summary> /// 褰撳墠閫夋嫨鐨勬埧闂碔D銆愭柊椋庨潰鏉裤�� /// </summary> + [Newtonsoft.Json.JsonIgnore] public string currentSelectRoomId = string.Empty; - /// <summary> - /// 褰撳墠寮�鍏虫ā寮� - /// </summary> - public string CurrentSwitchMode = ""; - /// <summary> - /// 褰撳墠灞炴�фā寮� - /// </summary> - public int currentClusterID; - /// <summary> - /// 褰撳墠璋冨厜妯″紡 - /// </summary> - public string CurrentDimmerMode = ""; - - /// <summary> - /// 褰撳墠閬槼妯″紡 - /// </summary> - public string CurrentCurtainMode = ""; - - /// <summary> - /// 褰撳墠鎴块棿ID - /// </summary> - public string RoomId = ""; - - /// <summary> - /// 褰撳墠閫変腑鐨勫満鏅疘D - /// </summary> - public string curSelectSceneID = ""; - - /// <summary> - /// 鏈湴妤煎眰鎴块棿缁戝畾鍒楄〃 - /// </summary> - public Dictionary<int, FloorRoomBindObj> FloorRoomBindObjList = new Dictionary<int, FloorRoomBindObj> { }; /// <summary> /// 缁戝畾鐨勬ゼ灞傛埧闂翠俊鎭� /// </summary> @@ -113,12 +75,8 @@ // <summary> /// 鎸夐敭涓缁戝畾鐨勭洰鏍囧垪琛� /// </summary> - public System.Collections.Generic.List<BindListResponseObj> bindList = new System.Collections.Generic.List<BindListResponseObj> { }; - - /// <summary> - /// 鎸夐敭鏀寔鐨勭鏈夋ā寮忓垪琛� - /// </summary> - public System.Collections.Generic.Dictionary<int, string> priDeviceModeFunList = new System.Collections.Generic.Dictionary<int, string> { }; + [Newtonsoft.Json.JsonIgnore] + public List<BindListResponseObj> bindList = new List<BindListResponseObj>(); /// <summary> /// 绉佹湁鍔熻兘绫� @@ -193,8 +151,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -209,18 +166,17 @@ if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new PanelPrivateFunctionsResponseAllInfo { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length > 12) { @@ -316,7 +272,6 @@ } break; } - panelPrivateFunctionsResponseInfo = tempD; result = new PanelPrivateFunctionsResponseAllInfo { panelPrivateFunctionsResponseInfo = tempD }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0003_{topic}"); } @@ -363,17 +318,8 @@ /// PIR閰嶇疆鍙傛暟鍥炲 /// </summary> [System.Serializable] - public class PanelPrivateFunctionsResponseAllInfo + public class PanelPrivateFunctionsResponseAllInfo:ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鍏夋劅绛夌骇涓暟锛圠ux鑳藉姏锛� /// <para>鏈夊嚑涓瓑绾у氨鏄剧ず鍑犱釜鍒诲害</para> @@ -384,7 +330,6 @@ /// <summary> /// 閰嶇疆鍙傛暟鍥炲 /// </summary> - public PanelPrivateFunctionsResponseInfo panelPrivateFunctionsResponseInfo; [System.Serializable] public class PanelPrivateFunctionsResponseInfo { @@ -717,8 +662,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -733,18 +677,17 @@ if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new ResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 16) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -896,8 +839,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -911,18 +853,17 @@ } if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new ResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 16) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -1123,10 +1064,6 @@ return data; } - /// <summary> - /// 鎸夐敭鎸囩ず鐏鑹蹭俊鎭� - /// </summary> - public KeyColorData keyColorData; // <summary> /// 鎸夐敭鎸囩ず鐏鑹蹭俊鎭� /// </summary> @@ -1274,8 +1211,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1289,18 +1225,17 @@ } if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new ResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 16) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -1427,8 +1362,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1443,18 +1377,17 @@ if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new ResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 16) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -1601,8 +1534,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1617,18 +1549,17 @@ if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new ResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 16) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -1738,8 +1669,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1754,18 +1684,17 @@ if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new KeyColorDataResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 24) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -1829,7 +1758,6 @@ tempR.keyNum = KeyNum.Key15; break; } - keyColorData = tempR; result = new KeyColorDataResponseAllData { keyColorData = tempR }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0404_{ topic}"); } @@ -1991,8 +1919,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2007,18 +1934,17 @@ if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new PanelSwitchLevelInfo { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 14) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -2026,8 +1952,6 @@ { var level1 = Convert.ToInt32(data[10].ToString() + data[11].ToString(), 16); var level2 = Convert.ToInt32(data[12].ToString() + data[13].ToString(), 16); - panelDirectionsLevel = level1; - panelBacklightLevel = level2; result = new PanelSwitchLevelInfo { panelDirectionsLevel = level1, panelBacklightLevel = level2 }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0406_{ topic}"); } @@ -2142,8 +2066,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2158,18 +2081,17 @@ if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new PanelSwitchLevelResponInfo { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 18) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -2186,7 +2108,6 @@ } tempR.time = Convert.ToInt32(data[14].ToString() + data[15].ToString() + data[12].ToString() + data[13].ToString(), 16); tempR.level = Convert.ToInt32(data[16].ToString() + data[17].ToString(), 16); - panelSaveEnergyModeInfo = tempR; result = new PanelSwitchLevelResponInfo { panelSaveEnergyModeInfo = tempR }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0408_{ topic}"); } @@ -2275,10 +2196,6 @@ } /// <summary> - /// 鎸夐敭鑺傝兘妯″紡淇℃伅 - /// </summary> - public PanelSaveEnergyModeInfo panelSaveEnergyModeInfo; - /// <summary> /// 鑾峰彇鎸夐敭鑺傝兘妯″紡閰嶇疆鐘舵�佹暟鎹� /// </summary> [System.Serializable] @@ -2321,8 +2238,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2337,18 +2253,17 @@ if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new PanelProximitySensorResponInfo { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 20) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -2365,7 +2280,6 @@ } tempR.sensorDistance = Convert.ToInt32(data[14].ToString() + data[15].ToString() + data[12].ToString() + data[13].ToString(), 16); tempR.sensorDelayTime = Convert.ToInt32(data[18].ToString() + data[19].ToString() + data[16].ToString() + data[17].ToString(), 16); - panelProximitySensorInfo = tempR; result = new PanelProximitySensorResponInfo { panelProximitySensorInfo = tempR }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0408_{ topic}"); } @@ -2453,10 +2367,6 @@ } /// <summary> - /// 鑾峰彇鎺ヨ繎浼犳劅閰嶇疆 - /// </summary> - public PanelProximitySensorInfo panelProximitySensorInfo; - /// <summary> /// 鑾峰彇鎺ヨ繎浼犳劅閰嶇疆鏁版嵁 /// </summary> [System.Serializable] @@ -2502,8 +2412,7 @@ // if (topic == gatewayID + "/" + "Error_Respon") // { - // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); // if (temp == null) // { @@ -2517,18 +2426,17 @@ // } // if (topic == gatewayID + "/" + "ZbDataPassthrough") // { - // var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - // gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + // var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - // if (gatewayTemp.clientDataPassthroughResponseData == null) + // if (clientDataPassthroughResponseData == null) // { // result = new PanelSleepGroupResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; // } // else // { - // if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + // if (clientDataPassthroughResponseData?.PassData != null) // { - // var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + // var data = clientDataPassthroughResponseData.PassData; // if (data.Length == 14) // { // var tempR = new PanelSleepGroupResponseData(); @@ -2893,8 +2801,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2908,7 +2815,6 @@ if (topic == gatewayID + "/" + "SetWritableValue_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString()); if (tempData == null) @@ -3064,8 +2970,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -3083,8 +2988,6 @@ var tempEpoint = jobject.Value<int>("Epoint"); var dataId = jobject.Value<int>("Data_ID"); - var lightSwitch = new Panel { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint, DataID = dataId }; - lightSwitch.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<Panel.DeviceStatusReportData>(jobject["Data"].ToString()); if ((DeviceType)(deviceID) == DeviceType.OnOffSwitch) { var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<Panel.DeviceStatusReportData>(jobject["Data"].ToString()); @@ -3254,10 +3157,6 @@ public GetSceneInfo getSceneInfo; } - /// <summary> - /// 鑾峰彇鍦烘櫙淇℃伅 - /// </summary> - public GetSceneInfo sceneGetInfo; /// <summary> /// 鑾峰彇鍦烘櫙淇℃伅 /// </summary> diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/Rollershade.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/Rollershade.cs index 78f02ed..7a88bfd 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/Rollershade.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/Rollershade.cs @@ -17,72 +17,11 @@ /// WcdType=0锛氬嵎甯� /// </summary> public int WcdType = -1; - - /// <summary> - ///绐楀笜褰撳墠楂樺害锛屽崟浣嶏細cm. - /// </summary> - public int WcdCurrentPositionLift = 0; - /// <summary> /// 褰撳墠绐楀笜鎵�鍦ㄧ殑浣嶇疆(鐧惧垎姣�). /// </summary> + [Newtonsoft.Json.JsonIgnore] public int WcdCurrentPositionLiftPercentage = 0; - //{ - // get - // { - // if (DeviceStatusReport.CluterID == 258) - // { - // var attriButeList = DeviceStatusReport.AttriBute; - // foreach (var attriBute in attriButeList) - // { - // if (attriBute.AttributeId == 8) - // { - // return attriBute.AttriButeData; - // } - // } - // } - // return 0; - // } - //} - - /// <summary> - /// 绐楀笜鍏ㄥ紑鎵�鍦ㄧ殑瑙掑害锛屽崟浣嶏細0.1掳 - /// </summary> - public int WcdInstalledOpenLimitTilt = 0; - - /// <summary> - /// 绐楀笜鍏ㄥ叧鎵�鍦ㄧ殑瑙掑害锛屽崟浣嶏細0.1掳 - /// </summary> - public int WcdInstalledClosedLimitTilt = 0; - - /// <summary> - /// 褰撳墠寮�鍚堝笜鐢垫満鏂瑰悜 - /// <para> (false:鐢垫満鏂瑰悜姝e悜锛泃rue:鐢垫満鏂瑰悜鍙嶅悜锛�)</para> . - /// </summary> - public bool WcdCurrentDirection = false; - - /// <summary> - /// 褰撳墠寮�鍚堝笜缁存姢妯″紡 - /// <para>fasle:鐢垫満杩愯浆姝e父锛泃rue:鐢垫満鍦ㄧ淮淇ā寮忎笅杩愯锛�</para> - /// </summary> - public bool WcdCurrentMaintenance = false; - - /// <summary> - /// 褰撳墠绐楀笜寮�鍚堝笜闄愪綅寮�锛堜笂锛夐檺浣� - /// 娉ㄦ剰杩欓噷鍊兼槸缃戝叧杩斿洖鐨勫疄闄呭�硷紝UI涓婃樉绀虹殑鍊艰瀹為檯澶勭悊 - /// </summary> - public int WcdCurrentWcdInstalOpenLimit = 0; - - /// <summary> - /// 褰撳墠寮�鍚堝笜闄愪綅鍏筹紙涓嬶級闄愪綅 - /// 娉ㄦ剰杩欓噷鍊兼槸缃戝叧杩斿洖鐨勫疄闄呭�硷紝UI涓婃樉绀虹殑鍊艰瀹為檯澶勭悊 - /// </summary> - public int WcdCurrentInstalCloseLimit = 0; - - /// <summary> - /// 褰撳墠寮�鍚堝笜鎬荤殑闀垮害 - /// </summary> - public int WcdCurrentLength = 0; /// <summary> /// 璇诲彇褰撳墠绐楀笜鐨勬ā寮� @@ -325,8 +264,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -340,7 +278,6 @@ if (topic == gatewayID + "/" + "SetWritableValue_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString()); if (tempData == null) @@ -415,8 +352,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -430,7 +366,6 @@ if (topic == gatewayID + "/" + "SetWritableValue_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString()); if (tempData == null) @@ -505,8 +440,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -520,7 +454,6 @@ if (topic == gatewayID + "/" + "SetWritableValue_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString()); if (tempData == null) @@ -613,8 +546,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -628,7 +560,6 @@ if (topic == gatewayID + "/" + "SetWritableValue_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString()); if (tempData == null) @@ -712,8 +643,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -727,7 +657,6 @@ if (topic == gatewayID + "/" + "SetWritableValue_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString()); if (tempData == null) diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs index 2c0df35..4c28218 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs @@ -23,7 +23,7 @@ /// </summary> public int Time; - /// <summary> + /// <summary> /// 绛夊緟浠庣綉鍏虫帴鏀舵暟鎹殑鏃堕棿 /// </summary> /// <value>The wait receive data time.</value> @@ -35,7 +35,8 @@ if (mainGateway == null) { return 3000; - }else if (mainGateway.IsVirtual) + } + else if (mainGateway.IsVirtual) { return 6000; } @@ -47,31 +48,8 @@ } /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - ErrorResponData errResponData; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - [System.Serializable] - public class ErrorResponData - { - /// <summary> - /// Error鍙傛暟鍚箟 - ///<para>1锛氱綉鍏虫棤娉曡В鏋愬懡浠ゆ暟鎹��</para> - ///<para>2锛氬崗璋冨櫒姝e湪鍗囩骇鎴栧浠�/鎭㈠鏁版嵁 - ///<para>3锛氭搷浣滆澶�/缁�/鍦烘櫙涓嶅瓨鍦�</para> - ///<para>4锛氬叾浠栭敊璇�</para> - ///<para>5锛氭暟鎹紶杈撻敊璇紙鍦ㄦ煇娆″鎴风鍚戠綉鍏冲彂閫佹暟鎹殑杩囩▼涓紝缃戝叧鍦ㄥ悎鐞嗘椂闂磋寖鍥村唴鎺ユ敹瀹㈡埛绔暟鎹笉瀹屾暣瀵艰嚧璇ラ敊璇彂鐢熴�傚瀹㈡埛绔悜缃戝叧涓�娆″彂閫�100涓瓧鑺傜殑鏁版嵁锛屼絾缃戝叧绛夊緟鎺ユ敹浜嗕竴绉掑彧鎺ユ敹浜�80涓瓧鑺傘�傚彂鐢熻閿欒锛岀綉鍏冲皢涓诲姩鍏抽棴瀹㈡埛绔繛鎺ワ級</para> - /// </summary> - public int Error; - } - - /// <summary> /// 缃戝叧淇℃伅閿欒鍙嶉鍐呭 - /// </summary> + /// </summary> static string ErrorMess(int err) { string message = ""; @@ -126,8 +104,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -135,28 +112,27 @@ } else { - d = new AdminLoginResponAllData { errorResponData = temp , errorMessageBase = ErrorMess(temp.Error) }; + d = new AdminLoginResponAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "Security/Error_Respon") { - var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new AdminLoginResponAllData { }; if (temp == null) { - d .errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" ; + d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖"; } else { if (temp.Error == 1) { - d.errorMessageBase = "缃戝叧涓嶆槸涓荤綉鍏筹紝鏃犳硶杩涜璇ユ搷浣溿��" ; + d.errorMessageBase = "缃戝叧涓嶆槸涓荤綉鍏筹紝鏃犳硶杩涜璇ユ搷浣溿��"; } else if (temp.Error == 2) { - d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��" ; + d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��"; } System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } @@ -164,7 +140,6 @@ if (topic == gatewayID + "/" + "Security/AdminLogin_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); if (tempData == null) { @@ -182,10 +157,10 @@ try { - var bytes = new byte[32]; - var reamarkGwBytes = System.Text.Encoding.UTF8.GetBytes(password); - System.Array.Copy(reamarkGwBytes, 0, bytes, 0, 32 < reamarkGwBytes.Length ? 32 : reamarkGwBytes.Length); - password = System.Text.Encoding.UTF8.GetString(bytes); + var bytes = new byte[32]; + var reamarkGwBytes = System.Text.Encoding.UTF8.GetBytes(password); + System.Array.Copy(reamarkGwBytes, 0, bytes, 0, 32 < reamarkGwBytes.Length ? 32 : reamarkGwBytes.Length); + password = System.Text.Encoding.UTF8.GetString(bytes); var jObject = new Newtonsoft.Json.Linq.JObject() { { "Cluster_ID", 0 }, @@ -195,12 +170,12 @@ jObject.Add("Data", data); mainGateway.Send("Security/AdminLogin", jObject.ToString()); } - catch{} + catch { } var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { await System.Threading.Tasks.Task.Delay(10); - if (d!= null) + if (d != null) { break; } @@ -224,17 +199,8 @@ /// 绠$悊鍛樺瘑鐮佺櫥闄嗚繑鍥炵殑鏁版嵁,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class AdminLoginResponAllData + public class AdminLoginResponAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 杩斿洖缁撴灉Result /// <para>0锛氱櫥闄嗘垚鍔�</para> @@ -277,12 +243,11 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { - d = new ChangeAdminPasswordResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; + d = new ChangeAdminPasswordResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; } else { @@ -292,14 +257,13 @@ if (topic == gatewayID + "/" + "Security/ChangeAdminPassword_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); if (result == 0) { - security.changeAdminPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ChangeAdminPasswordResponseData>(jobject["Data"].ToString()); - if (security.changeAdminPasswordResponseData != null) + var changeAdminPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ChangeAdminPasswordResponseData>(jobject["Data"].ToString()); + if (changeAdminPasswordResponseData != null) { - d = new ChangeAdminPasswordResponseAllData { changeAdminPasswordResponseData = security.changeAdminPasswordResponseData }; + d = new ChangeAdminPasswordResponseAllData { changeAdminPasswordResponseData = changeAdminPasswordResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } } @@ -324,7 +288,8 @@ }; mainGateway.Actions += action; System.Console.WriteLine("Security/ChangeAdminPassword_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ + try + { var jObject = new Newtonsoft.Json.Linq.JObject() { { "Cluster_ID", 0 }, { "Command", 4023} @@ -338,7 +303,7 @@ mainGateway.Send("Security/ChangeAdminPassword", jObject.ToString()); } catch { } - + var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { @@ -367,17 +332,8 @@ /// 淇敼绠$悊鍛樺瘑鐮佽繑鍥炵殑鏁版嵁,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class ChangeAdminPasswordResponseAllData + public class ChangeAdminPasswordResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 淇敼绠$悊鍛樺瘑鐮佽繑鍥炵殑鏁版嵁 /// </summary> @@ -435,8 +391,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -450,29 +405,29 @@ if (topic == gatewayID + "/" + "Security/CatDelayTime_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - security.catDelayTimeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CatDelayTimeResponseData>(jobject["Data"].ToString()); - if (security.catDelayTimeResponseData == null) + var catDelayTimeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CatDelayTimeResponseData>(jobject["Data"].ToString()); + if (catDelayTimeResponseData == null) { d = new CatDelayTimeResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new CatDelayTimeResponseAllData { catDelayTimeResponseData = security.catDelayTimeResponseData }; + d = new CatDelayTimeResponseAllData { catDelayTimeResponseData = catDelayTimeResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } } }; mainGateway.Actions += action; System.Console.WriteLine("Security/CatDelayTime_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ + try + { var jObject = new Newtonsoft.Json.Linq.JObject() { { "Cluster_ID", 0 }, { "Command", 4019} }; mainGateway.Send("Security/CatDelayTime", jObject.ToString()); } - catch{} + catch { } var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { @@ -501,24 +456,15 @@ /// 鏌ョ湅寤舵椂鏃堕棿杩斿洖鐨勬暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class CatDelayTimeResponseAllData + public class CatDelayTimeResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鏌ョ湅寤舵椂鏃堕棿杩斿洖鐨勬暟鎹� /// </summary> public CatDelayTimeResponseData catDelayTimeResponseData; } - + /// <summary> /// 鏌ョ湅寤舵椂鏃堕棿杩斿洖鐨勬暟鎹� /// </summary> @@ -548,7 +494,7 @@ /// <para>goOutDelayTime:澶栧嚭寤舵椂鏃堕棿锛屽崟浣嶇鑼冨洿锛�0-65535</para> /// <para>loginToken:鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆傚鏋滅櫥闄嗘垚鍔燂紝缃戝叧灏嗚褰曡鏍囪瘑锛宎pp闇�瑕佺鐞嗗憳鏉冮檺鐨勬寚浠ら兘搴旇甯︽湁璇ユ爣璇嗭紝缃戝叧浼氭牴鎹鏍囪瘑鏉ュ垽鏂槸鍚︿负绠$悊鍛樻搷浣滐紝濡傛灉鏍囪瘑閿欒锛屽皢杩斿洖鈥淪ecurity/Error_Respon鈥濅富棰樻暟鎹�� 銆�</para> /// </summary> - public static async System.Threading.Tasks.Task<SetDelayTimeResponseAllData> SetDelayTimeAsync(int entranceDelayTime,int goOutDelayTime,string loginToken) + public static async System.Threading.Tasks.Task<SetDelayTimeResponseAllData> SetDelayTimeAsync(int entranceDelayTime, int goOutDelayTime, string loginToken) { return await System.Threading.Tasks.Task.Run(async () => { @@ -567,8 +513,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -583,15 +528,15 @@ if (topic == gatewayID + "/" + "Security/Error_Respon") { var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new SetDelayTimeResponseAllData { }; if (temp == null) { - d .errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" ; + d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖"; } else { - d .errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" ; + d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖"; if (temp.Error == 1) { d.errorMessageBase = "缃戝叧涓嶆槸涓荤綉鍏筹紝鏃犳硶杩涜璇ユ搷浣溿��"; @@ -601,41 +546,42 @@ d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��"; } System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); - d.errorResponData = temp; + d.errorResponData = temp; } } if (topic == gatewayID + "/" + "Security/SetDelayTime_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - security.setDelayTimeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetDelayTimeResponseData>(jobject["Data"].ToString()); - if (security.setDelayTimeResponseData == null) + var setDelayTimeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetDelayTimeResponseData>(jobject["Data"].ToString()); + if (setDelayTimeResponseData == null) { d = new SetDelayTimeResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new SetDelayTimeResponseAllData { setDelayTimeResponseData = security.setDelayTimeResponseData }; + d = new SetDelayTimeResponseAllData { setDelayTimeResponseData = setDelayTimeResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } } }; mainGateway.Actions += action; System.Console.WriteLine("Security/SetDelayTime_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ - var jObject = new Newtonsoft.Json.Linq.JObject() { + try + { + var jObject = new Newtonsoft.Json.Linq.JObject() { { "Cluster_ID", 0 }, { "Command", 4020} }; - var data = new JObject + var data = new JObject { { "EntranceDelayTime", entranceDelayTime}, { "GoOutDelayTime", goOutDelayTime}, { "LoginToken", loginToken} }; - jObject.Add("Data", data); - mainGateway.Send("Security/SetDelayTime", jObject.ToString()); - }catch { } + jObject.Add("Data", data); + mainGateway.Send("Security/SetDelayTime", jObject.ToString()); + } + catch { } var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { @@ -664,17 +610,8 @@ /// 璁剧疆寤舵椂鏃堕棿杩斿洖鐨勬暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class SetDelayTimeResponseAllData + public class SetDelayTimeResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 璁剧疆寤舵椂鏃堕棿杩斿洖鐨勬暟鎹� /// </summary> @@ -714,7 +651,7 @@ { return await System.Threading.Tasks.Task.Run(async () => { - CatUserPasswordResponseAllData d =null; + CatUserPasswordResponseAllData d = null; var mainGateway = ZbGateway.MainGateWay; if (mainGateway == null) { @@ -729,8 +666,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -744,17 +680,16 @@ if (topic == gatewayID + "/" + "Security/Error_Respon") { - var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new CatUserPasswordResponseAllData { }; if (temp == null) { - d .errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" ; + d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖"; } else { - if (temp.Error == 1) + if (temp.Error == 1) { d.errorMessageBase = "缃戝叧涓嶆槸涓荤綉鍏筹紝鏃犳硶杩涜璇ユ搷浣溿��"; } @@ -763,41 +698,42 @@ d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��"; } System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); - d.errorResponData = temp; + d.errorResponData = temp; } } if (topic == gatewayID + "/" + "Security/CatUserPassword_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - security.catUserPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CatUserPasswordResponseData>(jobject["Data"].ToString()); - if (security.catUserPasswordResponseData == null) + var catUserPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CatUserPasswordResponseData>(jobject["Data"].ToString()); + if (catUserPasswordResponseData == null) { d = new CatUserPasswordResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new CatUserPasswordResponseAllData { catUserPasswordResponseData = security.catUserPasswordResponseData }; + d = new CatUserPasswordResponseAllData { catUserPasswordResponseData = catUserPasswordResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } } }; mainGateway.Actions += action; System.Console.WriteLine("Security/CatUserPassword_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ + try + { var jObject = new Newtonsoft.Json.Linq.JObject() { { "Cluster_ID", 0 }, { "Command", 4024} - }; + }; var data = new JObject { { "LoginToken", loginToken} }; jObject.Add("Data", data); - mainGateway.Send("Security/CatUserPassword", jObject.ToString()); - } - catch { - } + mainGateway.Send("Security/CatUserPassword", jObject.ToString()); + } + catch + { + } var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { @@ -826,17 +762,8 @@ /// 鏌ョ湅鐢ㄦ埛瀵嗙爜鍜岃儊杩瘑鐮佽繑鍥炵殑鏁版嵁,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class CatUserPasswordResponseAllData + public class CatUserPasswordResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鏌ョ湅鐢ㄦ埛瀵嗙爜鍜岃儊杩瘑鐮佽繑鍥炵殑鏁版嵁 /// </summary> @@ -912,8 +839,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -928,11 +854,11 @@ if (topic == gatewayID + "/" + "Security/Error_Respon") { var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new SetUserPasswordResponseAllData { }; if (temp == null) { - d .errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" ; + d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖"; } else { @@ -945,20 +871,19 @@ d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��"; } System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); - d.errorResponData = temp; + d.errorResponData = temp; } } if (topic == gatewayID + "/" + "Security/SetUserPassword_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); if (result == 0) { - security.setUserPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetUserPasswordResponseData>(jobject["Data"].ToString()); - if (security.setUserPasswordResponseData != null) + var setUserPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetUserPasswordResponseData>(jobject["Data"].ToString()); + if (setUserPasswordResponseData != null) { - d = new SetUserPasswordResponseAllData { setUserPasswordResponseData = security.setUserPasswordResponseData }; + d = new SetUserPasswordResponseAllData { setUserPasswordResponseData = setUserPasswordResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } @@ -975,7 +900,8 @@ }; mainGateway.Actions += action; System.Console.WriteLine("Security/SetUserPassword_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ + try + { var jObject = new Newtonsoft.Json.Linq.JObject() { { "Cluster_ID", 0 }, { "Command", 4025} @@ -990,8 +916,9 @@ jObject.Add("Data", data); mainGateway.Send("Security/SetUserPassword", jObject.ToString()); } - catch{ - } + catch + { + } var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { @@ -1039,8 +966,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1055,7 +981,7 @@ if (topic == gatewayID + "/" + "Security/Error_Respon") { var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new SetUserPasswordResponseAllData { }; if (temp == null) { @@ -1077,14 +1003,13 @@ if (topic == gatewayID + "/" + "Security/AddPassWordTips_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); if (result == 0) { - security.setUserPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetUserPasswordResponseData>(jobject["Data"].ToString()); - if (security.setUserPasswordResponseData != null) + var setUserPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetUserPasswordResponseData>(jobject["Data"].ToString()); + if (setUserPasswordResponseData != null) { - d = new SetUserPasswordResponseAllData { setUserPasswordResponseData = security.setUserPasswordResponseData }; + d = new SetUserPasswordResponseAllData { setUserPasswordResponseData = setUserPasswordResponseData }; } } else @@ -1143,17 +1068,8 @@ /// 鏂板鎴栭噸璁剧敤鎴峰瘑鐮佽繑鍥炵殑鏁版嵁,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class SetUserPasswordResponseAllData + public class SetUserPasswordResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 淇敼绠$悊鍛樺瘑鐮佽繑鍥炵殑鏁版嵁 /// </summary> @@ -1198,7 +1114,7 @@ /// 涓�0鏃讹紝鑷姩鍒嗛厤鏂扮殑鐢ㄦ埛id銆備负5鏃讹紝鍒欎慨鏀硅儊杩瘑鐮併�傚彇鍊艰寖鍥�0-5銆�</para> /// <para>loginToken:鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇��</para> /// </summary> - public static async System.Threading.Tasks.Task<DelUserPasswordResponseAllData> DelUserPasswordAsync(int userId,string loginToken) + public static async System.Threading.Tasks.Task<DelUserPasswordResponseAllData> DelUserPasswordAsync(int userId, string loginToken) { return await System.Threading.Tasks.Task.Run(async () => { @@ -1217,8 +1133,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1231,16 +1146,15 @@ } if (topic == gatewayID + "/" + "Security/Error_Respon") { - var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new DelUserPasswordResponseAllData { }; if (temp == null) { - d .errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" ; + d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖"; } else - { + { if (temp.Error == 1) { d.errorMessageBase = "缃戝叧涓嶆槸涓荤綉鍏筹紝鏃犳硶杩涜璇ユ搷浣溿��"; @@ -1255,11 +1169,10 @@ } if (topic == gatewayID + "/" + "Security/DelUserPassword_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - security.delUserPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelUserPasswordResponseData>(jobject["Data"].ToString()); - if (security.delUserPasswordResponseData != null) + var delUserPasswordResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelUserPasswordResponseData>(jobject["Data"].ToString()); + if (delUserPasswordResponseData != null) { - d = new DelUserPasswordResponseAllData { delUserPasswordResponseData = security.delUserPasswordResponseData }; + d = new DelUserPasswordResponseAllData { delUserPasswordResponseData = delUserPasswordResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } @@ -1273,7 +1186,8 @@ }; mainGateway.Actions += action; System.Console.WriteLine("Security/DelUserPassword_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ + try + { var jObject = new Newtonsoft.Json.Linq.JObject() { { "Cluster_ID", 0 }, { "Command", 4026} @@ -1286,7 +1200,7 @@ jObject.Add("Data", data); mainGateway.Send("Security/DelUserPassword", jObject.ToString()); } - catch{} + catch { } var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { @@ -1315,17 +1229,8 @@ /// 鍒犻櫎鐢ㄦ埛瀵嗙爜杩斿洖鐨勬暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class DelUserPasswordResponseAllData + public class DelUserPasswordResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鍒犻櫎鐢ㄦ埛瀵嗙爜杩斿洖鐨勬暟鎹� /// </summary> @@ -1381,7 +1286,7 @@ // if (topic == gatewayID + "/" + "Error_Respon") // { // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID }; - // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); // if (temp == null) // { @@ -1607,67 +1512,67 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { d = new AddDeviceToZoneResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; - } + } else { d = new AddDeviceToZoneResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; - + } } if (topic == gatewayID + "/" + "Security/Error_Respon") { var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new AddDeviceToZoneResponseAllData { }; if (temp == null) { - d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" ; + d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖"; } else { if (temp.Error == 1) { - d.errorMessageBase = "缃戝叧涓嶆槸涓荤綉鍏筹紝鏃犳硶杩涜璇ユ搷浣溿��" ; + d.errorMessageBase = "缃戝叧涓嶆槸涓荤綉鍏筹紝鏃犳硶杩涜璇ユ搷浣溿��"; } else if (temp.Error == 2) { - d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��" ; + d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��"; } System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); - d.errorResponData = temp ; + d.errorResponData = temp; } } if (topic == gatewayID + "/" + "Security/AddEqToZone_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); - + if (result == 0) { - security.addDeviceToZoneResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddDeviceToZoneResponseData>(jobject["Data"].ToString()); - if(security.addDeviceToZoneResponseData!=null){ - d = new AddDeviceToZoneResponseAllData { addDeviceToPartResponseData = security.addDeviceToZoneResponseData }; - } - System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); + var addDeviceToZoneResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddDeviceToZoneResponseData>(jobject["Data"].ToString()); + if (addDeviceToZoneResponseData != null) + { + d = new AddDeviceToZoneResponseAllData { addDeviceToPartResponseData = addDeviceToZoneResponseData }; + } + System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } else { d = new AddDeviceToZoneResponseAllData { errorMessageBase = "娣诲姞澶辫触" }; - } + } } }; mainGateway.Actions += action; System.Console.WriteLine($"Security/AddEqToZone_Actions鍚姩_{System.DateTime.Now.ToString()}"); - try{ + try + { if (addDeviceToZoneData != null) { var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4003 } }; @@ -1692,7 +1597,8 @@ mainGateway.Send(("Security/AddEqToZone_Actions 鍚姩"), jObject.ToString()); } } - catch { + catch + { } var dateTime = DateTime.Now; @@ -1724,17 +1630,8 @@ /// 璁惧鍔犲叆闃插尯鐨勮繑鍥炴暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class AddDeviceToZoneResponseAllData + public class AddDeviceToZoneResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 璁惧鍔犲叆闃插尯鐨勮繑鍥炴暟鎹� /// </summary> @@ -1891,8 +1788,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1907,7 +1803,7 @@ if (topic == gatewayID + "/" + "Security/Error_Respon") { var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new AddNewModeResponseAllData { }; if (temp == null) @@ -1932,17 +1828,16 @@ if (topic == gatewayID + "/" + "Security/AddNewMode_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); if (result == 0) { - security.addNewModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddNewModeResponseData>(jobject["Data"].ToString()); - if (security.addNewModeResponseData != null) + var addNewModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddNewModeResponseData>(jobject["Data"].ToString()); + if (addNewModeResponseData != null) { - d = new AddNewModeResponseAllData { addNewModeResponseData = security.addNewModeResponseData }; + d = new AddNewModeResponseAllData { addNewModeResponseData = addNewModeResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); - } + } } else { @@ -1952,7 +1847,8 @@ }; mainGateway.Actions += action; System.Console.WriteLine("Security/AddNewMode_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ + try + { if (addNewModeData != null) { var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4004 } }; @@ -1967,7 +1863,7 @@ mainGateway.Send(("Security/AddNewMode"), jObject.ToString()); } } - catch {} + catch { } var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { @@ -1977,9 +1873,9 @@ break; } } - if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime ) + if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) { - d = new AddNewModeResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; + d = new AddNewModeResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; } mainGateway.Actions -= action; @@ -1997,17 +1893,8 @@ /// 鏂板缓鎴栦慨鏀瑰竷闃叉ā寮忚繑鍥炵殑鏁版嵁,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class AddNewModeResponseAllData + public class AddNewModeResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> ///鏂板缓鎴栦慨鏀瑰竷闃叉ā寮忚繑鍥炵殑鏁版嵁 /// </summary> @@ -2040,14 +1927,14 @@ /// <summary> /// 甯冮槻妯″紡鍚嶇О 锛屾渶澶�32涓瓧绗︺�� /// </summary> - public string ModeName; + public string ModeName; /// <summary> /// 鍏佽澶辫兘銆� ///<para>0锛氫笉鍏佽澶辫兘銆�</para> ///<para>1锛氬厑璁稿け鑳�</para> /// </summary> - public int AllowDisable; + public int AllowDisable; } /// <summary> @@ -2071,7 +1958,7 @@ /// 甯冮槻妯″紡鍚嶇О 锛屾渶澶�32涓瓧绗︺�� ///<para>涓嶉渶瑕佷慨鏀瑰彲蹇界暐璇ュ瓧娈点��</para> /// </summary> - public string ModeName; + public string ModeName; /// <summary> /// 鍏佽澶辫兘銆� @@ -2111,8 +1998,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2121,13 +2007,12 @@ else { d = new ZoneJoinModeResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; - } + } } if (topic == gatewayID + "/" + "Security/Error_Respon") { - var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new ZoneJoinModeResponseAllData { }; if (temp == null) @@ -2152,15 +2037,14 @@ if (topic == gatewayID + "/" + "Security/ZoneJoinMode_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); var modeId = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["ModeId"].ToString()); if (result == 0) { - security.zoneJoinModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZoneJoinModeResponseData>(jobject["Data"].ToString()); - if (security.zoneJoinModeResponseData != null) + var zoneJoinModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZoneJoinModeResponseData>(jobject["Data"].ToString()); + if (zoneJoinModeResponseData != null) { - d = new ZoneJoinModeResponseAllData { zoneJoinModeResponseData = security.zoneJoinModeResponseData }; + d = new ZoneJoinModeResponseAllData { zoneJoinModeResponseData = zoneJoinModeResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } } @@ -2177,7 +2061,8 @@ }; mainGateway.Actions += action; System.Console.WriteLine("Security/ZoneJoinMode_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ + try + { if (zoneJoinModeData != null) { var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4005 } }; @@ -2199,8 +2084,8 @@ mainGateway.Send(("Security/ZoneJoinMode"), jObject.ToString()); } } - catch{} - + catch { } + var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { @@ -2230,17 +2115,8 @@ /// 闃插尯鍔犲叆甯冮槻妯″紡杩斿洖鐨勬暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class ZoneJoinModeResponseAllData + public class ZoneJoinModeResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> ///闃插尯鍔犲叆甯冮槻妯″紡杩斿洖鐨勬暟鎹� /// </summary> @@ -2288,7 +2164,7 @@ ///<para>2锛氬け璐ワ紝闃插尯宸插湪妯″紡涓瓨鍦�</para> ///<para>3锛氬け璐ワ紝闃插尯涓�24灏忔椂锛堥潤闊筹級闃插尯绫诲瀷銆�</para> /// </summary> - public int Status=999; + public int Status = 999; /// <summary> /// 闃插尯ID /// </summary> @@ -2357,8 +2233,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2372,8 +2247,7 @@ if (topic == gatewayID + "/" + "Security/Error_Respon") { - var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new RemoveZoneFromModeResponseAllData { }; if (temp == null) @@ -2398,16 +2272,15 @@ if (topic == gatewayID + "/" + "Security/RemoveZoneFromMode_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); var modeId = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["ModeId"].ToString()); if (result == 0) { - security.removeZoneFromModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveZoneFromModeResponseData>(jobject["Data"].ToString()); - if (security.removeZoneFromModeResponseData != null) + var removeZoneFromModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveZoneFromModeResponseData>(jobject["Data"].ToString()); + if (removeZoneFromModeResponseData != null) { - d = new RemoveZoneFromModeResponseAllData { removeZoneFromModeResponseData = security.removeZoneFromModeResponseData }; + d = new RemoveZoneFromModeResponseAllData { removeZoneFromModeResponseData = removeZoneFromModeResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } } @@ -2423,7 +2296,8 @@ }; mainGateway.Actions += action; System.Console.WriteLine("Security/RemoveZoneFromMode_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ + try + { if (removeZoneFromModeData != null) { var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4006 } }; @@ -2476,17 +2350,8 @@ /// 浠庡竷闃叉ā寮忎腑绉婚櫎闃插尯杩斿洖鐨勬暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class RemoveZoneFromModeResponseAllData + public class RemoveZoneFromModeResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> ///浠庡竷闃叉ā寮忎腑绉婚櫎闃插尯杩斿洖鐨勬暟鎹� /// </summary> @@ -2589,8 +2454,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2604,8 +2468,7 @@ if (topic == gatewayID + "/" + "Security/Error_Respon") { - var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new AddModeActonResponAllData { }; if (temp == null) @@ -2631,23 +2494,22 @@ if (topic == gatewayID + "/" + "Security/AddModeActon_Respon") { dateTime = DateTime.Now; - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); var modeId = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["ModeId"].ToString()); var actionType = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["ActionType"].ToString()); if (result == 0) { - security.addModeActonResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddModeActonResponData>(jobject["Data"].ToString()); - if (security.addModeActonResponData != null) + var addModeActonResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddModeActonResponData>(jobject["Data"].ToString()); + if (addModeActonResponData != null) { - d = new AddModeActonResponAllData { addModeActonResponData = security.addModeActonResponData }; + d = new AddModeActonResponAllData { addModeActonResponData = addModeActonResponData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } } else { - d = new AddModeActonResponAllData {}; + d = new AddModeActonResponAllData { }; var r = new AddModeActonResponData(); r.Result = result; r.ModeId = modeId; @@ -2658,53 +2520,54 @@ }; mainGateway.Actions += action; System.Console.WriteLine("Security/AddModeActon_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ - if (addModeActonData != null) + try { - var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4007 } }; - var acList = new JArray { }; - foreach (var act in addModeActonData.Actions) + if (addModeActonData != null) { - if (act.Type == 0) + var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4007 } }; + var acList = new JArray { }; + foreach (var act in addModeActonData.Actions) { - var taskList = new JArray { }; - foreach (var taskInfo in act.TaskList) + if (act.Type == 0) { - var tInfo = new JObject{ + var taskList = new JArray { }; + foreach (var taskInfo in act.TaskList) + { + var tInfo = new JObject{ { "TaskType", taskInfo.TaskType}, { "Data1", taskInfo.Data1}, { "Data2",taskInfo.Data2} }; - taskList.Add(tInfo); - } + taskList.Add(tInfo); + } - var a = new JObject { + var a = new JObject { { "Type",act.Type}, { "DeviceAddr", act.DeviceAddr} , { "Epoint",act.Epoint} , { "TaskList", taskList} }; - acList.Add(a); - } - else if (act.Type == 1) - { - var b = new JObject { + acList.Add(a); + } + else if (act.Type == 1) + { + var b = new JObject { { "Type",act.Type}, { "ScenesId", act.ScenesId} }; - acList.Add(b); + acList.Add(b); + } } - } - var data = new JObject { + var data = new JObject { { "ModeId",addModeActonData.ModeId}, { "ActionType", addModeActonData.ActionType} , { "Actions", acList}, { "LoginToken", addModeActonData.LoginToken} }; - jObject.Add("Data", data); - mainGateway.Send(("Security/AddModeActon"), jObject.ToString()); - } + jObject.Add("Data", data); + mainGateway.Send(("Security/AddModeActon"), jObject.ToString()); + } } catch { } @@ -2727,17 +2590,8 @@ /// 瀹夐槻妯″紡瑙﹀彂鍔ㄤ綔娣诲姞鐨勬暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class AddModeActonResponAllData + public class AddModeActonResponAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 瀹夐槻妯″紡瑙﹀彂鍔ㄤ綔娣诲姞鐨勬暟鎹� /// </summary> @@ -2758,7 +2612,7 @@ /// 0锛氶粯璁� ///<para>1锛氬け璐ワ紝妯″紡涓嶅瓨鍦ㄣ��</para> /// </summary> - public int Result=999; + public int Result = 999; /// <summary> /// 瑕佷慨鏀圭殑甯冮槻妯″紡ID銆� @@ -2791,7 +2645,7 @@ ///<para>0锛氭垚鍔�</para> ///<para>1锛氬け璐ワ紝璁惧鎴栧満鏅笉瀛樺湪</para> /// </summary> - public int Status=999; + public int Status = 999; /// <summary> /// 鍔ㄤ綔绫诲瀷 @@ -2848,7 +2702,7 @@ ///<para>2锛氬竷闃插け璐ユ寚绀哄姩浣�</para> ///<para>3锛氭挙闃叉垚鍔熸寚绀哄姩浣�</para> ///<para>4锛氭挙闃插け璐ユ寚绀哄姩浣�</para> - /// </summary> + /// </summary> public int ActionType; /// <summary> @@ -2972,8 +2826,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2987,10 +2840,9 @@ if (topic == gatewayID + "/" + "Security/Error_Respon") { - var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); - d = new RemoveActionFromModeAllData {}; + d = new RemoveActionFromModeAllData { }; if (temp == null) { d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖"; @@ -3006,32 +2858,32 @@ d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��"; } System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); - d.errorResponData = temp; + d.errorResponData = temp; } } if (topic == gatewayID + "/" + "Security/RemoveActonFromMode_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); if (result == 0) { - security.removeActonFromModeResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveActionFromModeResponData>(jobject["Data"].ToString()); - if (security.removeActonFromModeResponData != null) + var removeActonFromModeResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveActionFromModeResponData>(jobject["Data"].ToString()); + if (removeActonFromModeResponData != null) { - d = new RemoveActionFromModeAllData { removeActonFromModeResponData = security.removeActonFromModeResponData }; - System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); + d = new RemoveActionFromModeAllData { removeActonFromModeResponData = removeActonFromModeResponData }; + System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } } else { - d = new RemoveActionFromModeAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; + d = new RemoveActionFromModeAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } } }; mainGateway.Actions += action; System.Console.WriteLine("Security/RemoveActonFromMode_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ + try + { if (removeActonFromModeData != null) { var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4008 } }; @@ -3066,7 +2918,8 @@ mainGateway.Send(("Security/RemoveActonFromMode"), jObject.ToString()); } } - catch{ + catch + { } @@ -3098,17 +2951,8 @@ /// 灏嗗姩浣滀粠甯冮槻妯″紡涓Щ闄ょ殑鏁版嵁,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class RemoveActionFromModeAllData + public class RemoveActionFromModeAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 灏嗗姩浣滀粠甯冮槻妯″紡涓Щ闄ょ殑鍥炲鏁版嵁 /// </summary> @@ -3158,7 +3002,7 @@ ///<para>0锛氭垚鍔�</para> ///<para>1锛氬け璐ワ紝璁惧鎴栧満鏅笉瀛樺湪</para> /// </summary> - public int Status=999; + public int Status = 999; /// <summary> /// 鍔ㄤ綔绫诲瀷 @@ -3205,7 +3049,7 @@ ///<para>2锛氬竷闃插け璐ユ寚绀哄姩浣�</para> ///<para>3锛氭挙闃叉垚鍔熸寚绀哄姩浣�</para> ///<para>4锛氭挙闃插け璐ユ寚绀哄姩浣�</para> - /// </summary> + /// </summary> public int ActionType; /// <summary> @@ -3270,8 +3114,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -3285,29 +3128,30 @@ if (topic == gatewayID + "/" + "Security/GetModeList_Repon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - security.getModeListData = Newtonsoft.Json.JsonConvert.DeserializeObject<GetModeListData>(jobject["Data"].ToString()); - if (security.getModeListData == null) + var getModeListData = Newtonsoft.Json.JsonConvert.DeserializeObject<GetModeListData>(jobject["Data"].ToString()); + if (getModeListData == null) { d = new GetModeListAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new GetModeListAllData { getModeListData = security.getModeListData }; + d = new GetModeListAllData { getModeListData = getModeListData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } } }; mainGateway.Actions += action; System.Console.WriteLine("Security/GetModeList_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ + try + { var jObject = new Newtonsoft.Json.Linq.JObject() { { "Cluster_ID", 0 }, { "Command", 4009 } }; mainGateway.Send("Security/GetModeList", jObject.ToString()); - }catch{ } + } + catch { } var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) @@ -3337,17 +3181,8 @@ /// 鑾峰彇甯冮槻妯″紡鍒楄〃杩斿洖鐨勬暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class GetModeListAllData + public class GetModeListAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鑾峰彇甯冮槻妯″紡鍒楄〃杩斿洖鐨勬暟鎹� /// </summary> @@ -3389,14 +3224,14 @@ /// 甯冮槻妯″紡鍚嶇О 锛屾渶澶�32涓瓧绗� /// </summary> public string ModeName; - + /// <summary> /// 鍏佽澶辫兘銆� ///<para>0锛氫笉鍏佽澶辫兘銆�</para> ///<para>1锛氬厑璁稿け鑳�</para> /// </summary> public string AllowDisable; - + /// <summary> /// 妯″紡褰撳墠甯冩挙闃茬姸鎬� ///<para>0锛氭挙闃�</para> @@ -3417,7 +3252,7 @@ { return await System.Threading.Tasks.Task.Run(async () => { - GetModeInfoByIdResponAllData d =null; + GetModeInfoByIdResponAllData d = null; var mainGateway = ZbGateway.MainGateWay; if (mainGateway == null) { @@ -3432,8 +3267,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -3446,7 +3280,6 @@ } if (topic == gatewayID + "/" + "Security/GetModeInfoById_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); if (result == 0) { @@ -3456,7 +3289,7 @@ d = new GetModeInfoByIdResponAllData { getModeInfoByIdResponData = getModeInfoByIdResponData }; } System.Console.WriteLine("宸叉敹鍒伴�氱煡杩斿洖"); - } + } else { d = new GetModeInfoByIdResponAllData { }; @@ -3469,7 +3302,8 @@ }; mainGateway.Actions += action; System.Console.WriteLine("Security/GetModeInfoById_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ + try + { var jObject = new Newtonsoft.Json.Linq.JObject() { { "Cluster_ID", 0 }, { "Command", 4010 } @@ -3478,8 +3312,8 @@ jObject.Add("Data", data); mainGateway.Send("Security/GetModeInfoById", jObject.ToString()); } - catch {} - + catch { } + var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { @@ -3491,7 +3325,7 @@ } if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) { - d = new GetModeInfoByIdResponAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; + d = new GetModeInfoByIdResponAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; } mainGateway.Actions -= action; System.Console.WriteLine("Security/GetModeInfoById_Actions 閫�鍑�" + System.DateTime.Now.ToString()); @@ -3508,17 +3342,8 @@ /// 閫氳繃甯冮槻妯″紡ID鏌ョ湅妯″紡淇℃伅鐨勬暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class GetModeInfoByIdResponAllData + public class GetModeInfoByIdResponAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 閫氳繃甯冮槻妯″紡ID鏌ョ湅妯″紡淇℃伅杩斿洖鐨勬暟鎹� /// </summary> @@ -3539,7 +3364,7 @@ /// 0锛氶粯璁� ///<para>1锛氬け璐ワ紝甯冮槻妯″紡涓嶅瓨鍦�</para> /// </summary> - public int Result=999; + public int Result = 999; /// <summary> /// 甯冮槻妯″紡ID @@ -3550,7 +3375,7 @@ /// 甯冮槻妯″紡鍚嶇О 锛屾渶澶�32涓瓧绗� ///<para> (Result=0鏃跺�兼湁鏁�)</para> /// </summary> - public string ModeName; + public string ModeName; /// <summary> /// 鍏佽澶辫兘銆� @@ -3558,7 +3383,7 @@ ///<para>1锛氬厑璁稿け鑳�</para> ///<para> (Result=0鏃跺�兼湁鏁�)</para> /// </summary> - public int AllowDisable = 100; + public int AllowDisable = 100; /// <summary> /// 妯″紡褰撳墠甯冩挙闃茬姸鎬� @@ -3603,8 +3428,8 @@ ///<para> (Result=0鏃跺�兼湁鏁�)</para> /// </summary> public List<ActionsInfo> WithdrawFailActions = new List<ActionsInfo>(); - - } + + } /// <summary> /// 鍔犲叆鎴愬姛鐨勯槻鍖哄垪琛ㄧ殑鏁版嵁 @@ -3688,8 +3513,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -3703,7 +3527,6 @@ if (topic == gatewayID + "/" + "Security/GetModeUsing_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); if (result == 0) { @@ -3716,7 +3539,7 @@ } else { - d = new GetModeUsingResponseAllData {}; + d = new GetModeUsingResponseAllData { }; var r = new GetModeUsingResponseData(); r.Result = result; d.getModeUsingResponseData = r; @@ -3726,15 +3549,16 @@ }; mainGateway.Actions += action; System.Console.WriteLine("Security/GetModeUsing_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ + try + { var jObject = new Newtonsoft.Json.Linq.JObject() { { "Cluster_ID", 0 }, { "Command", 4011} }; mainGateway.Send("Security/GetModeUsing", jObject.ToString()); } - catch {} - + catch { } + var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { @@ -3746,7 +3570,7 @@ } if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) { - d = new GetModeUsingResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; + d = new GetModeUsingResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; } mainGateway.Actions -= action; System.Console.WriteLine("Security/GetModeUsing_Actions 閫�鍑�" + System.DateTime.Now.ToString()); @@ -3763,17 +3587,8 @@ /// 鏌ョ湅褰撳墠姝e湪浣跨敤鐨勫竷闃叉ā寮忚繑鍥炵殑鏁版嵁,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class GetModeUsingResponseAllData + public class GetModeUsingResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鏌ョ湅褰撳墠姝e湪浣跨敤鐨勫竷闃叉ā寮忚繑鍥炵殑鏁版嵁 /// </summary> @@ -3796,7 +3611,7 @@ /// 0锛氶粯璁� /// <para>1锛氱郴缁熷綋鍓嶆病鏈夎繘琛屽竷闃�</para> /// </summary> - public int Result=999; + public int Result = 999; /// <summary> /// 鍚敤鐨勫竷闃叉ā寮廼d @@ -3813,7 +3628,7 @@ /// <para>3锛氬け鑳戒竴娆★紝绗竴娆¤婵�娲讳笉璀﹀憡涓嶈Е鍙戝姩浣溿��</para> /// </summary> public int Setting; - + } #endregion @@ -3828,7 +3643,7 @@ { EnableModeResponAllData d = null; var mainGateway = ZbGateway.MainGateWay; - if (mainGateway == null) + if (mainGateway == null) { d = new EnableModeResponAllData { errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" }; return d; @@ -3841,8 +3656,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -3855,17 +3669,16 @@ } if (topic == gatewayID + "/" + "Security/EnableMode_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); var modeId = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["ModeId"].ToString()); - security.enableModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<EnableModeResponseData>(jobject["Data"].ToString()); - if (security.enableModeResponseData == null) + var enableModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<EnableModeResponseData>(jobject["Data"].ToString()); + if (enableModeResponseData == null) { d = new EnableModeResponAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new EnableModeResponAllData { enableModeResponseData = security.enableModeResponseData }; + d = new EnableModeResponAllData { enableModeResponseData = enableModeResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } } @@ -3873,7 +3686,8 @@ mainGateway.Actions += action; System.Console.WriteLine("Security/EnableMode_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ + try + { if (enableModeData != null) { var jObject = new Newtonsoft.Json.Linq.JObject() { @@ -3892,7 +3706,7 @@ mainGateway.Send("Security/EnableMode", jObject.ToString()); } } - catch{} + catch { } var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) @@ -3922,17 +3736,8 @@ /// 甯冮槻杩斿洖鐨勬暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class EnableModeResponAllData + public class EnableModeResponAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 甯冮槻杩斿洖鐨勬暟鎹� /// </summary> @@ -3957,7 +3762,7 @@ ///<para>4锛氬竷闃插け璐ワ紝鏈夊叾浠栧竷闃叉ā寮忔鍦ㄥ惎鐢紙鍙兘浣跨敤涓�绉嶅竷闃叉ā寮忥紝闇�灏嗘鍦ㄥ惎鐢ㄧ殑甯冮槻妯″紡鎾ら槻鎵嶈兘甯冮槻鏂版ā寮忥級銆�</para> ///<para>5锛氬け璐ワ紝妯″紡灞炴�т笉鍏佽澶辫兘锛堝鏋滄柊寤哄竷闃叉ā寮忔椂锛孉llowDisable璁剧疆涓�0锛屽垯甯冮槻Setting鍊间笉鑳戒负2鎴�3锛屽惁鍒欏皢鎶ュ憡璇ラ敊璇級</para> /// </summary> - public int Result=999; + public int Result = 999; /// <summary> /// 鍚敤鐨勫竷闃叉ā寮廼d @@ -3974,7 +3779,7 @@ /// <para>3锛氬け鑳戒竴娆★紝绗竴娆¤婵�娲讳笉璀﹀憡涓嶈Е鍙戝姩浣溿��</para> /// </summary> public int Setting; - + /// <summary> ///褰撳墠姝e湪鍚敤鐨勫竷闃叉ā寮廔D锛堝綋Result = 4鏃跺瓨鍦ㄣ�傦級 /// </summary> @@ -4037,7 +3842,7 @@ ///<para>1锛氭鏌�</para> /// </summary> public int CheckIASStatus; - + /// <summary> ///鐢ㄦ埛瀵嗙爜锛屾渶澶�32涓瓧绗� /// </summary> @@ -4069,8 +3874,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -4084,15 +3888,14 @@ if (topic == gatewayID + "/" + "Security/WithdrawMode_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - security.withdrawModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<WithdrawModeResponseData>(jobject["Data"].ToString()); - if (security.withdrawModeResponseData == null) + var withdrawModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<WithdrawModeResponseData>(jobject["Data"].ToString()); + if (withdrawModeResponseData == null) { d = new WithdrawModeResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new WithdrawModeResponseAllData { withdrawModeResponseData = security.withdrawModeResponseData }; + d = new WithdrawModeResponseAllData { withdrawModeResponseData = withdrawModeResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } } @@ -4100,7 +3903,8 @@ mainGateway.Actions += action; System.Console.WriteLine("Security/WithdrawMode_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ + try + { var jObject = new Newtonsoft.Json.Linq.JObject() { { "Cluster_ID", 0 }, { "Command", 4013} @@ -4113,8 +3917,8 @@ mainGateway.Send("Security/WithdrawMode", jObject.ToString()); } - catch {} - + catch { } + var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { @@ -4143,23 +3947,14 @@ /// 鎾ら槻杩斿洖鐨勬暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class WithdrawModeResponseAllData + public class WithdrawModeResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鎾ら槻杩斿洖鐨勬暟鎹� /// </summary> public WithdrawModeResponseData withdrawModeResponseData; - } + } /// <summary> /// 鎾ら槻杩斿洖鐨勬暟鎹� @@ -4177,7 +3972,7 @@ ///<para>2锛氭挙闃插け璐ワ紝瀵嗙爜閿欒銆�</para> ///<para>3锛氭挙闃插け璐ワ紝妯″紡涓嶅彲鎾ら槻銆傦紙鏂板缓妯″紡鏃讹紝妯″紡灞炴�ц涓轰笉鍙挙闃插垯甯冮槻鍚庡皢涓嶈兘鎾ら槻锛�</para> /// </summary> - public int Result=999; + public int Result = 999; /// <summary> /// 琚挙闃茬殑妯″紡 @@ -4207,7 +4002,7 @@ { RemoveModeResponseAllData d = null; var mainGateway = ZbGateway.MainGateWay; - if (mainGateway == null) + if (mainGateway == null) { d = new RemoveModeResponseAllData { errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" }; return d; @@ -4220,8 +4015,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -4235,8 +4029,7 @@ if (topic == gatewayID + "/" + "Security/Error_Respon") { - var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new RemoveModeResponseAllData { }; if (temp == null) { @@ -4253,29 +4046,29 @@ d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��"; } System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); - d.errorResponData = temp; + d.errorResponData = temp; } } if (topic == gatewayID + "/" + "Security/RemoveMode_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - security.removeModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveModeResponseData>(jobject["Data"].ToString()); - if (security.removeModeResponseData == null) + var removeModeResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveModeResponseData>(jobject["Data"].ToString()); + if (removeModeResponseData == null) { d = new RemoveModeResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new RemoveModeResponseAllData { removeModeResponseData = security.removeModeResponseData }; - System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); + d = new RemoveModeResponseAllData { removeModeResponseData = removeModeResponseData }; + System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } } }; mainGateway.Actions += action; System.Console.WriteLine("Security/RemoveMode_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ + try + { var jObject = new Newtonsoft.Json.Linq.JObject() { { "Cluster_ID", 0 }, { "Command", 4014} @@ -4288,8 +4081,8 @@ mainGateway.Send("Security/RemoveMode", jObject.ToString()); } - catch {} - + catch { } + var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { @@ -4318,17 +4111,8 @@ /// 鍒犻櫎甯冮槻妯″紡杩斿洖鐨勬暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class RemoveModeResponseAllData + public class RemoveModeResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鍒犻櫎甯冮槻妯″紡杩斿洖鐨勬暟鎹� /// </summary> @@ -4352,7 +4136,7 @@ ///<para>1锛氬け璐ワ紝涓嶅瓨鍦ㄨ甯冮槻妯″紡銆�</para> ///<para>2锛氬垹闄ゅけ璐ワ紝涓嶅厑璁稿垹闄ゃ�傦紙褰揗odeId涓�1鎴�2鏃讹紝绂诲甯冮槻鍜屽湪瀹跺竷闃叉ā寮忎笉鍏佽鍒犻櫎锛�</para> /// </summary> - public int Result=999; + public int Result = 999; /// <summary> /// 妯″紡id @@ -4365,152 +4149,6 @@ /// <summary>鈥� /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇�傗�� /// </summary>鈥� public string LoginToken;鈥� } #endregion - - //#region 鍒犻櫎闃插尯. - /////<summary > - ///// 鍒犻櫎闃插尯.(浠呯敤浜庝富缃戝叧鎺ュ彛锛�. - ///// </summary> - //public static async System.Threading.Tasks.Task<RemoveZoneResponseAllData> RemoveZoneAsync(int zoneId) - //{ - // return await System.Threading.Tasks.Task.Run(async () => - // { - // var d = new RemoveZoneResponseAllData { }; - // if (ZbGateway.MainGateWay == null) - // { - // d.errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�"; - // return d; - // } - - // Action<string, string> action = (topic, message) => - // { - // var gatewayID = topic.Split('/')[0]; - // var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); - - // if (topic == gatewayID + "/" + "Error_Respon") - // { - // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID }; - // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); - - // if (temp == null) - // { - // d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖"; - // } - // else - // { - // d.errorResponData = temp; - // d.errorMessageBase = ErrorMess(temp.Error); - // } - // } - - // if (topic == gatewayID + "/" + "Security/RemoveZone_Respon") - // { - // var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = ZbGateway.MainGateWay.CurrentGateWayId }; - // var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); - // if (result == 0) - // { - // security.removeZoneResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveZoneResponseData>(jobject["Data"].ToString()); - // if (security.removeZoneResponseData != null) - // { - // d.removeZoneResponseData = security.removeZoneResponseData; - // System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); - // } - // } - // else - // { - // var r = new RemoveZoneResponseData(); - // r.Result = result; - // d.removeZoneResponseData = r; - // System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); - // } - // } - // }; - // ZbGateway.MainGateWay.Actions += action; - // System.Console.WriteLine("Security/RemoveZone_Actions 鍚姩" + System.DateTime.Now.ToString()); - - // var jObject = new Newtonsoft.Json.Linq.JObject() { - // { "Cluster_ID", 0 }, - // { "Command", 4015} - // }; - // var data = new JObject - // { - // { "ZoneId", zoneId} - // }; - // jObject.Add("Data", data); - // ZbGateway.MainGateWay?.Send("Security/RemoveZone", jObject.ToString()); - - // var dateTime = DateTime.Now; - // while ((DateTime.Now - dateTime).TotalMilliseconds < 1000) - // { - // await System.Threading.Tasks.Task.Delay(10); - // if (d.removeZoneResponseData != null) - // { - // break; - // } - // } - // if ((DateTime.Now - dateTime).TotalMilliseconds > 10000) - // { - // d.errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔"; - // } - // ZbGateway.MainGateWay.Actions -= action; - // System.Console.WriteLine("Security/RemoveZone_Actions 閫�鍑�" + System.DateTime.Now.ToString()); - - // return d; - // }); - //} - - ///// <summary> - ///// 鍒犻櫎闃插尯,缃戝叧鍙嶉淇℃伅 - ///// </summary> - //public RemoveZoneResponseAllData removeZoneResponseAllData; - ///// <summary> - ///// 鍒犻櫎闃插尯,缃戝叧鍙嶉淇℃伅 - ///// </summary> - //[System.Serializable] - //public class RemoveZoneResponseAllData - //{ - // /// <summary> - // /// 閿欒淇℃伅 - // /// </summary> - // public string errorMessageBase; - // /// <summary> - // /// 缃戝叧淇℃伅閿欒鍙嶉 - // /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - // /// </summary> - // public ErrorResponData errorResponData; - // /// <summary> - // /// 鍒犻櫎闃插尯杩斿洖鐨勬暟鎹� - // /// </summary> - // public RemoveZoneResponseData removeZoneResponseData; - - //} - - - ///// <summary> - ///// 鍒犻櫎闃插尯杩斿洖鐨勬暟鎹� - ///// </summary> - //public RemoveZoneResponseData removeZoneResponseData; - ///// <summary> - ///// 鍒犻櫎闃插尯杩斿洖鐨勬暟鎹� - ///// </summary> - //[System.Serializable] - //public class RemoveZoneResponseData - //{ - // /// <summary> - // /// 0锛氬垹闄ゆ垚鍔熴�� - // ///<para>1锛氬け璐ワ紝闃插尯涓嶅瓨鍦ㄣ��</para> - // /// </summary> - // public int Result = 999; - - // /// <summary> - // /// 闃插尯id - // /// </summary> - // public int ZoneId; - // /// <summary> - // /// 闃插尯鍚嶇О锛屽綋Result=0鏃跺瓨鍦ㄣ�� - // /// </summary> - // public string ZoneName; - //} - //#endregion #region *14灏嗚澶囦粠闃插尯涓Щ闄�. /// <summary> @@ -4536,8 +4174,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -4551,8 +4188,7 @@ if (topic == gatewayID + "/" + "Security/Error_Respon") { - var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new RemoveDeviceToZoneAllData { }; if (temp == null) @@ -4570,20 +4206,19 @@ d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��"; } System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); - d.errorResponData = temp; + d.errorResponData = temp; } } if (topic == gatewayID + "/" + "Security/RemoveEqToZone_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); if (result == 0) { - security.removeDeviceToZoneResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveDeviceToZoneResponseData>(jobject["Data"].ToString()); - if (security.removeDeviceToZoneResponseData != null) + var removeDeviceToZoneResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveDeviceToZoneResponseData>(jobject["Data"].ToString()); + if (removeDeviceToZoneResponseData != null) { - d = new RemoveDeviceToZoneAllData { removeDeviceToZoneResponseData = security.removeDeviceToZoneResponseData }; + d = new RemoveDeviceToZoneAllData { removeDeviceToZoneResponseData = removeDeviceToZoneResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } } @@ -4600,7 +4235,8 @@ mainGateway.Actions += action; System.Console.WriteLine($"Security/RemoveEqToZone_Actions鍚姩_{System.DateTime.Now.ToString()}"); - try{ + try + { if (removeEqToZoneData != null) { var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4016 } }; @@ -4623,7 +4259,7 @@ mainGateway.Send(("Security/RemoveEqToZone_Actions 鍚姩"), jObject.ToString()); } } - catch{} + catch { } var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) @@ -4634,9 +4270,9 @@ break; } } - if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime ) + if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) { - d = new RemoveDeviceToZoneAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; + d = new RemoveDeviceToZoneAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; } mainGateway.Actions -= action; @@ -4653,17 +4289,8 @@ /// 灏嗚澶囦粠闃插尯涓Щ闄ょ殑杩斿洖鏁版嵁,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class RemoveDeviceToZoneAllData + public class RemoveDeviceToZoneAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 灏嗚澶囦粠闃插尯涓Щ闄ょ殑杩斿洖鏁版嵁 /// </summary> @@ -4686,7 +4313,7 @@ /// <para>1锛氭坊鍔犲け璐ャ�傦紙灞�閮ㄥ竷闃插垪琛╥d涓嶅瓨鍦級</para> /// </summary> public int Result = 999; - + /// <summary> /// 瀹夐槻璁惧鍒楄〃(Result=0鏃跺瓨鍦�) /// </summary> @@ -4776,7 +4403,7 @@ // if (topic == gatewayID + "/" + "Error_Respon") // { // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID }; - // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); // if (temp == null) // { @@ -4948,8 +4575,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -4962,14 +4588,13 @@ } if (topic == gatewayID + "/" + "Security/GetZoneDeviceListById_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); if (result == 0) { - security.getZoneDeviceListByIdResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<GetZoneDeviceListByIdResponData>(jobject["Data"].ToString()); - if (security.getZoneDeviceListByIdResponData != null) + var getZoneDeviceListByIdResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<GetZoneDeviceListByIdResponData>(jobject["Data"].ToString()); + if (getZoneDeviceListByIdResponData != null) { - d = new GetZoneDeviceListByIdResponAllData { getZoneDeviceListByIdResponData = security.getZoneDeviceListByIdResponData }; + d = new GetZoneDeviceListByIdResponAllData { getZoneDeviceListByIdResponData = getZoneDeviceListByIdResponData }; } System.Console.WriteLine($"UI宸叉敹鍒伴�氱煡鐨勪富棰榑{topic}"); } @@ -4995,7 +4620,7 @@ jObject.Add("Data", data); mainGateway.Send("Security/GetZoneDeviceListById", jObject.ToString()); } - catch { } + catch { } var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) @@ -5008,7 +4633,7 @@ } if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) { - d = new GetZoneDeviceListByIdResponAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; + d = new GetZoneDeviceListByIdResponAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; } mainGateway.Actions -= action; System.Console.WriteLine("Security/GetZoneDeviceListById_Actions 閫�鍑�" + System.DateTime.Now.ToString()); @@ -5025,17 +4650,8 @@ /// 閫氳繃甯冮槻妯″紡ID鏌ョ湅妯″紡淇℃伅鐨勬暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class GetZoneDeviceListByIdResponAllData + public class GetZoneDeviceListByIdResponAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 閫氳繃甯冮槻妯″紡ID鏌ョ湅妯″紡淇℃伅杩斿洖鐨勬暟鎹� /// </summary> @@ -5116,7 +4732,7 @@ ///<para>0锛氫笉鏃佽矾</para> ///<para>1锛氭梺璺�</para> /// </summary> - public int IsBypass=999; + public int IsBypass = 999; } #endregion @@ -5132,7 +4748,7 @@ ///<para>4锛氭挙闃插け璐ユ寚绀哄姩浣�</para> ///<para>loginToken:鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇��</para> ///</summary> - public static async System.Threading.Tasks.Task<ActionTestResponseAllData> ActionTestAsync(int modeId, int actionType,string loginToken) + public static async System.Threading.Tasks.Task<ActionTestResponseAllData> ActionTestAsync(int modeId, int actionType, string loginToken) { return await System.Threading.Tasks.Task.Run(async () => { @@ -5151,8 +4767,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -5161,13 +4776,13 @@ else { d = new ActionTestResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; - } + } } if (topic == gatewayID + "/" + "Security/Error_Respon") { var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new ActionTestResponseAllData { }; if (temp == null) { @@ -5184,17 +4799,16 @@ d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��"; } System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); - d.errorResponData = temp; + d.errorResponData = temp; } } if (topic == gatewayID + "/" + "Security/ActionTest_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - security.actionTestResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ActionTestResponseData>(jobject["Data"].ToString()); - if (security.actionTestResponseData != null) + var actionTestResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ActionTestResponseData>(jobject["Data"].ToString()); + if (actionTestResponseData != null) { - d = new ActionTestResponseAllData { actionTestResponseData = security.actionTestResponseData }; + d = new ActionTestResponseAllData { actionTestResponseData = actionTestResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } @@ -5208,7 +4822,8 @@ mainGateway.Actions += action; System.Console.WriteLine("Security/ActionTest_Actions 鍚姩" + System.DateTime.Now.ToString()); - try{ + try + { var jObject = new Newtonsoft.Json.Linq.JObject() { { "Cluster_ID", 0 }, { "Command", 4027} @@ -5222,8 +4837,8 @@ jObject.Add("Data", data); mainGateway.Send("Security/ActionTest", jObject.ToString()); } - catch {} - + catch { } + var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { @@ -5252,17 +4867,8 @@ /// 鎵ц瀹夐槻妯″紡鍔ㄤ綔杩斿洖鐨勬暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class ActionTestResponseAllData + public class ActionTestResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鎵ц瀹夐槻妯″紡鍔ㄤ綔杩斿洖鐨勬暟鎹� /// </summary> @@ -5401,7 +5007,7 @@ /// 鎶ヨ鏃舵渶鍚庤婵�娲荤殑闃插尯 /// </summary> public int ZoneId; - + /// <summary> /// 鏄惁涓哄己杩瘑鐮佹挙闃茶Е鍙戦潤闊抽槻鍖� ///<para>0锛氫笉鏄�</para> @@ -5429,8 +5035,8 @@ /// <summary> /// 淇℃伅鎺ㄩ�佺洰鏍� /// </summary> - public List<PushTargetInfo> PushTarget=new List<PushTargetInfo>(); - + public List<PushTargetInfo> PushTarget = new List<PushTargetInfo>(); + } #endregion @@ -5490,23 +5096,21 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) - { + { d = new EqByPassAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; - } + } else - { - d = new EqByPassAllData { errorMessageBase = ErrorMess(temp.Error) , errorResponData = temp }; - } + { + d = new EqByPassAllData { errorMessageBase = ErrorMess(temp.Error), errorResponData = temp }; + } } if (topic == gatewayID + "/" + "Security/Error_Respon") { - var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new EqByPassAllData { }; if (temp == null) { @@ -5523,21 +5127,20 @@ d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��"; } System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); - d.errorResponData = temp; + d.errorResponData = temp; } } if (topic == gatewayID + "/" + "Security/EqByPass_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); if (result == 0) { - security.eqByPassResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<EqByPassResponseData>(jobject["Data"].ToString()); - if (security.eqByPassResponseData != null) + var eqByPassResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<EqByPassResponseData>(jobject["Data"].ToString()); + if (eqByPassResponseData != null) { - d = new EqByPassAllData { eqByPassResponseData = security.eqByPassResponseData }; - System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); + d = new EqByPassAllData { eqByPassResponseData = eqByPassResponseData }; + System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } } else @@ -5545,7 +5148,7 @@ var r = new EqByPassResponseData(); r.Result = result; d = new EqByPassAllData { eqByPassResponseData = r }; - + System.Console.WriteLine("宸叉敹鍒伴�氱煡杩斿洖"); } } @@ -5553,7 +5156,8 @@ mainGateway.Actions += action; System.Console.WriteLine($"Security/EqByPass_Actions鍚姩_{System.DateTime.Now.ToString()}"); - try{ + try + { if (eqByPassData != null) { var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4029 } }; @@ -5570,8 +5174,8 @@ mainGateway.Send(("Security/EqByPass"), jObject.ToString()); } } - catch{} - + catch { } + var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { @@ -5583,7 +5187,7 @@ } if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) { - d = new EqByPassAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; + d = new EqByPassAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; } mainGateway.Actions -= action; @@ -5600,17 +5204,8 @@ /// 瀵归槻鍖哄畨闃茶澶囪繘琛屾梺璺垨鎾ら攢鏃佽矾鐨勮繑鍥炴暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class EqByPassAllData + public class EqByPassAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 瀵归槻鍖哄畨闃茶澶囪繘琛屾梺璺垨鎾ら攢鏃佽矾鐨勮繑鍥炴暟鎹� /// </summary> @@ -5659,7 +5254,7 @@ /// </summary> public int IsByPass; - } + } /// <summary> /// 瀵归槻鍖哄畨闃茶澶囪繘琛屾梺璺垨鎾ら攢鏃佽矾鐨勬暟鎹� @@ -5693,7 +5288,7 @@ /// 0锛氫笉鏃佽矾 ///<para>1锛氭梺璺澶�</para> /// </summary> - public int IsByPass=999; + public int IsByPass = 999; /// <summary>鈥� /// 鐧婚檰鏍囪瘑锛屾渶澶�32涓瓧绗︺�傜敱app鑷姩鐢熸垚鐨勫敮涓�鏍囪瘑銆備笌绠$悊鍛樼櫥闄嗘寚浠ょ殑鈥淟oginToken鈥濅竴鑷达紝鍚﹀垯灏嗚繑鍥炩�淪ecurity/Error_Respon鈥濋敊璇�傗�� /// </summary>鈥� public string LoginToken; } #endregion @@ -5710,9 +5305,9 @@ var mainGateway = ZbGateway.MainGateWay; if (mainGateway == null) - { + { d = new AddZoneActionAllData { errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" }; - return d; + return d; } Action<string, string> action = (topic, message) => { @@ -5721,8 +5316,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -5736,41 +5330,41 @@ if (topic == gatewayID + "/" + "Security/Error_Respon") { - var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new AddZoneActionAllData { }; if (temp == null) { - d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" ; + d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖"; } else { if (temp.Error == 1) { - d.errorMessageBase = "缃戝叧涓嶆槸涓荤綉鍏筹紝鏃犳硶杩涜璇ユ搷浣溿��" ; + d.errorMessageBase = "缃戝叧涓嶆槸涓荤綉鍏筹紝鏃犳硶杩涜璇ユ搷浣溿��"; } else if (temp.Error == 2) { - d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��" ; + d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��"; } System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); - d.errorResponData = temp ; + d.errorResponData = temp; } } if (topic == gatewayID + "/" + "Security/AddZoneAction_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - security.addZoneActionResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddZoneActionResponseData>(jobject["Data"].ToString()); - if (security.addZoneActionResponseData != null) + var addZoneActionResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddZoneActionResponseData>(jobject["Data"].ToString()); + if (addZoneActionResponseData != null) { - d = new AddZoneActionAllData { addZoneActionResponseData = security.addZoneActionResponseData }; - System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); - }else{ + d = new AddZoneActionAllData { addZoneActionResponseData = addZoneActionResponseData }; + System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); + } + else + { d = new AddZoneActionAllData { errorMessageBase = "缃戝叧鍥炲鏁版嵁鏄┖" }; - } - } + } + } }; mainGateway.Actions += action; System.Console.WriteLine($"Security/AddZoneAction_Actions鍚姩_{System.DateTime.Now.ToString()}"); @@ -5822,7 +5416,8 @@ jObject.Add("Data", data); mainGateway.Send(("Security/AddZoneAction"), jObject.ToString()); } - }catch{} + } + catch { } var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) { @@ -5835,7 +5430,7 @@ if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) { d = new AddZoneActionAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; - + } mainGateway.Actions -= action; @@ -5852,17 +5447,8 @@ /// 娣诲姞闃插尯鎶ヨ鐩爣鐨勮繑鍥炴暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class AddZoneActionAllData + public class AddZoneActionAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 娣诲姞闃插尯鎶ヨ鐩爣鐨勮繑鍥炴暟鎹� /// </summary> @@ -5941,8 +5527,8 @@ /// <summary> /// 璁惧鎴栧満鏅悕绉帮紝Status = 0鏃跺瓨鍦� /// </summary> - public string ESName; - } + public string ESName; + } /// <summary> /// 娣诲姞闃插尯鎶ヨ鐩爣鐨勬暟鎹� @@ -6001,8 +5587,8 @@ /// <summary> /// 鍦烘櫙ID 銆傚綋Type=1鏃跺瓨鍦� /// </summary> - public int ScenesId; - } + public int ScenesId; + } #endregion @@ -6028,8 +5614,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -6043,18 +5628,17 @@ if (topic == gatewayID + "/" + "Security/Error_Respon") { - var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new DelZoneActionResposeAllData { }; if (temp == null) { - d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖"; + d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖"; } else { if (temp.Error == 1) { - d .errorMessageBase = "缃戝叧涓嶆槸涓荤綉鍏筹紝鏃犳硶杩涜璇ユ搷浣溿��" ; + d.errorMessageBase = "缃戝叧涓嶆槸涓荤綉鍏筹紝鏃犳硶杩涜璇ユ搷浣溿��"; } else if (temp.Error == 2) { @@ -6068,11 +5652,10 @@ if (topic == gatewayID + "/" + "Security/DelZoneAction_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - security.delZoneActionResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelZoneActionResponseData>(jobject["Data"].ToString()); - if (security.delZoneActionResponseData != null) + var delZoneActionResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelZoneActionResponseData>(jobject["Data"].ToString()); + if (delZoneActionResponseData != null) { - d = new DelZoneActionResposeAllData { delZoneActionResponseData = security.delZoneActionResponseData }; + d = new DelZoneActionResposeAllData { delZoneActionResponseData = delZoneActionResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } else @@ -6119,7 +5702,8 @@ jObject.Add("Data", data); mainGateway.Send(("Security/DelZoneAction"), jObject.ToString()); } - }catch{} + } + catch { } var dateTime = DateTime.Now; while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) @@ -6149,17 +5733,8 @@ /// 鍒犻櫎闃插尯鎶ヨ鐩爣鐨勮繑鍥炴暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class DelZoneActionResposeAllData + public class DelZoneActionResposeAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鍒犻櫎闃插尯鎶ヨ鐩爣鐨勮繑鍥炴暟鎹� /// </summary> @@ -6211,7 +5786,7 @@ /// 鍔ㄤ綔绫诲瀷 ///<para>0锛氳妭鐐硅澶囧姩浣�</para> ///<para>1锛氭墦寮�鍦烘櫙</para> - /// </summary> + /// </summary> public string Type; /// <summary> /// 璁惧mac鍦板潃 锛� @@ -6223,13 +5798,13 @@ /// 璁惧绔彛鍙� ///<para>璁惧绔彛鍙� 鍜宮ac鍦板潃鍏卞悓鏍囪瘑鍞竴鐨剒igbee璁惧 鏁板�艰寖鍥�0-255銆� 褰揟ype=0鏃跺瓨鍦ㄣ��</para> /// </summary> - public int Epoint; + public int Epoint; /// <summary> /// 鍦烘櫙ID 銆傚綋Type=1鏃跺瓨鍦� /// </summary> - public int ScenesId; - } + public int ScenesId; + } /// <summary> /// 鍒犻櫎闃插尯鎶ヨ鐩爣鐨勬暟鎹� @@ -6277,13 +5852,13 @@ /// 璁惧绔彛鍙� ///<para>璁惧绔彛鍙� 鍜宮ac鍦板潃鍏卞悓鏍囪瘑鍞竴鐨剒igbee璁惧 鏁板�艰寖鍥�0-255銆� 褰揟ype=0鏃跺瓨鍦ㄣ��</para> /// </summary> - public int Epoint; + public int Epoint; /// <summary> /// 鍦烘櫙ID 銆傚綋Type=1鏃跺瓨鍦� /// </summary> - public int ScenesId; - } + public int ScenesId; + } #endregion #region 29鏌ョ湅闃插尯鎶ヨ鐩爣; @@ -6311,8 +5886,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateWay.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -6326,11 +5900,10 @@ if (topic == gatewayID + "/" + "Security/CatZoneAction_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateWay.CurrentGateWayId }; - security.catZoneActionResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CatZoneActionResponseData>(jobject["Data"].ToString()); - if (security.catZoneActionResponseData != null) + var catZoneActionResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CatZoneActionResponseData>(jobject["Data"].ToString()); + if (catZoneActionResponseData != null) { - d = new CatZoneActionResposeAllData { catZoneActionResponseData = security.catZoneActionResponseData }; + d = new CatZoneActionResposeAllData { catZoneActionResponseData = catZoneActionResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } else @@ -6341,17 +5914,18 @@ }; mainGateWay.Actions += action; System.Console.WriteLine($"Security/CatZoneAction_Actions鍚姩_{System.DateTime.Now.ToString()}"); - try{ - var jObject = new Newtonsoft.Json.Linq.JObject() { + try + { + var jObject = new Newtonsoft.Json.Linq.JObject() { { "Cluster_ID", 0 }, { "Command", 4032 } }; - var data = new JObject + var data = new JObject { { "ActionType", actionType } }; - jObject.Add("Data", data); - mainGateWay.Send("Security/CatZoneAction", jObject.ToString()); + jObject.Add("Data", data); + mainGateWay.Send("Security/CatZoneAction", jObject.ToString()); } catch { } @@ -6383,17 +5957,8 @@ /// 鏌ョ湅闃插尯鎶ヨ鐩爣鐨勮繑鍥炴暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class CatZoneActionResposeAllData + public class CatZoneActionResposeAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鏌ョ湅闃插尯鎶ヨ鐩爣鐨勮繑鍥炴暟鎹� /// </summary> @@ -6449,7 +6014,7 @@ /// 鍔ㄤ綔绫诲瀷 ///<para>0锛氳妭鐐硅澶囧姩浣�</para> ///<para>1锛氭墦寮�鍦烘櫙</para> - /// </summary> + /// </summary> public int Type; /// <summary> /// 璁惧mac鍦板潃 锛� @@ -6478,7 +6043,7 @@ /// 璁惧鎴栧満鏅悕绉�(褰揟ype=0 鎴朤ype=1鏃跺瓨鍦ㄣ��) /// </summary> public string ESName; - } + } #endregion @@ -6504,8 +6069,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -6519,36 +6083,34 @@ if (topic == gatewayID + "/" + "Security/Error_Respon") { - var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new SetCoercePhoneNumberAllResponseData { }; if (temp == null) { - d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" ; + d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖"; } else { if (temp.Error == 1) { - d.errorMessageBase = "缃戝叧涓嶆槸涓荤綉鍏筹紝鏃犳硶杩涜璇ユ搷浣溿��" ; + d.errorMessageBase = "缃戝叧涓嶆槸涓荤綉鍏筹紝鏃犳硶杩涜璇ユ搷浣溿��"; } else if (temp.Error == 2) { - d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��" ; + d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��"; } System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); - d.errorResponData = temp ; + d.errorResponData = temp; } } if (topic == gatewayID + "/" + "Security/AddZoneAction_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - security.setCoercePhoneNumberResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetCoercePhoneNumberResponseData>(jobject["Data"].ToString()); - if (security.setCoercePhoneNumberResponseData != null) + var setCoercePhoneNumberResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetCoercePhoneNumberResponseData>(jobject["Data"].ToString()); + if (setCoercePhoneNumberResponseData != null) { - d = new SetCoercePhoneNumberAllResponseData { setCoercePhoneNumberResponseData = security.setCoercePhoneNumberResponseData }; + d = new SetCoercePhoneNumberAllResponseData { setCoercePhoneNumberResponseData = setCoercePhoneNumberResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } else @@ -6559,39 +6121,40 @@ }; mainGateway.Actions += action; System.Console.WriteLine($"Security/AddZoneAction(璁剧疆鑳佽揩鐘舵�佷笅鐨勭數璇濆彿鐮侊級_Actions鍚姩_{System.DateTime.Now.ToString()}"); - try{ - if (setCoercePhoneNumberData != null) + try { - var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4030 } }; - var actionsList = new JArray { }; - foreach (var act in setCoercePhoneNumberData.Actions) - { - if (act.Type == 2) + if (setCoercePhoneNumberData != null) + { + var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4030 } }; + var actionsList = new JArray { }; + foreach (var act in setCoercePhoneNumberData.Actions) { - var pushTargetList = new JArray { }; - foreach (var pushInfo in act.PushTarget) + if (act.Type == 2) { - var pInfo = new JObject{ + var pushTargetList = new JArray { }; + foreach (var pushInfo in act.PushTarget) + { + var pInfo = new JObject{ { "PushNumber", pushInfo.PushNumber} }; - pushTargetList.Add(pInfo); - } - var c = new JObject { + pushTargetList.Add(pInfo); + } + var c = new JObject { { "Type",act.Type}, { "PushTarget", pushTargetList} }; - actionsList.Add(c); + actionsList.Add(c); + } } - } - var data = new JObject + var data = new JObject { { "ActionType", 253}, { "Actions", actionsList}, { "LoginToken", setCoercePhoneNumberData.LoginToken} }; - jObject.Add("Data", data); - mainGateway.Send(("Security/AddZoneAction"), jObject.ToString()); - } + jObject.Add("Data", data); + mainGateway.Send(("Security/AddZoneAction"), jObject.ToString()); + } } catch { } var dateTime = DateTime.Now; @@ -6621,7 +6184,7 @@ /// <param name="strPhone">鍦板尯鐮�-鑱旂郴鏂瑰紡</param> /// <param name="strNote">澶囨敞,鏈�澶�63byte</param> /// <returns></returns> - public static async System.Threading.Tasks.Task<SetCoercePhoneNumberResponseData> SetCoercePhoneNumberNoteAsync(string strPhone,string strNote) + public static async System.Threading.Tasks.Task<SetCoercePhoneNumberResponseData> SetCoercePhoneNumberNoteAsync(string strPhone, string strNote) { SetCoercePhoneNumberResponseData d = null; var mainGateway = ZbGateway.MainGateWay; @@ -6681,17 +6244,8 @@ /// 璁剧疆鑳佽揩鐘舵�佷笅琚�氱煡鐨勮仈绯诲彿鐮佺殑杩斿洖鏁版嵁,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class SetCoercePhoneNumberAllResponseData + public class SetCoercePhoneNumberAllResponseData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 璁剧疆鑳佽揩鐘舵�佷笅琚�氱煡鐨勮仈绯诲彿鐮佺殑杩斿洖鏁版嵁 /// </summary> @@ -6711,7 +6265,7 @@ /// <summary> /// 杩斿洖缁撴灉 /// <para>0锛氶粯璁�</para> - /// </summary> + /// </summary> public int Result = 999; /// <summary> @@ -6730,13 +6284,13 @@ /// </summary> [System.Serializable] public class PushTargetActionResponseObj - { + { /// <summary> /// 鍔ㄤ綔绫诲瀷 ///<para>2锛氫俊鎭帹閫�</para> /// </summary> public string Type; - + /// <summary> /// 淇℃伅鎺ㄩ�佺洰鏍�,褰揟ype=2鏃跺瓨鍦ㄣ�� /// </summary> @@ -6795,7 +6349,7 @@ ///<para>2锛氫俊鎭帹閫�</para> /// </summary> public int Type; - + /// <summary> /// 淇℃伅鎺ㄩ�佺洰鏍�,褰揟ype=2鏃跺瓨鍦ㄣ�� /// </summary> @@ -6825,8 +6379,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -6840,36 +6393,34 @@ if (topic == gatewayID + "/" + "Security/Error_Respon") { - var securityTemp = new Safeguard() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); d = new DelCoercePhoneNumberAllResponseData { }; if (temp == null) { - d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" ; + d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖"; } else { if (temp.Error == 1) { - d .errorMessageBase = "缃戝叧涓嶆槸涓荤綉鍏筹紝鏃犳硶杩涜璇ユ搷浣溿��" ; + d.errorMessageBase = "缃戝叧涓嶆槸涓荤綉鍏筹紝鏃犳硶杩涜璇ユ搷浣溿��"; } else if (temp.Error == 2) { - d. errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��" ; + d.errorMessageBase = "璇ユ搷浣滈渶瑕佸畨闃茬鐞嗗憳鏉冮檺锛岄渶鍏堜互绠$悊鍛樿韩浠借繘琛岀櫥闄嗐��"; } System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); - d.errorResponData = temp ; + d.errorResponData = temp; } } if (topic == gatewayID + "/" + "Security/DelZoneAction_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - security.delCoercePhoneNumberResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelCoercePhoneNumberResponseData>(jobject["Data"].ToString()); - if (security.delCoercePhoneNumberResponseData != null) + var delCoercePhoneNumberResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DelCoercePhoneNumberResponseData>(jobject["Data"].ToString()); + if (delCoercePhoneNumberResponseData != null) { - d = new DelCoercePhoneNumberAllResponseData { delCoercePhoneNumberResponseData = security.delCoercePhoneNumberResponseData }; + d = new DelCoercePhoneNumberAllResponseData { delCoercePhoneNumberResponseData = delCoercePhoneNumberResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } else @@ -6880,39 +6431,40 @@ }; mainGateway.Actions += action; System.Console.WriteLine($"Security/AddZoneAction(鍒犻櫎鑳佽揩鐘舵�佷笅鐨勭數璇濆彿鐮侊級_Actions鍚姩_{System.DateTime.Now.ToString()}"); - try{ - if (delCoercePhoneNumberData != null) + try { - var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4031 } }; - var actionsList = new JArray { }; - foreach (var act in delCoercePhoneNumberData.Actions) + if (delCoercePhoneNumberData != null) { - if (act.Type == 2) + var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4031 } }; + var actionsList = new JArray { }; + foreach (var act in delCoercePhoneNumberData.Actions) { - var pushTargetList = new JArray { }; - foreach (var pushInfo in act.PushTarget) + if (act.Type == 2) { - var pInfo = new JObject{ + var pushTargetList = new JArray { }; + foreach (var pushInfo in act.PushTarget) + { + var pInfo = new JObject{ { "PushNumber", pushInfo.PushNumber} }; - pushTargetList.Add(pInfo); - } - var c = new JObject { + pushTargetList.Add(pInfo); + } + var c = new JObject { { "Type",act.Type}, { "PushTarget", pushTargetList} }; - actionsList.Add(c); + actionsList.Add(c); + } } - } - var data = new JObject + var data = new JObject { { "ActionType", 253}, { "Actions", actionsList}, { "LoginToken", delCoercePhoneNumberData.LoginToken} }; - jObject.Add("Data", data); - mainGateway.Send(("Security/DelZoneAction"), jObject.ToString()); - } + jObject.Add("Data", data); + mainGateway.Send(("Security/DelZoneAction"), jObject.ToString()); + } } catch { } var dateTime = DateTime.Now; @@ -6944,17 +6496,8 @@ /// 鍒犻櫎鑳佽揩鐘舵�佷笅琚�氱煡鐨勮仈绯诲彿鐮佺殑杩斿洖鏁版嵁,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class DelCoercePhoneNumberAllResponseData + public class DelCoercePhoneNumberAllResponseData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鍒犻櫎鑳佽揩鐘舵�佷笅琚�氱煡鐨勮仈绯诲彿鐮佺殑杩斿洖鏁版嵁 /// </summary> @@ -6986,7 +6529,7 @@ /// </summary> public List<PushTargetActionResponseObj> Actions = new List<PushTargetActionResponseObj>(); - } + } /// <summary> /// 鍒犻櫎鑳佽揩鐘舵�佷笅琚�氱煡鐨勮仈绯诲彿鐮佺殑鏁版嵁 /// </summary> @@ -7034,8 +6577,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -7049,11 +6591,10 @@ if (topic == gatewayID + "/" + "Security/CatZoneAction_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - security.checkCoercePhoneNumberResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CheckCoercePhoneNumberResponseData>(jobject["Data"].ToString()); - if (security.checkCoercePhoneNumberResponseData != null) + var checkCoercePhoneNumberResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CheckCoercePhoneNumberResponseData>(jobject["Data"].ToString()); + if (checkCoercePhoneNumberResponseData != null) { - d = new CheckCoercePhoneNumberAllResponseData { checkCoercePhoneNumberResponseData = security.checkCoercePhoneNumberResponseData }; + d = new CheckCoercePhoneNumberAllResponseData { checkCoercePhoneNumberResponseData = checkCoercePhoneNumberResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } else @@ -7064,15 +6605,16 @@ }; mainGateway.Actions += action; System.Console.WriteLine($"Security/CatZoneAction(鏌ョ湅鑳佽揩鐘舵�佷笅鐨勭數璇濆彿鐮侊級_Actions鍚姩_{System.DateTime.Now.ToString()}"); - try{ - var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4032 } }; - var actionsList = new JArray { }; - var data = new JObject + try + { + var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 4032 } }; + var actionsList = new JArray { }; + var data = new JObject { { "ActionType", actionType } }; - jObject.Add("Data", data); - mainGateway.Send(("Security/CatZoneAction"), jObject.ToString()); + jObject.Add("Data", data); + mainGateway.Send(("Security/CatZoneAction"), jObject.ToString()); } catch { } @@ -7105,17 +6647,8 @@ /// 鏌ョ湅鑳佽揩鐘舵�佷笅琚�氱煡鐨勮仈绯诲彿鐮佺殑杩斿洖鏁版嵁,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class CheckCoercePhoneNumberAllResponseData + public class CheckCoercePhoneNumberAllResponseData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鏌ョ湅鑳佽揩鐘舵�佷笅琚�氱煡鐨勮仈绯诲彿鐮佺殑杩斿洖鏁版嵁 /// </summary> @@ -7207,8 +6740,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -7222,11 +6754,10 @@ if (topic == gatewayID + "/" + "Security/DisablePushMessage_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - security.disablePushMessageResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DisablePushMessageResponseData>(jobject["Data"].ToString()); - if (security.disablePushMessageResponseData != null) + var disablePushMessageResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<DisablePushMessageResponseData>(jobject["Data"].ToString()); + if (disablePushMessageResponseData != null) { - d = new DisablePushMessageResposeAllData { disablePushMessageResponseData = security.disablePushMessageResponseData }; + d = new DisablePushMessageResposeAllData { disablePushMessageResponseData = disablePushMessageResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } else @@ -7237,18 +6768,19 @@ }; mainGateway.Actions += action; System.Console.WriteLine($"Security/DisablePushMessage_Actions鍚姩_{System.DateTime.Now.ToString()}"); - try{ - var jObject = new Newtonsoft.Json.Linq.JObject() { + try + { + var jObject = new Newtonsoft.Json.Linq.JObject() { { "Cluster_ID", 0 }, { "Command", 4034 } }; - var data = new JObject + var data = new JObject { { "ZoneType", zoneType }, { "IsDisablePushMessage", isDisablePushMessage } }; - jObject.Add("Data", data); - mainGateway.Send(("Security/DisablePushMessage"), jObject.ToString()); + jObject.Add("Data", data); + mainGateway.Send(("Security/DisablePushMessage"), jObject.ToString()); } catch { } @@ -7280,17 +6812,8 @@ /// 鏌ョ湅闃插尯鎶ヨ鐩爣鐨勮繑鍥炴暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class DisablePushMessageResposeAllData + public class DisablePushMessageResposeAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鏌ョ湅闃插尯鎶ヨ鐩爣鐨勮繑鍥炴暟鎹� /// </summary> @@ -7354,8 +6877,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -7369,11 +6891,10 @@ if (topic == gatewayID + "/" + "Security/AdminLogOut_Respon") { - var security = new Safeguard() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - security.adminLogOutResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AdminLogOutResponseData>(jobject["Data"].ToString()); - if (security.adminLogOutResponseData != null) + var adminLogOutResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<AdminLogOutResponseData>(jobject["Data"].ToString()); + if (adminLogOutResponseData != null) { - d = new AdminLogOutResposeAllData {adminLogOutResponseData = security.adminLogOutResponseData }; + d = new AdminLogOutResposeAllData { adminLogOutResponseData = adminLogOutResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } else @@ -7427,17 +6948,8 @@ /// 閫�鍑虹鐞嗗憳鐧婚檰鐨勮繑鍥炴暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class AdminLogOutResposeAllData + public class AdminLogOutResposeAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 閫�鍑虹鐞嗗憳鐧婚檰鐨勮繑鍥炴暟鎹� /// </summary> diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs index 7006480..ad523d5 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/Scene.cs @@ -36,35 +36,6 @@ } /// <summary> - /// 缃戝叧涓満鏅澶囧垪琛� - /// </summary> - //[Newtonsoft.Json.JsonIgnore] - //public List<GetSceneDeviceListInfo> SceneDeviceList = new List<GetSceneDeviceListInfo>(); - - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - ErrorResponData errResponData; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - [System.Serializable] - public class ErrorResponData - { - /// <summary> - /// Error鍙傛暟鍚箟 - ///<para>1锛氱綉鍏虫棤娉曡В鏋愬懡浠ゆ暟鎹��</para> - ///<para>2锛氬崗璋冨櫒姝e湪鍗囩骇鎴栧浠�/鎭㈠鏁版嵁 - ///<para>3锛氭搷浣滆澶�/缁�/鍦烘櫙涓嶅瓨鍦�</para> - ///<para>4锛氬叾浠栭敊璇�</para> - ///<para>5锛氭暟鎹紶杈撻敊璇紙鍦ㄦ煇娆″鎴风鍚戠綉鍏冲彂閫佹暟鎹殑杩囩▼涓紝缃戝叧鍦ㄥ悎鐞嗘椂闂磋寖鍥村唴鎺ユ敹瀹㈡埛绔暟鎹笉瀹屾暣瀵艰嚧璇ラ敊璇彂鐢熴�傚瀹㈡埛绔悜缃戝叧涓�娆″彂閫�100涓瓧鑺傜殑鏁版嵁锛屼絾缃戝叧绛夊緟鎺ユ敹浜嗕竴绉掑彧鎺ユ敹浜�80涓瓧鑺傘�傚彂鐢熻閿欒锛岀綉鍏冲皢涓诲姩鍏抽棴瀹㈡埛绔繛鎺ワ級</para> - /// </summary> - public int Error; - } - - /// <summary> /// 绛夊緟浠庣綉鍏虫帴鏀舵暟鎹殑鏃堕棿 /// </summary> /// <value>The wait receive data time.</value> @@ -160,8 +131,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -175,16 +145,15 @@ if (topic == gatewayID + "/" + "Scene/GetNewId_Respon") { - var scene = new Scene() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - scene.getSceneIdData = Newtonsoft.Json.JsonConvert.DeserializeObject<Scene.GetSceneIdData>(jobject["Data"].ToString()); - if (scene.getSceneIdData == null) + var getSceneIdData = Newtonsoft.Json.JsonConvert.DeserializeObject<Scene.GetSceneIdData>(jobject["Data"].ToString()); + if (getSceneIdData == null) { d = new GetSceneIdAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { GetSceneAllInfoAsync(); - d = new GetSceneIdAllData { getSceneIdData = scene.getSceneIdData }; + d = new GetSceneIdAllData { getSceneIdData = getSceneIdData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } @@ -239,17 +208,8 @@ /// 鍒涘缓涓�涓┖鍦烘櫙杩斿洖鐨勬暟鎹�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class GetSceneIdAllData + public class GetSceneIdAllData:CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鍒涘缓涓�涓┖鍦烘櫙杩斿洖鐨勬暟鎹� /// </summary> @@ -291,7 +251,7 @@ d = new GetSceneAllData { errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" }; return d; } - ZbGateway.AllSceneList.Clear(); + var dateTime = DateTime.Now; Action<string, string> action = (topic, message) => { var gatewayID = topic.Split('/')[0]; @@ -299,8 +259,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -315,31 +274,15 @@ if (topic == gatewayID + "/" + "Scene/GetAllInfo_Respon") { dateTime = DateTime.Now; - var scene = new Scene() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - scene.sceneGetAllInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<GetSceneAllInfo>(jobject["Data"].ToString()); + var sceneGetAllInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<GetSceneAllInfo>(jobject["Data"].ToString()); - if (scene.sceneGetAllInfo == null) + if (sceneGetAllInfo == null) { d = new GetSceneAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - var info = ZbGateway.AllSceneList.Find(obj => obj.ScenesId == scene.sceneGetAllInfo.ScenesId); - if (info == null) - { - ZbGateway.AllSceneList.Add(scene.sceneGetAllInfo); - } - else - { - info.DeviceList = scene.sceneGetAllInfo.DeviceList; - info.DeviceSum = scene.sceneGetAllInfo.DeviceSum; - info.IsOpen = scene.sceneGetAllInfo.IsOpen; - info.ScenesId = scene.sceneGetAllInfo.ScenesId; - info.ScenesName = scene.sceneGetAllInfo.ScenesName; - info.ScenesNum = scene.sceneGetAllInfo.ScenesNum; - info.ScenesSum = scene.sceneGetAllInfo.ScenesSum; - } - d = new GetSceneAllData { getSceneAllInfo = scene.sceneGetAllInfo }; + d = new GetSceneAllData { getSceneAllInfo = sceneGetAllInfo }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } @@ -372,17 +315,8 @@ /// 鑾峰彇鎵�鏈夊満鏅殑鎵�鏈変俊鎭�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class GetSceneAllData + public class GetSceneAllData:CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鑾峰彇鎵�鏈夊満鏅殑鎵�鏈変俊鎭� /// </summary> @@ -448,7 +382,6 @@ ///<para>2锛氬欢鏃舵垚鍛�</para> /// </summary> public int Type; - /// <summary> /// 璁惧mac鍦板潃 锛� ///<para>褰揟ype=0鏃跺瓨鍦ㄣ��</para> @@ -460,21 +393,15 @@ /// </summary> public int Epoint; /// <summary> - /// 璁惧鍚嶇О - /// </summary> - public string DeviceName; - /// <summary> /// 璁惧鍒楄〃 /// 褰揟ype=0鏃跺瓨鍦� /// </summary> public List<Safeguard.TaskListInfo> TaskList = new List<Safeguard.TaskListInfo>(); - /// <summary> /// 鍦烘櫙鎴愬憳鐨勫満鏅痠d /// <para>褰揟ype=1鏃跺瓨鍦�</para> /// </summary> public int ElseScenesId; - /// <summary> ///寤舵椂鎵ц鏃堕棿锛屽崟浣嶇銆� /// </summary> @@ -493,7 +420,6 @@ ///</summary> public static async System.Threading.Tasks.Task<List<GetSceneAllInfo>> GetSceneListAsync() { - ZbGateway.AllSceneList.Clear(); return await System.Threading.Tasks.Task.Run(async () => { var dateTime = DateTime.Now; GetSceneAllData d = null; @@ -503,6 +429,8 @@ d = new GetSceneAllData { errorMessageBase = "褰撳墠娌℃湁涓荤綉鍏�" }; return null; } + + var listScene = new List<GetSceneAllInfo>(); Action<string, string> action = (topic, message) => { var gatewayID = topic.Split('/')[0]; @@ -511,24 +439,9 @@ if (topic == gatewayID + "/" + "Scene/GetAllInfo_Respon") { dateTime = DateTime.Now; - var scene = new Scene() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - scene.sceneGetAllInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<GetSceneAllInfo>(jobject["Data"].ToString()); + var sceneGetAllInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<GetSceneAllInfo>(jobject["Data"].ToString()); + listScene.Add(sceneGetAllInfo); - var info = ZbGateway.AllSceneList.Find(obj => obj.ScenesId == scene.sceneGetAllInfo.ScenesId); - if (info == null) - { - ZbGateway.AllSceneList.Add(scene.sceneGetAllInfo); - } - else - { - info.DeviceList = scene.sceneGetAllInfo.DeviceList; - info.DeviceSum = scene.sceneGetAllInfo.DeviceSum; - info.IsOpen = scene.sceneGetAllInfo.IsOpen; - info.ScenesId = scene.sceneGetAllInfo.ScenesId; - info.ScenesName = scene.sceneGetAllInfo.ScenesName; - info.ScenesNum = scene.sceneGetAllInfo.ScenesNum; - info.ScenesSum = scene.sceneGetAllInfo.ScenesSum; - } System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } }; @@ -549,7 +462,7 @@ mainGateway.Actions -= action; System.Console.WriteLine("Scene/GetAllInfo_Actions 閫�鍑�" + System.DateTime.Now.ToString()); - return ZbGateway.AllSceneList; + return listScene; }); } #endregion @@ -644,22 +557,9 @@ /// <summary> ///鑾峰彇鍦烘櫙淇℃伅,缃戝叧鍙嶉淇℃伅 /// </summary> - GetOnlySceneAllData getOnlySceneAllData; - /// <summary> - ///鑾峰彇鍦烘櫙淇℃伅,缃戝叧鍙嶉淇℃伅 - /// </summary> [System.Serializable] - class GetOnlySceneAllData + class GetOnlySceneAllData:CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鑾峰彇鍦烘櫙淇℃伅 /// </summary> @@ -734,8 +634,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -749,26 +648,15 @@ if (topic == gatewayID + "/" + "Scene/GetDeviceList_Respon") { - var sceneTemp = new Scene() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.getGatewayBaseInfo.gwID }; - sceneTemp.sceneGetDeviceListObj = Newtonsoft.Json.JsonConvert.DeserializeObject<GetSceneDeviceListInfo>(jobject["Data"].ToString()); + var sceneGetDeviceListObj = Newtonsoft.Json.JsonConvert.DeserializeObject<GetSceneDeviceListInfo>(jobject["Data"].ToString()); - if (sceneTemp.sceneGetDeviceListObj == null) + if (sceneGetDeviceListObj == null) { d = new GetSceneDeviceListAllInfo { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - var sDev = mainGateway.SceneDeviceList.Find(obj => obj.ScenesId == sceneTemp.sceneGetDeviceListObj.ScenesId); - if (sDev == null) - { - ZbGateway.MainGateWay.SceneDeviceList.Add(sceneTemp.sceneGetDeviceListObj); - } - else - { - sDev.DeviceList = sceneTemp.sceneGetDeviceListObj.DeviceList; - } - - d = new GetSceneDeviceListAllInfo { getSceneDeviceListInfo = sceneTemp.sceneGetDeviceListObj }; + d = new GetSceneDeviceListAllInfo { getSceneDeviceListInfo = sceneGetDeviceListObj }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } @@ -815,17 +703,8 @@ ///鑾峰彇鍦烘櫙鐨勮澶囧垪琛ㄤ俊鎭�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class GetSceneDeviceListAllInfo + public class GetSceneDeviceListAllInfo : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鑾峰彇鍦烘櫙鐨勮澶囧垪琛ㄤ俊鎭� /// </summary> @@ -893,8 +772,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -908,16 +786,15 @@ if (topic == gatewayID + "/" + "Scene/AddMember_Respon") { - var scene = new Scene() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - scene.addSceneMemberData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddSceneMemberResponseData>(jobject["Data"].ToString()); + var addSceneMemberData = Newtonsoft.Json.JsonConvert.DeserializeObject<AddSceneMemberResponseData>(jobject["Data"].ToString()); - if (scene.addSceneMemberData == null) + if (addSceneMemberData == null) { d = new AddSceneMemberResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new AddSceneMemberResponseAllData { addSceneMemberResponseData = scene.addSceneMemberData }; + d = new AddSceneMemberResponseAllData { addSceneMemberResponseData = addSceneMemberData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } @@ -1010,17 +887,8 @@ /// 鑾峰彇鍦烘櫙涓坊鍔犵殑鎴愬憳,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class AddSceneMemberResponseAllData + public class AddSceneMemberResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鑾峰彇鍦烘櫙涓坊鍔犵殑鎴愬憳 /// </summary> @@ -1166,8 +1034,7 @@ var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1180,16 +1047,15 @@ } if (topic == gatewayID + "/" + "Scene/RemoveMember_Respon") { - var scene = new Scene() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - scene.removeSceneMemberResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveSceneMemberResponseData>(jobject["Data"].ToString()); + var removeSceneMemberResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveSceneMemberResponseData>(jobject["Data"].ToString()); - if (scene.removeSceneMemberResponseData == null) + if (removeSceneMemberResponseData == null) { d = new RemoveSceneMemberResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new RemoveSceneMemberResponseAllData { removeSceneMemberResponseData = scene.removeSceneMemberResponseData }; + d = new RemoveSceneMemberResponseAllData { removeSceneMemberResponseData = removeSceneMemberResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } @@ -1341,17 +1207,8 @@ /// 绉婚櫎鍦烘櫙鎴愬憳淇℃伅鍙嶉,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class RemoveSceneMemberResponseAllData + public class RemoveSceneMemberResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 绉婚櫎鍦烘櫙鎴愬憳淇℃伅鍙嶉 /// </summary> @@ -1442,8 +1299,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1457,16 +1313,15 @@ if (topic == gatewayID + "/" + "Scene/Rename_Respon") { - var scene = new Scene() { DataID = jobject.Value<int>("DataID"), GateWayId = mainGateway.CurrentGateWayId }; - scene.sceneRenameResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SceneRenameResponseData>(jobject["Data"].ToString()); + var sceneRenameResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<SceneRenameResponseData>(jobject["Data"].ToString()); - if (scene.sceneRenameResponseData == null) + if (sceneRenameResponseData == null) { d = new SceneRenameResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new SceneRenameResponseAllData { sceneRenameResponseData = scene.sceneRenameResponseData }; + d = new SceneRenameResponseAllData { sceneRenameResponseData = sceneRenameResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } @@ -1510,17 +1365,8 @@ /// 淇敼鍦烘櫙鍚嶇О /// </summary> [System.Serializable] - public class SceneRenameResponseAllData + public class SceneRenameResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 淇敼鍦烘櫙鍚嶇О /// </summary> @@ -1582,8 +1428,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1597,26 +1442,15 @@ if (topic == gatewayID + "/" + "Scene/Remove_Respon") { - var scene = new Scene() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - scene.removeSceneData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveSceneData>(jobject["Data"].ToString()); - if (scene.removeSceneData == null) + var removeSceneData = Newtonsoft.Json.JsonConvert.DeserializeObject<RemoveSceneData>(jobject["Data"].ToString()); + if (removeSceneData == null) { d = new RemoveSceneAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; return; } else { - for (int listCount = 0; listCount < ZigBee.Device.ZbGateway.AllSceneList.Count; listCount++) - { - var sc = ZbGateway.AllSceneList[listCount]; - - if (scene.removeSceneData.ScenesId == sc.ScenesId) - { - ZigBee.Device.ZbGateway.AllSceneList.RemoveAt(listCount); - listCount--; - } - } - d = new RemoveSceneAllData { removeSceneData = scene.removeSceneData }; + d = new RemoveSceneAllData { removeSceneData = removeSceneData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } @@ -1660,17 +1494,8 @@ /// 绉婚櫎鍦烘櫙,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class RemoveSceneAllData + public class RemoveSceneAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 绉婚櫎鍦烘櫙 /// </summary> @@ -1724,8 +1549,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1739,15 +1563,14 @@ if (topic == gatewayID + "/" + "Scene/Open_Respon") { - var scene = new Scene() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - scene.sceneOpen = Newtonsoft.Json.JsonConvert.DeserializeObject<SceneOpenData>(jobject["Data"].ToString()); - if (scene.sceneOpen == null) + var sceneOpen = Newtonsoft.Json.JsonConvert.DeserializeObject<SceneOpenData>(jobject["Data"].ToString()); + if (sceneOpen == null) { d = new SceneOpenAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new SceneOpenAllData { sceneOpenData = scene.sceneOpen }; + d = new SceneOpenAllData { sceneOpenData = sceneOpen }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } @@ -1793,17 +1616,8 @@ /// 璋冪敤鍦烘櫙,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class SceneOpenAllData + public class SceneOpenAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 璋冪敤鍦烘櫙 /// </summary> @@ -1861,8 +1675,7 @@ var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = mainGateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1875,16 +1688,15 @@ } if (topic == gatewayID + "/" + "Scene/CatDelayScene_Respon") { - var scene = new Scene() { DataID = jobject.Value<int>("Data_ID"), GateWayId = mainGateway.CurrentGateWayId }; - scene.catDelaySceneResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CatDelaySceneResponseData>(jobject["Data"].ToString()); + var catDelaySceneResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CatDelaySceneResponseData>(jobject["Data"].ToString()); - if (scene.catDelaySceneResponseData == null) + if (catDelaySceneResponseData == null) { d = new CatDelaySceneResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new CatDelaySceneResponseAllData { catDelaySceneResponseData = scene.catDelaySceneResponseData }; + d = new CatDelaySceneResponseAllData { catDelaySceneResponseData = catDelaySceneResponseData }; System.Console.WriteLine($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } } @@ -1924,17 +1736,8 @@ /// 鏌ョ湅姝e湪寤舵椂鐨勫満鏅俊鎭弽棣�,缃戝叧鍙嶉淇℃伅 /// </summary> [System.Serializable] - public class CatDelaySceneResponseAllData + public class CatDelaySceneResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鏌ョ湅姝e湪寤舵椂鐨勫満鏅俊鎭俊鎭弽棣� /// </summary> diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/ThirdPartyModuleUpgrade.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/ThirdPartyModuleUpgrade.cs deleted file mode 100755 index 489ce45..0000000 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/ThirdPartyModuleUpgrade.cs +++ /dev/null @@ -1,247 +0,0 @@ -锘縰sing System; -using System.Collections.Generic; - -namespace ZigBee.Device -{ - public class ThirdPartyModuleUpgrade : CommonDevice - { - #region 鑾峰彇浜戠(绗笁鏂规ā鍧楋級鍥轰欢淇℃伅 - /// <summary> - /// 鑾峰彇浜戠鏈嶅姟鍣ㄤ腑鍥轰欢鐗堟湰淇℃伅 - /// </summary> - /// <returns>The https app version async.</returns> - public async System.Threading.Tasks.Task<ThirdPartyModuelInfoOBJ> RequestHttpsAcVersionAsync(string firewareName) - { - try - { - var requestOBJ = new GetFirmwareInfoOBJ - { - Name = firewareName, - RequestVersion = "CodeIDString",//鎸夌収閮鎴愯鐨勫綋鍓峚pp鏄摢涓増鏈� - FirmwareManaFirstType = 2 - }; - var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(requestOBJ); - var result = await RequestHttpsZigbeeAsync("FirmwareMana/DetectionPlatformUploadFirmware", System.Text.Encoding.UTF8.GetBytes(requestJson)); - if (result == null) - { - return null; - } - if (result.StateCode.ToUpper() == "SUCCESS") - { - if (result.ResponseData == null) - { - return null; - } - - var responeData = Newtonsoft.Json.JsonConvert.DeserializeObject<ThirdPartyModuelInfoRes>(result.ResponseData.ToString()); - if (responeData == null || responeData.pageData == null) - { - return null; - } - // int MaxIndex = 0; - //int NewID = 0; - //for (int i = 0; i < responeData.pageData.Count; i++) - //{ - //var moduleInfo = responeData.pageData[i]; - // if (int.Parse(moduleInfo.Id) > NewID) - // { - // NewID = int.Parse(moduleInfo.Id); - // MaxIndex = i; - // } - //} - - return responeData.pageData[0]; - } - return null; - } - catch (Exception ex) - { - return null; - } - } - - /// 涓嬭浇浜戠鍥轰欢鐨勬暟鎹� - /// </summary> - [Serializable] - public class ThirdPartyModuelInfoOBJ - { - public string Name { get; set; } - public string FirmwareVersion { get; set; } - public string Remarks { get; set; } - public string DistributedMark { get; set; } - public string Id { get; set; } - public string CreatedOnUtc { get; set; } - } - - /// <summary> - /// 鑾峰彇浜戠鍥轰欢鐨勬暟鎹� - /// </summary> - public class GetFirmwareInfoOBJ - { - public string RequestVersion; - /// <summary> - /// Name 鎼滅储鍥轰欢鍚嶇О(鍥轰欢鍚嶇О锛� - /// </summary> - public string Name; - /// <summary> - /// 鎼滅储绗竴绾у垎绫�(0:App 1:Zigbee缃戝叧 2:Zigbee 璁惧,3:Buspro锛� - /// </summary> - public int FirmwareManaFirstType; - } - - //[Serializable] - public class ThirdPartyModuelInfoRes - { - public int PageIndex; - public int PageSize; - public int TotalCount; - public int TotalPages; - public bool HasPreviousPage; - public bool HasNextPage; - public List<ThirdPartyModuelInfoOBJ> pageData = new List<ThirdPartyModuelInfoOBJ> { }; - } - - string RequestHttpsHost = "https://global.hdlcontrol.com/HangZhouHdlCloudApi"; - /// <summary> - /// 璇锋眰鏈嶅姟鍣ㄦ柟娉� - /// 鎸囧畾涓�涓猆rl,鍜岃姹傛柟娉曪紝鏁版嵁锛孋ookie锛屽緱鍒板搷搴旂殑鏁版嵁 - /// </summary> - /// <param name="requestUrl">璇锋眰Url</param> - /// <param name="byteData">璇锋眰鐨勭殑鏁版嵁</param> - /// <returns>寰楀埌鍝嶅簲鐨勬暟鎹�</returns> - public async System.Threading.Tasks.Task<byte[]> RequestHttpsZigbeeBytesResultAsync(string requestUrl, byte[] byteData) - { - try - { - //鍒濆鍖栨柊鐨剋ebRequst - //1锛� 鍒涘缓httpWebRequest瀵硅薄 - var webRequest = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(new Uri($"{RequestHttpsHost}/{requestUrl}")); - //2锛� 鍒濆鍖朒ttpWebRequest瀵硅薄 - webRequest.Method = "POST"; - webRequest.ContentType = "application/json"; - webRequest.ContentLength = byteData.Length; - webRequest.Headers.Add(System.Net.HttpRequestHeader.Authorization, Shared.Common.Config.Instance.Token); - //3锛� 闄勫姞瑕丳OST缁欐湇鍔″櫒鐨勬暟鎹埌HttpWebRequest瀵硅薄(闄勫姞POST鏁版嵁鐨勮繃绋嬫瘮杈冪壒娈婏紝瀹冨苟娌℃湁鎻愪緵涓�涓睘鎬х粰鐢ㄦ埛瀛樺彇锛岄渶瑕佸啓鍏ttpWebRequest瀵硅薄鎻愪緵鐨勪竴涓猻tream閲岄潰銆�) - var newStream = webRequest.GetRequestStream();//鍒涘缓涓�涓猄tream,璧嬪�兼槸鍐欏叆HttpWebRequest瀵硅薄鎻愪緵鐨勪竴涓猻tream閲岄潰 - newStream.Write(byteData, 0, byteData.Length); - newStream.Flush(); - newStream.Close(); - //4锛� 璇诲彇鏈嶅姟鍣ㄧ殑杩斿洖淇℃伅 - var response = (System.Net.HttpWebResponse)webRequest.GetResponse(); - var stream = response.GetResponseStream(); - if (stream == null) - { - return null; - } - var result = new byte[stream.Length]; - //宸叉帴鏀剁殑闀垮害 - int receivedLength = 0; - //娉ㄦ剰锛屽綋鏁版嵁姣旇緝澶ф椂锛屽彲鑳戒竴娆℃�ф病璇诲畬锛岄渶瑕侀噸澶嶈鍙� - //褰撳畬鎴愭椂鍙兘杩斿洖鐨勭粨鏋滀负 0 - while (receivedLength < result.Length) - { - var rece = await stream.ReadAsync(result, receivedLength, result.Length - receivedLength); - receivedLength += rece; - if (rece == 0) - { - break; - } - } - stream.Close(); - response.Close(); - return result; - } - catch (Exception e) - { - System.Console.WriteLine(e.Message); - return null; - } - } - - /// <summary> - /// 璇锋眰鏈嶅姟鍣ㄦ柟娉� - /// 鎸囧畾涓�涓猆rl,鍜岃姹傛柟娉曪紝鏁版嵁锛孋ookie锛屽緱鍒板搷搴旂殑鏁版嵁 - /// </summary> - /// <param name="requestUrl">璇锋眰Url</param> - /// <param name="byteData">璇锋眰鐨勭殑鏁版嵁</param> - /// <returns>寰楀埌鍝嶅簲鐨勬暟鎹�</returns> - public async System.Threading.Tasks.Task<string> RequestHttpsZigbeeResultAsync(string requestUrl, byte[] byteData) - { - var result = await RequestHttpsZigbeeBytesResultAsync(requestUrl, byteData); - if (result != null) - { - return System.Text.Encoding.UTF8.GetString(result); - } - return null; - } - - /// <summary> - /// 璇锋眰鏈嶅姟鍣ㄦ柟娉� - /// 鎸囧畾涓�涓猆rl,鍜岃姹傛柟娉曪紝鏁版嵁锛孋ookie锛屽緱鍒板搷搴旂殑鏁版嵁 - /// </summary> - /// <param name="requestUrl">璇锋眰Url</param> - /// <param name="byteData">璇锋眰鐨勭殑鏁版嵁</param> - /// <returns>寰楀埌鍝嶅簲鐨勬暟鎹�</returns> - public async System.Threading.Tasks.Task<Shared.Common.ResponseEntity.ResponsePack> RequestHttpsZigbeeAsync(string requestUrl, byte[] byteData) - { - string result = await this.RequestHttpsZigbeeResultAsync(requestUrl, byteData); - if (result != null) - { - try - { - var data = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.ResponsePack>(result); - return data; - } - catch (Exception ex) - { - System.Console.WriteLine(ex.Message); - } - } - return null; - } - - /// <summary> - /// 涓嬭浇Ac绋嬪簭 - /// </summary> - /// <returns>The load apk async.</returns> - /// <param name="requestUrl">璇锋眰閾炬帴</param> - /// <param name="byteData">璇锋眰鍙傛暟</param> - public System.Threading.Tasks.Task<byte[]> DownLoadAcAsync(string requestUrl, byte[] byteData) - { - try - { - var webClient = new System.Net.WebClient { }; - webClient.Headers.Add(System.Net.HttpRequestHeader.ContentType, "application/json"); - webClient.Headers.Add(System.Net.HttpRequestHeader.Authorization, Shared.Common.Config.Instance.Token); - var result = webClient.UploadDataTaskAsync($"{RequestHttpsHost}/{requestUrl}", "POST", byteData); - if (result == null) - { - return null; - } - return result; - } - catch (Exception ex) - { - return null; - } - finally - { - } - } - #endregion - - #region 涓嬭浇鍥轰欢绋嬪簭 - /// <summary> - /// 涓嬭浇Ac鍥轰欢绋嬪簭 - /// </summary> - public class DownLoadAcFireware - { - public string RequestVersion; - /// <summary> - /// 涓嬭浇鍥轰欢鐨勫敮涓�鏍囪瘑 - /// </summary> - public string DistributedMark; - } - #endregion - } -} diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs index 60c83d9..64b9859 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGateway.cs @@ -22,14 +22,7 @@ [System.Serializable] public class ZbGateway : ZbGatewayData { - public ZbGateway() - { - this.Type = DeviceType.ZbGateway; - } - - - - #region 缃戝叧鐗规畩淇℃伅澶勭悊 + #region 涓�鍫嗗彉閲� /// <summary> /// 涓荤綉鍏� /// </summary> @@ -71,20 +64,39 @@ /// </summary> /// <value>The file path.</value> [Newtonsoft.Json.JsonIgnore] - public override string FilePath + public string FilePath { get { - var deviceType = Type.ToString(); - var fileName = "Gateway_" + deviceType + "_" + this.getGatewayBaseInfo?.gwID; + var fileName = "Gateway_" + DeviceType.ZbGateway.ToString() + "_" + this.getGatewayBaseInfo?.gwID; return fileName; + } + } + + /// <summary> + /// 绛夊緟浠庣綉鍏虫帴鏀舵暟鎹殑鏃堕棿 + /// </summary> + /// <value>The wait receive data time.</value> + [Newtonsoft.Json.JsonIgnore] + public int WaitReceiveDataTime + { + get + { + if (Device.ZbGateway.RemoteMqttClient != null && Device.ZbGateway.RemoteMqttClient.IsConnected) + { + return 10000; + } + else + { + return 3000; + } } } /// <summary> /// 灞�鍩熺綉鍔犲瘑瀵嗙爜 /// </summary> - string password; + private string password; /// <summary> /// 灞�鍩熺綉鍔犲瘑瀵嗛挜 /// </summary> @@ -101,27 +113,6 @@ } } - #region variable - /// <summary> - /// 杩滅▼杩炴帴鎴愬姛鏃剁殑鏃堕棿 - /// </summary> - public static DateTime LoginRemoteDateTime = DateTime.Now; - - /// <summary> - /// 鍚屾鍒拌繙绋嬬殑褰撳墠鏃堕棿鎴� - /// </summary>Re - public static ulong CurrentTimeStamp - { - get - { - return RemoteTimeStamp + (ulong)(DateTime.Now - LoginRemoteDateTime).TotalSeconds; - } - } - - /// <summary> - /// 杩滅▼杩炴帴鎴愬姛鏃剁殑鏃堕棿鎴� - /// </summary> - public static ulong RemoteTimeStamp; /// <summary> /// 缃戝叧鏄惁鍔犲瘑 /// </summary> @@ -138,37 +129,6 @@ [Newtonsoft.Json.JsonIgnore] public static List<ZbGateway> GateWayList = new List<ZbGateway>(); - //褰撳墠缃戝叧涓殑璁惧鍒楄〃 - [Newtonsoft.Json.JsonIgnore] - public List<CommonDevice> DeviceList = new List<CommonDevice>(); - - /// <summary> - /// 缃戝叧涓満鏅垪琛� - /// 涓�涓満鏅腑鍖呭惈鎵�鏈変俊鎭紝鍖呮嫭鍦烘櫙璁惧淇℃伅 - /// </summary> - [Newtonsoft.Json.JsonIgnore] - public static List<Scene.GetSceneAllInfo> AllSceneList = new List<Scene.GetSceneAllInfo>(); - - /// <summary> - /// 缃戝叧涓満鏅殑璁惧鍒楄〃 - /// </summary> - [Newtonsoft.Json.JsonIgnore] - public List<Scene.GetSceneDeviceListInfo> SceneDeviceList = new List<Scene.GetSceneDeviceListInfo>(); - - #region action variable - /// <summary> - /// 鎺ユ敹鏁版嵁鍚庡洖璋� - /// </summary> - [Newtonsoft.Json.JsonIgnore] - Action<object> action; - /// <summary> - /// 璁剧疆鏁版嵁鍥炶皟 - /// </summary> - public void SetAction(Action<object> action, int timeOut = 1000) - { - this.action = action; - } - /// <summary> /// 缃戝叧鎺ㄩ�佹暟鎹� /// <para>绗竴涓弬鏁帮細濡傛灉涓� DeviceInComingRespon:璁惧鏂颁笂鎶�</para> @@ -183,24 +143,15 @@ /// <para>绗竴涓弬鏁帮細濡傛灉涓� ZoneTriggerReport:闃插尯琚Е鍙戞椂鎶ュ憡</para> /// <para>绗竴涓弬鏁帮細濡傛灉涓� LogicExecuteReport:閫昏緫琚皟鐢ㄥ弽棣�</para> /// <para>绗竴涓弬鏁帮細濡傛灉涓� TimingWillArrive:鏃堕棿鐐规潯浠舵帹杩熸墽琛�</para> - /// para>绗竴涓弬鏁帮細 濡傛灉涓� ModeTriggerReport:妯″紡瀹夐槻鍔ㄤ綔琚渶缁堟縺娲绘椂鍙戦�佹姤璀︿俊鎭�</para> + /// <para>绗竴涓弬鏁帮細 濡傛灉涓� ModeTriggerReport:妯″紡瀹夐槻鍔ㄤ綔琚渶缁堟縺娲绘椂鍙戦�佹姤璀︿俊鎭�</para> /// <para>绗竴涓弬鏁帮細濡傛灉涓� EnOrWithdrawSucceedReport:閫氳繃澶栭儴鏂瑰紡甯冮槻鎾ら槻鎴愬姛鏃舵姤鍛婃伅</para> /// <para>绗竴涓弬鏁帮細濡傛灉涓� PushTargetInfoReport:鑳佽揩瀵嗙爜鎾ら槻鏃剁煭淇℃帹閫�</para> - /// <para>绗竴涓弬鏁帮細濡傛灉涓� DeviceDefaultAck:鑺傜偣璁惧榛樿鍙嶉</para> /// <para>绗竴涓弬鏁帮細濡傛灉涓� DDevice/IsGetEpointInfo:鏈夋柊璁惧鍔犲叆zigbee缃戠粶鍙嶉</para>璁惧璇锋眰APP鑾峰彇鍗囩骇鏁版嵁 /// <para>绗竴涓弬鏁帮細濡傛灉涓� Device/DeviceJoinZbNet:鑾峰彇鏂拌澶囨墍鏈夌鐐逛俊鎭槸鍚︽垚鍔熷弽棣�</para> /// <para>绗竴涓弬鏁帮細濡傛灉涓� DeviceRequestAcUpdateData: 璁惧璇锋眰绌鸿皟鍙戝崌绾ф暟鎹�</para> /// </summary> [Newtonsoft.Json.JsonIgnore] public Action<string, object> ReportAction; - /// <summary> - /// 浜戠閫氳閿欒鏁版嵁涓婃姤 - ///<para>"ForwardGatewayNoOnLine", "褰撳墠鎿嶄綔鐨勭綉鍏充笉鍦ㄧ嚎"</para> - ///<para>"AppTimeOut", "浠庝簯绔幏鍙栨暟鎹秴鏃讹紝璇烽噸鏂拌幏鍙�"</para> - ///<para>"AppNoLogin", "鐧诲綍杩囨湡锛岃閲嶆柊鐧诲綍"</para> - /// </summary> - [Newtonsoft.Json.JsonIgnore] - public Action<string, string> CloudErrorAction; /// <summary> /// 缃戝叧鏂囦欢娴佸唴瀹归�氱煡 @@ -219,8 +170,7 @@ /// </summary> [Newtonsoft.Json.JsonIgnore] public Action<string, string> Actions; - #endregion - #endregion + #endregion #region 缃戝叧API @@ -241,8 +191,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -250,24 +199,21 @@ } else { - d = new GetGwVersionAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + d = new GetGwVersionAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "GetZbGwVersionRespon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - gatewayTemp.getGwVersion = Newtonsoft.Json.JsonConvert.DeserializeObject<GetGwVersionData>(jobject["Data"].ToString()); + var getGwVersion = Newtonsoft.Json.JsonConvert.DeserializeObject<GetGwVersionData>(jobject["Data"].ToString()); - if (gatewayTemp.getGwVersion == null) + if (getGwVersion == null) { d = new GetGwVersionAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; } else { - d = new GetGwVersionAllData { getGwVersion = gatewayTemp.getGwVersion }; - AppVersion = gatewayTemp.getGwVersion.AppVersion; - ZigbeeVersion = gatewayTemp.getGwVersion.ZigbeeVersion; + d = new GetGwVersionAllData { getGwVersion = getGwVersion }; //Save(); DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } @@ -319,16 +265,15 @@ if (topic == gatewayID + "/" + "GetZbGwInfo_Respon") { var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = getGatewayBaseInfo.gwID }; - gatewayTemp.getGwInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<GetGwData>(jobject["Data"].ToString()); + var getGwInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<GetGwData>(jobject["Data"].ToString()); - if (gatewayTemp.getGwInfo == null) + if (getGwInfo == null) { data = new GetGwAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - data = new GetGwAllData { getGwData = gatewayTemp.getGwInfo }; + data = new GetGwAllData { getGwData = getGwInfo }; DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } } @@ -373,8 +318,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -382,13 +326,12 @@ } else { - d = new GetMacResponData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + d = new GetMacResponData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "ZbGw/GetMac_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<MacAddrData>(jobject["Data"].ToString()); if (tempData == null) @@ -443,8 +386,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -452,22 +394,21 @@ } else { - d = new GwReNameAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + d = new GwReNameAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "GwReName_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - gatewayTemp.gwRename = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.GwReNameData>(jobject["Data"].ToString()); + var gwRename = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.GwReNameData>(jobject["Data"].ToString()); - if (gatewayTemp.gwRename == null) + if (gwRename == null) { d = new GwReNameAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new GwReNameAllData { gwReNameData = gatewayTemp.gwRename }; + d = new GwReNameAllData { gwReNameData = gwRename }; DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } } @@ -526,8 +467,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -535,21 +475,20 @@ } else { - d = new GwSetHomeIdAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + d = new GwSetHomeIdAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "GwSetHomeId_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - gatewayTemp.gwSetHomeId = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.GwSetHomeIdData>(jobject["Data"].ToString()); - if (gatewayTemp.gwSetHomeId == null) + var gwSetHomeId = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.GwSetHomeIdData>(jobject["Data"].ToString()); + if (gwSetHomeId == null) { d = new GwSetHomeIdAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new GwSetHomeIdAllData { gwSetHomeIdData = gatewayTemp.gwSetHomeId }; + d = new GwSetHomeIdAllData { gwSetHomeIdData = gwSetHomeId }; DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } } @@ -597,82 +536,6 @@ Actions -= action; DebugPrintLog("GwReName_Actions 閫�鍑�" + System.DateTime.Now.ToString()); - - return d; - }); - } - #endregion - - #region 鑾峰彇缃戝叧璁板綍鐨勮澶囧睘鎬х姸鎬� - /// <summary> - ///鑾峰彇缃戝叧璁板綍鐨勮澶囧睘鎬х姸鎬� - /// </summary> - public async System.Threading.Tasks.Task<GetStatusRecordAllInfo> GetStatusRecordAsync(string deviceAddr, int deviceEpoint) - { - return await System.Threading.Tasks.Task.Run(async () => - { - GetStatusRecordAllInfo d = null; - Action<string, string> action = (topic, message) => - { - var gatewayID = topic.Split('/')[0]; - var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); - - if (topic == gatewayID + "/" + "Error_Respon") - { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); - - if (temp == null) - { - d = new GetStatusRecordAllInfo { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; - } - else - { - d = new GetStatusRecordAllInfo { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; - } - } - - if (topic == gatewayID + "/" + "GetStatusRecord_Respon") - { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - gatewayTemp.getStatusRecordInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.GetStatusRecordInfo>(jobject["Data"].ToString()); - - if (gatewayTemp.getStatusRecordInfo == null) - { - d = new GetStatusRecordAllInfo { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; - } - else - { - d = new GetStatusRecordAllInfo { getStatusRecordInfo = gatewayTemp.getStatusRecordInfo }; - DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); - } - } - }; - Actions += action; - DebugPrintLog("GetStatusRecord_Actions 鍚姩" + System.DateTime.Now.ToString()); - try - { - var jObject = new JObject { { "DeviceAddr", deviceAddr }, { "Epoint", deviceEpoint }, { "Cluster_ID", 0 }, { "Command", 80 } }; - Send("GetStatusRecord", jObject.ToString()); - - } - catch { } - - var dateTime = DateTime.Now; - while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) - { - await System.Threading.Tasks.Task.Delay(10); - if (d != null) - { - break; - } - } - if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) - { - d = new GetStatusRecordAllInfo { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; - } - Actions -= action; - DebugPrintLog("GetStatusRecord_Actions 閫�鍑�" + System.DateTime.Now.ToString()); return d; }); @@ -743,8 +606,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -752,13 +614,12 @@ } else { - d = new GwLinuxResetResponData { errorMessageBase = ErrorMess(temp.Error) }; + d = new GwLinuxResetResponData { errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "GwLinuxReset_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"].ToString()); if (result == null) @@ -821,8 +682,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -830,13 +690,12 @@ } else { - d = new GwRebootResponAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + d = new GwRebootResponAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "GwReboot_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"].ToString()); if (result == null) @@ -897,8 +756,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -906,22 +764,21 @@ } else { - d = new SaveNVFileResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + d = new SaveNVFileResponseAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "ZbGwOperation/SaveNVFile_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.zbGwOperationSaveNVFileData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.SaveNVFileResponseData>(jobject["Data"].ToString()); + var zbGwOperationSaveNVFileData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.SaveNVFileResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.zbGwOperationSaveNVFileData == null) + if (zbGwOperationSaveNVFileData == null) { d = new SaveNVFileResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new SaveNVFileResponseAllData { saveNVFileResponseData = gatewayTemp.zbGwOperationSaveNVFileData }; + d = new SaveNVFileResponseAllData { saveNVFileResponseData = zbGwOperationSaveNVFileData }; DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } } @@ -975,8 +832,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -984,14 +840,13 @@ } else { - d = new RestoreNVAllDtta { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + d = new RestoreNVAllDtta { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "ZbGwOperation/RestoreNV_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.RestoreNVDtta>(jobject["Data"].ToString()); if (tempData == null) @@ -1055,21 +910,19 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { d = new GwGetChannelResponData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; } else { - d = new GwGetChannelResponData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + d = new GwGetChannelResponData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "ZbGw/GetChannel_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; var channel = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Channel"].ToString()); d = new GwGetChannelResponData { channel = channel }; DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); @@ -1123,8 +976,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1132,13 +984,12 @@ } else { - d = new ChangeChannelResponAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + d = new ChangeChannelResponAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "ZbGw/ChangeChannel_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; var tempInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<ChangeChannelResponData>(jobject["Data"].ToString()); if (tempInfo == null) @@ -1217,8 +1068,11 @@ /// </summary> public async System.Threading.Tasks.Task<Panel.PanelSwitchLevelInfo> ClientDataPassthroughBytesAsync(string deviceAddr, int devicePoint, long dataLength, byte[] passData) { + var myDevice = Shared.Common.LocalDevice.Current.GetDevice(deviceAddr, devicePoint); + Panel.PanelSwitchLevelInfo result = null; - if (Gateway == null) + + if (myDevice.Gateway == null) { result = new Panel.PanelSwitchLevelInfo { errorMessageBase = "褰撳墠娌℃湁缃戝叧" }; return result; @@ -1232,8 +1086,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = Gateway.getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1242,24 +1095,23 @@ else { - result = new Panel.PanelSwitchLevelInfo { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + result = new Panel.PanelSwitchLevelInfo { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ClientDataPassthroughResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.clientDataPassthroughResponseData == null) + if (clientDataPassthroughResponseData == null) { result = new Panel.PanelSwitchLevelInfo { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null) + if (clientDataPassthroughResponseData?.PassData != null) { - var data = gatewayTemp.clientDataPassthroughResponseData.PassData; + var data = clientDataPassthroughResponseData.PassData; if (data.Length == 14) { var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString(); @@ -1276,7 +1128,7 @@ } }; - Gateway.Actions += action; + myDevice.Gateway.Actions += action; System.Console.WriteLine("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString()); try @@ -1317,7 +1169,7 @@ { result = new Panel.PanelSwitchLevelInfo { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; } - Gateway.Actions -= action; + myDevice.Gateway.Actions -= action; System.Console.WriteLine("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString()); return result; @@ -1346,8 +1198,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1355,24 +1206,16 @@ } else { - d = new PassthroughAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + d = new PassthroughAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "ZbDataPassthrough") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(jobject["Data"].ToString()); - if (gatewayTemp.getGwVersion == null) - { - d = new PassthroughAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; - } - else - { - d = new PassthroughAllData { passData = temp }; - DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); - } + d = new PassthroughAllData { passData = temp }; + DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } }; Actions += action; @@ -1425,8 +1268,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1435,13 +1277,12 @@ else { - d = new LinuxUpgradeAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + d = new LinuxUpgradeAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "ZbGwOperation/LinuxUpgrade_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); d = new LinuxUpgradeAllData { Result = result }; DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); @@ -1502,8 +1343,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1512,22 +1352,21 @@ else { - d = new ZbGwOperationUpgradeAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + d = new ZbGwOperationUpgradeAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "ZbGwOperation/Upgrade_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.zbGwOperationUpgradeData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ZbGwOperationUpgradeData>(jobject["Data"].ToString()); + zbGwOperationUpgradeData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ZbGwOperationUpgradeData>(jobject["Data"].ToString()); - if (gatewayTemp.zbGwOperationUpgradeData == null) + if (zbGwOperationUpgradeData == null) { d = new ZbGwOperationUpgradeAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new ZbGwOperationUpgradeAllData { bGwOperationUpgradeData = gatewayTemp.zbGwOperationUpgradeData }; + d = new ZbGwOperationUpgradeAllData { bGwOperationUpgradeData = zbGwOperationUpgradeData }; DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } } @@ -1573,11 +1412,11 @@ /// <returns>The file async.</returns> /// <param name="distributedMark">Distributed mark:鍥轰欢鍞竴鏍囪瘑</param> /// <param name="imageName">Image name:鍥轰欢鐗堟湰</param> - public async System.Threading.Tasks.Task<DownloadFileResponAllData> DownloadFileAsync(string distributedMark, string imageName) + public async System.Threading.Tasks.Task<CommonDevice.DownloadFileResponAllData> DownloadFileAsync(string distributedMark, string imageName) { return await System.Threading.Tasks.Task.Run(async () => { - DownloadFileResponAllData d = null; ; + CommonDevice.DownloadFileResponAllData d = null; ; Action<string, string> action = (topic, message) => { var gatewayID = topic.Split('/')[0]; @@ -1585,32 +1424,30 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { - d = new DownloadFileResponAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; + d = new CommonDevice.DownloadFileResponAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; } else { - d = new DownloadFileResponAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + d = new CommonDevice.DownloadFileResponAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "DownloadFile_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.downloadFileResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<DownloadFileResponData>(jobject["Data"].ToString()); + var downloadFileResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DownloadFileResponData>(jobject["Data"].ToString()); - if (gatewayTemp.downloadFileResponData == null) + if (downloadFileResponData == null) { - d = new DownloadFileResponAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; + d = new CommonDevice.DownloadFileResponAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new DownloadFileResponAllData { downloadFileResponData = gatewayTemp.downloadFileResponData }; + d = new CommonDevice.DownloadFileResponAllData { downloadFileResponData = downloadFileResponData }; DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } } @@ -1641,7 +1478,7 @@ } if ((DateTime.Now - dateTime).TotalMilliseconds > 30 * 1000) { - d = new DownloadFileResponAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; + d = new CommonDevice.DownloadFileResponAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; } Actions -= action; @@ -1668,8 +1505,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1678,22 +1514,21 @@ else { - d = new CheckVDDriveCodeResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + d = new CheckVDDriveCodeResponseAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "VirtualDrive/CatDriveCode_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.vDriveDriveCodeResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<VDriveDriveCodeResponData>(jobject["Data"].ToString()); + var vDriveDriveCodeResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<VDriveDriveCodeResponData>(jobject["Data"].ToString()); - if (gatewayTemp.vDriveDriveCodeResponData == null) + if (vDriveDriveCodeResponData == null) { d = new CheckVDDriveCodeResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new CheckVDDriveCodeResponseAllData { vDriveDriveCodeResponData = gatewayTemp.vDriveDriveCodeResponData }; + d = new CheckVDDriveCodeResponseAllData { vDriveDriveCodeResponData = vDriveDriveCodeResponData }; DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); } } @@ -1748,8 +1583,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1758,22 +1592,21 @@ else { - d = new VirtualDriveUpgradeResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + d = new VirtualDriveUpgradeResponseAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "VirtualDrive/Upgrade_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.virtualDriveUpgradeResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<VirtualDriveUpgradeResponData>(jobject["Data"].ToString()); + virtualDriveUpgradeResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<VirtualDriveUpgradeResponData>(jobject["Data"].ToString()); - if (gatewayTemp.virtualDriveUpgradeResponData == null) + if (virtualDriveUpgradeResponData == null) { d = new VirtualDriveUpgradeResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; } else { - d = new VirtualDriveUpgradeResponseAllData { virtualDriveUpgradeResponData = gatewayTemp.virtualDriveUpgradeResponData }; + d = new VirtualDriveUpgradeResponseAllData { virtualDriveUpgradeResponData = virtualDriveUpgradeResponData }; DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{topic}"); } } @@ -1811,115 +1644,6 @@ #endregion - //#region 涓婁紶绉佹湁鏁版嵁 - //private bool backupSuccess = false; - /// <summary> - /// 涓婁紶绉佹湁鏁版嵁 - /// </summary> - /// <returns>The data to gateway.</returns> - /// <param name="fileName">File name.</param> - /// <param name="dev">Dev.</param> - //public async System.Threading.Tasks.Task<SendFileResponseAllData> BackupDataToGateway(string fileName, CommonDevice dev) - //{ - // return await System.Threading.Tasks.Task.Run(async () => - // { - // SendFileResponseAllData backUpStatus = null; - // var file = await System.Threading.Tasks.Task.Factory.StartNew(() => Newtonsoft.Json.JsonConvert.SerializeObject(dev)); - // var data = System.Text.Encoding.UTF8.GetBytes(file); - // //缃戝叧涓垱寤哄瓨鍌ㄦ暟鎹殑鏂囦欢 - // var saveFileName = await dev.Gateway.CreateFileAsync(fileName); - // if (saveFileName != null && saveFileName.Result == 0) - // { - // backupSuccess = false; - // //涓婁紶鏁版嵁鍒扮綉鍏� - // var saveData = await dev.Gateway.SendFileAsync(data); - // if (saveData != null) - // { - // backUpStatus = new SendFileResponseAllData { Result = saveData.Result }; - // } - // } - // var dateTime = DateTime.Now; - // while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime) - // { - // await System.Threading.Tasks.Task.Delay(10); - // if (backUpStatus != null) - // { - // break; - // } - // } - // if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime) - // { - // backUpStatus = new SendFileResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; - // }; - // return backUpStatus; - // }); - //} - - /// <summary> - /// 涓嬭浇绉佹湁鏁版嵁 - /// </summary> - /// <returns>The data from gateway.</returns> - /// <param name="fileName">File name.</param> - /// <param name="dev">Dev.</param> - //public async System.Threading.Tasks.Task<System.Collections.Generic.List<byte>> DownloadDataFromGateway(string fileName, CommonDevice dev) - //{ - // return await System.Threading.Tasks.Task.Run(async () => - // { - // byteSource.Clear(); - // System.Collections.Generic.List<byte> backUpData = null; - // var dateTime = DateTime.Now; - // //鑾峰彇褰撳墠鏂囦欢鐨勫叿浣撲俊鎭� - // //var getFileSize = await currentKey.Gateway.GetCurrentFileInfoAsync(fileName); - // //涓嬭浇鏂囦欢 - // var saveFileName = await dev.Gateway.SetDownloadFileAsync(fileName); - // Action<string, byte[]> action = (topic, dataContent) => - // { - // if (topic.Split('/')[0] + "/" + topic.Split('/')[1] + "/" + topic.Split('/')[2] == topic.Split('/')[0] + "/" + "FileTransfer/DownloadFile") - // { - // dateTime = DateTime.Now; - // byte[] fileBytes = dataContent; - // if (fileBytes[5] != 1) - // { - // if (fileBytes.Length == 2056) - // { - // var tempBytes = new byte[2048]; - // System.Array.Copy(fileBytes, 8, tempBytes, 0, 2048); - // byteSource.AddRange(tempBytes); - // } - // else - // { - // var tempBytes = new byte[fileBytes.Length - 8]; - // System.Array.Copy(fileBytes, 8, tempBytes, 0, tempBytes.Length); - // byteSource.AddRange(tempBytes); - // } - // } - // else - // { - // var tempBytes = new byte[fileBytes.Length - 8]; - // System.Array.Copy(fileBytes, 8, tempBytes, 0, tempBytes.Length); - // byteSource.AddRange(tempBytes); - - // if (byteSource != null ) - // { - // backUpData = byteSource; - // } - // } - - // } - // }; - // dev.Gateway.FileContentAction += action; - - // while ((DateTime.Now - dateTime).TotalMilliseconds < 2000) - // { - // await System.Threading.Tasks.Task.Delay(10); - // } - // dev.Gateway.FileContentAction -= action; - // return byteSource; - // }); - //} - - //#endregion - #region 瀹㈡埛绔笂浼犳枃浠跺埌缃戝叧. /// <summary> /// 瀹㈡埛绔笂浼犳枃浠跺埌缃戝叧 @@ -1940,8 +1664,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -1949,13 +1672,12 @@ } else { - dataRes = new CreateFileResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + dataRes = new CreateFileResponseAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "FileTransfer/CreateFile_Respon") { - var security = new ZbGateway() { DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = getGatewayBaseInfo.gwID }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); dataRes = new CreateFileResponseAllData { Result = result }; DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); @@ -2019,7 +1741,6 @@ if (topic == gatewayID + "/FileTransfer/SendFile_Respon") { - var gateway = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); dataRes = new SendFileResponseAllData { Result = result }; if (result == 0) @@ -2109,8 +1830,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2118,13 +1838,12 @@ } else { - dataRes = new FileTransferLsDiResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + dataRes = new FileTransferLsDiResponseAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "FileTransfer/lsDir_Respon") { - var lsDir = new ZbGateway() { DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = getGatewayBaseInfo.gwID }; var resultlsDir = Newtonsoft.Json.JsonConvert.DeserializeObject<FileTransferLsDiResponseData>(jobject["Data"].ToString()); if (resultlsDir != null) { @@ -2187,8 +1906,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2196,13 +1914,12 @@ } else { - dataRes = new FileTransferGetFileInfoResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + dataRes = new FileTransferGetFileInfoResponseAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "FileTransfer/GetFileInfo_Respon") { - var lsDir = new ZbGateway() { DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = getGatewayBaseInfo.gwID }; var resultlsDir = Newtonsoft.Json.JsonConvert.DeserializeObject<FileTransferGetFileInfoResponseData>(jobject["Data"].ToString()); if (resultlsDir != null) { @@ -2267,8 +1984,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2276,13 +1992,12 @@ } else { - dataRes = new SetDownloadFileResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + dataRes = new SetDownloadFileResponseAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "FileTransfer/SetDownloadFile_Respon") { - var lsDir = new ZbGateway() { DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = CurrentGateWayId }; var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetDownloadFileResponseData>(jobject["Data"].ToString()); if (tempData != null) { @@ -2290,7 +2005,7 @@ var tempDa = new SetDownloadFileResponseData(); if (tempData.Result == 0) { - ZbGateway.byteSource.Clear(); + this.byteSource.Clear(); } tempDa.Result = tempData.Result; dataRes.setDownloadFileResponseData = tempDa; @@ -2338,7 +2053,7 @@ #endregion #region 缃戝叧鍙戦�佹枃浠舵祦鍒板鎴风 - static System.Collections.Generic.List<byte> byteSource = new System.Collections.Generic.List<byte>(); + private List<byte> byteSource = new List<byte>(); ///<summary > /// 涓嬭浇鏂囦欢涓殑鏁版嵁 /// </summary> @@ -2401,8 +2116,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2410,13 +2124,12 @@ } else { - dataRes = new DelFileOrDirResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + dataRes = new DelFileOrDirResponseAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "FileTransfer/DelFileOrDir_Respon") { - var lsDir = new ZbGateway() { DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = CurrentGateWayId }; var resultDelFileOrDir = Newtonsoft.Json.JsonConvert.DeserializeObject<DelFileOrDirResponseData>(jobject["Data"].ToString()); if (resultDelFileOrDir != null) { @@ -2480,8 +2193,7 @@ if (topic == gatewayID + "/" + "Error_Respon") { - var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = getGatewayBaseInfo.gwID }; - var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ErrorResponData>(jobject["Data"].ToString()); + var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ErrorResponData>(jobject["Data"].ToString()); if (temp == null) { @@ -2489,13 +2201,12 @@ } else { - dataRes = new CreateDirResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + dataRes = new CreateDirResponseAllData { errorResponData = temp, errorMessageBase = CommonDevice.ErrorMess(temp.Error) }; } } if (topic == gatewayID + "/" + "FileTransfer/CreateDir_Respon") { - var lsDir = new ZbGateway() { DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = CurrentGateWayId }; var resultCreateDir = Newtonsoft.Json.JsonConvert.DeserializeObject<CreateDirResponseData>(jobject["Data"].ToString()); if (resultCreateDir != null) { @@ -2556,7 +2267,6 @@ if (topic == gatewayID + "/" + "SendAESKey_Respon") { var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; var result = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Result"].ToString()); sendKeyResponData = new SendKeyResponData { Result = result }; DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); @@ -2601,7 +2311,7 @@ /// <para>杩涘叆褰撳墠鐣岄潰鏃惰娣诲姞</para> /// <para>閫�鍑哄綋鍓嶇晫闈㈡椂瑕佸叧闂�</para> /// </summary> - public static readonly System.Collections.Generic.List<IStatus> StatusList = new System.Collections.Generic.List<IStatus>(); + public static readonly List<IStatus> StatusList = new List<IStatus>(); /// <summary> /// 璁惧淇℃伅鍙樺寲 @@ -2631,6 +2341,7 @@ /// </summary> IMqttClient localMqttClient = new MqttFactory().CreateMqttClient(); bool localMqttIsConnecting; + [Newtonsoft.Json.JsonIgnore] public bool localIsConnected; /// <summary> /// 鎵嬫満鏍囪瘑 @@ -2852,15 +2563,12 @@ /// 澶栫綉鐨凪QTT鏄惁姝e湪杩炴帴 /// </summary> static bool remoteMqttIsConnecting; - static bool IsLoginAgain; + /// <summary> /// 杩滅▼MqttClient /// </summary> - public static IMqttClient RemoteMqttClient= new MqttFactory().CreateMqttClient(); - static bool remoteIsConnected; - private int IsLogin = 0; - [Newtonsoft.Json.JsonIgnore] - static Action actionTemp; + public static IMqttClient RemoteMqttClient = new MqttFactory().CreateMqttClient(); + static bool remoteIsConnected; /// <summary> /// 鍚姩杩滅▼Mqtt @@ -3086,7 +2794,7 @@ localIsConnected = false; DebugPrintLog($"Local涓诲姩鏂紑_{s}"); //await localMqttClient.DisconnectAsync(new MQTTnet.Client.Disconnecting.MqttClientDisconnectOptions { }, CancellationToken.None); - await localMqttClient.DisconnectAsync(); + await localMqttClient.DisconnectAsync(); } } catch (Exception ex) @@ -3098,7 +2806,7 @@ /// <summary> /// 鏂紑杩滅▼Mqtt鐨勯摼鎺� /// </summary> - public static async System.Threading.Tasks.Task DisConnectRemoteMqttClient(string s="") + public static async System.Threading.Tasks.Task DisConnectRemoteMqttClient(string s = "") { try { @@ -3117,6 +2825,8 @@ } #endregion + + #region 鏁版嵁鍙戦�� /// <summary> /// 鍙戦�佹秷鎭埌鏈嶅姟鍣� @@ -3197,11 +2907,11 @@ if (IsRemote) { await SendRemoteMsg(topic, message, retain); - DebugPrintLog($"杩滅▼鈥斺�斿彂閫佸埌缃戝叧鐨勪富棰�:{topic}_鍙戦�佸埌缃戝叧鐨勬暟鎹�:{System.Text.Encoding.UTF8.GetString(message)}_褰撳墠缃戝叧{CurrentGateWayId}");//{System.DateTime.Now.ToString()}");// DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff") + DebugPrintLog($"杩滅▼鈥斺�斿彂閫佸埌缃戝叧鐨勪富棰�:{topic}_鍙戦�佸埌缃戝叧鐨勬暟鎹�:{System.Text.Encoding.UTF8.GetString(message)}");//{System.DateTime.Now.ToString()}");// DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff") } else { - DebugPrintLog($"灞�鍩熺綉鈥斺�斿彂閫佸埌缃戝叧鐨勪富棰�:{topic}_鍙戦�佸埌缃戝叧鐨勬暟鎹�:{System.Text.Encoding.UTF8.GetString(message)}_褰撳墠缃戝叧{CurrentGateWayId} 鏄惁鍔犲瘑:{IsEncry}"); + DebugPrintLog($"灞�鍩熺綉鈥斺�斿彂閫佸埌缃戝叧鐨勪富棰�:{topic}_鍙戦�佸埌缃戝叧鐨勬暟鎹�:{System.Text.Encoding.UTF8.GetString(message)}_鏄惁鍔犲瘑:{IsEncry}"); if (IsEncry) { @@ -3217,14 +2927,14 @@ { await localMqttClient.PublishAsync(new MqttApplicationMessage { Topic = topic, Payload = message, QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.ExactlyOnce, Retain = retain }); } - catch(Exception e) + catch (Exception e) { DebugPrintLog($"Local涓诲姩鏂紑_{e.Message}"); await DisConnectLocalMqttClient(e.Message); await StartLocalMqtt("ReConnect"); if (localIsConnected) { - DebugPrintLog($"灞�鍩熺綉鈥斺�斾簩娆″彂閫佸埌缃戝叧鐨勪富棰�:{topic}_鍙戦�佸埌缃戝叧鐨勬暟鎹�:{System.Text.Encoding.UTF8.GetString(message)}_褰撳墠缃戝叧{CurrentGateWayId} 鏄惁鍔犲瘑:{IsEncry}"); + DebugPrintLog($"灞�鍩熺綉鈥斺�斾簩娆″彂閫佸埌缃戝叧鐨勪富棰�:{topic}_鍙戦�佸埌缃戝叧鐨勬暟鎹�:{System.Text.Encoding.UTF8.GetString(message)}_鏄惁鍔犲瘑:{IsEncry}"); await localMqttClient.PublishAsync(new MqttApplicationMessage { Topic = topic, Payload = message, QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.ExactlyOnce, Retain = retain }); } } @@ -3269,7 +2979,7 @@ return; } - DebugPrintLog($"灞�鍩熺綉鈥斺�斿彂閫佸埌缃戝叧鐨勪富棰�:{topic}_鍙戦�佸埌缃戝叧鐨勬暟鎹�:{System.Text.Encoding.UTF8.GetString(message)}_褰撳墠缃戝叧{CurrentGateWayId} 鏄惁鍔犲瘑:{IsEncry}"); + DebugPrintLog($"灞�鍩熺綉鈥斺�斿彂閫佸埌缃戝叧鐨勪富棰�:{topic}_鍙戦�佸埌缃戝叧鐨勬暟鎹�:{System.Text.Encoding.UTF8.GetString(message)}_鏄惁鍔犲瘑:{IsEncry}"); if (IsEncry) { @@ -3292,7 +3002,7 @@ await StartLocalMqtt("ReConnect"); if (localIsConnected) { - DebugPrintLog($"灞�鍩熺綉鈥斺�斾簩娆″彂閫佸埌缃戝叧鐨勪富棰�:{topic}_鍙戦�佸埌缃戝叧鐨勬暟鎹�:{System.Text.Encoding.UTF8.GetString(message)}_褰撳墠缃戝叧{CurrentGateWayId} 鏄惁鍔犲瘑:{IsEncry}"); + DebugPrintLog($"灞�鍩熺綉鈥斺�斾簩娆″彂閫佸埌缃戝叧鐨勪富棰�:{topic}_鍙戦�佸埌缃戝叧鐨勬暟鎹�:{System.Text.Encoding.UTF8.GetString(message)}_鏄惁鍔犲瘑:{IsEncry}"); await localMqttClient.PublishAsync(new MqttApplicationMessage { Topic = topic, Payload = message, QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.ExactlyOnce, Retain = retain }); } } @@ -3304,13 +3014,9 @@ } } - [Serializable] - public class CloudTimeResponse - { - public string StateCode; - public string Info; - public string CloudTimestamp; - } + #endregion + + #region 鏁版嵁鎺ユ敹澶勭悊 /// <summary> /// 鎺ユ敹杩滅▼鏁版嵁澶勭悊 @@ -3423,7 +3129,7 @@ /// <param name="topic">Topic.</param> /// <param name="message">Message.</param> /// <param name="e">E.</param> - static void ReceiveMessage(string topic, string message, byte []payload) + static void ReceiveMessage(string topic, string message, byte[] payload) { try { @@ -3461,7 +3167,6 @@ } gwa.GwResDataAction?.Invoke(topic, message); - gwa.CurrentGateWayId = gatewayID; var jobject = new Newtonsoft.Json.Linq.JObject(); if (topic.Split('/')[0] + "/" + topic.Split('/')[1] == topic.Split('/')[0] + "/" + "FileTransfer") @@ -3505,121 +3210,13 @@ } #endregion - #region 璁惧鏂颁笂鎶� - //姝ラ1锛夌綉鍏冲憡鐭ュ鎴风鏈夋柊璁惧鍔犲叆zigbee缃戠粶銆� - if (topic == gatewayID + "/" + "Device/DeviceJoinZbNet_Respon") - { - var gatewayTemp = new ZbGateway() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; - gatewayTemp.deviceDeviceJoinZbNetResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceDeviceJoinZbNetResponData>(jobject["Data"].ToString()); - if (gatewayTemp.deviceDeviceJoinZbNetResponData == null) - { - return; - } - //涓婃姤绫诲瀷閫氱煡 - if (gwa.ReportAction != null) - { - DebugPrintLog("Device/DeviceJoinZbNet宸茬粡閫氱煡"); - gatewayTemp.CurrentGateWayId = gatewayID;//杩欓噷鐨凜urrentGateWayId鏄綋鍓嶆柊new ZbGateway鐨勫�� - gwa.ReportAction("Device/DeviceJoinZbNet", gatewayTemp); - } - } - //姝ラ2锛夌綉鍏冲憡鐭ュ鎴风鑾峰彇鏂拌澶囨墍鏈夌鐐逛俊鎭槸鍚︽垚鍔� - if (topic == gatewayID + "/" + "Device/IsGetEpointInfo_Respon") - { - var gatewayTemp = new ZbGateway() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; - gatewayTemp.deviceIsGetEpointInfoResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceIsGetEpointInfoResponData>(jobject["Data"].ToString()); - if (gatewayTemp.deviceIsGetEpointInfoResponData == null) - { - return; - } - //涓婃姤绫诲瀷閫氱煡 - if (gwa.ReportAction != null) - { - DebugPrintLog("Device/IsGetEpointInfo宸茬粡閫氱煡"); - gatewayTemp.CurrentGateWayId = gatewayID;//杩欓噷鐨凜urrentGateWayId鏄綋鍓嶆柊new ZbGateway鐨勫�� - gwa.ReportAction("Device/IsGetEpointInfo", gatewayTemp); - } - } - //姝ラ3锛夌綉鍏充笂鎶ヨ妭鐐硅澶囨墍鏈夌鐐逛俊鎭� - if (topic == gatewayID + "/" + "DeviceInComingRespon") - { - //鏂拌澶囦笂鎶ワ紝閲嶆柊鍙戣幏鍙栨墍鏈夌殑璁惧 - var tempDevice = new CommonDevice() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; - tempDevice.getNewDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.NewDeviceInfoData>(jobject["Data"].ToString()); - if (gwa.ReportAction != null) - { - DebugPrintLog("DeviceInComingRespon宸茬粡閫氱煡"); - gwa.ReportAction("DeviceInComingRespon", tempDevice.getNewDeviceInfo); - } - UpdateDeviceInfo(tempDevice, "DeviceInComingRespon"); - } - #endregion - #region 璁惧鍦ㄧ嚎鐘舵�佹洿鏂板弽棣� - else if (topic == gatewayID + "/" + "OnlineStatusChange_Respon") - { - var tempDevice = new CommonDevice() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; - tempDevice.IsOnline = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["IsOnline"].ToString()); - - if (gwa.ReportAction != null) - { - DebugPrintLog("OnlineStatusChange宸茬粡閫氱煡"); - gwa.ReportAction("OnlineStatusChange", tempDevice); - } - var infoTempDevice = gwa.DeviceList.Find(obj => obj.DeviceID == tempDevice.DeviceID && obj.DeviceAddr == tempDevice.DeviceAddr); - if (infoTempDevice == null) - { - gwa.DeviceList.Add(tempDevice); - UpdateDeviceInfo(tempDevice, "OnlineStatusChange"); - } - else - { - if (infoTempDevice.DeviceInfo != null) - { - infoTempDevice.DeviceInfo.IsOnline = infoTempDevice.IsOnline; - } - UpdateDeviceInfo(infoTempDevice, "OnlineStatusChange"); - } - } - #endregion - #region 璁惧琚垹闄や笂鎶� - else if (topic == gatewayID + "/" + "RemoveDeviceRespon") - { - var gatewayTemp = new ZbGateway() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; - gatewayTemp.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.RemoveDeviceResponseData>(jobject["Data"].ToString()); - if (gatewayTemp.removeDeviceResponseData != null) - { - try - { - if (gatewayTemp.removeDeviceResponseData.Result == 0) - { - foreach (var delD in gatewayTemp.removeDeviceResponseData.DeviceList) - { - var tempDevice = new CommonDevice() { DeviceAddr = jobject.Value<string>("DeviceAddr"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; - tempDevice.removeDeviceResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.RemoveDeviceResponseData>(jobject["Data"].ToString()); - if (tempDevice.removeDeviceResponseData == null) - { - return; - } - else - { - UpdateDeviceInfo(tempDevice, "RemoveDeviceRespon"); - if (tempDevice.removeDeviceResponseData.Result == 0) - { - var infoTempDevice = gwa.DeviceList.Find((CommonDevice obj) => obj.DeviceID == tempDevice.DeviceID && obj.DeviceAddr == tempDevice.DeviceAddr && obj.DeviceEpoint == tempDevice.DeviceEpoint); - if (infoTempDevice != null) - { - gwa.DeviceList.Remove(infoTempDevice); - } - } - } - } - } - } - catch { } - } - } + #region 璁惧鍦ㄧ嚎鐘舵�佹洿鏂板弽棣� + + //2020.05.11 鍒犻櫎 + #endregion + #region 璁惧鐘舵�佷笂鎶� else if (topic == gatewayID + "/" + "DeviceStatusReport" + "/" + addr + "/" + epoint + "/" + cluID + "/" + attrId) { @@ -3628,7 +3225,7 @@ var tempEpoint = jobject.Value<int>("Epoint"); var dataId = jobject.Value<int>("Data_ID"); - var tempDevice = new CommonDevice { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint, DataID = dataId }; + var tempDevice = new CommonDevice { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint }; tempDevice.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DeviceStatusReportData>(jobject["Data"].ToString()); UpdateDeviceInfo(tempDevice, "DeviceStatusReport"); } @@ -3640,7 +3237,7 @@ switch ((DeviceType)(deviceID)) { case DeviceType.DoorLock: - var doorLock = new DoorLock() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; + var doorLock = new DoorLock() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; var OperatingEventNotificationDatad = Newtonsoft.Json.JsonConvert.DeserializeObject<ZigBee.Device.DoorLock.DoorLockOperatingEventNotificationCommand>(jobject["Data"].ToString()); if (OperatingEventNotificationDatad != null) { @@ -3663,7 +3260,7 @@ switch ((DeviceType)(deviceID)) { case DeviceType.DoorLock: - var doorLock = new DoorLock() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; + var doorLock = new DoorLock() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; var ProgrammingEventNotificationData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZigBee.Device.DoorLock.DoorLockProgrammingEventNotificationCommand>(jobject["Data"].ToString()); if (ProgrammingEventNotificationData != null) { @@ -3677,35 +3274,18 @@ UpdateDeviceInfo(doorLock, "DoorLockProgrammingEventNotificationCommand"); break; } - } + } #endregion #region IAS瀹夐槻淇℃伅涓婃姤 - else if (topic == gatewayID + "/" + "IASInfoReport") - { - var deviceID = jobject.Value<int>("Device_ID"); - switch ((DeviceType)(deviceID)) - { - case DeviceType.IASZone: - var ias = new IASZone() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; - ias.iASInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<IASZone.IASInfoData>(jobject["Data"].ToString()); - //涓婃姤绫诲瀷閫氱煡锛屽繀闇�鍏堣皟鐢紝鐒跺悗鎵嶆湁閫氱煡锛屽惁鍒欐槸绌轰笉浼氶�氱煡鐨� - if (gwa.ReportAction != null) - { - DebugPrintLog("IASInfoReport宸茬粡閫氱煡"); - //ias.Save(); - gwa.ReportAction("IASInfoReport", ias.iASInfo); - } - UpdateDeviceInfo(ias, "IASInfoReport"); - break; - } - } + + //2020.05.11 鍒犻櫎 + #endregion #region 涓嬭浇杩涘害涓婃姤 else if (topic == gatewayID + "/" + "DownloadFile_Progress") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.downloadFileProgressResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<DownloadFileProgressResponData>(jobject["Data"].ToString()); - if (gatewayTemp.downloadFileProgressResponData == null) + gwa.downloadFileProgressResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DownloadFileProgressResponData>(jobject["Data"].ToString()); + if (gwa.downloadFileProgressResponData == null) { return; } @@ -3713,15 +3293,13 @@ if (gwa.ReportAction != null) { DebugPrintLog("DownloadFileProgress"); - gatewayTemp.CurrentGateWayId = gatewayID;//杩欓噷鐨凜urrentGateWayId鏄綋鍓嶆柊new ZbGateway鐨勫�� - gwa.ReportAction("DownloadFileProgress", gatewayTemp); + gwa.ReportAction("DownloadFileProgress", gwa); } } else if (topic == gatewayID + "/" + "ZbGwOperation/Upgrade_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.zbGwOperationUpgradeData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGwOperationUpgradeData>(jobject["Data"].ToString()); - if (gatewayTemp.zbGwOperationUpgradeData == null) + gwa.zbGwOperationUpgradeData = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGwOperationUpgradeData>(jobject["Data"].ToString()); + if (gwa.zbGwOperationUpgradeData == null) { return; } @@ -3729,16 +3307,14 @@ if (gwa.ReportAction != null) { DebugPrintLog("鍗忚皟鍣ㄥ崌绾х櫨鍒嗘瘮"); - gatewayTemp.CurrentGateWayId = gatewayID;//杩欓噷鐨凜urrentGateWayId鏄綋鍓嶆柊new ZbGateway鐨勫�� - gwa.ReportAction("CordinatorUpgradePercent", gatewayTemp); + gwa.ReportAction("CordinatorUpgradePercent", gwa); } } else if (topic == gatewayID + "/" + "OTA/Schedule_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.oTAScheduleResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<OTAScheduleResponData>(jobject["Data"].ToString()); + gwa.oTAScheduleResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.OTAScheduleResponData>(jobject["Data"].ToString()); - if (gatewayTemp.oTAScheduleResponData == null) + if (gwa.oTAScheduleResponData == null) { return; } @@ -3747,16 +3323,14 @@ if (gwa.ReportAction != null) { DebugPrintLog("鑺傜偣璁惧鍗囩骇鐧惧垎姣�"); - gatewayTemp.CurrentGateWayId = gatewayID;//杩欓噷鐨凜urrentGateWayId鏄綋鍓嶆柊new ZbGateway鐨勫�� - gwa.ReportAction("DeviceUpgradePercent", gatewayTemp); + gwa.ReportAction("DeviceUpgradePercent", gwa); } } else if (topic == gatewayID + "/" + "VirtualDrive/Upgrade_Respon") { - var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; - gatewayTemp.virtualDriveUpgradeResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<VirtualDriveUpgradeResponData>(jobject["Data"].ToString()); + gwa.virtualDriveUpgradeResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<VirtualDriveUpgradeResponData>(jobject["Data"].ToString()); - if (gatewayTemp.virtualDriveUpgradeResponData == null) + if (gwa.virtualDriveUpgradeResponData == null) { return; } @@ -3764,18 +3338,16 @@ if (gwa.ReportAction != null) { DebugPrintLog("铏氭嫙椹卞姩鍗囩骇鐧惧垎姣�"); - gatewayTemp.CurrentGateWayId = gatewayID;//杩欓噷鐨凜urrentGateWayId鏄綋鍓嶆柊new ZbGateway鐨勫�� - gwa.ReportAction("VirtualDriveUpgrade", gatewayTemp); + gwa.ReportAction("VirtualDriveUpgrade", gwa); } } #endregion #region 閲嶅惎缃戝叧绯荤粺 else if (topic == gatewayID + "/" + "GwReboot_Respon") { - var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID") }; - gatewayTemp.gwRebootResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<GwRebootResponData>(jobject["Data"].ToString()); + var gwRebootResponData = Newtonsoft.Json.JsonConvert.DeserializeObject<GwRebootResponData>(jobject["Data"].ToString()); - if (gatewayTemp.gwRebootResponData == null) + if (gwRebootResponData == null) { return; } @@ -3783,8 +3355,7 @@ if (gwa.ReportAction != null) { DebugPrintLog("GwReboot_Respon宸茬粡閫氱煡"); - gatewayTemp.CurrentGateWayId = gatewayID;//杩欓噷鐨凜urrentGateWayId鏄綋鍓嶆柊new ZbGateway鐨勫�� - gwa.ReportAction("GwReboot_Respon", gatewayTemp); + gwa.ReportAction("GwReboot_Respon", gwRebootResponData); } } #endregion @@ -3893,22 +3464,6 @@ } } #endregion - #region 鑺傜偣璁惧榛樿鍙嶉 - else if (topic == gatewayID + "/" + "DeviceDefaultAck") - { - var deviceDefaultAck = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gwa.getGatewayBaseInfo.gwID }; - if (deviceDefaultAck == null) - { - return; - } - //涓婃姤绫诲瀷閫氱煡 - if (gwa.ReportAction != null) - { - DebugPrintLog("DeviceDefaultAck"); - gwa.ReportAction("DeviceDefaultAck", deviceDefaultAck); - } - } - #endregion #region 璁惧璇锋眰APP鑾峰彇鍗囩骇鏁版嵁 else if (topic == gatewayID + "/" + "ZbDataPassthrough") @@ -3916,7 +3471,7 @@ //涓婃姤绫诲瀷閫氱煡 if (gwa.ReportAction != null) { - var clientDataPassthrough = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString()); + var clientDataPassthrough = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.ClientDataPassthroughResponseData>(jobject["Data"].ToString()); if (clientDataPassthrough != null) { DebugPrintLog("DeviceRequestAcUpdateData"); @@ -3932,5 +3487,40 @@ } } + + #endregion + + #region 淇濆瓨缂撳瓨 + + /// <summary> + /// 閲嶆柊淇濆瓨璁惧 + /// </summary> + public void ReSave() + { + Global.WriteFileByBytesByHomeId(FilePath, System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this))); + } + #endregion + + #region 璋冭瘯鎵撳嵃 + + /// <summary> + /// 璋冭瘯鏃舵墦寮�鎵撳嵃淇℃伅锛宼rue:鎵撳嵃锛宖alse:涓嶆墦鍗� + /// </summary> + /// <param name="msg">Message.</param> + /// <param name="flage">If set to <c>true</c> flage.</param> + public static void DebugPrintLog(string msg, bool flage = true) + { +#if DEBUG + if (flage == true) + { + if (msg.Contains("DeviceStatusReport") == false) + { + System.Console.WriteLine(msg + " " + System.DateTime.Now.ToLongTimeString() + " " + System.DateTime.Now.Millisecond); + } + } +#endif + } + + #endregion } } diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs index e77d781..c4b44cc 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs @@ -4,9 +4,9 @@ namespace ZigBee.Device { - public class ZbGatewayData : CommonDevice + public class ZbGatewayData { - #region 鏂拌拷鍔犵殑涓�浜涘彉閲� + #region 涓�鍫嗗彉閲� /// <summary> /// 鍒ゆ柇缃戝叧鏄惁鍦ㄧ嚎鐨勬爣璇嗭紝APP鐣岄潰浼氭敼鍙樺畠鐨勫��,Application浼氶噸鏂板埛鏂板畠鐨勫�� /// </summary> @@ -15,57 +15,32 @@ /// 缃戝叧鎵�鍦ㄧ殑鎴块棿ID /// </summary> public string RoomId = string.Empty; - - #endregion - - [Newtonsoft.Json.JsonIgnore] /// <summary> /// 铏氭嫙缃戝叧 /// </summary> - public bool IsVirtual; - - #region 缃戝叧鍩烘湰淇℃伅 + [Newtonsoft.Json.JsonIgnore] + public bool IsVirtual; /// <summary> - /// 璇ョ綉鍏冲簲鐢ㄧ▼搴忕増鏈� + /// 鏈�鍚庣殑鏇存柊鏃堕棿 /// </summary> - public long AppVersion; + [Newtonsoft.Json.JsonIgnore] + public DateTime LastDateTime = DateTime.MinValue; - /// <summary> - /// Zigbee鍗忚鍣ㄧ▼搴忕増鏈� - /// </summary> - public int ZigbeeVersion; #endregion #region 缃戝叧淇℃伅. /// <summary> /// 缃戝叧鐗堟湰淇℃伅,缃戝叧鍙嶉淇℃伅 /// </summary> - public GetGwVersionAllData getGwVersionAllData; - /// <summary> - /// 缃戝叧鐗堟湰淇℃伅,缃戝叧鍙嶉淇℃伅 - /// </summary> [System.Serializable] - public class GetGwVersionAllData + public class GetGwVersionAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 缃戝叧鐗堟湰淇℃伅 /// </summary> public GetGwVersionData getGwVersion; } - /// <summary> - /// 缃戝叧鐗堟湰淇℃伅 - /// </summary> - public GetGwVersionData getGwVersion; /// <summary> /// 缃戝叧鐗堟湰淇℃伅 /// </summary> @@ -84,25 +59,13 @@ #endregion #region 鑾峰彇缃戝叧淇℃伅. - /// <summary> - /// 缃戝叧淇℃伅,缃戝叧鍙嶉鍏蜂綋淇℃伅. - /// </summary> - public GetGwAllData getGwAllData; + /// <summary> /// 缃戝叧淇℃伅,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> [System.Serializable] - public class GetGwAllData + public class GetGwAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 缃戝叧淇℃伅 /// </summary> @@ -114,7 +77,7 @@ /// </summary> public GetGwData getGwInfo; /// <summary> - /// 缃戝叧淇℃伅 + /// 缃戝叧淇℃伅(灞忚斀鎺変簡涓�浜涚洰鍓嶄笉浣跨敤鐨勫彉閲�) /// </summary> [System.Serializable] public class GetGwData @@ -122,10 +85,11 @@ ///<summary> ///缃戝叧搴忓垪鍙凤紝璇ョ綉鍏冲敮涓�鏍囪瘑 /// </summary> - public string GwId; + public string GwId; /// <summary> ///缃戝叧缁戝畾缃戝崱鐨刴ac鍦板潃 /// </summary> + [Newtonsoft.Json.JsonIgnore] public string GwMac; /// <summary> ///缃戝叧鍚嶇О @@ -140,61 +104,71 @@ ///<para>0锛氬惁</para> ///<para>1锛氭槸</para> /// </summary> - public int IsDominant; + public int IsDominant; ///<summary> ///utc鏃堕棿鎴筹紝绋嬪簭鍚姩鏃剁綉鍏崇殑绯荤粺鏃堕棿 ///</summary> - public long StartTime; + [Newtonsoft.Json.JsonIgnore] + public long StartTime; /// <summary> ///鍔犲叆灞�鍩熺綉妯″紡 ///<para>0锛歸ifi杩炴帴灞�鍩熺綉</para> ///<para>1锛氭湁绾胯繛鎺ュ眬鍩熺綉</para> ///<para>2锛氭湭鍔犲叆灞�鍩熺綉</para> /// </summary> + [Newtonsoft.Json.JsonIgnore] public int JoinMode; /// <summary> ///缃戝叧鎵�鍦ㄥ眬鍩熺綉鐨刬p鍦板潃 /// </summary> - public string GwIP; + public string GwIP; /// <summary> /// 涓讳汉鐨凣uid(鍗充娇鏄鐞嗗憳,杩欓噷涔熸槸涓讳汉鐨凣uid) /// </summary> + [Newtonsoft.Json.JsonIgnore] public string AccountId; /// <summary> ///褰撳墠灞�鍩熺綉缃戠粶鍙峰崰鐢ㄤ綅鏁帮紝鐢ㄤ簬璁$畻瀛愮綉鎺╃爜锛屽Mask=32锛屽垯瀛愮綉鎺╃爜涓�255.255.255.0 /// </summary> - public int Mask; + [Newtonsoft.Json.JsonIgnore] + public int Mask; /// <summary> ///涓婄骇璺敱鍣ㄦ棤绾垮悕绉� ///<para>褰� JoinMode = 0鏃跺瓨鍦� </para> /// </summary> - public string RouteESSID; + [Newtonsoft.Json.JsonIgnore] + public string RouteESSID; /// <summary> ///DNS鏈嶅姟鍣ㄥ湴鍧� /// </summary> + [Newtonsoft.Json.JsonIgnore] public string DNSServer; /// <summary> - /// 璇ョ綉鍏冲簲鐢ㄧ▼搴忕増鏈� + /// 璇ョ綉鍏冲簲鐢ㄧ▼搴忕増鏈�(缃戝叧鍥轰欢鏃ユ湡锛燂紵) /// </summary> - public long AppVersion; + public long AppVersion; /// <summary> /// Zigbee鍗忚鍣ㄧ▼搴忕増鏈� /// </summary> - public int ZigbeeVersion; + [Newtonsoft.Json.JsonIgnore] + public int ZigbeeVersion; /// <summary> ///鍗忚皟鍣╩ac鍦板潃 /// </summary> - public string ZigbeeMacAddr; + [Newtonsoft.Json.JsonIgnore] + public string ZigbeeMacAddr; /// <summary> ///缃戝叧瀹卛d /// </summary> - public string HomeId; + [Newtonsoft.Json.JsonIgnore] + public string HomeId; /// <summary> ///鏄惁宸茬粡杩炴帴浜戠mqtt ///<para>0锛氬惁</para> ///<para>1锛氭槸</para> /// </summary> - public int IsConnectCloud; + [Newtonsoft.Json.JsonIgnore] + public int IsConnectCloud; /// <summary> ///锛堢敤浜庣綉鍏崇▼搴忚皟璇曪級 ///<para>https鐧婚檰浜戠鏃讹紝鏈�杩戜竴娆¤幏鍙栫殑鍝嶅簲鐘舵�佺爜銆傛牴鎹簯绔殑瀹氫箟锛屾湁濡備笅鐘舵�佺爜銆�</para> @@ -203,6 +177,7 @@ ///<para>(3)NoBind,鍒欏搷搴斿瓧娈典腑[ErrorInfo] 涓洪敊璇俊鎭痆鎮ㄦ墍鎻愪氦鐨刐GatewayUniqueId 缃戝叧鍞竴Id(MAC)]鍜孾浣忓畢涓婚敭Id]涓嶅瓨鍦ㄧ粦瀹氱殑鍏崇郴]</para> ///<para>(4)YouDataNoIsLocalRegion,鍒欏搷搴斿瓧娈典腑[ErrorInfo] 涓洪敊璇俊鎭痆鎮ㄧ殑鐨勬暟鎹苟涓嶅湪姝DL鍖哄煙鏈嶅姟鍣�, 璇烽噸瀹氬悜鍒板涓婬DL鍖哄煙鏈嶅姟鍣ㄨ繘琛屽鐞�.]</para> /// </summary> + [Newtonsoft.Json.JsonIgnore] public string StateCode; /// <summary> ///Linux缃戝叧绫诲瀷 @@ -227,12 +202,12 @@ /// <summary> /// 缃戝叧闀滃儚绫诲瀷 /// </summary> - public int ZbImageType; - + public int ZbImageType; /// <summary> /// 铏氭嫙椹卞姩淇℃伅 /// </summary> - public List <DriveCodeListObj> DriveCodeList = new List<DriveCodeListObj>(); + [Newtonsoft.Json.JsonIgnore] + public List<DriveCodeListObj> DriveCodeList = new List<DriveCodeListObj>(); } public class DriveCodeListObj @@ -264,32 +239,15 @@ /// <summary> /// 淇敼缃戝叧鍚嶇О,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public GwReNameAllData gwReNameAllData; - /// <summary> - /// 淇敼缃戝叧鍚嶇О,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] - public class GwReNameAllData + public class GwReNameAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 淇敼缃戝叧鍚嶇О /// </summary> public GwReNameData gwReNameData; } - /// <summary> - /// 淇敼缃戝叧鍚嶇О - /// </summary> - public GwReNameData gwRename; /// <summary> /// 淇敼缃戝叧鍚嶇О /// </summary> @@ -307,32 +265,15 @@ /// <summary> /// 缃戝叧浣忓畢id鏁版嵁,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public GwSetHomeIdAllData gwSetHomeIdAllData; - /// <summary> - /// 缃戝叧浣忓畢id鏁版嵁,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] - public class GwSetHomeIdAllData + public class GwSetHomeIdAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 缃戝叧浣忓畢id鏁版嵁 /// </summary> public GwSetHomeIdData gwSetHomeIdData; } - /// <summary> - /// 缃戝叧浣忓畢id鏁版嵁 - /// </summary> - public GwSetHomeIdData gwSetHomeId; /// <summary> /// 缃戝叧浣忓畢id鏁版嵁 /// </summary> @@ -346,11 +287,11 @@ } /// <summary> - /// 骞挎挱鍙戠幇鍗忚 + /// 骞挎挱鍙戠幇鍗忚(灞忚斀鎺変簡涓�浜涚洰鍓嶄笉鐢ㄧ殑鍙橀噺) /// </summary> - public GatewayBaseInfo getGatewayBaseInfo = new GatewayBaseInfo { }; + public GatewayBaseInfo getGatewayBaseInfo = new GatewayBaseInfo(); /// <summary> - /// 骞挎挱鍙戠幇鍗忚 + /// 骞挎挱鍙戠幇鍗忚(灞忚斀鎺変簡涓�浜涚洰鍓嶄笉鐢ㄧ殑鍙橀噺) /// </summary> [System.Serializable] public class GatewayBaseInfo @@ -362,10 +303,11 @@ /// <summary> /// 浣忓畢id锛�4瀛楄妭鏁村瀷銆傦紙灏忕缁撴瀯锛夊鏋滅綉鍏充笉璁剧疆瀹卛d锛屽皢榛樿涓�0 /// </summary> - public string HomeId = string.Empty; + public string HomeId = string.Empty; /// <summary> /// 缃戝叧褰撳墠鏃堕棿鎴筹紙灏忕缁撴瀯锛� /// </summary> + [Newtonsoft.Json.JsonIgnore] public int Time; /// <summary> /// 鏄惁涓轰富缃戝叧 @@ -376,30 +318,11 @@ /// </summary> public string GwName; /// <summary> - /// RSA鍏挜 - /// </summary> - //public string PubKey; - //string id; - /// <summary> /// 缃戝叧ID /// </summary> public string gwID; - //{ - // get{ - // return id; - // } - // set{ - // id = value; - // //System.Console.WriteLine("===========123456"); - // } - //} - } - /// <summary> - /// 缃戝叧鎴愪负涓荤綉鍏虫椂骞挎挱閫氱煡 - /// </summary> - public MainGatewayBaseInfo getMainGatewayBaseInfo; /// <summary> /// 缃戝叧鎴愪负涓荤綉鍏虫椂骞挎挱閫氱煡 /// </summary> @@ -447,22 +370,9 @@ /// <summary> /// 缃戝叧鎭㈠鍑哄巶璁剧疆杩斿洖鐨勬暟鎹�. /// </summary> - public GwLinuxResetResponData gwLinuxResetResponData; - /// <summary> - /// 缃戝叧鎭㈠鍑哄巶璁剧疆杩斿洖鐨勬暟鎹�. - /// </summary> [System.Serializable] - public class GwLinuxResetResponData + public class GwLinuxResetResponData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>缃戝叧鎭㈠鍑哄巶璁剧疆</para> - /// </summary> - public ErrorResponData errorResponData; ///<summary > /// <para>0锛氬懡浠ゅ凡鎺ユ敹锛岀郴缁熷嵆灏嗘仮澶嶅嚭鍘傚苟閲嶅惎銆�</para> /// </summary> @@ -475,32 +385,15 @@ /// <summary> /// 閲嶅惎缃戝叧绯荤粺杩斿洖鏁版嵁 /// </summary> - public GwRebootResponAllData gwRebootResponAllData; - /// <summary> - /// 閲嶅惎缃戝叧绯荤粺杩斿洖鏁版嵁 - /// </summary> [System.Serializable] - public class GwRebootResponAllData + public class GwRebootResponAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; ///<summary > /// <para>杩斿洖鍊兼槸0:鍛戒护宸叉帴鏀讹紝绯荤粺鍗冲皢閲嶅惎銆�</para> /// </summary> public int Result = 999; } - /// <summary> - /// 閲嶅惎缃戝叧绯荤粺杩斿洖鏁版嵁 - /// </summary> - public GwRebootResponData gwRebootResponData; /// <summary> /// 閲嶅惎缃戝叧绯荤粺杩斿洖鏁版嵁 /// </summary> @@ -519,32 +412,15 @@ /// <summary> /// 淇濆瓨zigbee鍗忚皟鍣ㄧ粍缃戜俊鎭�,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public SaveNVFileResponseAllData saveNVFileResponseData; - /// <summary> - /// 淇濆瓨zigbee鍗忚皟鍣ㄧ粍缃戜俊鎭�,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] - public class SaveNVFileResponseAllData + public class SaveNVFileResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 淇濆瓨zigbee鍗忚皟鍣ㄧ粍缃戜俊鎭� /// </summary> public SaveNVFileResponseData saveNVFileResponseData; } - /// <summary> - /// 淇濆瓨zigbee鍗忚皟鍣ㄧ粍缃戜俊鎭� - /// </summary> - public SaveNVFileResponseData zbGwOperationSaveNVFileData; /// <summary> /// 淇濆瓨zigbee鍗忚皟鍣ㄧ粍缃戜俊鎭� /// </summary> @@ -565,32 +441,15 @@ /// <summary> /// 鍗忚皟鍣ㄦ仮澶嶇粍缃戜俊鎭�,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public RestoreNVAllDtta restoreNVAllDtta; - /// <summary> - /// 鍗忚皟鍣ㄦ仮澶嶇粍缃戜俊鎭�,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] - public class RestoreNVAllDtta + public class RestoreNVAllDtta : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鍗忚皟鍣ㄦ仮澶嶇粍缃戜俊鎭� /// </summary> public RestoreNVDtta restoreNVDtta; } - /// <summary> - /// 鍗忚皟鍣ㄦ仮澶嶇粍缃戜俊鎭� - /// </summary> - public RestoreNVDtta restoreNVDtta; /// <summary> /// 鍗忚皟鍣ㄦ仮澶嶇粍缃戜俊鎭� /// </summary> @@ -609,25 +468,24 @@ #endregion #region 鍗忚皟鍣ㄥ崌绾� + /// <summary> - /// 鍗忚皟鍣ㄥ崌绾�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// 涓嬭浇杩涘害 + /// </summary + [Newtonsoft.Json.JsonIgnore] + public CommonDevice.DownloadFileProgressResponData downloadFileProgressResponData = null; + /// <summary> + /// 鍚姩鍗囩骇 /// </summary> - public ZbGwOperationUpgradeAllData zbGwOperationUpgradeAllData; + [Newtonsoft.Json.JsonIgnore] + public CommonDevice.OTAScheduleResponData oTAScheduleResponData = null; + /// <summary> /// 鍗忚皟鍣ㄥ崌绾�,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> [System.Serializable] - public class ZbGwOperationUpgradeAllData + public class ZbGwOperationUpgradeAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鍗忚皟鍣ㄥ崌绾� /// </summary> @@ -637,6 +495,7 @@ /// <summary> /// 鍗忚皟鍣ㄥ崌绾� /// </summary> + [Newtonsoft.Json.JsonIgnore] public ZbGwOperationUpgradeData zbGwOperationUpgradeData; /// <summary> /// 鍗忚皟鍣ㄥ崌绾� @@ -667,22 +526,9 @@ /// <summary> /// 鍗囩骇铏氭嫙椹卞姩璁惧,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public VirtualDriveUpgradeResponseAllData virtualDriveUpgradeResponseAllData; - /// <summary> - /// 鍗囩骇铏氭嫙椹卞姩璁惧,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] - public class VirtualDriveUpgradeResponseAllData + public class VirtualDriveUpgradeResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鍗囩骇铏氭嫙椹卞姩璁惧 /// </summary> @@ -691,7 +537,11 @@ /// <summary> /// 鍗囩骇铏氭嫙椹卞姩璁惧 /// </summary> + [Newtonsoft.Json.JsonIgnore] public VirtualDriveUpgradeResponData virtualDriveUpgradeResponData; + /// <summary> + /// 鍗囩骇铏氭嫙椹卞姩璁惧 + /// </summary> [System.Serializable] public class VirtualDriveUpgradeResponData { @@ -720,22 +570,9 @@ /// <summary> /// 鏌ョ湅缃戝叧璁板綍鐨勮櫄鎷熼┍鍔�,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public CheckVDDriveCodeResponseAllData checkVDDriveCodeResponseAllData; - /// <summary> - /// 鏌ョ湅缃戝叧璁板綍鐨勮櫄鎷熼┍鍔�,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] - public class CheckVDDriveCodeResponseAllData + public class CheckVDDriveCodeResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鏌ョ湅缃戝叧璁板綍鐨勮櫄鎷熼┍鍔� /// </summary> @@ -744,7 +581,6 @@ /// <summary> /// 鏌ョ湅缃戝叧璁板綍鐨勮櫄鎷熼┍鍔� /// </summary> - public VDriveDriveCodeResponData vDriveDriveCodeResponData; [System.Serializable] public class VDriveDriveCodeResponData { @@ -786,22 +622,9 @@ /// <summary> /// 缃戝叧绯荤粺鍗囩骇,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public LinuxUpgradeAllData linuxUpgradeAllData; - /// <summary> - /// 缃戝叧绯荤粺鍗囩骇,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] - public class LinuxUpgradeAllData + public class LinuxUpgradeAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 0锛氭甯革紙榛樿鍥炲锛� ///<para>1锛氭壘涓嶅埌鍗囩骇鍥轰欢锛岃矾寰勬垨鍗囩骇鍥轰欢鍚嶇О閿欒銆�</para> @@ -817,22 +640,9 @@ /// <summary> /// 鑾峰彇鍗忚皟鍣ㄥ綋鍓嶄俊閬�,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public GwGetChannelResponData zbGwGetChannelResponData; - /// <summary> - /// 鑾峰彇鍗忚皟鍣ㄥ綋鍓嶄俊閬�,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] - public class GwGetChannelResponData + public class GwGetChannelResponData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鍗忚皟鍣ㄥ綋鍓嶄俊閬� /// </summary> @@ -845,32 +655,15 @@ /// <summary> /// 鏇存敼鍗忚皟鍣ㄥ綋鍓嶄俊閬�,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public ChangeChannelResponAllData changeChannelResponAllData; - /// <summary> - /// 鏇存敼鍗忚皟鍣ㄥ綋鍓嶄俊閬�,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] - public class ChangeChannelResponAllData + public class ChangeChannelResponAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鏇存敼鍗忚皟鍣ㄥ綋鍓嶄俊閬撴暟鎹� /// </summary> public ChangeChannelResponData changeChannelResponData; } - /// <summary> - /// 鏇存敼鍗忚皟鍣ㄥ綋鍓嶄俊閬撴暟鎹� - /// </summary> - public ChangeChannelResponData changeChannelResponData; /// <summary> /// 鏇存敼鍗忚皟鍣ㄥ綋鍓嶄俊閬撴暟鎹� /// </summary> @@ -891,25 +684,13 @@ } #endregion - /// <summary> - /// 璇诲彇鍗忚皟鍣∕AC鍦板潃,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> - public GetMacResponData getMacResponData; + #region 璇诲彇鍗忚皟鍣∕AC鍦板潃 /// <summary> /// 璇诲彇鍗忚皟鍣∕AC鍦板潃,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> [System.Serializable] - public class GetMacResponData + public class GetMacResponData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鍗忚皟鍣╩ac鍦板潃 /// </summary> @@ -927,28 +708,15 @@ public string MacAddr; } - //#endregion + #endregion #region 鍚敤鎴栧叧闂�忎紶鏁版嵁涓婁紶鎺ュ彛 /// <summary> /// 閫忎紶鏁版嵁涓婁紶鎺ュ彛,缃戝叧鍙嶉淇℃伅 /// </summary> - public PassthroughAllData passthroughAllData; - /// <summary> - /// 閫忎紶鏁版嵁涓婁紶鎺ュ彛,缃戝叧鍙嶉淇℃伅 - /// </summary> [System.Serializable] - public class PassthroughAllData + public class PassthroughAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 宸茬粡杞崲鎴愬瓧绗︽牸寮忕殑16杩涘埗鐨勯�忎紶鏁版嵁 /// </summary> @@ -961,17 +729,8 @@ /// 瀹㈡埛绔彂閫佹枃浠舵祦鍒扮綉鍏� /// </summary> [System.Serializable] - public class SendFileResponseAllData + public class SendFileResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 0: 鏁版嵁鍐欏叆鎴愬姛,璇锋眰鍙戦�佷笅涓�涓暟鎹寘 ///<para>1锛氭暟鎹啓鍏ュけ璐�</para> @@ -988,61 +747,31 @@ /// <summary> /// 瀹㈡埛绔彂閫佸垱寤烘枃浠跺懡浠�,缃戝叧鍙嶉淇℃伅 /// </summary> - public CreateFileResponseAllData createFileResponseAllData; - /// <summary> - /// 瀹㈡埛绔彂閫佸垱寤烘枃浠跺懡浠�,缃戝叧鍙嶉淇℃伅 - /// </summary> [System.Serializable] - public class CreateFileResponseAllData + public class CreateFileResponseAllData : CommonDevice.ErrorResponCommon { /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; - /// <summary> /// 0锛氬垱寤烘垚鍔� ///<para>1锛氬け璐ワ紝鏃犳硶鍒涘缓鏂囦欢</para> ///<para>2锛氬け璐ワ紝璇ュ鎴风鏈夋枃浠惰繕娌′笂浼犲畬鎴愶紝璇风瓑寰呮枃浠朵笂浼犲畬姣曪紙涓�涓鎴风鍙兘鍚屾椂涓婁紶涓�涓枃浠讹級</para> /// </summary> public int Result = 999; - } + } #endregion #region 鏌ョ湅缃戝叧鐩綍鏂囦欢淇℃伅 /// <summary> /// 鏌ョ湅缃戝叧鐩綍鏂囦欢淇℃伅,缃戝叧鍙嶉淇℃伅 /// </summary> - public FileTransferLsDiResponseAllData fileTransferLsDiResponseAllData; - /// <summary> - /// 鏌ョ湅缃戝叧鐩綍鏂囦欢淇℃伅,缃戝叧鍙嶉淇℃伅 - /// </summary> [System.Serializable] - public class FileTransferLsDiResponseAllData + public class FileTransferLsDiResponseAllData : CommonDevice.ErrorResponCommon { /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; - /// <summary> /// 鏌ョ湅缃戝叧鐩綍鏂囦欢淇℃伅 /// </summary> public FileTransferLsDiResponseData fileTransferLsDiResponseData; } - /// <summary> - /// 鏌ョ湅缃戝叧鐩綍鏂囦欢淇℃伅,缃戝叧鍙嶉淇℃伅 - /// </summary> - public FileTransferLsDiResponseData fileTransferLsDiResponseData; /// <summary> /// 瀹㈡埛绔彂閫佸垱寤烘枃浠跺懡浠�,缃戝叧鍙嶉淇℃伅 /// </summary> @@ -1087,32 +816,15 @@ /// <summary> /// 瀹㈡埛绔瀹氳涓嬭浇鐨勬枃浠跺悕绉板拰璺緞,缃戝叧鍙嶉淇℃伅 /// </summary> - public SetDownloadFileResponseAllData setDownloadFileResponseAllData; - /// <summary> - /// 瀹㈡埛绔瀹氳涓嬭浇鐨勬枃浠跺悕绉板拰璺緞,缃戝叧鍙嶉淇℃伅 - /// </summary> [System.Serializable] - public class SetDownloadFileResponseAllData + public class SetDownloadFileResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 瀹㈡埛绔瀹氳涓嬭浇鐨勬枃浠跺悕绉板拰璺緞 /// </summary> public SetDownloadFileResponseData setDownloadFileResponseData; } - /// <summary> - /// 瀹㈡埛绔瀹氳涓嬭浇鐨勬枃浠跺悕绉板拰璺緞,缃戝叧鍙嶉淇℃伅 - /// </summary> - public SetDownloadFileResponseData setDownloadFileResponseData; /// <summary> /// 瀹㈡埛绔瀹氳涓嬭浇鐨勬枃浠跺悕绉板拰璺緞,缃戝叧鍙嶉淇℃伅 /// </summary> @@ -1142,32 +854,15 @@ /// <summary> /// 鏌ョ湅鍗曚釜鏂囦欢淇℃伅鏁版嵁 /// </summary> - public FileTransferGetFileInfoResponseAllData fileTransferGetFileInfoResponseAllData; - /// <summary> - /// 鏌ョ湅鍗曚釜鏂囦欢淇℃伅鏁版嵁 - /// </summary> [System.Serializable] - public class FileTransferGetFileInfoResponseAllData + public class FileTransferGetFileInfoResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鏌ョ湅鍗曚釜鏂囦欢淇℃伅杩斿洖鐨勬暟鎹� /// </summary> public FileTransferGetFileInfoResponseData fileTransferGetFileInfoResponseData; } - /// <summary> - /// 鏌ョ湅鍗曚釜鏂囦欢淇℃伅杩斿洖鐨勬暟鎹� - /// </summary> - public FileTransferGetFileInfoResponseData fileTransferGetFileInfoResponseData; /// <summary> /// 鏌ョ湅鍗曚釜鏂囦欢淇℃伅杩斿洖鐨勬暟鎹� /// </summary> @@ -1198,22 +893,9 @@ /// <summary> /// 瀹㈡埛绔帴鏀跺埌缃戝叧鍙戣壊鏁版嵁鏍煎紡鍚庡簲鍙嶉缁欑綉鍏冲埌鏍煎紡鏁版嵁 /// </summary> - public DownloadFileResponseAllData downloadFileResponseAllData; - /// <summary> - /// 瀹㈡埛绔帴鏀跺埌缃戝叧鍙戣壊鏁版嵁鏍煎紡鍚庡簲鍙嶉缁欑綉鍏冲埌鏍煎紡鏁版嵁 - /// </summary> [System.Serializable] - public class DownloadFileResponseAllData + public class DownloadFileResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 0: 鏁版嵁鍐欏叆鎴愬姛,璇锋眰鍙戦�佷笅涓�涓暟鎹寘 ///<para>1锛氱粓姝笅杞姐�傚綋涓嬭浇鍑虹幇閿欒锛屾垨鑰呬笅杞藉凡缁忓畬鎴愬彲浠ュ彂閫佽鍊笺��</para> @@ -1221,10 +903,6 @@ public int Result = -1; } - /// <summary> - /// 瀹㈡埛绔帴鏀跺埌缃戝叧鍙戣壊鏁版嵁鏍煎紡鍚庡簲鍙嶉缁欑綉鍏� - /// </summary> - public FileTransferDownloadFileRespon fileTransferDownloadFileRespon; /// <summary> /// 瀹㈡埛绔帴鏀跺埌缃戝叧鍙戣壊鏁版嵁鏍煎紡鍚庡簲鍙嶉缁欑綉鍏� /// </summary> @@ -1243,32 +921,15 @@ /// <summary> /// 鍒犻櫎鏂囦欢鎴栫洰褰�,缃戝叧鍙嶉淇℃伅 /// </summary> - public DelFileOrDirResponseAllData delFileOrDirResponseAllData; - /// <summary> - /// 鍒犻櫎鏂囦欢鎴栫洰褰�,缃戝叧鍙嶉淇℃伅 - /// </summary> [System.Serializable] - public class DelFileOrDirResponseAllData + public class DelFileOrDirResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鍒犻櫎鏂囦欢鎴栫洰褰� /// </summary> public DelFileOrDirResponseData delFileOrDirResponseData; } - /// <summary> - /// 鍒犻櫎鏂囦欢鎴栫洰褰�,缃戝叧鍙嶉淇℃伅 - /// </summary> - public DelFileOrDirResponseData delFileOrDirResponseData; /// <summary> /// 鍒犻櫎鏂囦欢鎴栫洰褰�,缃戝叧鍙嶉淇℃伅 /// </summary> @@ -1293,32 +954,15 @@ /// <summary> /// 鍒涘缓涓�涓洰褰�,缃戝叧鍙嶉淇℃伅 /// </summary> - public CreateDirResponseAllData createDirResponseAllData; - /// <summary> - /// 鍒涘缓涓�涓洰褰�,缃戝叧鍙嶉淇℃伅 - /// </summary> [System.Serializable] - public class CreateDirResponseAllData + public class CreateDirResponseAllData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 鍒涘缓涓�涓洰褰� /// </summary> public CreateDirResponseData createDirResponseData; } - /// <summary> - /// 鍒涘缓涓�涓洰褰�,缃戝叧鍙嶉淇℃伅 - /// </summary> - public CreateDirResponseData createDirResponseData; /// <summary> /// 鍒涘缓涓�涓洰褰�,缃戝叧鍙嶉淇℃伅 /// </summary> @@ -1342,22 +986,9 @@ /// <summary> /// 瀹㈡埛绔彂閫丏ES瀵嗛挜鍒扮綉鍏�,缃戝叧鍙嶉鍏蜂綋淇℃伅 /// </summary> - public SendKeyResponData sendDESKeyResponData; - /// <summary> - /// 瀹㈡埛绔彂閫丏ES瀵嗛挜鍒扮綉鍏�,缃戝叧鍙嶉鍏蜂綋淇℃伅 - /// </summary> [System.Serializable] - public class SendKeyResponData + public class SendKeyResponData : CommonDevice.ErrorResponCommon { - /// <summary> - /// 閿欒淇℃伅 - /// </summary> - public string errorMessageBase; - /// <summary> - /// 缃戝叧淇℃伅閿欒鍙嶉 - /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> - /// </summary> - public ErrorResponData errorResponData; /// <summary> /// 0锛氭垚鍔� ///<para>1锛氬け璐ワ紝RSA绉侀挜瑙e瘑澶辫触</para> diff --git a/ZigbeeApp/Shared/Phone/ZigBee/IO/LocalFileUtils.cs b/ZigbeeApp/Shared/Phone/ZigBee/IO/LocalFileUtils.cs deleted file mode 100755 index f86475f..0000000 --- a/ZigbeeApp/Shared/Phone/ZigBee/IO/LocalFileUtils.cs +++ /dev/null @@ -1,40 +0,0 @@ -锘縰sing System; -using System.IO; -using System.Collections.Generic; -using ZigBee.Device; -using System.Text; - -namespace ZigBee.IO -{ - public static class LocalFileUtils - { - /// <summary> - /// 淇濆瓨璁惧淇℃伅 - /// </summary> - //public static string ReadEquipmentMessage(CommonDevice commonDevice) - //{ - // string fileName = "Zigbee_"; - // fileName += commonDevice.GetType().ToString().Replace("Shared.", "") + "_" + commonDevice.DeviceAddr.ToString() + "_" + commonDevice.DeviceEpoint.ToString(); - // var bytes =Shared.IO.FileUtils.ReadFile(fileName); - // string one = System.Text.Encoding.UTF8.GetString(bytes); - // return one; - //} - - /// <summary> - ///淇濆瓨璁惧淇℃伅. - /// </summary> - //public static void SaveDeviceInfo(CommonDevice commonDevice, string epoint = "") - //{ - // var deviceType = commonDevice.Type.ToString(); - // var fileName = "Zigbee_" + deviceType + "_" + commonDevice.DeviceAddr; - // if (epoint != "") - // { - // fileName += "_" + (epoint.Length < 2 ? "0" + epoint : epoint); - // } - // commonDevice.SavePath = fileName; - // Console.WriteLine(fileName); - // //淇濆瓨鍒版牴鐩綍涓� - // Shared.IO.FileUtils.WriteFileByBytes(System.IO.Path.Combine(Shared.Common.Config.Instance.HomeId, fileName), Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(commonDevice))); - //} - } -} \ No newline at end of file diff --git a/ZigbeeApp/Shared/R.cs b/ZigbeeApp/Shared/R.cs index 36c9262..ade9d1f 100644 --- a/ZigbeeApp/Shared/R.cs +++ b/ZigbeeApp/Shared/R.cs @@ -350,7 +350,7 @@ /// </summary> public const int AddFreshAirModulPanelMsg = 239; /// <summary> - /// 璁剧疆甯稿紑妯″紡鍚庯紝鎮ㄧ殑闂ㄩ攣灏嗗缁坽0}澶勪簬鎵撳紑鐘舵�侊紝纭寮�鍚紵 + /// 璁剧疆甯稿紑妯″紡鍚庯紝鎮ㄧ殑闂ㄩ攣灏嗗缁坽0}澶勪簬鎵撳紑鐘舵�侊紝纭寮�鍚紵 /// </summary> public const int SetDoorLockNomallyOpen = 241; /// <summary> @@ -1171,90 +1171,90 @@ /// 鍔熻兘璁剧疆 /// </summary> public const int FunctionSetting = 11012; - /// <summary> - /// 淇℃伅缂栬緫 - /// </summary> - public const int EditInfo = 11013; - /// <summary> - /// 鍔熻兘鍚嶇О - /// </summary> - public const int FunctionName = 11014; - /// <summary> - /// 鎵�灞炲尯鍩� - /// </summary> - public const int BelongZone = 11015; - /// <summary> - /// 鎵�灞炶澶� - /// </summary> - public const int BelongDevice = 11016; - /// <summary> - /// 鏈煡 - /// </summary> - public const int UNKnown = 11017; - /// <summary> - /// 鍒嗕韩 - /// </summary> - public const int Share = 11018; - /// <summary> - /// 鍒嗕韩鐨� - /// </summary> - public const int Shared = 11019; - /// <summary> - /// 閫夋嫨鍥炬爣 - /// </summary> - public const int SelectIcon = 11020; - /// <summary> - /// 淇濆瓨 - /// </summary> - public const int Save = 11021; - /// <summary> - /// 鎻愰啋 - /// </summary> - public const int TIP = 11022; - /// <summary> - /// 鍙栨秷 - /// </summary> - public const int Cancel = 11023; - /// <summary> - /// 娌℃湁鍦烘櫙{0}璇风偣鍑诲彸涓婅娣诲姞 - /// </summary> - public const int NoScene = 11024; - /// <summary> - /// 璁剧疆 - /// </summary> - public const int Setting = 11025; - /// <summary> - /// 寤舵椂 - /// </summary> - public const int Delay = 11026; - /// <summary> - /// 纭畾鍒犻櫎鍚楋紵 - /// </summary> - public const int ConfirmDelete = 11027; - /// <summary> - /// 娣诲姞鍦烘櫙 - /// </summary> - public const int AddScence = 11028; - /// <summary> - /// 鍦烘櫙鍚嶇О - /// </summary> - public const int SceneName = 11029; - /// <summary> - /// 璇疯緭鍏ュ満鏅悕绉� - /// </summary> - public const int PleaseInputSceneName = 11030; - /// <summary> - /// 娣诲姞鎵ц鐩爣 - /// </summary> - public const int AddScentTargetAction = 11031; - /// <summary> - /// 閫夋嫨鍖哄煙 - /// </summary> - public const int SelectZone = 11032; - /// <summary> - /// 閫夋嫨鍦烘櫙鍥剧墖 - /// </summary> - public const int SelectScenePic = 11033; + /// <summary> + /// 淇℃伅缂栬緫 + /// </summary> + public const int EditInfo = 11013; + /// <summary> + /// 鍔熻兘鍚嶇О + /// </summary> + public const int FunctionName = 11014; + /// <summary> + /// 鎵�灞炲尯鍩� + /// </summary> + public const int BelongZone = 11015; + /// <summary> + /// 鎵�灞炶澶� + /// </summary> + public const int BelongDevice = 11016; + /// <summary> + /// 鏈煡 + /// </summary> + public const int UNKnown = 11017; + /// <summary> + /// 鍒嗕韩 + /// </summary> + public const int Share = 11018; + /// <summary> + /// 鍒嗕韩鐨� + /// </summary> + public const int Shared = 11019; + /// <summary> + /// 閫夋嫨鍥炬爣 + /// </summary> + public const int SelectIcon = 11020; + /// <summary> + /// 淇濆瓨 + /// </summary> + public const int Save = 11021; + /// <summary> + /// 鎻愰啋 + /// </summary> + public const int TIP = 11022; + /// <summary> + /// 鍙栨秷 + /// </summary> + public const int Cancel = 11023; + /// <summary> + /// 娌℃湁鍦烘櫙{0}璇风偣鍑诲彸涓婅娣诲姞 + /// </summary> + public const int NoScene = 11024; + /// <summary> + /// 璁剧疆 + /// </summary> + public const int Setting = 11025; + /// <summary> + /// 寤舵椂 + /// </summary> + public const int Delay = 11026; + /// <summary> + /// 纭畾鍒犻櫎鍚楋紵 + /// </summary> + public const int ConfirmDelete = 11027; + /// <summary> + /// 娣诲姞鍦烘櫙 + /// </summary> + public const int AddScence = 11028; + /// <summary> + /// 鍦烘櫙鍚嶇О + /// </summary> + public const int SceneName = 11029; + /// <summary> + /// 璇疯緭鍏ュ満鏅悕绉� + /// </summary> + public const int PleaseInputSceneName = 11030; + /// <summary> + /// 娣诲姞鎵ц鐩爣 + /// </summary> + public const int AddScentTargetAction = 11031; + /// <summary> + /// 閫夋嫨鍖哄煙 + /// </summary> + public const int SelectZone = 11032; + /// <summary> + /// 閫夋嫨鍦烘櫙鍥剧墖 + /// </summary> + public const int SelectScenePic = 11033; /// <summary> /// 纭畾瑕佺Щ闄よ鍔熻兘锛� /// </summary> @@ -5997,7 +5997,7 @@ /// </summary> public const int uAddFangyueEnvironmentPanelMsg = 21021; /// <summary> - /// 绐楀笜闈㈡澘 -> 闀挎寜闈㈡澘宸︿笂瑙掓寜閿紝鎵�鏈夋寜閿畕0}鎸囩ず鐏寒璧凤紝鍒欓厤缃戞垚鍔� + /// 绐楀笜闈㈡澘 -> 闀挎寜闈㈡澘宸︿笂瑙掓寜閿紝鎵�鏈夋寜閿畕0}鎸囩ず鐏寒璧凤紝鍒欓厤缃戞垚鍔� /// </summary> public const int uAddCurtaunPanelMsg = 21022; /// <summary> @@ -6250,7 +6250,7 @@ /// </summary> public const int uDeviceBelongId2310 = 40018; /// <summary> - /// 鑷畾涔夎澶囨墍灞濱D涓�1307鐨勭炕璇戝悕瀛楋細PM2.5绌烘皵璐ㄩ噺浼犳劅鍣� + /// 鑷畾涔夎澶囨墍灞濱D涓�1307鐨勭炕璇戝悕瀛楋細绌烘皵璐ㄩ噺 /// </summary> public const int uDeviceBelongId1307 = 40019; diff --git a/ZigbeeApp/Shared/Shared.projitems b/ZigbeeApp/Shared/Shared.projitems index 9d1ca45..c02dff6 100644 --- a/ZigbeeApp/Shared/Shared.projitems +++ b/ZigbeeApp/Shared/Shared.projitems @@ -29,6 +29,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceCurtainRowControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceDoorLockRowControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceFreshAirRowControl.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DevicePmSensorRowControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceRelayRowControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceSensorRowControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DeviceTemperatureRowControl.cs" /> @@ -96,6 +97,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceColorLightDetailCardForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceCurtainDetailCardForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceFreshAirDetailCardForm.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DevicePmSensorDetailCardForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceRelayDetailCardForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceCard\DeviceFreshAirCardControl.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceFunctionUnallocatedControl.cs" /> @@ -253,6 +255,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionFileListForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionGatewayListForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionMainForm.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionMemoryListDeviceForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionSearchAllFile.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Member\MemberNotEsixtForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Password\CheckNewPhoneForm.cs" /> @@ -404,7 +407,6 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\HumiditySensor.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\PMSensor.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\Repeater.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\ThirdPartyModuleUpgrade.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\Transverter.cs" /> <Compile Include="$(MSBuildThisFileDirectory)R.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserView\HomePage.cs" /> @@ -463,7 +465,6 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\HDLbutton.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\IASZone.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\LigthtBase.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\LogicBase.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\OTADevice.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\Panel.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\PIRSensor.cs" /> @@ -475,7 +476,6 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\ToggleLight.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\ZbGateway.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\ZbGatewayData.cs" /> - <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\IO\LocalFileUtils.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlSafeguardLogic.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlAlarmsLogic.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Category\Controls\DeviceRow\DevicePmSensorRowControl.cs" /> -- Gitblit v1.8.0