From 3f87bf0ae7394cdd7d52428f1f6b4361434c7cc4 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期五, 15 五月 2020 13:28:33 +0800 Subject: [PATCH] hhhhhhhhh --- ZigbeeApp/GateWay.Droid/Assets/Language.ini | 2 ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs | 41 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceFreshAirCardControl.cs | 10 ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs | 5 ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs | 64 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs | 89 + ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj | 10 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirSwitchRowControl.cs | 6 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs | 28 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs | 2 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs | 6 ZigbeeApp/Shared/Common/CommonPage.cs | 65 - ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs | 80 + ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListControl.cs | 12 ZigbeeApp/Home.Ios/Resources/Phone/Logo/StartBackGroud.png | 0 ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs | 74 + ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs | 76 + ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs | 17 ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs | 27 ZigbeeApp/GateWay.Droid/Assets/Phone/Logo/Logo.png | 0 ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs | 72 + ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs | 3 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/VerificationCodeControl.cs | 15 ZigbeeApp/GateWay.Droid/Properties/AndroidManifest.xml | 2 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs | 6 ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs | 5 ZigbeeApp/Home.Ios/Resources/Phone/Logo/Logo.png | 0 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceRelayRowControl.cs | 6 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs | 17 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs | 6 ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs | 45 ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs | 10 ZigbeeApp/Home.Ios/mono_crash.115869ea88.0.json | 775 +++++++++++++++++++ ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAcRowControl.cs | 6 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceDoorLockRowControl.cs | 6 ZigbeeApp/Shared/Phone/MainPage/DeviceDetailInfoForm.cs | 10 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs | 8 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs | 17 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/ControlCommonResourse.cs | 4 ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs | 39 ZigbeeApp/Home.Ios/Resources/Language.ini | 2 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs | 6 ZigbeeApp/Home.Ios/Home.IOS.csproj | 2 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs | 6 ZigbeeApp/Shared/R.cs | 8 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlExperienceAccountLogic.cs | 2 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListRefreshControl.cs | 12 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAirSwitchCardControl.cs | 6 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs | 11 ZigbeeApp/Shared/Common/Device.cs | 93 +- ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs | 1 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs | 46 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DevicePmSensorRowControl.cs | 6 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs | 25 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceRelayCardControl.cs | 6 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs | 62 - ZigbeeApp/Shared/Phone/UserView/LoginLoading.cs | 33 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs | 99 ++ ZigbeeApp/GateWay.Droid/Assets/Phone/Logo/StartBackGroud.png | 0 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameRefreshControl.cs | 13 /dev/null | 0 ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceFreshAirRowControl.cs | 6 ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs | 4 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs | 64 ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs | 79 - ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs | 4 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs | 12 ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs | 24 ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDoorLockCardControl.cs | 6 70 files changed, 1,688 insertions(+), 618 deletions(-) diff --git a/ZigbeeApp/GateWay.Droid/Assets/Language.ini b/ZigbeeApp/GateWay.Droid/Assets/Language.ini index 134a3fe..58d835e 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Language.ini +++ b/ZigbeeApp/GateWay.Droid/Assets/Language.ini @@ -1846,6 +1846,8 @@ 16114=鐏叏鍏� 16115=甯稿紑鑷姩鍖栨墜鍔ㄥ彇娑� 16116=娓稿浣撻獙 +16117=鏅鸿兘鏀瑰彉鐢熸椿 | Enjoy smart life +16118=缃戠粶涓嶇ǔ瀹氾紝鍦烘櫙鍒楄〃淇℃伅缂烘崯 ;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� 18004=鎸囧畾缃戝叧宸茬粡琚粦瀹� diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Logo/2.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Logo/2.png deleted file mode 100755 index 7a07804..0000000 --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Logo/2.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Logo/Logo.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Logo/Logo.png index 232eeea..30b57f2 100755 --- a/ZigbeeApp/GateWay.Droid/Assets/Phone/Logo/Logo.png +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Logo/Logo.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/Assets/Phone/Logo/StartBackGroud.png b/ZigbeeApp/GateWay.Droid/Assets/Phone/Logo/StartBackGroud.png new file mode 100755 index 0000000..43956d1 --- /dev/null +++ b/ZigbeeApp/GateWay.Droid/Assets/Phone/Logo/StartBackGroud.png Binary files differ diff --git a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj index f74407e..15159bf 100644 --- a/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj +++ b/ZigbeeApp/GateWay.Droid/GateWay.Droid.csproj @@ -507,7 +507,6 @@ <AndroidAsset Include="Assets\Phone\Item\UpperTriangle.png" /> <AndroidAsset Include="Assets\Phone\Item\VirtualFrame.png" /> <AndroidAsset Include="Assets\Phone\Item\WrongIcon.png" /> - <AndroidAsset Include="Assets\Phone\Logo\Logo.png" /> <AndroidAsset Include="Assets\Phone\Navigation\Category.png" /> <AndroidAsset Include="Assets\Phone\Navigation\CategorySelected.png" /> <AndroidAsset Include="Assets\Phone\Navigation\Home.png" /> @@ -2087,9 +2086,6 @@ <AndroidAsset Include="Assets\Phone\Item\NormallyOpen.png" /> </ItemGroup> <ItemGroup> - <AndroidAsset Include="Assets\Phone\Logo\2.png" /> - </ItemGroup> - <ItemGroup> <AndroidAsset Include="Assets\Phone\Item\Check1.png" /> </ItemGroup> <ItemGroup> @@ -2161,6 +2157,12 @@ <ItemGroup> <AndroidAsset Include="Assets\Phone\PM2.5Sensor\TemperaturePic.png" /> </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Logo\StartBackGroud.png" /> + </ItemGroup> + <ItemGroup> + <AndroidAsset Include="Assets\Phone\Logo\Logo.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 06662d7..be6eda8 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="2020050901" android:installLocation="auto" android:versionName="1.0.20050901"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2020051301" android:installLocation="auto" android:versionName="1.0.20051301"> <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/Home.IOS.csproj b/ZigbeeApp/Home.Ios/Home.IOS.csproj index 9321179..75bf261 100644 --- a/ZigbeeApp/Home.Ios/Home.IOS.csproj +++ b/ZigbeeApp/Home.Ios/Home.IOS.csproj @@ -467,7 +467,7 @@ <BundleResource Include="Resources\Phone\DoorLock\UnLockSideslipIcon.png" /> <BundleResource Include="Resources\Phone\DoorLock\UndistributeIcon.png" /> <BundleResource Include="Resources\Phone\Logo\Logo.png" /> - <BundleResource Include="Resources\Phone\Logo\2.png" /> + <BundleResource Include="Resources\Phone\Logo\StartBackGroud.png" /> <BundleResource Include="Resources\Phone\Item\Shared.png" /> <BundleResource Include="Resources\Phone\Item\RoomIcon.png" /> <BundleResource Include="Resources\Phone\Item\Add.png" /> diff --git a/ZigbeeApp/Home.Ios/Resources/Language.ini b/ZigbeeApp/Home.Ios/Resources/Language.ini index 134a3fe..58d835e 100755 --- a/ZigbeeApp/Home.Ios/Resources/Language.ini +++ b/ZigbeeApp/Home.Ios/Resources/Language.ini @@ -1846,6 +1846,8 @@ 16114=鐏叏鍏� 16115=甯稿紑鑷姩鍖栨墜鍔ㄥ彇娑� 16116=娓稿浣撻獙 +16117=鏅鸿兘鏀瑰彉鐢熸椿 | Enjoy smart life +16118=缃戠粶涓嶇ǔ瀹氾紝鍦烘櫙鍒楄〃淇℃伅缂烘崯 ;鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� 18004=鎸囧畾缃戝叧宸茬粡琚粦瀹� diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Logo/2.png b/ZigbeeApp/Home.Ios/Resources/Phone/Logo/2.png deleted file mode 100755 index 7a07804..0000000 --- a/ZigbeeApp/Home.Ios/Resources/Phone/Logo/2.png +++ /dev/null Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Logo/Logo.png b/ZigbeeApp/Home.Ios/Resources/Phone/Logo/Logo.png index 232eeea..30b57f2 100755 --- a/ZigbeeApp/Home.Ios/Resources/Phone/Logo/Logo.png +++ b/ZigbeeApp/Home.Ios/Resources/Phone/Logo/Logo.png Binary files differ diff --git a/ZigbeeApp/Home.Ios/Resources/Phone/Logo/StartBackGroud.png b/ZigbeeApp/Home.Ios/Resources/Phone/Logo/StartBackGroud.png new file mode 100755 index 0000000..43956d1 --- /dev/null +++ b/ZigbeeApp/Home.Ios/Resources/Phone/Logo/StartBackGroud.png Binary files differ diff --git a/ZigbeeApp/Home.Ios/mono_crash.115869ea88.0.json b/ZigbeeApp/Home.Ios/mono_crash.115869ea88.0.json new file mode 100644 index 0000000..759f137 --- /dev/null +++ b/ZigbeeApp/Home.Ios/mono_crash.115869ea88.0.json @@ -0,0 +1,775 @@ +{ + "protocol_version" : "0.0.5", + "configuration" : { + "version" : "(6.6.0.155) (2019-08/296a9afdb24)", + "tlc" : "normal", + "sigsgev" : "altstack", + "notifications" : "kqueue", + "architecture" : "amd64", + "disabled_features" : "none", + "smallconfig" : "disabled", + "bigarrays" : "disabled", + "softdebug" : "enabled", + "interpreter" : "enabled", + "llvm_support" : "0", + "suspend" : "hybrid" + }, + "memory" : { + "Resident Size" : "156639232", + "Virtual Size" : "4818821120", + "minor_gc_time" : "3344349", + "major_gc_time" : "1878887", + "minor_gc_count" : "4", + "major_gc_count" : "8", + "major_gc_time_concurrent" : "0" + }, + "threads" : [ + { + "is_managed" : false, + "offset_free_hash" : "0x0", + "offset_rich_hash" : "0x0", + "crashed" : false, + "native_thread_id" : "0x70000685a000", + "thread_info_addr" : "0x7fea5c83bc00", + "thread_name" : "Finalizer", + "ctx" : { + "IP" : "0x7fff61571266", + "SP" : "0x700006859da8", + "BP" : "0x700006859e50" + }, + "unmanaged_frames" : [ + { + "is_managed" : "false", + "native_address" : "0x10ff50156", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1100f6775", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1100f64a7", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x10ffbaf3c", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fff61627b5d", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fea5be0c040", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1100f7373", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fff616302eb", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fff61633249", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fff6162f40d", + "native_offset" : "0x00000" + } + + ] + }, + { + "is_managed" : false, + "offset_free_hash" : "0x0", + "offset_rich_hash" : "0x0", + "crashed" : false, + "native_thread_id" : "0x11281b5c0", + "thread_info_addr" : "0x7fea5c801800", + "thread_name" : "tid_307", + "ctx" : { + "IP" : "0x7fff6157486a", + "SP" : "0x7ffedfd62c98", + "BP" : "0x7ffedfd62d20" + }, + "unmanaged_frames" : [ + { + "is_managed" : "false", + "native_address" : "0x10ff50156", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1100f6775", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1100f64a7", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x10ffbaf3c", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fff61627b5d", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x10ff525b6", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1101a07c0", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1101bb2e1", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1100f3774", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1100f358a", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x10ff156c2", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x10fe9f848", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fff6143c3d5", + "native_offset" : "0x00000" + } + + ] + }, + { + "is_managed" : true, + "offset_free_hash" : "0x115869ea88", + "offset_rich_hash" : "0x115869ee42", + "crashed" : true, + "native_thread_id" : "0x700006fec000", + "thread_info_addr" : "0x7fea5c45ac00", + "thread_name" : "Thread Pool Worker", + "ctx" : { + "IP" : "0x7fff615772c6", + "SP" : "0x700006fea548", + "BP" : "0x700006fea580" + }, + "managed_frames" : [ + { + "is_managed" : "false", + "native_address" : "unregistered" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x00000", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x0000c" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x6001f80", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x0001a" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x6001f27", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x00028" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x6001f25", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x00002" + } +, + { + "is_managed" : "true", + "guid" : "2278D637-312B-4F39-AE26-3AE8170D7EC6", + "token" : "0x6000084", + "native_offset" : "0x0", + "filename" : "MonoDevelop.MSBuildBuilder.exe", + "sizeofimage" : "0x14000", + "timestamp" : "0xb4416f59", + "il_offset" : "0x000ae" + } +, + { + "is_managed" : "true", + "guid" : "2278D637-312B-4F39-AE26-3AE8170D7EC6", + "token" : "0x6000083", + "native_offset" : "0x0", + "filename" : "MonoDevelop.MSBuildBuilder.exe", + "sizeofimage" : "0x14000", + "timestamp" : "0xb4416f59", + "il_offset" : "0x00001" + } +, + { + "is_managed" : "true", + "guid" : "2278D637-312B-4F39-AE26-3AE8170D7EC6", + "token" : "0x600006a", + "native_offset" : "0x0", + "filename" : "MonoDevelop.MSBuildBuilder.exe", + "sizeofimage" : "0x14000", + "timestamp" : "0xb4416f59", + "il_offset" : "0x00048" + } +, + { + "is_managed" : "true", + "guid" : "2278D637-312B-4F39-AE26-3AE8170D7EC6", + "token" : "0x60000a1", + "native_offset" : "0x0", + "filename" : "MonoDevelop.MSBuildBuilder.exe", + "sizeofimage" : "0x14000", + "timestamp" : "0xb4416f59", + "il_offset" : "0x00001" + } +, + { + "is_managed" : "true", + "guid" : "2278D637-312B-4F39-AE26-3AE8170D7EC6", + "token" : "0x6000067", + "native_offset" : "0x0", + "filename" : "MonoDevelop.MSBuildBuilder.exe", + "sizeofimage" : "0x14000", + "timestamp" : "0xb4416f59", + "il_offset" : "0x00001" + } +, + { + "is_managed" : "true", + "guid" : "2278D637-312B-4F39-AE26-3AE8170D7EC6", + "token" : "0x6000075", + "native_offset" : "0x0", + "filename" : "MonoDevelop.MSBuildBuilder.exe", + "sizeofimage" : "0x14000", + "timestamp" : "0xb4416f59", + "il_offset" : "0x00057" + } +, + { + "is_managed" : "true", + "guid" : "2278D637-312B-4F39-AE26-3AE8170D7EC6", + "token" : "0x00000", + "native_offset" : "0x0", + "filename" : "MonoDevelop.MSBuildBuilder.exe", + "sizeofimage" : "0x14000", + "timestamp" : "0xb4416f59", + "il_offset" : "0x0002a" + } +, + { + "is_managed" : "false", + "native_address" : "unregistered" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x00000", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x0000c" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x6004cdb", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x0006a" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x60048c4", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "2278D637-312B-4F39-AE26-3AE8170D7EC6", + "token" : "0x6000039", + "native_offset" : "0x0", + "filename" : "MonoDevelop.MSBuildBuilder.exe", + "sizeofimage" : "0x14000", + "timestamp" : "0xb4416f59", + "il_offset" : "0x00019" + } +, + { + "is_managed" : "true", + "guid" : "2278D637-312B-4F39-AE26-3AE8170D7EC6", + "token" : "0x6000166", + "native_offset" : "0x0", + "filename" : "MonoDevelop.MSBuildBuilder.exe", + "sizeofimage" : "0x14000", + "timestamp" : "0xb4416f59", + "il_offset" : "0x00029" + } +, + { + "is_managed" : "true", + "guid" : "2278D637-312B-4F39-AE26-3AE8170D7EC6", + "token" : "0x6000181", + "native_offset" : "0x0", + "filename" : "MonoDevelop.MSBuildBuilder.exe", + "sizeofimage" : "0x14000", + "timestamp" : "0xb4416f59", + "il_offset" : "0x00001" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x6001fe8", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x00007" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x6001ec3", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x00071" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x6001ec1", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x6001fe6", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x00021" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x6001fce", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x00074" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x6001fe3", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x00000", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x0002a" + } + + ], + "unmanaged_frames" : [ + { + "is_managed" : "false", + "native_address" : "0x10ff50156", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1100f6775", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1100f6dfa", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x10ffbbf46", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x10ff54c65", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x10ffbb2db", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fff61627b5d", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x110221439", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fff614e16a6", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1101c5cb7", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1101a6b2f", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1101c603e", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1101c61bf", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x110060e76", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x110061478", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1101b419f", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1101b44b0", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1100637ab", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x110086675", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x00000", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "2278D637-312B-4F39-AE26-3AE8170D7EC6", + "token" : "0x6000083", + "native_offset" : "0x0", + "filename" : "MonoDevelop.MSBuildBuilder.exe", + "sizeofimage" : "0x14000", + "timestamp" : "0xb4416f59", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "2278D637-312B-4F39-AE26-3AE8170D7EC6", + "token" : "0x60000a1", + "native_offset" : "0x0", + "filename" : "MonoDevelop.MSBuildBuilder.exe", + "sizeofimage" : "0x14000", + "timestamp" : "0xb4416f59", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "2278D637-312B-4F39-AE26-3AE8170D7EC6", + "token" : "0x00000", + "native_offset" : "0x0", + "filename" : "MonoDevelop.MSBuildBuilder.exe", + "sizeofimage" : "0x14000", + "timestamp" : "0xb4416f59", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x10feb062d", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1100cffa4", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1100d43a6", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x11006b6f4", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x00000", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x60048c4", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "2278D637-312B-4F39-AE26-3AE8170D7EC6", + "token" : "0x6000181", + "native_offset" : "0x0", + "filename" : "MonoDevelop.MSBuildBuilder.exe", + "sizeofimage" : "0x14000", + "timestamp" : "0xb4416f59", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x6001ec1", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "true", + "guid" : "7D0BC631-CADD-4A07-BF74-717847E90CFA", + "token" : "0x6001fe3", + "native_offset" : "0x0", + "filename" : "mscorlib.dll", + "sizeofimage" : "0x472000", + "timestamp" : "0xec216ac8", + "il_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x10feb062d", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1100cffa4", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1100f9ec0", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x11002c28c", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x1100f7373", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fff616302eb", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fff61633249", + "native_offset" : "0x00000" + } +, + { + "is_managed" : "false", + "native_address" : "0x7fff6162f40d", + "native_offset" : "0x00000" + } + + ] +} +] +} \ No newline at end of file diff --git a/ZigbeeApp/Shared/Common/CommonPage.cs b/ZigbeeApp/Shared/Common/CommonPage.cs index 89f2577..5f5a967 100755 --- a/ZigbeeApp/Shared/Common/CommonPage.cs +++ b/ZigbeeApp/Shared/Common/CommonPage.cs @@ -45,19 +45,12 @@ Phone.UserView.HomePage.Instance.InitPage(); } - public static string SoftTitle = "ZigBee"; - /// <summary> - /// 鐭俊妯℃澘缂栧彿 - /// </summary> - public static int SoftSmsType = 0; - public static string LogoString = @"Logo/Logo.png"; - public static string RegisterLogoString = @"Logo/Register_logo.png"; //public static string RequestHttpsHost = "https://global.hdlcontrol.com/HangZhouHdlCloudApi"; public static string RequestHttpsHost = "https://global.hdlcontrol.com/ProposedProductionApi"; /// <summary> /// 鐗堟湰鍙� /// </summary> - public static string CodeIDString = "1.0.20050901"; + public static string CodeIDString = "1.0.20051301"; /// <summary> /// 娉ㄥ唽鏉ユ簮(0:HDL On 1:Zigbee) /// </summary> @@ -80,10 +73,6 @@ /// </summary> public static int XLeft = 58; /// <summary> - /// button楂樺害--110 - /// </summary> - public static int ButtonHeight = 110; - /// <summary> /// 浣跨敤鐨勮瑷� /// </summary> public static string ZigBeeLanguage @@ -94,10 +83,6 @@ } } /// <summary> - /// 澶ф帶浠跺渾瑙� --- 10銆備笉鏄笉鍗婂渾閭g銆� - /// </summary> - public static uint BigFormRadius = 10; - /// <summary> /// 榛樿鎵嬫満鍖哄彿涓�86涓浗澶ч檰 /// </summary> public static string PhoneZoneStr = "86"; @@ -106,46 +91,9 @@ /// </summary> public static string ZoneNameStr = "涓浗澶ч檰"; /// <summary> - /// 璺濈椤剁楂樺害--80 鐘舵�佹爮楂樺害 - /// </summary> - public static int NavigationTitle_Y = 80; - /// <summary> - /// 琛岄珮--180 - /// </summary> - public static int RowHeight = 180; - /// <summary> /// APP瀹藉害 -- 1080 /// </summary> public static int AppRealWidth = 1080; - /// <summary> - /// APP楂樺害 -- 1920 - /// </summary> - public static int AppRealHeight = 1920; - /// <summary> - /// 杩斿洖閿窛绂诲乏杈圭殑璺濈 30 - /// </summary> - public static int Navigation_X = 30; - /// <summary> - /// 瀵艰埅鏍忛珮搴�-220 - /// </summary> - public static int Navigation_Height = 220; - /// <summary> - /// 搴曡竟鏍忛珮搴� - /// </summary> - public const int TabbarHeight = 141; - /// <summary> - /// 绾挎潯鐨勯珮搴�--瀹為檯鍍忕礌3 - /// </summary> - public static int LineHeight = 3; - /// <summary> - /// 鏁翠釜鍦烘櫙寤舵椂鏃堕棿--60绉� - /// </summary> - public static int SceneDelayTime = 60; - - /// <summary> - /// 闂撮殧澶氶暱鏃堕棿璇诲彇璁惧鐘舵�� 鍗曚綅 绉� --榛樿30 - /// </summary> - public static int ReadDeviceStatuSpan = 30; /// <summary> /// 璇诲彇澶氬皯椤�--999 /// </summary> @@ -163,21 +111,10 @@ /// 鐢ㄤ簬楠岃瘉閭姝e垯琛ㄨ揪寮� /// </summary> public static string EmailRegexStr = "^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$"; - - - //public static Encoding EncodingUTF8 = Encoding.UTF8; - //public static Encoding EncodingGB2312 = Encoding.GetEncoding("gb2312"); - public static bool IsRemote = false; - public static bool FindGateway = false; /// <summary> /// 褰撳墠缃戠粶杩炴帴鐨勬ā寮� 0:娌℃湁缃戠粶 1锛氳繙绋嬭繛鎺ワ紝涔熷彨3G,4G 2锛歐IFI /// </summary> public static int nowNetworkMode = 0; - /// <summary> - /// 鍗犱綅瀛椾綋澶у皬 - /// 11 - /// </summary> - public static int PlaceHolderTextSize = 11; /// <summary> /// 瀹夊崜鐨勭郴缁熻繑鍥炴寜閿兘鍚︽寜涓�(姣斿鍦ㄥ浠借繕鍘熸椂,涓嶈兘鎸変笅杩斿洖閿�) /// </summary> diff --git a/ZigbeeApp/Shared/Common/Device.cs b/ZigbeeApp/Shared/Common/Device.cs index f7c3ede..75fe150 100755 --- a/ZigbeeApp/Shared/Common/Device.cs +++ b/ZigbeeApp/Shared/Common/Device.cs @@ -1954,26 +1954,10 @@ /// <param name="saveRoadDevice">濡傛灉鍙湁涓�涓洖璺�,鏄惁鎶婂洖璺殑鎴块棿涓�璧蜂慨鏀�</param> public void SaveRealDeviceRoomId(List<CommonDevice> listDevice, string roomId, bool saveRoadDevice = true) { - if (listDevice != null) + if (listDevice == null) { - if (roomId == string.Empty) - { - //閫夋嫨鐨勬槸鏈垎閰� - this.dicDeviceRoomId.Remove(listDevice[0].DeviceAddr); - } - else - { - this.dicDeviceRoomId[listDevice[0].DeviceAddr] = roomId; - } + return; } - - //淇濆瓨璁板綍 - string fullName = UserCenterLogic.CombinePath(DirNameResourse.DeviceRoomIdFile); - UserCenterLogic.SaveFileContent(fullName, this.dicDeviceRoomId); - - //娣诲姞鑷姩澶囦唤 - HdlAutoBackupLogic.AddOrEditorFile(DirNameResourse.DeviceRoomIdFile); - //濡傛灉璁惧鍙湁涓�涓洖璺紝濡傛灉鏀瑰彉浜嗙湡瀹炶澶囧尯鍩燂紝鍒欏畠鐨勫洖璺殑鍖哄煙涔熶竴璧锋敼浜� if (saveRoadDevice == true && listDevice != null && listDevice.Count == 1) { @@ -1983,6 +1967,31 @@ return; } HdlRoomLogic.Current.ChangedRoom(listDevice[0], roomId, false); + } + bool save = false; + if (roomId == string.Empty) + { + //閫夋嫨鐨勬槸鏈垎閰� + this.dicDeviceRoomId.Remove(listDevice[0].DeviceAddr); + save = true; + } + else + { + if (this.dicDeviceRoomId.ContainsKey(listDevice[0].DeviceAddr) == false) + { + this.dicDeviceRoomId[listDevice[0].DeviceAddr] = roomId; + save = true; + } + } + + if (save == true) + { + //淇濆瓨璁板綍 + string fullName = UserCenterLogic.CombinePath(DirNameResourse.DeviceRoomIdFile); + UserCenterLogic.SaveFileContent(fullName, this.dicDeviceRoomId); + + //娣诲姞鑷姩澶囦唤 + HdlAutoBackupLogic.AddOrEditorFile(DirNameResourse.DeviceRoomIdFile); } } @@ -2149,26 +2158,15 @@ listDevice = this.GetDeviceByGatewayID(gwId); } - var dicDevice = new Dictionary<string, CommonDevice>(); + var listCheck = new HashSet<string>(); + var listReturn = new List<CommonDevice>(); foreach (var device in listDevice) { - if (dicDevice.ContainsKey(device.DeviceAddr) == false) + if (listCheck.Contains(device.DeviceAddr) == false) { - dicDevice[device.DeviceAddr] = device; - continue; + listCheck.Add(device.DeviceAddr); + listReturn.Add(device); } - //璁惧鏄惁澶勪簬鍦ㄧ嚎鐘舵�� - bool online = this.CheckDeviceIsOnline(device); - if (online == true) - { - //濡傛灉璁惧鍥炶矾鍦ㄧ嚎,鍒欎紭鍏堜娇鐢ㄥ湪绾跨殑鍥炶矾,鍚庢潵鐨勭洿鎺ヨ鐩� - dicDevice[device.DeviceAddr] = device; - } - } - var listReturn = new List<CommonDevice>(); - foreach (var device in dicDevice.Values) - { - listReturn.Add(device); } return listReturn; } @@ -2184,8 +2182,18 @@ /// <returns></returns> public bool CheckDeviceIsOnline(CommonDevice i_device) { - //0:绂荤嚎 1:鍦ㄧ嚎 2:姝e湪鍒锋柊鐘舵�� - return i_device.IsOnline == 1 || i_device.IsOnline == 2; + var listDevice = this.GetDevicesByMac(i_device.DeviceAddr, false); + foreach (var device in listDevice) + { + //0:绂荤嚎 1:鍦ㄧ嚎 2:姝e湪鍒锋柊鐘舵�� + bool statu = i_device.IsOnline == 1 || i_device.IsOnline == 2; + if (statu == true) + { + //鏈変竴涓洖璺湪绾�,鍗冲湪绾� + return true; + } + } + return false; } /// <summary> @@ -2415,8 +2423,14 @@ if (listCheck.Contains(mainkeys) == false) { listDevice.Add(device); - listCheck.Add(mainkeys); + //鍒锋柊涓�涓嬫湰鍦扮紦瀛� + var localDevice = this.GetDevice(mainkeys); + if (localDevice != null) + { + //鍒锋柊灞炴�� + this.SetDeviceInfoToMain(localDevice, device); + } } } } @@ -2596,8 +2610,9 @@ //濡傛灉鏄笁璺户鐢靛櫒鐨勫洖璺殑璇�,榛樿涓虹伅鍏� else if (mainDevice.Type == DeviceType.OnOffOutput) { - var myType = this.GetHdlMyDeviceEnumInfo(mainDevice); - if (myType != null && myType.ConcreteType == DeviceConcreteType.Relay_ThreeLoad) + //2020.05.13鍙樻洿:缁х數鍣ㄩ兘榛樿涓虹伅鍏� + //var myType = this.GetHdlMyDeviceEnumInfo(mainDevice); + //if (myType != null && myType.ConcreteType == DeviceConcreteType.Relay_ThreeLoad) { if (mainDevice.DfunctionType == DeviceFunctionType.A鏈畾涔�) { diff --git a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs index 198566a..aeccb00 100755 --- a/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs +++ b/ZigbeeApp/Shared/Phone/Category/CategoryMainForm.cs @@ -162,7 +162,7 @@ floors.FloorAction += (floorId) => { btnFloorName.Text = Config.Instance.Home.GetFloorNameById(floorId); - HdlRoomLogic.Current.CurrentRoom = HdlRoomLogic.Current.GetLoveRoom(); + HdlRoomLogic.Current.NowCategoryRoom = HdlRoomLogic.Current.GetLoveRoom(); //鍒锋柊bodyView this.RefreshBodyView(); }; @@ -276,16 +276,21 @@ { //褰撳墠妤煎眰鐨勫叏閮ㄦ埧闂� var lisrRoom = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom(); + if (HdlRoomLogic.Current.NowCategoryRoom == null) + { + //璁剧疆绗竴涓负鍒濆鎴块棿 + HdlRoomLogic.Current.NowCategoryRoom = lisrRoom[0]; + } //鎴块棿鑿滃崟鎺т欢 var roomSwitchContr = new RoomDeviceGroupMenuControl(lisrRoom); roomSwitchContr.Y = Application.GetRealHeight(-55); this.functionSceneAutoBodyView.AddChidren(roomSwitchContr); //璁剧疆鍒濆鍊� - roomSwitchContr.SetDefultIndex(HdlRoomLogic.Current.CurrentRoom.Id); + roomSwitchContr.SetDefultIndex(HdlRoomLogic.Current.NowCategoryRoom.Id); //閫夋嫨浜嬩欢 roomSwitchContr.SelectRoomEvent += (selectRoom) => { - HdlRoomLogic.Current.CurrentRoom = selectRoom; + HdlRoomLogic.Current.NowCategoryRoom = selectRoom; //鍦烘櫙 if (UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex == 0) { @@ -537,7 +542,7 @@ cardContr.chidrenYaxis = listView.rowSpace / 2; //鍒濆鍖栧崱鐗� listView.AddChidren(cardContr); - cardContr.InitControl(device); + cardContr.InitControl(device, HdlRoomLogic.Current.NowCategoryRoom); //鎺т欢璁板綍鍒扮紦瀛樹腑 this.dicDeviceRowControl[LocalDevice.Current.GetDeviceMainKeys(device)] = cardContr; //鍔犵紦瀛�,鐒跺悗鍙戝懡浠� @@ -588,6 +593,46 @@ /// <param name="room"></param> private void RefreshSceneView(Room room) { + //涓讳汉锛岀鐞嗗憳涓撶敤鍒锋柊鎺т欢 + VerticalListRefreshControl listview1 = null; + //鎴愬憳涓撶敤涓嶈兘鍒锋柊鐨勬帶浠� + VerticalListControl listview2 = null; + if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2) + { + //涓讳汉锛岀鐞嗗憳涓撶敤鍒锋柊鎺т欢 + listview1 = new VerticalListRefreshControl(); + functionSceneBodyView.AddChidren(listview1); + //涓嬫媺鍒锋柊 + listview1.BeginHeaderRefreshingAction += () => + { + HdlThreadLogic.Current.RunThread(() => + { + //浠庣綉鍏冲埛鏂板満鏅垪琛� + bool result = HdlSceneLogic.Current.RefreshSceneUIList(); + HdlThreadLogic.Current.RunMain(() => + { + listview1.EndHeaderRefreshing(); + if (result == true) + { + //鍦ㄥ闈㈡竻绌�(鐗规晥鐨勯棶棰�) + this.functionSceneBodyView.RemoveAll(); + HdlThreadLogic.Current.RunMainInThread(() => + { + //鍒锋柊鍦烘櫙鍒嗘敮鎺т欢 + this.RefreshSceneView(room); + }); + } + }); + }); + }; + } + else + { + //鎴愬憳涓撶敤涓嶈兘鍒锋柊鐨勬帶浠� + listview2 = new VerticalListControl(); + functionSceneBodyView.AddChidren(listview2); + } + var listScene = new List<SceneUI>(); foreach (var sceneId in room.ListSceneId) { @@ -599,28 +644,17 @@ } if (listScene.Count == 0) { + //鍦ㄦ粦鍔ㄦ帶浠堕噷闈㈡坊鍔犱竴涓甯� + var frameTable = new FrameLayout(); + listview1?.AddChidren(frameTable); + listview2?.AddChidren(frameTable); //娌℃湁鍦烘櫙{0}璇风偣鍑诲彸涓婅娣诲姞 string[] arryMsg = Language.StringByID(R.MyInternationalizationString.NoScene).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries); - this.ShowNotDataImage(functionSceneBodyView, arryMsg); + this.ShowNotDataImage(frameTable, arryMsg); return; } var dicSceneContr = new Dictionary<int, SceneCategoryView>(); - //涓讳汉锛岀鐞嗗憳涓撶敤鍒锋柊鎺т欢 - VerticalListRefreshControl listview1 = null; - //鎴愬憳涓撶敤涓嶈兘鍒锋柊鐨勬帶浠� - VerticalListControl listview2 = null; - //if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2) - //{ - // listview1 = new VerticalListRefreshControl(); - // functionSceneBodyView.AddChidren(listview1); - //} - //else - { - listview2 = new VerticalListControl(); - functionSceneBodyView.AddChidren(listview2); - } - foreach (var scene in listScene) { //鍦烘櫙鍗$墖鎺т欢 diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs index 2789bd2..737c569 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs @@ -53,6 +53,10 @@ /// 鍒ゆ柇鏄惁鏈夊紑鍏冲姛鑳� /// </summary> private bool isHadOpenSwitch = true; + /// <summary> + /// 褰撳墠閫夋嫨鐨勬埧闂� + /// </summary> + public Common.Room nowSelectRoom = null; #endregion @@ -71,9 +75,11 @@ /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device">璁惧瀵硅薄</param> - public virtual void InitControl(CommonDevice i_device) + /// <param name="i_nowSelectRoom">褰撳墠閫夋嫨鐨勬埧闂�(鏈夌偣鐢ㄥ)</param> + public virtual void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { this.device = i_device; + this.nowSelectRoom = i_nowSelectRoom; //璁惧鍥炬爣鑳屾櫙鎺т欢 this.frameIconBackGroud = new FrameLayout(); frameIconBackGroud.Height = this.GetPictrueRealSize(112); @@ -137,17 +143,17 @@ btnSwitch.SelectedImagePath = "Item/SwitchSelected.png"; //鍒嗕韩鐨勬埧闂�,鍒欎笉鑳界紪杈戝拰鍒犻櫎 - if (HdlRoomLogic.Current.CurrentRoom.IsSharedRoom == false) + if (this.nowSelectRoom.IsSharedRoom == false) { //缂栬緫 var btnEditor = this.AddEditorControl(); btnEditor.ButtonClickEvent += (sender, e) => { var detailInfo = new MainPage.DeviceDetailInfoForm(); - detailInfo.AddForm(i_device, HdlRoomLogic.Current.CurrentRoom); - detailInfo.FormCloseEvent += (curDevice, curRoom) => + detailInfo.AddForm(i_device, this.nowSelectRoom); + detailInfo.FormCloseEvent += () => { - if (HdlRoomLogic.Current.CurrentRoom.IsLove == true) + if (this.nowSelectRoom.IsLove == true) { //褰撳墠鏄枩鐖辨埧闂存椂 if (HdlRoomLogic.Current.IsCollectInRoom(this.device) == false) @@ -159,7 +165,8 @@ return; } } - else if (HdlRoomLogic.Current.CurrentRoom.Id != curRoom.Id) + var curRoom = HdlRoomLogic.Current.GetRoomByDevice(this.device); + if (curRoom == null || this.nowSelectRoom.Id != curRoom.Id) { //鍥炶皟鎺т欢琚Щ闄ょ殑浜嬩欢 this.RowNeedRemoveEvent?.Invoke(); @@ -182,7 +189,7 @@ { //绉婚櫎鏀惰棌(涓嶇浠�涔堟儏鍐�,鏀惰棌閮借绉婚櫎) HdlRoomLogic.Current.DeleteLoveDevice(i_device); - if (HdlRoomLogic.Current.CurrentRoom.IsLove == false) + if (this.nowSelectRoom.IsLove == false) { //浠庢埧闂翠腑绉婚櫎 HdlRoomLogic.Current.DeleteDevice(i_device); @@ -342,10 +349,9 @@ /// 娣卞害鍗$墖淇℃伅鐨勮繑鍥炰簨浠�(搴曞眰涓撶敤) /// </summary> /// <param name="device">璁惧</param> - /// <param name="room">鎴块棿</param> - public void CardDetailInfoBackEvent(CommonDevice device, Common.Room room) + public void CardDetailInfoBackEvent(CommonDevice device) { - if (HdlRoomLogic.Current.CurrentRoom.IsLove == true) + if (this.nowSelectRoom.IsLove == true) { //宸茬粡鍙栨秷鐨勬敹钘� if (HdlRoomLogic.Current.IsCollectInRoom(device) == false) @@ -361,7 +367,7 @@ { //濡傛灉杩欎釜璁惧鏀瑰彉浜嗘埧闂寸殑璇�,鍥炶皟鍗$墖琚垹闄ょ殑鍑芥暟 var nowRoom = HdlRoomLogic.Current.GetRoomByDevice(device); - if (nowRoom == null || nowRoom.Id != HdlRoomLogic.Current.CurrentRoom.Id) + if (nowRoom == null || nowRoom.Id != this.nowSelectRoom.Id) { //鍥炶皟鎺т欢琚Щ闄ょ殑浜嬩欢 this.RowNeedRemoveEvent?.Invoke(); diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAcRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAcRowControl.cs index 8674a16..3ea4dc9 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAcRowControl.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAcRowControl.cs @@ -17,9 +17,9 @@ /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device"></param> - public override void InitControl(CommonDevice i_device) + public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { - base.InitControl(i_device); + base.InitControl(i_device, i_nowSelectRoom); //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 this.AddDetailInfoEvent(i_device); @@ -63,7 +63,7 @@ { //绌鸿皟绫诲瀷鐨勬繁搴﹀崱鐗囩晫闈� var form = new MainPage.ControlForm.DeviceAcDetailCardForm(); - form.AddForm(i_device, HdlRoomLogic.Current.CurrentRoom, 965, 1457); + form.AddForm(i_device, this.nowSelectRoom, 965, 1457); form.FormCloseEvent += this.CardDetailInfoBackEvent; }; } diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirSwitchRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirSwitchRowControl.cs index d039131..9f813fa 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirSwitchRowControl.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceAirSwitchRowControl.cs @@ -17,9 +17,9 @@ /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device"></param> - public override void InitControl(CommonDevice i_device) + public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { - base.InitControl(i_device); + base.InitControl(i_device, i_nowSelectRoom); //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 this.AddDetailInfoEvent(i_device); @@ -85,7 +85,7 @@ //缁х數鍣ㄧ被鍨嬬殑娣卞害鍗$墖鐣岄潰(鍚┖姘斿紑鍏�) var form = new MainPage.ControlForm.DeviceRelayDetailCardForm(); - form.AddForm(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom, 965, backHeight); + form.AddForm(i_device, this.nowSelectRoom, 965, backHeight); form.FormCloseEvent += this.CardDetailInfoBackEvent; }; } diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs index 247ce4f..35c8dc4 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceColorLightRowControl.cs @@ -17,9 +17,9 @@ /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device"></param> - public override void InitControl(CommonDevice i_device) + public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { - base.InitControl(i_device); + base.InitControl(i_device, i_nowSelectRoom); //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 this.AddDetailInfoEvent(i_device); @@ -71,7 +71,7 @@ { //褰╃伅,璋冨厜鍣ㄧ被鍨嬬殑娣卞害鍗$墖鐣岄潰 var form = new MainPage.ControlForm.DeviceColorLightDetailCardForm(); - form.AddForm(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom, 965, 1316); + form.AddForm(i_device, this.nowSelectRoom, 965, 1316); form.FormCloseEvent += this.CardDetailInfoBackEvent; }; } diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs index 0d6511b..9688346 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceCurtainRowControl.cs @@ -38,9 +38,9 @@ /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device"></param> - public override void InitControl(CommonDevice i_device) + public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { - base.InitControl(i_device); + base.InitControl(i_device, i_nowSelectRoom); //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 this.AddDetailInfoEvent(i_device); @@ -116,7 +116,7 @@ { //绐楀笜绫诲瀷鐨勬繁搴﹀崱鐗囩晫闈� var form = new MainPage.ControlForm.DeviceCurtainDetailCardForm(); - form.AddForm(i_device, HdlRoomLogic.Current.CurrentRoom, 965, 1316); + form.AddForm(i_device, this.nowSelectRoom, 965, 1316); form.FormCloseEvent += this.CardDetailInfoBackEvent; }; } diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceDoorLockRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceDoorLockRowControl.cs index cda4706..c1afa2a 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceDoorLockRowControl.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceDoorLockRowControl.cs @@ -25,9 +25,9 @@ /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device"></param> - public override void InitControl(CommonDevice i_device) + public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { - base.InitControl(i_device); + base.InitControl(i_device, i_nowSelectRoom); //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,姝ゅ姛鑳芥棤鏁� if (Common.Config.Instance.Home.IsVirtually == false) @@ -49,7 +49,7 @@ //娣卞害鍗$墖淇℃伅 this.frameTable.ButtonClickEvent += (sender, e) => { - var userDoorLockPage = new UserCenter.DoorLock.UserDoorLockPage(UserCenter.HdlRoomLogic.Current.CurrentRoom, i_device); + var userDoorLockPage = new UserCenter.DoorLock.UserDoorLockPage(this.nowSelectRoom, i_device); UserView.HomePage.Instance.AddChidren(userDoorLockPage); UserView.HomePage.Instance.PageIndex += 1; userDoorLockPage.Show(); diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceFreshAirRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceFreshAirRowControl.cs index 3329e2f..de6520e 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceFreshAirRowControl.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceFreshAirRowControl.cs @@ -13,9 +13,9 @@ /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device"></param> - public override void InitControl(CommonDevice i_device) + public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { - base.InitControl(i_device); + base.InitControl(i_device, i_nowSelectRoom); //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 this.AddDetailInfoEvent(i_device); @@ -57,7 +57,7 @@ { //鏂伴绫诲瀷鐨勬繁搴﹀崱鐗囩晫闈� var form = new MainPage.ControlForm.DeviceFreshAirDetailCardForm(); - form.AddForm(i_device, HdlRoomLogic.Current.CurrentRoom, 965, 1374); + form.AddForm(i_device, this.nowSelectRoom, 965, 1374); form.FormCloseEvent += this.CardDetailInfoBackEvent; }; } diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DevicePmSensorRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DevicePmSensorRowControl.cs index 11f00ed..1663fae 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DevicePmSensorRowControl.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DevicePmSensorRowControl.cs @@ -12,9 +12,9 @@ /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device"></param> - public override void InitControl(CommonDevice i_device) + public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { - base.InitControl(i_device); + base.InitControl(i_device, i_nowSelectRoom); //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 this.AddDetailInfoEvent(i_device); @@ -32,7 +32,7 @@ { //PM2.5浼犳劅鍣ㄧ被鍨嬬殑娣卞害鍗$墖鐣岄潰 var form = new MainPage.ControlForm.DevicePmSensorDetailCardForm(); - form.AddForm(i_device, HdlRoomLogic.Current.CurrentRoom, 965, 1374); + form.AddForm(i_device, this.nowSelectRoom, 965, 1374); form.FormCloseEvent += this.CardDetailInfoBackEvent; }; } diff --git a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceRelayRowControl.cs b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceRelayRowControl.cs index 34e1d60..38a38bc 100755 --- a/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceRelayRowControl.cs +++ b/ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/DeviceRelayRowControl.cs @@ -17,9 +17,9 @@ /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device"></param> - public override void InitControl(CommonDevice i_device) + public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { - base.InitControl(i_device); + base.InitControl(i_device, i_nowSelectRoom); //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 this.AddDetailInfoEvent(i_device); @@ -86,7 +86,7 @@ //缁х數鍣ㄧ被鍨嬬殑娣卞害鍗$墖鐣岄潰(鍚┖姘斿紑鍏�) var form = new MainPage.ControlForm.DeviceRelayDetailCardForm(); - form.AddForm(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom, 965, backHeight); + form.AddForm(i_device, this.nowSelectRoom, 965, backHeight); form.FormCloseEvent += this.CardDetailInfoBackEvent; }; } diff --git a/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs b/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs index d0417ce..f7b2221 100755 --- a/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs +++ b/ZigbeeApp/Shared/Phone/CommonForm/EditorCommonForm.cs @@ -188,13 +188,16 @@ /// <param name="parameter">鍚姩鍙傛暟锛氬弬鏁扮敱鎸囧畾鐢婚潰鐨凷howForm鍑芥暟鎵�鎸囧畾</param> public override void AddForm(params object[] parameter) { + //鐣岄潰鍔犺浇涓� + ControlCommonResourse.IsFormAdding = true; + base.AddForm(parameter); - //妫�娴嬭兘鍚﹁拷鍔犵敾闈� - if (UserCenterLogic.CheckCanAddForm(this) == false) - { - return; - } + //妫�娴嬭兘鍚﹁拷鍔犵敾闈� 2020.05.14鑸嶅純 + //if (UserCenterLogic.CheckCanAddForm(this) == false) + //{ + // return; + //} UserView.HomePage.Instance.AddChidren(this); UserView.HomePage.Instance.PageIndex += 1; @@ -204,6 +207,9 @@ //鎵цShowForm()鏂规硶 this.LoadShowFormMethod(parameter); + + //鐣岄潰鍔犺浇缁撴潫 + ControlCommonResourse.IsFormAdding = false; } #endregion @@ -225,9 +231,38 @@ this.m_parameter = null; //娓呯┖bodyFrame this.ClearBodyFrame(); - } + } #endregion + + #region 鈻� 娣诲姞甯姪鎺т欢_______________________ + + /// <summary> + /// 娣诲姞鏌ョ湅甯姪鎺т欢 + /// </summary> + /// <returns></returns> + public NormalViewControl AddHelpControl() + { + //鏌ョ湅甯姪 + var btnHelp = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(50), false); + btnHelp.Y = Application.GetRealHeight(1388); + btnHelp.TextSize = 12; + btnHelp.TextAlignment = TextAlignment.Center; + btnHelp.TextColor = UserCenterColor.Current.TextOrangeColor; + btnHelp.Text = Language.StringByID(R.MyInternationalizationString.uSearchHelp); + bodyFrameLayout.AddChidren(btnHelp); + //搴曠嚎 + int lineWidth = btnHelp.GetRealWidthByText(); + var btnLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false); + btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor; + btnLine.Gravity = Gravity.CenterHorizontal; + btnLine.Y = btnHelp.Bottom - Application.GetRealHeight(8); + bodyFrameLayout.AddChidren(btnLine); + + return btnHelp; + } + + #endregion #region 鈻� 鏄剧ず閲嶆柊鍔犺浇_______________________ @@ -289,35 +324,6 @@ { } - #endregion - - #region 鈻� 娣诲姞甯姪鎺т欢_______________________ - - /// <summary> - /// 娣诲姞鏌ョ湅甯姪鎺т欢 - /// </summary> - /// <returns></returns> - public NormalViewControl AddHelpControl() - { - //鏌ョ湅甯姪 - var btnHelp = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(50), false); - btnHelp.Y = Application.GetRealHeight(1388); - btnHelp.TextSize = 12; - btnHelp.TextAlignment = TextAlignment.Center; - btnHelp.TextColor = UserCenterColor.Current.TextOrangeColor; - btnHelp.Text = Language.StringByID(R.MyInternationalizationString.uSearchHelp); - bodyFrameLayout.AddChidren(btnHelp); - //搴曠嚎 - int lineWidth = btnHelp.GetRealWidthByText(); - var btnLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false); - btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor; - btnLine.Gravity = Gravity.CenterHorizontal; - btnLine.Y = btnHelp.Bottom - Application.GetRealHeight(8); - bodyFrameLayout.AddChidren(btnLine); - - return btnHelp; - } - #endregion #region 鈻� 鏄剧ず娌℃湁鏁版嵁鐨勫浘鍍忔樉绀虹壒鏁坃________ diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs index 742b6f6..8790293 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs @@ -83,9 +83,6 @@ public async void Read() { - - - CommonPage.Loading.Start(); if (!BoolExist()) { @@ -101,28 +98,34 @@ { continue; } - bool yes = false; - for (int a = 0; a < logic.Accounts.Count; a++) - { - //Option4鏄澶噈ac锛汷ption2鏄澶囩鍙o紱 - if (logic.Accounts[a]["Option4"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[a]["Option2"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString()) - { - //鏌ユ壘鏄惁鏄偅涓棬閿侊紱 - //濡傛灉涓嶆槸璇ラ棬閿佽仈鍔ㄤ簨浠朵笉鏄剧ず鍑烘潵; - yes = false; - break; - } - if (logic.Accounts[a]["Account"].ToString() == Config.Instance.Guid) - { - //鏌ユ壘鑷繁璐﹀彿涓嬬殑鍒涘缓鑱斿姩浜嬩欢锛� - yes = true; - break; - } - } - if (yes) - { - Common.Logic.LockLogicList.Add(listlogic[j]); - } + Common.Logic.LockLogicList.Add(listlogic[j]); + //bool yes = false; + //for (int a = 0; a < logic.Accounts.Count; a++) + //{ + // //Option4鏄澶噈ac锛汷ption2鏄澶囩鍙o紱 + // if (logic.Accounts[a]["Option4"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[a]["Option2"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString()) + // { + // //鏌ユ壘鏄惁鏄偅涓棬閿侊紱 + // //濡傛灉涓嶆槸璇ラ棬閿佽仈鍔ㄤ簨浠朵笉鏄剧ず鍑烘潵; + // yes = false; + + // } + // else + // { + // yes = true; + + // } + // //if (logic.Accounts[a]["Account"].ToString() == Config.Instance.Guid) + // //{ + // // //鏌ユ壘鑷繁璐﹀彿涓嬬殑鍒涘缓鑱斿姩浜嬩欢锛� + // // yes = true; + // // break; + // //} + //} + //if (yes) + //{ + // Common.Logic.LockLogicList.Add(listlogic[j]); + //} } } } @@ -326,14 +329,17 @@ //鏌ユ壘鏄惁鏄偅涓棬閿侊紱 //濡傛灉涓嶆槸璇ラ棬閿佽仈鍔ㄤ簨浠朵笉鏄剧ず鍑烘潵; yes = false; - break; } - if (logic.Accounts[j]["Account"].ToString() == Config.Instance.Guid) + else { - //鏌ユ壘鑷繁璐﹀彿涓嬬殑鍒涘缓鑱斿姩浜嬩欢锛� yes = true; - break; } + //if (logic.Accounts[j]["Account"].ToString() == Config.Instance.Guid) + //{ + // //鏌ユ壘鑷繁璐﹀彿涓嬬殑鍒涘缓鑱斿姩浜嬩欢锛� + // yes = true; + // break; + //} } return yes; diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs index 2e68b30..3a853b5 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs @@ -724,6 +724,10 @@ actionsInfo.Add("Epoint", common.DeviceEpoint); actionsInfo.Add("PassData", "055704010113");//榛樿闂ㄩ攣甯稿叧 + Dictionary<string, string> accounts = new Dictionary<string, string>(); + accounts.Add("Option4", common.DeviceAddr.ToString());//鐢ㄤ簬鍒ゆ柇璇嗗埆鏄摢涓棬閿�; + accounts.Add("Option2", common.DeviceEpoint.ToString()); + Common.Logic currentLogic = new Common.Logic(); currentLogic.IsEnable = 1;//榛樿涓哄紑 currentLogic.TimeAttribute.Repeat = 0;//鎵ц涓�娆� @@ -731,6 +735,7 @@ currentLogic.LogicName = Language.StringByID(R.MyInternationalizationString.openmode); currentLogic.Conditions.Add(timeConditionsInfo); currentLogic.Actions.Add(actionsInfo); + currentLogic.Accounts.Add(accounts); var logicIfon = await Send.AddModifyLogic(currentLogic); if (logicIfon != null && logicIfon.LogicId != 0) { @@ -747,24 +752,42 @@ /// 娉ㄦ剰(鍙傛暟:2-甯稿紑鑷姩鍖�;3-澶辨晥鏃堕棿鑷姩鍖�); /// 杩斿洖鍊硷細0涓嶅瓨鍦�;鍏跺畠鍊奸兘瀛樺湪; /// </summary> - public static async System.Threading.Tasks.Task<int> Exist(int valueInt) + public static async System.Threading.Tasks.Task<int> Exist(int valueInt, ZigBee.Device.DoorLock doorLock) { int exist = 0; var Idlist = await Send.GetLogicId(valueInt); if (Idlist.Count != 0) { //榛樿鍙栫涓�涓�昏緫ID - exist = Idlist[0]; - + var id = Idlist[0]; + if (valueInt != 3) + { + exist = id; + } + else + { + var logic = await Send.GetLogic(id, 3); + if (logic != null) + { + if (ExistLogic(logic, doorLock)) + { + exist = id; + } + else + { + exist = 0; + } + } + } } return exist; } - + ///<summary> - ///鑾峰彇閫昏緫淇℃伅 + ///鑾峰彇闂ㄩ攣閫昏緫淇℃伅 /// 杩斿洖鍊硷細null涓嶅瓨鍦�;鍏跺畠鍊奸兘瀛樺湪; /// </summary> - public static async System.Threading.Tasks.Task<Common.Logic> GetLogicIfon() + public static async System.Threading.Tasks.Task<Common.Logic> GetLogicIfon(ZigBee.Device.DoorLock doorLock) { Common.Logic logic = null; var Idlist = await Send.GetLogicId(3); @@ -773,15 +796,19 @@ //榛樿鍙栫涓�涓�昏緫ID(鏃舵晥鎬у彧鏈変竴鏉¢�昏緫) int exist = Idlist[0]; logic = await Send.GetLogic(exist, 3); + if (!ExistLogic(logic, doorLock)) + { + logic = null; + } } return logic; } ///<summary> - ///鍒犻櫎鎵�鏈夋椂鏁堟�ц嚜鍔ㄥ寲 + ///鍒犻櫎璇ラ棬閿佹墍鏈夋椂鏁堟�ц嚜鍔ㄥ寲 /// 杩斿洖鍊硷細true鎴愬姛;false澶辫触; /// </summary> - public static async System.Threading.Tasks.Task<bool> GetLogicAll() + public static async System.Threading.Tasks.Task<bool> GetLogicAll(ZigBee.Device.DoorLock doorLock) { bool _if = false; var Idlist = await Send.GetLogicId(3); @@ -792,15 +819,44 @@ for (int i = 0; i < Idlist.Count; i++) { int id = Idlist[i]; - //鏈潵鍙湁涓�鏉℃椂鏁堟�ц嚜鍔ㄥ寲锛� - //闃叉鐗规畩鎯呭喌,鎵惧埌灏卞垹闄ゆ帀; - Send.DelLogic(id); + var logic = await Send.GetLogic(id, 3); + if (logic != null) + { + if (ExistLogic(logic, doorLock)) + { + //鏈潵鍙湁涓�鏉℃椂鏁堟�ц嚜鍔ㄥ寲锛� + //闃叉鐗规畩鎯呭喌,鎵惧埌灏卞垹闄ゆ帀; + Send.DelLogic(id); + } + } } } return _if; } - + /// <summary> + /// 鏌ユ壘杩欎竴鏉¤嚜鍔ㄥ寲鏄惁灞炰簬璇ラ棬閿� + /// </summary> + /// <returns></returns> + public static bool ExistLogic(Common.Logic logic, ZigBee.Device.DoorLock doorLock) + { + bool yes = false; + for (int j = 0; j < logic.Accounts.Count; j++) + { + //Option4鏄澶噈ac锛汷ption2鏄澶囩鍙o紱 + if (logic.Accounts[j]["Option4"].ToString() != doorLock.DeviceAddr && logic.Accounts[j]["Option2"].ToString() != doorLock.DeviceEpoint.ToString()) + { + //鏌ユ壘鏄惁鏄偅涓棬閿侊紱 + //濡傛灉涓嶆槸璇ラ棬閿佽仈鍔ㄤ簨浠朵笉鏄剧ず鍑烘潵; + yes = false; + } + else + { + yes = true; + } + } + return yes; + } } } diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs index 4c51329..08d8d07 100755 --- a/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs @@ -64,7 +64,7 @@ { //杩涙潵鏇存柊涓�娆� //鏌ユ壘鏄惁瀛樺湪鏃舵晥鎬ц嚜鍔ㄥ寲锛涙湁鐨勮瘽灏辫繑鍥炶嚜鍔ㄥ寲瀵硅薄; - var logic = await SkipView.GetLogicIfon(); + var logic = await SkipView.GetLogicIfon(Send.CurrentDoorLock); if (logic != null) { try @@ -162,7 +162,10 @@ actionsInfo.Add("LinkType", 8); actionsInfo.Add("DeviceAddr", Send.CurrentDoorLock.DeviceAddr); actionsInfo.Add("Epoint", "200"); - actionsInfo.Add("PassData", "055704010113");//榛樿闂ㄩ攣甯稿叧 + actionsInfo.Add("PassData", "055704010113");//榛樿闂ㄩ攣甯稿叧 + Dictionary<string, string> accounts = new Dictionary<string, string>(); + accounts.Add("Option4", Send.CurrentDoorLock.DeviceAddr.ToString());//鐢ㄤ簬鍒ゆ柇璇嗗埆鏄摢涓棬閿�; + accounts.Add("Option2", Send.CurrentDoorLock.DeviceEpoint.ToString()); //new涓�涓柊閫昏緫瀵硅薄锛� //鏂板闂ㄩ攣甯稿紑妯″紡鑷姩鍖栧叆鍙o紱 Common.Logic.CurrentLogic = new Common.Logic(); @@ -170,7 +173,8 @@ Common.Logic.CurrentLogic.LogicType = 2;//鏍囪閫昏緫绫诲瀷 Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.openmode); Common.Logic.CurrentLogic.Conditions.Add(timeConditionsInfo);//娣诲姞鏉′欢 - Common.Logic.CurrentLogic.Actions.Add(actionsInfo);//娣诲姞鐩爣 + Common.Logic.CurrentLogic.Actions.Add(actionsInfo);//娣诲姞鐩爣 + Common.Logic.CurrentLogic.Accounts.Add(accounts); var oneLogic = new OneLogic(); UserView.HomePage.Instance.AddChidren(oneLogic); UserView.HomePage.Instance.PageIndex += 1; @@ -264,6 +268,7 @@ { if (logicId != 0) { + ///鏈夊彲鑳藉彧鏈夊父寮�妯″紡锛屾病鏈夋椂鏁堟�ц嚜鍔ㄥ寲 Send.DelLogic(logicId); } @@ -387,43 +392,47 @@ else { ///鍥犱负鏈夊父寮�妯″紡涓嬫墠鍙互鍒涘缓澶辨晥閫昏緫锛� - SkipView.GetLogicAll();//鍒犻櫎涔嬪墠鎵�鏈夊け鏁堥�昏緫 + SkipView.GetLogicAll(Send.CurrentDoorLock);//鍒犻櫎涔嬪墠鎵�鏈夊け鏁堥�昏緫 var addResult = await SkipView.LockAddModifyLogic(int.Parse(str), Send.CurrentDoorLock);//娣诲姞涓�鏉″け鏁堥�昏緫 if (addResult == 0) - { + { ///鍙璇村鏋滃父寮�妯″紡寮�锛屽垱寤鸿嚜鍔ㄥ寲澶辫触锛岄偅涔堝皢瑕佸彂涓�鏉″父寮�妯″紡鍏抽棴鍛戒护; UserCenter.DoorLock.DoorLockCommonInfo.DelNormallyOpenMode(Send.CurrentDoorLock); ///鎻愮ず澶辫触 LogicView.TipView.ShowFlashTip(Language.StringByID(MyInternationalizationString.addFailed)); - return; - } - logicId = addResult; - timeValue = int.Parse(str); - Send.CurrentDoorLock.IsDoorLockNormallyMode = true; - ModeView(); - //娣诲姞App寮�鍚父寮�妯″紡鐨勫巻鍙茶褰� - UserCenter.HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(Send.CurrentDoorLock, 9001, string.Empty); - } - } - catch - { + return; + } + else + { + logicId = addResult; + timeValue = int.Parse(str); + Send.CurrentDoorLock.IsDoorLockNormallyMode = true; + ModeView(); + ///娣诲姞APP寮�鍚父寮�妯″紡鐨勫巻鍙茶褰� + UserCenter.HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(Send.CurrentDoorLock,9001,string.Empty); + } - } - finally - { - Application.RunOnMainThread(() => - { - CommonPage.Loading.Hide(); - }); - } - }); + } + } + catch + { - }); + } + finally + { + Application.RunOnMainThread(() => + { + CommonPage.Loading.Hide(); - }; + }); + } + }); + + }); + + }; } - listLogicFl.Y = fLayout.Bottom; listLogicFl.X = Application.GetRealWidth(58); listLogicFl.Height = Application.GetRealHeight(Method.H - 184) - fLayout.Height; @@ -454,8 +463,11 @@ if (logic.LogicType != 2) { continue; + } + if (SkipView.ExistLogic(logic,Send.CurrentDoorLock)) + { + Common.Logic.SoneLogicList.Add(logic); } - Common.Logic.SoneLogicList.Add(logic); } } } diff --git a/ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs b/ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs index b726d07..2166a86 100755 --- a/ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs +++ b/ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs @@ -32,6 +32,11 @@ /// <param name="account">鐧婚檰璐﹀彿</param> public void ShowForm(string account = "") { + if (account == string.Empty) + { + //浣跨敤涓婁竴娆$櫥闄嗙殑璐﹀彿 + account = Common.Config.Instance.Account; + } if (Config.Instance.IsLogin == true) { return; diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs index 87b1643..f502459 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs @@ -16,15 +16,15 @@ /// <summary> /// 鐣岄潰鍏抽棴浜嬩欢 /// </summary> - public Action<CommonDevice, Common.Room> FormCloseEvent = null; + public Action<CommonDevice> FormCloseEvent = null; /// <summary> /// 璁惧瀵硅薄 /// </summary> public CommonDevice device = null; /// <summary> - /// 鎴块棿瀵硅薄 + /// 褰撳墠閫夋嫨鐨勬埧闂村璞�(鍐嶆鍒锋柊鐣岄潰鏃�,杩欎釜涓滆タ鏈夊彲鑳芥槸null) /// </summary> - public Common.Room room = null; + public Common.Room nowSelectRoom = null; /// <summary> /// 鐘舵�佹帶浠� /// </summary> @@ -66,13 +66,13 @@ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) /// </summary> /// <param name="i_device">璁惧瀵硅薄</param> - /// <param name="i_room">鎴块棿</param> + /// <param name="i_nowSelectRoom">鎴块棿</param> /// <param name="i_backWidth">鐧借壊鑳屾櫙鐨勫搴�(闈炵湡瀹炲��)</param> /// <param name="i_backHeight">鐧借壊鑳屾櫙鐨勯珮搴�(闈炵湡瀹炲��)</param> - public void ShowForm(CommonDevice i_device, Common.Room i_room, int i_backWidth, int i_backHeight) + public void ShowForm(CommonDevice i_device, Common.Room i_nowSelectRoom, int i_backWidth, int i_backHeight) { this.CurrentText = Language.StringByID(R.MyInternationalizationString.Current) + " "; - this.room = i_room; + this.nowSelectRoom = i_nowSelectRoom; this.backFrameWidth = i_backWidth; this.backFrameHeight = i_backHeight; @@ -84,7 +84,7 @@ btnMore.ButtonClickEvent += (sender, e) => { var detailInfo = new DeviceDetailInfoForm(); - detailInfo.AddForm(device, room); + detailInfo.AddForm(device, nowSelectRoom); }; //鍒濆鍖栦腑閮ㄤ俊鎭� @@ -166,7 +166,15 @@ btnRoomName.TextSize = 12; btnRoomName.TextColor = UserCenterColor.Current.White; btnRoomName.Gravity = Gravity.CenterVertical; - btnRoomName.Text = this.room.Name; + if (this.nowSelectRoom != null) + { + btnRoomName.Text = this.nowSelectRoom.Name; + } + else + { + //鏈垎閰� + btnRoomName.TextID = R.MyInternationalizationString.uDeviceNotAssignedRoom; + } frameRoomBlack.AddChidren(btnRoomName); //鏀惰棌 @@ -328,9 +336,9 @@ public override int FormActionAgainEvent() { //濡傛灉涓嶆槸鍠滅埍鎴块棿鐨勮瘽,瀹冪殑鎴块棿鏈夊彲鑳借鍒囨崲浜� - if (this.room.IsLove == false) + if (this.nowSelectRoom == null || this.nowSelectRoom.IsLove == false) { - this.room = HdlRoomLogic.Current.GetRoomByDevice(this.device); + this.nowSelectRoom = HdlRoomLogic.Current.GetRoomByDevice(this.device); } //濡傛灉鍔熻兘绫诲瀷鍙樻洿浜� if (this.nowDeviceFuncType != this.device.DfunctionType) @@ -344,8 +352,15 @@ this.btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(this.device); btnDeviceName.Width = btnDeviceName.GetRealWidthByText(); btnDeviceName.Gravity = Gravity.CenterHorizontal; - - this.btnRoomName.Text = this.room.Name; + if (this.nowSelectRoom == null) + { + //鏈垎閰� + this.btnRoomName.TextID = R.MyInternationalizationString.uDeviceNotAssignedRoom; + } + else + { + this.btnRoomName.Text = this.nowSelectRoom.Name; + } } return 1; @@ -365,7 +380,7 @@ HdlGatewayReceiveLogic.Current.RemoveEvent("DeviceDetailCardAttribute" + mainKeys); //鍥炶皟鍑芥暟 - this.FormCloseEvent?.Invoke(this.device, this.room); + this.FormCloseEvent?.Invoke(this.device); this.FormCloseEvent = null; base.CloseFormBefore(); diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs index 721b112..e966a0b 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs @@ -57,6 +57,10 @@ /// 鍒ゆ柇鏄惁鏈夊紑鍏冲姛鑳� /// </summary> private bool isHadOpenSwitch = true; + /// <summary> + /// 褰撳墠閫夋嫨鐨勬埧闂� + /// </summary> + public Common.Room nowSelectRoom = null; #endregion @@ -79,9 +83,11 @@ /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device">鎸囧畾璁惧</param> - public virtual void InitControl(CommonDevice i_device) + /// <param name="i_nowSelectRoom">褰撳墠閫夋嫨鐨勬埧闂�(鏈夌偣鐢ㄥ)</param> + public virtual void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { this.device = i_device; + this.nowSelectRoom = i_nowSelectRoom; //鑳屾櫙鍥剧墖 this.btnBackGroud = new PicViewControl(this.Width, this.Height, false); btnBackGroud.UnSelectedImagePath = "Item/FunctionCardView.png"; @@ -115,7 +121,7 @@ { //鍙栨秷鏀惰棌 HdlRoomLogic.Current.DeleteLoveDevice(i_device); - if (HdlRoomLogic.Current.CurrentRoom.IsLove == true) + if (this.nowSelectRoom.IsLove == true) { //濡傛灉褰撳墠鎴块棿鏄垜鐨勫枩鐖辩殑璇�,鍥炶皟鍗$墖琚垹闄ょ殑浜嬩欢 this.CardNeedRemoveEvent?.Invoke(); @@ -308,10 +314,9 @@ /// 娣卞害鍗$墖淇℃伅鐨勮繑鍥炰簨浠�(搴曞眰涓撶敤) /// </summary> /// <param name="device">璁惧</param> - /// <param name="room">鎴块棿</param> - public void CardDetailInfoBackEvent(CommonDevice device, Common.Room room) + public void CardDetailInfoBackEvent(CommonDevice device) { - if (HdlRoomLogic.Current.CurrentRoom.IsLove == true) + if (this.nowSelectRoom.IsLove == true) { //濡傛灉鏄富椤靛彇娑堟悳钘忕殑璇�,鍥炶皟鍗$墖琚垹闄ょ殑鍑芥暟 if (HdlRoomLogic.Current.IsCollectInRoom(device) == false) @@ -324,7 +329,7 @@ { //濡傛灉杩欎釜璁惧鏀瑰彉浜嗘埧闂寸殑璇�,鍥炶皟鍗$墖琚垹闄ょ殑鍑芥暟 var nowRoom = HdlRoomLogic.Current.GetRoomByDevice(device); - if (nowRoom == null || nowRoom.Id != HdlRoomLogic.Current.CurrentRoom.Id) + if (nowRoom == null || nowRoom.Id != this.nowSelectRoom.Id) { this.CardNeedRemoveEvent?.Invoke(); return; diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs index fecfda3..e3836a7 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAcCardControl.cs @@ -17,9 +17,9 @@ /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device"></param> - public override void InitControl(CommonDevice i_device) + public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { - base.InitControl(i_device); + base.InitControl(i_device, i_nowSelectRoom); //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 this.AddDetailInfoEvent(i_device); @@ -74,7 +74,7 @@ //绌鸿皟绫诲瀷鐨勬繁搴﹀崱鐗囩晫闈� var form = new ControlForm.DeviceAcDetailCardForm(); - form.AddForm(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom, 965, 1457); + form.AddForm(i_device, this.nowSelectRoom, 965, 1457); form.FormCloseEvent += this.CardDetailInfoBackEvent; }; } diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAirSwitchCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAirSwitchCardControl.cs index d37e7e5..83fa9c1 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAirSwitchCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceAirSwitchCardControl.cs @@ -17,9 +17,9 @@ /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device"></param> - public override void InitControl(CommonDevice i_device) + public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { - base.InitControl(i_device); + base.InitControl(i_device, i_nowSelectRoom); //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 this.AddDetailInfoEvent(i_device); @@ -87,7 +87,7 @@ //缁х數鍣ㄧ被鍨嬬殑娣卞害鍗$墖鐣岄潰(鍚┖姘斿紑鍏�) var form = new ControlForm.DeviceRelayDetailCardForm(); - form.AddForm(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom, 965, backHeight); + form.AddForm(i_device, this.nowSelectRoom, 965, backHeight); form.FormCloseEvent += this.CardDetailInfoBackEvent; }; } diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs index 1d249da..5f4b1ad 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceColorLightCardControl.cs @@ -17,9 +17,9 @@ /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device"></param> - public override void InitControl(CommonDevice i_device) + public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { - base.InitControl(i_device); + base.InitControl(i_device, i_nowSelectRoom); //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 this.AddDetailInfoEvent(i_device); @@ -73,7 +73,7 @@ //褰╃伅,璋冨厜鍣ㄧ被鍨嬬殑娣卞害鍗$墖鐣岄潰 var form = new ControlForm.DeviceColorLightDetailCardForm(); - form.AddForm(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom, 965, 1316); + form.AddForm(i_device, this.nowSelectRoom, 965, 1316); form.FormCloseEvent += this.CardDetailInfoBackEvent; }; } diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs index e0184f4..974068c 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceCurtainCardControl.cs @@ -17,9 +17,9 @@ /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device"></param> - public override void InitControl(CommonDevice i_device) + public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { - base.InitControl(i_device); + base.InitControl(i_device, i_nowSelectRoom); //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 this.AddDetailInfoEvent(i_device); @@ -73,7 +73,7 @@ Common.CommonPage.Instance.IsDrawerLockMode = true; //绐楀笜绫诲瀷鐨勬繁搴﹀崱鐗囩晫闈� var form = new ControlForm.DeviceCurtainDetailCardForm(); - form.AddForm(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom, 965, 1316); + form.AddForm(i_device, this.nowSelectRoom, 965, 1316); form.FormCloseEvent += this.CardDetailInfoBackEvent; }; } diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDoorLockCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDoorLockCardControl.cs index fdc89bc..bc8a1b5 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDoorLockCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceDoorLockCardControl.cs @@ -16,9 +16,9 @@ /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device"></param> - public override void InitControl(CommonDevice i_device) + public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { - base.InitControl(i_device); + base.InitControl(i_device, i_nowSelectRoom); //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 if (Common.Config.Instance.Home.IsVirtually == false) { @@ -41,7 +41,7 @@ { Common.CommonPage.Instance.IsDrawerLockMode = true; - var userDoorLockPage = new UserCenter.DoorLock.UserDoorLockPage(UserCenter.HdlRoomLogic.Current.CurrentRoom, i_device); + var userDoorLockPage = new UserCenter.DoorLock.UserDoorLockPage(this.nowSelectRoom, i_device); userDoorLockPage.IsDrawerLockMode = true; UserView.HomePage.Instance.AddChidren(userDoorLockPage); UserView.HomePage.Instance.PageIndex += 1; diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceFreshAirCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceFreshAirCardControl.cs index 9fc1779..9ff6bb4 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceFreshAirCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceFreshAirCardControl.cs @@ -7,16 +7,16 @@ /// 鏂伴鍗$墖鐨勬帶浠� /// </summary> public class DeviceFreshAirCardControl : DeviceCardCommon - { + { #region 鈻� 鍒濆鍖朹____________________________ - + /// <summary> /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device"></param> - public override void InitControl(CommonDevice i_device) + public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { - base.InitControl(i_device); + base.InitControl(i_device, i_nowSelectRoom); //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 this.AddDetailInfoEvent(i_device); @@ -71,7 +71,7 @@ //鏂伴绫诲瀷鐨勬繁搴﹀崱鐗囩晫闈� var form = new MainPage.ControlForm.DeviceFreshAirDetailCardForm(); - form.AddForm(i_device, HdlRoomLogic.Current.CurrentRoom, 965, 1374); + form.AddForm(i_device, this.nowSelectRoom, 965, 1374); form.FormCloseEvent += this.CardDetailInfoBackEvent; }; } diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceRelayCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceRelayCardControl.cs index 738ffde..6d7bcb2 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceRelayCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/DeviceRelayCardControl.cs @@ -17,9 +17,9 @@ /// 鍒濆鍖栨帶浠� /// </summary> /// <param name="i_device"></param> - public override void InitControl(CommonDevice i_device) + public override void InitControl(CommonDevice i_device, Common.Room i_nowSelectRoom) { - base.InitControl(i_device); + base.InitControl(i_device, i_nowSelectRoom); //娣诲姞璺宠浆娣卞害鍗$墖淇℃伅浜嬩欢 this.AddDetailInfoEvent(i_device); @@ -88,7 +88,7 @@ //缁х數鍣ㄧ被鍨嬬殑娣卞害鍗$墖鐣岄潰(鍚┖姘斿紑鍏�) var form = new ControlForm.DeviceRelayDetailCardForm(); - form.AddForm(i_device, UserCenter.HdlRoomLogic.Current.CurrentRoom, 965, backHeight); + form.AddForm(i_device, this.nowSelectRoom, 965, backHeight); form.FormCloseEvent += this.CardDetailInfoBackEvent; }; } diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs index 58b89b3..604a490 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs @@ -150,7 +150,7 @@ { //鍙栨秷鏀惰棌 HdlSceneLogic.Current.DeleteLoveScene(i_scene); - if (HdlRoomLogic.Current.CurrentRoom.IsLove == true) + if (HdlRoomLogic.Current.NowMainPageRoom.IsLove == true) { //濡傛灉褰撳墠鎴块棿鏄垜鐨勫枩鐖辩殑璇�,鍥炶皟鍗$墖琚垹闄ょ殑浜嬩欢 this.CardNeedRemoveEvent?.Invoke(); diff --git a/ZigbeeApp/Shared/Phone/MainPage/DeviceDetailInfoForm.cs b/ZigbeeApp/Shared/Phone/MainPage/DeviceDetailInfoForm.cs index 8bec1a6..0a03bdf 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/DeviceDetailInfoForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/DeviceDetailInfoForm.cs @@ -17,13 +17,13 @@ /// <summary> /// 鐣岄潰鍏抽棴浜嬩欢(璇ヤ簨浠剁洰鍓嶇粰鍒嗙被鐣岄潰鐨勮嚜瀹氫箟琛屾帶浠朵娇鐢�) /// </summary> - public Action<CommonDevice, Room> FormCloseEvent = null; + public Action FormCloseEvent = null; /// <summary> /// 璁惧瀵硅薄 /// </summary> private CommonDevice device; /// <summary> - /// 鎴块棿瀵硅薄(杩欎釜鎴块棿鏈夊彲鑳芥槸鍠滅埍) + /// 鎴块棿瀵硅薄(杩欎釜鎴块棿鏈夊彲鑳芥槸鍠滅埍,鏈夊彲鑳芥槸null) /// </summary> private Room room = null; /// <summary> @@ -132,7 +132,7 @@ }; //鍠滅埍鎴块棿涓嶅厑璁稿彉鏇村尯鍩� - if (this.room.IsLove == false) + if (this.room == null || this.room.IsLove == false) { //鎵�灞炲尯鍩� var rowBeloneArea = new BelongAreaControl(listview.rowSpace / 2); @@ -232,7 +232,7 @@ btnNote.AddBottomLine(); //鍠滅埍鎴块棿涓嶅厑璁稿嚭鐜板尯鍩� - if (this.room.IsLove == false) + if (this.room == null || this.room.IsLove == false) { //鎵�灞炲尯鍩� caption = Language.StringByID(R.MyInternationalizationString.uBelongArea); @@ -345,7 +345,7 @@ /// </summary> public override void CloseFormBefore() { - this.FormCloseEvent?.Invoke(this.device, this.room); + this.FormCloseEvent?.Invoke(); this.FormCloseEvent = null; base.CloseFormBefore(); diff --git a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs index e1a5808..13b308f 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs @@ -398,6 +398,11 @@ //褰撳墠鎴块棿 var listRoom = HdlRoomLogic.Current.GetRoomsByCurrentFloorIdAppendLoveRoom(); + if (HdlRoomLogic.Current.NowMainPageRoom == null) + { + //璁剧疆绗竴涓负鍒濆鎴块棿 + HdlRoomLogic.Current.NowMainPageRoom = listRoom[0]; + } var curIndex = 0; for (int i = 0; i < listRoom.Count; i++) { @@ -405,7 +410,7 @@ roomPageView.AddChidren(roomView); roomView.Init(listRoom[i]); - if (listRoom[i].Id == HdlRoomLogic.Current.CurrentRoom.Id) + if (listRoom[i].Id == HdlRoomLogic.Current.NowMainPageRoom.Id) { //褰撳墠鎴块棿,鍒欐樉绀洪偅浜涙暟鎹嚭鏉� roomView.HideName(false); @@ -470,7 +475,7 @@ btnRoomRightShadow.Visible = true; btnRoomBottomShadow.Visible = true; //鍒囨崲褰撳墠鎴块棿 - HdlRoomLogic.Current.CurrentRoom = listRoom[curIndex]; + HdlRoomLogic.Current.NowMainPageRoom = listRoom[curIndex]; //鍒锋柊璁惧妗屽竷鎺т欢 this.isRoomChanging = false; this.RefreshBodyView(); @@ -532,7 +537,7 @@ this.dicDeviceCardControl.Clear(); var listDevice = new List<CommonDevice>(); - foreach (var mainkeys in HdlRoomLogic.Current.CurrentRoom.ListDevice) + foreach (var mainkeys in HdlRoomLogic.Current.NowMainPageRoom.ListDevice) { var device = LocalDevice.Current.GetDevice(mainkeys); //鍒ゆ柇璇ヨ澶囪兘鍚︽樉绀哄湪涓婚〉 @@ -640,7 +645,7 @@ cardContr.X = XX; cardContr.Y = YY; listDeviceBackContr.AddChidren(cardContr); - cardContr.InitControl(device); + cardContr.InitControl(device, HdlRoomLogic.Current.NowMainPageRoom); //鍗$墖闇�瑕佽绉婚櫎鐨勪簨浠� cardContr.CardNeedRemoveEvent += () => { @@ -787,7 +792,7 @@ this.dicDeviceCardControl.Clear(); var listScene = new List<SceneUI>(); - foreach (int sceneId in HdlRoomLogic.Current.CurrentRoom.ListSceneId) + foreach (int sceneId in HdlRoomLogic.Current.NowMainPageRoom.ListSceneId) { var sceneUi = HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId); if (sceneUi == null) @@ -1162,7 +1167,7 @@ floorFL.FloorAction = (floorId) => { btnFloor.Text = Config.Instance.Home.GetFloorNameById(floorId); - HdlRoomLogic.Current.CurrentRoom = HdlRoomLogic.Current.GetLoveRoom(); + HdlRoomLogic.Current.NowMainPageRoom = HdlRoomLogic.Current.GetLoveRoom(); this.ShowForm(); }; } diff --git a/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs b/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs index 1347cbe..6846d70 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ListRoomViewFrom.cs @@ -214,7 +214,6 @@ } string oldFloorId = Config.Instance.Home.CurrentFloorId; CommonPage.Instance.CloseLeftMenu(); - HdlRoomLogic.Current.CurrentRoom = room; HdlThreadLogic.Current.RunThread(() => { diff --git a/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs b/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs index a238bb8..330f836 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/UnallocatedRoomForm.cs @@ -193,7 +193,7 @@ frameContr.CollectEvent += (collect) => { //濡傛灉褰撳墠鏄敹钘忔埧闂�,鍒欓渶瑕佸埛鏂颁富椤� - if (HdlRoomLogic.Current.CurrentRoom.IsLove == true) + if (HdlRoomLogic.Current.NowMainPageRoom.IsLove == true) { this.dataHadChanged = true; } @@ -536,7 +536,7 @@ selectZone.ZoneAction += (selectRoom) => { //鍙樻洿浜嗗綋鍓嶆埧闂寸殑涓滆タ,涓婚〉闇�瑕佸埛鏂� - if (HdlRoomLogic.Current.CurrentRoom.Id == selectRoom.Id) + if (HdlRoomLogic.Current.NowMainPageRoom.Id == selectRoom.Id) { this.dataHadChanged = true; } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs index 098ffaa..160b6c3 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs @@ -181,7 +181,8 @@ this.MouseUpEventHandler -= ButtonBase_MouseUpEventHandler; return; } - if (CanClick == true) + //2020.05.14杩藉姞IsFormAdding:鐣岄潰杩樺湪鍔犺浇涓�,涓嶈兘鍐嶇偣鍑� + if (CanClick == true && ControlCommonResourse.IsFormAdding == false) { //Log鍑哄姏 this.WriteLog(0); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/VerificationCodeControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/VerificationCodeControl.cs index 3c44056..da2a3c0 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/VerificationCodeControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/VerificationCodeControl.cs @@ -115,6 +115,21 @@ } if (e.Focus == true) { + //鑷姩鐒︾偣閫夋嫨鍓嶉潰鐨勭┖鐧戒綅缃� + //if (txtCode.Text == string.Empty) + //{ + // for (int i = 0; i < this.CodeLenth; i++) + // { + // if (dicCodeControls[i].Text == string.Empty) + // { + // dicCodeControls[i].FoucsChanged -= this.TxtCode_FoucsChangedEvent; + // dicCodeControls[i].Parent.BorderColor = UserCenterColor.Current.TextFrameSelectColor; + // dicCodeControls[i].Foucs = true; + // dicCodeControls[i].FoucsChanged += this.TxtCode_FoucsChangedEvent; + // return; + // } + // } + //} txtCode.Parent.BorderColor = UserCenterColor.Current.TextFrameSelectColor; } else diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs old mode 100644 new mode 100755 index ac8eb1d..84f54ab --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameControl.cs @@ -41,13 +41,13 @@ /// <param name="i_rowSpace">琛屼箣闂寸殑闂磋窛(杩欎釜鍊兼槸涓庤鎺т欢缁戝畾涓�璧蜂娇鐢ㄧ殑)</param> public VerticalFrameControl(int i_rowSpace = 0) { - rowSpace = Application.GetRealHeight(i_rowSpace); + rowSpace = Application.GetRealHeight(i_rowSpace); #if iOS - //鑷姩鍋忕Щ鍙栨秷 - if (UIKit.UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) - { - (this.uiView as UIKit.UIScrollView).ContentInsetAdjustmentBehavior = UIKit.UIScrollViewContentInsetAdjustmentBehavior.Never; - } + //鑷姩鍋忕Щ鍙栨秷 + if (UIKit.UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) + { + (this.uiView as UIKit.UIScrollView).ContentInsetAdjustmentBehavior = UIKit.UIScrollViewContentInsetAdjustmentBehavior.Never; + } #endif } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameRefreshControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameRefreshControl.cs old mode 100644 new mode 100755 index 24c3bdf..3ad73c6 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameRefreshControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalFrameRefreshControl.cs @@ -42,14 +42,13 @@ public VerticalFrameRefreshControl(int i_rowSpace = 0) { rowSpace = Application.GetRealHeight(i_rowSpace); - this.VerticalScrollBarEnabled = false; - + this.VerticalScrollBarEnabled = false; #if iOS - //鑷姩鍋忕Щ鍙栨秷 - if (UIKit.UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) - { - (this.uiView as UIKit.UIScrollView).ContentInsetAdjustmentBehavior = UIKit.UIScrollViewContentInsetAdjustmentBehavior.Never; - } + //鑷姩鍋忕Щ鍙栨秷 + if (UIKit.UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) + { + (this.uiView as UIKit.UIScrollView).ContentInsetAdjustmentBehavior = UIKit.UIScrollViewContentInsetAdjustmentBehavior.Never; + } #endif } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListControl.cs old mode 100644 new mode 100755 index 4947e92..282f443 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListControl.cs @@ -49,13 +49,13 @@ /// <param name="i_rowSpace">琛屼箣闂寸殑闂磋窛(杩欎釜鍊兼槸涓庤鎺т欢缁戝畾涓�璧蜂娇鐢ㄧ殑)</param> public VerticalListControl(int i_rowSpace = 0) { - this.rowSpace = Application.GetRealHeight(i_rowSpace); + this.rowSpace = Application.GetRealHeight(i_rowSpace); #if iOS - //鑷姩鍋忕Щ鍙栨秷 - if (UIKit.UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) - { - (this.uiView as UIKit.UIScrollView).ContentInsetAdjustmentBehavior = UIKit.UIScrollViewContentInsetAdjustmentBehavior.Never; - } + //鑷姩鍋忕Щ鍙栨秷 + if (UIKit.UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) + { + (this.uiView as UIKit.UIScrollView).ContentInsetAdjustmentBehavior = UIKit.UIScrollViewContentInsetAdjustmentBehavior.Never; + } #endif } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListRefreshControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListRefreshControl.cs old mode 100644 new mode 100755 index 45a6689..ba307b5 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListRefreshControl.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/ListViewLayoutControls/VerticalListRefreshControl.cs @@ -50,13 +50,13 @@ public VerticalListRefreshControl(int i_rowSpace = 0) { this.rowSpace = Application.GetRealHeight(i_rowSpace); - this.VerticalScrollBarEnabled = false; + this.VerticalScrollBarEnabled = false; #if iOS - //鑷姩鍋忕Щ鍙栨秷 - if (UIKit.UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) - { - (this.uiView as UIKit.UIScrollView).ContentInsetAdjustmentBehavior = UIKit.UIScrollViewContentInsetAdjustmentBehavior.Never; - } + //鑷姩鍋忕Щ鍙栨秷 + if (UIKit.UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) + { + (this.uiView as UIKit.UIScrollView).ContentInsetAdjustmentBehavior = UIKit.UIScrollViewContentInsetAdjustmentBehavior.Never; + } #endif } diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlExperienceAccountLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlExperienceAccountLogic.cs index 5203ff7..1e792df 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlExperienceAccountLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlExperienceAccountLogic.cs @@ -58,6 +58,8 @@ this.InitDeviceData(); //鍒濆鍖栧満鏅� this.InitSceneData(); + //鍒锋柊宸﹁竟鍒锋柊鎴块棿瑙嗗浘鍒楄〃 + HdlRoomLogic.Current.RefreshRoomListView(); } #endregion diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs index 2a1b88a..18ffe33 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs @@ -2228,13 +2228,13 @@ waitCount++; if (this.nowGwConnectMode == GatewayConnectMode.Remote) { - //杩滅▼姣�10绉掓娴嬩竴娆� - if (waitCount < 10) { continue; } + //杩滅▼姣�20绉掓娴嬩竴娆� + if (waitCount < 20) { continue; } } else if (this.nowGwConnectMode == GatewayConnectMode.WIFI) { - //灞�鍩熺綉姣�3绉掓娴嬩竴娆� - if (waitCount < 3) { continue; } + //灞�鍩熺綉姣�5绉掓娴嬩竴娆� + if (waitCount < 5) { continue; } } waitCount = 0; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs index 0e0fbce..d9acfff 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayReceiveLogic.cs @@ -425,24 +425,51 @@ //娓╁害 if (attData.AttributeId == (int)AttriButeId.MeasuredValue) { - if (attData.AttriButeData == 0) + decimal temperatrue = 0; + string receiptData = string.Empty; + //涓や釜涓や釜浣嶇疆鏇挎崲 + for (int i = attData.AttriButeDataHex.Length - 1; i >= 0; i = i - 2) { - ((TemperatureSensor)locadevice).Temperatrue = 0; + receiptData += attData.AttriButeDataHex[i - 1].ToString() + attData.AttriButeDataHex[i].ToString(); } - else if (attData.AttriButeData > 32767) - { - //璐熸暟(鐗规畩澶勭悊) - string strValue = (attData.AttriButeData - 65536).ToString(); - //灏忔暟鐐归渶瑕佷竴浣� - strValue = strValue.Substring(0, strValue.Length - 1); - ((TemperatureSensor)locadevice).Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); - } - else + //鏈夌鍙�(浼氬嚭鐜拌礋鏁�) + if (attData.AttriButeDataType == 40 || attData.AttriButeDataType == 41) { //灏忔暟鐐归渶瑕佷竴浣� - string strValue = attData.AttriButeData.ToString(); + string strValue = Convert.ToInt16(receiptData, 16).ToString(); strValue = strValue.Substring(0, strValue.Length - 1); - ((TemperatureSensor)locadevice).Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); + temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); + } + //鏃犵鍙�(涓嶄細鍑虹幇璐熸暟) + else if (attData.AttriButeDataType == 32 || attData.AttriButeDataType == 33) + { + ushort shortData = Convert.ToUInt16(receiptData, 16); + if (shortData > 32767) + { + //璐熸暟(鐗规畩澶勭悊) + string strValue = (shortData - 65536).ToString(); + //灏忔暟鐐归渶瑕佷竴浣� + strValue = strValue.Substring(0, strValue.Length - 1); + temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); + } + else + { + //灏忔暟鐐归渶瑕佷竴浣� + string strValue = shortData.ToString(); + strValue = strValue.Substring(0, strValue.Length - 1); + temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); + } + } + + //娓╁害浼犳劅鍣� + if (locadevice is TemperatureSensor) + { + ((TemperatureSensor)locadevice).Temperatrue = temperatrue; + } + //PM2.5浼犳劅鍣� + else if (locadevice is PMSensor) + { + ((PMSensor)locadevice).currentTemperature = (int)temperatrue; } //宸茬粡鎺ユ敹鍒扮姸鎬� locadevice.HadReadDeviceStatu = true; @@ -460,16 +487,38 @@ //婀垮害 if (attData.AttributeId == (int)AttriButeId.MeasuredValue) { - if (attData.AttriButeData == 0) + decimal humidity = 0; + string receiptData = string.Empty; + //涓や釜涓や釜浣嶇疆鏇挎崲 + for (int i = attData.AttriButeDataHex.Length - 1; i >= 0; i = i - 2) { - ((TemperatureSensor)locadevice).Humidity = 0; + receiptData += attData.AttriButeDataHex[i - 1].ToString() + attData.AttriButeDataHex[i].ToString(); } - else + //鏈夌鍙�(浼氬嚭鐜拌礋鏁�) + if (attData.AttriButeDataType == 40 || attData.AttriButeDataType == 41) { - //灏忔暟鐐归渶瑕佷竴浣�(婀垮害娌℃湁璐熸暟) - string strValue = attData.AttriButeData.ToString(); + //灏忔暟鐐归渶瑕佷竴浣� + string strValue = Convert.ToInt16(receiptData, 16).ToString(); strValue = strValue.Substring(0, strValue.Length - 1); - ((TemperatureSensor)locadevice).Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); + humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); + } + //鏃犵鍙�(涓嶄細鍑虹幇璐熸暟) + else if (attData.AttriButeDataType == 32 || attData.AttriButeDataType == 33) + { + //灏忔暟鐐归渶瑕佷竴浣� 婀垮害涓嶄細鍑虹幇璐熸暟 + string strValue = Convert.ToUInt16(receiptData, 16).ToString(); + strValue = strValue.Substring(0, strValue.Length - 1); + humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); + } + //娓╁害浼犳劅鍣� + if (locadevice is TemperatureSensor) + { + ((TemperatureSensor)locadevice).Humidity = humidity; + } + //PM2.5浼犳劅鍣� + else if (locadevice is PMSensor) + { + ((PMSensor)locadevice).currentHumidity = (int)humidity; } } //宸茬粡鎺ユ敹鍒扮姸鎬� @@ -548,7 +597,7 @@ { //娓╁眳鍩庣殑瑕佺綉鍏充腑鏄惁鏈夐�昏緫瀛樺湪 //鍙傛暟:2-甯稿紑鑷姩鍖�;3-澶辨晥鏃堕棿鑷姩鍖� - var result = await Shared.Phone.Device.Logic.SkipView.Exist(2); + var result = await Shared.Phone.Device.Logic.SkipView.Exist(3, (ZigBee.Device.DoorLock)device); HdlThreadLogic.Current.RunMain(() => { //寮瑰嚭寰愭鐨勯偅涓獥鍙� diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs index 2edc90e..8105082 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlRoomLogic.cs @@ -31,32 +31,14 @@ return m_Current; } } - /// <summary> - /// 褰撳墠閫夋嫨鐨勬埧闂� + /// 褰撳墠涓婚〉閫夋嫨鐨勬埧闂村璞� /// </summary> - private Room m_CurrentRoom = null; + public Room NowMainPageRoom = null; /// <summary> - /// 褰撳墠閫夋嫨鐨勬埧闂� + /// 褰撳墠鍒嗙被閫夋嫨鐨勬埧闂村璞� /// </summary> - public Room CurrentRoom - { - get - { - if (m_CurrentRoom == null && dicRooms.Count > 0) - { - //璁剧疆鍒濆鍊� - foreach (var room in dicRooms.Values) - { - m_CurrentRoom = room; - break; - } - } - return m_CurrentRoom; - } - set { m_CurrentRoom = value; } - } - + public Room NowCategoryRoom = null; /// <summary> /// 鎵�鏈夌殑鎴块棿淇℃伅 /// </summary> @@ -72,6 +54,9 @@ /// </summary> public void InitAllRoom() { + this.NowMainPageRoom = null; + this.NowCategoryRoom = null; + //娓呯┖鏈湴缂撳瓨 this.dicRooms.Clear(); //妫�娴嬫垜鐨勫枩鐖辫繖涓埧闂村璞� @@ -591,8 +576,8 @@ { return; } - //浠庡師鏉ョ殑鎴块棿绉婚櫎璁惧 - this.DeleteDevice(device); + //浠庡師鏉ョ殑鎴块棿绉婚櫎璁惧,杩欓噷涓嶅垹闄ょ湡瀹炶澶囩殑鎴块棿 + this.DeleteDevice(device, false); //娣诲姞鍒版柊鐨勬埧闂� var room = this.GetRoomById(roomId); @@ -705,12 +690,20 @@ /// 鍒犻櫎璁惧(杩欎釜鍑芥暟涓嶅垹闄ゆ垜鐨勫枩鐖�) /// </summary> /// <param name="device">瑕佸垹闄ょ殑璁惧瀵硅薄</param> - public void DeleteDevice(CommonDevice device) + /// <param name="deleteReal">鏄惁鍒犻櫎鐪熷疄鐗╃悊璁惧鐨勬埧闂�</param> + public void DeleteDevice(CommonDevice device, bool deleteReal = true) { if (device == null) { return; } + //濡傛灉瀹冨彧鏈変竴涓洖璺� + if (deleteReal == true && LocalDevice.Current.GetDevicesCountByMac(device.DeviceAddr) == 1) + { + //鍒犻櫎鎺夊畠鐨勭湡瀹炵墿鐞嗚澶囩殑鎵�鍦ㄤ綅缃� + LocalDevice.Current.DeleteRealDeviceFromRoom(device); + } + //鏍规嵁璁惧锛岃幏鍙栨墍鍦ㄧ殑鎴块棿 var room = this.GetRoomByDevice(device); if (room == null) @@ -725,7 +718,7 @@ HdlAutoBackupLogic.AddOrEditorFile(room.FileName); //閫掑綊锛氬垹闄ゆ帀浠ュ墠鐨勬棫鏁版嵁瀵艰嚧鐨勫涓埧闂寸殑闂 - this.DeleteDevice(device); + this.DeleteDevice(device, deleteReal); } /// <summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs index 7f5755c..58bbc9f 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlSceneLogic.cs @@ -79,10 +79,10 @@ /// <summary> /// 鍒锋柊鏈湴鐨勫叏閮ㄥ満鏅� /// </summary> - public async Task<bool> RefreshSceneUIList() + public bool RefreshSceneUIList() { //鑾峰彇缃戝叧瀛樺湪鐨勫満鏅� - var sceneList = await ZigBee.Device.Scene.GetSceneListAsync(); + var sceneList = this.RefreshSceneListFromGateway(); if (sceneList == null) { return false; @@ -95,6 +95,8 @@ continue; } listEsxit.Add(scene.ScenesId); + //鍒锋柊scene鐨勪俊鎭� + this.RefreshScene(scene); } var listDelete = new List<SceneUI>(); @@ -115,6 +117,99 @@ return true; } + /// <summary> + /// 鍒锋柊scene鐨勪俊鎭� + /// </summary> + /// <param name="sceneInfo"></param> + private void RefreshScene(Scene.GetSceneAllInfo sceneInfo) + { + if (this.dicScenes.ContainsKey(sceneInfo.ScenesId) == true) + { + var localScene = this.dicScenes[sceneInfo.ScenesId]; + //鍙埛鏂板悕瀛楀拰缁戝畾琛� + localScene.Name = sceneInfo.ScenesName; + localScene.AdjustTargetList.Clear(); + localScene.AdjustTargetList.AddRange(sceneInfo.DeviceList); + localScene.Save(); + } + else + { + var newScene = new SceneUI(); + newScene.Name = sceneInfo.ScenesName; + newScene.IconPath = "SceneIcon/0.png"; + newScene.Id = sceneInfo.ScenesId; + newScene.AdjustTargetList.AddRange(sceneInfo.DeviceList); + //娣诲姞缂撳瓨 + newScene.Save(); + //鍔犲叆缂撳瓨 + this.dicScenes[newScene.Id] = newScene; + //澶囦唤 + HdlAutoBackupLogic.AddOrEditorFile(newScene.FileName); + } + + } + + /// <summary> + /// 浠庣綉鍏抽噸鏂板埛鏂板満鏅垪琛� + /// </summary> + /// <returns></returns> + private List<Scene.GetSceneAllInfo> RefreshSceneListFromGateway() + { + var mainGateway = ZbGateway.MainGateWay; + if (mainGateway == null) + { + //鑾峰彇缃戝叧瀵硅薄澶辫触 + this.ShowTipMsg(Language.StringByID(R.MyInternationalizationString.uGetGatewayTagartFail)); + return null; + } + + //瓒呮椂鏃堕棿 + int TimeOut = 0; + bool receiptAll = false; + + var listScene = new List<Scene.GetSceneAllInfo>(); + Action<string, string> action = (topic, message) => + { + var gatewayID = topic.Split('/')[0]; + var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); + + if (topic == gatewayID + "/" + "Scene/GetAllInfo_Respon") + { + var sceneGetAllInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<Scene.GetSceneAllInfo>(jobject["Data"].ToString()); + listScene.Add(sceneGetAllInfo); + + if (sceneGetAllInfo.ScenesNum == sceneGetAllInfo.ScenesSum) + { + //鎺ユ敹瀹屾垚 + receiptAll = true; + TimeOut = 0; + } + } + }; + mainGateway.Actions += action; + + var jObject = new Newtonsoft.Json.Linq.JObject { { "Cluster_ID", 0 }, { "Command", 807 } }; + mainGateway.Send(("Scene/GetAllInfo"), System.Text.Encoding.UTF8.GetBytes(jObject.ToString())); + + int waitTime = 20 * 6; + while (receiptAll == false && TimeOut < waitTime) + { + //鍏ㄩ儴鎺ユ敹鎵嶉��鍑� + System.Threading.Thread.Sleep(50); + TimeOut++; + } + mainGateway.Actions -= action; + action = null; + if (receiptAll == false) + { + //缃戠粶涓嶇ǔ瀹氾紝鍦烘櫙鍒楄〃淇℃伅缂烘崯 + this.ShowTipMsg(Language.StringByID(R.MyInternationalizationString.uNetworkUnStableAndSceneInfoIsNotFull)); + return null; + } + + return listScene; + } + #endregion #region 鈻� 娣诲姞鍦烘櫙___________________________ diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs index e4997c7..cace472 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs @@ -470,21 +470,25 @@ try { var Myform = UserCenterResourse.DicActionForm[UserCenterResourse.NowActionFormID] as EditorCommonForm; - //閲嶇疆宸︽粦浣胯兘 - Myform.ScrollEnabled = Myform.ScrollEnabled; - //瑙﹀彂鐣岄潰鍐嶆婵�娲荤殑浜嬩欢 - int value = Myform.FormActionAgainEvent(); - if (value == 1) + //鐐瑰嚮寰堝揩鏃�,杩欎釜涓滆タ浼氭槸null,浣嗘槸DicActionForm閲岄潰涓嶆槸null,涓嶇煡閬撲负浠�涔� + if (Myform != null) { - //Log鍑哄姏 - HdlLogLogic.Current.WriteLog(1, Myform.FormID + " 琚縺娲�"); + //閲嶇疆宸︽粦浣胯兘 + Myform.ScrollEnabled = Myform.ScrollEnabled; + //瑙﹀彂鐣岄潰鍐嶆婵�娲荤殑浜嬩欢 + int value = Myform.FormActionAgainEvent(); + if (value == 1) + { + //Log鍑哄姏 + HdlLogLogic.Current.WriteLog(1, Myform.FormID + " 琚縺娲�"); + } } } catch (Exception ex) { //鍑虹幇鏈煡閿欒,鏁版嵁涓㈠け - var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError)); - alert.Show(); + //var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError)); + //alert.Show(); //Log鍑哄姏 HdlLogLogic.Current.WriteLog(ex, "鐣岄潰閲嶆柊婵�娲诲紓甯� " + UserCenterResourse.NowActionFormID); @@ -834,6 +838,7 @@ { //璋冪敤杩欎釜鏂规硶,閮介渶瑕侀噸鏂板埛鏂颁富椤� UserView.UserPage.Instance.RefreshForm = true; + //濡傛灉鏄櫄鎷熶綇瀹� if (Config.Instance.Home.IsVirtually == true) { @@ -955,6 +960,8 @@ Common.LocalDevice.Current.ReFreshByLocal(); //鍒濆鍖栨埧闂�(閮洩鍩庨偅杈逛笉鍋氬鐞�,闇�瑕佽繖閲岀壒娈婃墽琛屼竴姝�) HdlRoomLogic.Current.RefreshAllRoomByLocation(); + //鍒锋柊宸﹁竟鍒锋柊鎴块棿瑙嗗浘鍒楄〃 + HdlRoomLogic.Current.RefreshRoomListView(); } /// <summary> diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/ControlCommonResourse.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/ControlCommonResourse.cs index 97a3d37..b5f2c64 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/ControlCommonResourse.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Resourse/ControlCommonResourse.cs @@ -68,6 +68,10 @@ /// 寰愭鐨勯棬閿佺晫闈㈡槸鍚︽槸鎵撳紑鐨勭姸鎬� /// </summary> public static bool IsDoorLockPageOpen = false; + /// <summary> + /// 鏄惁鏄晫闈㈡鍦ㄥ姞杞戒腑(搴曞眰涓撶敤,涓嶉渶瑕佺悊) + /// </summary> + public static bool IsFormAdding = false; #if Android /// <summary> /// 涓や釜鏂囨湰鎷兼帴鏃�,涓轰簡鐪嬭捣鏉ユ槸姝e父鐨勶紝闇�瑕佸噺鍘诲畠浠箣闂寸殑闂撮殧璇樊 diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs index 8f904cd..fefadb2 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceListMainForm.cs @@ -481,7 +481,7 @@ { //鏂规偊闈㈡澘鐨勫姛鑳介厤缃� var form = new DevicePanel.PanelFangyueFunctionSettionForm(); - form.AddForm(device); + form.AddForm(device, deviceEnumInfo); } else { @@ -789,13 +789,12 @@ if (localDevice != null) { //鍦ㄧ嚎鐘舵�佷竴鏍风殑璇濓紝涓嶉渶瑕佸埛鏂� - if (localDevice.IsOnline == device.IsOnline) + if (localDevice.IsOnline != device.IsOnline) { - return; + //淇濆瓨鐘舵�� + localDevice.IsOnline = device.IsOnline; + localDevice.ReSave(); } - //淇濆瓨鐘舵�� - localDevice.IsOnline = device.IsOnline; - localDevice.ReSave(); } rowInfo.MenuRow.IsOnline = Common.LocalDevice.Current.CheckDeviceIsOnline(device); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs index fda6ee2..0996841 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs @@ -736,7 +736,7 @@ || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEight) { var form = new DevicePanel.PanelFangyueFunctionSettionForm(); - form.AddForm(listNewDevice[0]); + form.AddForm(listNewDevice[0], deviceEnumInfo); } //娌充笢鐨勯潰鏉胯澶� else if (deviceEnumInfo.BeloneType == DeviceBeloneType.A鎸夐敭闈㈡澘 && deviceEnumInfo.IsHdlDevice == true) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs index 225a2aa..be3f331 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueButtonSettionForm.cs @@ -377,9 +377,10 @@ private NormalViewControl InitDeviceButtonControl(FrameLayout frame, CommonDevice device) { var btnIcon = new NormalViewControl(this.GetPictrueRealSize(52), this.GetPictrueRealSize(52), false); - btnIcon.Text = "Button" + device.DeviceEpoint; + btnIcon.Text = "BUTTON" + device.DeviceEpoint; btnIcon.TextAlignment = TextAlignment.Center; btnIcon.TextColor = UserCenterColor.Current.TextGrayColor1; + btnIcon.IsBold = true; if (frame is FrameLayoutStatuControl) { ((FrameLayoutStatuControl)frame).AddChidren(btnIcon, ChidrenBindMode.BindEventOnly); @@ -447,7 +448,7 @@ { //鎸夐敭1 var btnButton1 = this.InitDeviceButtonControl(frameBack, listDevice[0]); - btnButton1.TextSize = 12; + btnButton1.TextSize = 10; btnButton1.Height = this.GetPictrueRealSize(175); btnButton1.Width = this.GetPictrueRealSize(183); btnButton1.X = this.GetPictrueRealSize(34); @@ -455,7 +456,7 @@ //鎸夐敭2 var btnButton2 = this.InitDeviceButtonControl(frameBack, listDevice[1]); - btnButton2.TextSize = 12; + btnButton2.TextSize = 10; btnButton2.Height = this.GetPictrueRealSize(175); btnButton2.Width = this.GetPictrueRealSize(183); btnButton2.X = btnButton1.Right; @@ -463,7 +464,7 @@ //鎸夐敭3 var btnButton3 = this.InitDeviceButtonControl(frameBack, listDevice[2]); - btnButton3.TextSize = 12; + btnButton3.TextSize = 10; btnButton3.Height = this.GetPictrueRealSize(175); btnButton3.Width = this.GetPictrueRealSize(183); btnButton3.X = btnButton1.X; @@ -471,7 +472,7 @@ //鎸夐敭4 var btnButton4 = this.InitDeviceButtonControl(frameBack, listDevice[3]); - btnButton4.TextSize = 12; + btnButton4.TextSize = 10; btnButton4.Height = this.GetPictrueRealSize(175); btnButton4.Width = this.GetPictrueRealSize(183); btnButton4.X = btnButton2.X; @@ -541,7 +542,7 @@ frameButton1.Width = this.GetPictrueRealSize(183); frameBack.AddChidren(frameButton1); var btnButton1 = this.InitDeviceButtonControl(frameButton1, device1); - btnButton1.TextSize = 10; + btnButton1.TextSize = 8; btnButton1.Height = this.GetPictrueRealSize(35); btnButton1.Width = this.GetPictrueRealSize(183); btnButton1.Y = this.GetPictrueRealSize(37); @@ -554,7 +555,7 @@ frameButton2.Y = frameButton1.Bottom; frameBack.AddChidren(frameButton2); var btnButton2 = this.InitDeviceButtonControl(frameButton2, device2); - btnButton2.TextSize = 10; + btnButton2.TextSize = 8; btnButton2.Height = btnButton1.Height; btnButton2.Width = btnButton1.Width; btnButton2.Y = this.GetPictrueRealSize(20); @@ -588,7 +589,7 @@ nowContr.TextColor = 0xfffb744a; nowSelectControl = nowContr; - nowSelectDevice = Common.LocalDevice.Current.GetDevice(deviceObj.DeviceAddr, Convert.ToInt32(nowContr.Text.Replace("Button", string.Empty))); + nowSelectDevice = Common.LocalDevice.Current.GetDevice(deviceObj.DeviceAddr, Convert.ToInt32(nowContr.Text.Replace("BUTTON", string.Empty))); //閲嶆柊鍒濆鍖栬彍鍗曡 this.InitMenuRow(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs index 1111293..cc4040a 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFreshAirTargetsForm.cs @@ -1383,13 +1383,13 @@ foreach (var de in room.ListDevice) { var device = LocalDevice.Current.GetDevice(de); - //鐢垫睜璁惧涓嶆敮鎸佺粦瀹� - if (device.ZigbeeType != 1) - { - continue; - } if (device != null) - { + { + //鐢垫睜璁惧涓嶆敮鎸佺粦瀹� + if (device.ZigbeeType != 1) + { + continue; + } if (device.Type == DeviceType.TemperatureSensor) { var dev = device as TemperatureSensor; @@ -1413,13 +1413,13 @@ foreach (var de in room.ListDevice) { var device = LocalDevice.Current.GetDevice(de); - //鐢垫睜璁惧涓嶆敮鎸佺粦瀹� - if (device.ZigbeeType != 1) - { - continue; - } if (device != null) - { + { + //鐢垫睜璁惧涓嶆敮鎸佺粦瀹� + if (device.ZigbeeType != 1) + { + continue; + } if (device.Type == DeviceType.TemperatureSensor) { var dev = device as TemperatureSensor; diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs index cdd9f59..5896288 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelFangyueFunctionSettionForm.cs @@ -33,6 +33,10 @@ /// </summary> private CommonDevice deviceObj = null; /// <summary> + /// 璁惧鐨勭被鍨� + /// </summary> + private DeviceEnumInfo deviceEnum = null; + /// <summary> /// 璁惧闇�瑕佷繚瀛樼殑璁惧鍚嶅瓧 /// </summary> private Dictionary<int, string> dicDeviceSaveName = new Dictionary<int, string>(); @@ -49,9 +53,11 @@ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) /// </summary> /// <param name="i_device">璁惧鐨勬煇涓�鍥炶矾</param> - public void ShowForm(CommonDevice i_device) + /// <param name="i_deviceEnum">璁惧鐨勭被鍨�</param> + public void ShowForm(CommonDevice i_device, DeviceEnumInfo i_deviceEnum) { this.deviceObj = i_device; + this.deviceEnum = i_deviceEnum; //璁剧疆澶撮儴淇℃伅 base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uFunctionSettingUp)); @@ -265,9 +271,8 @@ var listSort = new List<CommonDevice>(); foreach (var device in listDevice) { - //濡傛灉鏄户鐢靛櫒鍜岃皟鍏夊櫒鐨勮瘽 - if (device.Type == DeviceType.OnOffOutput || device.Type == DeviceType.DimmableLight - || device.Type == DeviceType.ColorDimmableLight) + //濡傛灉鏄户鐢靛櫒 + if (device.Type == DeviceType.OnOffOutput) { listSort.Add(device); if (device.DeviceEpoint == deviceObj.DeviceEpoint) @@ -303,21 +308,21 @@ frameBorder.AddChidren(btnPic); - if (listSort.Count == 8) + if (deviceEnum.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueEight) { - //鍏寜閿潰鏉� + //鍥涘紑鍏帶闈㈡澘 btnPic.UnSelectedImagePath = "DeviceItem/PanelFangyueEightButtonTable.png"; this.InitEightButtonPanelIcon(frameBorder, listSort); } - else if (listSort.Count == 4) + else if (deviceEnum.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueFour) { - //鍥涙寜閿潰鏉� + //鍙屽紑鍥涙帶闈㈡澘 btnPic.UnSelectedImagePath = "DeviceItem/PanelFangyueFourButtonTable.png"; this.InitFourButtonPanelIcon(frameBorder, listSort); } else { - //浜屾寜閿潰鏉� + //鍗曞紑鍙屾帶闈㈡澘 btnPic.UnSelectedImagePath = "DeviceItem/PanelFangyueTwoButtonTable.png"; this.InitTwoButtonPanelIcon(frameBorder, listSort); } @@ -332,9 +337,10 @@ private NormalViewControl InitDeviceButtonControl(FrameLayout frame, CommonDevice device) { var btnIcon = new NormalViewControl(this.GetPictrueRealSize(52), this.GetPictrueRealSize(52), false); - btnIcon.Text = "Button" + device.DeviceEpoint; + btnIcon.Text = "CHANNEL" + device.DeviceEpoint; btnIcon.TextAlignment = TextAlignment.Center; btnIcon.TextColor = UserCenterColor.Current.TextGrayColor1; + btnIcon.IsBold = true; if (frame is FrameLayoutStatuControl) { ((FrameLayoutStatuControl)frame).AddChidren(btnIcon, ChidrenBindMode.BindEventOnly); @@ -368,7 +374,7 @@ #region 鈻� 鍒濆鍖栦簩鎸夐敭鍥炬爣___________________ /// <summary> - /// 鍒濆鍖栦簩鎸夐敭闈㈡澘鐨勫浘鏍� + /// 鍒濆鍖栧崟寮�鍙屾帶闈㈡澘鐨勫浘鏍� /// </summary> /// <param name="frameBack">瀹瑰櫒</param> /// <param name="listDevice">璁惧鍒楄〃</param> @@ -394,7 +400,7 @@ #region 鈻� 鍒濆鍖栧洓鎸夐敭鍥炬爣___________________ /// <summary> - /// 鍒濆鍖栧洓鎸夐敭闈㈡澘鐨勫浘鏍� + /// 鍒濆鍖栧弻寮�鍥涙帶閿潰鏉跨殑鍥炬爣 /// </summary> /// <param name="frameBack">瀹瑰櫒</param> /// <param name="listDevice">璁惧鍒楄〃</param> @@ -402,7 +408,7 @@ { //鎸夐敭1 var btnButton1 = this.InitDeviceButtonControl(frameBack, listDevice[0]); - btnButton1.TextSize = 12; + btnButton1.TextSize = 8; btnButton1.Height = this.GetPictrueRealSize(175); btnButton1.Width = this.GetPictrueRealSize(183); btnButton1.X = this.GetPictrueRealSize(34); @@ -410,7 +416,7 @@ //鎸夐敭2 var btnButton2 = this.InitDeviceButtonControl(frameBack, listDevice[1]); - btnButton2.TextSize = 12; + btnButton2.TextSize = 8; btnButton2.Height = this.GetPictrueRealSize(175); btnButton2.Width = this.GetPictrueRealSize(183); btnButton2.X = btnButton1.Right; @@ -418,7 +424,7 @@ //鎸夐敭3 var btnButton3 = this.InitDeviceButtonControl(frameBack, listDevice[2]); - btnButton3.TextSize = 12; + btnButton3.TextSize = 8; btnButton3.Height = this.GetPictrueRealSize(175); btnButton3.Width = this.GetPictrueRealSize(183); btnButton3.X = btnButton1.X; @@ -426,7 +432,7 @@ //鎸夐敭4 var btnButton4 = this.InitDeviceButtonControl(frameBack, listDevice[3]); - btnButton4.TextSize = 12; + btnButton4.TextSize = 8; btnButton4.Height = this.GetPictrueRealSize(175); btnButton4.Width = this.GetPictrueRealSize(183); btnButton4.X = btnButton2.X; @@ -438,7 +444,7 @@ #region 鈻� 鍒濆鍖栧叓鎸夐敭鍥炬爣___________________ /// <summary> - /// 鍒濆鍖栧叓鎸夐敭闈㈡澘鐨勫浘鏍� + /// 鍒濆鍖栧洓寮�鍏帶闈㈡澘鐨勫浘鏍� /// </summary> /// <param name="frameBack">瀹瑰櫒</param> /// <param name="listDevice">璁惧鍒楄〃</param> @@ -461,24 +467,6 @@ frame2.Width = frame1.Width; frameBack.AddChidren(frame2); this.InitEightButtonPanelIcon(frame2, listDevice[2], listDevice[3]); - - //鎸夐敭5锝炴寜閿�6 - var frame3 = new FrameLayout(); - frame3.X = frame1.X; - frame3.Y = frame1.Bottom + this.GetPictrueRealSize(4); - frame3.Height = frame1.Height; - frame3.Width = frame1.Width; - frameBack.AddChidren(frame3); - this.InitEightButtonPanelIcon(frame3, listDevice[4], listDevice[5]); - - //鎸夐敭7锝炴寜閿�8 - var frame4 = new FrameLayout(); - frame4.X = frame1.Right; - frame4.Y = frame1.Bottom + this.GetPictrueRealSize(4); - frame4.Height = frame1.Height; - frame4.Width = frame1.Width; - frameBack.AddChidren(frame4); - this.InitEightButtonPanelIcon(frame4, listDevice[6], listDevice[7]); } /// <summary> @@ -496,7 +484,7 @@ frameButton1.Width = this.GetPictrueRealSize(183); frameBack.AddChidren(frameButton1); var btnButton1 = this.InitDeviceButtonControl(frameButton1, device1); - btnButton1.TextSize = 10; + btnButton1.TextSize = 8; btnButton1.Height = this.GetPictrueRealSize(35); btnButton1.Width = this.GetPictrueRealSize(183); btnButton1.Y = this.GetPictrueRealSize(37); @@ -509,7 +497,7 @@ frameButton2.Y = frameButton1.Bottom; frameBack.AddChidren(frameButton2); var btnButton2 = this.InitDeviceButtonControl(frameButton2, device2); - btnButton2.TextSize = 10; + btnButton2.TextSize = 8; btnButton2.Height = btnButton1.Height; btnButton2.Width = btnButton1.Width; btnButton2.Y = this.GetPictrueRealSize(20); @@ -543,7 +531,7 @@ nowContr.TextColor = 0xfffb744a; nowSelectControl = nowContr; - nowSelectDevice = Common.LocalDevice.Current.GetDevice(deviceObj.DeviceAddr, Convert.ToInt32(nowContr.Text.Replace("Button", string.Empty))); + nowSelectDevice = Common.LocalDevice.Current.GetDevice(deviceObj.DeviceAddr, Convert.ToInt32(nowContr.Text.Replace("CHANNEL", string.Empty))); //閲嶆柊鍒濆鍖栬彍鍗曡 this.InitMenuRow(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs index 449c8e2..9989e00 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonInfo.cs @@ -151,11 +151,6 @@ public static void NormallyOpenModeValue(ZigBee.Device.DoorLock doorLock, bool value) { doorLock.IsDoorLockNormallyMode = value; - - if (LogicAction != null) - { - LogicAction(value); - } } /// <summary> @@ -196,10 +191,14 @@ { //涓婃姤鈥滃父寮�妯″紡鈥濆凡琚彇娑堬紝app榛樿浜嗏�滃父寮�妯″紡鈥濊鍙栨秷 DoorLockCommonInfo.NormallyOpenModeValue(doorLock, false); + if (LogicAction != null) + { + LogicAction(false); + } if (haveLogic) { //姝ゅ鍒犻櫎娓╁眳鍩庣殑甯稿紑妯″紡鐗规畩閫昏緫 - var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(); + var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(doorLock); } } else @@ -221,7 +220,7 @@ if (haveLogic) { //姝ゅ鍒犻櫎娓╁眳鍩庣殑甯稿紑妯″紡鐗规畩閫昏緫 - var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(); + var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(doorLock); } //app閲嶆柊寮�鍚�滃父寮�妯″紡鈥� @@ -237,6 +236,10 @@ }); action?.Invoke(doorLock.IsDoorLockNormallyMode); action = null; + if (LogicAction != null) + { + LogicAction(false); + } return; } if (result.defaultControlResponseData.status != 0) @@ -248,8 +251,13 @@ NormallyOpenModeValue(doorLock, false); CommonPage.Loading.Hide(); }); + action?.Invoke(doorLock.IsDoorLockNormallyMode); action = null; + if (LogicAction != null) + { + LogicAction(false); + } return; } else @@ -262,6 +270,10 @@ ShowTipMsg(msg0); NormallyOpenModeValue(doorLock, true); CommonPage.Loading.Hide(); + if (LogicAction != null) + { + LogicAction(true); + } }); } } @@ -279,10 +291,14 @@ if (doorLockMessType == DoorLockMessType.DeviceReport || doorLockMessType == DoorLockMessType.ServicePush) { NormallyOpenModeValue(doorLock, false); + if (LogicAction != null) + { + LogicAction(false); + } if (haveLogic) { //姝ゅ鍒犻櫎娓╁眳鍩庣殑甯稿紑妯″紡鐗规畩閫昏緫 - var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(); + var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(doorLock); } } else @@ -299,6 +315,10 @@ }); action?.Invoke(doorLock.IsDoorLockNormallyMode); action = null; + if (LogicAction != null) + { + LogicAction(false); + } return; } if (result.defaultControlResponseData.status != 0) @@ -311,6 +331,10 @@ }); action?.Invoke(doorLock.IsDoorLockNormallyMode); action = null; + if (LogicAction != null) + { + LogicAction(false); + } return; } else @@ -323,7 +347,7 @@ if (haveLogic) { //姝ゅ鍒犻櫎娓╁眳鍩庣殑甯稿紑妯″紡鐗规畩閫昏緫 - var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(); + var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(doorLock); } Application.RunOnMainThread(() => { @@ -331,6 +355,10 @@ ShowTipMsg(msg2); CommonPage.Loading.Hide(); }); + if (LogicAction != null) + { + LogicAction(false); + } } } action?.Invoke(doorLock.IsDoorLockNormallyMode); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs index e1c744d..7e93794 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs @@ -697,7 +697,7 @@ DoorLockCommonInfo.NormallyOpenModeValue(doorLock, tempRes); Application.RunOnMainThread(async () => { - var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(2); + var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(3,doorLock); if (resTemp == 1) { haveLogicNormallyOpenMode = true; @@ -856,17 +856,14 @@ //寮�閿佷簨浠� EventHandler<MouseEventArgs> hander1 = async (sender, e) => { + canShowDialog = true; if (doorLock.IsDoorLockNormallyMode) { if (canOpenNormallyMode) { Application.RunOnMainThread(() => { - Action<bool> action = (obj) => - { - UpdateNomallyOpenStatus(); - }; - DoorLockCommonInfo.NomallyOpenModeInvalidDialog(doorLock, DoorLockCommonInfo.DoorLockMessType.AppOperate, haveLogicNormallyOpenMode, action); + NomallyOpenModeInvalidDialog(); }); } else @@ -889,17 +886,14 @@ //鍏抽攣浜嬩欢 EventHandler<MouseEventArgs> hander2 = (sender, e) => { + canShowDialog = true; if (canOpenNormallyMode) { if (doorLock.IsDoorLockNormallyMode) { Application.RunOnMainThread(() => { - Action<bool> action = (obj) => - { - UpdateNomallyOpenStatus(); - }; - DoorLockCommonInfo.NomallyOpenModeInvalidDialog(doorLock, DoorLockCommonInfo.DoorLockMessType.AppOperate, haveLogicNormallyOpenMode, action); + NomallyOpenModeInvalidDialog(); }); } } @@ -1128,15 +1122,11 @@ { UpdateNomallyOpenStatus(); }); - //鍒犻櫎宸茬粡澶辨晥鐨勨�滃父寮�妯″紡鈥濈殑閫昏緫 + if (haveLogicNormallyOpenMode) { - var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(3); - //if (resTemp == 3) - //{ - // string msg0 = Language.StringByID(R.MyInternationalizationString.CancelLogicNormallyModeFailed); - // this.ShowTipMsg(msg0); - //} + //姝ゅ鍒犻櫎娓╁眳鍩庣殑甯稿紑妯″紡鐗规畩閫昏緫 + var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(doorLock); } } else @@ -1156,16 +1146,11 @@ { //涓婃姤鈥滃父寮�妯″紡鈥濆凡琚彇娑� Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); }); - //鍏堝垹闄ゅ凡澶辨晥鐨勨�滃父寮�妯″紡鈥濈殑閫昏緫 + if (haveLogicNormallyOpenMode) { - var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(3); - //if (resTemp == 3) - //{ - // string msg0 = Language.StringByID(R.MyInternationalizationString.CancelLogicNormallyModeFailed2); - // this.ShowTipMsg(msg0); - // return; - //} + //姝ゅ鍒犻櫎娓╁眳鍩庣殑甯稿紑妯″紡鐗规畩閫昏緫 + var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(doorLock); } //app閲嶆柊寮�鍚�滃父寮�妯″紡鈥� var result = await doorLock.SetNormallyOpenModeFuncAsync(true); @@ -1233,15 +1218,10 @@ UpdateNomallyOpenStatus(); }); - //鍒犻櫎宸茬粡澶辨晥鐨勨�滃父寮�妯″紡鈥濈殑閫昏緫 if (haveLogicNormallyOpenMode) { - var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(3); - //if (resTemp == 3) - //{ - // string msg0 = Language.StringByID(R.MyInternationalizationString.CancelLogicNormallyModeFailed); - // this.ShowTipMsg(msg0); - //} + //姝ゅ鍒犻櫎娓╁眳鍩庣殑甯稿紑妯″紡鐗规畩閫昏緫 + var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(doorLock); } } else @@ -1272,21 +1252,11 @@ { UpdateNomallyOpenStatus(); }); - //鍒犻櫎璁剧疆甯稿紑妯″紡鍒涘缓鐨勯�昏緫 + if (haveLogicNormallyOpenMode) { - var resTemp = await Shared.Phone.Device.Logic.SkipView.Exist(3); - //鍥犱负鐩墠鏈哄埗闂锛岄�昏緫缁忓父澶辫触锛屾墍浠ヤ笉鎻愮ず锛屽悗鏈熸満鍒惰鏀癸紝閲嶆柊鍋氫竴涓繖涓晫闈� - //if (resTemp == 3) - //{ - // string msg0 = Language.StringByID(R.MyInternationalizationString.CancelLogicNormallyModeFailed); - // this.ShowTipMsg(msg0); - //} - //else if (resTemp == 2) - //{ - // string msg2 = Language.StringByID(R.MyInternationalizationString.CloseNormallyOpenModeSuccess); - // this.ShowTipMsg(msg2); - //} + //姝ゅ鍒犻櫎娓╁眳鍩庣殑甯稿紑妯″紡鐗规畩閫昏緫 + var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(doorLock); } string msg2 = Language.StringByID(R.MyInternationalizationString.CloseNormallyOpenModeSuccess); this.ShowTipMsg(msg2); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs index 28c511f..b6ddfc2 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/EditorRoomInforForm.cs @@ -424,41 +424,22 @@ { return; } - - foreach (var data in report.DeviceStatusReport.AttriBute) + var localDevice = Common.LocalDevice.Current.GetDevice(mainKeys); + HdlThreadLogic.Current.RunMain(() => { - if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) + if (((ZigBee.Device.TemperatureSensor)localDevice).Temperatrue == 0) { - HdlThreadLogic.Current.RunMain(() => - { - if (data.AttriButeData == 0) - { - //0鈩� - btnTemper.Text = "0.0鈩�"; - this.cloneRoom.Temperatrue = 0; - } - else if (data.AttriButeData > 32767) - { - //璐熸暟(鐗规畩澶勭悊) - string strValue = (data.AttriButeData - 65536).ToString(); - //灏忔暟鐐归渶瑕佷竴浣� - strValue = strValue.Substring(0, strValue.Length - 1); - //璁板綍娓╁害 - this.cloneRoom.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); - btnTemper.Text = this.cloneRoom.Temperatrue.ToString() + "鈩�"; - } - else - { - //灏忔暟鐐归渶瑕佷竴浣� - string strValue = data.AttriButeData.ToString(); - strValue = strValue.Substring(0, strValue.Length - 1); - //璁板綍娓╁害 - this.cloneRoom.Temperatrue = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); - btnTemper.Text = this.cloneRoom.Temperatrue.ToString() + "鈩�"; - } - }); + //0鈩� + btnTemper.Text = "0.0鈩�"; + this.cloneRoom.Temperatrue = 0; } - } + else + { + //璁板綍娓╁害 + this.cloneRoom.Temperatrue = ((ZigBee.Device.TemperatureSensor)localDevice).Temperatrue; + btnTemper.Text = this.cloneRoom.Temperatrue.ToString() + "鈩�"; + } + }, ShowErrorMode.NO); })); //鍙戦�佽幏鍙栨俯搴︾殑鍛戒护 ((ZigBee.Device.TemperatureSensor)device).ReadTemperatureOrHumidity(); @@ -531,30 +512,22 @@ { return; } - foreach (var data in report.DeviceStatusReport.AttriBute) + var localDevice = Common.LocalDevice.Current.GetDevice(mainKeys); + HdlThreadLogic.Current.RunMain(() => { - if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue) + if (((ZigBee.Device.TemperatureSensor)localDevice).Humidity == 0) { - HdlThreadLogic.Current.RunMain(() => - { - if (data.AttriButeData == 0) - { - //0 - btnHumi.Text = "0.0%"; - this.cloneRoom.Humidity = 0; - } - else - { - //灏忔暟鐐归渶瑕佷竴浣�(婀垮害娌℃湁璐熸暟) - string strValue = data.AttriButeData.ToString(); - strValue = strValue.Substring(0, strValue.Length - 1); - //璁板綍婀垮害 - this.cloneRoom.Humidity = Convert.ToDecimal(strValue.Insert(strValue.Length - 1, ".")); - btnHumi.Text = this.cloneRoom.Humidity.ToString() + "%"; - } - }); + //0 + btnHumi.Text = "0.0%"; + this.cloneRoom.Humidity = 0; } - } + else + { + //璁板綍婀垮害 + this.cloneRoom.Humidity = ((ZigBee.Device.TemperatureSensor)localDevice).Humidity; + btnHumi.Text = this.cloneRoom.Humidity.ToString() + "%"; + } + }, ShowErrorMode.NO); }); //鍙戦�佽幏鍙栨箍搴︾殑鍛戒护 ((ZigBee.Device.TemperatureSensor)device).ReadTemperatureOrHumidity(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs index 69419c8..8dfdc85 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/FloorListRoomForm.cs @@ -152,11 +152,6 @@ //纭鍒犻櫎鎴块棿? this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uDeleteRoomMsg), () => { - if (HdlRoomLogic.Current.CurrentRoom.Id == room.Id) - { - //濡傛灉鍒犻櫎鐨勬槸褰撳墠鎴块棿鐨勮瘽 - HdlRoomLogic.Current.CurrentRoom = HdlRoomLogic.Current.GetLoveRoom(); - } HdlRoomLogic.Current.RemoveRoom(room.Id); //璋冩暣楂樺害 frameRow.RemoveFromParent(); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs index 12f4930..91d1c5e 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceManagementForm.cs @@ -384,11 +384,6 @@ listDeleteId.Add(listAllRoom[i].Id); } } - //濡傛灉褰撳墠閫夋嫨鐨勬埧闂存槸鍒犻櫎瀵硅薄鐨勮瘽 - if (HdlRoomLogic.Current.CurrentRoom.FloorId == keys) - { - HdlRoomLogic.Current.CurrentRoom = HdlRoomLogic.Current.GetLoveRoom(); - } //鍒犻櫎鎴块棿 foreach (string roomId in listDeleteId) { @@ -616,11 +611,6 @@ //纭鍒犻櫎鎴块棿? this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uDeleteRoomMsg), () => { - if (HdlRoomLogic.Current.CurrentRoom.Id == room.Id) - { - //濡傛灉鍒犻櫎鐨勬槸褰撳墠鎴块棿鐨勮瘽 - HdlRoomLogic.Current.CurrentRoom = HdlRoomLogic.Current.GetLoveRoom(); - } HdlRoomLogic.Current.RemoveRoom(room.Id); //淇濆瓨椤哄簭 this.listRoomSort.Remove(room.Id); diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs index 0087924..1f4abf5 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs @@ -53,8 +53,8 @@ bodyFrameLayout.AddChidren(frameInput); //瀛楁暟 - var btnFild = new NormalViewControl(120, 60, true); - btnFild.X = frameInput.Width - ControlCommonResourse.XXLeft - Application.GetRealWidth(120); + var btnFild = new NormalViewControl(150, 60, true); + btnFild.X = frameInput.Width - ControlCommonResourse.XXLeft - Application.GetRealWidth(150); btnFild.Y = Application.GetRealHeight(503); btnFild.TextColor = UserCenterColor.Current.TextGrayColor1; btnFild.TextSize = 12; @@ -82,21 +82,30 @@ } int length = txtvalue.Length; - if (length > 500) - { - if (btnSubmit.CanClick == true) { btnSubmit.CanClick = false; } - btnFild.Text = "0"; - return; - } if (length == 0) { if (btnSubmit.CanClick == true) { btnSubmit.CanClick = false; } } else { - if (btnSubmit.CanClick == false) { btnSubmit.CanClick = true; } + if (btnSubmit.CanClick == false) + { + //鍙樼伆鑹插瓧浣� + btnFild.TextColor = UserCenterColor.Current.TextGrayColor1; + btnSubmit.CanClick = true; + } } btnFild.Text = (500 - length).ToString(); + + if (length > 500) + { + if (btnSubmit.CanClick == true) + { + btnSubmit.CanClick = false; + //鍙樼孩鑹插瓧浣� + btnFild.TextColor = Common.ZigbeeColor.Current.GXCTextRed; + } + } }; var framType = new FrameLayout(); diff --git a/ZigbeeApp/Shared/Phone/UserView/LoginLoading.cs b/ZigbeeApp/Shared/Phone/UserView/LoginLoading.cs index a8247ad..0509967 100755 --- a/ZigbeeApp/Shared/Phone/UserView/LoginLoading.cs +++ b/ZigbeeApp/Shared/Phone/UserView/LoginLoading.cs @@ -10,6 +10,7 @@ { BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; Tag = "Login"; + this.BackgroundImagePath = "Logo/StartBackGroud.png"; } /// <summary> @@ -17,11 +18,33 @@ /// </summary> public void Show() { - var sceneBtn = new ImageView(); - sceneBtn.Width = this.Width; - sceneBtn.Height = this.Height; - sceneBtn.ImagePath = "Logo/2.png"; - AddChidren(sceneBtn); + //Logo鍥炬爣 + var btnIcon = new Button(); + btnIcon.Y = Application.GetRealHeight(570); + btnIcon.Width = UserCenter.HdlControlLogic.Current.GetPictrueRealSize(184); + btnIcon.Height = UserCenter.HdlControlLogic.Current.GetPictrueRealSize(184); + btnIcon.UnSelectedImagePath = "Logo/Logo.png"; + btnIcon.Gravity = Gravity.CenterHorizontal; + this.AddChidren(btnIcon); + + //Hdl Home + var btnText = new Button(); + btnText.Height = Application.GetRealHeight(70); + btnText.Y = btnIcon.Bottom; + btnText.TextAlignment = TextAlignment.Center; + btnText.Text = "Hdl Home"; + btnText.TextColor = UserCenter.UserCenterColor.Current.White; + btnText.TextSize = 16; + this.AddChidren(btnText); + + //鏅鸿兘鏀瑰彉鐢熸椿 | Enjoy smart life + var btnTip = new Button(); + btnTip.Height = btnIcon.Bottom + Application.GetRealHeight(850); + btnTip.Y = btnIcon.Bottom; + btnTip.TextAlignment = TextAlignment.Center; + btnTip.TextSize = 16; + btnTip.TextID = R.MyInternationalizationString.uLogoPageText; + this.AddChidren(btnTip); } } } diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs b/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs index 04c6a57..c446b42 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Common/Application.cs @@ -333,7 +333,7 @@ public static class FindGateWaySocket { //鏈湴Socket - public static System.Net.Sockets.Socket busSocket; + public static Socket busSocket; /// <summary> /// 鍚姩Socket鎺ユ敹鍜屽彂閫佸姛鑳� @@ -379,7 +379,7 @@ { get { - return null == busSocket ? false : true; + return busSocket == null ? false : true; } } @@ -391,12 +391,47 @@ { try { + //妫�娴嬭繛鎺ョ姸鎬� + CheckConnectiton(); + Start(7624); busSocket.BeginSendTo(bytes, 0, bytes.Length, SocketFlags.None, iPEndPoint, new AsyncCallback(asyncEndSend), null); } catch { } } + /// <summary> + /// 妫�娴嬭繛鎺ョ姸鎬� + /// </summary> + private static void CheckConnectiton() + { + if (busSocket == null) { return; } + + bool blockingState = busSocket.Blocking; + try + { + byte[] tmp = new byte[1]; + + busSocket.Blocking = false; + busSocket.Send(tmp, 0, 0); + //tcp杩樺湪杩炴帴鐫� + busSocket.Blocking = blockingState; + } + catch (SocketException e) + { + // 10035 == WSAEWOULDBLOCK + if (e.NativeErrorCode.Equals(10035)) + { + //Still Connected, but the Send would block + } + else + { + //tcp宸茬粡鏂紑浜嗚繛鎺� + Stop(); + } + } + } + /// <summary> /// 寮傛鍙戦�佹暟鎹粨鏉� /// </summary> diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs index 92b3442..4c6de8a 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/CommonDevice.cs @@ -296,6 +296,10 @@ { device = Newtonsoft.Json.JsonConvert.DeserializeObject<FreshAir>(strDeviceByte); } + else if (strDeviceType == ZigBee.Device.DeviceType.PMSensor.ToString()) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject<PMSensor>(strDeviceByte); + } else { return null; } //鑳藉皯瀛樹竴涓彉閲忓氨灏戝瓨涓�涓� device.Type = (DeviceType)device.DeviceID; diff --git a/ZigbeeApp/Shared/R.cs b/ZigbeeApp/Shared/R.cs index 799a1c7..b1e6567 100755 --- a/ZigbeeApp/Shared/R.cs +++ b/ZigbeeApp/Shared/R.cs @@ -5769,6 +5769,14 @@ /// 娓稿浣撻獙 /// </summary> public const int uExperienceAccount = 16116; + /// <summary> + /// 鏅鸿兘鏀瑰彉鐢熸椿 | Enjoy smart life + /// </summary> + public const int uLogoPageText = 16117; + /// <summary> + /// 缃戠粶涓嶇ǔ瀹氾紝鍦烘櫙鍒楄〃淇℃伅缂烘崯 + /// </summary> + public const int uNetworkUnStableAndSceneInfoIsNotFull = 16118; //鈽呪槄鈽呪槄涓嬮潰杩欎簺鏄帴鍙g殑杩斿洖淇℃伅缈昏瘧,浠�18000寮�濮嬧槄鈽呪槄鈽� -- Gitblit v1.8.0