From 8ce0f9b1e568dd9125e74421cd02fbc29381c1f1 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期三, 29 七月 2020 12:53:33 +0800 Subject: [PATCH] 新版本 --- ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧640_960备份-1.png | 0 ZigbeeApp/GateWay.Droid/Assets/Language.ini | 2 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧1024_768备份.png | 0 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧640_960备份.png | 0 ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs | 2 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧1024_748备份.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs | 3 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/Contents.json | 56 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs | 12 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧2688*1242.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs | 20 ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs | 1 ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs | 24 ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs | 41 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs | 77 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧1536_2048备份.png | 0 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧1536_2008备份.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs | 1 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧640_1136备份.png | 0 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧320_480备份.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFourButtonDirectionForm.cs | 10 ZigbeeApp/Shared/Phone/UserCenter/Safety/GarrisonAreaSettionMenuForm.cs | 4 ZigbeeApp/Shared/Phone/Device/VideoIntercom/VideoMachine.cs | 5 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧768*1024.png | 0 ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs | 136 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs | 22 ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionGatewayInfoMenuForm.cs | 78 ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs | 92 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCurtainLogic.cs | 17 ZigbeeApp/Home.Ios/Info.plist | 4 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧2048*2732.png | 0 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧1024*768.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs | 2 ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/iconSelectedBackgroundColor1.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs | 296 +++ ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionGatewayListFileForm.cs | 203 ++ ZigbeeApp/Shared/Shared.projitems | 6 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧768_1024备份.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelColorSelectForm.cs | 182 + ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/iconSelectedBackgroundColor1.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelThreeButton.png | 0 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧750_1334备份.png | 0 ZigbeeApp/Shared/Phone/Device/Logic/LogicView/RoomClickView.cs | 51 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs | 6 ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/iconBackgroundColor1.png | 0 ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelTwoButton.png | 0 ZigbeeApp/Shared/Phone/Device/Logic/Method.cs | 34 ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj | 6 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs | 34 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧1125*2436.png | 0 ZigbeeApp/Shared/Common/CommonPage.cs | 2 ZigbeeApp/Shared/Phone/Device/Logic/Send.cs | 6 ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs | 95 ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs | 36 ZigbeeApp/Shared/Phone/TemplateData/TemplateCommonLogic.cs | 1846 +++++++++++++++++++ ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧1242*2688.png | 0 ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs | 5 ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml | 2 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFileLogic.cs | 10 ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelThreeButton.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs | 10 ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs | 27 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧2048*1536.png | 0 ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs | 10 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs | 24 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧2048_1496备份.png | 0 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧1792*828.png | 0 ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelFourButton.png | 0 ZigbeeApp/Home.Ios/Resources/Language.ini | 2 ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelFourButton.png | 0 ZigbeeApp/Home.Ios/Home.IOS.csproj | 58 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs | 28 ZigbeeApp/Shared/R.cs | 8 ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs | 80 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧2048_1536备份.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePirSensorLogic.cs | 15 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧2436*1125.png | 0 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧1536*2048.png | 0 ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs | 188 + ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧1242*2208.png | 0 ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs | 4 ZigbeeApp/Shared/Common/Device.cs | 54 ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionGatewayListForm.cs | 2 ZigbeeApp/Shared/Phone/TemplateData/TemplateDataCommon.cs | 738 +++++++ ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs | 10 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelThreeButtonDirectionForm.cs | 10 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧2208*1242.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs | 28 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs | 47 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧768_1004备份.png | 0 /dev/null | 0 ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelTwoButton.png | 0 ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelTwoButtonDirectionForm.cs | 10 ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDevice.cs | 7 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs | 16 ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs | 3 ZigbeeApp/Shared/Phone/TemplateData/TemplateDeviceDataLogic.cs | 890 +++++++++ ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧828*1792.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/UserCenterResourse.cs | 8 ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/易欧640_1136备份-1.png | 0 ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/iconBackgroundColor1.png | 0 ZigbeeApp/Shared/Common/House.cs | 54 102 files changed, 5,228 insertions(+), 532 deletions(-) diff --git a/ZigbeeApp/GateWay.Droid/Assets/Language.ini b/ZigbeeApp/GateWay.Droid/Assets/Language.ini index 6c90466..3aa1b68 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Language.ini +++ b/ZigbeeApp/GateWay.Droid/Assets/Language.ini @@ -1880,6 +1880,8 @@ 16141=绱ф�ユ寜閽� 16142=闂ㄧ獥浼犳劅鍣� 16143=閽ュ寵鎵� +16144=鑹插�煎彿涓�6浣嶏紙鐢变换鎰忔暟瀛�+瀛楁瘝缁勫悎锛� +16145=闀挎寜姝ゆ寜閿� ;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� 18004=鎸囧畾缃戝叧宸茬粡琚粦瀹� diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelFourButton.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelFourButton.png index 19d8078..91fa891 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelFourButton.png +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelFourButton.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelThreeButton.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelThreeButton.png index 96688db..6b9e971 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelThreeButton.png +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelThreeButton.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelTwoButton.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelTwoButton.png index bd1271c..fcaef59 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelTwoButton.png +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Instruct/PanelTwoButton.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/iconBackgroundColor1.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/iconBackgroundColor1.png new file mode 100755 index 0000000..cecc4ee --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/iconBackgroundColor1.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/iconSelectedBackgroundColor1.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/iconSelectedBackgroundColor1.png new file mode 100755 index 0000000..b2c5368 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/ZigeeLogic/iconSelectedBackgroundColor1.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj index 545eee2..af819da 100644 --- a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj +++ b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj @@ -2330,6 +2330,12 @@ <ItemGroup> <AndroidAsset Include="Assets\Phone\Item\SynchronizationSelected.png" /> </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\ZigeeLogic\iconBackgroundColor1.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\ZigeeLogic\iconSelectedBackgroundColor1.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 2509196..2aa220d 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="0120072302" android:installLocation="auto" android:versionName="1.1.0120072302"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="0120072403" android:installLocation="auto" android:versionName="1.1.0120072403"> <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/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_748-1.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_748-1.png deleted file mode 100755 index 78c5f84..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_748-1.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_768-2.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_768-2.png deleted file mode 100755 index c2c8ed9..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_768-2.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_768-3.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_768-3.png deleted file mode 100755 index c2c8ed9..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1024_768-3.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1125_2436-1.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1125_2436-1.png deleted file mode 100755 index ed5abe7..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1125_2436-1.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242_2208.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242_2208.png deleted file mode 100755 index cacd31f..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242_2208.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242_2688_XS Max-1.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242_2688_XS Max-1.png deleted file mode 100755 index 73a6627..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1242_2688_XS Max-1.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2008-1.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2008-1.png deleted file mode 100755 index 4942e4a..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2008-1.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2048-2.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2048-2.png deleted file mode 100755 index 3aa9190..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2048-2.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2048-3.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2048-3.png deleted file mode 100755 index 3aa9190..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1536_2048-3.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1792_828-1.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1792_828-1.png deleted file mode 100755 index 23abb10..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/1792_828-1.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1496-1.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1496-1.png deleted file mode 100755 index 6d32881..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1496-1.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1536-2.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1536-2.png deleted file mode 100755 index f1db73f..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1536-2.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1536-3.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1536-3.png deleted file mode 100755 index f1db73f..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_1536-3.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_2732.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_2732.png deleted file mode 100755 index c7b53b1..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2048_2732.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2208_1242-1.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2208_1242-1.png deleted file mode 100755 index 4092649..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2208_1242-1.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2436_1125-1.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2436_1125-1.png deleted file mode 100755 index e4ea893..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2436_1125-1.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2688_1242-1.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2688_1242-1.png deleted file mode 100755 index 98dc1c1..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/2688_1242-1.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/320_480-1.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/320_480-1.png deleted file mode 100755 index 75b2896..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/320_480-1.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_1136-2.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_1136-2.png deleted file mode 100755 index dee0605..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_1136-2.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_1136-3.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_1136-3.png deleted file mode 100755 index dee0605..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_1136-3.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_960-2.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_960-2.png deleted file mode 100755 index 68ece8a..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_960-2.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_960-3.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_960-3.png deleted file mode 100755 index 68ece8a..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/640_960-3.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/750_1334-1.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/750_1334-1.png deleted file mode 100755 index c746b45..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/750_1334-1.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1004-1.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1004-1.png deleted file mode 100755 index 526911f..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1004-1.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1024-2.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1024-2.png deleted file mode 100755 index 42fdc74..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1024-2.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1024-3.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1024-3.png deleted file mode 100755 index 42fdc74..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/768_1024-3.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/828_1792_XR-1.png b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/828_1792_XR-1.png deleted file mode 100755 index d85b362..0000000 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/828_1792_XR-1.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/Contents.json b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/Contents.json index 89d8507..17aefa3 100755 --- a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/Contents.json +++ b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/Contents.json @@ -3,7 +3,6 @@ { "orientation": "landscape", "extent": "full-screen", - "filename": "1920_1080-1.png", "size": "1920x1080", "scale": "1x", "idiom": "tv", @@ -12,7 +11,6 @@ { "orientation": "landscape", "extent": "full-screen", - "filename": "3840_2160-1.png", "size": "1920x1080", "scale": "2x", "idiom": "tv", @@ -22,7 +20,7 @@ "minimum-system-version": "12.0", "orientation": "portrait", "extent": "full-screen", - "filename": "1242_2688_XS Max-1.png", + "filename": "鏄撴1242*2688.png", "size": "414x896", "subtype": "1792", "scale": "3x", @@ -32,7 +30,7 @@ "minimum-system-version": "12.0", "orientation": "portrait", "extent": "full-screen", - "filename": "828_1792_XR-1.png", + "filename": "鏄撴828*1792.png", "size": "276x597.3", "subtype": "2688", "scale": "3x", @@ -42,7 +40,7 @@ "minimum-system-version": "12.0", "orientation": "landscape", "extent": "full-screen", - "filename": "2688_1242-1.png", + "filename": "鏄撴2688*1242.png", "size": "896x414", "subtype": "1792", "scale": "3x", @@ -52,7 +50,7 @@ "minimum-system-version": "12.0", "orientation": "landscape", "extent": "full-screen", - "filename": "1792_828-1.png", + "filename": "鏄撴1792*828.png", "size": "597.3x276", "subtype": "2688", "scale": "3x", @@ -62,7 +60,7 @@ "minimum-system-version": "11.0", "orientation": "portrait", "extent": "full-screen", - "filename": "1125_2436-1.png", + "filename": "鏄撴1125*2436.png", "size": "375x812", "subtype": "2436h", "scale": "3x", @@ -72,7 +70,7 @@ "minimum-system-version": "11.0", "orientation": "landscape", "extent": "full-screen", - "filename": "2436_1125-1.png", + "filename": "鏄撴2436*1125.png", "size": "812x375", "subtype": "2436h", "scale": "3x", @@ -82,7 +80,7 @@ "minimum-system-version": "8.0", "orientation": "portrait", "extent": "full-screen", - "filename": "1242_2208.png", + "filename": "鏄撴1242*2208.png", "size": "414x736", "subtype": "736h", "scale": "3x", @@ -92,7 +90,7 @@ "minimum-system-version": "8.0", "orientation": "portrait", "extent": "full-screen", - "filename": "750_1334-1.png", + "filename": "鏄撴750_1334澶囦唤.png", "size": "375x667", "subtype": "667h", "scale": "2x", @@ -102,7 +100,7 @@ "minimum-system-version": "8.0", "orientation": "landscape", "extent": "full-screen", - "filename": "2208_1242-1.png", + "filename": "鏄撴2208*1242.png", "size": "736x414", "subtype": "736h", "scale": "3x", @@ -112,7 +110,7 @@ "minimum-system-version": "7.0", "orientation": "portrait", "extent": "full-screen", - "filename": "2048_2732.png", + "filename": "鏄撴2048*2732.png", "size": "1024x1366", "scale": "2x", "idiom": "ipad" @@ -121,7 +119,7 @@ "minimum-system-version": "7.0", "orientation": "portrait", "extent": "full-screen", - "filename": "640_960-2.png", + "filename": "鏄撴640_960澶囦唤.png", "size": "320x480", "scale": "2x", "idiom": "iphone" @@ -130,7 +128,7 @@ "minimum-system-version": "7.0", "orientation": "portrait", "extent": "full-screen", - "filename": "640_1136-2.png", + "filename": "鏄撴640_1136澶囦唤.png", "size": "320x568", "subtype": "retina4", "scale": "2x", @@ -140,7 +138,7 @@ "minimum-system-version": "7.0", "orientation": "portrait", "extent": "full-screen", - "filename": "768_1024-2.png", + "filename": "鏄撴768*1024.png", "size": "768x1024", "scale": "1x", "idiom": "ipad" @@ -149,7 +147,7 @@ "minimum-system-version": "7.0", "orientation": "portrait", "extent": "full-screen", - "filename": "1536_2048-2.png", + "filename": "鏄撴1536*2048.png", "size": "768x1024", "scale": "2x", "idiom": "ipad" @@ -158,7 +156,7 @@ "minimum-system-version": "7.0", "orientation": "landscape", "extent": "full-screen", - "filename": "1024_768-2.png", + "filename": "鏄撴1024*768.png", "size": "1024x768", "scale": "1x", "idiom": "ipad" @@ -167,7 +165,7 @@ "minimum-system-version": "7.0", "orientation": "landscape", "extent": "full-screen", - "filename": "2048_1536-2.png", + "filename": "鏄撴2048*1536.png", "size": "1024x768", "scale": "2x", "idiom": "ipad" @@ -175,7 +173,7 @@ { "orientation": "portrait", "extent": "full-screen", - "filename": "320_480-1.png", + "filename": "鏄撴320_480澶囦唤.png", "size": "320x480", "scale": "1x", "idiom": "iphone" @@ -183,7 +181,7 @@ { "orientation": "portrait", "extent": "full-screen", - "filename": "640_960-3.png", + "filename": "鏄撴640_960澶囦唤-1.png", "size": "320x480", "scale": "2x", "idiom": "iphone" @@ -191,7 +189,7 @@ { "orientation": "portrait", "extent": "full-screen", - "filename": "640_1136-3.png", + "filename": "鏄撴640_1136澶囦唤-1.png", "size": "320x568", "subtype": "retina4", "scale": "2x", @@ -200,7 +198,7 @@ { "orientation": "portrait", "extent": "to-status-bar", - "filename": "768_1004-1.png", + "filename": "鏄撴768_1004澶囦唤.png", "size": "768x1004", "scale": "1x", "idiom": "ipad" @@ -208,7 +206,7 @@ { "orientation": "portrait", "extent": "to-status-bar", - "filename": "1536_2008-1.png", + "filename": "鏄撴1536_2008澶囦唤.png", "size": "768x1004", "scale": "2x", "idiom": "ipad" @@ -216,7 +214,7 @@ { "orientation": "portrait", "extent": "full-screen", - "filename": "768_1024-3.png", + "filename": "鏄撴768_1024澶囦唤.png", "size": "768x1024", "scale": "1x", "idiom": "ipad" @@ -224,7 +222,7 @@ { "orientation": "portrait", "extent": "full-screen", - "filename": "1536_2048-3.png", + "filename": "鏄撴1536_2048澶囦唤.png", "size": "768x1024", "scale": "2x", "idiom": "ipad" @@ -232,7 +230,7 @@ { "orientation": "landscape", "extent": "to-status-bar", - "filename": "1024_748-1.png", + "filename": "鏄撴1024_748澶囦唤.png", "size": "1024x748", "scale": "1x", "idiom": "ipad" @@ -240,7 +238,7 @@ { "orientation": "landscape", "extent": "to-status-bar", - "filename": "2048_1496-1.png", + "filename": "鏄撴2048_1496澶囦唤.png", "size": "1024x748", "scale": "2x", "idiom": "ipad" @@ -248,7 +246,7 @@ { "orientation": "landscape", "extent": "full-screen", - "filename": "1024_768-3.png", + "filename": "鏄撴1024_768澶囦唤.png", "size": "1024x768", "scale": "1x", "idiom": "ipad" @@ -256,7 +254,7 @@ { "orientation": "landscape", "extent": "full-screen", - "filename": "2048_1536-3.png", + "filename": "鏄撴2048_1536澶囦唤.png", "size": "1024x768", "scale": "2x", "idiom": "ipad" diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471024*768.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471024*768.png" new file mode 100644 index 0000000..2b98c16 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471024*768.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471024_748\345\244\207\344\273\275.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471024_748\345\244\207\344\273\275.png" new file mode 100755 index 0000000..a82c717 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471024_748\345\244\207\344\273\275.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471024_768\345\244\207\344\273\275.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471024_768\345\244\207\344\273\275.png" new file mode 100755 index 0000000..2b98c16 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471024_768\345\244\207\344\273\275.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471125*2436.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471125*2436.png" new file mode 100644 index 0000000..9d7348a --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471125*2436.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471242*2208.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471242*2208.png" new file mode 100644 index 0000000..d4b9c68 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471242*2208.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471242*2688.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471242*2688.png" new file mode 100644 index 0000000..147990a --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471242*2688.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471536*2048.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471536*2048.png" new file mode 100644 index 0000000..736a3c6 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471536*2048.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471536_2008\345\244\207\344\273\275.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471536_2008\345\244\207\344\273\275.png" new file mode 100755 index 0000000..4961c22 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471536_2008\345\244\207\344\273\275.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471536_2048\345\244\207\344\273\275.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471536_2048\345\244\207\344\273\275.png" new file mode 100755 index 0000000..736a3c6 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471536_2048\345\244\207\344\273\275.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471792*828.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471792*828.png" new file mode 100644 index 0000000..7f565ad --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2471792*828.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472048*1536.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472048*1536.png" new file mode 100644 index 0000000..8c238d9 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472048*1536.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472048*2732.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472048*2732.png" new file mode 100644 index 0000000..8fcd577 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472048*2732.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472048_1496\345\244\207\344\273\275.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472048_1496\345\244\207\344\273\275.png" new file mode 100755 index 0000000..db8e8de --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472048_1496\345\244\207\344\273\275.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472048_1536\345\244\207\344\273\275.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472048_1536\345\244\207\344\273\275.png" new file mode 100755 index 0000000..8c238d9 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472048_1536\345\244\207\344\273\275.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472208*1242.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472208*1242.png" new file mode 100644 index 0000000..85d0525 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472208*1242.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472436*1125.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472436*1125.png" new file mode 100644 index 0000000..6e31500 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472436*1125.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472688*1242.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472688*1242.png" new file mode 100644 index 0000000..80784b4 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\2472688*1242.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247320_480\345\244\207\344\273\275.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247320_480\345\244\207\344\273\275.png" new file mode 100755 index 0000000..6d8e60c --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247320_480\345\244\207\344\273\275.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247640_1136\345\244\207\344\273\275-1.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247640_1136\345\244\207\344\273\275-1.png" new file mode 100755 index 0000000..0fbd6b4 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247640_1136\345\244\207\344\273\275-1.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247640_1136\345\244\207\344\273\275.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247640_1136\345\244\207\344\273\275.png" new file mode 100755 index 0000000..0fbd6b4 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247640_1136\345\244\207\344\273\275.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247640_960\345\244\207\344\273\275-1.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247640_960\345\244\207\344\273\275-1.png" new file mode 100755 index 0000000..bf03de8 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247640_960\345\244\207\344\273\275-1.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247640_960\345\244\207\344\273\275.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247640_960\345\244\207\344\273\275.png" new file mode 100755 index 0000000..bf03de8 --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247640_960\345\244\207\344\273\275.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247750_1334\345\244\207\344\273\275.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247750_1334\345\244\207\344\273\275.png" new file mode 100755 index 0000000..95ae2bd --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247750_1334\345\244\207\344\273\275.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247768*1024.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247768*1024.png" new file mode 100644 index 0000000..4ef3f1c --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247768*1024.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247768_1004\345\244\207\344\273\275.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247768_1004\345\244\207\344\273\275.png" new file mode 100755 index 0000000..be6450b --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247768_1004\345\244\207\344\273\275.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247768_1024\345\244\207\344\273\275.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247768_1024\345\244\207\344\273\275.png" new file mode 100755 index 0000000..4ef3f1c --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247768_1024\345\244\207\344\273\275.png" Binary files differ diff --git "a/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247828*1792.png" "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247828*1792.png" new file mode 100644 index 0000000..907da4a --- /dev/null +++ "b/ZigbeeApp/Home.Ios/Assets.xcassets/LaunchImage.launchimage/\346\230\223\346\254\247828*1792.png" Binary files differ diff --git a/ZigbeeApp/Home.Ios/Home.IOS.csproj b/ZigbeeApp/Home.Ios/Home.IOS.csproj index 8885bc5..1de72cf 100644 --- a/ZigbeeApp/Home.Ios/Home.IOS.csproj +++ b/ZigbeeApp/Home.Ios/Home.IOS.csproj @@ -199,33 +199,6 @@ <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048*1536-1.png" /> <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1920_1080-1.png" /> <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\3840_2160-1.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1242_2688_XS Max-1.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\828_1792_XR-1.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2688_1242-1.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1792_828-1.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1125_2436-1.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2436_1125-1.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1242_2208.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\750_1334-1.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2208_1242-1.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048_2732.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640_960-2.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640_1136-2.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768_1024-2.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536_2048-2.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024_768-2.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048_1536-2.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\320_480-1.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640_960-3.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\640_1136-3.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768_1004-1.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536_2008-1.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\768_1024-3.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1536_2048-3.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024_748-1.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048_1496-1.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\1024_768-3.png" /> - <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\2048_1536-3.png" /> <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\40_40-3.png" /> <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\60_60-1.png" /> <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\58_58-2.png" /> @@ -250,9 +223,37 @@ <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\87_87-2.png" /> <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\80_80-4.png" /> <ImageAsset Include="Assets.xcassets\AppIcon.appiconset\1024_1024-2.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴1242*2688.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴828*1792.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴2688*1242.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴1792*828.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴1125*2436.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴2436*1125.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴1242*2208.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴2208*1242.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴2048*2732.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴768*1024.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴1536*2048.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴1024*768.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴2048*1536.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴750_1334澶囦唤.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴640_960澶囦唤.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴640_1136澶囦唤.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴320_480澶囦唤.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴640_960澶囦唤-1.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴640_1136澶囦唤-1.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴768_1004澶囦唤.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴1536_2008澶囦唤.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴768_1024澶囦唤.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴1536_2048澶囦唤.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴1024_748澶囦唤.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴2048_1496澶囦唤.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴1024_768澶囦唤.png" /> + <ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\鏄撴2048_1536澶囦唤.png" /> </ItemGroup> <ItemGroup> <BundleResource Include="Resources\Language.ini" /> + <BundleResource Include="Resources\DeviceName.ini" /> <BundleResource Include="Resources\Phone\Guide\RightIcon.png" /> <BundleResource Include="Resources\Phone\Guide\LeftIcon.png" /> <BundleResource Include="Resources\Phone\Guide\Finger.png" /> @@ -705,6 +706,7 @@ <BundleResource Include="Resources\Phone\ZigeeLogic\withdrawal.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\logicaddcolor.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\sensor13.png" /> + <BundleResource Include="Resources\Phone\ZigeeLogic\iconSelectedBackgroundColor1.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\nightLight.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\logicclose.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\function.png" /> @@ -748,6 +750,7 @@ <BundleResource Include="Resources\Phone\ZigeeLogic\sensor21.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\selectedsensor0.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\next.png" /> + <BundleResource Include="Resources\Phone\ZigeeLogic\iconBackgroundColor1.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\iconSelectedBackgroundColor.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\security.png" /> <BundleResource Include="Resources\Phone\ZigeeLogic\sensor44.png" /> @@ -1141,7 +1144,6 @@ <BundleResource Include="Resources\Phone\Gateway\WiredGateway.png" /> <BundleResource Include="Resources\Phone\Gateway\WirelessGateway.png" /> <BundleResource Include="Resources\Phone\Gateway\AddGatewaySuccess.png" /> - <BundleResource Include="Resources\DeviceName.ini" /> </ItemGroup> <Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" /> diff --git a/ZigbeeApp/Home.Ios/Info.plist b/ZigbeeApp/Home.Ios/Info.plist index 480436c..97f150a 100755 --- a/ZigbeeApp/Home.Ios/Info.plist +++ b/ZigbeeApp/Home.Ios/Info.plist @@ -54,9 +54,9 @@ <key>aps-environment</key> <string>development</string> <key>CFBundleShortVersionString</key> - <string>1.1.012007231</string> + <string>1.1.0120072301</string> <key>CFBundleVersion</key> - <string>202007231</string> + <string>2020072301</string> <key>CFBundleURLTypes</key> <array> <dict> diff --git a/ZigbeeApp/Home.Ios/Resources/Language.ini b/ZigbeeApp/Home.Ios/Resources/Language.ini index 6c90466..3aa1b68 100755 --- a/ZigbeeApp/Home.Ios/Resources/Language.ini +++ b/ZigbeeApp/Home.Ios/Resources/Language.ini @@ -1880,6 +1880,8 @@ 16141=绱ф�ユ寜閽� 16142=闂ㄧ獥浼犳劅鍣� 16143=閽ュ寵鎵� +16144=鑹插�煎彿涓�6浣嶏紙鐢变换鎰忔暟瀛�+瀛楁瘝缁勫悎锛� +16145=闀挎寜姝ゆ寜閿� ;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� 18004=鎸囧畾缃戝叧宸茬粡琚粦瀹� diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelFourButton.png b/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelFourButton.png index 19d8078..91fa891 100755 --- a/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelFourButton.png +++ b/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelFourButton.png Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelThreeButton.png b/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelThreeButton.png index 96688db..6b9e971 100755 --- a/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelThreeButton.png +++ b/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelThreeButton.png Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelTwoButton.png b/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelTwoButton.png index bd1271c..fcaef59 100755 --- a/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelTwoButton.png +++ b/ZigbeeApp/Home.Ios/Resources/Phone/Instruct/PanelTwoButton.png Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/iconBackgroundColor1.png b/ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/iconBackgroundColor1.png new file mode 100755 index 0000000..cecc4ee --- /dev/null +++ b/ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/iconBackgroundColor1.png Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/iconSelectedBackgroundColor1.png b/ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/iconSelectedBackgroundColor1.png new file mode 100755 index 0000000..b2c5368 --- /dev/null +++ b/ZigbeeApp/Home.Ios/Resources/Phone/ZigeeLogic/iconSelectedBackgroundColor1.png Binary files differ diff --git a/ZigbeeApp/Shared/Common/CommonPage.cs b/ZigbeeApp/Shared/Common/CommonPage.cs old mode 100644 new mode 100755 index 15b6819..44f364e --- a/ZigbeeApp/Shared/Common/CommonPage.cs +++ b/ZigbeeApp/Shared/Common/CommonPage.cs @@ -42,7 +42,7 @@ /// <summary> /// 鐗堟湰鍙� /// </summary> - public static string CodeIDString = "1.1.012007231"; + public static string CodeIDString = "1.1.0120072403"; /// <summary> /// 娉ㄥ唽鏉ユ簮(0:HDL On 1:Zigbee) /// </summary> diff --git a/ZigbeeApp/Shared/Common/Device.cs b/ZigbeeApp/Shared/Common/Device.cs index 8b92a87..a813749 100755 --- a/ZigbeeApp/Shared/Common/Device.cs +++ b/ZigbeeApp/Shared/Common/Device.cs @@ -99,7 +99,7 @@ this.dicDeviceEpoint.Clear(); //鍒濆鍖栬澶囨灇涓� - this.InitDeviceModelIdEnum(); + this.InitDeviceModelIdEnum(); //鑾峰彇鏈湴鍏ㄩ儴鐨勮澶囨枃浠� List<string> listFile = this.GetAllDeviceFile(); @@ -565,7 +565,7 @@ //濡傛灉褰撳墠鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return Phone.ModelData.DeviceModelDataLogic.Current.ReDeviceMacName(device, macName, "MacRename"); + return Phone.TemplateData.TemplateDeviceDataLogic.Current.ReDeviceMacName(device, macName); } //鑾峰彇缂栬緫璁惧Mac鍚嶅瓧鐨勫懡浠ゅ瓧绗� @@ -576,7 +576,7 @@ return null; } //鍔犵紦瀛� - Phone.ModelData.DeviceModelDataLogic.Current.ReDeviceMacName(device, macName, "MacRename"); + Phone.TemplateData.TemplateDeviceDataLogic.Current.ReDeviceMacName(device, macName); var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.RenameDeviceMacNameData>(result.ReceiptData); return new CommonDevice.RenameDeviceMacNameAllData { renameDeviceMacNameData = tempData }; @@ -593,7 +593,7 @@ //濡傛灉褰撳墠鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return Phone.ModelData.DeviceModelDataLogic.Current.ReDeviceEpointName(device, deviceName, "DeviceRename"); + return Phone.TemplateData.TemplateDeviceDataLogic.Current.ReDeviceEpointName(device, deviceName); } //鑾峰彇缂栬緫璁惧绔偣鍚嶅瓧鐨勫懡浠ゅ瓧绗� var sendData = this.GetReDeviceEpointNameCommandText(device.DeviceAddr, device.DeviceEpoint, deviceName); @@ -603,7 +603,7 @@ return null; } //鍔犵紦瀛� - Phone.ModelData.DeviceModelDataLogic.Current.ReDeviceEpointName(device, deviceName, "DeviceRename"); + Phone.TemplateData.TemplateDeviceDataLogic.Current.ReDeviceEpointName(device, deviceName); var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DeviceRenameResponseData>(result.ReceiptData); return new CommonDevice.DeviceRenameAllData { deviceRenameData = tempData }; @@ -885,7 +885,7 @@ return false; } //娓╂箍搴︿紶鎰熷櫒娌℃湁瀹氫綅鍔熻兘 - if (myTypeInfo.ConcreteType == DeviceConcreteType.Sensor_TemperatrueHumidity) + if (myTypeInfo.ConcreteType == DeviceConcreteType.Sensor_TemperatureHumidity) { return false; } @@ -1386,6 +1386,16 @@ //闈㈡澘鐨勬俯搴︽帰澶村彨 闈㈡澘鍚嶅瓧+娓╁害 return deviceInfoType.DeviceDefultName + Language.StringByID(R.MyInternationalizationString.uTemperature); } + else if (((TemperatureSensor)device).SensorDiv == 1) + { + //娓╁害浼犳劅鍣� + return Language.StringByID(R.MyInternationalizationString.TemperatureSensor); + } + else if (((TemperatureSensor)device).SensorDiv == 2) + { + //婀垮害浼犳劅鍣� + return Language.StringByID(R.MyInternationalizationString.HumiditySensor); + } } //鍏朵粬鎯呭喌,浣跨敤瀹冪殑榛樿鍚嶇О return deviceInfoType.DeviceDefultName + epointNo; @@ -1420,7 +1430,7 @@ /// <param name="device">璁惧瀵硅薄</param> /// <param name="macName">Mac鍚嶅瓧</param> /// <returns></returns> - private void SetMacName(CommonDevice device, string macName) + public void SetMacName(CommonDevice device, string macName) { device.DeviceName = macName; } @@ -1431,7 +1441,7 @@ /// <param name="device">璁惧瀵硅薄</param> /// <param name="epointName">绔偣鍚嶅瓧</param> /// <returns></returns> - private void SetEpointName(CommonDevice device, string epointName) + public void SetEpointName(CommonDevice device, string epointName) { device.DeviceEpointName = epointName; } @@ -2079,14 +2089,14 @@ //璁剧疆浼犳劅鍣ㄥ叿浣撶殑绫诲瀷 info.BeloneType = DeviceBeloneType.A娓╂箍搴︿紶鎰熷櫒; info.ConcreteText = this.dicDeviceModelIdEnum["A411"].A瀹樻柟鍚嶅瓧; - info.ConcreteType = DeviceConcreteType.Sensor_TemperatrueHumidity; + info.ConcreteType = DeviceConcreteType.Sensor_TemperatureHumidity; } else if (temperatrue == true && humidity == false) { //璁剧疆浼犳劅鍣ㄥ叿浣撶殑绫诲瀷 info.BeloneType = DeviceBeloneType.A娓╁害浼犳劅鍣�; info.ConcreteText = this.dicDeviceModelIdEnum["A412"].A瀹樻柟鍚嶅瓧; - info.ConcreteType = DeviceConcreteType.Sensor_Temperatrue; + info.ConcreteType = DeviceConcreteType.Sensor_Temperature; } else if (temperatrue == false && humidity == true) { @@ -2187,12 +2197,6 @@ //闂ㄧ獥浼犳劅鍣� info.ConcreteType = DeviceConcreteType.Sensor_DoorWindow; info.ConcreteText = Language.StringByID(R.MyInternationalizationString.uSensorDoorWindow); - } - else if (iasZone.IasDeviceType == 541) - { - //鐞冨瀷绉诲姩浼犳劅鍣� - info.ConcreteType = DeviceConcreteType.Sensor_SphericalMotion; - info.ConcreteText = this.dicDeviceModelIdEnum["MSPIRB-ZB.10"].A瀹樻柟鍚嶅瓧; } } @@ -2877,14 +2881,8 @@ /// <param name="device">璁剧疆婧愯澶囧璞�</param> public void SetDeviceInfoToMain(CommonDevice mainDevice, CommonDevice device) { - if (string.IsNullOrEmpty(device.DeviceInfo.MacName) == false) - { - mainDevice.DeviceName = device.DeviceInfo.MacName; - } - if (string.IsNullOrEmpty(device.DeviceInfo.DeviceName) == false) - { - mainDevice.DeviceEpointName = device.DeviceInfo.DeviceName; - } + mainDevice.DeviceName = device.DeviceInfo.MacName; + mainDevice.DeviceEpointName = device.DeviceInfo.DeviceName; mainDevice.CurrentGateWayId = device.CurrentGateWayId; mainDevice.ZigbeeType = device.DeviceInfo.ZigbeeType; mainDevice.IsOnline = device.DeviceInfo.IsOnline; @@ -3399,9 +3397,9 @@ /// </summary> Sensor_PMTwoPointFive = 1307, /// <summary> - /// 娓╂箍搴︿紶鎰熷櫒 + /// 娓╂箍搴︿紶鎰熷櫒(杩欎釜鍗曡瘝鎷奸敊浜�,浣嗘槸閿欎簡灏遍敊浜嗗憲,灏辫繖鏍蜂簡) /// </summary> - Sensor_TemperatrueHumidity = 1308, + Sensor_TemperatureHumidity = 1308, /// <summary> /// 杩愬姩浼犳劅鍣� @@ -3412,9 +3410,9 @@ /// </summary> Sensor_Keyfob = -1307, /// <summary> - /// 娓╁害浼犳劅鍣� + /// 娓╁害浼犳劅鍣�(杩欎釜鍗曡瘝鎷奸敊浜�,浣嗘槸閿欎簡灏遍敊浜嗗憲,灏辫繖鏍蜂簡) /// </summary> - Sensor_Temperatrue = -1309, + Sensor_Temperature = -1309, /// <summary> /// 婀垮害浼犳劅鍣� /// </summary> diff --git a/ZigbeeApp/Shared/Common/House.cs b/ZigbeeApp/Shared/Common/House.cs index e726972..87e9aee 100755 --- a/ZigbeeApp/Shared/Common/House.cs +++ b/ZigbeeApp/Shared/Common/House.cs @@ -65,6 +65,58 @@ /// value:FloorName /// </summary> public Dictionary<string,string> FloorDics = new Dictionary<string,string> { }; + /// <summary> + /// -1:鏈厤缃�(闇�瑕侀噸鏂伴�夋嫨) 1:鏃犳ā鏉挎湁璁惧 2:鏈夋ā鏉挎湁璁惧 3:鏃犳ā鏉挎棤璁惧(璇锋棤瑙嗚繖涓彉閲�) + /// </summary> + public int TemplateMode = -1; + /// <summary> + /// 璇ヤ綇瀹呮槸鍚︽槸灞曠ず妯℃澘(姝ゅ彉閲忔槸缁欐煡鐪嬫ā鏉挎暟鎹椂浣跨敤鐨�,璇锋棤瑙嗚繖涓彉閲�) + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public bool IsShowTemplate = false; + /// <summary> + /// 褰撳墠浣忓畢閫夋嫨鐨勬ā鏉垮悕瀛�(璇锋棤瑙嗚繖涓彉閲�) + /// </summary> + public string SelectTemplate = string.Empty; + /// <summary> + /// 鑷畾涔夊崟鍏冪殑鏍囬鍚嶇О(涓嶭istUintContent涓暟鍖归厤,璇锋棤瑙嗚繖涓彉閲�) + /// </summary> + public List<string> ListUintName = new List<string>(); + /// <summary> + /// 鑷畾涔夊崟鍏冪殑鍐呭(涓嶭istUintName涓暟鍖归厤,璇锋棤瑙嗚繖涓彉閲�) + /// </summary> + public List<string> ListUintContent = new List<string>(); + /// <summary> + /// 鏈�鍚庣紪杈戠殑浜嬩欢(2020.05.26杩藉姞) 1970/12/31 23:59鏍煎紡 + /// </summary> + public string LastEditorTime = "1970/12/31 23:59"; + /// <summary> + /// 鏍囪瘑姝や綇瀹呯殑鏁版嵁鏄惁宸茬粡鍙戦�佽繃妯℃澘鏁版嵁缁欑綉鍏�(鍙拡瀵筎emplateMode=2,璇锋棤瑙嗚繖涓彉閲�) + /// </summary> + public bool SendTemplateSuccess = false; + /// <summary> + /// 杩欎釜浣忓畢涓嬫墍鎷ユ湁鐨勭綉鍏砳d(2020.05.26杩藉姞,null浠h〃娌℃湁澶勭悊杩�,璇锋棤瑙嗚繖涓彉閲�) + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public List<string> listGatewayId = null; + /// <summary> + /// <para>鏍囪瘑浣忓畢鏁版嵁鐨勫尯鍒�(鏂囦欢璇诲彇鏃堕厤缃�,璇锋棤瑙嗚繖涓彉閲�)锛�</para> + /// <para>1:鏈韩鑷繁鐨勬暟鎹�(鏂囦欢澶瑰悕瀛椾负浣忓畢id)</para> + /// <para>2:鑷繁鎵嬪姩鍒涘缓鐨勪繚瀛樺湪鏈満鐨勫浠�(鏂囦欢澶瑰悕瀛椾互銆怋ackupResidenceData銆戝紑澶�)</para> + /// <para>3:姝ゆ暟鎹粠浜戠涓嬭浇鑰屾潵(鏂囦欢澶瑰悕瀛椾互銆怐ownLoadResidenceData銆戝紑澶�)</para> + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public int HouseDataDiv = 1; + /// <summary> + /// 褰撳墠浣忓畢鐨勫湪绾跨姸鎬� -1:铏氭嫙 0:绂荤嚎 1:鏈湴 2:杩滅▼ 3:璇诲彇涓�(璇锋棤瑙嗚繖涓彉閲�) + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public string NowHomeOnlineStatu = "3"; + /// <summary> + /// 褰撳墠瀛樻斁浣忓畢鏁版嵁鐨勬枃浠跺す鍚嶅瓧(姝ゅ彉閲忔槸缁欐湰鏈哄浠�,鎴栬�呬簯绔笅杞藉浠戒娇鐢ㄧ殑,璇锋棤瑙嗚繖涓彉閲�) + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public string SaveDirctoryName = string.Empty; #endregion @@ -98,6 +150,8 @@ /// <param name="autoBackup">鏄惁澶囦唤</param> public void Save(bool autoBackup = true) { + //淇敼鏃堕棿 + this.LastEditorTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm"); var path = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Config.Instance.Guid, Id); //濡傛灉娌℃湁瀛樺湪浣忓畢鐩綍锛屽厛鍒涘缓 if (!System.IO.Directory.Exists(path)) diff --git a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs index d30d6cd..2fe6c56 100755 --- a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs +++ b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs @@ -78,6 +78,8 @@ this.AddNormalDeviceReportEvent(); //娣诲姞浼犳劅鍣ㄧ姸鎬佷笂鎶ヤ簨浠� this.AddSensorDeviceReportEvent(); + //寮�鍚紶鎰熷櫒鐘舵�佽繕鍘熺殑绾跨▼ + this.StartRecoverSenorStatuThread(); } /// <summary> @@ -460,6 +462,7 @@ { //鍏堟竻绌� listView.RemoveAll(); + this.dicDeviceRowControl = new Dictionary<string, Controls.DeviceRowCommon>(); var listDevice = new List<CommonDevice>(); for (int i = 0; i < rowInfo.listDeviceKeys.Count; i++) @@ -888,6 +891,44 @@ #endregion + #region 鈻� 浼犳劅鍣ㄧ姸鎬佽繕鍘焈____________________ + + /// <summary> + /// 寮�鍚紶鎰熷櫒鐘舵�佽繕鍘熺殑绾跨▼ + /// </summary> + private void StartRecoverSenorStatuThread() + { + HdlThreadLogic.Current.RunThread(() => + { + while (this.Parent != null) + { + try + { + var dicControl = this.dicDeviceRowControl; + foreach (var contr in dicControl.Values) + { + //濡傛灉鏄紶鎰熷櫒,鍒欏埛鏂扮姸鎬� + if (contr.device.Type == DeviceType.IASZone && contr.Parent != null + && ((IASZone)contr.device).iASInfo == null) + { + HdlThreadLogic.Current.RunMain(() => + { + //璁惧鐘舵�佸繀椤诲埛鏂� + string statuText = HdlDeviceOtherLogic.Current.GetDeviceStatu(contr.device); + contr.SetDeviceStatuText(statuText); + + }, ShowErrorMode.NO); + } + } + System.Threading.Thread.Sleep(8000); + } + catch { System.Threading.Thread.Sleep(3000); } + } + }); + } + + #endregion + #region 鈻� 鏁村悎璁惧___________________________ /// <summary> diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs index 3b5ffb5..746574f 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs @@ -21,14 +21,14 @@ public HorizontalScrolViewLayout roomhorizontalScrol = new HorizontalScrolViewLayout { Width = Application.GetRealWidth(1080 - 58), - Height = Application.GetRealHeight(200), + Height = Application.GetRealHeight(204), Y = Application.GetRealHeight(184), X = Application.GetRealWidth(58), }; public VerticalScrolViewLayout middle = new VerticalScrolViewLayout { Width = Application.GetRealWidth(1080), - Height = Application.GetRealHeight(Method.H - 260 - 200 - 184), + Height = Application.GetRealHeight(Method.H - 260 - 204 - 184), BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, }; @@ -228,49 +228,31 @@ for (int i = 0; i < RoomList.Count; i++) { var room = RoomList[i]; - var fra = new FrameLayout - { - Height = Application.GetRealHeight(200), - Width = Application.GetRealWidth(255), - }; - roomhorizontalScrol.AddChidren(fra); - var roombjBtn = new Button - { - Height = Application.GetRealHeight(158), - Width = Application.GetRealWidth(255), - UnSelectedImagePath = "ZigeeLogic/iconBackgroundColor.png", - SelectedImagePath = "ZigeeLogic/iconSelectedBackgroundColor.png", - Y = Application.GetRealHeight(21), - }; - fra.AddChidren(roombjBtn); - - var roomnameBtn = new Button - { - - Height = Application.GetRealHeight(152 - 26 - 20), - Width = Application.GetRealWidth(255 - 20 - 50), - Text = room.Name, - TextColor = ZigbeeColor.Current.LogicBtnCancelColor, - SelectedTextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - Y = Application.GetRealHeight(21 + 13 + 10), - X = Application.GetRealWidth(10 + 25), - - }; - fra.AddChidren(roomnameBtn); + LogicView.RoomClickView roomClickView = new LogicView.RoomClickView(); + roomClickView.Show(roomhorizontalScrol); + roomClickView.roomnameBtn.Text =room.Name; if (i == 0) { - roombjButton.IsSelected = false; - roombjButton = roombjBtn; - roombjBtn.IsSelected = true; + roombjButton.IsSelected = false; + roomClickView.roombjBtn.Height = Application.GetRealHeight(135); + roomClickView.roombjBtn.Width = Application.GetRealWidth(245); + roomClickView.roombjBtn.Y = Application.GetRealHeight(40); + roomClickView.roombjBtn.X = Application.GetRealWidth(0); + roombjButton = roomClickView.roombjBtn; + roomClickView.roombjBtn.IsSelected = true; roomTextButton.IsSelected = false; - roomTextButton = roomnameBtn; - roomnameBtn.IsSelected = true; + roomClickView.roomnameBtn.Width = Application.GetRealWidth(245 - 60 * 2); + roomClickView.roomnameBtn.X = Application.GetRealWidth(60); + roomTextButton = roomClickView.roomnameBtn; + roomClickView.roomnameBtn.IsSelected = true; + SceneView(room.ListSceneId); } + EventHandler<MouseEventArgs> roomclick = (sender, e) => { @@ -279,17 +261,31 @@ clickbutton = null; clickbutton = new Button(); + roombjButton.Height = Application.GetRealHeight(72); + roombjButton.Width = Application.GetRealWidth(170); + roombjButton.Y = Application.GetRealHeight(60); + roombjButton.X = Application.GetRealWidth(26); roombjButton.IsSelected = false; - roombjButton = roombjBtn; - roombjBtn.IsSelected = true; + roomClickView.roombjBtn.Height = Application.GetRealHeight(135); + roomClickView.roombjBtn.Width = Application.GetRealWidth(245); + roomClickView.roombjBtn.Y = Application.GetRealHeight(40); + roomClickView.roombjBtn.X = Application.GetRealWidth(0); + roombjButton = roomClickView.roombjBtn; + roomClickView.roombjBtn.IsSelected = true; + + roomTextButton.Width = Application.GetRealWidth(125); + roomTextButton.X = Application.GetRealWidth(26 + 22); roomTextButton.IsSelected = false; - roomTextButton = roomnameBtn; - roomnameBtn.IsSelected = true; + roomClickView.roomnameBtn.Width = Application.GetRealWidth(245 - 60 * 2); + roomClickView.roomnameBtn.X = Application.GetRealWidth(60); + roomTextButton = roomClickView.roomnameBtn; + roomClickView.roomnameBtn.IsSelected = true; + SceneView(room.ListSceneId); }; - roomnameBtn.MouseUpEventHandler += roomclick; - roombjBtn.MouseUpEventHandler += roomclick; + roomClickView.roomnameBtn.MouseUpEventHandler += roomclick; + roomClickView.roombjBtn.MouseUpEventHandler += roomclick; } } diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs b/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs index 426b615..9412a75 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs @@ -22,7 +22,7 @@ completeView.Btntitle.Text = LocalDevice.Current.GetDeviceEpointName(common); EventHandler<MouseEventArgs> clickcancel = (sender, e) => { - if (!edit) + if (edit) { UserView.HomePage.Instance.ScrollEnabled = true; } @@ -323,8 +323,9 @@ closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; openView.selectedIconBtn.Visible = true; closeView.selectedIconBtn.Visible = false; - if (iASZonedevice.IasDeviceType == 13||iASZonedevice.IasDeviceType == 541) + if (iASZonedevice.IasDeviceType == 13) { + closeView.selectedIconBtn.Visible = true; } Send.dictionary(deviceConditionsInfo, "Range", "5"); @@ -355,13 +356,74 @@ { case 13: { - openView.titleBtn.TextID = MyInternationalizationString.someone; - closeView.titleBtn.TextID = MyInternationalizationString.unattendedtime1; - closeView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor; - closeView.selectedIconBtn.UnSelectedImagePath = "ZigeeLogic/next.png"; - closeView.selectedIconBtn.Visible = true; - completeView.Show(2).AddChidren(openView.Show()); - completeView.Show(2).AddChidren(closeView.Show()); + + if (common.ModelIdentifier == "MSPIRB-ZB.10") + { + int _height = 3; + if (edit) + { + _height = 2; + } + var view = completeView.Show(_height); + openView.titleBtn.TextID = MyInternationalizationString.someone; + closeView.titleBtn.TextID = MyInternationalizationString.unattendedtime1; + closeView.selectedIconBtn.UnSelectedImagePath = "ZigeeLogic/next.png"; + closeView.selectedIconBtn.Visible = true; + view.AddChidren(openView.Show()); + view.AddChidren(closeView.Show()); + + takebackView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor; + takebackView.selectedIconBtn.Visible = true; + takebackView.titleBtn.TextID = MyInternationalizationString.ambientLight; + takebackView.selectedIconBtn.UnSelectedImagePath = "ZigeeLogic/next.png"; + if (edit) + { + + if (devices["Cluster_ID"] == "1024") + { + flMain.RemoveFromParent(); + var illumination = new Illumination(); + UserView.HomePage.Instance.AddChidren(illumination); + UserView.HomePage.Instance.PageIndex += 1; + illumination.Show(common, takebackView.titleBtn.Text, int.Parse(devices["AttriButeData1"]), true); + } + else + { + closeView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor; + } + } + else + { + view.AddChidren(takebackView.Show()); + + } + + + takebackView.clickviewBtn.MouseUpEventHandler += (sender, e) => + { + SelectedDeviceStatus = ""; + openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; + openView.selectedIconBtn.Visible = false; + var illumination = new Illumination(); + UserView.HomePage.Instance.AddChidren(illumination); + UserView.HomePage.Instance.PageIndex += 1; + illumination.Show(common, takebackView.titleBtn.Text, 0, false); + + }; + + } + else + { + + openView.titleBtn.TextID = MyInternationalizationString.someone; + closeView.titleBtn.TextID = MyInternationalizationString.unattendedtime1; + closeView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor; + closeView.selectedIconBtn.UnSelectedImagePath = "ZigeeLogic/next.png"; + closeView.selectedIconBtn.Visible = true; + completeView.Show(2).AddChidren(openView.Show()); + completeView.Show(2).AddChidren(closeView.Show()); + + } } break; case 21: @@ -435,61 +497,6 @@ completeView.Show(1).AddChidren(openView.Show()); } break; - case 541: - { - int _height = 3; - if (edit) - { - _height = 2; - } - var view = completeView.Show(_height); - openView.titleBtn.TextID = MyInternationalizationString.someone; - closeView.titleBtn.TextID = MyInternationalizationString.unattendedtime1; - closeView.selectedIconBtn.UnSelectedImagePath = "ZigeeLogic/next.png"; - closeView.selectedIconBtn.Visible = true; - view.AddChidren(openView.Show()); - view.AddChidren(closeView.Show()); - - takebackView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor; - takebackView.selectedIconBtn.Visible = true; - takebackView.titleBtn.TextID = MyInternationalizationString.ambientLight; - takebackView.selectedIconBtn.UnSelectedImagePath = "ZigeeLogic/next.png"; - if (edit) - { - - if (devices["Cluster_ID"] == "1024") - { - flMain.RemoveFromParent(); - var illumination = new Illumination(); - UserView.HomePage.Instance.AddChidren(illumination); - UserView.HomePage.Instance.PageIndex += 1; - illumination.Show(common, takebackView.titleBtn.Text, int.Parse(devices["AttriButeData1"]), true); - } - else - { - closeView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor; - } - } - else - { - view.AddChidren(takebackView.Show()); - - } - - - takebackView.clickviewBtn.MouseUpEventHandler += (sender, e) => - { - SelectedDeviceStatus = ""; - openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; - openView.selectedIconBtn.Visible = false; - var illumination = new Illumination(); - UserView.HomePage.Instance.AddChidren(illumination); - UserView.HomePage.Instance.PageIndex += 1; - illumination.Show(common,takebackView.titleBtn.Text, 0, false); - - }; - } - break; default: { openView.titleBtn.TextID = MyInternationalizationString.callthepolice; @@ -544,6 +551,7 @@ completeView.Show(l).AddChidren(openView.Show()); openView.titleBtn.Text = LocalDevice.Current.GetDeviceEpointName(common); + //openView.titleBtn.Text =Language.StringByID(MyInternationalizationString.OnOffSwitch) + common.DeviceEpoint.ToString(); openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor; openView.clickviewBtn.MouseUpEventHandler += (sender, e) => { diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs index ebc0789..f9b736b 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicDveiceStatus.cs @@ -177,33 +177,40 @@ { case 13: { - if (conditions.ContainsKey("IgnoreTime")) + if (conditions["Cluster_ID"] == "1024") { - int minute = int.Parse(conditions["IgnoreTime"]) / 60; - int second = int.Parse(conditions["IgnoreTime"]) % 60; - if (minute != 0 && second != 0) - { - state = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1); - - } - else - { - if (minute == 0 && second != 0) - { - state = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1); - - } - if (minute != 0 && second == 0) - { - state = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.unattendedtime1); - - } - - } + state = Language.StringByID(MyInternationalizationString.ambientLight) + "<" + conditions["AttriButeData1"] + "lux" + Language.StringByID(MyInternationalizationString.hour1); } else { - state = Language.StringByID(MyInternationalizationString.someone); + if (conditions.ContainsKey("IgnoreTime")) + { + int minute = int.Parse(conditions["IgnoreTime"]) / 60; + int second = int.Parse(conditions["IgnoreTime"]) % 60; + if (minute != 0 && second != 0) + { + state = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1); + + } + else + { + if (minute == 0 && second != 0) + { + state = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1); + + } + if (minute != 0 && second == 0) + { + state = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.unattendedtime1); + + } + + } + } + else + { + state = Language.StringByID(MyInternationalizationString.someone); + } } } @@ -291,44 +298,7 @@ } break; - case 541: - { - if (conditions["Cluster_ID"] == "1024") { - state = Language.StringByID(MyInternationalizationString.ambientLight)+"<"+conditions["AttriButeData1"]+"lux"+ Language.StringByID(MyInternationalizationString.hour1); - } - else - { - if (conditions.ContainsKey("IgnoreTime")) - { - int minute = int.Parse(conditions["IgnoreTime"]) / 60; - int second = int.Parse(conditions["IgnoreTime"]) % 60; - if (minute != 0 && second != 0) - { - state = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1); - - } - else - { - if (minute == 0 && second != 0) - { - state = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1); - - } - if (minute != 0 && second == 0) - { - state = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.unattendedtime1); - - } - - } - } - else - { - state = Language.StringByID(MyInternationalizationString.someone); - } - } - } - break; + default: { if (intvalue == "1") diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs index fd74126..9725229 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicIfon.cs @@ -44,7 +44,7 @@ else if (common.Type == DeviceType.IASZone) { var iASZonedevice = common as IASZone; - if (iASZonedevice.IasDeviceType == 541) + if (iASZonedevice.ModelIdentifier == "MSPIRB-ZB.10") {//鐞冨舰绉诲姩浼犳劅鍣� if (Common.Logic.CurrentLogic.Conditions[i]["Cluster_ID"] == objecttype["Cluster_ID"]) { diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/RoomClickView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/RoomClickView.cs new file mode 100755 index 0000000..e6adce3 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/RoomClickView.cs @@ -0,0 +1,51 @@ +锘縰sing System; +namespace Shared.Phone.Device.Logic.LogicView +{ + public class RoomClickView + { + public RoomClickView() + { + + } + /// <summary> + /// 鐖舵帶浠� + /// </summary> + public FrameLayout fra = new FrameLayout + { + Height = Application.GetRealHeight(204), + Width = Application.GetRealWidth(245), + }; + /// <summary> + /// 鑳屾櫙鍥剧墖鎺т欢 + /// </summary> + public Button roombjBtn = new Button + { + Height = Application.GetRealHeight(72), + Width = Application.GetRealWidth(170), + UnSelectedImagePath = "ZigeeLogic/iconBackgroundColor1.png", + SelectedImagePath = "ZigeeLogic/iconSelectedBackgroundColor1.png", + Y = Application.GetRealHeight(60), + X = Application.GetRealWidth(26), + }; + /// <summary> + /// 鎴块棿鍚嶅瓧鎺т欢 + /// </summary> + public Button roomnameBtn = new Button + { + Height = Application.GetRealHeight(49), + Width = Application.GetRealWidth(125), + TextColor = Common.ZigbeeColor.Current.LogicBtnCancelColor, + SelectedTextColor = Common.ZigbeeColor.Current.LogicBlankBackgroundColor, + Y = Application.GetRealHeight(72), + X = Application.GetRealWidth(26 + 22), + + }; + public void Show(HorizontalScrolViewLayout HorizontalScrolViewLayout) + { + HorizontalScrolViewLayout.AddChidren(fra); + fra.AddChidren(roombjBtn); + fra.AddChidren(roomnameBtn); + } + + } +} diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs index 6fba6f9..7f76b73 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs @@ -46,7 +46,7 @@ { ///鍖哄垎鍑鸿緭鍏ユ潯浠跺拰杈撳嚭鐩爣璁惧 var listdevicetype = GetDevice(type); - var listdevice = GetDeviceUIList(listAllRoom[i], listdevicetype); + var listdevice = GetDeviceUIList(listAllRoom[i], listdevicetype, type); if (listdevice.Count == 0) { ///杩囨护鎺夋病鏈夎澶囩殑鎴块棿 @@ -68,8 +68,9 @@ /// </summary> /// <param name="room">褰撳墠鎴块棿</param> /// <param name="deviceTypelist">璁惧绫诲瀷</param> + /// /// <param name="type">閫昏緫绫诲瀷</param> /// <returns></returns> - public static List<CommonDevice> GetDeviceUIList(Common.Room room, List<DeviceType> deviceTypelist) + public static List<CommonDevice> GetDeviceUIList(Common.Room room, List<DeviceType> deviceTypelist,string type) { var deviceUIlist = new List<CommonDevice>(); foreach (var deviceKey in room.ListDevice) @@ -92,6 +93,22 @@ //鏆傛椂涓嶆敮鎸丼-one闂ㄩ攣; //杩囨护鎺変笉鏀寔S-one闂ㄩ攣璁惧; continue; + } + } + if (type == "condition_mould") + { + if (device.Type == DeviceType.IASZone) + { + if (device.IasDeviceType != 13) + {//鑷姩鍖栨ā鏉垮彧鏀寔绾㈠浼犳劅鍣� + continue; + } + if (device.ModelIdentifier == "MSPIRB-ZB.10") + { + //鑷姩鍖栨ā鏉夸笉鏀寔鍏夌収搴� + continue; + } + } } deviceUIlist.Add(device); @@ -261,8 +278,17 @@ { break; } - patm = $"ZigeeLogic/sensor{iASZonedevice.IasDeviceType}.png"; - selectedpatm = $"ZigeeLogic/selectedsensor{iASZonedevice.IasDeviceType}.png"; + + if (device.ModelIdentifier == "MSPIRB-ZB.10") + { + patm = $"ZigeeLogic/sensor541.png"; + selectedpatm = $"ZigeeLogic/selectedsensor541.png"; + } + else + { + patm = $"ZigeeLogic/sensor{iASZonedevice.IasDeviceType}.png"; + selectedpatm = $"ZigeeLogic/selectedsensor{iASZonedevice.IasDeviceType}.png"; + } } break; case DeviceType.TemperatureSensor: diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs index 45f0f72..0bacf91 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs @@ -12,9 +12,22 @@ { Tag = "Logic"; } + /// <summary> + /// 璁板綍鐐瑰嚮鎴块棿 + /// </summary> Button roombjButton = new Button(); + /// <summary> + /// 璁板綍鐐瑰嚮鎴块棿鍚嶇О + /// </summary> Button roomTextButton = new Button(); - Button devicetypeButton = new Button(); + /// <summary> + /// 璁板綍鐐瑰嚮璁惧 + /// </summary> + Button deviceTypeBjButton = new Button(); + /// <summary> + /// 璁板綍鐐瑰嚮璁惧绫诲瀷 + /// </summary> + Button deviceTypeTextButton = new Button(); FrameLayout clickframeLayout = new FrameLayout(); Button clickbutton = new Button(); Button clicktextcolcrbutton = new Button(); @@ -27,21 +40,33 @@ /// </summary> public HorizontalScrolViewLayout roomhorizontalScrol = new HorizontalScrolViewLayout { - Width = Application.GetRealWidth(1080 - 58), - Height = Application.GetRealHeight(200), - X = Application.GetRealWidth(58), + Width = Application.GetRealWidth(1080 - 29), + Height = Application.GetRealHeight(204), + X = Application.GetRealWidth(29), Y = Application.GetRealHeight(184), + }; + /// <summary> + /// 鍦嗚17 + /// </summary> + public HorizontalScrolViewLayout devicetypehorizontalScrol1 = new HorizontalScrolViewLayout + { + Width = Application.GetRealWidth(1080 - 52), + Height = Application.GetRealHeight(50), + Y = Application.GetRealHeight(184 + 204), + BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, + X = Application.GetRealWidth(52), + }; /// <summary> /// 璁惧绫诲瀷婊戝姩鐨勬帶浠� /// </summary> public HorizontalScrolViewLayout devicetypehorizontalScrol = new HorizontalScrolViewLayout { - Width = Application.GetRealWidth(1080 - 58), + Width = Application.GetRealWidth(1080 - 52), Height = Application.GetRealHeight(280), - Y = Application.GetRealHeight(184 + 200), + Y = Application.GetRealHeight(184 + 204), BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, - X = Application.GetRealWidth(58), + X = Application.GetRealWidth(52), // Radius = (uint)Application.GetRealHeight(50), }; @@ -51,8 +76,8 @@ public VerticalScrolViewLayout middle = new VerticalScrolViewLayout { X = Application.GetRealWidth(58), - Y = Application.GetRealHeight(184 + 200 + 280 + 40), - Height = Application.GetRealHeight(Method.H - 40 - 184 - 280 - 200), + Y = Application.GetRealHeight(184 + 204 + 280 + 40), + Height = Application.GetRealHeight(Method.H - 40 - 184 - 280 - 204), BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, }; @@ -88,15 +113,18 @@ if (roomlists.Count == 0) { //杩斿洖娌℃湁鎴块棿闅愯棌涓嬮潰鏁村潡; + devicetypehorizontalScrol1.Height = 0; devicetypehorizontalScrol.Height = 0; middle.Height = 0; } /// 璁惧绫诲瀷鍒楄〃 var deviceTypeList = Method.GetDevice(IfType); this.AddChidren(roomhorizontalScrol); + this.AddChidren(devicetypehorizontalScrol1); this.AddChidren(devicetypehorizontalScrol); this.AddChidren(middle); - devicetypehorizontalScrol.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerBottomLeft); + devicetypehorizontalScrol1.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft); + devicetypehorizontalScrol.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerBottomLeft|HDLUtils.RectCornerTopLeft); middle.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerTopLeft); ///妤煎眰鐐瑰嚮浜嬩欢 view.foolrclickBtn.MouseUpEventHandler += (sender, e) => @@ -187,11 +215,13 @@ var list = Method.GetRoomList(IfType, btnfoolrname.Tag.ToString()); if (list.Count == 0) { + devicetypehorizontalScrol1.Height = 0; devicetypehorizontalScrol.Height = 0; middle.Height = 0; } else { + devicetypehorizontalScrol1.Height = 50; devicetypehorizontalScrol.Height = Application.GetRealHeight(280); middle.Height = Application.GetRealHeight(1920 - 40 - 184 - 280 - 200); } @@ -214,70 +244,64 @@ { var room = roomlist[i]; - var fra = new FrameLayout - { - Height = Application.GetRealHeight(200), - Width = Application.GetRealWidth(255), - }; - roomhorizontalScrol.AddChidren(fra); - - var roombjBtn = new Button - { - Height = Application.GetRealHeight(158), - Width = Application.GetRealWidth(255), - UnSelectedImagePath = "ZigeeLogic/iconBackgroundColor.png", - SelectedImagePath = "ZigeeLogic/iconSelectedBackgroundColor.png", - Y = Application.GetRealHeight(21), - }; - fra.AddChidren(roombjBtn); - - var roomnameBtn = new Button - { - - Height = Application.GetRealHeight(152 - 26 - 20), - Width = Application.GetRealWidth(255 - 20 - 50), - Text = room.Name, - TextColor = ZigbeeColor.Current.LogicBtnCancelColor, - SelectedTextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, - Y = Application.GetRealHeight(21 + 13 + 10), - X = Application.GetRealWidth(10 + 25), - - }; - fra.AddChidren(roomnameBtn); + LogicView.RoomClickView roomClickView = new LogicView.RoomClickView(); + roomClickView.Show(roomhorizontalScrol); + roomClickView.roomnameBtn.Text = room.Name; if (i == 0)//榛樿閫変腑绗竴涓埧闂� { + roombjButton.IsSelected = false; - roombjButton = roombjBtn; - roombjBtn.IsSelected = true; - + roomClickView.roombjBtn.Height = Application.GetRealHeight(135); + roomClickView.roombjBtn.Width = Application.GetRealWidth(245); + roomClickView.roombjBtn.Y = Application.GetRealHeight(40); + roomClickView.roombjBtn.X = Application.GetRealWidth(0); + roombjButton = roomClickView.roombjBtn; + roomClickView.roombjBtn.IsSelected = true; roomTextButton.IsSelected = false; - roomTextButton = roomnameBtn; - roomnameBtn.IsSelected = true; + roomClickView.roomnameBtn.Width = Application.GetRealWidth(245 - 60 * 2); + roomClickView.roomnameBtn.X = Application.GetRealWidth(60); + roomTextButton = roomClickView.roomnameBtn; + roomClickView.roomnameBtn.IsSelected = true; - roombjBtn.IsSelected = true; - roomnameBtn.IsSelected = true; - - var list = Method.GetDeviceUIList(room, deviceTypeList); + var list = Method.GetDeviceUIList(room, deviceTypeList, IfType); AllDeviceTypeView(list); } EventHandler<MouseEventArgs> roomclick = (sender, e) => { + roombjButton.Height = Application.GetRealHeight(72); + roombjButton.Width = Application.GetRealWidth(170); + roombjButton.Y = Application.GetRealHeight(60); + roombjButton.X = Application.GetRealWidth(26); roombjButton.IsSelected = false; - roombjButton = roombjBtn; - roombjBtn.IsSelected = true; + roombjButton.Height = Application.GetRealHeight(72); + roombjButton.Width = Application.GetRealWidth(170); + roombjButton.Y = Application.GetRealHeight(60); + roombjButton.X = Application.GetRealWidth(26); + roombjButton.IsSelected = false; + + roomClickView.roombjBtn.Height = Application.GetRealHeight(135); + roomClickView.roombjBtn.Width = Application.GetRealWidth(245); + roomClickView.roombjBtn.Y = Application.GetRealHeight(40); + roomClickView.roombjBtn.X = Application.GetRealWidth(0); + roombjButton = roomClickView.roombjBtn; + roomClickView.roombjBtn.IsSelected = true; + + roomTextButton.Width = Application.GetRealWidth(125); + roomTextButton.X = Application.GetRealWidth(26 + 22); roomTextButton.IsSelected = false; - roomTextButton = roomnameBtn; - roomnameBtn.IsSelected = true; + roomClickView.roomnameBtn.Width = Application.GetRealWidth(245 - 60 * 2); + roomClickView.roomnameBtn.X = Application.GetRealWidth(60); + roomTextButton = roomClickView.roomnameBtn; + roomClickView.roomnameBtn.IsSelected = true; - - var list = Method.GetDeviceUIList(room, deviceTypeList); + var list = Method.GetDeviceUIList(room, deviceTypeList, IfType); AllDeviceTypeView(list); }; - roomnameBtn.MouseUpEventHandler += roomclick; - roombjBtn.MouseUpEventHandler += roomclick; + roomClickView.roomnameBtn.MouseUpEventHandler += roomclick; + roomClickView.roombjBtn.MouseUpEventHandler += roomclick; } } @@ -292,30 +316,27 @@ for (int i = 0; i < devicetypelist.Count; i++) { var devicetype = devicetypelist[i]; - var spaceRowLayout = new FrameLayout(); - devicetypehorizontalScrol.AddChidren(spaceRowLayout); + if (i == 0) { + var spaceRowLayout = new FrameLayout(); + devicetypehorizontalScrol.AddChidren(spaceRowLayout); spaceRowLayout.Width = Application.GetRealWidth(37); } - else - { - spaceRowLayout.Width = Application.GetRealWidth(80); - } + var deviceRowLayout = new FrameLayout { - Width = Application.GetRealWidth(156 + 20), - Height = Application.GetRealHeight(280 - 30), - Y = Application.GetRealHeight(30), + Width = Application.GetRealWidth(150+75), + Height = Application.GetRealHeight(173+52), + Y = Application.GetRealHeight(35), }; devicetypehorizontalScrol.AddChidren(deviceRowLayout); var backgroundColor = new Button { - Width = Application.GetMinRealAverage(156), - Height = Application.GetMinRealAverage(180), - X = Application.GetRealWidth(10), + Width = Application.GetMinRealAverage(150), + Height = Application.GetMinRealAverage(173), UnSelectedImagePath = "ZigeeLogic/deviceunselectedbackgroundcolor.png", SelectedImagePath = "ZigeeLogic/deviceselectedbackgroundcolor.png", }; @@ -326,21 +347,22 @@ { Width = Application.GetMinRealAverage(84), Height = Application.GetMinRealAverage(84), - X = Application.GetRealWidth(46), - Y = Application.GetRealHeight(30), + X = Application.GetRealWidth(35), + Y = Application.GetRealHeight(29), UnSelectedImagePath =Method.GetDeviceTypeIcon(devicetype), }; deviceRowLayout.AddChidren(devicetypeicon); var devicetypename = new Button { - Width = Application.GetRealWidth(176), - Height = Application.GetRealHeight(40), + Width = Application.GetRealWidth(150), + Height = Application.GetRealHeight(52), Text = devicetype, TextAlignment = TextAlignment.Center, Y = backgroundColor.Bottom, - TextColor = ZigbeeColor.Current.LogicAddColor, TextSize = 10, + TextColor =ZigbeeColor.Current.LogicBtnSelectedColor, + SelectedTextColor =ZigbeeColor.Current.LogicAddColor, }; deviceRowLayout.AddChidren(devicetypename); @@ -356,13 +378,18 @@ EventHandler<MouseEventArgs> devicetypeclick = (sender13, e13) => { - devicetypeButton.IsSelected = false; - devicetypeButton = backgroundColor; + deviceTypeBjButton.IsSelected = false; + deviceTypeBjButton = backgroundColor; backgroundColor.IsSelected = true; + + deviceTypeTextButton.IsSelected = false; + deviceTypeTextButton = devicetypename; + devicetypename.IsSelected = true; + + var list = Method.GetDeviceType(devicetypename.Text); ConditionDeviceView(list, devicelist); }; - deviceRowLayout.MouseUpEventHandler += devicetypeclick; devicetypename.MouseUpEventHandler += devicetypeclick; devicetypeicon.MouseUpEventHandler += devicetypeclick; backgroundColor.MouseUpEventHandler += devicetypeclick; @@ -387,13 +414,6 @@ if (deviceTypelist.Count != 0 && !deviceTypelist.Contains(common.Type)) { continue; - } - if (IfType == "condition_mould") - { - if (common.IasDeviceType != 13) - {//鑷姩鍖栨ā鏉垮彧鏀寔绾㈠浼犳劅鍣� - continue; - } } var deviceFramelayout = new FrameLayout { diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs index 7502d06..04d882d 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs @@ -1361,8 +1361,8 @@ /// 鍒ゆ柇瀛楀吀鏄惁瀛樺湪鐨勬柟娉� /// </summary> /// <param name="deviceConditionsInfo"></param> - /// <param name="Key"></param> - /// <param name="Value"></param> + /// <param name="Key">閿�</param> + /// <param name="Value">閿��</param> public static void dictionary(Dictionary<string, string> deviceConditionsInfo, string Key, string Value) { if (deviceConditionsInfo.ContainsKey(Key)) @@ -1372,6 +1372,6 @@ deviceConditionsInfo.Add(Key, Value); } - + } } diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs index 0f5a797..deb3564 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs @@ -10,6 +10,7 @@ { public class SkipView:FrameLayout { + /// <summary> /// 鍏跺畠鐣岄潰璺宠繘鏉ョ殑鍏ュ彛 /// </summary> @@ -73,6 +74,19 @@ //functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; #region ---鎺ㄨ崘妯℃澘鐨勭粍浠� //鎺ㄨ崘妯℃澘鑳屾櫙鎺т欢 + + + var bjFrameLayout1 = new FrameLayout + { + Width = Application.GetRealWidth(1080 - 58), + Height = Application.GetRealHeight(50), + BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, + X = Application.GetRealWidth(58), + //Radius = (uint)Application.GetRealHeight(50), + Y = Application.GetRealHeight(30), + + }; + functionSceneAutoBodyView.AddChidren(bjFrameLayout1); var bjFrameLayout = new FrameLayout { Width = Application.GetRealWidth(1080 - 58), @@ -81,10 +95,10 @@ X = Application.GetRealWidth(58), //Radius = (uint)Application.GetRealHeight(50), Y = Application.GetRealHeight(30), - }; functionSceneAutoBodyView.AddChidren(bjFrameLayout); - bjFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft); + bjFrameLayout1.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft); + bjFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft|HDLUtils.RectCornerBottomLeft); //鍥炬爣鎺т欢 var sigBtn = new Button { @@ -241,7 +255,7 @@ { if (!Config.Instance.Home.IsVirtually) {//铏氭嫙鐨勪笉鑾峰彇缃戝叧閫昏緫鍒楄〃 - //閲嶆柊鍒锋柊logic鍒楄〃 + //閲嶆柊鍒锋柊logic鍒楄〃 If_once = true; Common.Logic.LogicList.Clear(); Read(logicScrolView, no); @@ -306,6 +320,7 @@ Common.Logic.LogicList.Add(logic); } } + } } } @@ -319,6 +334,7 @@ CommonPage.Loading.Hide(); } static RowLayout selectedRow = new RowLayout() { Tag = "0" };//璁板綍宸︽粦鐘舵�� + /// <summary> /// 鍔犺浇鑷姩鍖栧垪琛ㄧ晫闈� /// </summary> @@ -868,6 +884,8 @@ return false; } + + } } diff --git a/ZigbeeApp/Shared/Phone/Device/VideoIntercom/VideoMachine.cs b/ZigbeeApp/Shared/Phone/Device/VideoIntercom/VideoMachine.cs index 070ceac..69299ed 100755 --- a/ZigbeeApp/Shared/Phone/Device/VideoIntercom/VideoMachine.cs +++ b/ZigbeeApp/Shared/Phone/Device/VideoIntercom/VideoMachine.cs @@ -115,7 +115,7 @@ /// <summary> /// 鍒ゆ柇璐﹀彿鏄惁鏀寔鍙瀵硅 /// </summary> - /// <param name="topFrameLayout"></param> + /// <param name="topFrameLayout">鍙瀵硅鍥炬爣鐨勭埗鎺т欢</param> public async static void AccountSupportVideo(FrameLayout topFrameLayout) { var jobject = new JObject(); @@ -166,9 +166,6 @@ } catch { } } - - - } /// <summary> /// 鑾峰彇鍙瀵硅鍒楄〃 diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs index 098d1b9..b935e42 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs @@ -1052,8 +1052,8 @@ this.listControl[1].IsSelected = false; this.listControl[2].IsSelected = false; this.listControl[3].IsSelected = false; - arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor); } + arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor); //璁剧疆鐘舵�佹枃瀛� 鍏抽棴 this.SetStatuText(Language.StringByID(R.MyInternationalizationString.Close)); return; @@ -1068,8 +1068,8 @@ this.listControl[1].IsSelected = true; this.listControl[2].IsSelected = true; this.listControl[3].IsSelected = true; - arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor); } + arcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor); } this.listControl[1].SelectedImagePath = DeviceAcDetailCardMethord.GetModeSelectedImagePathByModeId(deviceAc.currentSystemMode); this.listControl[1].UnSelectedImagePath = DeviceAcDetailCardMethord.GetModeUnSelectedImagePathByModeId(deviceAc.currentSystemMode); diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs index 5a87885..3634885 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceMiniLightDetailCardForm.cs @@ -405,7 +405,12 @@ { HdlThreadLogic.Current.RunMain(() => { + //鎺ユ敹鍒扮綉鍏冲洖澶� this.btnBuzzerSwitch.CanClick = true; + if (result == true) + { + this.btnBuzzerSwitch.IsSelected = isOpen; + } }); }); //鍙戦�佸懡浠� diff --git a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs index f28273d..636fc83 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs @@ -85,6 +85,8 @@ this.AddNormalDeviceReportEvent(); //娣诲姞浼犳劅鍣ㄧ姸鎬佷笂鎶ヤ簨浠� this.AddSensorDeviceReportEvent(); + //寮�鍚紶鎰熷櫒鐘舵�佽繕鍘熺殑绾跨▼ + this.StartRecoverSenorStatuThread(); } /// <summary> @@ -1163,6 +1165,40 @@ #region 鈻� 浼犳劅鍣ㄧ姸鎬佽繕鍘焈____________________ + /// <summary> + /// 寮�鍚紶鎰熷櫒鐘舵�佽繕鍘熺殑绾跨▼ + /// </summary> + private void StartRecoverSenorStatuThread() + { + HdlThreadLogic.Current.RunThread(() => + { + while (this.Parent != null) + { + try + { + var dicControl = this.dicDeviceCardControl; + foreach (var contr in dicControl.Values) + { + //濡傛灉鏄紶鎰熷櫒,鍒欏埛鏂扮姸鎬� + if (contr.device.Type == DeviceType.IASZone && contr.Parent != null + && ((IASZone)contr.device).iASInfo == null) + { + HdlThreadLogic.Current.RunMain(() => + { + //璁惧鐘舵�佸繀椤诲埛鏂� + string statuText = HdlDeviceOtherLogic.Current.GetDeviceStatu(contr.device); + contr.SetDeviceStatuText(statuText); + + }, ShowErrorMode.NO); + } + } + System.Threading.Thread.Sleep(8000); + } + catch { System.Threading.Thread.Sleep(3000); } + } + }); + } + #endregion #region 鈻� 鍒囨崲妤煎眰___________________________ diff --git a/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDevice.cs b/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDevice.cs index b2df8fa..304eb74 100755 --- a/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDevice.cs +++ b/ZigbeeApp/Shared/Phone/SmartSound/Forms/SmartSoundContentForDevice.cs @@ -135,6 +135,13 @@ else { tipLayout.Visible = false; + } + + if (listView.ChildrenCount > 5) + { + TextView textView = new TextView(); + textView.Height = Application.GetRealHeight(127 * 3); + listView.AddChidren(textView); } } catch (Exception ex) diff --git a/ZigbeeApp/Shared/Phone/TemplateData/TemplateCommonLogic.cs b/ZigbeeApp/Shared/Phone/TemplateData/TemplateCommonLogic.cs new file mode 100755 index 0000000..4537e58 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/TemplateData/TemplateCommonLogic.cs @@ -0,0 +1,1846 @@ +锘縰sing Shared.Phone.UserCenter; +using System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; + +namespace Shared.Phone.TemplateData +{ + /// <summary> + /// 妯℃澘鐨勫叡閫氶�昏緫绫� + /// </summary> + public class TemplateCommonLogic + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 妯℃澘鐨勫叡閫氶�昏緫绫� + /// </summary> + private static TemplateCommonLogic m_Current = null; + /// <summary> + /// 妯℃澘鐨勫叡閫氶�昏緫绫� + /// </summary> + public static TemplateCommonLogic Current + { + get + { + if (m_Current == null) + { + m_Current = new TemplateCommonLogic(); + } + return m_Current; + } + } + /// <summary> + /// 妯℃澘鏁版嵁 + /// </summary> + public TemplateMemoryData modelData = new TemplateMemoryData(); + /// <summary> + /// 妯℃澘鏂囦欢涓� #start# 鍒� #end# 鐨勫唴瀹�(涓存椂鍙橀噺) + /// </summary> + private string strTempContentData = string.Empty; + /// <summary> + /// 鏈湴妯℃澘鏂囦欢鐨勫悕瀛� + /// </summary> + private const string TemplateFileName = "ModelData_Release.bin"; + + #endregion + + #region 鈻� 鍔犺浇鏈湴妯℃澘缂撳瓨___________________ + + /// <summary> + /// 鍔犺浇鏈湴妯℃澘鏂囦欢缂撳瓨(姝ゆ柟娉曚互鏈湴缂撳瓨涓哄噯,鍒囨崲浣忓畢鏃朵娇鐢�) + /// </summary> + public void LoadLocalTemplateMemoryData() + { + this.modelData = new TemplateMemoryData(); + //淇濆瓨鐨勮矾寰� + string saveFile = DirNameResourse.LocalTemplateDirectory; + + //濡傛灉褰撳墠浣忓畢鎷ユ湁閫夋嫨鐨勬ā鏉� + if (Common.Config.Instance.Home.SelectTemplate != string.Empty) + { + string checkFile = System.IO.Path.Combine(saveFile, TemplateFileName); + //濡傛灉鏈湴娌℃湁杩欎釜bin鏂囦欢 + if (System.IO.File.Exists(checkFile) == false) + { + //澶嶅埗妯℃澘bin鏂囦欢鍒版湰鍦扮殑妯℃澘鏂囦欢澶归噷 + this.CopyTemplateFileToLocalDirectory(Common.Config.Instance.Home.SelectTemplate); + } + } + + //鑾峰彇杩欎釜璺緞涓嬮潰鍏ㄩ儴鐨勬枃浠� + var listFile = HdlFileLogic.Current.GetFileFromDirectory(saveFile); + + //妯℃澘Bin鏂囦欢 + string templateBinFile = string.Empty; + //杩欓噷鏄鍙栦粬涓婁竴娆$紪杈戝畬鎴愪箣鍚庣殑妯℃澘鏁版嵁(涔熷氨鏄紪杈戝埌涓�鍗婁箣鍚�,閫�鍑篈pp,涓嬩竴娆″啀缂栬緫) + foreach (var fileName in listFile) + { + if (fileName == TemplateFileName) + { + //妯℃澘Bin鏂囦欢 + templateBinFile = fileName; + continue; + } + if (fileName.StartsWith("Device_") == false) + { + //鍙璁惧 + continue; + } + string fileData = HdlFileLogic.Current.ReadFileTextContent(System.IO.Path.Combine(saveFile, fileName)); + if (fileData == null) + { + continue; + } + string deviceData = string.Empty; + ModelDeviceSaveEnum saveDiv = ModelDeviceSaveEnum.A鏈畾涔�; + //鏍规嵁鎹㈣绗﹀垏鍒嗘暟鎹枃鏈� + string[] arryData = fileData.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); + foreach (string strData in arryData) + { + //璁惧鏁版嵁鏍囧織 + if (strData.StartsWith("===>") == true) + { + if (deviceData != string.Empty) + { + //鍙嶅簭鍒楀寲璁惧鐨勪繚瀛樻枃浠跺唴瀹� + var tempData = this.DeserializeDeviceDataByDiv(saveDiv, deviceData); + //灏嗚澶囨ā鏉挎暟鎹坊鍔犲叆缂撳瓨 + string mainKey = Common.LocalDevice.Current.GetDeviceMainKeys(tempData.DeviceMac, tempData.DeviceEpoint); + this.SetTemplateDeviceDataToMemmory(tempData, deviceData, mainKey, true); + } + //娓呯┖ + deviceData = string.Empty; + saveDiv = (ModelDeviceSaveEnum)Convert.ToInt32(strData.Substring(4)); + continue; + } + deviceData += strData; + } + if (deviceData != string.Empty) + { + //鍙嶅簭鍒楀寲璁惧鐨勪繚瀛樻枃浠跺唴瀹� + var tempData = this.DeserializeDeviceDataByDiv(saveDiv, deviceData); + //灏嗚澶囨ā鏉挎暟鎹坊鍔犲叆缂撳瓨 + string mainKey = Common.LocalDevice.Current.GetDeviceMainKeys(tempData.DeviceMac, tempData.DeviceEpoint); + this.SetTemplateDeviceDataToMemmory(tempData, deviceData, mainKey, true); + } + } + + //璇诲彇妯℃澘Bin鏂囦欢 + if (templateBinFile != string.Empty) + { + bool hadRoom = HdlRoomLogic.Current.GetAllListRooms().Count > 1; + //寮�濮嬭鍙栨枃浠跺唴瀹� + this.ReadTemplateFileMethord((strData, saveDiv, deviceType) => + { + //鍦ㄥ姞杞芥湰鍦扮紦瀛樼殑鍓嶆彁涓�,澶勭悊妯℃澘鏂囦欢閲岄潰鐨勭壒娈婂唴瀹� + var result = this.AdjustTemplateBinFileContentOnLoadMemory(strData, hadRoom); + //false浠h〃瀹冧笉鏄壒娈婂唴瀹� + if (result == false) + { + //澶勭悊妯℃澘鏂囦欢閲岄潰鐨勫叡閫氬唴瀹� + //鍥犱负涓婇潰宸茬粡鍔犺浇浜嗘寚瀹氭湰鍦扮殑缂撳瓨,鎵�浠ヨ繖閲屼笉闇�瑕佹坊鍔犲叆dicDeviceTemplateData涓� + this.AdjustTemplateBinFileCommonContent(strData, saveDiv, deviceType, false); + } + }); + } + //娓呯┖瀵硅薄缂撳瓨 + this.strTempContentData = string.Empty; + + //鍔犺浇璁惧鍜岀綉鍏虫ā鏉块�夋嫨鐨勬暟鎹� + this.modelData.dicDeviceTemplateSelect = new Dictionary<string, string>(); + this.modelData.dicGatewayTemplateSelect = new Dictionary<string, string>(); + + string fileData2 = HdlFileLogic.Current.ReadFileTextContent(DirNameResourse.DeviceTemplateSelectFile); + if (fileData2 != null) + { + //璁惧閫夋嫨鐨勬ā鏉垮璞�(keys:鏈湴璁惧鐨凪ac value:妯℃澘涓殑Mac) + this.modelData.dicDeviceTemplateSelect = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, string>>(fileData2); + } + fileData2 = HdlFileLogic.Current.ReadFileTextContent(DirNameResourse.GatewayTemplateSelectFile); + if (fileData2 != null) + { + //缃戝叧瀵硅薄閫夋嫨鐨勬ā鏉垮璞�(keys:鏈湴缃戝叧ID, value:妯℃澘涓殑缃戝叧ID) + this.modelData.dicGatewayTemplateSelect = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, string>>(fileData2); + } + } + + /// <summary> + /// 鍦ㄥ姞杞芥湰鍦扮紦瀛樼殑鍓嶆彁涓�,澶勭悊妯℃澘鏂囦欢閲岄潰鐨勭壒娈婂唴瀹� + /// </summary> + /// <param name="strData">妯℃澘鏂囦欢涓殑琛屾暟鎹�</param> + /// <param name="hadRoom">鏄惁宸茬粡鏈変簡鎴块棿</param> + private bool AdjustTemplateBinFileContentOnLoadMemory(string strData,bool hadRoom) + { + //鍦烘櫙瀵硅薄 + if (strData == "#SceneTemplate END#") + { + if (hadRoom == false) + { + //鍙垵濮嬪寲涓�娆�,鏈夋埧闂存椂浠h〃宸茬粡涓嶆槸绗竴娆″姞杞戒簡 + var scene = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.SceneUI>(this.strTempContentData); + scene.Save(); + } + this.strTempContentData = string.Empty; + return true; + } + //妤煎眰瀵硅薄 + else if (strData == "#FloorInfo END#") + { + if (hadRoom == false) + { + //鍙垵濮嬪寲涓�娆�,鏈夋埧闂存椂浠h〃宸茬粡涓嶆槸绗竴娆″姞杞戒簡 + Common.Config.Instance.Home.FloorDics = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, string>>(this.strTempContentData); + } + this.strTempContentData = string.Empty; + return true; + } + //鎴块棿瀵硅薄 + else if (strData == "#RoomInfo END#") + { + var room = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.Room>(this.strTempContentData); + //鍚勮嚜绔偣鎵�澶勭殑鎴块棿ID,淇濆瓨璧锋潵 + foreach (var deviceKey in room.ListDevice) + { + this.modelData.dicDeviceTemplateRoom[deviceKey] = room.Id; + } + if (hadRoom == false) + { + //绗竴娆″姞杞�,璁惧鍒楄〃闇�瑕佹竻绌�,閫夋嫨璁惧妯℃澘鏃�,鎵嶆坊鍔� + room.ListDevice.Clear(); + room.Save(); + } + this.strTempContentData = string.Empty; + return true; + } + //璁惧閫夋嫨鐨勬ā鏉� + else if (strData == "#DeviceSelectTemplate END#") + { + //杩欎釜涓滆タ鍦ㄨ繖涓垎鏀笅涓嶄粠鏂囦欢涓鍙�,浠庢湰鍦扮紦瀛樻枃浠跺綋涓幏鍙� + this.strTempContentData = string.Empty; + return true; + } + //缃戝叧閫夋嫨鐨勬ā鏉� + else if (strData == "#GatewaySelectTemplate END#") + { + //杩欎釜涓滆タ鍦ㄨ繖涓垎鏀笅涓嶄粠鏂囦欢涓鍙�,浠庢湰鍦扮紦瀛樻枃浠跺綋涓幏鍙� + this.strTempContentData = string.Empty; + return true; + } + return false; + } + + #endregion + + #region 鈻� 鏍规嵁妯℃澘Bin鏂囦欢鎭㈠鏁版嵁____________ + + /// <summary> + /// 鏍规嵁妯℃澘Bin鏂囦欢,鎭㈠鏁版嵁(鍒嗕袱涓嚱鏁板惂,澶毦鎺у埗浜�) + /// </summary> + public void RecoverDataByTemplateBinFile() + { + //閲嶆柊鍒濆鍖� + this.modelData = new TemplateMemoryData(); + + //寮�濮嬭鍙栨枃浠跺唴瀹� + this.ReadTemplateFileMethord((strData, saveDiv, deviceType) => + { + //鍦ㄦ仮澶嶆暟鎹殑鍓嶆彁涓�,澶勭悊妯℃澘鏂囦欢閲岄潰鐨勭壒娈婂唴瀹� + var result = this.AdjustTemplateBinFileContentOnRecover(strData); + //false浠h〃瀹冧笉鏄壒娈婂唴瀹� + if (result == false) + { + //澶勭悊妯℃澘鏂囦欢閲岄潰鐨勫叡閫氬唴瀹� + //鍥犱负鏄互妯℃澘鏉ユ仮澶嶄綇瀹呮暟鎹�,鎵�浠ヨ繖閲岄渶瑕佹坊鍔犲叆dicDeviceTemplateData涓� + this.AdjustTemplateBinFileCommonContent(strData, saveDiv, deviceType, true); + } + }); + //娓呯┖瀵硅薄缂撳瓨 + this.strTempContentData = string.Empty; + + //鍒犳帀杩欎袱涓繚瀛橀�夋嫨妯℃澘鐨勬枃浠�(杩欎袱涓笢瑗垮彲鑳借繕瀛樺湪) + HdlFileLogic.Current.DeleteFile(DirNameResourse.DeviceTemplateSelectFile); + HdlFileLogic.Current.DeleteFile(DirNameResourse.GatewayTemplateSelectFile); + + //鍐嶆鍒濆鍖栨埧闂� + HdlRoomLogic.Current.InitAllRoom(); + } + + /// <summary> + /// 鍦ㄦ仮澶嶆暟鎹殑鍓嶆彁涓�,澶勭悊妯℃澘鏂囦欢閲岄潰鐨勭壒娈婂唴瀹� + /// </summary> + /// <param name="strData">妯℃澘鏂囦欢涓殑琛屾暟鎹�</param> + private bool AdjustTemplateBinFileContentOnRecover(string strData) + { + //鍦烘櫙瀵硅薄 + if (strData == "#SceneTemplate END#") + { + var scene = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.SceneUI>(this.strTempContentData); + scene.Save(); + this.strTempContentData = string.Empty; + return true; + } + //妤煎眰瀵硅薄 + else if (strData == "#FloorInfo END#") + { + Common.Config.Instance.Home.FloorDics = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, string>>(this.strTempContentData); + this.strTempContentData = string.Empty; + return true; + } + //鎴块棿瀵硅薄 + else if (strData == "#RoomInfo END#") + { + var room = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.Room>(this.strTempContentData); + room.Save(); + //鍚勮嚜绔偣鎵�澶勭殑鎴块棿ID,淇濆瓨璧锋潵 + foreach (var deviceKey in room.ListDevice) + { + this.modelData.dicDeviceTemplateRoom[deviceKey] = room.Id; + } + this.strTempContentData = string.Empty; + return true; + } + //璁惧閫夋嫨鐨勬ā鏉� + else if (strData == "#DeviceSelectTemplate END#") + { + this.modelData.dicDeviceTemplateSelect = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, string>>(this.strTempContentData); + this.strTempContentData = string.Empty; + return true; + } + //缃戝叧閫夋嫨鐨勬ā鏉� + else if (strData == "#GatewaySelectTemplate END#") + { + this.modelData.dicGatewayTemplateSelect = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, string>>(this.strTempContentData); + this.strTempContentData = string.Empty; + return true; + } + return false; + } + + #endregion + + #region 鈻� 澶勭悊妯℃澘鏂囦欢閲岄潰鐨勫叡閫氬唴瀹筥________ + + /// <summary> + /// 澶勭悊妯℃澘鏂囦欢閲岄潰鐨勫叡閫氬唴瀹� + /// </summary> + /// <param name="strData">妯℃澘鏂囦欢涓殑琛屾暟鎹�</param> + /// <param name="saveDiv">妯℃澘璁惧淇濆瓨鐨勫尯鍒�(璁惧鏁版嵁鏃舵湁鏁�)</param> + /// <param name="deviceType">妯℃澘涓澶囩殑deviceType(璁惧鏁版嵁鏃舵湁鏁�,鍙嶅皠鐢�)</param> + /// <param name="addToTemplate">鏄惁娣诲姞鍒拌澶囨ā鏉跨紦瀛樹腑</param> + private void AdjustTemplateBinFileCommonContent(string strData, ModelDeviceSaveEnum saveDiv, string deviceType, bool addToTemplate) + { + //妯℃澘鍩烘湰鏁版嵁 + if (strData == "#TemplateData END#") + { + var templateData = Newtonsoft.Json.JsonConvert.DeserializeObject<LocalModelBaseInfo>(this.strTempContentData); + this.modelData.TemplateName = templateData.ModelName; + this.strTempContentData = string.Empty; + return; + } + //璁惧妯℃澘 + else if (strData == "#DeviceTemplate END#") + { + //鍙嶅簭鍒楀寲璁惧鐨勪繚瀛樻枃浠跺唴瀹� + var tempData = this.DeserializeDeviceDataByDiv(saveDiv, this.strTempContentData); + //灏嗚澶囨ā鏉挎暟鎹坊鍔犲叆缂撳瓨(姝ゅ鐗规畩,涓嶉渶瑕佸姞鍏ヨ澶囨ā鏉跨紦瀛樹腑) + string mainKey = Common.LocalDevice.Current.GetDeviceMainKeys(tempData.DeviceMac, tempData.DeviceEpoint); + this.SetTemplateDeviceDataToMemmory(tempData, this.strTempContentData, mainKey, addToTemplate); + this.strTempContentData = string.Empty; + return; + } + //璁惧瀵硅薄 + else if (strData == "#DeviceInfo END#") + { + //鍙嶅簭鍒楀寲璁惧 + var device = CommonDevice.CommonDeviceByByteString(deviceType, this.strTempContentData); + if (device != null) + { + if (this.modelData.dicDeviceInfo.ContainsKey(device.DeviceAddr) == false) + { + this.modelData.dicDeviceInfo[device.DeviceAddr] = new List<CommonDevice>(); + } + this.modelData.dicDeviceInfo[device.DeviceAddr].Add(device); + } + this.strTempContentData = string.Empty; + return; + } + //缃戝叧瀵硅薄鏁版嵁 + else if (strData == "#GatewayInfo END#") + { + //鍙嶅簭鍒楀寲璁惧 + var gateway = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway>(this.strTempContentData); + this.modelData.dicGatewayInfo[gateway.GwId] = gateway; + this.strTempContentData = string.Empty; + return; + } + //鐗╃悊璁惧鐨勬埧闂� + else if (strData == "#DeviceTemplateRealRoom END#") + { + this.modelData.dicDeviceTemplateRealRoom = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, string>>(this.strTempContentData); + this.strTempContentData = string.Empty; + return; + } + //妯℃澘浣忓畢鐨勪俊鎭�(鐩墠鍦ㄨ繖閲屽熀鏈病鐢�) + else if (strData == "#TemplateHomeInfo END#") + { + this.strTempContentData = string.Empty; + return; + } + this.strTempContentData += strData; + } + + #endregion + + #region 鈻� 璇诲彇妯℃澘鏂囦欢鍐呭___________________ + + /// <summary> + /// 璇诲彇妯℃澘鏂囦欢鍐呭 + /// </summary> + /// <param name="AdjustAction"> + /// <para>鍙傛暟1:妯℃澘鏂囦欢涓殑琛屾暟鎹�</para> + /// <para>鍙傛暟2:妯℃澘璁惧淇濆瓨鐨勫尯鍒�(璁惧鏁版嵁鏃舵湁鏁�)</para> + /// <para>鍙傛暟3:鏉夸腑璁惧鐨刣eviceType(璁惧鏁版嵁鏃舵湁鏁�,鍙嶅皠鐢�)</para> + /// </param> + private void ReadTemplateFileMethord(Action<string, ModelDeviceSaveEnum, string> AdjustAction) + { + //淇濆瓨鐨勮矾寰� + string saveFile = DirNameResourse.LocalTemplateDirectory; + saveFile = System.IO.Path.Combine(saveFile, TemplateFileName); + + string fileData = HdlFileLogic.Current.ReadFileTextContent(saveFile); + if (fileData == null) + { + AdjustAction = null; + return; + } + + var saveDiv = ModelDeviceSaveEnum.A鏈畾涔�; + var deviceType = string.Empty; + + //鏍规嵁鎹㈣绗﹀垏鍒嗘暟鎹枃鏈� + string[] arryData = fileData.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); + foreach (string strData in arryData) + { + if (strData == "#START#") + { + //鏃犻檮鍔犳暟鎹殑銆愭暟鎹爣棰樸�� + continue; + } + if (strData.StartsWith("#DeviceTemplate START#") == true) + { + //闄勫姞鏁版嵁:璁惧淇濆瓨鍖哄垎 + saveDiv = (ModelDeviceSaveEnum)Convert.ToInt32(strData.Substring(22)); + continue; + } + if (strData.StartsWith("#DeviceInfo START#") == true) + { + //闄勫姞鏁版嵁:璁惧瀵硅薄绫诲瀷 + deviceType = strData.Substring(18); + continue; + } + try + { + //鎵ц鏁版嵁澶勭悊 + AdjustAction(strData, saveDiv, deviceType); + } + catch (Exception ex) + { + HdlLogLogic.Current.WriteLog(ex, "妯℃澘bin鏂囦欢鍑洪棶棰榎r\n" + this.strTempContentData); + this.strTempContentData = string.Empty; + } + } + } + + #endregion + + #region 鈻� 鍙嶅簭鍒楀寲璁惧鐨勪繚瀛樻枃浠跺唴瀹筥________ + + /// <summary> + /// 鍙嶅簭鍒楀寲璁惧鐨勪繚瀛樻枃浠跺唴瀹� + /// </summary> + /// <param name="saveDiv">淇濆瓨鍖哄垎</param> + /// <param name="fileData"></param> + /// <returns></returns> + private TemplateDeviceDataCommon DeserializeDeviceDataByDiv(ModelDeviceSaveEnum saveDiv, string fileData) + { + TemplateDeviceDataCommon modelData = null; + if (saveDiv == ModelDeviceSaveEnum.APir閰嶇疆) + { + modelData = Newtonsoft.Json.JsonConvert.DeserializeObject<ModelPirSensorSettion>(fileData); + } + else if (saveDiv == ModelDeviceSaveEnum.A绌鸿皟鎽嗛鍔熻兘) + { + modelData = Newtonsoft.Json.JsonConvert.DeserializeObject<ModelAcSwingModeSupport>(fileData); + } + else if (saveDiv == ModelDeviceSaveEnum.A绌鸿皟鑷畾涔夋ā寮�) + { + modelData = Newtonsoft.Json.JsonConvert.DeserializeObject<ModelAcModeSupport>(fileData); + } + else if (saveDiv == ModelDeviceSaveEnum.A绐楀笜鎵嬫媺鎺у埗) + { + modelData = Newtonsoft.Json.JsonConvert.DeserializeObject<ModelCurtainHandPullControl>(fileData); + } + else if (saveDiv == ModelDeviceSaveEnum.A绐楀笜鏂瑰悜鍙婇檺浣�) + { + modelData = Newtonsoft.Json.JsonConvert.DeserializeObject<ModelCurtainDirectionAndLimite>(fileData); + } + else if (saveDiv == ModelDeviceSaveEnum.A绔偣鍚嶇О) + { + modelData = Newtonsoft.Json.JsonConvert.DeserializeObject<ModelDeviceEpointNameInfo>(fileData); + } + else if (saveDiv == ModelDeviceSaveEnum.A璁惧鍚嶇О) + { + modelData = Newtonsoft.Json.JsonConvert.DeserializeObject<ModelDeviceMacNameInfo>(fileData); + } + else if (saveDiv == ModelDeviceSaveEnum.A璁惧缁戝畾鍒楄〃) + { + modelData = Newtonsoft.Json.JsonConvert.DeserializeObject<ModelDeviceBindData>(fileData); + } + else if (saveDiv == ModelDeviceSaveEnum.A闈㈡澘鑳屽厜鐏�) + { + modelData = Newtonsoft.Json.JsonConvert.DeserializeObject<ModelPanelBackLightInfo>(fileData); + } + else if (saveDiv == ModelDeviceSaveEnum.A闈㈡澘闇囧姩鍔熻兘) + { + modelData = Newtonsoft.Json.JsonConvert.DeserializeObject<ModelPanelVibrationInfo>(fileData); + } + return modelData; + } + + /// <summary> + /// 灏嗚澶囨ā鏉挎暟鎹坊鍔犲叆缂撳瓨 + /// </summary> + /// <param name="modelData">妯℃澘鏁版嵁</param> + /// <param name="fileData">璁惧淇濆瓨鍦ㄦ枃浠朵腑鐨勫唴瀹�(鍙负null)</param> + /// <param name="mainKey">娣诲姞鐨勪富閿�</param> + /// <param name="addToTemplate">鏄惁娣诲姞鍒拌澶囨ā鏉跨紦瀛樹腑</param> + private void SetTemplateDeviceDataToMemmory(TemplateDeviceDataCommon modelData, string fileData, string mainKey, bool addToTemplate) + { + if (modelData == null) + { + return; + } + + //浠庢ā鏉夸富鏂囦欢涓幏鍙栫殑璁惧妯℃澘淇℃伅,鏄笉闇�瑕佹坊鍔犲埌杩欎釜鍙橀噺涓殑 + //鍥犱负瀹冨彧鑳芥參鎱竴涓釜鍖归厤 + if (addToTemplate == true) + { + if (this.modelData.dicDeviceTemplateData.ContainsKey(mainKey) == false) + { + this.modelData.dicDeviceTemplateData[mainKey] = new List<TemplateDeviceDataCommon>(); + } + this.modelData.dicDeviceTemplateData[mainKey].Add(modelData); + } + + if (fileData != null) + { + //涓存椂缂撳瓨:妯℃澘涓悇鑷鐐规墍淇濆瓨鐨勫唴瀹�(keys:璁惧涓婚敭),璁惧閫夋嫨妯℃澘鏃�,妯℃澘鏁版嵁杩佺Щ浣跨敤,鍥犱负鏄紩鐢ㄧ被鍨�,鎵�浠ラ渶瑕侀噸鏂癗ew + if (this.modelData.dicDeviceFileContent.ContainsKey(mainKey) == false) + { + this.modelData.dicDeviceFileContent[mainKey] = new List<TemplateDeviceContent>(); + } + var fileCentent = new TemplateDeviceContent(); + fileCentent.saveDiv = modelData.DataSaveDiv; + fileCentent.FileContent = fileData; + fileCentent.DeviceMac = modelData.DeviceMac; + this.modelData.dicDeviceFileContent[mainKey].Add(fileCentent); + } + } + + #endregion + + #region 鈻� 淇濆瓨妯℃澘鏁版嵁鍒版湰鍦扮浉鍏砡____________ + + /// <summary> + /// 淇濆瓨妯℃澘鏁版嵁鍒版湰鍦� + /// </summary> + /// <param name="backupName">澶囦唤鍚嶇О</param> + public void SaveTemplateDataToLocation(string backupName) + { + //鑾峰彇鏈湴鍏ㄩ儴鐨勬ā鏉垮垪琛ㄧ殑鍩烘湰淇℃伅 + var localModel = this.GetLocalAllModelList(); + var fileName = this.GetNewTemplateFileName(); + foreach (var model in localModel) + { + //鍚嶅瓧涓�鏍锋椂 + if (model.ModelName == backupName) + { + fileName = model.FileName; + //澶囦唤鏁版嵁宸茬粡瀛樺湪,鏄惁瑕嗙洊? + this.ShowMassage(ShowMsgType.Confirm, "澶囦唤鏁版嵁宸茬粡瀛樺湪,鏄惁瑕嗙洊?", () => + { + //灏嗘ā鏉挎暟鎹繚瀛樺埌鍒版寚瀹氱殑鏂囦欢澶逛腑 + this.SaveTemplateDataToLocation2(fileName, backupName); + }); + return; + } + } + //灏嗘ā鏉挎暟鎹繚瀛樺埌鍒版寚瀹氱殑鏂囦欢澶逛腑 + this.SaveTemplateDataToLocation2(fileName, backupName); + } + + /// <summary> + /// 淇濆瓨妯℃澘鏁版嵁鍒版湰鍦� + /// </summary> + /// <param name="fileName">淇濆瓨鏂囦欢鐨勫悕瀛�</param> + /// <param name="backName">妯℃澘澶囦唤鐨勫悕瀛�</param> + private void SaveTemplateDataToLocation2(string fileName, string backupName) + { + HdlThreadLogic.Current.RunThread(() => + { + ProgressFormBar.Current.Start(); + ProgressFormBar.Current.SetMsg("姝e湪淇濆瓨妯℃澘鏁版嵁"); + System.Threading.Thread.Sleep(1500); + + //灏嗘ā鏉挎暟鎹繚瀛樺埌鍒版寚瀹氱殑鏂囦欢澶逛腑 + var fileFullName = this.SaveTemplateDataToFile(fileName, backupName); + //鑾峰彇鍗囩骇鍥轰欢鏂囦欢 + var result = HdlFirmwareUpdateLogic.DownLoadTemplateDeviceFirmware(fileFullName, "姝e湪淇濆瓨鍗囩骇鍥轰欢鏁版嵁"); + if (result == -1) + { + this.ShowMassage(ShowMsgType.Tip, "淇濆瓨鍗囩骇鍥轰欢鏁版嵁澶辫触"); + } + else + { + //鏈湴澶囦唤淇濆瓨鎴愬姛 + this.ShowMassage(ShowMsgType.Tip, "鏈湴澶囦唤淇濆瓨鎴愬姛"); + } + }); + } + + /// <summary> + /// 鍦ㄧ敓鎴愭ā鏉挎暟鎹箣鍓�,妫�娴嬫ā鏉挎暟鎹� + /// </summary> + private void CheckTempLateDataBeforCreat() + { + //涓轰簡淇濊瘉妯℃澘閲岀殑璁惧鏁板拰鏈湴鐨勪竴鑷�,鎵�浠ユ娴嬩竴涓� + //濡傛灉缂哄皯,鍒欐坊鍔犱慨鏀筂ac鐨勬暟鎹繘鍘� + //鍏朵粬鐨�,濡傛灉涓嶇偣鍑诲悇鑷殑閰嶇疆鐣岄潰,鍒欏綋鍋氭槸榛樿璁惧鍘熸潵鐨勯厤缃姸鎬� + + //鑾峰彇鐩墠宸茬粡璁剧疆璁惧鐗╃悊鍚嶇О鐨勮澶嘙ac + var listMac = new HashSet<string>(); + foreach (var listData in this.modelData.dicDeviceTemplateData.Values) + { + if (listData.Count > 0 && listMac.Contains(listData[0].DeviceMac) == true) + { + //宸茬粡鍔犱簡 + continue; + } + foreach (var data in listData) + { + if (data.DataSaveDiv == ModelDeviceSaveEnum.A璁惧鍚嶇О) + { + listMac.Add(data.DeviceMac); + } + } + } + var listDevice = Common.LocalDevice.Current.listAllDevice; + foreach (var device in listDevice) + { + if (listMac.Contains(device.DeviceAddr) == false) + { + listMac.Add(device.DeviceAddr); + //閲嶆柊娣诲姞Mac鍚嶅瓧缂撳瓨 + TemplateDeviceDataLogic.Current.ReDeviceMacName(device, Common.LocalDevice.Current.GetDeviceMacName(device)); + } + //閲嶆柊娣诲姞绔偣鍚嶅瓧缂撳瓨 + TemplateDeviceDataLogic.Current.ReDeviceEpointName(device, Common.LocalDevice.Current.GetDeviceEpointName(device)); + } + } + + /// <summary> + /// 鑾峰彇鏈湴鍏ㄩ儴鐨勬ā鏉垮垪琛ㄧ殑鍩烘湰淇℃伅 + /// </summary> + /// <returns></returns> + public List<LocalModelBaseInfo> GetLocalAllModelList() + { + var dicData = new Dictionary<string, List<LocalModelBaseInfo>>(); + var listTime = new List<string>(); + + var strPath = DirNameResourse.AllResidenceTemplateDirectory; + //鑾峰彇鍏ㄩ儴鏂囦欢 + var arryFile = System.IO.Directory.GetFiles(strPath, "ModelData_*"); + foreach (string modelFile in arryFile) + { + //璇诲彇鏂囦欢鍐呭 + var textValue = HdlFileLogic.Current.ReadFileTextContent(modelFile); + if (textValue == null) + { + continue; + } + //浠庢枃浠朵腑鑾峰彇鎸囧畾鐨勫唴瀹� + string modelBaseInfo = this.GetDataFromFileContent(textValue, "#START#", "#TemplateData END#"); + if (modelBaseInfo != string.Empty) + { + var myModel = Newtonsoft.Json.JsonConvert.DeserializeObject<LocalModelBaseInfo>(modelBaseInfo); + myModel.FileName = modelFile.Substring(strPath.Length + 1); + if (dicData.ContainsKey(myModel.EditorTime) == false) + { + dicData[myModel.EditorTime] = new List<LocalModelBaseInfo>(); + listTime.Add(myModel.EditorTime); + } + dicData[myModel.EditorTime].Add(myModel); + + string homeData = this.GetDataFromFileContent(textValue, "#START#", "#TemplateHomeInfo END#"); + if (homeData != string.Empty) + { + var homeInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<TemplateHomeInfo>(homeData); + myModel.ListUintContent.AddRange(homeInfo.ListUintContent); + myModel.ResidenceAddressName = homeInfo.ResidenceAddressName; + } + } + } + //鎸夋椂闂存帓搴� + listTime.Sort(); + + var listData = new List<LocalModelBaseInfo>(); + for (int i = listTime.Count - 1; i >= 0; i--) + { + listData.AddRange(dicData[listTime[i]]); + } + return listData; + } + + /// <summary> + /// 鑾峰彇涓�涓柊鐨勬ā鏉夸繚瀛樻枃浠跺悕 + /// </summary> + /// <returns></returns> + public string GetNewTemplateFileName() + { + return "ModelData_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".bin"; + } + + #endregion + + #region 鈻� 鐢熸垚妯℃澘鏁版嵁鐩稿叧___________________ + + /// <summary> + /// 淇濆瓨妯℃澘鏁版嵁鍒版枃浠�(杩斿洖淇濆瓨鏂囦欢鐨勫叏璺緞) + /// </summary> + /// <param name="fileName">淇濆瓨鏂囦欢鐨勫悕瀛�(鏂板缓鏃剁敤 GetNewTemplateFileName鍑芥暟鏂板缓)</param> + /// <param name="backName">妯℃澘澶囦唤鐨勫悕瀛�</param> + public string SaveTemplateDataToFile(string fileName, string backUpName) + { + //鍐欏叆鏂囦欢鐨勫唴瀹� + string writeText = string.Empty; + + //鍦ㄧ敓鎴愭ā鏉挎暟鎹箣鍓�,妫�娴嬫ā鏉挎暟鎹� + this.CheckTempLateDataBeforCreat(); + + //鐢熸垚鍐欏叆鏂囦欢鐨勩�愭ā鏉垮熀鏈暟鎹�� + this.CreatWriteTemplateBaseData(ref writeText, backUpName); + + //鐢熸垚鍐欏叆鏂囦欢鐨勩�愭ā鏉夸綇瀹呬俊鎭暟鎹�� + this.CreatWriteTemplateHomeData(ref writeText); + + //鐢熸垚鍐欏叆鏂囦欢鐨勩�愯澶囨ā鏉挎暟鎹�� + this.CreatWriteDeviceTemplateData(ref writeText); + + //鐢熸垚鍐欏叆鏂囦欢鐨勩�愯澶囧璞℃暟鎹�� + this.CreatWriteCommonDeviceData(ref writeText); + + //鐢熸垚鍐欏叆鏂囦欢鐨勩�愮綉鍏冲璞℃暟鎹�� + this.CreatWriteGatewayData(ref writeText); + + //鐢熸垚鍐欏叆鏂囦欢鐨勩�愬満鏅ā鏉挎暟鎹�� + this.CreatWriteSceneData(ref writeText); + + //鐢熸垚鍐欏叆鏂囦欢鐨勩�愭埧闂存ā鏉挎暟鎹�� + this.CrearWriteRoomTemplateData(ref writeText); + + //鐢熸垚鍐欏叆鏂囦欢鐨勩�愯澶囧拰缃戝叧閫夋嫨鐨勬ā鏉跨殑鏁版嵁銆� + this.CrearWriteDeviceSelectTemplateData(ref writeText); + + //鍐欏叆鍐呭 + string saveFile = DirNameResourse.AllResidenceTemplateDirectory; + saveFile = System.IO.Path.Combine(saveFile, fileName); + + HdlFileLogic.Current.SaveTextToFile(saveFile, writeText); + + return saveFile; + } + + /// <summary> + /// 鐢熸垚鍐欏叆鏂囦欢鐨勩�愭ā鏉垮熀鏈暟鎹�� + /// </summary> + /// <param name="writeText"></param> + private void CreatWriteTemplateBaseData(ref string writeText, string backUpName) + { + var modelData = new LocalModelBaseInfo(); + modelData.EditorTime = DateTime.Now.ToString("yyyy.MM.dd HH:mm"); + modelData.ModelName = backUpName; + modelData.ListUintContent.AddRange(Common.Config.Instance.Home.ListUintContent); + modelData.FloorCount = Common.Config.Instance.Home.FloorDics.Count; + modelData.DeviceCount = this.modelData.dicDeviceTemplateData.Count; + //鍔熻兘鏁� + int funcCount = 0; + foreach (var listData in this.modelData.dicDeviceTemplateData.Values) + { + if (listData.Count > 0) + { + var listDevice = Common.LocalDevice.Current.GetDevicesByMac(listData[0].DeviceMac, false); + funcCount += listDevice.Count; + } + } + modelData.FunctionCount = funcCount; + + writeText += "#START#\r\n"; + string dataInfo = Newtonsoft.Json.JsonConvert.SerializeObject(modelData); + writeText += dataInfo + "\r\n"; + writeText += "#TemplateData END#\r\n\r\n"; + } + + /// <summary> + /// 鐢熸垚鍐欏叆鏂囦欢鐨勩�愭ā鏉夸綇瀹呬俊鎭暟鎹�� + /// </summary> + /// <param name="writeText"></param> + private void CreatWriteTemplateHomeData(ref string writeText) + { + var homeData = new TemplateHomeInfo(); + homeData.ResidenceAddressName = Common.Config.Instance.Home.ResidenceAddressName; + homeData.ListUintContent.AddRange(Common.Config.Instance.Home.ListUintContent); + + writeText += "#START#\r\n"; + string dataInfo = Newtonsoft.Json.JsonConvert.SerializeObject(homeData); + writeText += dataInfo + "\r\n"; + writeText += "#TemplateHomeInfo END#\r\n\r\n"; + } + + /// <summary> + /// 鐢熸垚鍐欏叆鏂囦欢鐨勩�愯澶囨ā鏉挎暟鎹�� + /// </summary> + /// <param name="writeText"></param> + private void CreatWriteDeviceTemplateData(ref string writeText) + { + foreach (var list in this.modelData.dicDeviceTemplateData.Values) + { + foreach (var data in list) + { + writeText += "#DeviceTemplate START#" + (int)data.DataSaveDiv + "\r\n"; + string dataInfo = Newtonsoft.Json.JsonConvert.SerializeObject(data); + writeText += dataInfo + "\r\n"; + writeText += "#DeviceTemplate END#\r\n\r\n"; + } + } + } + + /// <summary> + /// 鐢熸垚鍐欏叆鏂囦欢鐨勩�愯澶囧璞℃暟鎹�� + /// </summary> + /// <param name="writeText"></param> + private void CreatWriteCommonDeviceData(ref string writeText) + { + var listDevice = Common.LocalDevice.Current.listAllDevice; + var listCheck = new HashSet<string>(); + foreach (var device in listDevice) + { + //璁惧绔偣 + writeText += "#DeviceInfo START#" + device.Type.ToString() + "\r\n"; + string dataInfo = Newtonsoft.Json.JsonConvert.SerializeObject(device); + writeText += dataInfo + "\r\n"; + writeText += "#DeviceInfo END#\r\n\r\n"; + + //娣诲姞Ota璁惧瀵硅薄鐨勭紦瀛� + if (listCheck.Contains(device.DeviceAddr) == false) + { + listCheck.Add(device.DeviceAddr); + var otaDevice = Common.LocalDevice.Current.GetOTADevice(device.DeviceAddr); + if (otaDevice != null) + { + writeText += "#DeviceInfo START#" + otaDevice.Type.ToString() + "\r\n"; + string dataInfo2 = Newtonsoft.Json.JsonConvert.SerializeObject(otaDevice); + writeText += dataInfo2 + "\r\n"; + writeText += "#DeviceInfo END#\r\n\r\n"; + } + } + } + } + + /// <summary> + /// 鐢熸垚鍐欏叆鏂囦欢鐨勩�愮綉鍏冲璞℃暟鎹�� + /// </summary> + /// <param name="writeText"></param> + private void CreatWriteGatewayData(ref string writeText) + { + var listGateway = HdlGatewayLogic.Current.GetAllLocalGateway(); + foreach (var gateway in listGateway) + { + //璁惧绔偣 + writeText += "#START#\r\n"; + string dataInfo = Newtonsoft.Json.JsonConvert.SerializeObject(gateway); + writeText += dataInfo + "\r\n"; + writeText += "#GatewayInfo END#\r\n\r\n"; + } + } + + /// <summary> + /// 鐢熸垚鍐欏叆鏂囦欢鐨勩�愬満鏅暟鎹�� + /// </summary> + /// <param name="writeText"></param> + private void CreatWriteSceneData(ref string writeText) + { + //鍏ㄩ儴鐨勫満鏅� + var listScene = HdlSceneLogic.Current.GetAllLocalScene(); + + foreach (var scene in listScene) + { + writeText += "#START#\r\n"; + string dataInfo = Newtonsoft.Json.JsonConvert.SerializeObject(scene); + writeText += dataInfo + "\r\n"; + writeText += "#SceneTemplate END#\r\n\r\n"; + } + } + + /// <summary> + /// 鐢熸垚鍐欏叆鏂囦欢鐨勩�愭埧闂存ā鏉挎暟鎹�� + /// </summary> + /// <param name="writeText"></param> + private void CrearWriteRoomTemplateData(ref string writeText) + { + //妤煎眰鏁版嵁 + writeText += "#START#\r\n"; + string dataInfo1 = Newtonsoft.Json.JsonConvert.SerializeObject(Common.Config.Instance.Home.FloorDics); + writeText += dataInfo1 + "\r\n"; + writeText += "#FloorInfo END#\r\n\r\n"; + + //鎴块棿鏁版嵁 + var listRoom = HdlRoomLogic.Current.GetAllListRooms(); + foreach (var room in listRoom) + { + if (room.IsLove == false) + { + writeText += "#START#\r\n"; + string dataInfo2 = Newtonsoft.Json.JsonConvert.SerializeObject(room); + writeText += dataInfo2 + "\r\n"; + writeText += "#RoomInfo END#\r\n\r\n"; + } + } + //鐗╃悊缃戝叧鎵�鍦ㄧ殑鎴块棿 + var dicRealRoom = new Dictionary<string, string>(); + var listGateway = HdlGatewayLogic.Current.GetAllLocalGateway(); + foreach (var gateway in listGateway) + { + dicRealRoom[gateway.GwId] = gateway.RoomId; + } + //鑾峰彇鍏ㄩ儴鐗╃悊璁惧鎵�灞炴埧闂寸殑璁板綍 + var dicDeviceRoom = Common.LocalDevice.Current.GetAllRealDeviceRoomData(); + foreach (var strMac in dicDeviceRoom.Keys) + { + dicRealRoom[strMac] = dicDeviceRoom[strMac]; + } + + writeText += "#START#\r\n"; + string dataInfo = Newtonsoft.Json.JsonConvert.SerializeObject(dicRealRoom); + writeText += dataInfo + "\r\n"; + writeText += "#DeviceTemplateRealRoom END#\r\n\r\n"; + } + + /// <summary> + /// 鐢熸垚鍐欏叆鏂囦欢鐨勩�愯澶囧拰缃戝叧閫夋嫨鐨勬ā鏉跨殑鏁版嵁銆� + /// </summary> + /// <param name="writeText"></param> + private void CrearWriteDeviceSelectTemplateData(ref string writeText) + { + //璁惧閫夋嫨妯℃澘鐨勬暟鎹� + writeText += "#START#\r\n"; + string dataInfo1 = Newtonsoft.Json.JsonConvert.SerializeObject(this.modelData.dicDeviceTemplateSelect); + writeText += dataInfo1 + "\r\n"; + writeText += "#DeviceSelectTemplate END#\r\n\r\n"; + + //缃戝叧閫夋嫨妯℃澘鐨勬暟鎹� + writeText += "#START#\r\n"; + string dataInfo2 = Newtonsoft.Json.JsonConvert.SerializeObject(this.modelData.dicGatewayTemplateSelect); + writeText += dataInfo2 + "\r\n"; + writeText += "#GatewaySelectTemplate END#\r\n\r\n"; + } + + #endregion + + #region 鈻� 寮哄埗鎵ц鐨勭壒娈婂嚱鏁癬________________ + + /// <summary> + /// 寮哄埗浠庣紦瀛樺綋涓敓鎴愯澶囧拰缃戝叧鏂囦欢 + /// </summary> + public void CreatDeviceAndGatewayFileFromMemoryByForce() + { + //鍘熸潵鐨勭姸鎬� + bool oldShowTemplate = Common.Config.Instance.Home.IsShowTemplate; + //璁╁畠鍙互鐢熸垚鏂囦欢 + Common.Config.Instance.Home.IsShowTemplate = false; + + //鐢熸垚璁惧鏂囦欢 + foreach (var listDevice in this.modelData.dicDeviceInfo.Values) + { + foreach (var device in listDevice) + { + device.ReSave(); + } + } + //鐢熸垚缃戝叧鏂囦欢 + foreach (var gateway in this.modelData.dicGatewayInfo.Values) + { + gateway.ReSave(); + } + //杩樺師鐘舵�� + Common.Config.Instance.Home.IsShowTemplate = oldShowTemplate; + } + + #endregion + + #region 鈻� 璁惧鍜岀綉鍏虫ā鏉块�夋嫨鐩稿叧_____________ + + /// <summary> + /// 娣诲姞/淇敼 璁惧妯℃澘閫夋嫨鐩爣 + /// </summary> + /// <param name="sourceMac">璁惧Mac瀵硅薄</param> + /// <param name="targetMac">鐩爣Mac瀵硅薄</param> + public void AddDeviceTemplateSelect(string sourceMac, string targetMac) + { + //鑾峰彇鏈湴鎸囧畾鐨凪ac鐨勫叏閮ㄨ澶� + var listDevice = Common.LocalDevice.Current.GetDevicesByMac(sourceMac, false); + + foreach (var device in listDevice) + { + //妯℃澘閫夋嫨鐨勬椂鍊�,浠栦滑鐨勭鐐规槸涓�鑷寸殑 + string localDeviceKey = Common.LocalDevice.Current.GetDeviceMainKeys(device); + string templateDeviceKey = Common.LocalDevice.Current.GetDeviceMainKeys(targetMac, device.DeviceEpoint); + + if (this.modelData.dicDeviceTemplateRoom.ContainsKey(templateDeviceKey) == true) + { + //濡傛灉妯℃澘閲岄潰,杩欎釜绔偣璁剧疆鏈夋埧闂寸殑璇� + HdlRoomLogic.Current.ChangedRoom(device, this.modelData.dicDeviceTemplateRoom[templateDeviceKey], false); + } + //濡傛灉杩欎釜绔偣鏈夋ā鏉挎暟鎹殑璇� + if (this.modelData.dicDeviceFileContent.ContainsKey(templateDeviceKey) == true) + { + //濡傛灉鍘熸潵瀹冮�夋嫨鏈夋ā鏉挎暟鎹殑璇� + if (this.modelData.dicDeviceTemplateData.ContainsKey(localDeviceKey) == true) + { + //鍒犻櫎杩欎釜璁惧鐨勬ā鏉夸繚瀛樻枃浠� + HdlFileLogic.Current.DeleteFile(System.IO.Path.Combine(DirNameResourse.LocalTemplateDirectory, device.FilePath)); + //绉婚櫎褰撳墠绔偣淇濆瓨鐨勬ā鏉挎暟鎹� + this.modelData.dicDeviceTemplateData.Remove(localDeviceKey); + } + + //鍙嶅簭鍒楀寲璁惧鏁版嵁 + foreach (var strCentent in this.modelData.dicDeviceFileContent[templateDeviceKey]) + { + var tempData = this.DeserializeDeviceDataByDiv(strCentent.saveDiv, strCentent.FileContent); + //杩欓噷闇�瑕佹浛鎹㈡帀Mac + tempData.DeviceMac = sourceMac; + //娣诲姞缂撳瓨(涓婚敭涓烘湰鍦拌澶囩殑涓婚敭) + this.SetTemplateDeviceDataToMemmory(tempData, null, localDeviceKey, true); + //淇敼绔偣缂撳瓨鍚嶅瓧 + if (tempData.DataSaveDiv == ModelDeviceSaveEnum.A绔偣鍚嶇О) + { + Common.LocalDevice.Current.SetEpointName(device, ((ModelDeviceEpointNameInfo)tempData).deviceEpointName); + } + else if (tempData.DataSaveDiv == ModelDeviceSaveEnum.A璁惧鍚嶇О) + { + Common.LocalDevice.Current.SetMacName(device, ((ModelDeviceMacNameInfo)tempData).deviceMacName); + } + } + } + //涓嶇濡備綍,閮介渶瑕佸垯閲嶆柊淇濆瓨鎴愭枃浠� + this.SaveDeviceMemmoryData(device); + //杩樺師鍙婂彉鏇村満鏅殑鎵ц鐩爣 + //this.RecoverAndChangedSceneAdjustTarget(device, targetMac); + } + //鏇存敼鐗╃悊璁惧鎵�鍦ㄧ殑鎴块棿 + if (this.modelData.dicDeviceTemplateRealRoom.ContainsKey(targetMac) == true) + { + Common.LocalDevice.Current.SaveRealDeviceRoomId(listDevice, this.modelData.dicDeviceTemplateRealRoom[targetMac], false); + } + + //璁板綍缂撳瓨 + this.modelData.dicDeviceTemplateSelect[sourceMac] = targetMac; + //淇濆瓨鐨勮矾寰� + string fileData = Newtonsoft.Json.JsonConvert.SerializeObject(this.modelData.dicDeviceTemplateSelect); + HdlFileLogic.Current.SaveTextToFile(DirNameResourse.DeviceTemplateSelectFile, fileData); + } + + /// <summary> + /// 杩樺師鍙婂彉鏇村満鏅殑鎵ц鐩爣 + /// </summary> + /// <param name="device">鏈湴璁惧瀵硅薄</param> + /// <param name="targetMac">闇�瑕佸彉鏇寸殑妯℃澘璁惧鐨凪ac</param> + private void RecoverAndChangedSceneAdjustTarget(CommonDevice device, string targetMac) + { + //濡傛灉杩欎釜璁惧鏄浛鎹㈤�夋嫨鐨勬ā鏉跨殑璇� + if (this.modelData.dicDeviceTemplateSelect.ContainsKey(device.DeviceAddr) == false) + { + return; + } + //鍏ㄩ儴鐨勫満鏅� + var listScene = HdlSceneLogic.Current.GetAllLocalScene(); + + //杩樻病鏈夋墽琛屽彉鏇村墠,瀹冪洰鍓嶉�夋嫨鐨勬ā鏉跨殑Mac + string oldTemplateMac = this.modelData.dicDeviceTemplateSelect[device.DeviceAddr]; + //灏嗗満鏅璞′腑,杩欎釜鍥炶矾鐨勪富閿�,鏇挎崲鍥炲師鏉ユā鏉夸腑鐨凪ac+绔彛 + foreach (var scene in listScene) + { + bool save = false; + for (int i = 0; i < scene.AdjustTargetList.Count; i++) + { + if (scene.AdjustTargetList[i].Type != 0) + { + //鍙鐞嗚澶囩粦瀹氱洰鏍� + continue; + } + //濡傛灉鏄綋鍓嶅洖璺� + if (scene.AdjustTargetList[i].DeviceAddr == device.DeviceAddr && + scene.AdjustTargetList[i].Epoint == device.DeviceEpoint) + { + //鏇挎崲鎺塎ac + scene.AdjustTargetList[i].DeviceAddr = oldTemplateMac; + save = true; + continue; + } + //濡傛灉鏄ā鏉跨洰鏍囧洖璺� + if (targetMac != null && + scene.AdjustTargetList[i].DeviceAddr == targetMac && + scene.AdjustTargetList[i].Epoint == device.DeviceEpoint) + { + //灏嗙洰鏍囩殑Mac鍙樻洿涓哄綋鍓嶈澶囩殑Mac + scene.AdjustTargetList[i].DeviceAddr = device.DeviceAddr; + save = true; + continue; + } + } + if (save == true) + { + //淇濆瓨缂撳瓨 + scene.Save(); + } + } + } + + /// <summary> + /// 鑾峰彇璁惧宸茬粡閫夋嫨浜嗙殑妯℃澘鐩爣鐨勮澶囩殑Mac(娌℃湁鐩爣鏃�,杩斿洖null) + /// </summary> + /// <param name="sourceMac">璁惧鐨凪ac</param> + /// <returns></returns> + public string GetDeviceTemplateSelectMac(string sourceMac) + { + if (this.modelData.dicDeviceTemplateSelect.ContainsKey(sourceMac) == true) + { + return this.modelData.dicDeviceTemplateSelect[sourceMac]; + } + return null; + } + + /// <summary> + /// 鑾峰彇璁惧宸茬粡閫夋嫨浜嗙殑妯℃澘鐩爣鐨勮澶囩殑Mac鍚嶅瓧(娌℃湁鐩爣鏃�,杩斿洖null) + /// </summary> + /// <param name="sourceMac">璁惧鐨凪ac</param> + /// <returns></returns> + public string GetDeviceTemplateSelectName(string sourceMac) + { + if (this.modelData.dicDeviceTemplateSelect.ContainsKey(sourceMac) == true) + { + string tempMac = this.modelData.dicDeviceTemplateSelect[sourceMac]; + foreach (var listData in this.modelData.dicDeviceFileContent.Values) + { + foreach (var data in listData) + { + if (data.DeviceMac != tempMac || data.saveDiv != ModelDeviceSaveEnum.A璁惧鍚嶇О) + { + continue; + } + var tempModel = Newtonsoft.Json.JsonConvert.DeserializeObject<ModelDeviceMacNameInfo>(data.FileContent); + return tempModel.deviceMacName; + } + } + } + return null; + } + + /// <summary> + /// 鍙栨秷璁惧妯℃澘鐨勯�夋嫨鐩爣 + /// </summary> + /// <param name="sourceMac">璁惧鐨凪ac</param> + public void RemoveDeviceTemplateSelect(string sourceMac) + { + ////鑾峰彇鏈湴鎸囧畾鐨凪ac鐨勫叏閮ㄨ澶� + //var listDevice = Common.LocalDevice.Current.GetDevicesByMac(sourceMac, false); + //foreach (var device in listDevice) + //{ + // //杩樺師鍦烘櫙鐨勬墽琛岀洰鏍� + // this.RecoverAndChangedSceneAdjustTarget(device, null); + //} + + //璁板綍缂撳瓨 + this.modelData.dicDeviceTemplateSelect.Remove(sourceMac); + //淇濆瓨鐨勮矾寰� + string fileData = Newtonsoft.Json.JsonConvert.SerializeObject(this.modelData.dicDeviceTemplateSelect); + HdlFileLogic.Current.SaveTextToFile(DirNameResourse.DeviceTemplateSelectFile, fileData); + } + + /// <summary> + /// 娣诲姞/淇敼 缃戝叧妯℃澘閫夋嫨鐩爣 + /// </summary> + /// <param name="sourceGwid">缃戝叧id</param> + /// <param name="targetGwid">鐩爣缃戝叧id(妯℃澘)</param> + public void AddGatewayTemplateSelect(string sourceGwid, string targetGwid) + { + //璁板綍缂撳瓨 + this.modelData.dicGatewayTemplateSelect[sourceGwid] = targetGwid; + //淇濆瓨鐨勮矾寰� + string fileData = Newtonsoft.Json.JsonConvert.SerializeObject(this.modelData.dicGatewayTemplateSelect); + HdlFileLogic.Current.SaveTextToFile(DirNameResourse.GatewayTemplateSelectFile, fileData); + + //鍙樻洿缃戝叧鎴块棿 + if (this.modelData.dicDeviceTemplateRealRoom.ContainsKey(targetGwid) == true) + { + HdlGatewayLogic.Current.ChangedGatewayRoom(sourceGwid, this.modelData.dicDeviceTemplateRealRoom[targetGwid]); + } + //鍙樻洿缃戝叧鍚嶅瓧 + if (this.modelData.dicGatewayInfo.ContainsKey(targetGwid) == true) + { + var localGateway = HdlGatewayLogic.Current.GetLocalGateway(sourceGwid); + string gwName = HdlGatewayLogic.Current.GetGatewayName(this.modelData.dicGatewayInfo[targetGwid]); + HdlGatewayLogic.Current.ReName(localGateway, gwName); + } + } + + /// <summary> + /// 鍙栨秷缃戝叧妯℃澘閫夋嫨鐩爣 + /// </summary> + /// <param name="sourceGwid">缃戝叧id</param> + /// <param name="targetGwid">鐩爣缃戝叧id</param> + public void RemoveGatewayTemplateSelect(string sourceGwid) + { + //璁板綍缂撳瓨 + this.modelData.dicGatewayTemplateSelect.Remove(sourceGwid); + //淇濆瓨鐨勮矾寰� + string fileData = Newtonsoft.Json.JsonConvert.SerializeObject(this.modelData.dicGatewayTemplateSelect); + HdlFileLogic.Current.SaveTextToFile(DirNameResourse.GatewayTemplateSelectFile, fileData); + } + + /// <summary> + /// 鑾峰彇缃戝叧宸茬粡閫夋嫨浜嗙殑妯℃澘鐩爣鐨勭綉鍏崇殑鍚嶅瓧(娌℃湁鐩爣鏃�,杩斿洖null) + /// </summary> + /// <param name="sourceMac">缃戝叧id</param> + /// <returns></returns> + public string GetGatewayTemplateSelectName(string sourceGwid) + { + if (this.modelData.dicGatewayTemplateSelect.ContainsKey(sourceGwid) == true) + { + string tempMac = this.modelData.dicGatewayTemplateSelect[sourceGwid]; + if (this.modelData.dicGatewayInfo.ContainsKey(tempMac) == true) + { + string gwName = HdlGatewayLogic.Current.GetGatewayName(this.modelData.dicGatewayInfo[tempMac]); + return gwName; + } + } + return null; + } + + /// <summary> + /// 鑾峰彇缃戝叧宸茬粡閫夋嫨浜嗙殑妯℃澘鐩爣鐨勭綉鍏崇殑鍚嶅瓧(娌℃湁鐩爣鏃�,杩斿洖null) + /// </summary> + /// <param name="sourceMac">缃戝叧id</param> + /// <returns></returns> + public string GetGatewayTemplateSelectId(string sourceGwid) + { + if (this.modelData.dicGatewayTemplateSelect.ContainsKey(sourceGwid) == true) + { + return this.modelData.dicGatewayTemplateSelect[sourceGwid]; + } + return null; + } + + /// <summary> + /// 鑾峰彇妯℃澘涓叏閮ㄧ綉鍏崇殑鍚嶅瓧 + /// </summary> + /// <returns></returns> + public Dictionary<string, string> GetAllGatewayTemplateName() + { + var dic = new Dictionary<string, string>(); + foreach (string gwId in this.modelData.dicGatewayInfo.Keys) + { + string gwName = HdlGatewayLogic.Current.GetGatewayName(this.modelData.dicGatewayInfo[gwId]); + dic[gwId] = gwName; + } + return dic; + } + + /// <summary> + /// 鑾峰彇鎸囧畾缃戝叧鑳藉閫夋嫨鐨勬ā鏉垮悕瀛� + /// </summary> + /// <returns></returns> + public Dictionary<string, string> GetGatewayCanSelectTemplateName(ZbGateway zbGateway) + { + var dic = new Dictionary<string, string>(); + foreach (var zbway in this.modelData.dicGatewayInfo.Values) + { + if (zbGateway.LinuxImageType == zbway.LinuxImageType) + { + string gwName = HdlGatewayLogic.Current.GetGatewayName(zbway); + dic[zbway.GwId] = gwName; + } + } + return dic; + } + + /// <summary> + /// 娓呴櫎鍏ㄩ儴宸茬粡宸茬粡閫夋嫨濂戒簡妯℃澘瀵硅薄鐨勮澶囧拰缃戝叧 + /// </summary> + public void ClearAllSelectDeviceAndGateway() + { + //閲嶆柊鍒濆鍖� + this.modelData.dicDeviceTemplateSelect = new Dictionary<string, string>(); + this.modelData.dicGatewayTemplateSelect = new Dictionary<string, string>(); + //鍒犳帀杩欎袱涓繚瀛橀�夋嫨妯℃澘鐨勬枃浠� + HdlFileLogic.Current.DeleteFile(DirNameResourse.DeviceTemplateSelectFile); + HdlFileLogic.Current.DeleteFile(DirNameResourse.GatewayTemplateSelectFile); + } + + #endregion + + #region 鈻� 鑾峰彇鑳藉閫夋嫨鐨勬ā鏉縚________________ + + /// <summary> + /// 鑾峰彇鑳藉閫夋嫨鐨勬ā鏉� + /// </summary> + /// <param name="localDevice">鏈湴璁惧</param> + /// <returns></returns> + public List<TemplateCanSelectContent> GetCanSelectDeviceTemplate(CommonDevice localDevice) + { + var listCanSelect = new List<TemplateCanSelectContent>(); + if (this.modelData.dicGatewayTemplateSelect.ContainsKey(localDevice.CurrentGateWayId) == false) + { + //璇ョ綉鍏虫病鏈夊尮閰嶆ā鏉�,涓嶆彁渚涙ā鏉块�夋嫨 + return listCanSelect; + } + var listHadSelect = new HashSet<string>(); + foreach (var localMac in this.modelData.dicDeviceTemplateSelect.Keys) + { + //瀹冭嚜宸辩殑璇�,鍙互鏄剧ず(鍥犱负鏈変釜鍙栨秷缁戝畾鐨勫姛鑳�) + if (localMac != localDevice.DeviceAddr) + { + //鐩墠宸茬粡琚�夋嫨浜嗙殑妯℃澘Mac + listHadSelect.Add(this.modelData.dicDeviceTemplateSelect[localMac]); + } + } + + var listCheck = new HashSet<string>(); + //璁惧鐨勬ā鍧桰D + string modelId = this.GetDeviceModelId(localDevice.DeviceAddr); + //妯℃澘涓殑缃戝叧ID + string gatewayTemplateId = this.modelData.dicGatewayTemplateSelect[localDevice.CurrentGateWayId]; + foreach (var listData in this.modelData.dicDeviceFileContent.Values) + { + foreach (var data in listData) + { + if (data.saveDiv != ModelDeviceSaveEnum.A璁惧鍚嶇О) + { + //鍙幏鍙栬澶噈ac鍚嶇О鐨勬ā鏉挎暟鎹� + continue; + } + if (listHadSelect.Contains(data.DeviceMac) == true + || listCheck.Contains(data.DeviceMac) == true) + { + //濡傛灉杩欎釜妯℃澘宸茬粡琚叾浠栬澶囬�夋嫨浜�,鎴栬�呰繖涓狹ac宸茬粡澶勭悊浜�,鍒檅reak + break; + } + if (this.modelData.dicDeviceInfo.ContainsKey(data.DeviceMac) == false + || this.modelData.dicDeviceInfo[data.DeviceMac][0].CurrentGateWayId != gatewayTemplateId + || this.modelData.dicDeviceInfo[data.DeviceMac][0].ModelIdentifier != modelId) + { + //璇ユā鏉夸笉鏄繖涓綉鍏崇殑,鎴栬�呮ā鍧桰D涓嶄竴鏍风殑 + break; + } + listCheck.Add(data.DeviceMac); + + var info = Newtonsoft.Json.JsonConvert.DeserializeObject<ModelDeviceMacNameInfo>(data.FileContent); + var selectData = new TemplateCanSelectContent(); + selectData.DeviceMac = data.DeviceMac; + selectData.DeviceName = info.deviceMacName; + + Common.Room room = null; + if (this.modelData.dicDeviceTemplateRealRoom.ContainsKey(data.DeviceMac) == true) + { + room = HdlRoomLogic.Current.GetRoomById(this.modelData.dicDeviceTemplateRealRoom[data.DeviceMac]); + } + selectData.RoomName = HdlRoomLogic.Current.GetRoomName(room); + + listCanSelect.Add(selectData); + } + } + return listCanSelect; + } + + #endregion + + #region 鈻� 鍒犻櫎璁惧___________________________ + + /// <summary> + /// 鍒犻櫎璁惧 + /// </summary> + /// <param name="device"></param> + public void DeleteDevice(CommonDevice device) + { + //鍒犻櫎淇濆瓨鏂囦欢 + string saveFile = DirNameResourse.LocalTemplateDirectory; + saveFile = System.IO.Path.Combine(saveFile, device.FilePath); + HdlFileLogic.Current.DeleteFile(saveFile); + + //绉婚櫎妯℃澘缂撳瓨 + this.modelData.dicDeviceTemplateData.Remove(Common.LocalDevice.Current.GetDeviceMainKeys(device)); + //绉婚櫎璁惧閫夋嫨缂撳瓨 + if (this.modelData.dicDeviceTemplateSelect.ContainsKey(device.DeviceAddr) == true) + { + this.modelData.dicDeviceTemplateSelect.Remove(device.DeviceAddr); + HdlFileLogic.Current.SaveFileContent(DirNameResourse.DeviceTemplateSelectFile, this.modelData.dicDeviceTemplateSelect); + } + } + + #endregion + + #region 鈻� 淇濆瓨璁惧缂撳瓨_______________________ + + /// <summary> + /// 淇濆瓨璁惧缂撳瓨 + /// </summary> + /// <param name="device">璁惧瀵硅薄</param> + public void SaveDeviceMemmoryData(CommonDevice device) + { + string mainkey = Common.LocalDevice.Current.GetDeviceMainKeys(device); + if (this.modelData.dicDeviceTemplateData.ContainsKey(mainkey) == false) + { + return; + } + + //淇濆瓨璺緞 + string saveFile = DirNameResourse.LocalTemplateDirectory; + saveFile = System.IO.Path.Combine(saveFile, device.FilePath); + + var listData = this.modelData.dicDeviceTemplateData[mainkey]; + if (listData.Count == 0) + { + //鍒犻櫎鎺夎繖涓枃浠� + HdlFileLogic.Current.DeleteFile(saveFile); + return; + } + //鍐欏叆鏂囦欢鐨勫唴瀹� + string writeText = string.Empty; + foreach (var data in listData) + { + writeText += "===>" + (int)data.DataSaveDiv + "\r\n"; + string dataInfo = Newtonsoft.Json.JsonConvert.SerializeObject(data); + writeText += dataInfo + "\r\n"; + } + //鍐欏叆鍐呭 + HdlFileLogic.Current.SaveTextToFile(saveFile, writeText); + } + + #endregion + + #region 鈻� 鑾峰彇闇�瑕佸崌绾х殑璁惧瀵硅薄_____________ + + /// <summary> + /// 鑾峰彇闇�瑕佸崌绾х殑璁惧瀵硅薄,鎸夌綉鍏冲垎缁�(key:缃戝叧ID value鐨刱ey:鏈湴Ota璁惧鐨凪ac value:鍗囩骇鍥轰欢鍦板潃) + /// </summary> + /// <returns></returns> + public Dictionary<string, Dictionary<string, string>> GetNeedToUpdateDevice() + { + var dicGatewayDevice = new Dictionary<string, Dictionary<string, string>>(); + //寰幆璁惧鍖归厤鐨勬ā鏉� + foreach (var localMac in this.modelData.dicDeviceTemplateSelect.Keys) + { + string tempMac = this.modelData.dicDeviceTemplateSelect[localMac]; + if (this.modelData.dicDeviceInfo.ContainsKey(tempMac) == false) + { + //搴旇涓嶄細杩涙潵,鍗充娇杩涙潵,鎴戜篃涓嶇煡閬撲负浠�涔� + continue; + } + //鍙栨湰鍦癘ta璁惧瀵硅薄 + var localOta = Common.LocalDevice.Current.GetOTADevice(localMac); + if (localOta == null) + { + //搴旇涓嶄細杩涙潵,鍗充娇杩涙潵,鎴戜篃涓嶇煡閬撲负浠�涔� + continue; + } + foreach (var tempDevice in this.modelData.dicDeviceInfo[tempMac]) + { + //鍙栨ā鏉縊ta璁惧瀵硅薄 + if (tempDevice is OTADevice) + { + //鍙涓よ�呯殑鍥轰欢鐗堟湰涓嶄竴鏍�,骞朵笖鏈湴鏈夎繖涓崌绾у浐浠�,鍒欓兘闇�瑕佸崌绾� + if (localOta.ImgVersion != tempDevice.ImgVersion + && HdlFirmwareUpdateLogic.IsEsixtDeviceFirmwareFile((OTADevice)tempDevice) == true) + { + //鎸夌綉鍏冲垎缁� + if (dicGatewayDevice.ContainsKey(localOta.CurrentGateWayId) == false) + { + dicGatewayDevice[localOta.CurrentGateWayId] = new Dictionary<string, string>(); + } + var dicDevice = dicGatewayDevice[localOta.CurrentGateWayId]; + dicDevice[localMac] = HdlFirmwareUpdateLogic.GetDeviceFirmwareFile((OTADevice)tempDevice); + } + break; + } + } + } + + return dicGatewayDevice; + } + + /// <summary> + /// 鑾峰彇闇�瑕佸崌绾х殑缃戝叧瀵硅薄(key:鏈湴缃戝叧鐨刬d value:鍗囩骇鍥轰欢鍦板潃,绗竴浣嶆槸Linux,绗簩浣嶆槸鍗忚皟鍣�,涔嬪悗閮芥槸铏氭嫙椹卞姩) + /// </summary> + /// <returns></returns> + public Dictionary<string, List<string>> GetNeedToUpdateGateway() + { + var dicGateway = new Dictionary<string, List<string>>(); + //寰幆缃戝叧鍖归厤鐨勬ā鏉� + foreach (var localId in this.modelData.dicGatewayTemplateSelect.Keys) + { + string tempId = this.modelData.dicGatewayTemplateSelect[localId]; + if (this.modelData.dicGatewayInfo.ContainsKey(tempId) == false) + { + //搴旇涓嶄細杩涙潵,鍗充娇杩涙潵,鎴戜篃涓嶇煡閬撲负浠�涔� + continue; + } + //鍙栨湰鍦扮綉鍏冲璞� + var localGateway = HdlGatewayLogic.Current.GetLocalGateway(localId); + if (localGateway == null) + { + //搴旇涓嶄細杩涙潵,鍗充娇杩涙潵,鎴戜篃涓嶇煡閬撲负浠�涔� + continue; + } + var tempGateway = this.modelData.dicGatewayInfo[tempId]; + //鍒濆鍖栧鍣� + dicGateway[localId] = new List<string>() { null, null }; + + //Linux鐗堟湰姣旇緝 + if (tempGateway.LinuxFirmwareVersion != localGateway.LinuxFirmwareVersion) + { + //Linux鍗囩骇鍥轰欢鏂囦欢鍏ㄨ矾寰� + string updateFile = HdlFirmwareUpdateLogic.GetGatewayLinuxFirmwareFile(tempGateway); + if (System.IO.File.Exists(updateFile) == true) + { + //濡傛灉瀛樺湪鐨勮瘽 + dicGateway[localId][0] = updateFile; + } + } + //鍗忚皟鍣ㄧ増鏈瘮杈� + if (tempGateway.CoordinatorFirmwareVersion != localGateway.CoordinatorFirmwareVersion) + { + //鍗忚皟鍣ㄥ崌绾у浐浠舵枃浠跺叏璺緞 + string updateFile = HdlFirmwareUpdateLogic.GetGatewayCoordinatorFirmwareFile(tempGateway); + if (System.IO.File.Exists(updateFile) == true) + { + //濡傛灉瀛樺湪鐨勮瘽 + dicGateway[localId][1] = updateFile; + } + } + //铏氭嫙椹卞姩姣旇緝 + if (localGateway.LinuxImageType != 6) + { + foreach (var localCode in localGateway.DriveCodeList) + { + foreach (var tempCode in tempGateway.DriveCodeList) + { + //闃叉瀹冩斁鐨勯『搴忎笉鏍� + if (localCode.DriveId == tempCode.DriveId && localCode.DriveFwVersion != tempCode.DriveFwVersion) + { + //铏氭嫙椹卞姩鍗囩骇鍥轰欢鏂囦欢鍏ㄨ矾寰� + string updateFile = HdlFirmwareUpdateLogic.GetGatewayDriveCodeFirmwareFile(tempCode); + if (System.IO.File.Exists(updateFile) == true) + { + //濡傛灉瀛樺湪鐨勮瘽 + dicGateway[localId].Add(updateFile); + } + } + } + } + } + } + + return dicGateway; + } + + #endregion + + #region 鈻� 浠庢ā鏉挎枃浠朵腑鑾峰彇瀵硅薄(澶栭儴璋冪敤)_____ + + /// <summary> + /// 浠庢ā鏉挎枃浠朵腑,鑾峰彇璁惧鍜岀綉鍏冲璞� + /// </summary> + /// <param name="fullFileName">妯℃澘鏂囦欢鐨勫叏璺緞</param> + /// <param name="listDevice">ota璁惧鍒楄〃</param> + /// <param name="listGateway">缃戝叧鍒楄〃</param> + public void GetDeviceObjectFromTemplate(string fullFileName, ref List<OTADevice> listDevice, ref List<ZbGateway> listGateway) + { + var fileData = HdlFileLogic.Current.ReadFileTextContent(fullFileName); + if (fileData == null) + { + return; + } + var deviceType = string.Empty; + var strTempContentData = string.Empty; + + //鏍规嵁鎹㈣绗﹀垏鍒嗘暟鎹枃鏈� + string[] arryData = fileData.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); + foreach (string strData in arryData) + { + if (strData == "#START#") + { + //鏃犻檮鍔犳暟鎹殑銆愭暟鎹爣棰樸�� + strTempContentData = string.Empty; + continue; + } + if (strData.StartsWith("#DeviceInfo START#") == true) + { + //闄勫姞鏁版嵁:璁惧瀵硅薄绫诲瀷 + deviceType = strData.Substring(18); + strTempContentData = string.Empty; + continue; + } + try + { + //璁惧瀵硅薄 + if (strData == "#DeviceInfo END#") + { + //鍙嶅簭鍒楀寲璁惧 + if (deviceType == "OtaDevice" || deviceType == "OtaPanelDevice") + { + var device = Newtonsoft.Json.JsonConvert.DeserializeObject<OTADevice>(strTempContentData); + if (device != null) + { + listDevice.Add(device); + } + } + + strTempContentData = string.Empty; + continue; + } + //缃戝叧瀵硅薄鏁版嵁 + else if (strData == "#GatewayInfo END#") + { + //鍙嶅簭鍒楀寲璁惧 + var gateway = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway>(strTempContentData); + if (gateway != null) + { + listGateway.Add(gateway); + } + strTempContentData = string.Empty; + return; + } + strTempContentData += strData; + } + catch (Exception ex) + { + HdlLogLogic.Current.WriteLog(ex, "妯℃澘bin鏂囦欢鍑洪棶棰榎r\n" + strTempContentData); + strTempContentData = string.Empty; + } + } + } + + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + /// <summary> + /// 澶嶅埗妯℃澘bin鏂囦欢鍒版湰鍦扮殑妯℃澘鏂囦欢澶归噷 + /// </summary> + /// <param name="templateFileName">妯℃澘鏂囦欢鐨勫悕瀛�(鍏ㄤ綇瀹呭瓨鏀剧殑妯℃澘)</param> + public void CopyTemplateFileToLocalDirectory(string templateFileName) + { + string sourceFile = System.IO.Path.Combine(DirNameResourse.AllResidenceTemplateDirectory, templateFileName); + + this.CopyTemplateFileToLocalDirectory2(sourceFile); + } + + /// <summary> + /// 澶嶅埗妯℃澘bin鏂囦欢鍒版湰鍦扮殑妯℃澘鏂囦欢澶归噷 + /// </summary> + /// <param name="fullTemplateName">妯℃澘鏂囦欢鐨勫叏璺緞</param> + public void CopyTemplateFileToLocalDirectory2(string fullTemplateName) + { + if (System.IO.File.Exists(fullTemplateName) == false) + { + return; + } + + //淇濆瓨鐨勮矾寰� + string targetFile = DirNameResourse.LocalTemplateDirectory; + targetFile = System.IO.Path.Combine(targetFile, TemplateFileName); + + try { System.IO.File.Copy(fullTemplateName, targetFile, true); } + catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex, "澶嶅埗妯℃澘bin鏂囦欢澶辫触"); } + } + + /// <summary> + /// 鍒犻櫎鏈湴鍏ㄩ儴鐨勬ā鏉跨紦瀛樻枃浠� + /// </summary> + public void DeleteAllLocalFile() + { + //鑾峰彇杩欎釜璺緞涓嬮潰鍏ㄩ儴鐨勬枃浠� + var listFile = HdlFileLogic.Current.GetFileFromDirectory(DirNameResourse.LocalTemplateDirectory, false); ; + foreach (var file in listFile) + { + HdlFileLogic.Current.DeleteFile(file); + } + } + + /// <summary> + /// 鑾峰彇妯℃澘涓殑璁惧鏁� + /// </summary> + /// <returns></returns> + public int GetTemplateDeviceCount() + { + return this.modelData.dicDeviceInfo.Count; + } + + /// <summary> + /// 妫�娴嬭澶囨ā鏉挎暟鍜屽綋鍓嶈澶囬�夋嫨鐨勬ā鏉挎暟鏄惁涓�鑷� + /// </summary> + /// <returns></returns> + public bool CheckTemplateDeviceCountAndSelectCountIsEqual() + { + return this.modelData.dicDeviceInfo.Count == this.modelData.dicDeviceTemplateSelect.Count; + } + + /// <summary> + /// 鑾峰彇鏂囦欢閲屾寚瀹氱殑鍐呭 + /// </summary> + /// <param name="fileContrnt">鏂囦欢鏂囨湰</param> + /// <param name="startFlage">寮�濮嬪瓧绗�</param> + /// <param name="endFlage">缁撴潫瀛楃</param> + /// <returns></returns> + private string GetDataFromFileContent(string fileContrnt, string startFlage, string endFlage) + { + string[] arryValue = fileContrnt.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); + string modelBaseInfo = string.Empty; + bool getData = false; + bool success = false; + foreach (var strValue in arryValue) + { + //寮�濮� + if (strValue == startFlage) + { + getData = true; + //鍚屼竴寮�濮嬪瓧绗︾殑涓滆タ寰堝 + modelBaseInfo = string.Empty; + continue; + } + //缁撴潫 + if (strValue == endFlage) + { + success = true; + break; + } + if (getData == true) + { + modelBaseInfo += strValue; + } + } + return success == true ? modelBaseInfo : string.Empty; + } + + /// <summary> + /// 鑾峰彇妯″潡ID + /// </summary> + /// <param name="deviceMac"></param> + /// <returns></returns> + private string GetDeviceModelId(string deviceMac) + { + var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac); + foreach (var device in listDevice) + { + if (device.ModelIdentifier != string.Empty) + { + return device.ModelIdentifier; + } + } + return string.Empty; + } + + /// <summary> + /// 鑾峰彇璁惧淇濆瓨鐨勬ā鏉垮璞� + /// </summary> + /// <param name="device"></param> + /// <param name="saveEnum"></param> + /// <returns></returns> + public TemplateDeviceDataCommon GetDeviceModelDataClass(CommonDevice device, ModelDeviceSaveEnum saveEnum, TemplateDeviceDataCommon newClass) + { + string mainkey = Common.LocalDevice.Current.GetDeviceMainKeys(device); + + //鍒涘缓瀛樺偍绌洪棿 + if (this.modelData.dicDeviceTemplateData.ContainsKey(mainkey) == false) + { + this.modelData.dicDeviceTemplateData[mainkey] = new List<TemplateDeviceDataCommon>(); + } + foreach (var data in this.modelData.dicDeviceTemplateData[mainkey]) + { + //濡傛灉鏄凡缁忓瓨鍦ㄤ簡鐨� + if (data.DataSaveDiv == saveEnum) + { + return data; + } + } + //鏂板缓涓�涓柊鐨勫璞� + newClass.DataSaveDiv = saveEnum; + newClass.DeviceEpoint = device.DeviceEpoint; + newClass.DeviceMac = device.DeviceAddr; + + //榛樿鍒涘缓涓�涓储寮曚綅 + newClass.ListReceiveResult.Add(string.Empty); + newClass.ListReceiveTopic.Add(string.Empty); + newClass.ListSendTopic.Add(string.Empty); + + this.modelData.dicDeviceTemplateData[mainkey].Add(newClass); + + return newClass; + } + + /// <summary> + /// 鏄剧ず淇℃伅妗� + /// </summary> + /// <param name="msgType">淇℃伅绫诲瀷</param> + /// <param name="msg">淇℃伅</param> + /// <param name="action">鍗曞嚮纭鍚庢墽琛岀殑鍥炶皟鍑芥暟</param> + /// <param name="buttonText">鎸夐挳鐨勬枃鏈�</param> + private void ShowMassage(ShowMsgType msgType, string msg, Action action = null, string buttonText = null) + { + //绌哄璞℃椂锛屼笉鏄剧ず + if (string.IsNullOrEmpty(msg)) + { + return; + } + Application.RunOnMainThread(() => + { + var alert = new ShowMsgControl(msgType, msg, buttonText); + if (action != null) + { + alert.ConfirmClickEvent += () => + { + try + { + //鍥炶皟鍑芥暟 + action?.Invoke(); + } + catch (Exception ex) + { + //鍑虹幇鏈煡閿欒,鏁版嵁涓㈠け + this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError)); + + //Log鍑哄姏 + HdlLogLogic.Current.WriteLog(ex); + } + action = null; + }; + } + alert.Show(); + }); + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/TemplateData/TemplateDataCommon.cs b/ZigbeeApp/Shared/Phone/TemplateData/TemplateDataCommon.cs new file mode 100755 index 0000000..ec0d985 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/TemplateData/TemplateDataCommon.cs @@ -0,0 +1,738 @@ +锘縰sing Shared.Phone.UserCenter; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Shared.Phone.TemplateData +{ + #region 鈻� 鍏遍�氭ā鏉挎暟鎹畾涔塤__________________ + + /// <summary> + /// 妯℃澘缂撳瓨鏁版嵁 + /// </summary> + public class TemplateMemoryData + { + //鈽� 銉嗐兂銉椼儸銉笺儓銉曘偂銈ゃ儷銇繚瀛樸仌銈屻仧銉戙儵銉°兗銈裤兗 鈽� 鈫� + /// <summary> + /// 妯℃澘鐨勫悕瀛� + /// </summary> + public string TemplateName = string.Empty; + /// <summary> + /// 鍏ㄩ儴鐨勮澶囬厤缃紦瀛樻暟鎹�(涓婚敭鏄湰鍦拌澶囩殑涓婚敭) + /// </summary> + public Dictionary<string, List<TemplateDeviceDataCommon>> dicDeviceTemplateData = new Dictionary<string, List<TemplateDeviceDataCommon>>(); + /// <summary> + /// 缃戝叧瀵硅薄鏁版嵁 + /// </summary> + public Dictionary<string, ZigBee.Device.ZbGateway> dicGatewayInfo = new Dictionary<string, ZigBee.Device.ZbGateway>(); + /// <summary> + /// 璁惧瀵硅薄鏁版嵁(key锛氳澶嘙ac) + /// </summary> + public Dictionary<string, List<ZigBee.Device.CommonDevice>> dicDeviceInfo = new Dictionary<string, List<ZigBee.Device.CommonDevice>>(); + /// <summary> + /// 妯℃澘涓澶囧悇鑷湡瀹炶澶囧搴旂殑鎴块棿(keys:璁惧Mac鎴栬�呯綉鍏矷D, value:鎴块棿ID) + /// </summary> + public Dictionary<string, string> dicDeviceTemplateRealRoom = new Dictionary<string, string>(); + //鈽� 銉嗐兂銉椼儸銉笺儓銇繚瀛樸仌銈屻仧銉戙儵銉°兗銈裤兗 鈽� 鈫� + + + /// <summary> + /// 涓存椂缂撳瓨:妯℃澘涓悇鑷鐐规墍澶勭殑鎴块棿(keys:璁惧涓婚敭 value:鎴块棿ID) 鏃ㄥ湪閽堝璁惧鏉ュ洖閫夋嫨妯℃澘鐨勬儏鍐� + /// </summary> + public Dictionary<string, string> dicDeviceTemplateRoom = new Dictionary<string, string>(); + /// <summary> + /// 涓存椂缂撳瓨:妯℃澘涓悇鑷鐐规墍淇濆瓨鐨勫唴瀹�(keys:妯℃澘涓澶囦富閿�),璁惧閫夋嫨妯℃澘鏃�,妯℃澘鏁版嵁杩佺Щ浣跨敤,鍥犱负鏄紩鐢ㄧ被鍨�,鎵�浠ラ渶瑕侀噸鏂癗ew + /// </summary> + public Dictionary<string, List<TemplateDeviceContent>> dicDeviceFileContent = new Dictionary<string, List<TemplateDeviceContent>>(); + + + //鈽� 鍒ャ伄銉曘偂銈ゃ儷銇繚瀛樸仌銈屻仧銉戙儵銉°兗銈裤兗 鈽� 鈫� + /// <summary> + /// 璁惧閫夋嫨鐨勬ā鏉垮璞�(keys:鏈湴璁惧鐨凪ac value:妯℃澘涓殑Mac) + /// </summary> + public Dictionary<string, string> dicDeviceTemplateSelect = new Dictionary<string, string>(); + /// <summary> + /// 缃戝叧瀵硅薄閫夋嫨鐨勬ā鏉垮璞�(keys:鏈湴缃戝叧ID, value:妯℃澘涓殑缃戝叧ID) + /// </summary> + public Dictionary<string, string> dicGatewayTemplateSelect = new Dictionary<string, string>(); + //鈽� 鍒ャ伄銉曘偂銈ゃ儷銇繚瀛樸仌銈屻仧銉戙儵銉°兗銈裤兗 鈽� 鈫� + } + + /// <summary> + /// 涓�涓澶囩殑妯℃澘鏁版嵁鐨勫叡閫� + /// </summary> + public class TemplateDeviceDataCommon + { + /// <summary> + /// 璁惧Mac鍦板潃 + /// </summary> + public string DeviceMac = string.Empty; + /// <summary> + /// 璁惧绔偣 + /// </summary> + public int DeviceEpoint = -1; + /// <summary> + /// 鍙戦�侀渶瑕佺殑澶ф鏃堕棿(绉�) + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public int SendTime { get { return this.GetSendTime(); } } + /// <summary> + /// 鏁版嵁淇濆瓨鐨勫尯鍒�(涓嶉渶瑕佸啀娆¤缃�) + /// </summary> + public ModelDeviceSaveEnum DataSaveDiv = ModelDeviceSaveEnum.A鏈畾涔�; + /// <summary> + /// 鎺ユ敹鐨勪富棰�(鑰冭檻澶氭潯鍛戒护,姝e父閮芥槸1鏉″懡浠�) + /// </summary> + public List<string> ListReceiveTopic = new List<string>(); + /// <summary> + /// 鎺ユ敹鐨勭粨鏋�(鑰冭檻澶氭潯鍛戒护,姝e父閮芥槸1鏉″懡浠�) + /// </summary> + public List<string> ListReceiveResult = new List<string>(); + /// <summary> + /// 鍙戦�佺殑涓婚(鑰冭檻澶氭潯鍛戒护,姝e父閮芥槸1鏉″懡浠�) + /// </summary> + public List<string> ListSendTopic = new List<string>(); + + /// <summary> + /// 鑾峰彇鏇存敼璁惧閰嶇疆鐨勫懡浠ゅ瓧绗�(鑰冭檻澶氭潯鍛戒护,姝e父閮芥槸1鏉″懡浠�) + /// </summary> + /// <returns></returns> + public virtual List<string> GetSendGatewayValue() + { + return new List<string>(); + } + + /// <summary> + /// 鍙戦�侀渶瑕佺殑澶ф鏃堕棿(绉�) + /// </summary> + /// <returns></returns> + public virtual int GetSendTime() + { + return 0; + } + } + + /// <summary> + /// 妯℃澘璁惧鐨勭増鏈俊鎭� + /// </summary> + public class TemplateDeviceVersionInfo + { + //鐩墠鍙湁 鐗堟湰鍙橀噺 + /// <summary> + /// 褰撳墠鐗堟湰 + /// </summary> + public int Version = -1; + } + + /// <summary> + /// 妯℃澘璁惧鍦ㄦ枃浠朵腑鐨勫唴瀹� + /// </summary> + public class TemplateDeviceContent + { + /// <summary> + /// 淇濆瓨鍖哄垎 鍙傜収:ModelDeviceSaveEnum + /// </summary> + public ModelDeviceSaveEnum saveDiv = ModelDeviceSaveEnum.A鏈畾涔�; + /// <summary> + /// 鏈夌偣鐢ㄥ + /// </summary> + public string DeviceMac = string.Empty; + /// <summary> + /// 鏂囦欢涓繚瀛樼殑鍐呭 + /// </summary> + public string FileContent = string.Empty; + } + + /// <summary> + /// 鍙�夋ā鏉跨殑鍐呭 + /// </summary> + public class TemplateCanSelectContent + { + /// <summary> + /// 璁惧Mac + /// </summary> + public string DeviceMac = string.Empty; + /// <summary> + /// 璁惧Mac鍚嶅瓧 + /// </summary> + public string DeviceName = string.Empty; + /// <summary> + /// 璇ヨ澶囨墍鍦ㄧ殑鎴块棿 + /// </summary> + public string RoomName = string.Empty; + } + + /// <summary> + /// 鏈湴妯℃澘鐨勫熀鏈俊鎭� + /// </summary> + public class LocalModelBaseInfo + { + /// <summary> + /// <para>淇濆瓨鏁版嵁鐨勬枃浠跺悕瀛�(涓嶉渶瑕佷繚瀛樺埌鏂囦欢澶逛腑)</para> + /// <para>ModelData_Local_yyyyMMdd_HHmmss.bin -> 鏈湴妯℃澘</para> + /// <para>ModelData_Cloud_yyyyMMdd_HHmmss.bin -> 鏈湴妯℃澘</para> + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public string FileName = string.Empty; + /// <summary> + /// 鏄惁鏄湰鍦版ā鏉� + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public bool IsLocalTemplate + { + get { return FileName.StartsWith("ModelData_Local"); } + } + /// <summary> + /// 鍗曞厓鍚嶇О(杩欎釜鐩墠鏄粰鏌ョ湅妯℃澘浣跨敤鐨�) + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public List<string> ListUintContent = new List<string>(); + /// <summary> + /// 褰撳墠浣忓畢鐨勫湴鍥句綅缃悕绉� + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public string ResidenceAddressName = string.Empty; + + /// <summary> + /// 妯℃澘鍚嶅瓧 + /// </summary> + public string ModelName = string.Empty; + /// <summary> + /// 缂栬緫鏃堕棿 2020.01.04 19:55鏍煎紡 + /// </summary> + public string EditorTime = string.Empty; + /// <summary> + /// 妤煎眰鏁� + /// </summary> + public int FloorCount = 0; + /// <summary> + /// 璁惧鏁� + /// </summary> + public int DeviceCount = 0; + /// <summary> + /// 鍔熻兘鏁� + /// </summary> + public int FunctionCount = 0; + } + + /// <summary> + /// 妯℃澘浣忓畢鐨勪俊鎭� + /// </summary> + public class TemplateHomeInfo + { + /// <summary> + /// 鍗曞厓鍚嶇О + /// </summary> + public List<string> ListUintContent = new List<string>(); + /// <summary> + /// 褰撳墠浣忓畢鐨勫湴鍥句綅缃悕绉� + /// </summary> + public string ResidenceAddressName = string.Empty; + } + + #endregion + + #region 鈻� 绐楀笜妯℃澘鏁版嵁瀹氫箟___________________ + + /// <summary> + /// 绐楀笜鎵嬫媺鎺у埗妯℃澘瀹氫箟 + /// </summary> + public class ModelCurtainHandPullControl : TemplateDeviceDataCommon + { + /// <summary> + /// 鐘舵�� + /// </summary> + public bool Statu = false; + /// <summary> + /// 鑾峰彇鏇存敼璁惧閰嶇疆鐨勫懡浠ゅ瓧绗� + /// </summary> + /// <returns></returns> + public override List<string> GetSendGatewayValue() + { + var command = HdlDeviceCurtainLogic.Current.GetHandPullControlText(DeviceMac, DeviceEpoint, Statu); + return new List<string>() { command }; + } + + /// <summary> + /// 鑾峰彇鍙戦�佸懡浠ゅぇ姒傞渶瑕佺殑鏃堕棿(绉�) + /// </summary> + /// <returns></returns> + public override int GetSendTime() + { + //鎵ц杩欎釜鍛戒护澶х害闇�瑕�5绉� + return 5; + } + } + + /// <summary> + /// 绐楀笜闄愪綅妯℃澘瀹氫箟 + /// </summary> + public class ModelCurtainDirectionAndLimite : TemplateDeviceDataCommon + { + /// <summary> + /// false:鐢垫満鏂瑰悜姝e悜锛泃rue:鐢垫満鏂瑰悜鍙嶅悜 + /// </summary> + public bool Direction = false; + /// <summary> + /// 寮�闄愪綅 + /// </summary> + public int upLimit = 2; + /// <summary> + /// 鍚堥檺浣� + /// </summary> + public int downLimit = 98; + /// <summary> + /// 瀵艰建闀垮害 + /// </summary> + public int curtainLength = 100; + /// <summary> + /// 鑾峰彇鏇存敼璁惧閰嶇疆鐨勫懡浠ゅ瓧绗� + /// </summary> + /// <returns></returns> + public override List<string> GetSendGatewayValue() + { + //鏂瑰悜 + var command1 = HdlDeviceCurtainLogic.Current.GetCurtainDirectionCommadText(DeviceMac, DeviceEpoint, Direction); + //闄愪綅 + var command2 = HdlDeviceCurtainLogic.Current.GetAutoOpenCurtainLimitPointCommandText(DeviceMac, DeviceEpoint, upLimit, downLimit); + return new List<string>() { command1, command2 }; + } + + /// <summary> + /// 鑾峰彇鍙戦�佸懡浠ゅぇ姒傞渶瑕佺殑鏃堕棿(绉�) + /// </summary> + /// <returns></returns> + public override int GetSendTime() + { + //鎵ц杩欎釜鍛戒护澶х害闇�瑕�5绉� + return 5; + } + } + + #endregion + + #region 鈻� 绌鸿皟妯℃澘鏁版嵁瀹氫箟___________________ + + /// <summary> + /// 绌鸿皟鑷畾涔夋ā寮忔ā鏉挎暟鎹畾涔� + /// </summary> + public class ModelAcModeSupport : TemplateDeviceDataCommon + { + /// <summary> + /// 鍊� + /// </summary> + public int data = 0; + /// <summary> + /// 鑾峰彇鏇存敼璁惧閰嶇疆鐨勫懡浠ゅ瓧绗� + /// </summary> + /// <returns></returns> + public override List<string> GetSendGatewayValue() + { + var command = HdlDeviceAttributeLogic.Current.GetWriteDeviceAttributeText(DeviceMac, DeviceEpoint, 513, 4099, 25, data); + return new List<string>() { command }; + } + + /// <summary> + /// 鑾峰彇鍙戦�佸懡浠ゅぇ姒傞渶瑕佺殑鏃堕棿(绉�) + /// </summary> + /// <returns></returns> + public override int GetSendTime() + { + //鎵ц杩欎釜鍛戒护澶х害闇�瑕�5绉� + return 5; + } + } + + /// <summary> + /// 绌鸿皟鎽嗛妯″紡妯℃澘鏁版嵁瀹氫箟 + /// </summary> + public class ModelAcSwingModeSupport : TemplateDeviceDataCommon + { + /// <summary> + /// 鍊� + /// </summary> + public int data = 0; + /// <summary> + /// 鑾峰彇鏇存敼璁惧閰嶇疆鐨勫懡浠ゅ瓧绗� + /// </summary> + /// <returns></returns> + public override List<string> GetSendGatewayValue() + { + var command = HdlDeviceAttributeLogic.Current.GetWriteDeviceAttributeText(DeviceMac, DeviceEpoint, 513, 4099, 25, data); + return new List<string>() { command }; + } + + /// <summary> + /// 鑾峰彇鍙戦�佸懡浠ゅぇ姒傞渶瑕佺殑鏃堕棿(绉�) + /// </summary> + /// <returns></returns> + public override int GetSendTime() + { + //鎵ц杩欎釜鍛戒护澶х害闇�瑕�5绉� + return 5; + } + } + + #endregion + + #region 鈻� 璁惧缁戝畾妯℃澘鏁版嵁瀹氫箟_______________ + + /// <summary> + /// 璁惧缁戝畾妯℃澘鏁版嵁瀹氫箟 + /// </summary> + public class ModelDeviceBindData : TemplateDeviceDataCommon + { + /// <summary> + /// 鎸夐敭鐨勫姛鑳芥ā寮� + /// </summary> + public ZigBee.Device.Panel.KeyMode keyMode = ZigBee.Device.Panel.KeyMode.Default; + /// <summary> + /// 鎸夐敭鐨勫姛鑳芥ā寮忕殑闀濱D + /// </summary> + public int keyModeClusterID = -1; + /// <summary> + /// 缁戝畾鍒楄〃 + /// </summary> + public List<ZigBee.Device.BindObj.BindListResponseObj> BindList = new List<ZigBee.Device.BindObj.BindListResponseObj>(); + + /// <summary> + /// 鑾峰彇鏇存敼璁惧閰嶇疆鐨勫懡浠ゅ瓧绗� + /// </summary> + /// <returns></returns> + public override List<string> GetSendGatewayValue() + { + var addBindData = new ZigBee.Device.BindObj.AddBindData(); + addBindData.DeviceAddr = this.DeviceMac; + addBindData.Epoint = this.DeviceEpoint; + + //褰撳墠閫夋嫨鐨勬ā鏉垮璞� + var dicChangedMac = new Dictionary<string, string>(); + var dicNowSelect = TemplateCommonLogic.Current.modelData.dicDeviceTemplateSelect; + foreach (var localMac in dicNowSelect.Keys) + { + dicChangedMac[dicNowSelect[localMac]] = localMac; + } + foreach (var data in BindList) + { + //鍦烘櫙 + if (data.BindType == 2) + { + var addData = new ZigBee.Device.BindObj.AddBindListObj(); + addBindData.BindList.Add(addData); + addData.BindCluster = data.BindCluster; + addData.BindScenesId = data.BindScenesId; + addData.BindType = 1; + } + //璁惧 + else + { + if (dicChangedMac.ContainsKey(data.BindMacAddr) == false) + { + //杩欎釜涓滆タ娌℃湁閫夋嫨妯℃澘,鍒欎笉鎵ц + continue; + } + var addData = new ZigBee.Device.BindObj.AddBindListObj(); + addBindData.BindList.Add(addData); + addData.BindCluster = data.BindCluster; + addData.BindEpoint = data.BindEpoint; + //鏇挎崲mac + addData.BindMacAddr = dicChangedMac[data.BindMacAddr]; + addData.BindType = 0; + } + } + var listCommand = new List<string>(); + //娓呯┖缁戝畾 + var jObject = new Newtonsoft.Json.Linq.JObject { { "DeviceAddr", this.DeviceMac }, { "Epoint", this.DeviceEpoint }, { "Cluster_ID", 0 }, { "Command", 5006 } }; + listCommand.Add(jObject.ToString()); + + //鍔熻兘閰嶇疆 + listCommand.Add(string.Empty); + if (keyModeClusterID != -1) + { + var command1 = HdlDeviceBindLogic.Current.GetConfigureHdlKeyCommandText(this.DeviceMac, this.DeviceEpoint, keyMode, keyModeClusterID); + listCommand[1] = command1; + } + + //缁戝畾鍒楄〃 + listCommand.Add(string.Empty); + if (addBindData.BindList.Count > 0) + { + var command2 = HdlDeviceBindLogic.Current.GetAddDeviceListBindCommandText(addBindData); + listCommand[2] = command2; + } + return listCommand; + } + + /// <summary> + /// 鑾峰彇鍙戦�佸懡浠ゅぇ姒傞渶瑕佺殑鏃堕棿(绉�) + /// </summary> + /// <returns></returns> + public override int GetSendTime() + { + //鎵ц杩欎釜鍛戒护澶х害闇�瑕�15绉� + return 15; + } + } + + #endregion + + #region 鈻� Pir浼犳劅鍣ㄦā鏉挎暟鎹畾涔塤_____________ + + /// <summary> + /// Pir浼犳劅鍣ㄦā鏉挎暟鎹畾涔� + /// </summary> + public class ModelPirSensorSettion : TemplateDeviceDataCommon + { + /// <summary> + /// pir鐨勯厤缃俊鎭� + /// </summary> + public ZigBee.Device.IASZone.ConfigureParamates pirConfigure = new ZigBee.Device.IASZone.ConfigureParamates(); + /// <summary> + /// 鑾峰彇鏇存敼璁惧閰嶇疆鐨勫懡浠ゅ瓧绗� + /// </summary> + /// <returns></returns> + public override List<string> GetSendGatewayValue() + { + var command = HdlDevicePirSensorLogic.Current.GetPirSensorSettionCommandText(DeviceMac, pirConfigure); + return new List<string>() { command }; + } + + /// <summary> + /// 鑾峰彇鍙戦�佸懡浠ゅぇ姒傞渶瑕佺殑鏃堕棿(绉�) + /// </summary> + /// <returns></returns> + public override int GetSendTime() + { + //鎵ц杩欎釜鍛戒护澶х害闇�瑕�5绉� + return 5; + } + } + + #endregion + + #region 鈻� 闈㈡澘妯℃澘鏁版嵁瀹氫箟___________________ + + /// <summary> + /// 闈㈡澘闇囧姩鍔熻兘妯℃澘鏁版嵁瀹氫箟 + /// </summary> + public class ModelPanelVibrationInfo : TemplateDeviceDataCommon + { + /// <summary> + /// 闇囧姩鍔熻兘 + /// </summary> + public HdlDevicePanelLogic.PanelVibrationInfo vibrationInfo = new HdlDevicePanelLogic.PanelVibrationInfo(); + /// <summary> + /// 鑾峰彇鏇存敼璁惧閰嶇疆鐨勫懡浠ゅ瓧绗� + /// </summary> + /// <returns></returns> + public override List<string> GetSendGatewayValue() + { + var command = HdlDevicePanelLogic.Current.GetPanelVibrationCommandText(DeviceMac, vibrationInfo); + return new List<string>() { command }; + } + + /// <summary> + /// 鑾峰彇鍙戦�佸懡浠ゅぇ姒傞渶瑕佺殑鏃堕棿(绉�) + /// </summary> + /// <returns></returns> + public override int GetSendTime() + { + //鎵ц杩欎釜鍛戒护澶х害闇�瑕�5绉� + return 5; + } + } + + /// <summary> + /// 闈㈡澘鑳屽厜鐏ā鏉挎暟鎹畾涔� + /// </summary> + public class ModelPanelBackLightInfo : TemplateDeviceDataCommon + { + /// <summary> + /// 浜害璋冭妭鐨勪俊鎭� + /// </summary> + public ModelPanelSwitchLevelInfo linghtLevelInfo = new ModelPanelSwitchLevelInfo(); + /// <summary> + /// 鑺傝兘妯″紡 + /// </summary> + public ZigBee.Device.Panel.PanelSaveEnergyModeInfo energyModeInfo = new ZigBee.Device.Panel.PanelSaveEnergyModeInfo(); + /// <summary> + /// 鎸夐敭鐨勯鑹叉暟鎹� + /// </summary> + public ZigBee.Device.Panel.KeyColorData keyColorData = new ZigBee.Device.Panel.KeyColorData(); + /// <summary> + /// 鍜宬eyColorData涓�璧风敤鐨勪笢瑗� + /// </summary> + public ZigBee.Device.Panel.KeyNumStatus KeyNum = new ZigBee.Device.Panel.KeyNumStatus(); + /// <summary> + /// 鑾峰彇鏇存敼璁惧閰嶇疆鐨勫懡浠ゅ瓧绗� + /// </summary> + /// <returns></returns> + public override List<string> GetSendGatewayValue() + { + //杩欎笁涓笢瑗跨殑椤哄簭涓嶈兘鍙� + //浜害璋冭妭 + var command1 = HdlDevicePanelLogic.Current.GetPanelLevelCommadText(DeviceMac, linghtLevelInfo.panelDirectionsLevel, linghtLevelInfo.panelBacklightLevel); + //鑺傝兘妯″紡 + var command2 = HdlDevicePanelLogic.Current.GetDeviceEnergyConservationModeCommandText(DeviceMac, energyModeInfo.enable, energyModeInfo.time, energyModeInfo.level); + //鎸夐敭鎸囩ず鐏鑹� + var command3 = HdlDevicePanelLogic.Current.GetPanelColorCommandText(DeviceMac, keyColorData, KeyNum); + + return new List<string>() { command1, command2, command3 }; + } + + /// <summary> + /// 鑾峰彇鍙戦�佸懡浠ゅぇ姒傞渶瑕佺殑鏃堕棿(绉�) + /// </summary> + /// <returns></returns> + public override int GetSendTime() + { + //鎵ц杩欎釜鍛戒护澶х害闇�瑕�8绉� + return 8; + } + } + + /// <summary> + /// 鎸夐敭鎸囩ず鐏潰鏉垮紑鍏充寒搴﹂厤缃洖澶� + /// </summary> + public class ModelPanelSwitchLevelInfo + { + /// <summary> + ///鎸夐敭寮�鐘舵�侊紙鎸囩ず锛変寒搴�(杩欎釜鏄偣鍑诲悗鐨勫��) + /// </summary> + public int panelDirectionsLevel = -1; + + /// <summary> + /// 鎸夐敭鍏崇姸鎬侊紙鑳屽厜锛変寒搴�(杩欎釜鏄偣鍑诲墠鐨勫��) + /// </summary> + public int panelBacklightLevel = -1; + } + + #endregion + + #region 鈻� 璁惧鍚嶇О妯℃澘鏁版嵁瀹氫箟_______________ + + /// <summary> + /// 璁惧绔偣鍚嶇О妯℃澘鏁版嵁瀹氫箟 + /// </summary> + public class ModelDeviceEpointNameInfo : TemplateDeviceDataCommon + { + /// <summary> + /// 璁惧绔偣鍚嶇О + /// </summary> + public string deviceEpointName = string.Empty; + /// <summary> + /// 鑾峰彇鏇存敼璁惧閰嶇疆鐨勫懡浠ゅ瓧绗� + /// </summary> + /// <returns></returns> + public override List<string> GetSendGatewayValue() + { + var command = Common.LocalDevice.Current.GetReDeviceEpointNameCommandText(DeviceMac, DeviceEpoint, deviceEpointName); + return new List<string>() { command }; + } + + /// <summary> + /// 鑾峰彇鍙戦�佸懡浠ゅぇ姒傞渶瑕佺殑鏃堕棿(绉�) + /// </summary> + /// <returns></returns> + public override int GetSendTime() + { + //鎵ц杩欎釜鍛戒护澶х害闇�瑕�3绉� + return 3; + } + } + + /// <summary> + /// 璁惧Mac鍚嶇О妯℃澘鏁版嵁瀹氫箟 + /// </summary> + public class ModelDeviceMacNameInfo : TemplateDeviceDataCommon + { + /// <summary> + /// 璁惧Mac鍚嶇О + /// </summary> + public string deviceMacName = string.Empty; + /// <summary> + /// 鑾峰彇鏇存敼璁惧閰嶇疆鐨勫懡浠ゅ瓧绗� + /// </summary> + /// <returns></returns> + public override List<string> GetSendGatewayValue() + { + var command = Common.LocalDevice.Current.GetReDeviceMacNameCommandText(DeviceMac, DeviceEpoint, deviceMacName); + return new List<string>() { command }; + } + + /// <summary> + /// 鑾峰彇鍙戦�佸懡浠ゅぇ姒傞渶瑕佺殑鏃堕棿(绉�) + /// </summary> + /// <returns></returns> + public override int GetSendTime() + { + //鎵ц杩欎釜鍛戒护澶х害闇�瑕�3绉� + return 3; + } + } + + #endregion + + #region 鈻� 鑷畾涔夋灇涓綺________________________ + + /// <summary> + /// 妯℃澘璁惧淇濆瓨鐨勫尯鍒� + /// </summary> + public enum ModelDeviceSaveEnum + { + A鏈畾涔� = -1, + /// <summary> + /// 瀵硅薄绫�:ModelDeviceMacNameInfo + /// </summary> + A璁惧鍚嶇О = 1, + /// <summary> + /// 瀵硅薄绫�:ModelDeviceEpointNameInfo + /// </summary> + A绔偣鍚嶇О = 2, + /// <summary> + /// 瀵硅薄绫�:ModelPirSensorSettion + /// </summary> + APir閰嶇疆 = 3, + /// <summary> + /// 瀵硅薄绫�:ModelCurtainDirectionAndLimite + /// </summary> + A绐楀笜鏂瑰悜鍙婇檺浣� = 8, + /// <summary> + /// 瀵硅薄绫�:ModelCurtainHandPullControl + /// </summary> + A绐楀笜鎵嬫媺鎺у埗 = 9, + /// <summary> + /// 瀵硅薄绫�:ModelAcModeSupport + /// </summary> + A绌鸿皟鑷畾涔夋ā寮� = 10, + /// <summary> + /// 瀵硅薄绫�:ModelPanelVibrationInfo + /// </summary> + A闈㈡澘闇囧姩鍔熻兘 = 11, + /// <summary> + /// 瀵硅薄绫�:ModelAcSwingModeSupport + /// </summary> + A绌鸿皟鎽嗛鍔熻兘 = 12, + /// <summary> + /// 瀵硅薄绫�:ModelDeviceBindData + /// </summary> + A璁惧缁戝畾鍒楄〃 = 14, + /// <summary> + /// 瀵硅薄绫�:ModelPanelBackLightInfo + /// </summary> + A闈㈡澘鑳屽厜鐏� = 15 + } + + /// <summary> + /// 鍙戦�佹ā鏉挎暟鎹殑鍖哄垎 + /// </summary> + public enum ModelDataSendEnum + { + A鏈畾涔� = -1, + A绉佹湁灞炴�� = 1, + A绉佹湁鍗忚 = 2, + A閫忎紶鏁版嵁 = 3 + } + + #endregion +} diff --git a/ZigbeeApp/Shared/Phone/TemplateData/TemplateDeviceDataLogic.cs b/ZigbeeApp/Shared/Phone/TemplateData/TemplateDeviceDataLogic.cs new file mode 100755 index 0000000..fbf9219 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/TemplateData/TemplateDeviceDataLogic.cs @@ -0,0 +1,890 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; + +namespace Shared.Phone.TemplateData +{ + /// <summary> + /// 璁惧妯℃澘鏁版嵁鐨勯�昏緫 + /// </summary> + public class TemplateDeviceDataLogic + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 璁惧妯℃澘鏁版嵁鐨勯�昏緫 + /// </summary> + private static TemplateDeviceDataLogic m_Current = null; + /// <summary> + /// 璁惧妯℃澘鏁版嵁鐨勯�昏緫 + /// </summary> + public static TemplateDeviceDataLogic Current + { + get + { + if (m_Current == null) + { + m_Current = new TemplateDeviceDataLogic(); + } + return m_Current; + } + } + + #endregion + + #region 鈻� 绐楀笜鎵嬫媺鎺у埗_______________________ + + /// <summary> + /// 娣诲姞绐楀笜鎵嬫媺鎺у埗缂撳瓨 + /// </summary> + /// <param name="device">璁惧瀵硅薄</param> + /// <param name="bolStatu">鎵嬫媺鎺у埗鐘舵��</param> + /// <param name="receiveResult">璁惧杩斿洖鐨勭粨鏋�</param> + public void SetCurtainHandPullControl(CommonDevice device, bool bolStatu, string receiveResult) + { + //鑾峰彇瀵硅薄 + var classData = new ModelCurtainHandPullControl(); + var memoryData = (ModelCurtainHandPullControl)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A绐楀笜鎵嬫媺鎺у埗, classData); + + memoryData.Statu = bolStatu; + memoryData.ListSendTopic[0] = "SetWritableValue"; + memoryData.ListReceiveTopic[0] = "SetWritableValue_Respon"; + memoryData.ListReceiveResult[0] = receiveResult; + //淇濆瓨鏁版嵁 + this.SaveDeviceMemmoryData(device); + } + + /// <summary> + /// 鑾峰彇绐楀笜鎵嬫媺鎺у埗鐘舵��(铏氭嫙浣跨敤) + /// </summary> + /// <param name="device"></param> + /// <returns></returns> + public bool GetCurtainHandPullControl(CommonDevice device) + { + //鑾峰彇瀵硅薄 + var classData = new ModelCurtainHandPullControl(); + var memoryData = (ModelCurtainHandPullControl)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A绐楀笜鎵嬫媺鎺у埗, classData); + + return memoryData.Statu; + } + + #endregion + + #region 鈻� 绐楀笜鏂瑰悜___________________________ + + /// <summary> + /// 璁剧疆绐楀笜鐨勬柟鍚� + /// </summary> + /// <param name="device"></param> + /// <param name="isDirectionReversed"></param> + /// <param name="receiveResult">璁惧杩斿洖鐨勭粨鏋�</param> + /// <returns></returns> + public CommonDevice.SetWritableValueResponAllData SetCurtainDirection(CommonDevice device, bool isDirectionReversed, string receiveResult) + { + //鑾峰彇瀵硅薄 + var classData = new ModelCurtainDirectionAndLimite(); + var memoryData = (ModelCurtainDirectionAndLimite)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A绐楀笜鏂瑰悜鍙婇檺浣�, classData); + + memoryData.Direction = isDirectionReversed; + memoryData.ListSendTopic[0] = "SetWritableValue"; + memoryData.ListReceiveTopic[0] = "SetWritableValue_Respon"; + memoryData.ListReceiveResult[0] = receiveResult; + //淇濆瓨鏁版嵁 + this.SaveDeviceMemmoryData(device); + + return new CommonDevice.SetWritableValueResponAllData { setWritableValueResponData = new CommonDevice.SetWritableValueResponData { Status = 0 } }; + } + + #endregion + + #region 鈻� 绐楀笜闄愪綅___________________________ + + /// <summary> + /// 鑾峰彇寮�鍚堝笜鐨勯檺浣� + /// </summary> + /// <param name="rollershade"></param> + /// <param name="upLimit"></param> + /// <param name="downLimit"></param> + /// <param name="curtainLength"></param> + /// <param name="receiveResult">璁惧杩斿洖鐨勭粨鏋�</param> + /// <returns></returns> + public bool SetCurtainLimitPoint(CommonDevice rollershade,int upLimit, int downLimit, int curtainLength, string receiveResult) + { + //鑾峰彇瀵硅薄 + var classData = new ModelCurtainDirectionAndLimite(); + var memoryData = (ModelCurtainDirectionAndLimite)this.GetDeviceModelDataClass(rollershade, ModelDeviceSaveEnum.A绐楀笜鏂瑰悜鍙婇檺浣�, classData); + memoryData.curtainLength = curtainLength; + memoryData.downLimit = downLimit; + memoryData.upLimit = upLimit; + + memoryData.ListSendTopic[0] = "SetWritableValue"; + memoryData.ListReceiveTopic[0] = "SetWritableValue_Respon"; + memoryData.ListReceiveResult[0] = receiveResult; + + return true; + } + + /// <summary> + /// 鑾峰彇寮�鍚堝笜鐨勯檺浣� + /// </summary> + /// <param name="rollershade"></param> + /// <returns></returns> + public ModelCurtainDirectionAndLimite GetCurtainLimitPoint(CommonDevice rollershade) + { + //鑾峰彇瀵硅薄 + var classData = new ModelCurtainDirectionAndLimite(); + var memoryData = (ModelCurtainDirectionAndLimite)this.GetDeviceModelDataClass(rollershade, ModelDeviceSaveEnum.A绐楀笜鏂瑰悜鍙婇檺浣�, classData); + + return memoryData; + } + + #endregion + + #region 鈻� 绌鸿皟鑷畾涔夋ā寮廮____________________ + + /// <summary> + /// 娣诲姞绌鸿皟鑷畾涔夋ā寮忕紦瀛� + /// </summary> + /// <param name="device">璁惧瀵硅薄</param> + /// <param name="data">鍊�</param> + /// <param name="receiveResult">璁惧杩斿洖鐨勭粨鏋�</param> + public void SetAcModeSupport(CommonDevice device, int data, string receiveResult) + { + //鑾峰彇瀵硅薄 + var classData = new ModelAcModeSupport(); + var memoryData = (ModelAcModeSupport)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A绌鸿皟鑷畾涔夋ā寮�, classData); + + memoryData.data = data; + memoryData.ListSendTopic[0] = "SetWritableValue"; + memoryData.ListReceiveTopic[0] = "SetWritableValue_Respon"; + memoryData.ListReceiveResult[0] = receiveResult; + //淇濆瓨鏁版嵁 + this.SaveDeviceMemmoryData(device); + } + + /// <summary> + /// 鑾峰彇绌鸿皟鑷畾涔夋ā寮�(铏氭嫙浣跨敤) + /// </summary> + /// <param name="device"></param> + /// <returns></returns> + public int GetAcModeSupport(CommonDevice device) + { + //鑾峰彇瀵硅薄 + var classData = new ModelAcModeSupport(); + var memoryData = (ModelAcModeSupport)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A绌鸿皟鑷畾涔夋ā寮�, classData); + + return memoryData.data; + } + + #endregion + + #region 鈻� 绌鸿皟鎽嗛妯″紡_______________________ + + /// <summary> + /// 娣诲姞绌鸿皟鎽嗛妯″紡缂撳瓨 + /// </summary> + /// <param name="device">璁惧瀵硅薄</param> + /// <param name="data">鍊�</param> + /// <param name="receiveResult">璁惧杩斿洖鐨勭粨鏋�</param> + public void SetAcSwingModeSupport(CommonDevice device, int data, string receiveResult) + { + //鑾峰彇瀵硅薄 + var classData = new ModelAcSwingModeSupport(); + var memoryData = (ModelAcSwingModeSupport)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A绌鸿皟鎽嗛鍔熻兘, classData); + + memoryData.data = data; + memoryData.ListSendTopic[0] = "SetWritableValue"; + memoryData.ListReceiveTopic[0] = "SetWritableValue_Respon"; + memoryData.ListReceiveResult[0] = receiveResult; + //淇濆瓨鏁版嵁 + this.SaveDeviceMemmoryData(device); + } + + /// <summary> + /// 鑾峰彇绌鸿皟鎽嗛妯″紡(铏氭嫙浣跨敤) + /// </summary> + /// <param name="device"></param> + /// <returns></returns> + public int GetAcSwingModeSupport(CommonDevice device) + { + //鑾峰彇瀵硅薄 + var classData = new ModelAcSwingModeSupport(); + var memoryData = (ModelAcSwingModeSupport)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A绌鸿皟鎽嗛鍔熻兘, classData); + + return memoryData.data; + } + + #endregion + + #region 鈻� 璁惧缁戝畾___________________________ + + /// <summary> + /// 鑾峰彇璁惧缁戝畾鍒楄〃鐨勭紦瀛� + /// </summary> + /// <param name="device">璁惧瀵硅薄</param> + /// <returns></returns> + public List<BindObj.BindListResponseObj> GetDeviceBindList(CommonDevice device) + { + //鑾峰彇瀵硅薄 + var classData = new ModelDeviceBindData(); + var memoryData = (ModelDeviceBindData)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A璁惧缁戝畾鍒楄〃, classData); + + return memoryData.BindList; + } + + /// <summary> + /// 娣诲姞璁惧缁戝畾鍒楄〃鐨勭紦瀛� + /// </summary> + /// <param name="addBindData"></param> + /// <param name="receiveResult">璁惧杩斿洖鐨勭粨鏋�</param> + /// <returns></returns> + public BindObj.AddedDeviceBindResponseAllData AddDeviceBindList(BindObj.AddBindData addBindData, string receiveResult) + { + var device = Common.LocalDevice.Current.GetDevice(addBindData.DeviceAddr, addBindData.Epoint); + //鑾峰彇瀵硅薄 + var classData = new ModelDeviceBindData(); + var memoryData = (ModelDeviceBindData)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A璁惧缁戝畾鍒楄〃, classData); + if (memoryData.ListReceiveResult.Count == 1) + { + //璁惧缁戝畾鏈変笁鏉″懡浠� 绗竴鏉′负娓呯┖ + memoryData.ListReceiveResult.Insert(0, "{" + SetDouMarks("Result") + ": 0," + SetDouMarks("ResultRemark") + ": " + SetDouMarks("Success") + " }"); + memoryData.ListReceiveTopic.Insert(0, "Bind/ClearBindInfo_Respon"); + memoryData.ListSendTopic.Insert(0, "Bind/ClearBindInfo"); + + memoryData.ListReceiveResult.Add(string.Empty); + memoryData.ListReceiveTopic.Add(string.Empty); + memoryData.ListSendTopic.Add(string.Empty); + } + memoryData.ListSendTopic[2] = "Bind/SetBind"; + memoryData.ListReceiveTopic[2] = "Bind/SetBind_Respon"; + memoryData.ListReceiveResult[2] = receiveResult; + + var reData = new BindObj.AddedDeviceBindResponseAllData(); + reData.addedDeviceBindResponseData = new BindObj.AddedDeviceBindResponseData(); + reData.addedDeviceBindResponseData.Result = 0; + + foreach (var data in addBindData.BindList) + { + bool canAdd = true; + for (int i = 0; i < memoryData.BindList.Count; i++) + { + var bindData = memoryData.BindList[i]; + //濡傛灉鏄澶� + if (bindData.BindType == 0 && data.BindType == 0 + && bindData.BindMacAddr == data.BindMacAddr + && bindData.BindEpoint == data.BindEpoint + && bindData.BindCluster == data.BindCluster) + { + //鍚屼竴涓笢瑗夸笉闇�瑕佹浛鎹� + canAdd = false; + reData.addedDeviceBindResponseData.BindList.Add(bindData); + break; + } + //濡傛灉鏄満鏅� + if (bindData.BindType == 2 && data.BindType == 1 + && bindData.BindScenesId == data.BindScenesId + && bindData.BindCluster == data.BindCluster) + { + //鍚屼竴涓笢瑗夸笉闇�瑕佹浛鎹� + canAdd = false; + reData.addedDeviceBindResponseData.BindList.Add(bindData); + break; + } + } + if (canAdd == true) + { + //娣诲姞鏂扮殑缂撳瓨 + var newData = new BindObj.BindListResponseObj(); + memoryData.BindList.Add(newData); + + newData.BindCluster = data.BindCluster; + newData.BindEpoint = data.BindEpoint; + newData.BindMacAddr = data.BindMacAddr; + newData.BindScenesId = data.BindScenesId; + newData.BindType = data.BindType == 0 ? 0 : 2; + reData.addedDeviceBindResponseData.BindList.Add(newData); + } + } + //淇濆瓨鏁版嵁 + this.SaveDeviceMemmoryData(device); + + return reData; + } + + /// <summary> + /// 鍒犻櫎璁惧缁戝畾鍒楄〃鐨勭紦瀛� + /// </summary> + /// <param name="delDeviceBindData"></param> + /// <returns></returns> + public BindObj.DelDeviceBindResponseAllData DeleteDeviceBindList(BindObj.DelDeviceBindData delDeviceBindData) + { + var device = Common.LocalDevice.Current.GetDevice(delDeviceBindData.DeviceAddr, delDeviceBindData.Epoint); + //鑾峰彇瀵硅薄 + var classData = new ModelDeviceBindData(); + var memoryData = (ModelDeviceBindData)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A璁惧缁戝畾鍒楄〃, classData); + + //杩斿洖鍊� + var reData = new BindObj.DelDeviceBindResponseAllData(); + reData.removeBindResultResponseData = new BindObj.RemoveBindResultResponseData(); + reData.removeBindResultResponseData.Result = 0; + + reData.delDeviceBindResponseData = new BindObj.DelDeviceBindResponseData(); + + foreach (var data in delDeviceBindData.RemoveBindList) + { + for (int i = 0; i < memoryData.BindList.Count; i++) + { + var bindData = memoryData.BindList[i]; + //濡傛灉鏄澶� + if (bindData.BindType == 0 && data.BindType == 0 + && bindData.BindMacAddr == data.BindMacAddr + && bindData.BindEpoint == data.BindEpoint + && bindData.BindCluster == data.BindCluster) + { + //绉婚櫎缂撳瓨 + memoryData.BindList.RemoveAt(i); + break; + } + //濡傛灉鏄満鏅� + if (bindData.BindType == 2 && data.BindType == 1 + && bindData.BindScenesId == data.BindScenesId + && bindData.BindCluster == data.BindCluster) + { + //绉婚櫎缂撳瓨 + memoryData.BindList.RemoveAt(i); + break; + } + } + var removeData = new BindObj.RemoveBindListResponseObj(); + reData.delDeviceBindResponseData.RemoveBindList.Add(removeData); + removeData.BindCluster = data.BindCluster; + removeData.BindEpoint = data.BindEpoint; + removeData.BindMacAddr = data.BindMacAddr; + removeData.BindScenesId = data.BindScenesId; + removeData.BindType = data.BindType == 0 ? 0 : 2; + removeData.Result = 0; + } + //淇濆瓨鏁版嵁 + this.SaveDeviceMemmoryData(device); + return reData; + } + + /// <summary> + /// 鍒犻櫎鎸囧畾璁惧鐨勫叏閮ㄧ粦瀹� + /// </summary> + /// <param name="device"></param> + /// <returns></returns> + public BindObj.ClearBindInfoResponseAllData ClearDeviceAllBind(CommonDevice device) + { + string mainkey = Common.LocalDevice.Current.GetDeviceMainKeys(device); + if (TemplateCommonLogic.Current.modelData.dicDeviceTemplateData.ContainsKey(mainkey) == true) + { + //绉婚櫎鍏ㄩ儴鐨� 璁惧缁戝畾鍒楄〃 鏁版嵁 + var listBind = TemplateCommonLogic.Current.modelData.dicDeviceTemplateData[mainkey]; + for (int i = 0; i < listBind.Count; i++) + { + if (listBind[i].DataSaveDiv == ModelDeviceSaveEnum.A璁惧缁戝畾鍒楄〃) + { + ((ModelDeviceBindData)listBind[i]).BindList.Clear(); + } + } + } + this.SaveDeviceMemmoryData(device); + + return new BindObj.ClearBindInfoResponseAllData + { + clearBindInfoResponseData = new BindObj.ClearBindInfoResponseData { Result = 0 } + }; + } + + /// <summary> + /// 閰嶇疆鎸夐敭鐨勫姛鑳芥ā寮� + /// </summary> + /// <param name="device"></param> + /// <param name="value"></param> + /// <param name="clusterID"></param> + /// <param name="receiveResult">璁惧杩斿洖鐨勭粨鏋�</param> + /// <returns></returns> + public CommonDevice.SetWritableValueResponAllData ConfigurePanelKeyModel(CommonDevice device, Panel.KeyMode value, int clusterID, string receiveResult) + { + //鑾峰彇瀵硅薄 + var classData = new ModelDeviceBindData(); + var memoryData = (ModelDeviceBindData)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A璁惧缁戝畾鍒楄〃, classData); + memoryData.keyMode = value; + memoryData.keyModeClusterID = clusterID; + + if (memoryData.ListReceiveResult.Count == 1) + { + if (memoryData.ListReceiveResult.Count == 1) + { + //璁惧缁戝畾鏈変笁鏉″懡浠� 绗竴鏉′负娓呯┖ + memoryData.ListReceiveResult.Insert(0, "{" + SetDouMarks("Result") + ": 0," + SetDouMarks("ResultRemark") + ": " + SetDouMarks("Success") + " }"); + memoryData.ListReceiveTopic.Insert(0, "Bind/ClearBindInfo_Respon"); + memoryData.ListSendTopic.Insert(0, "Bind/ClearBindInfo"); + + memoryData.ListReceiveResult.Add(string.Empty); + memoryData.ListReceiveTopic.Add(string.Empty); + memoryData.ListSendTopic.Add(string.Empty); + } + } + memoryData.ListSendTopic[1] = "SetWritableValue"; + memoryData.ListReceiveTopic[1] = "SetWritableValue_Respon"; + memoryData.ListReceiveResult[1] = receiveResult; + + this.SaveDeviceMemmoryData(device); + + return new CommonDevice.SetWritableValueResponAllData + { + setWritableValueResponData = new CommonDevice.SetWritableValueResponData { Status = 0 } + }; + } + + /// <summary> + /// 鑾峰彇鎸夐敭鐨勫姛鑳芥ā寮� + /// </summary> + /// <param name="device"></param> + /// <returns></returns> + public Panel.PanelConfigureInfoResponAllData ReadPanelConfigureKeyModel(CommonDevice device) + { + var classData = new ModelDeviceBindData(); + var memoryData = (ModelDeviceBindData)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A璁惧缁戝畾鍒楄〃, classData); + + var data = new Panel.PanelConfigureInfoResponAllData(); + data.deviceStatusReportData = new CommonDevice.DeviceStatusReportData { CluterID = memoryData.keyModeClusterID }; + + var dataAttri = new CommonDevice.AttributeDataObj(); + dataAttri.AttriButeData = (int)memoryData.keyMode; + data.deviceStatusReportData.AttriBute.Add(dataAttri); + + return data; + } + + #endregion + + #region 鈻� Pir浼犳劅鍣╛_________________________ + + /// <summary> + /// 鑾峰彇Pir浼犳劅鍣ㄧ殑閰嶇疆 + /// </summary> + /// <param name="device"></param> + /// <returns></returns> + public IASZone.ParamatesInfo GetPirSensorLightSettion(CommonDevice device) + { + //鑾峰彇瀵硅薄 + var classData = new ModelPirSensorSettion(); + var memoryData = (ModelPirSensorSettion)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.APir閰嶇疆, classData); + + var localData = new IASZone.ParamatesInfo(); + localData.configureParamates = new IASZone.ConfigureParamates(); + localData.configureParamates.controlDevEnable = memoryData.pirConfigure.controlDevEnable; + localData.configureParamates.dimmerLevel = memoryData.pirConfigure.dimmerLevel; + localData.configureParamates.dimmerOffTime = memoryData.pirConfigure.dimmerOffTime; + localData.configureParamates.dimmerOnTime = memoryData.pirConfigure.dimmerOnTime; + localData.configureParamates.iasReportPeriod = memoryData.pirConfigure.iasReportPeriod; + localData.configureParamates.levelEnable = memoryData.pirConfigure.levelEnable; + localData.configureParamates.levelSize = memoryData.pirConfigure.levelSize; + localData.configureParamates.mode = memoryData.pirConfigure.mode; + localData.configureParamates.transitionTime = memoryData.pirConfigure.transitionTime; + localData.configureParamates.type = memoryData.pirConfigure.type; + + return localData; + } + + /// <summary> + /// 璁剧疆Pir浼犳劅鍣ㄧ殑閰嶇疆 + /// </summary> + /// <param name="device"></param> + /// <param name="configureParamates"></param> + /// <param name="receiveResult">璁惧杩斿洖鐨勭粨鏋�</param> + /// <returns></returns> + public IASZone.ResponseAllData SetPirSensorLightSettion(CommonDevice device, IASZone.ConfigureParamates configureParamates, string receiveResult) + { + //鑾峰彇瀵硅薄 + var classData = new ModelPirSensorSettion(); + var memoryData = (ModelPirSensorSettion)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.APir閰嶇疆, classData); + + memoryData.pirConfigure = configureParamates; + + memoryData.ListSendTopic[0] = "ClientDataPassthrough"; + memoryData.ListReceiveTopic[0] = "ZbDataPassthrough"; + memoryData.ListReceiveResult[0] = receiveResult; + + this.SaveDeviceMemmoryData(device); + + return new CommonDevice.ResponseAllData { responseData = new CommonDevice.ResponseData { status = 0 } }; + } + + #endregion + + #region 鈻� 闈㈡澘闇囧姩鍔熻兘_______________________ + + /// <summary> + /// 鑾峰彇闈㈡澘闇囧姩鍔熻兘 + /// </summary> + /// <param name="device"></param> + /// <returns></returns> + public UserCenter.HdlDevicePanelLogic.PanelVibrationInfo GetPanelVibrationInfo(CommonDevice device) + { + //鑾峰彇瀵硅薄 + var classData = new ModelPanelVibrationInfo(); + var memoryData = (ModelPanelVibrationInfo)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A闈㈡澘闇囧姩鍔熻兘, classData); + + var data = new UserCenter.HdlDevicePanelLogic.PanelVibrationInfo(); + data.A闇囧姩浣胯兘 = memoryData.vibrationInfo.A闇囧姩浣胯兘; + data.A闇囧姩寮哄害 = memoryData.vibrationInfo.A闇囧姩寮哄害; + data.A闇囧姩鏃堕棿 = memoryData.vibrationInfo.A闇囧姩鏃堕棿; + + return data; + } + + /// <summary> + /// 璁剧疆闈㈡澘闇囧姩鍔熻兘 + /// </summary> + /// <param name="device"></param> + /// <param name="datainfo"></param> + /// <param name="receiveResult">璁惧杩斿洖鐨勭粨鏋�</param> + /// <returns></returns> + public bool SetPanelVibrationInfo(CommonDevice device, UserCenter.HdlDevicePanelLogic.PanelVibrationInfo datainfo, string receiveResult) + { + //鑾峰彇瀵硅薄 + var classData = new ModelPanelVibrationInfo(); + var memoryData = (ModelPanelVibrationInfo)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A闈㈡澘闇囧姩鍔熻兘, classData); + memoryData.vibrationInfo = datainfo; + + memoryData.ListSendTopic[0] = "ClientDataPassthrough"; + memoryData.ListReceiveTopic[0] = "ZbDataPassthrough"; + memoryData.ListReceiveResult[0] = receiveResult; + + this.SaveDeviceMemmoryData(device); + + return true; + } + #endregion + + #region 鈻� 璁惧鍚嶇О___________________________ + + /// <summary> + /// 淇敼璁惧Mac鍚嶇О + /// </summary> + /// <param name="device"></param> + /// <param name="macName"></param> + /// <returns></returns> + public CommonDevice.RenameDeviceMacNameAllData ReDeviceMacName(CommonDevice device, string macName) + { + //鑾峰彇瀵硅薄 + var classData = new ModelDeviceMacNameInfo(); + var memoryData = (ModelDeviceMacNameInfo)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A璁惧鍚嶇О, classData); + memoryData.deviceMacName = macName; + + //璁惧杩斿洖鐨勭粨鏋� + var receiveResult = "{" + + SetDouMarks("DeviceAddr") + ": " + SetDouMarks(device.DeviceAddr) + "," + + SetDouMarks("Data_ID") + ": 100," + + SetDouMarks("Data") + ": {" + + SetDouMarks("Result") + ": 0," + + SetDouMarks("MacName") + ":" + macName+ "}" + + "}"; + + memoryData.ListSendTopic[0] = "MacRename"; + memoryData.ListReceiveTopic[0] = "MacRename_Respon"; + memoryData.ListReceiveResult[0] = receiveResult; + + this.SaveDeviceMemmoryData(device); + + return new CommonDevice.RenameDeviceMacNameAllData + { + renameDeviceMacNameData = new CommonDevice.RenameDeviceMacNameData + { + Result = 0, + MacName = macName + } + }; + } + + /// <summary> + /// 淇敼璁惧绔偣鍚嶇О + /// </summary> + /// <param name="device"></param> + /// <param name="macName"></param> + /// <returns></returns> + public CommonDevice.DeviceRenameAllData ReDeviceEpointName(CommonDevice device, string deviceName) + { + //鑾峰彇瀵硅薄 + var classData = new ModelDeviceEpointNameInfo(); + var memoryData = (ModelDeviceEpointNameInfo)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A绔偣鍚嶇О, classData); + memoryData.deviceEpointName = deviceName; + + //璁惧杩斿洖鐨勭粨鏋� + var receiveResult = "{" + + SetDouMarks("Device_ID") + ": 2," + + SetDouMarks("DeviceAddr") + ": " + SetDouMarks(device.DeviceAddr) + "," + + SetDouMarks("Epoint") + ": " + device.DeviceEpoint + "," + + SetDouMarks("Data_ID") + ": 96," + + SetDouMarks("Data") + ": {" + + SetDouMarks("Result") + ": 0," + + SetDouMarks("DeviceName") + ":" + deviceName + "}" + + "}"; + + memoryData.ListSendTopic[0] = "DeviceRename"; + memoryData.ListReceiveTopic[0] = "DeviceRenameRespon"; + memoryData.ListReceiveResult[0] = receiveResult; + + this.SaveDeviceMemmoryData(device); + + return new CommonDevice.DeviceRenameAllData + { + deviceRenameData = new CommonDevice.DeviceRenameResponseData + { + Result = 0, + DeviceName = deviceName + } + }; + } + + #endregion + + #region 鈻� 闈㈡澘鑳屽厜鐏缃甠____________________ + + /// <summary> + /// 鑾峰彇璁惧浜害閰嶇疆锛坲i鍙寒搴﹁皟鑺�,浣跨敤杩斿洖鍊肩殑panelDirectionsLevel锛� + /// </summary> + /// <param name="device"></param> + /// <returns></returns> + public Panel.PanelSwitchLevelInfo GetDeviceLightSettion(CommonDevice device) + { + //鑾峰彇瀵硅薄 + var classData = new ModelPanelBackLightInfo(); + var memoryData = (ModelPanelBackLightInfo)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A闈㈡澘鑳屽厜鐏�, classData); + + var data = new Panel.PanelSwitchLevelInfo(); + data.panelBacklightLevel = memoryData.linghtLevelInfo.panelBacklightLevel == -1 ? 0 : memoryData.linghtLevelInfo.panelBacklightLevel; + data.panelDirectionsLevel = memoryData.linghtLevelInfo.panelDirectionsLevel == -1 ? 0 : memoryData.linghtLevelInfo.panelDirectionsLevel; + return data; + } + + /// <summary> + /// 璁剧疆璁惧浜害锛坲i鍙寒搴﹁皟鑺傦級 + /// </summary> + /// <param name="panel">璁惧瀵硅薄</param> + /// <param name="directionsLevel">0-100(杩欎釜鏄偣鍑诲悗鐨勫��)</param> + /// <param name="backlightLevel">0-100(杩欎釜鏄偣鍑诲墠鐨勫��)</param> + /// <param name="receiveResult">璁惧杩斿洖鐨勭粨鏋�</param> + /// <returns></returns> + public bool SetDeviceLightSettion(CommonDevice device, int directionsLevel, int backlightLevel, string receiveResult) + { + //鑾峰彇瀵硅薄 + var classData = new ModelPanelBackLightInfo(); + var memoryData = (ModelPanelBackLightInfo)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A闈㈡澘鑳屽厜鐏�, classData); + memoryData.linghtLevelInfo.panelBacklightLevel = backlightLevel; + memoryData.linghtLevelInfo.panelDirectionsLevel = directionsLevel; + //鑳屽厜鐏湁涓変釜涓滆タ + if (memoryData.ListSendTopic.Count == 1) + { + memoryData.ListSendTopic.Add(string.Empty); + memoryData.ListSendTopic.Add(string.Empty); + + memoryData.ListReceiveTopic.Add(string.Empty); + memoryData.ListReceiveTopic.Add(string.Empty); + + memoryData.ListReceiveResult.Add(string.Empty); + memoryData.ListReceiveResult.Add(string.Empty); + } + memoryData.ListSendTopic[0] = "ClientDataPassthrough"; + memoryData.ListReceiveTopic[0] = "ZbDataPassthrough"; + memoryData.ListReceiveResult[0] = receiveResult; + + this.SaveDeviceMemmoryData(device); + + return true; + } + + /// <summary> + /// 鑾峰彇璁惧鑺傝兘妯″紡鐨勯厤缃姸鎬�(ui鍙妭鑳芥ā寮�) + /// </summary> + /// <param name="device"></param> + /// <returns></returns> + public Panel.PanelSaveEnergyModeInfo GetDeviceEnergyConservationMode(CommonDevice device) + { + //鑾峰彇瀵硅薄 + var classData = new ModelPanelBackLightInfo(); + var memoryData = (ModelPanelBackLightInfo)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A闈㈡澘鑳屽厜鐏�, classData); + + var data = new Panel.PanelSaveEnergyModeInfo(); + data.enable = memoryData.energyModeInfo.enable; + data.level = memoryData.energyModeInfo.level == -1 ? 0 : memoryData.energyModeInfo.level; + data.time = memoryData.energyModeInfo.time == -1 ? 0 : memoryData.energyModeInfo.time; + return data; + } + + /// <summary> + /// 璁剧疆璁惧鐨勮妭鑳芥ā寮�(ui鍙妭鑳芥ā寮�) + /// </summary> + /// <param name="device">璁惧瀵硅薄</param> + /// <param name="modeEnable">鑺傝兘妯″紡鏄惁鏈夋晥</param> + /// <param name="modeTime">鏃犳搷浣滆繘鍏ヨ妭鑳芥ā寮忔椂闂� 0-255</param> + /// <param name="level">鑺傝兘妯″紡浜害:0-100</param> + /// <param name="receiveResult">璁惧杩斿洖鐨勭粨鏋�</param> + /// <returns></returns> + public bool SetDeviceEnergyConservationMode(CommonDevice device, bool modeEnable, int modeTime, int level,string receiveResult) + { + //鑾峰彇瀵硅薄 + var classData = new ModelPanelBackLightInfo(); + var memoryData = (ModelPanelBackLightInfo)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A闈㈡澘鑳屽厜鐏�, classData); + memoryData.energyModeInfo.enable = modeEnable; + memoryData.energyModeInfo.time = modeTime; + memoryData.energyModeInfo.level = level; + + //鑳屽厜鐏湁涓変釜涓滆タ + if (memoryData.ListSendTopic.Count == 1) + { + memoryData.ListSendTopic.Add(string.Empty); + memoryData.ListSendTopic.Add(string.Empty); + + memoryData.ListReceiveTopic.Add(string.Empty); + memoryData.ListReceiveTopic.Add(string.Empty); + + memoryData.ListReceiveResult.Add(string.Empty); + memoryData.ListReceiveResult.Add(string.Empty); + } + memoryData.ListSendTopic[1] = "ClientDataPassthrough"; + memoryData.ListReceiveTopic[1] = "ZbDataPassthrough"; + memoryData.ListReceiveResult[1] = receiveResult; + + this.SaveDeviceMemmoryData(device); + + return true; + } + + /// <summary> + /// 鑾峰彇鎸夐敭鎸囩ず鐏紑鍏抽鑹�. + /// </summary> + /// <param name="device"></param> + /// <param name="keyNum"></param> + /// <returns></returns> + public Panel.KeyColorDataResponseAllData GetPanelColorInfo(CommonDevice device, Panel.KeyNum keyNum) + { + //鑾峰彇瀵硅薄 + var classData = new ModelPanelBackLightInfo(); + var memoryData = (ModelPanelBackLightInfo)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A闈㈡澘鑳屽厜鐏�, classData); + + var data = new Panel.KeyColorDataResponseAllData(); + data.keyColorData = new Panel.KeyColorData(); + data.keyColorData.CloseColorB = string.IsNullOrEmpty(memoryData.keyColorData.CloseColorB) == true ? "0" : memoryData.keyColorData.CloseColorB; + data.keyColorData.CloseColorG = string.IsNullOrEmpty(memoryData.keyColorData.CloseColorG) == true ? "0" : memoryData.keyColorData.CloseColorG; + data.keyColorData.CloseColorR = string.IsNullOrEmpty(memoryData.keyColorData.CloseColorR) == true ? "0" : memoryData.keyColorData.CloseColorR; + data.keyColorData.OpenColorB = string.IsNullOrEmpty(memoryData.keyColorData.OpenColorB) == true ? "0" : memoryData.keyColorData.OpenColorB; + data.keyColorData.OpenColorG = string.IsNullOrEmpty(memoryData.keyColorData.OpenColorG) == true ? "0" : memoryData.keyColorData.OpenColorG; + data.keyColorData.OpenColorR = string.IsNullOrEmpty(memoryData.keyColorData.OpenColorR) == true ? "0" : memoryData.keyColorData.OpenColorR; + data.keyColorData.keyNum = keyNum; + + return data; + } + + /// <summary> + /// 閰嶇疆鎸夐敭鎸囩ず鐏鑹� + /// </summary> + /// <param name="device"></param> + /// <param name="keyColorData"></param> + /// <param name="keyNumStatus"></param> + /// <param name="receiveResult">璁惧杩斿洖鐨勭粨鏋�</param> + /// <returns></returns> + public CommonDevice.ResponseAllData SetPanelColorInfo(CommonDevice device, Panel.KeyColorData keyColorData, Panel.KeyNumStatus keyNumStatus, string receiveResult) + { + //鑾峰彇瀵硅薄 + var classData = new ModelPanelBackLightInfo(); + var memoryData = (ModelPanelBackLightInfo)this.GetDeviceModelDataClass(device, ModelDeviceSaveEnum.A闈㈡澘鑳屽厜鐏�, classData); + + memoryData.keyColorData.keyNum = keyColorData.keyNum; + memoryData.keyColorData.OpenColorB = keyColorData.OpenColorB; + memoryData.keyColorData.OpenColorG = keyColorData.OpenColorG; + memoryData.keyColorData.OpenColorR = keyColorData.OpenColorR; + memoryData.keyColorData.CloseColorB = keyColorData.CloseColorB; + memoryData.keyColorData.CloseColorG = keyColorData.CloseColorG; + memoryData.keyColorData.CloseColorR = keyColorData.CloseColorR; + + memoryData.KeyNum.Key1 = keyNumStatus.Key1; + memoryData.KeyNum.Key2 = keyNumStatus.Key2; + memoryData.KeyNum.Key3 = keyNumStatus.Key3; + memoryData.KeyNum.Key4 = keyNumStatus.Key4; + memoryData.KeyNum.Key5 = keyNumStatus.Key5; + memoryData.KeyNum.Key6 = keyNumStatus.Key6; + memoryData.KeyNum.Key7 = keyNumStatus.Key7; + memoryData.KeyNum.Key8 = keyNumStatus.Key8; + memoryData.KeyNum.Key9 = keyNumStatus.Key9; + memoryData.KeyNum.Key10 = keyNumStatus.Key10; + memoryData.KeyNum.Key11 = keyNumStatus.Key11; + memoryData.KeyNum.Key12 = keyNumStatus.Key12; + memoryData.KeyNum.Key13 = keyNumStatus.Key13; + memoryData.KeyNum.Key14 = keyNumStatus.Key14; + memoryData.KeyNum.Key15 = keyNumStatus.Key15; + memoryData.KeyNum.Key16 = keyNumStatus.Key16; + + //鑳屽厜鐏湁涓変釜涓滆タ + if (memoryData.ListSendTopic.Count == 1) + { + memoryData.ListSendTopic.Add(string.Empty); + memoryData.ListSendTopic.Add(string.Empty); + + memoryData.ListReceiveTopic.Add(string.Empty); + memoryData.ListReceiveTopic.Add(string.Empty); + + memoryData.ListReceiveResult.Add(string.Empty); + memoryData.ListReceiveResult.Add(string.Empty); + } + memoryData.ListSendTopic[2] = "ClientDataPassthrough"; + memoryData.ListReceiveTopic[2] = "ZbDataPassthrough"; + memoryData.ListReceiveResult[2] = receiveResult; + + this.SaveDeviceMemmoryData(device); + + return new CommonDevice.ResponseAllData + { + responseData = new CommonDevice.ResponseData + { status = 0 } + }; + } + + #endregion + + #region 鈻� 淇濆瓨璁惧缂撳瓨_______________________ + + /// <summary> + /// 淇濆瓨璁惧缂撳瓨 + /// </summary> + /// <param name="device">璁惧瀵硅薄</param> + public void SaveDeviceMemmoryData(CommonDevice device) + { + //浠g爜绉诲姩鍒板埆鐨勬枃浠朵腑浜� + TemplateCommonLogic.Current.SaveDeviceMemmoryData(device); + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + /// <summary> + /// 鑾峰彇璁惧淇濆瓨鐨勬ā鏉垮璞� + /// </summary> + /// <param name="device"></param> + /// <param name="saveEnum"></param> + /// <returns></returns> + private TemplateDeviceDataCommon GetDeviceModelDataClass(CommonDevice device, ModelDeviceSaveEnum saveEnum, TemplateDeviceDataCommon newClass) + { + //浠g爜绉诲姩鍒板埆鐨勬枃浠朵腑浜� + return TemplateCommonLogic.Current.GetDeviceModelDataClass(device, saveEnum, newClass); + } + + /// <summary> + /// 娣诲姞鍙屽紩鍙� + /// </summary> + /// <param name="i_text"></param> + /// <returns></returns> + private string SetDouMarks(string i_text) + { + return UserCenter.UserCenterResourse.douMarks + i_text + UserCenter.UserCenterResourse.douMarks; + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs index c0e1669..fa84e94 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/IMessageCommon.cs @@ -676,7 +676,7 @@ //鍦ㄥ唽鐨凪sg return Language.StringByID(dicMsg[requestName][statuCode]); } - return "Error:" + statuCode; + return null; } } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs index e99ab65..a6bd03a 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs @@ -1400,13 +1400,17 @@ /// </summary> public int ErrorMsgDiv = 1; /// <summary> - /// 鎺ユ敹鐨勬暟鎹� + /// 鎺ユ敹鐨凞ata鏁版嵁 /// </summary> public string ReceiptData = null; /// <summary> /// 鎺ユ敹鐨勬暟鎹�(澶氫釜杩斿洖涓婚涓撶敤) /// </summary> public string[] listReceiptData = null; + /// <summary> + /// 杩欎釜鏄綉鍏冲洖澶嶇殑鏁翠釜json鏁版嵁,涓暟涓巐istReceiptData涓�鑷� + /// </summary> + public string[] JsonData = null; } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs index 6d11849..c4572c8 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs @@ -16,13 +16,27 @@ /// </summary> private NormalViewControl btnLineTemp = null; /// <summary> - /// 鑱斿姩搴曠嚎(鍊艰緭鍏ヤ箣鍚�,绾跨殑棰滆壊浼氬彉) + /// 鑱斿姩搴曠嚎(鍏夋爣杩涙潵涔嬪悗,绾跨殑棰滆壊浼氬彉) /// </summary> public NormalViewControl btnLine { set { this.btnLineTemp = value; + } + } + /// <summary> + /// 鑱斿姩澶栨 + /// </summary> + private NormalFrameLayout frameBorder = null; + /// <summary> + /// 鑱斿姩澶栨(鍏夋爣杩涙潵涔嬪悗,澶栨鐨勯鑹蹭細鍙�) + /// </summary> + public NormalFrameLayout FrameBorder + { + set + { + this.frameBorder = value; } } @@ -177,6 +191,10 @@ { btnLineTemp.BackgroundColor = UserCenterColor.Current.ButtomLine; } + if (frameBorder != null) + { + frameBorder.BorderColor = 0xffcccccc; + } if (m_UseFocusColor == true) { //鐏拌壊瀛椾綋 @@ -189,6 +207,10 @@ { btnLineTemp.BackgroundColor = UserCenterColor.Current.TextFrameSelectColor; } + if (frameBorder != null) + { + frameBorder.BorderColor = UserCenterColor.Current.TextFrameSelectColor; + } if (m_UseFocusColor == true) { //姝e父瀛椾綋 diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs index fffeefb..e396d32 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs @@ -244,6 +244,14 @@ string fullDir = string.Empty; if (upPath == string.Empty) { + //灏嗘ā鏉挎暟鎹繚瀛樺埌鍒版寚瀹氱殑鏂囦欢澶逛腑 + var templateName = TemplateData.TemplateCommonLogic.Current.GetNewTemplateFileName(); + var templateFile = TemplateData.TemplateCommonLogic.Current.SaveTemplateDataToFile(templateName, "HomeTemplate"); + + //灏嗘ā鏉縝in鏂囦欢绉诲姩鍒板浠芥枃浠跺す涓� + try { System.IO.File.Move(templateFile, System.IO.Path.Combine(Config.Instance.FullPath, templateName)); } + catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex, "绉诲姩妯℃澘澶辫触"); } + //鑾峰彇鏈湴鏂囦欢 listAllFile = HdlFileLogic.Current.GetRootPathListFile(); fullDir = Common.Config.Instance.FullPath; @@ -265,6 +273,11 @@ foreach (string fileName in listAllFile) { + //鍒ゆ柇鎸囧畾鏂囦欢鏄惁闇�瑕佷笂浼�(鏍圭洰褰曠殑鎵嶅垽鏂�) + if (upPath == string.Empty && this.IsNotUpLoadFile(fileName) == true) + { + continue; + } if (fileName.EndsWith(".png") == true || fileName.EndsWith(".bin") == true) { @@ -302,11 +315,6 @@ Shared.Common.CommonPage.BackKeyCanClick = true; UserCenterResourse.AccountOption.AppCanSignout = true; return false; - } - //鍒ゆ柇鏄惁鏄簲璇ヤ笂浼犵殑鏂囦欢 - if (IsNotUpLoadFile(file) == true && upPath == string.Empty) - { - continue; } //鏁寸悊鏁版嵁 var datainfo = new FileInfoData(); @@ -784,8 +792,15 @@ //鍏抽棴杩涘害鏉� ProgressFormBar.Current.Close(); + //娓呯┖鍏ㄩ儴鎴块棿 + HdlRoomLogic.Current.DeleteAllRoom(); + //娓呯┖鏈湴鍏ㄩ儴鐨勫満鏅暟鎹� + HdlSceneLogic.Current.DeleteAllLocalScene(); //濡傛灉璇诲彇鍒扮殑鏂囦欢瀹屽叏娌℃湁闂锛屽垯娓呯悊鏈湴鐨勬枃浠� HdlFileLogic.Current.DeleteAllLocationFile(false); + + //娓呯悊鏈湴鐨勬ā鏉挎枃浠� + TemplateData.TemplateCommonLogic.Current.DeleteAllLocalFile(); //娌℃湁閿欒鐨勮瘽锛屽垯绉诲姩鍒板綋鍓嶄綇瀹呮枃浠跺す涓嬮潰 HdlFileLogic.Current.MoveDirectoryFileToHomeDirectory(tempDirectory, true); @@ -829,11 +844,14 @@ /// </summary> /// <param name="file"></param> /// <returns></returns> - public bool IsNotUpLoadFile(string file) + private bool IsNotUpLoadFile(string file) { - if (file == "Config.json") + if (file.StartsWith("Device_") == true + || file.StartsWith("Gateway_") == true + || file.StartsWith("Room_") == true + || file.StartsWith("Scene_") == true) { - //涓嶈兘瑕嗙洊Config鏂囦欢 + //璁惧,缃戝叧,鎴块棿,鍦烘櫙鏂囦欢涓嶉渶瑕佷笂浼�,瀹冨凡缁忎繚瀛樺湪bin妯℃澘鏂囦欢涓� return true; } return false; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs index 27d0ccd..2193c34 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAirConditionerLogic.cs @@ -125,7 +125,7 @@ if (Common.Config.Instance.Home.IsVirtually == true) { //鐩存帴娣诲姞缂撳瓨 - ModelData.DeviceModelDataLogic.Current.SetAcModeSupport(device, data, "SetWritableValue"); + TemplateData.TemplateDeviceDataLogic.Current.SetAcModeSupport(device, data, null); return true; } //鍙戦�佹暟鎹� @@ -155,6 +155,9 @@ return false; } + //娣诲姞缂撳瓨 + TemplateData.TemplateDeviceDataLogic.Current.SetAcModeSupport(device, data, result.JsonData[0]); + return true; } @@ -174,7 +177,7 @@ if (Common.Config.Instance.Home.IsVirtually == true) { //鐩存帴娣诲姞缂撳瓨 - ModelData.DeviceModelDataLogic.Current.SetAcSwingModeSupport(device, data, "SetWritableValue"); + TemplateData.TemplateDeviceDataLogic.Current.SetAcSwingModeSupport(device, data, null); return true; } //鍙戦�佹暟鎹� @@ -204,6 +207,9 @@ return false; } + //娣诲姞缂撳瓨 + TemplateData.TemplateDeviceDataLogic.Current.SetAcSwingModeSupport(device, data, result.JsonData[0]); + return true; } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs index 24b9780..f5ac6ec 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceBindLogic.cs @@ -76,7 +76,7 @@ //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - var listBind = ModelData.DeviceModelDataLogic.Current.GetDeviceBindList(device, "Bind/GetDeviceBind"); + var listBind = TemplateData.TemplateDeviceDataLogic.Current.GetDeviceBindList(device); return new BindObj.GetDeviceBindResponseAllData() { getAllBindResponseData = new BindObj.GetDeviceBindResponseData @@ -177,7 +177,7 @@ //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.AddDeviceBindList(addBindData, "Bind/GetDeviceBind"); + return TemplateData.TemplateDeviceDataLogic.Current.AddDeviceBindList(addBindData, null); } var device = Common.LocalDevice.Current.GetDevice(addBindData.DeviceAddr, addBindData.Epoint); @@ -191,7 +191,7 @@ } //淇敼缂撳瓨 - ModelData.DeviceModelDataLogic.Current.AddDeviceBindList(addBindData, "Bind/GetDeviceBind"); + TemplateData.TemplateDeviceDataLogic.Current.AddDeviceBindList(addBindData, result.JsonData[0]); var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<BindObj.AddedDeviceBindResponseData>(result.ReceiptData); return new BindObj.AddedDeviceBindResponseAllData() { addedDeviceBindResponseData = tempData }; @@ -420,7 +420,7 @@ //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.DeleteDeviceBindList(delDeviceBindData); + return TemplateData.TemplateDeviceDataLogic.Current.DeleteDeviceBindList(delDeviceBindData); } var device = Common.LocalDevice.Current.GetDevice(delDeviceBindData.DeviceAddr, delDeviceBindData.Epoint); //鑾峰彇闇�瑕佸彂閫佺殑鏁版嵁 @@ -447,7 +447,7 @@ } //淇敼缂撳瓨 - ModelData.DeviceModelDataLogic.Current.DeleteDeviceBindList(delDeviceBindData); + TemplateData.TemplateDeviceDataLogic.Current.DeleteDeviceBindList(delDeviceBindData); return responseData; } @@ -460,7 +460,7 @@ //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.ClearDeviceAllBind(device); + return TemplateData.TemplateDeviceDataLogic.Current.ClearDeviceAllBind(device); } var jObject = new JObject { { "DeviceAddr", device.DeviceAddr }, { "Epoint", device.DeviceEpoint }, { "Cluster_ID", 0 }, { "Command", 5006 } }; @@ -472,7 +472,7 @@ } //淇敼缂撳瓨 - ModelData.DeviceModelDataLogic.Current.ClearDeviceAllBind(device); + TemplateData.TemplateDeviceDataLogic.Current.ClearDeviceAllBind(device); var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<BindObj.ClearBindInfoResponseData>(result.ReceiptData); return new BindObj.ClearBindInfoResponseAllData { clearBindInfoResponseData = tempData }; @@ -660,7 +660,7 @@ //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.ConfigurePanelKeyModel(device, value, clusterID, "SetWritableValue"); + return TemplateData.TemplateDeviceDataLogic.Current.ConfigurePanelKeyModel(device, value, clusterID, null); } //鑾峰彇鍙戦�佹暟鎹� var sendData = this.GetConfigureHdlKeyCommandText(device.DeviceAddr, device.DeviceEpoint, value, clusterID); @@ -671,7 +671,7 @@ } //淇敼缂撳瓨 - ModelData.DeviceModelDataLogic.Current.ConfigurePanelKeyModel(device, value, clusterID, "SetWritableValue"); + TemplateData.TemplateDeviceDataLogic.Current.ConfigurePanelKeyModel(device, value, clusterID, result.JsonData[0]); var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.SetWritableValueResponData>(result.ReceiptData); return new CommonDevice.SetWritableValueResponAllData { setWritableValueResponData = tempData }; @@ -685,7 +685,7 @@ //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.ReadPanelConfigureKeyModel(device); + return TemplateData.TemplateDeviceDataLogic.Current.ReadPanelConfigureKeyModel(device); } var JObject = new JObject {{ "DeviceAddr",device.DeviceAddr },{ "Epoint", device.DeviceEpoint }, diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs index 02d698c..e92d774 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCommonLogic.cs @@ -67,6 +67,8 @@ { var reResult = new ReceiptGatewayResult(); reResult.listReceiptData = new string[listReceiptTopic.Count]; + reResult.JsonData = new string[listReceiptTopic.Count]; + var myGateway = device.Gateway; if (myGateway == null) { @@ -120,6 +122,12 @@ return; } reResult.listReceiptData[i] = jobject["Data"].ToString(); + if (jobject.Property("Time") != null) + { + //闇�瑕佺Щ闄ime杩欎釜瀛楁 + jobject.Remove("Time"); + } + reResult.JsonData[i] = jobject.ToString(); receiptCount++; } } @@ -151,7 +159,6 @@ { //濡傛灉鍙湁涓�涓富棰�,鍒欐浛鎹㈠彉閲� reResult.ReceiptData = reResult.listReceiptData[0]; - reResult.listReceiptData = null; } } @@ -242,6 +249,13 @@ if (command == receiptCommand) { reResult.ReceiptData = responseData.PassData; + reResult.JsonData = new string[1]; + if (jobject.Property("Time") != null) + { + //闇�瑕佺Щ闄ime杩欎釜瀛楁 + jobject.Remove("Time"); + } + reResult.JsonData[0] = jobject.ToString(); } } }; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCurtainLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCurtainLogic.cs index 8a29182..a3af533 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCurtainLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceCurtainLogic.cs @@ -1,6 +1,6 @@ 锘縰sing Newtonsoft.Json; using Newtonsoft.Json.Linq; -using Shared.Phone.ModelData; +using Shared.Phone.TemplateData; using System; using System.Collections.Generic; using System.Text; @@ -51,7 +51,7 @@ if (Common.Config.Instance.Home.IsVirtually == true) { //娣诲姞缂撳瓨 - DeviceModelDataLogic.Current.SetCurtainHandPullControl(device, bolStatu, "SetWritableValue"); + TemplateDeviceDataLogic.Current.SetCurtainHandPullControl(device, bolStatu, null); return true; } //鑾峰彇鍙戦�佺殑鍛戒护瀛楃 @@ -81,6 +81,9 @@ this.ShowTipMsg(msg); return false; } + //娣诲姞缂撳瓨 + TemplateDeviceDataLogic.Current.SetCurtainHandPullControl(device, bolStatu, result.JsonData[0]); + return true; } @@ -150,7 +153,7 @@ //濡傛灉褰撳墠鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.SetCurtainDirection(device, isDirectionReversed, "SetWritableValue"); + return TemplateDeviceDataLogic.Current.SetCurtainDirection(device, isDirectionReversed, null); } //鑾峰彇缂栬緫绐楀笜鏂瑰悜鐨勫懡浠ゅ瓧绗� var sendData = this.GetCurtainDirectionCommadText(device.DeviceAddr, device.DeviceEpoint, isDirectionReversed); @@ -159,6 +162,9 @@ { return null; } + + //娣诲姞缂撳瓨 + TemplateDeviceDataLogic.Current.SetCurtainDirection(device, isDirectionReversed, result.JsonData[0]); var tempData = JsonConvert.DeserializeObject<CommonDevice.SetWritableValueResponData>(result.ReceiptData); return new CommonDevice.SetWritableValueResponAllData { setWritableValueResponData = tempData }; @@ -199,7 +205,7 @@ //濡傛灉褰撳墠鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.SetCurtainLimitPoint(rollershade, upLimit, downLimit, curtainLength, "SetWritableValue"); + return TemplateData.TemplateDeviceDataLogic.Current.SetCurtainLimitPoint(rollershade, upLimit, downLimit, curtainLength, null); } //鑾峰彇缂栬緫寮�鍚堝笜闄愪綅鐨勫懡浠ゅ瓧绗� var sendData = this.GetAutoOpenCurtainLimitPointCommandText(rollershade.DeviceAddr, rollershade.DeviceEpoint, upLimit, downLimit); @@ -222,6 +228,9 @@ return false; } + //娣诲姞缂撳瓨 + TemplateDeviceDataLogic.Current.SetCurtainLimitPoint(rollershade, upLimit, downLimit, curtainLength, result.JsonData[0]); + return true; } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs index ff85b85..20fa781 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceOtherLogic.cs @@ -313,7 +313,7 @@ //鐑熼浘 if (ias.iASInfo?.Alarm1 == 1) { - return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Alarm); + return Language.StringByID(R.MyInternationalizationString.uSmogAlarm); } return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Safe); } @@ -322,9 +322,9 @@ //pir if (ias.iASInfo?.Alarm1 == 1) { - return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Alarm); + return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_HavePerson); } - return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Safe); + return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_NoPerson); } else if (info.ConcreteType == DeviceConcreteType.Sensor_Keyfob) { @@ -340,9 +340,9 @@ //杩愬姩浼犳劅鍣� if (ias.iASInfo?.Alarm1 == 1) { - return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Alarm); + return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_HavePerson); } - return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_Normal); + return Language.StringByID(R.MyInternationalizationString.IASZone_Statu_NoPerson); } else if (info.ConcreteType == DeviceConcreteType.Sensor_EmergencyButton) { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs index d1eddb8..603dce4 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs @@ -118,7 +118,7 @@ //濡傛灉褰撳墠鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.GetPanelColorInfo(device, keyNum); + return TemplateData.TemplateDeviceDataLogic.Current.GetPanelColorInfo(device, keyNum); } //鍙戦�佹暟鎹� keyNum杞负16杩涘埗 鑼冨洿锛�01~10 var passData = "0504040101" + Convert.ToString((int)keyNum, 16).ToUpper().PadLeft(2, '0'); @@ -215,7 +215,7 @@ //濡傛灉褰撳墠鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.SetPanelColorInfo(device, keyColorData, keyNumStatus, "ZbDataPassthrough"); + return TemplateData.TemplateDeviceDataLogic.Current.SetPanelColorInfo(device, keyColorData, keyNumStatus, null); } //鑾峰彇閰嶇疆鎸夐敭鎸囩ず鐏鑹茬殑鍛戒护瀛楃 var sendData = this.GetPanelColorCommandText(device.DeviceAddr, keyColorData, keyNumStatus); @@ -228,6 +228,10 @@ var tempD = new CommonDevice.ResponseData(); tempD.command = data[12].ToString() + data[13].ToString() + data[10].ToString() + data[11].ToString(); tempD.status = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16); + + //娣诲姞缂撳瓨 + TemplateData.TemplateDeviceDataLogic.Current.SetPanelColorInfo(device, keyColorData, keyNumStatus, result.JsonData[0]); + return new CommonDevice.ResponseAllData { responseData = tempD }; } @@ -386,7 +390,7 @@ //濡傛灉褰撳墠鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.GetDeviceLightSettion(device); + return TemplateData.TemplateDeviceDataLogic.Current.GetDeviceLightSettion(device); } //鑾峰彇鍙戦�佺殑鍛戒护瀛楃 var passData = "050604010101"; @@ -422,7 +426,7 @@ //濡傛灉褰撳墠鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.SetDeviceLightSettion(device, directionsLevel, backlightLevel, "ZbDataPassthrough"); + return TemplateData.TemplateDeviceDataLogic.Current.SetDeviceLightSettion(device, directionsLevel, backlightLevel, null); } //鑾峰彇淇敼闈㈡澘鐨勪寒搴﹁皟鑺傜殑鍛戒护瀛楃 var sendData = this.GetPanelLevelCommadText(device.DeviceAddr, directionsLevel, backlightLevel); @@ -456,7 +460,7 @@ } //淇敼缂撳瓨 - ModelData.DeviceModelDataLogic.Current.SetDeviceLightSettion(device, directionsLevel, backlightLevel, "ZbDataPassthrough"); + TemplateData.TemplateDeviceDataLogic.Current.SetDeviceLightSettion(device, directionsLevel, backlightLevel, result.JsonData[0]); return true; } @@ -611,7 +615,7 @@ //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.GetDeviceEnergyConservationMode(device); + return TemplateData.TemplateDeviceDataLogic.Current.GetDeviceEnergyConservationMode(device); } //鍙戦�佸懡浠� string passData = "050804010101"; @@ -677,7 +681,7 @@ //濡傛灉褰撳墠鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.SetDeviceEnergyConservationMode(device, modeEnable, modeTime, level, "ZbDataPassthrough"); + return TemplateData.TemplateDeviceDataLogic.Current.SetDeviceEnergyConservationMode(device, modeEnable, modeTime, level, null); } //鑾峰彇璁剧疆璁惧鐨勮妭鑳芥ā寮忕殑鍛戒护瀛楃 var sendData = this.GetDeviceEnergyConservationModeCommandText(device.DeviceAddr, modeEnable, modeTime, level); @@ -707,7 +711,7 @@ } //淇敼缂撳瓨 - ModelData.DeviceModelDataLogic.Current.SetDeviceEnergyConservationMode(device, modeEnable, modeTime, level, "ZbDataPassthrough"); + TemplateData.TemplateDeviceDataLogic.Current.SetDeviceEnergyConservationMode(device, modeEnable, modeTime, level, result.JsonData[0]); return true; } @@ -1048,7 +1052,7 @@ //濡傛灉鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.GetPanelVibrationInfo(device); + return TemplateData.TemplateDeviceDataLogic.Current.GetPanelVibrationInfo(device); } //鍙戦�佹暟鎹� var jObject = new Newtonsoft.Json.Linq.JObject { { "DeviceAddr", device.DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } }; @@ -1083,7 +1087,7 @@ //濡傛灉鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.SetPanelVibrationInfo(device, datainfo, "ClientDataPassthrough"); + return TemplateData.TemplateDeviceDataLogic.Current.SetPanelVibrationInfo(device, datainfo, null); } //鑾峰彇缂栬緫闈㈡澘闇囧姩鍔熻兘鐨勫懡浠ゅ瓧绗� var sendData = this.GetPanelVibrationCommandText(device.DeviceAddr, datainfo); @@ -1096,6 +1100,9 @@ this.ShowTipMsg(errorMsg); return false; } + //娣诲姞缂撳瓨 + TemplateData.TemplateDeviceDataLogic.Current.SetPanelVibrationInfo(device, datainfo, result.JsonData[0]); + return true; } @@ -1258,7 +1265,6 @@ private void LoadDryContactFunctionFromLocaltion() { this.dicDryContactFunction = new Dictionary<string, DryContactFunctionInfo>(); - byte[] filebyte = HdlFileLogic.Current.ReadFileByteContent(DirNameResourse.DryContactFunctionFile); if (filebyte == null) { diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePirSensorLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePirSensorLogic.cs index ab171e6..81552d6 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePirSensorLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePirSensorLogic.cs @@ -133,7 +133,7 @@ //濡傛灉褰撳墠浣忓畢鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.GetPirSensorLightSettion(device); + return TemplateData.TemplateDeviceDataLogic.Current.GetPirSensorLightSettion(device); } var sendData = this.GetPirSensorParamateCommadText(device.DeviceAddr); var result = HdlDeviceCommonLogic.Current.SendJobjectDataToGateway2(device, sendData, "0302", 34, 9); @@ -225,7 +225,7 @@ //濡傛灉鏄櫄鎷熶綇瀹� if (Common.Config.Instance.Home.IsVirtually == true) { - return ModelData.DeviceModelDataLogic.Current.SetPirSensorLightSettion(device, configureParamates, "ClientDataPassthrough"); + return TemplateData.TemplateDeviceDataLogic.Current.SetPirSensorLightSettion(device, configureParamates, null); } //鍙戦�佹暟鎹� var sendData = this.GetPirSensorSettionCommandText(device.DeviceAddr, configureParamates); @@ -238,6 +238,9 @@ var tempD = new IASZone.ResponseData(); tempD.command = data[12].ToString() + data[13].ToString() + data[10].ToString() + data[11].ToString(); tempD.status = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16); + + //娣诲姞缂撳瓨 + TemplateData.TemplateDeviceDataLogic.Current.SetPirSensorLightSettion(device, configureParamates, result.JsonData[0]); return new CommonDevice.ResponseAllData { responseData = tempD }; } @@ -258,10 +261,10 @@ return jObject.ToString(); } - /// <summary> - /// 鑾峰彇淇敼PIR浼犳劅鍣ㄩ厤缃殑鍛戒护瀛楃 - /// </summary> - private string GetPIRSensorSettionPassData(IASZone.ConfigureParamates configureParamates) + /// <summary> + /// 鑾峰彇淇敼PIR浼犳劅鍣ㄩ厤缃殑鍛戒护瀛楃 + /// </summary> + private string GetPIRSensorSettionPassData(IASZone.ConfigureParamates configureParamates) { string data = ""; string dataLength = "10"; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFileLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFileLogic.cs index 640cb70..db14cc1 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFileLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFileLogic.cs @@ -60,6 +60,10 @@ //LOG鍑哄姏銆愭枃浠跺す銆� this.CreateDirectory(DirNameResourse.LogDirectory); + //妯℃澘缂撳瓨瀛樻斁鐨勩�愭枃浠跺す銆� + this.CreateDirectory(DirNameResourse.LocalTemplateDirectory); + this.CreateDirectory(DirNameResourse.AllResidenceTemplateDirectory); + //鐢ㄦ埛鍥剧墖鐩綍璺緞銆愭枃浠跺す銆� if (UserCenterResourse.AccountOption.UserPictruePath != string.Empty) { @@ -276,6 +280,12 @@ var rootPath = Common.Config.Instance.FullPath; foreach (var file in listFile) { + if (file.StartsWith("ModelData_") == true) + { + //澶嶅埗妯℃澘鏁版嵁鏂囦欢鍒版寚瀹氭枃浠跺す + TemplateData.TemplateCommonLogic.Current.CopyTemplateFileToLocalDirectory2(System.IO.Path.Combine(fulldirectory, file)); + continue; + } string oldFile = System.IO.Path.Combine(fulldirectory, file); string newFile = System.IO.Path.Combine(rootPath, file); //绉诲姩鏂囦欢 diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs index 8be19e6..2bdb33a 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlFirmwareUpdateLogic.cs @@ -1,6 +1,7 @@ 锘縰sing System; using System.Collections.Generic; using System.Text; +using ZigBee.Device; namespace Shared.Phone.UserCenter { @@ -310,6 +311,45 @@ #endregion + #region 鈻� 鑾峰彇鎸囧畾鍥轰欢鐗堟湰淇℃伅_______________ + + /// <summary> + /// 鑾峰彇鎸囧畾鍥轰欢鐨勭増鏈俊鎭�(濡傛灉杩斿洖Null,鍒欒〃绀烘病鏈夎繖涓浐浠�) + /// </summary> + /// <param name="levelType">鍥轰欢闃剁骇鍒嗙被</param> + /// <param name="HardwareVersion">纭欢鐗堟湰</param> + /// <param name="imgType">闀滃儚绫诲瀷</param> + /// <param name="nowVersion">鐜板湪鐨勭増鏈�</param> + /// <returns></returns> + public static FirmwareVersionInfo GetFirmwareVersionInfo(FirmwareLevelType levelType, string HardwareVersion, string imgType, int nowVersion) + { + //闀滃儚绫诲瀷 + var listdata = GetFirmwareVersionListInfo(levelType, HardwareVersion, imgType); + foreach (var verInfo in listdata) + { + if (verInfo.Name.EndsWith(".bin") == true) + { + //瀹冧笉鏄崌绾у浐浠�, .bin鏄壒娈婄殑 + continue; + } + int testVersion = Convert.ToInt32(verInfo.FirmwareVersion.ToString().PadLeft(6, '0').Substring(2, 2)); + if (testVersion % 2 != 0) + { + //涓棿閭d釜byte涓哄鏁版椂锛屼唬琛ㄦ槸娴嬭瘯鐗堟湰,鍦ㄦ樉绀烘渶鏂扮増鏈椂,涓嶉渶瑕佹樉绀猴紝浣嗘槸鍦ㄥ巻鍙茬増鏈偅閲屽彲浠ユ樉绀� + //涓棿閭d釜byte涓哄伓鏁版椂,浠h〃鏄寮忕増鏈� + continue; + } + + if (verInfo.FirmwareVersion == nowVersion) + { + return verInfo; + } + } + return null; ; + } + + #endregion + #region 鈻� 鍥轰欢瀛樺湪妫�娴媉______________________ /// <summary> @@ -339,6 +379,262 @@ return true; } + /// <summary> + /// 妫�娴嬭Ota璁惧鐨勫崌绾у浐浠舵槸鍚﹀瓨鍦� + /// </summary> + /// <param name="device">璁惧瀵硅薄</param> + /// <returns></returns> + public static bool IsEsixtDeviceFirmwareFile(OTADevice device) + { + var fileFullName = GetDeviceFirmwareFile(device); + return System.IO.File.Exists(fileFullName); + } + + /// <summary> + /// 鑾峰彇ota鎸囧畾鐨勫崌绾у浐浠跺悕瀛�(鍏ㄨ矾寰�) + /// </summary> + /// <param name="device">璁惧瀵硅薄</param> + /// <returns></returns> + public static string GetDeviceFirmwareFile(OTADevice device) + { + //纭欢鐗堟湰_闀滃儚ID_鍥轰欢鐗堟湰 + string fileName = device.HwVersion + "_" + device.ImgTypeId + "_" + device.ImgVersion; + return System.IO.Path.Combine(DirNameResourse.FirmwareUpdateDirectory, "Device_" + fileName + ".ota"); + } + + /// <summary> + /// 鑾峰彇缃戝叧Linux鐨勫崌绾у浐浠跺悕瀛�(鍏ㄨ矾寰�) + /// </summary> + /// <param name="zbGateway">缃戝叧瀵硅薄</param> + /// <returns></returns> + public static string GetGatewayLinuxFirmwareFile(ZbGateway zbGateway) + { + string fileName = zbGateway.LinuxHardVersion + "_" + zbGateway.LinuxImageType + "_" + zbGateway.LinuxFirmwareVersion; + return System.IO.Path.Combine(DirNameResourse.FirmwareUpdateDirectory, "Linux_" + fileName + ".ota"); + } + + /// <summary> + /// 鑾峰彇缃戝叧鍗忚皟鍣ㄧ殑鍗囩骇鍥轰欢鍚嶅瓧(鍏ㄨ矾寰�) + /// </summary> + /// <param name="zbGateway">缃戝叧瀵硅薄</param> + /// <returns></returns> + public static string GetGatewayCoordinatorFirmwareFile(ZbGateway zbGateway) + { + string fileName = zbGateway.CoordinatorHardVersion + "_" + zbGateway.CoordinatorImageId + "_" + zbGateway.CoordinatorFirmwareVersion; + return System.IO.Path.Combine(DirNameResourse.FirmwareUpdateDirectory, "Coordinator_" + fileName + ".ota"); + } + + /// <summary> + /// 鑾峰彇缃戝叧铏氭嫙椹卞姩鐨勫崌绾у浐浠跺悕瀛�(鍏ㄨ矾寰�) + /// </summary> + /// <param name="codeObj">铏氭嫙椹卞姩鏁版嵁</param> + /// <returns></returns> + public static string GetGatewayDriveCodeFirmwareFile(ZbGatewayData.DriveCodeObj codeObj) + { + string fileName = codeObj.DriveHwVersion + "_" + codeObj.DriveImageType + "_" + codeObj.DriveFwVersion; + return System.IO.Path.Combine(DirNameResourse.FirmwareUpdateDirectory, "DriveCode_" + fileName + ".ota"); + } + + #endregion + + #region 鈻� 涓嬭浇妯℃澘鍥轰欢_______________________ + + /// <summary> + /// 涓嬭浇妯℃澘涓綉鍏冲拰璁惧鐨勫浐浠� + /// </summary> + /// <param name="fullFileName"></param> + /// <param name="i_Msg"></param> + public static int DownLoadTemplateDeviceFirmware(string fullFileName, string i_Msg) + { + //浠庢ā鏉垮綋涓幏鍙栬澶囧拰缃戝叧瀵硅薄 + var listTempDevice = new List<OTADevice>(); + var listTempGateway = new List<ZbGateway>(); + TemplateData.TemplateCommonLogic.Current.GetDeviceObjectFromTemplate(fullFileName, ref listTempDevice, ref listTempGateway); + + //鑾峰彇闇�瑕佷笅杞界殑鍥轰欢鏁版嵁 + var listVersion = GetNeedToDownLoadVersionData(listTempDevice, listTempGateway); + if (listVersion.Count == 0) + { + return 0; + } + //鎵撳紑杩涘害鏉� + ProgressFormBar.Current.Start(); + ProgressFormBar.Current.SetMsg(i_Msg); + ProgressFormBar.Current.SetValue(0, 1); + + System.Threading.Thread.Sleep(1000); + + var dicFirmwareName = new Dictionary<string, string>(); + var fileData = HdlFileLogic.Current.ReadFileTextContent(DirNameResourse.FirmwareUpdateList); + if (fileData != null) + { + //鏈湴瀛樻斁鐨勫浐浠跺師鏉ョ殑鍚嶅瓧(鍥犱负璁惧鍗囩骇鏃�,瀹冮渶瑕佽瘑鍒枃浠跺悕瀛楅噷闈㈠寘鍚殑鐗规畩瀛楃) + //key:纭欢鐗堟湰_闀滃儚ID_鍥轰欢鐗堟湰 value:鍥轰欢鍘熸潵鐨勫悕瀛� + dicFirmwareName = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, string>>(fileData); + } + + //鍥轰欢瀛樺偍璺緞 + string firmwareDir = DirNameResourse.FirmwareUpdateDirectory; + int nowCount = 0; + foreach (var versionData in listVersion) + { + nowCount++; + //鑾峰彇鍗囩骇鍥轰欢淇℃伅 + var result = AddFirmwareVersionInfo(versionData.levelType, versionData.HwVersion, versionData.ImageType); + if (result == -1) + { + ProgressFormBar.Current.Close(); + return -1; + } + //鑾峰彇褰撳墠杩欎釜鐗堟湰鐨勫浐浠朵俊鎭� + var versionFirmware = GetFirmwareVersionInfo(versionData.levelType, versionData.HwVersion, versionData.ImageType, versionData.FirmwareVersion); + if (versionFirmware == null) + { + //浜戠娌℃湁杩欎釜鐗堟湰 杩涘害鍊� + ProgressFormBar.Current.SetValue(nowCount, listVersion.Count); + continue; + } + //鍘讳笅杞借繖涓浐浠� + var pra = new { RequestVersion = Common.CommonPage.RequestVersion, DistributedMark = versionFirmware.DistributedMark }; + var byteData = UserCenterLogic.GetByteResponseDataByRequestHttps("FirmwareMana/DownloadPlatformUploadFirmware", false, pra, null, true); + if (byteData == null) + { + ProgressFormBar.Current.Close(); + return -1; + } + //淇濆瓨鍥轰欢 + var saveFile = System.IO.Path.Combine(firmwareDir, versionData.FileDiv + versionData.HwVersion + "_" + versionData.ImageType + "_" + versionData.FirmwareVersion + ".ota"); + HdlFileLogic.Current.SaveTextToFile(saveFile, Encoding.UTF8.GetString(byteData)); + dicFirmwareName[saveFile] = versionFirmware.Name; + + //杩涘害鍊� + ProgressFormBar.Current.SetValue(nowCount, listVersion.Count); + } + //淇濆瓨鍒楄〃鍚嶅瓧 + HdlFileLogic.Current.SaveFileContent(DirNameResourse.FirmwareUpdateList, dicFirmwareName); + ProgressFormBar.Current.Close(); + + return 1; + } + + /// <summary> + /// 鑾峰彇闇�瑕佷笅杞界殑鍥轰欢鏁版嵁 + /// </summary> + /// <param name="listDevice">璁惧鍒楄〃</param> + /// <param name="listGateway">缃戝叧鍒楄〃</param> + /// <returns></returns> + private static List<TemplateDeviceVersion> GetNeedToDownLoadVersionData(List<OTADevice> listDevice, List<ZbGateway> listGateway) + { + //瀛樺偍璺緞 + string firmwareDir = DirNameResourse.FirmwareUpdateDirectory; + HdlFileLogic.Current.CreateDirectory(firmwareDir); + + var listVersion = new List<TemplateDeviceVersion>(); + var listCheck = new HashSet<string>(); + foreach (var device in listDevice) + { + //璁惧鐨勫崌绾у浐浠跺悕瀛� + var fileFullName = GetDeviceFirmwareFile(device); + if (System.IO.File.Exists(fileFullName) == false && listCheck.Contains(fileFullName) == false) + { + listCheck.Add(fileFullName); + //璁惧 + listVersion.Add(new TemplateDeviceVersion + { + FileDiv = "Device_", + levelType = FirmwareLevelType.ZigbeeDevice, + HwVersion = device.HwVersion.ToString(), + ImageType = device.ImgTypeId.ToString(), + FirmwareVersion = device.ImgVersion + }); + } + } + foreach (var gateway in listGateway) + { + //Linux鐨勫崌绾у浐浠跺悕瀛� + var fileFullName = GetGatewayLinuxFirmwareFile(gateway); + if (System.IO.File.Exists(fileFullName) == false && listCheck.Contains(fileFullName) == false) + { + listCheck.Add(fileFullName); + //Linux + listVersion.Add(new TemplateDeviceVersion + { + FileDiv = "Linux_", + levelType = FirmwareLevelType.Linux, + HwVersion = gateway.LinuxHardVersion.ToString(), + ImageType = gateway.LinuxImageType.ToString(), + FirmwareVersion = gateway.LinuxFirmwareVersion + }); + } + //鍗忚皟鍣ㄧ殑鍗囩骇鍥轰欢鍚嶅瓧 + fileFullName = GetGatewayCoordinatorFirmwareFile(gateway); + if (System.IO.File.Exists(fileFullName) == false && listCheck.Contains(fileFullName) == false) + { + listCheck.Add(fileFullName); + //鍗忚皟鍣� + listVersion.Add(new TemplateDeviceVersion + { + FileDiv = "Coordinator_", + levelType = FirmwareLevelType.Coordinator, + HwVersion = gateway.CoordinatorHardVersion.ToString(), + ImageType = gateway.CoordinatorImageId.ToString(), + FirmwareVersion = gateway.CoordinatorFirmwareVersion + }); + } + //杩欎釜缃戝叧闇�瑕佹湁铏氭嫙椹卞姩杩欎釜涓滆タ鎵嶈 + if (gateway.LinuxImageType != 6) + { + //铏氭嫙椹卞姩鍙� + foreach (var data in gateway.DriveCodeList) + { + //铏氭嫙椹卞姩鍙风殑鍗囩骇鍥轰欢鍚嶅瓧 + fileFullName = GetGatewayDriveCodeFirmwareFile(data); + if (System.IO.File.Exists(fileFullName) == false && listCheck.Contains(fileFullName) == false) + { + listCheck.Add(fileFullName); + //铏氭嫙椹卞姩鍙� + listVersion.Add(new TemplateDeviceVersion + { + FileDiv = "DriveCode_", + levelType = FirmwareLevelType.VirtualDevice, + HwVersion = data.DriveHwVersion.ToString(), + ImageType = data.DriveImageType.ToString(), + FirmwareVersion = data.DriveFwVersion + }); + } + } + } + } + return listVersion; + } + + /// <summary> + /// 妯℃澘璁惧鐨勭増鏈俊鎭� + /// </summary> + private class TemplateDeviceVersion + { + /// <summary> + /// 鏂囦欢鍖哄垎 + /// </summary> + public string FileDiv = string.Empty; + /// <summary> + /// 鍥轰欢闃剁骇鍖哄垎 + /// </summary> + public FirmwareLevelType levelType; + /// <summary> + /// 纭欢鐗堟湰 + /// </summary> + public string HwVersion = string.Empty; + /// <summary> + /// 闀滃儚ID + /// </summary> + public string ImageType = string.Empty; + /// <summary> + /// 鍥轰欢鐗堟湰 + /// </summary> + public int FirmwareVersion = 0; + } + #endregion #region 鈻� 涓�鑸柟娉昣__________________________ diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs index bb9ce8a..605bbc4 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs @@ -660,6 +660,11 @@ return false; } } + //鍒锋柊鍏ㄩ儴鍦烘櫙 + if (this.IsMainGateway(realWay) == 1) + { + HdlSceneLogic.Current.RefreshSceneUIList(false); + } //鑾峰彇鍏ㄩ儴璁惧 int result = LocalDevice.Current.SetDeviceToMemmoryByGateway(realWay, false); @@ -1538,6 +1543,11 @@ /// <returns></returns> public List<FirmwareVersionInfo> GetGatewayAllNewVersion(ZbGateway zbGateway, ShowErrorMode mode = ShowErrorMode.YES) { + //濡傛灉鏄睍绀烘ā鏉�,鎴栬�呮槸铏氭嫙浣忓畢鐨勮瘽,娌℃湁浠�涔堟柊鐗堟湰鐨勮娉� + if (Common.Config.Instance.Home.IsVirtually == true || Common.Config.Instance.Home.IsShowTemplate == true) + { + return new List<FirmwareVersionInfo> { null, null, null }; + } //鑾峰彇缃戝叧鐗堟湰淇℃伅 var result = this.GetGatewayInfo(zbGateway, false, mode); if (result == null) @@ -1623,6 +1633,13 @@ /// <returns></returns> public List<ZbGatewayData.DriveCodeObj> GetListVDDriveCode(ZbGateway zbGateway) { + //濡傛灉鏄睍绀烘ā鏉�,鎴栬�呮槸铏氭嫙浣忓畢鐨勮瘽,鐩存帴鍙栫紦瀛� + if (Common.Config.Instance.Home.IsVirtually == true || Common.Config.Instance.Home.IsShowTemplate == true) + { + //鍙栨湰鍦板璞� + var localgw = this.GetLocalGateway(zbGateway.GwId); + return localgw != null ? zbGateway.DriveCodeList : zbGateway.DriveCodeList; + } var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 505 } }; var result = this.SendJobjectDataToGateway(zbGateway, "VirtualDrive/CatDriveCode", jObject.ToString(), "VirtualDrive/CatDriveCode_Respon"); if (result.ErrorMsg != null) @@ -1891,6 +1908,11 @@ } return false; } + if (((decimal)Longitude) == 0 && ((decimal)Latitude) == 0) + { + //娌℃湁閰嶇疆杩囩粡绾害 + return true; + } int result = -1; Action<string, string> action = (topic, message) => diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs index 117fe8c..ea1c159 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs @@ -288,7 +288,8 @@ { if (attData.AttributeId == 0) { - ((ColorTemperatureLight)locadevice).IsBuzzerRing = attData.AttriButeData == 1 ? true : false; + //杩欎釜鏄姤璀︽寔缁椂闂�(澶т簬2绉掓椂,鏍囪涓鸿繕鍦ㄥ搷鐫�) + ((ColorTemperatureLight)locadevice).IsBuzzerRing = attData.AttriButeData > 2 ? true : false; } } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs index 38c531b..c3269e3 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs @@ -298,7 +298,6 @@ Common.LocalDevice.Current.DeleteRealDeviceByRoomId(roomId); if (refreshLeftView == true) { - //HdlAutoBackupLogic.DeleteFile(roomFilePath); //鍒锋柊鎴块棿瑙嗗浘鍒楄〃 this.RefreshRoomListView(); } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs index 0917329..05702e2 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSafeguardLogic.cs @@ -231,6 +231,9 @@ zoneInfo.ZoneId = allData.ZoneId; zoneInfo.ZoneName = allData.ZoneName; + //淇℃伅鎺ㄩ�� + zoneInfo.InformationPush = allData.IsDisablePushMessage; + //澶勭悊璁惧 foreach (var data2 in allData.DeviceList) { @@ -285,9 +288,6 @@ zoneInfo.dicAlarmDevice.Clear(); zoneInfo.dicScenes.Clear(); - - //淇℃伅鎺ㄩ�� - zoneInfo.InformationPush = resData.IsDisablePushMessage; foreach (var data in resData.Actions) { @@ -1737,10 +1737,6 @@ /// <returns>0:鎺ㄩ�� 1:涓嶆帹閫�</returns> public int GetGarrisonInformationPushStatu(int zoneId) { - if (zoneId > 3) - { - zoneId = 3; - } if (this.dicAllZoneInfo.ContainsKey(zoneId) == false) { return 1; @@ -2335,7 +2331,7 @@ /// </summary> public string ZoneName; /// <summary> - /// 淇℃伅鎺ㄩ�� 0:鎺ㄩ�� 1:涓嶆帹閫� (鍙湁闃插尯ID:1,2,3鎵嶄細鏈夈��4,5鐨勯兘褰掍负3,鍥犱负瀹冩槸浠ラ槻鍖烘ā寮廔D(ActionType)涓哄崟浣嶇殑) + /// 淇℃伅鎺ㄩ�� 0:鎺ㄩ�� 1:涓嶆帹閫� /// </summary> public int InformationPush = 1; /// <summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs index d087a84..3b90c1d 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs @@ -178,7 +178,11 @@ if (topic == gatewayID + "/" + "Scene/GetAllInfo_Respon") { var sceneGetAllInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<Scene.GetSceneAllInfo>(jobject["Data"].ToString()); - listScene.Add(sceneGetAllInfo); + if (sceneGetAllInfo.ScenesSum != 0) + { + //濡傛灉缃戝叧閲岄潰娌℃湁鍦烘櫙鐨勮瘽,瀹冧篃浼氭帹杩欎釜涓滆タ杩囨潵 + listScene.Add(sceneGetAllInfo); + } //鏇村鎺ユ敹寰楀埌鍦烘櫙 canReceve = true; @@ -359,12 +363,15 @@ /// <summary> /// 鑾峰彇娣诲姞鎵ц鐩爣鍒板満鏅殑鍛戒护 /// </summary> - /// <param name="sceneId"></param> - /// <param name="listAdjustTarget"></param> + /// <param name="sceneId">鍦烘櫙id</param> + /// <param name="listAdjustTarget">鎵ц鐩爣</param> + /// <param name="dicChangedMac">浜ゆ崲mac key:listAdjustTarget褰撳墠鐨凪ac value:杞崲鐨刴ac</param> + /// <param name="sceneName">鍦烘櫙鍚嶇О(鐗规畩鐢ㄩ��,璇峰嬁璁剧疆)</param> /// <returns></returns> - public List<string> GetAddTargetToSceneCommand(int sceneId, List<Scene.DeviceListData> listAdjustTarget) + public List<string> GetAddTargetToSceneCommand(int sceneId, List<Scene.DeviceListData> listAdjustTarget, Dictionary<string, string> dicChangedMac = null, string sceneName = null) { var listCommand = new List<string>(); + int index = 1; for (int i = 0; i < listAdjustTarget.Count; i++) { var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 820 } }; @@ -372,6 +379,17 @@ //璁惧 if (data.Type == 0) { + string deviceAddr = data.DeviceAddr; + if (dicChangedMac != null) + { + //濡傛灉涓嶅寘鍚�,鍒欎笉浣滀负澶勭悊瀵硅薄 + if (dicChangedMac.ContainsKey(deviceAddr) == false) + { + continue; + } + deviceAddr = dicChangedMac[deviceAddr]; + } + var taskList = new Newtonsoft.Json.Linq.JArray { }; foreach (var taskInfo in data.TaskList) { @@ -379,25 +397,38 @@ { "Data1", taskInfo.Data1},{ "Data2",taskInfo.Data2}}; taskList.Add(tInfo); } - var data2 = new Newtonsoft.Json.Linq.JObject {{ "ScenesId",sceneId},{ "Type", 0} ,{ "DeviceAddr",data.DeviceAddr} , - { "Epoint", data.Epoint} ,{ "TaskList", taskList },{ "DelayTime", 0} ,{ "MemberNumber",i + 1}}; + var data2 = new Newtonsoft.Json.Linq.JObject {{ "ScenesId",sceneId},{ "Type", 0} ,{ "DeviceAddr",deviceAddr} , + { "Epoint", data.Epoint} ,{ "TaskList", taskList },{ "DelayTime", 0} ,{ "MemberNumber",index}}; + if (sceneName != null) + { + data2.Add(new Newtonsoft.Json.Linq.JProperty("ScenesName", sceneName)); + } jObject.Add("Data", data2); } //鍦烘櫙 else if (data.Type == 1) { var data2 = new Newtonsoft.Json.Linq.JObject {{ "ScenesId",sceneId},{ "Type", 1} , - { "ElseScenesId", data.ElseScenesId },{ "DelayTime", 0} ,{ "MemberNumber",i + 1} }; + { "ElseScenesId", data.ElseScenesId },{ "DelayTime", 0} ,{ "MemberNumber",index} }; + if (sceneName != null) + { + data2.Add(new Newtonsoft.Json.Linq.JProperty("ScenesName", sceneName)); + } jObject.Add("Data", data2); } //寤舵椂 else { var data2 = new Newtonsoft.Json.Linq.JObject {{ "Type", 2} ,{ "ScenesId",sceneId}, - { "DelayTime", data.DelayTime} ,{ "MemberNumber",i + 1}}; + { "DelayTime", data.DelayTime} ,{ "MemberNumber",index}}; + if (sceneName != null) + { + data2.Add(new Newtonsoft.Json.Linq.JProperty("ScenesName", sceneName)); + } jObject.Add("Data", data2); } listCommand.Add(jObject.ToString()); + index++; } return listCommand; } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs index 2f61f5d..33a1934 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs @@ -29,12 +29,12 @@ var connectMode = GetHttpConnectMode(checkAuthority); //鑾峰彇浠庢帴鍙i偅閲屽彇鍒扮殑姣旂壒鏁版嵁 var byteData = GettByteResponsePack(RequestName, connectMode, obj); - if (byteData == null && setAgain == true) + if (byteData == null) { if (setAgain == false) { //褰撳墠鏃犳硶璁块棶缃戠粶 - ShowNotNetMsg(listNotShowError); + ShowNotNetMsg(RequestName, listNotShowError); return false; } byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj); @@ -69,7 +69,7 @@ if (setAgain == false) { //褰撳墠鏃犳硶璁块棶缃戠粶 - ShowNotNetMsg(listNotShowError); + ShowNotNetMsg(RequestName, listNotShowError); return "Error"; } byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj); @@ -107,7 +107,7 @@ if (setAgain == false) { //褰撳墠鏃犳硶璁块棶缃戠粶 - ShowNotNetMsg(listNotShowError); + ShowNotNetMsg(RequestName, listNotShowError); return null; } byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj); @@ -151,7 +151,7 @@ if (setAgain == false) { //褰撳墠鏃犳硶璁块棶缃戠粶 - ShowNotNetMsg(listNotShowError); + ShowNotNetMsg(RequestName, listNotShowError); return null; } revertObj = ResetByteRequestHttps(RequestName, checkAuthority, obj); @@ -206,7 +206,7 @@ if (count == 3) { //鏄剧ず娌℃湁缃戠粶鐨凪sg - ShowNotNetMsg(null); + ShowNotNetMsg(RequestName, null); break; } } @@ -328,13 +328,15 @@ /// <summary> /// 鏄剧ず娌℃湁缃戠粶鐨凪sg /// </summary> - private static void ShowNotNetMsg(List<string> listNotShowError) + private static void ShowNotNetMsg(string RequestName, List<string> listNotShowError) { if (listNotShowError != null && listNotShowError.Contains("NotCheck") == true) { //涓嶆娴� return; } + //HdlLogLogic.Current.WriteLog(-1, "褰撳墠鏃犵綉缁滆繛鎺�:" + RequestName); + HdlThreadLogic.Current.RunMain(() => { // 褰撳墠鏃犵綉缁滆繛鎺�,璇风‘璁ょ綉缁� @@ -498,13 +500,18 @@ #endregion #region 鈻� 鍒锋柊鏈湴缂撳瓨_______________________ + /// <summary> - /// 鍒锋柊鏈湴鎵�鏈夌紦瀛� + /// 鍒锋柊鏈湴鎵�鏈夌紦瀛�(鐩墠姝ゆ柟娉曞彧鎻愪緵缁欐仮澶嶅浠芥暟鎹娇鐢�) /// </summary> public static void RefreshAllMemory() { //鍒锋柊浣忓畢瀵硅薄 RefreshHomeObject(); + //鏍规嵁妯℃澘鏂囦欢,鎭㈠鏁版嵁 + TemplateData.TemplateCommonLogic.Current.RecoverDataByTemplateBinFile(); + //寮哄埗鐢熸垚璁惧鍜岀綉鍏虫枃浠� + TemplateData.TemplateCommonLogic.Current.CreatDeviceAndGatewayFileFromMemoryByForce(); //鍒锋柊鏈湴缃戝叧鏂囦欢 HdlGatewayLogic.Current.ReFreshByLocal(); //鍒锋柊鏈湴璁惧 @@ -847,6 +854,9 @@ //鍒锋柊APP鍓嶄竴娆¢�夋嫨鐨勭綉鍏矷D(鍙互鍙嶅璋冪敤,闇�瑕佸湪缃戝叧鍒濆鍖栧畬浜嗕箣鍚庢墠鑳借皟鐢�) HdlGatewayLogic.Current.RefreshAppOldSelectGatewayId(); + //鍔犺浇妯℃澘缂撳瓨 + //TemplateData.TemplateCommonLogic.Current.LoadLocalTemplateMemoryData(); + //0:宸茬粡鍚屾杩囷紝涓嶉渶瑕佸悓姝�,杩欎釜鏃跺�欓渶瑕佹彁绀哄浠� if (result == 0 && ShowPrompted == true) { @@ -912,6 +922,8 @@ HdlRoomLogic.Current.RefreshAllRoomByLocation(); //鍒锋柊宸﹁竟鍒锋柊鎴块棿瑙嗗浘鍒楄〃 HdlRoomLogic.Current.RefreshRoomListView(); + //鍔犺浇妯℃澘缂撳瓨 + //TemplateData.TemplateCommonLogic.Current.LoadLocalTemplateMemoryData(); } /// <summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs index 4771a28..7c15ae9 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/DirectoryFileNameResourse.cs @@ -151,6 +151,48 @@ get { return System.IO.Path.Combine(Common.Config.Instance.FullPath, "020945dd7966a7550090d3c04a04d93cd2278eb4e6aebcf6"); } } /// <summary> + /// 鏈湴妯℃澘缂撳瓨瀛樻斁鐨勩�愭枃浠跺す銆� + /// </summary> + public static string LocalTemplateDirectory + { + get { return System.IO.Path.Combine(LocalMemoryDirectory, "1180648b252f370b18565d54115f2bece19fcc9985dd1f70"); } + } + /// <summary> + /// 鎵�鏈変綇瀹呯殑妯℃澘缂撳瓨瀛樻斁鐨勩�愭枃浠跺す銆� + /// </summary> + public static string AllResidenceTemplateDirectory + { + get { return System.IO.Path.Combine(IO.FileUtils.RootPath, Common.Config.Instance.Guid, "f8e712a42227d8f6a8208b076c7e132fe9869f7f0aff3d37"); } + } + /// <summary> + /// 淇濆瓨璁惧閫夋嫨鐨勬ā鏉跨殑銆愭枃浠躲�� + /// </summary> + public static string DeviceTemplateSelectFile + { + get { return System.IO.Path.Combine(LocalMemoryDirectory, "76d54eaedfd2124c4629cf8c4b8ae60f423c10556dfe50cb9de193a83c5653ef"); } + } + /// <summary> + /// 淇濆瓨缃戝叧閫夋嫨鐨勬ā鏉跨殑銆愭枃浠躲�� + /// </summary> + public static string GatewayTemplateSelectFile + { + get { return System.IO.Path.Combine(LocalMemoryDirectory, "fdac0d1dd857d946a524feb8ae4e69ecb048333261cb41f5fcc9932b35b09c2f"); } + } + /// <summary> + /// 涓存椂淇濆瓨褰撳墠鏈湴鍏ㄩ儴鏂囦欢鐨勩�愭枃浠跺す銆� + /// </summary> + public static string TemporaryBackupLocalFileDirectory + { + get { return System.IO.Path.Combine(Common.Config.Instance.FullPath, "eaa527389defe69899beb6df9a83228b281b4e57a63a654de1ad6d01ab956907"); } + } + /// <summary> + /// 涓存椂淇濆瓨鏈湴褰撳墠鍏ㄩ儴妯℃澘鏂囦欢鐨勩�愭枃浠跺す銆� + /// </summary> + public static string TemporaryBackupTemplateFileDirectory + { + get { return System.IO.Path.Combine(TemporaryBackupLocalFileDirectory, "f8e712a42227d8f6df0aa223fe0a1eda"); } + } + /// <summary> /// 淇濆瓨鎰忚鍙嶉娆℃暟鐨勩�愭枃浠躲�� /// </summary> public static string SuggestionFile @@ -165,13 +207,6 @@ get { return System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, "cad1afb384fb482de753fc37ebe84f9e"); } } /// <summary> - /// 璋冭瘯鏋佸厜鍙戦�両D鐨勩�愭枃浠躲�� - /// </summary> - public static string JiguangFile - { - get { return System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, "e509ddd21100cb994f509fb28c2e4dd6"); } - } - /// <summary> /// 璁板綍鍙戦�佸拰鎺ユ敹鐨勬暟鎹甃og /// </summary> public static string SendAndReceveDataLog @@ -185,6 +220,34 @@ { get { return System.IO.Path.Combine(Common.Config.Instance.FullPath, LocalMemoryDirectory, "SocketReceiveDataLog.log"); } } + /// <summary> + /// 瀛樻斁鍗囩骇鍥轰欢鐨勩�愭枃浠跺す銆� + /// </summary> + public static string FirmwareUpdateDirectory + { + get { return System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, "5b78084db39091e2f9144bc6209e3001e0328e968d16adbc"); } + } + /// <summary> + /// 瀛樻斁鍗囩骇鍥轰欢鍒楄〃鍚嶅瓧鐨勩�愭枃浠躲�� + /// </summary> + public static string FirmwareUpdateList + { + get { return System.IO.Path.Combine(FirmwareUpdateDirectory, "5b78084db39091e2ee87891aa45d2c1ffc005ce4b9d67f51"); } + } + /// <summary> + /// 璋冭瘯鏋佸厜鍙戦�両D鐨勩�愭枃浠躲�� + /// </summary> + public static string JiguangFile + { + get { return System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, "e509ddd21100cb994f509fb28c2e4dd6"); } + } + /// <summary> + /// 瀛樻斁鐢熸垚鍙戦�佺粰缃戝叧鐨勫悇绉嶆ā鏉挎暟鎹殑銆愭枃浠跺す銆� + /// </summary> + public static string CreatSendToGwTemplateDirectory + { + get { return System.IO.Path.Combine(Common.Config.Instance.FullPath, "96048b35f1d3d43725b1b2d7240878f804c003969e26330cd5afe42f509b63c7"); } + } /// <summary> /// 鍒嗕韩妤煎眰鐨勩�愭枃浠跺悕銆� /// </summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/UserCenterResourse.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/UserCenterResourse.cs index 38bb2ef..8e98407 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/UserCenterResourse.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/UserCenterResourse.cs @@ -47,5 +47,13 @@ /// 鏂囦欢鍔犲瘑绉橀挜 /// </summary> public const string FileEncryptKey = "4^Olh_3f"; + /// <summary> + /// 鍗曟枩鏉犵殑杞箟瀛楃 + /// </summary> + public const string slash = "\\"; + /// <summary> + /// 鍙屽紩鍙风殑杞箟瀛楃 + /// </summary> + public const string douMarks = "\""; } } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFourButtonDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFourButtonDirectionForm.cs index acded9a..b698f35 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFourButtonDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelFourButtonDirectionForm.cs @@ -49,15 +49,11 @@ btnGreanLinght.TextID = R.MyInternationalizationString.uPanelBackLightLighting; framePic.AddChidren(btnGreanLinght); - //浠绘剰鎸夐敭闀挎寜5绉� - string textMsg = Language.StringByID(R.MyInternationalizationString.uLongClickEachPanelSomeSecond); - if (textMsg.Contains("{0}") == true) - { - textMsg = string.Format(textMsg, "5"); - } + //闀挎寜姝ゆ寜閿� + string textMsg = Language.StringByID(R.MyInternationalizationString.uLongPressThisButton); var btnSecond = new NormalViewControl(this.GetPictrueRealSize(400), this.GetPictrueRealSize(45), false); btnSecond.X = this.GetPictrueRealSize(441); - btnSecond.Y = this.GetPictrueRealSize(583); + btnSecond.Y = this.GetPictrueRealSize(526); btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond.TextSize = 10; btnSecond.Text = textMsg; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelThreeButtonDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelThreeButtonDirectionForm.cs index 02ade6f..5ef3e6d 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelThreeButtonDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelThreeButtonDirectionForm.cs @@ -49,15 +49,11 @@ btnGreanLinght.TextID = R.MyInternationalizationString.uPanelBackLightLighting; framePic.AddChidren(btnGreanLinght); - //浠绘剰鎸夐敭闀挎寜5绉� - string textMsg = Language.StringByID(R.MyInternationalizationString.uLongClickEachPanelSomeSecond); - if (textMsg.Contains("{0}") == true) - { - textMsg = string.Format(textMsg, "5"); - } + //闀挎寜姝ゆ寜閿� + string textMsg = Language.StringByID(R.MyInternationalizationString.uLongPressThisButton); var btnSecond = new NormalViewControl(this.GetPictrueRealSize(400), this.GetPictrueRealSize(45), false); btnSecond.X = this.GetPictrueRealSize(441); - btnSecond.Y = this.GetPictrueRealSize(583); + btnSecond.Y = this.GetPictrueRealSize(526); btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond.TextSize = 10; btnSecond.Text = textMsg; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelTwoButtonDirectionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelTwoButtonDirectionForm.cs index ae74341..adb6ccf 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelTwoButtonDirectionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Direction/PanelTwoButtonDirectionForm.cs @@ -49,15 +49,11 @@ btnGreanLinght.TextID = R.MyInternationalizationString.uPanelBackLightLighting; framePic.AddChidren(btnGreanLinght); - //浠绘剰鎸夐敭闀挎寜5绉� - string textMsg = Language.StringByID(R.MyInternationalizationString.uLongClickEachPanelSomeSecond); - if (textMsg.Contains("{0}") == true) - { - textMsg = string.Format(textMsg, "5"); - } + //闀挎寜姝ゆ寜閿� + string textMsg = Language.StringByID(R.MyInternationalizationString.uLongPressThisButton); var btnSecond = new NormalViewControl(this.GetPictrueRealSize(400), this.GetPictrueRealSize(45), false); btnSecond.X = this.GetPictrueRealSize(441); - btnSecond.Y = this.GetPictrueRealSize(583); + btnSecond.Y = this.GetPictrueRealSize(526); btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3; btnSecond.TextSize = 10; btnSecond.Text = textMsg; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelColorSelectForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelColorSelectForm.cs index 85c4f68..71725b2 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelColorSelectForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelColorSelectForm.cs @@ -32,6 +32,14 @@ /// 鍦嗙洏閫夋嫨鐨勯鑹叉樉绀烘帶浠�(鍐呮) /// </summary> private IconViewControl wheelSelectIcon2 = null; + /// <summary> + /// 鏄惁鏄鑹查�夋嫨 + /// </summary> + private bool isColorSelect = false; + /// <summary> + /// 棰滆壊鍊艰緭鍏ユ帶浠� + /// </summary> + private TextInputControl txtColorInput = null; #endregion @@ -43,7 +51,7 @@ /// <param name="i_R">R</param> /// <param name="i_G">G</param> /// <param name="i_B">B</param> - public void ShowForm(int i_R,int i_G,int i_B) + public void ShowForm(int i_R, int i_G, int i_B) { this.ScrollEnabled = false; @@ -97,17 +105,15 @@ /// </summary> private void InitColorPictrueControl() { - //鍦嗙洏鎺т欢鐨凢rameLayout - var frameBack = new FrameLayout(); - frameBack.Y = Application.GetRealHeight(66); - frameBack.Height = Application.GetRealHeight(1204); - bodyFrameLayout.AddChidren(frameBack); + //鍒濆鍖栭鑹茶緭鍏ユ帶浠� + this.txtColorInput = this.InitColorInputControl(); var framePic = new FrameLayout(); framePic.Width = this.GetPictrueRealSize(588); framePic.Height = this.GetPictrueRealSize(588); - framePic.Gravity = Gravity.Center; - frameBack.AddChidren(framePic); + framePic.Gravity = Gravity.CenterHorizontal; + framePic.Y = Application.GetRealHeight(192); + bodyFrameLayout.AddChidren(framePic); //鍦嗙洏鎺т欢 var colorPic = new ColorPicker(); @@ -137,14 +143,11 @@ listRGB.Add(Convert.ToInt32(Convert.ToString(eColor[2]))); //鏄剧ず閫夋嫨棰滆壊鐨勬帶浠� - if (nowSelectIcon1 != null) - { - nowSelectIcon1.BorderColor = UserCenterColor.Current.White; - } - wheelSelectIcon2.BackgroundColor = this.GetColorByRGB(eColor[0], eColor[1], eColor[2]); - wheelSelectIcon1.BorderColor = 0xffcccccc; - wheelSelectIcon1.Name = listRGB[0] + "-" + listRGB[1] + "-" + listRGB[2]; - nowSelectIcon1 = wheelSelectIcon1; + this.ShowNowSelectColorControl(eColor); + + //鑾峰彇棰滆壊鐨勭炕璇戞枃鏈� + isColorSelect = true; + this.txtColorInput.Text = this.GetColorTextTranslate(listRGB[0], listRGB[1], listRGB[2]); }; colorPic.MouseDownEventHandler += (sender, e) => { @@ -167,6 +170,99 @@ //褰撻紶鏍囩偣涓嬩簨浠跺鐞� colorPic.MouseDownEventHandler(sender, e); }; + + //鎵嬪姩杈撳叆鍊兼敼鍙樹簨浠� + this.txtColorInput.TextChangeEventHandler += (sender, value) => + { + if (isColorSelect == true) + { + //杩欓噷鏄敱鐐瑰嚮鑹茬洏杩涜璧嬪�艰Е鍙� + isColorSelect = false; + return; + } + //妫�娴嬭緭鍏ョ殑棰滆壊鍊� + var byteColor = this.CheckInputColorValue(value); + if (byteColor == null) + { + return; + } + if (btnWhiteView.Visible == true) + { + //鐧界偣闅愯棌 + btnWhiteView.Visible = false; + } + + //璁板綍缂撳瓨 + listRGB = new List<int>(); + listRGB.Add(Convert.ToInt32(Convert.ToString(byteColor[0]))); + listRGB.Add(Convert.ToInt32(Convert.ToString(byteColor[1]))); + listRGB.Add(Convert.ToInt32(Convert.ToString(byteColor[2]))); + + //鏄剧ず閫夋嫨棰滆壊鐨勬帶浠� + this.ShowNowSelectColorControl(byteColor); + }; + } + + /// <summary> + /// 鍒濆鍖栭鑹茶緭鍏ユ帶浠� + /// </summary> + /// <returns></returns> + private TextInputControl InitColorInputControl() + { + //鑷畾涔夎壊鍊肩殑澶栨 + var frameInput = new NormalFrameLayout(); + frameInput.Width = Application.GetRealWidth(458); + frameInput.Height = Application.GetRealHeight(104); + frameInput.Y = Application.GetRealHeight(1103); + frameInput.Gravity = Gravity.CenterHorizontal; + frameInput.BorderColor = 0xffcccccc; + frameInput.Radius = (uint)Application.GetRealWidth(17); + frameInput.BorderWidth = Application.GetRealWidth(3) == 0 ? 1 : (uint)Application.GetRealWidth(3); + bodyFrameLayout.AddChidren(frameInput); + var btnMark = new NormalViewControl(100, 58, true); + btnMark.X = Application.GetRealWidth(35); + btnMark.Gravity = Gravity.CenterVertical; + btnMark.IsBold = true; + btnMark.Text = "# "; + btnMark.Width = btnMark.GetRealWidthByText(); + btnMark.TextColor = UserCenterColor.Current.TextGrayColor2; + frameInput.AddChidren(btnMark); + //鑷畾涔夎壊鍊艰緭鍏ユ + var txtInput = new TextInputControl(400, 58, true); + txtInput.X = btnMark.Right; + txtInput.Gravity = Gravity.CenterVertical; + txtInput.TextSize = 16; + txtInput.FrameBorder = frameInput; + frameInput.AddChidren(txtInput); + //鑹插�煎彿涓�6浣嶏紙鐢变换鎰忔暟瀛�+瀛楁瘝缁勫悎锛� + var btnTipView = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(55), false); + btnTipView.Y = frameInput.Bottom + Application.GetRealHeight(20); + btnTipView.IsBold = true; + btnTipView.TextAlignment = TextAlignment.Center; + btnTipView.TextColor = UserCenterColor.Current.TextGrayColor2; + btnTipView.TextSize = 12; + btnTipView.TextID = R.MyInternationalizationString.uColorLengthMsg; + bodyFrameLayout.AddChidren(btnTipView); + + return txtInput; + } + + /// <summary> + /// 鏄剧ず閫夋嫨棰滆壊鐨勬帶浠� + /// </summary> + /// <param name="eColor"></param> + private void ShowNowSelectColorControl(byte[] eColor) + { + //鏄剧ず閫夋嫨棰滆壊鐨勬帶浠� + if (nowSelectIcon1 != null) + { + nowSelectIcon1.BorderColor = UserCenterColor.Current.White; + } + var uintColor = this.GetColorByRGB(eColor[0], eColor[1], eColor[2]); + wheelSelectIcon2.BackgroundColor = uintColor; + wheelSelectIcon1.BorderColor = 0xffcccccc; + wheelSelectIcon1.Name = listRGB[0] + "-" + listRGB[1] + "-" + listRGB[2]; + nowSelectIcon1 = wheelSelectIcon1; } #endregion @@ -194,7 +290,7 @@ btnFrame.Width = this.GetPictrueRealSize(80); btnFrame.Radius = (uint)this.GetPictrueRealSize(80) / 2; btnFrame.X = Xdefult + i * this.GetPictrueRealSize(80 + 24); - btnFrame.Y = Application.GetRealHeight(1054); + btnFrame.Y = Application.GetRealHeight(880); btnFrame.BackgroundColor = UserCenterColor.Current.White; btnFrame.BorderWidth = 1; btnFrame.BorderColor = UserCenterColor.Current.White; @@ -221,6 +317,10 @@ wheelSelectIcon1 = btnFrame; wheelSelectIcon2 = btnIcon; nowSelectIcon1 = btnFrame; + + //鑾峰彇棰滆壊鐨勭炕璇戞枃鏈� + isColorSelect = true; + this.txtColorInput.Text = this.GetColorTextTranslate(i_R, i_G, i_B); } btnFrame.ButtonClickEvent += (sender, e) => @@ -241,6 +341,9 @@ listRGB.Add(Convert.ToInt32(Convert.ToString(Arry[1]))); listRGB.Add(Convert.ToInt32(Convert.ToString(Arry[2]))); } + //鑾峰彇棰滆壊鐨勭炕璇戞枃鏈� + isColorSelect = true; + this.txtColorInput.Text = this.GetColorTextTranslate(listRGB[0], listRGB[1], listRGB[2]); }; } } @@ -296,6 +399,51 @@ } /// <summary> + /// 妫�娴嬭緭鍏ョ殑棰滆壊鍊� + /// </summary> + /// <param name="colorText"></param> + /// <returns></returns> + private byte[] CheckInputColorValue(string colorText) + { + //鍙湁闀垮害涓�6鎵嶅鐞� + if (colorText.Length != 6) { return null; } + + colorText = colorText.ToUpper(); + foreach (var c in colorText) + { + if (char.IsNumber(c) == true) + { + //鏁板瓧鐨勮瘽,OK + continue; + } + if ('A' <= c && c <= 'F') + { + //A-F鐨勮瘽,OK + continue; + } + return null; + } + int R = Convert.ToInt32(colorText.Substring(0, 2), 16); + int G = Convert.ToInt32(colorText.Substring(2, 2), 16); + int B = Convert.ToInt32(colorText.Substring(4, 2), 16); + return new byte[] { (byte)R, (byte)G, (byte)B }; + } + + /// <summary> + /// 鑾峰彇棰滆壊鐨勭炕璇戞枃鏈� + /// </summary> + /// <param name="i_R"></param> + /// <param name="i_G"></param> + /// <param name="i_B"></param> + /// <returns></returns> + private string GetColorTextTranslate(int i_R, int i_G, int i_B) + { + return Convert.ToString(i_R, 16).ToUpper().PadLeft(2, '0') + + Convert.ToString(i_G, 16).ToUpper().PadLeft(2, '0') + + Convert.ToString(i_B, 16).ToUpper().PadLeft(2, '0'); + } + + /// <summary> /// 灏哛GB杞崲涓洪鑹� /// </summary> /// <param name="R"></param> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs index d44f2d0..5658f1d 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionFileContentForm.cs @@ -95,7 +95,6 @@ textValue += value + "\r\n"; } } - textValue = textValue.Replace(",", "\r\n"); if (textValue.StartsWith("{") == true) { textValue = "{\r\n" + textValue.Substring(1); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionGatewayInfoMenuForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionGatewayInfoMenuForm.cs new file mode 100755 index 0000000..83fc914 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionGatewayInfoMenuForm.cs @@ -0,0 +1,78 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.HideOption +{ + /// <summary> + /// 闅愬尶鍔熻兘鐨勭綉鍏充俊鎭彍鍗曠晫闈� + /// </summary> + public class HideOptionGatewayInfoMenuForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 缃戝叧瀵硅薄 + /// </summary> + private ZbGateway zbGateway = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + /// <param name="i_gateway"></param> + public void ShowForm(ZbGateway i_gateway) + { + this.zbGateway = i_gateway; + //璁剧疆鏍囬淇℃伅 + base.SetTitleText("缃戝叧鑿滃崟"); + //鍒濆鍖栦腑閮ㄦ帶浠� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄦ帶浠� + /// </summary> + private void InitMiddleFrame() + { + //娓呯┖bodyFrame + this.ClearBodyFrame(); + + var listview = new VerticalListControl(29); + listview.Height = bodyFrameLayout.Height; + listview.BackgroundColor = UserCenterColor.Current.White; + bodyFrameLayout.AddChidren(listview); + + //缃戝叧淇℃伅 + var rowContr1 = new RowLayoutControl(listview.rowSpace / 2); + listview.AddChidren(rowContr1); + rowContr1.frameTable.AddLeftCaption("缃戝叧淇℃伅", 700); + rowContr1.frameTable.AddRightArrow(); + rowContr1.frameTable.AddBottomLine(); + rowContr1.frameTable.ButtonClickEvent += (sender, e) => + { + var form = new GatewayManage.GatewayInfoEditorForm(); + form.AddForm(zbGateway); + }; + + //缃戝叧鏂囦欢鍒楄〃 + var rowContr2 = new RowLayoutControl(listview.rowSpace / 2); + listview.AddChidren(rowContr2); + rowContr2.frameTable.AddLeftCaption("缃戝叧鏂囦欢鍒楄〃", 700); + rowContr2.frameTable.AddRightArrow(); + rowContr2.frameTable.ButtonClickEvent += (sender, e) => + { + var form = new HideOptionGatewayListFileForm(); + form.AddForm(zbGateway); + }; + + listview.AdjustRealHeight(Application.GetRealHeight(23)); + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionGatewayListFileForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionGatewayListFileForm.cs new file mode 100755 index 0000000..529ff96 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionGatewayListFileForm.cs @@ -0,0 +1,203 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter.HideOption +{ + /// <summary> + /// 闅愬尶鍔熻兘鐨勭綉鍏虫枃浠跺垪琛ㄧ晫闈� + /// </summary> + public class HideOptionGatewayListFileForm : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 缃戝叧瀵硅薄 + /// </summary> + private ZbGateway zbGateway = null; + private BottomClickButton btnDelete = null; + private List<string> listDeleteFile = new List<string>(); + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + /// <param name="i_gateway"></param> + public void ShowForm(ZbGateway i_gateway) + { + HdlFileLogic.Current.CreateDirectory(System.IO.Path.Combine(DirNameResourse.LocalMemoryDirectory, "MyTempDir"), true); + this.zbGateway = i_gateway; + //璁剧疆鏍囬淇℃伅 + base.SetTitleText("缃戝叧鏂囦欢鍒楄〃"); + //鍒濆鍖栦腑閮ㄦ帶浠� + this.InitMiddleFrame(); + + var btnButton = new NormalViewControl(300, 69, true); + btnButton.Gravity = Gravity.CenterVertical; + btnButton.X = bodyFrameLayout.Width - Application.GetRealWidth(300) - ControlCommonResourse.XXLeft; + btnButton.TextColor = UserCenterColor.Current.TopLayoutTitleText; + btnButton.TextAlignment = TextAlignment.CenterRight; + btnButton.TextSize = 17; + btnButton.Text = "涓�閿垹闄�"; + topFrameLayout.AddChidren(btnButton); + btnButton.ButtonClickEvent += (sender, e) => + { + btnDelete.Visible = true; + }; + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄦ帶浠� + /// </summary> + private void InitMiddleFrame() + { + //娓呯┖bodyFrame + this.ClearBodyFrame(); + + var listview = new VerticalListControl(29); + listview.Height = bodyFrameLayout.Height; + listview.BackgroundColor = UserCenterColor.Current.White; + bodyFrameLayout.AddChidren(listview); + + this.ShowProgressBar(); + HdlThreadLogic.Current.RunThread(async () => + { + var result = await zbGateway.FileTransferLsDirAsync(); + + this.CloseProgressBar(); + if (result == null || result.fileTransferLsDiResponseData == null) + { + this.ShowMassage(ShowMsgType.Tip, "鑾峰彇鍒楄〃澶辫触,缃戝叧娌℃湁鍥炲"); + return; + } + if (result.fileTransferLsDiResponseData.Result != 0) + { + this.ShowMassage(ShowMsgType.Tip, "鏌ョ湅澶辫触,濂藉儚缃戝叧涓嶅厑璁告煡鐪嬭繖涓洰褰�"); + return; + } + + var listFile = new List<string>(); + foreach (var data in result.fileTransferLsDiResponseData.Dir) + { + string[] strArry = data.File.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries); + listFile.Add(strArry[strArry.Length - 1]); + } + listFile.Sort(); + HdlThreadLogic.Current.RunMain(() => + { + foreach (var fileName in listFile) + { + var rowContr1 = new RowLayoutControl(listview.rowSpace / 2); + listview.AddChidren(rowContr1); + rowContr1.frameTable.AddLeftCaption(fileName, 700); + rowContr1.frameTable.AddBottomLine(); + + var btnSelect = new IconViewControl(58); + btnSelect.UnSelectedImagePath = "Item/ItemSelected.png"; + btnSelect.Gravity = Gravity.Center; + rowContr1.frameTable.AddChidren(btnSelect); + btnSelect.Visible = false; + + var btnDelete = rowContr1.AddDeleteControl(); + btnDelete.ButtonClickEvent += (sender, e) => + { + this.ShowMassage(ShowMsgType.Confirm, "鏄惁鍒犻櫎缃戝叧鐨勮繖涓枃浠�(闇�璋ㄦ厧)", async () => + { + var result9 = await zbGateway.DelFileOrDirAsync("/etc/hdlDat/" + fileName); + if (result9 == null || result9.delFileOrDirResponseData == null) + { + this.ShowMassage(ShowMsgType.Tip, "鍒犻櫎鏂囦欢澶辫触,缃戝叧娌℃湁鍥炲"); + return; + } + if (result9.delFileOrDirResponseData.Result == 1) + { + this.ShowMassage(ShowMsgType.Tip, "鍒犻櫎鏂囦欢澶辫触,缃戝叧璇磋繖涓笢瑗夸笉瀛樺湪"); + return; + } + if (result9.delFileOrDirResponseData.Result == 2) + { + this.ShowMassage(ShowMsgType.Tip, "鍒犻櫎鏂囦欢澶辫触,缃戝叧璇磋繖涓笢瑗夸笉鍏佽鍒犻櫎"); + return; + } + if (result9.delFileOrDirResponseData.Result != 0) + { + this.ShowMassage(ShowMsgType.Tip, "鍒犻櫎鏂囦欢澶辫触,鏃犳硶璇嗗埆鐨勭姸鎬佺爜(" + result9.delFileOrDirResponseData.Result + ")"); + return; + } + rowContr1.RemoveFromParent(); + this.ShowMassage(ShowMsgType.Tip, "鍒犻櫎鏂囦欢鎴愬姛"); + }); + }; + } + + listview.AdjustRealHeightByBottomButton(Application.GetRealHeight(23)); + + this.btnDelete = new BottomClickButton(); + btnDelete.Text = "鍒犻櫎"; + bodyFrameLayout.AddChidren(btnDelete); + btnDelete.Visible = false; + btnDelete.ButtonClickEvent += (sender, e) => + { + this.ShowMassage(ShowMsgType.Confirm, "纭畾鏄惁鍒犻櫎杩欎簺鏂囦欢?",async () => + { + foreach (var listfile in this.listDeleteFile) + { + var result9 = await zbGateway.DelFileOrDirAsync("/etc/hdlDat/" + listfile); + if (result9 == null || result9.delFileOrDirResponseData == null) + { + this.ShowMassage(ShowMsgType.Tip, "鍒犻櫎鏂囦欢澶辫触,缃戝叧娌℃湁鍥炲"); + this.InitMiddleFrame(); + this.listDeleteFile = new List<string>(); + return; + } + if (result9.delFileOrDirResponseData.Result == 1) + { + this.ShowMassage(ShowMsgType.Tip, "鍒犻櫎鏂囦欢澶辫触,缃戝叧璇磋繖涓笢瑗夸笉瀛樺湪"); + this.InitMiddleFrame(); + this.listDeleteFile = new List<string>(); + return; + } + if (result9.delFileOrDirResponseData.Result == 2) + { + this.ShowMassage(ShowMsgType.Tip, "鍒犻櫎鏂囦欢澶辫触,缃戝叧璇磋繖涓笢瑗夸笉鍏佽鍒犻櫎"); + this.InitMiddleFrame(); + this.listDeleteFile = new List<string>(); + return; + } + if (result9.delFileOrDirResponseData.Result != 0) + { + this.ShowMassage(ShowMsgType.Tip, "鍒犻櫎鏂囦欢澶辫触,鏃犳硶璇嗗埆鐨勭姸鎬佺爜(" + result9.delFileOrDirResponseData.Result + ")"); + this.InitMiddleFrame(); + this.listDeleteFile = new List<string>(); + return; + } + } + this.InitMiddleFrame(); + this.listDeleteFile = new List<string>(); + }); + }; + }); + }); + } + + #endregion + + #region 鈻� 鐣岄潰鍏抽棴___________________________ + + /// <summary> + /// 鐣岄潰鍏抽棴 + /// </summary> + public override void CloseFormBefore() + { + HdlFileLogic.Current.DeleteDirectory(System.IO.Path.Combine(DirNameResourse.LocalMemoryDirectory, "MyTempDir")); + + base.CloseFormBefore(); + } + + #endregion + } +} diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionGatewayListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionGatewayListForm.cs index 585bd74..b6ad0bf 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionGatewayListForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionGatewayListForm.cs @@ -137,7 +137,7 @@ }; gatewayRow.frameTable.ButtonClickEvent += (sender, e) => { - var form = new GatewayManage.GatewayInfoEditorForm(); + var form = new HideOptionGatewayInfoMenuForm(); form.AddForm(i_gateway); }; } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs index 2731bce..0dc5107 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs @@ -51,6 +51,15 @@ { listView.RemoveAll(); + var rowTemp = this.AddNormalRowControl(string.Empty, 400, string.Empty, 400); + var btnTemp = new NormalViewControl(600, 100, true); + btnTemp.Text = "涓�鑸俊鎭儴鍒�"; + btnTemp.Gravity = Gravity.Center; + btnTemp.TextSize = 16; + btnTemp.IsBold = true; + btnTemp.TextAlignment = TextAlignment.Center; + rowTemp.AddChidren(btnTemp); + this.AddNormalRowControl("褰撳墠韬唤", 400, UserCenterResourse.UserInfo.AuthorityText, 400); this.AddTopButtomRowControl("浣忓畢ID", 400, Common.Config.Instance.Home.Id, 900); @@ -66,6 +75,15 @@ this.AddNormalRowControl("鎷ユ湁杩滅▼鏉冮檺", 400, ZigBee.Device.ZbGateway.AllowRemoteCtrl == true ? "鏄�" : "鍚�", 400); this.AddNormalRowControl("WIFI鍙橀噺", 400, Shared.Application.IsWifi == true ? "true" : "false", 400); + + rowTemp = this.AddNormalRowControl(string.Empty, 400, string.Empty, 400); + btnTemp = new NormalViewControl(600, 100, true); + btnTemp.Text = "閾炬帴璋冭瘯閮ㄥ垎"; + btnTemp.Gravity = Gravity.Center; + btnTemp.TextSize = 16; + btnTemp.IsBold = true; + btnTemp.TextAlignment = TextAlignment.Center; + rowTemp.AddChidren(btnTemp); this.AddNormalRowControl("鎵嬫満鑾峰彇鐨処P", 600, new Shared.Net.NetWiFi().BroadcastIpAddress.ToString(), 600); @@ -98,28 +116,6 @@ //妫�娴嬭兘鍚﹀箍鎾緱鍒扮綉鍏� this.AddCheckReceviceGatewayRow(); - - row1 = new FrameRowControl(listView.rowSpace / 2); - listView.AddChidren(row1); - row1.AddLeftCaption("鏌ョ湅缂撳瓨鏂囦欢", 500); - row1.AddRightArrow(); - row1.AddBottomLine(); - row1.ButtonClickEvent += (sender, e) => - { - var form = new HideOptionDirectoryListForm(); - form.AddForm(); - }; - - row1 = new FrameRowControl(listView.rowSpace / 2); - listView.AddChidren(row1); - row1.AddLeftCaption("璁惧缂撳瓨鍙橀噺", 500); - row1.AddRightArrow(); - row1.AddBottomLine(); - row1.ButtonClickEvent += (sender, e) => - { - var form = new HideOptionMemoryListDeviceForm(); - form.AddForm(); - }; row1 = new FrameRowControl(listView.rowSpace / 2); listView.AddChidren(row1); @@ -198,6 +194,61 @@ }); }; + rowTemp = this.AddNormalRowControl(string.Empty, 400, string.Empty, 400); + btnTemp = new NormalViewControl(600, 100, true); + btnTemp.Text = "鏌ョ湅缂撳瓨閮ㄥ垎"; + btnTemp.Gravity = Gravity.Center; + btnTemp.TextSize = 16; + btnTemp.IsBold = true; + btnTemp.TextAlignment = TextAlignment.Center; + rowTemp.AddChidren(btnTemp); + + row1 = new FrameRowControl(listView.rowSpace / 2); + listView.AddChidren(row1); + row1.AddLeftCaption("鏌ョ湅缂撳瓨鏂囦欢", 500); + row1.AddRightArrow(); + row1.AddBottomLine(); + row1.ButtonClickEvent += (sender, e) => + { + var form = new HideOptionDirectoryListForm(); + form.AddForm(); + }; + + row1 = new FrameRowControl(listView.rowSpace / 2); + listView.AddChidren(row1); + row1.AddLeftCaption("璁惧缂撳瓨鍙橀噺", 500); + row1.AddRightArrow(); + row1.AddBottomLine(); + row1.ButtonClickEvent += (sender, e) => + { + var form = new HideOptionMemoryListDeviceForm(); + form.AddForm(); + }; + + rowTemp = this.AddNormalRowControl(string.Empty, 400, string.Empty, 400); + btnTemp = new NormalViewControl(600, 100, true); + btnTemp.Text = "鍏朵粬閮ㄥ垎"; + btnTemp.Gravity = Gravity.Center; + btnTemp.TextSize = 16; + btnTemp.IsBold = true; + btnTemp.TextAlignment = TextAlignment.Center; + rowTemp.AddChidren(btnTemp); + + row1 = new FrameRowControl(listView.rowSpace / 2); + listView.AddChidren(row1); + row1.AddLeftCaption("閲嶇疆瀵煎叆鏍囪瘑", 500); + row1.AddRightArrow(); + row1.AddBottomLine(); + row1.ButtonClickEvent += (sender, e) => + { + this.ShowMassage(ShowMsgType.Confirm, "鏄惁閲嶇疆杩欎釜浣忓畢鐨勫鍏ユ爣璇�?\r\n閲嶇疆涔嬪悗鍙互鍐嶆瀵煎叆缃戝叧", () => + { + Common.Config.Instance.Home.SendTemplateSuccess = false; + Common.Config.Instance.Home.Save(); + this.ShowMassage(ShowMsgType.Tip, "閲嶇疆瀹屾垚"); + }); + }; + row1 = new FrameRowControl(listView.rowSpace / 2); listView.AddChidren(row1); row1.AddLeftCaption("涓婁紶Log", 500); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/GarrisonAreaSettionMenuForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/GarrisonAreaSettionMenuForm.cs index bf7c54f..dbc1465 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/GarrisonAreaSettionMenuForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/GarrisonAreaSettionMenuForm.cs @@ -123,8 +123,8 @@ /// <param name="btnswich"></param> private async void SetInformationPush(MostRightIconControl btnswich) { - //鑾峰彇鐘舵�� - int statu = HdlSafeguardLogic.Current.GetGarrisonInformationPushStatu(this.zoonID) == 0 ? 1 : 0; + //鑾峰彇鐘舵��(鍙栧弽) + int statu = btnswich.IsSelected == true ? 1 : 0; //鎵ц淇敼 var result = await HdlSafeguardLogic.Current.SetGarrisonInformationPushStatu(this.zoonID, statu); diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs index fa16d90..61a4856 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs @@ -85,7 +85,6 @@ /// <para>鎸佺画鏁版嵁涓婃姤(MomentStatus=0 TriggerZoneStatus>=1锛滄姤璀︼紴 TriggerZoneStatus=0锛滃彇娑堟姤璀︼紴)</para> /// <para>21: Door/Window 闂ㄧ獥浼犳劅鍣紙鏈�21鍜�22锛岃繖閲屾病鏈夊啓閿欙級</para> /// <para>22:Door/Window 闂ㄧ獥浼犳劅鍣紙鏈�21鍜�22锛岃繖閲屾病鏈夊啓閿�</para> - /// <para>541 鐞冨瀷绉诲姩浼犳劅鍣�</para> /// </summary> public int IasDeviceType; /// <summary> @@ -116,7 +115,7 @@ /// </summary> public int ZigbeeType; /// <summary> - /// 褰撳墠杩愯绋嬪簭鐗堟湰淇℃伅銆� 鏈�澶�64瀛楄妭 + /// 鍥轰欢鐗堟湰 /// </summary> public int ImgVersion; /// <summary> diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs index 04f6b80..af40ff4 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/Safeguard.cs @@ -4706,7 +4706,15 @@ /// <summary> /// 闃插尯鍚嶇О 锛屾渶澶�32涓瓧绗� /// </summary> - public string ZoneName; + public string ZoneName; + + /// <summary> + /// 鏄惁绂佺敤淇℃伅鎺ㄩ�侊細 + ///<para>0锛氫笉绂佺敤</para> + ///<para>1锛氱鐢�</para> + ///<para>褰撻槻鍖虹殑淇℃伅鎺ㄩ�佽绂佺敤鏃讹紝闃插尯琚Е鍙戞椂涓嶄細鍙戦��18灏忚妭鐨勨�濋槻鍖鸿瑙﹀彂鏄姤鍛娾�濈殑涓婚淇℃伅銆�</para> + /// </summary> + public int IsDisablePushMessage = 0; /// <summary> /// 瀹夐槻璁惧鍒楄〃 diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs index ab48517..33f7267 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs @@ -72,7 +72,7 @@ /// <summary> /// 铏氭嫙椹卞姩淇℃伅 /// </summary> - public List<DriveCodeListObj> DriveCodeList = new List<DriveCodeListObj>(); + public List<DriveCodeObj> DriveCodeList = new List<DriveCodeObj>(); /// <summary> /// 铏氭嫙缃戝叧 @@ -249,32 +249,9 @@ /// <summary> /// 铏氭嫙椹卞姩淇℃伅 /// </summary> - public List<DriveCodeListObj> DriveCodeList = new List<DriveCodeListObj>(); + public List<DriveCodeObj> DriveCodeList = new List<DriveCodeObj>(); } - public class DriveCodeListObj - { - /// <summary> - /// 椹卞姩浠e彿锛堢敱缃戝叧涓洪┍鍔ㄥ垎閰嶅敮涓�鏍囪瘑锛� - /// </summary> - public int DriveCode; - /// <summary> - /// 椹卞姩纭欢鐗堟湰 - /// </summary> - public int DriveHwVersion; - /// <summary> - /// 椹卞姩杞欢鐗� - /// </summary> - public int DriveFwVersion; - /// <summary> - /// 椹卞姩鍥轰欢绫诲瀷 - /// </summary> - public int DriveImageType; - /// <summary> - /// 椹卞姩id - /// </summary> - public int DriveId; - } #endregion #region 淇敼缃戝叧鍚嶇О diff --git a/ZigbeeApp/Shared/R.cs b/ZigbeeApp/Shared/R.cs index aef72af..b767caa 100755 --- a/ZigbeeApp/Shared/R.cs +++ b/ZigbeeApp/Shared/R.cs @@ -5846,6 +5846,14 @@ /// 閽ュ寵鎵� /// </summary> public const int uKeyfob = 16143; + /// <summary> + /// 鑹插�煎彿涓�6浣嶏紙鐢变换鎰忔暟瀛�+瀛楁瘝缁勫悎锛� + /// </summary> + public const int uColorLengthMsg = 16144; + /// <summary> + /// 闀挎寜姝ゆ寜閿� + /// </summary> + public const int uLongPressThisButton = 16145; //鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� diff --git a/ZigbeeApp/Shared/Shared.projitems b/ZigbeeApp/Shared/Shared.projitems index 651aaa1..25ce690 100755 --- a/ZigbeeApp/Shared/Shared.projitems +++ b/ZigbeeApp/Shared/Shared.projitems @@ -45,6 +45,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\IfString.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\LightView.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\mFunView.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\RoomClickView.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\SaveView.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\SelectedDeviceView.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\TipView.cs" /> @@ -139,6 +140,9 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\Widget\MyButton.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\Widget\SoundRowLayout.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\SmartSound\Widget\TextDialog.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\TemplateData\TemplateCommonLogic.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\TemplateData\TemplateDataCommon.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\TemplateData\TemplateDeviceDataLogic.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Abount\AbountForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Abount\SLAForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Common\AccountOption.cs" /> @@ -291,6 +295,8 @@ <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HdlBackup\HdlBackupListForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionDirectoryListForm.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionFileContentForm.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionGatewayInfoMenuForm.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\HideOption\HideOptionGatewayListFileForm.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" /> -- Gitblit v1.8.0