| | |
| | | 16114=灯全关 |
| | | 16115=常开自动化手动取消 |
| | | 16116=游客体验 |
| | | 16117=智能改变生活 | Enjoy smart life |
| | | 16118=网络不稳定,场景列表信息缺损 |
| | | |
| | | ;★★★★下面这些是接口的返回信息翻译,从18000开始★★★★
|
| | | 18004=指定网关已经被绑定
|
| | |
| | | <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" />
|
| | |
| | | <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>
|
| | |
| | | <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')" />
|
| | |
| | | <?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" /> |
| | |
| | | <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" /> |
| | |
| | | 16114=灯全关 |
| | | 16115=常开自动化手动取消 |
| | | 16116=游客体验 |
| | | 16117=智能改变生活 | Enjoy smart life |
| | | 16118=网络不稳定,场景列表信息缺损 |
| | | |
| | | ;★★★★下面这些是接口的返回信息翻译,从18000开始★★★★
|
| | | 18004=指定网关已经被绑定
|
New file |
| | |
| | | { |
| | | "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" |
| | | } |
| | | |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | |
| | | 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> |
| | |
| | | /// </summary> |
| | | public static int XLeft = 58; |
| | | /// <summary> |
| | | /// button高度--110 |
| | | /// </summary> |
| | | public static int ButtonHeight = 110; |
| | | /// <summary> |
| | | /// 使用的语言 |
| | | /// </summary> |
| | | public static string ZigBeeLanguage |
| | |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 大控件圆角 --- 10。不是不半圆那种。 |
| | | /// </summary> |
| | | public static uint BigFormRadius = 10; |
| | | /// <summary> |
| | | /// 默认手机区号为86中国大陆 |
| | | /// </summary> |
| | | public static string PhoneZoneStr = "86"; |
| | |
| | | /// </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> |
| | |
| | | /// 用于验证邮箱正则表达式 |
| | | /// </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:WIFI |
| | | /// </summary> |
| | | public static int nowNetworkMode = 0; |
| | | /// <summary> |
| | | /// 占位字体大小 |
| | | /// 11 |
| | | /// </summary> |
| | | public static int PlaceHolderTextSize = 11; |
| | | /// <summary>
|
| | | /// 安卓的系统返回按键能否按下(比如在备份还原时,不能按下返回键)
|
| | | /// </summary> |
| | |
| | | /// <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)
|
| | | {
|
| | |
| | | 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);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | 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;
|
| | | }
|
| | |
| | | /// <returns></returns>
|
| | | public bool CheckDeviceIsOnline(CommonDevice i_device)
|
| | | {
|
| | | //0:离线 1:在线 2:正在刷新状态 |
| | | 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:正在刷新状态 |
| | | bool statu = i_device.IsOnline == 1 || i_device.IsOnline == 2;
|
| | | if (statu == true)
|
| | | {
|
| | | //有一个回路在线,即在线
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | if (listCheck.Contains(mainkeys) == false)
|
| | | {
|
| | | listDevice.Add(device);
|
| | |
|
| | | listCheck.Add(mainkeys);
|
| | | //刷新一下本地缓存
|
| | | var localDevice = this.GetDevice(mainkeys);
|
| | | if (localDevice != null)
|
| | | {
|
| | | //刷新属性
|
| | | this.SetDeviceInfoToMain(localDevice, device);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | //如果是三路继电器的回路的话,默认为灯光
|
| | | 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未定义)
|
| | | {
|
| | |
| | | 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();
|
| | | };
|
| | |
| | | {
|
| | | //当前楼层的全部房间
|
| | | 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)
|
| | | {
|
| | |
| | | cardContr.chidrenYaxis = listView.rowSpace / 2;
|
| | | //初始化卡片
|
| | | listView.AddChidren(cardContr);
|
| | | cardContr.InitControl(device);
|
| | | cardContr.InitControl(device, HdlRoomLogic.Current.NowCategoryRoom);
|
| | | //控件记录到缓存中
|
| | | this.dicDeviceRowControl[LocalDevice.Current.GetDeviceMainKeys(device)] = cardContr;
|
| | | //加缓存,然后发命令
|
| | |
| | | /// <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)
|
| | | {
|
| | |
| | | }
|
| | | 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)
|
| | | {
|
| | | //场景卡片控件
|
| | |
| | | /// 判断是否有开关功能
|
| | | /// </summary>
|
| | | private bool isHadOpenSwitch = true;
|
| | | /// <summary>
|
| | | /// 当前选择的房间
|
| | | /// </summary>
|
| | | public Common.Room nowSelectRoom = null;
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | /// 初始化控件
|
| | | /// </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);
|
| | |
| | | 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)
|
| | |
| | | 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();
|
| | |
| | | {
|
| | | //移除收藏(不管什么情况,收藏都要移除)
|
| | | HdlRoomLogic.Current.DeleteLoveDevice(i_device);
|
| | | if (HdlRoomLogic.Current.CurrentRoom.IsLove == false)
|
| | | if (this.nowSelectRoom.IsLove == false)
|
| | | {
|
| | | //从房间中移除
|
| | | HdlRoomLogic.Current.DeleteDevice(i_device);
|
| | |
| | | /// 深度卡片信息的返回事件(底层专用)
|
| | | /// </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)
|
| | |
| | | {
|
| | | //如果这个设备改变了房间的话,回调卡片被删除的函数
|
| | | 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();
|
| | |
| | | /// 初始化控件
|
| | | /// </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);
|
| | |
| | | {
|
| | | //空调类型的深度卡片界面
|
| | | 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;
|
| | | };
|
| | | }
|
| | |
| | | /// 初始化控件
|
| | | /// </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);
|
| | |
| | |
|
| | | //继电器类型的深度卡片界面(含空气开关)
|
| | | 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;
|
| | | };
|
| | | }
|
| | |
| | | /// 初始化控件
|
| | | /// </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);
|
| | |
| | | {
|
| | | //彩灯,调光器类型的深度卡片界面
|
| | | 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;
|
| | | };
|
| | | }
|
| | |
| | | /// 初始化控件
|
| | | /// </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);
|
| | |
| | | {
|
| | | //窗帘类型的深度卡片界面
|
| | | 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;
|
| | | };
|
| | | }
|
| | |
| | | /// 初始化控件
|
| | | /// </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)
|
| | |
| | | //深度卡片信息
|
| | | 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();
|
| | |
| | | /// 初始化控件
|
| | | /// </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);
|
| | |
| | | { |
| | | //新风类型的深度卡片界面 |
| | | 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;
|
| | | };
|
| | | } |
| | |
| | | /// 初始化控件
|
| | | /// </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); |
| | |
| | | { |
| | | //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;
|
| | | };
|
| | | } |
| | |
| | | /// 初始化控件
|
| | | /// </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);
|
| | |
| | |
|
| | | //继电器类型的深度卡片界面(含空气开关)
|
| | | 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;
|
| | | };
|
| | | }
|
| | |
| | | /// <param name="parameter">启动参数:参数由指定画面的ShowForm函数所指定</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;
|
| | |
| | |
|
| | | //执行ShowForm()方法
|
| | | this.LoadShowFormMethod(parameter);
|
| | |
|
| | | //界面加载结束
|
| | | ControlCommonResourse.IsFormAdding = false;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | 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 ■ 显示重新加载_______________________ |
| | | |
| | |
| | | {
|
| | | }
|
| | |
|
| | | #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 ■ 显示没有数据的图像显示特效_________ |
| | |
| | | public async void Read() |
| | | { |
| | | |
| | | |
| | | |
| | | |
| | | CommonPage.Loading.Start(); |
| | | if (!BoolExist()) |
| | | { |
| | |
| | | { |
| | | continue; |
| | | } |
| | | bool yes = false; |
| | | for (int a = 0; a < logic.Accounts.Count; a++) |
| | | { |
| | | //Option4是设备mac;Option2是设备端口; |
| | | 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是设备mac;Option2是设备端口; |
| | | // 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]); |
| | | //} |
| | | } |
| | | } |
| | | } |
| | |
| | | //查找是否是那个门锁; |
| | | //如果不是该门锁联动事件不显示出来; |
| | | 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; |
| | |
| | | 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;//执行一次 |
| | |
| | | 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) |
| | | { |
| | |
| | | /// 注意(参数: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); |
| | |
| | | //默认取第一个逻辑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); |
| | |
| | | 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是设备mac;Option2是设备端口; |
| | | if (logic.Accounts[j]["Option4"].ToString() != doorLock.DeviceAddr && logic.Accounts[j]["Option2"].ToString() != doorLock.DeviceEpoint.ToString()) |
| | | { |
| | | //查找是否是那个门锁; |
| | | //如果不是该门锁联动事件不显示出来; |
| | | yes = false; |
| | | } |
| | | else |
| | | { |
| | | yes = true; |
| | | } |
| | | } |
| | | return yes; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | //进来更新一次 |
| | | //查找是否存在时效性自动化;有的话就返回自动化对象; |
| | | var logic = await SkipView.GetLogicIfon(); |
| | | var logic = await SkipView.GetLogicIfon(Send.CurrentDoorLock); |
| | | if (logic != null) |
| | | { |
| | | try |
| | |
| | | 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一个新逻辑对象; |
| | | //新增门锁常开模式自动化入口; |
| | | Common.Logic.CurrentLogic = new Common.Logic(); |
| | |
| | | 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; |
| | |
| | | { |
| | | if (logicId != 0) |
| | | { |
| | | |
| | | ///有可能只有常开模式,没有时效性自动化 |
| | | Send.DelLogic(logicId); |
| | | } |
| | |
| | | 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; |
| | |
| | | if (logic.LogicType != 2) |
| | | { |
| | | continue; |
| | | }
|
| | | if (SkipView.ExistLogic(logic,Send.CurrentDoorLock))
|
| | | {
|
| | | Common.Logic.SoneLogicList.Add(logic);
|
| | | } |
| | | Common.Logic.SoneLogicList.Add(logic); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <param name="account">登陆账号</param>
|
| | | public void ShowForm(string account = "")
|
| | | {
|
| | | if (account == string.Empty)
|
| | | {
|
| | | //使用上一次登陆的账号
|
| | | account = Common.Config.Instance.Account;
|
| | | }
|
| | | if (Config.Instance.IsLogin == true)
|
| | | {
|
| | | return;
|
| | |
| | | /// <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>
|
| | |
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
| | | /// </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;
|
| | |
|
| | |
| | | btnMore.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var detailInfo = new DeviceDetailInfoForm();
|
| | | detailInfo.AddForm(device, room);
|
| | | detailInfo.AddForm(device, nowSelectRoom);
|
| | | };
|
| | |
|
| | | //初始化中部信息
|
| | |
| | | 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);
|
| | |
|
| | | //收藏
|
| | |
| | | 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)
|
| | |
| | | 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;
|
| | |
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("DeviceDetailCardAttribute" + mainKeys);
|
| | |
|
| | | //回调函数
|
| | | this.FormCloseEvent?.Invoke(this.device, this.room);
|
| | | this.FormCloseEvent?.Invoke(this.device);
|
| | | this.FormCloseEvent = null;
|
| | |
|
| | | base.CloseFormBefore();
|
| | |
| | | /// 判断是否有开关功能
|
| | | /// </summary>
|
| | | private bool isHadOpenSwitch = true;
|
| | | /// <summary>
|
| | | /// 当前选择的房间
|
| | | /// </summary>
|
| | | public Common.Room nowSelectRoom = null;
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | /// 初始化控件
|
| | | /// </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";
|
| | |
| | | {
|
| | | //取消收藏
|
| | | HdlRoomLogic.Current.DeleteLoveDevice(i_device);
|
| | | if (HdlRoomLogic.Current.CurrentRoom.IsLove == true)
|
| | | if (this.nowSelectRoom.IsLove == true)
|
| | | {
|
| | | //如果当前房间是我的喜爱的话,回调卡片被删除的事件
|
| | | this.CardNeedRemoveEvent?.Invoke();
|
| | |
| | | /// 深度卡片信息的返回事件(底层专用)
|
| | | /// </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)
|
| | |
| | | {
|
| | | //如果这个设备改变了房间的话,回调卡片被删除的函数
|
| | | 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;
|
| | |
| | | /// 初始化控件
|
| | | /// </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);
|
| | |
| | |
|
| | | //空调类型的深度卡片界面
|
| | | 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;
|
| | | };
|
| | | }
|
| | |
| | | /// 初始化控件
|
| | | /// </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);
|
| | |
| | |
|
| | | //继电器类型的深度卡片界面(含空气开关)
|
| | | 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;
|
| | | };
|
| | | }
|
| | |
| | | /// 初始化控件
|
| | | /// </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);
|
| | |
| | |
|
| | | //彩灯,调光器类型的深度卡片界面
|
| | | 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;
|
| | | };
|
| | | }
|
| | |
| | | /// 初始化控件
|
| | | /// </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);
|
| | |
| | | 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;
|
| | | };
|
| | | }
|
| | |
| | | /// 初始化控件
|
| | | /// </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)
|
| | | {
|
| | |
| | | {
|
| | | 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;
|
| | |
| | | /// 新风卡片的控件
|
| | | /// </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);
|
| | |
| | | |
| | | //新风类型的深度卡片界面 |
| | | 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;
|
| | | };
|
| | | }
|
| | |
| | | /// 初始化控件
|
| | | /// </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);
|
| | |
| | |
|
| | | //继电器类型的深度卡片界面(含空气开关)
|
| | | 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;
|
| | | };
|
| | | }
|
| | |
| | | {
|
| | | //取消收藏
|
| | | HdlSceneLogic.Current.DeleteLoveScene(i_scene);
|
| | | if (HdlRoomLogic.Current.CurrentRoom.IsLove == true)
|
| | | if (HdlRoomLogic.Current.NowMainPageRoom.IsLove == true)
|
| | | {
|
| | | //如果当前房间是我的喜爱的话,回调卡片被删除的事件
|
| | | this.CardNeedRemoveEvent?.Invoke();
|
| | |
| | | /// <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>
|
| | |
| | | };
|
| | |
|
| | | //喜爱房间不允许变更区域
|
| | | if (this.room.IsLove == false)
|
| | | if (this.room == null || this.room.IsLove == false)
|
| | | {
|
| | | //所属区域
|
| | | var rowBeloneArea = new BelongAreaControl(listview.rowSpace / 2);
|
| | |
| | | btnNote.AddBottomLine();
|
| | |
|
| | | //喜爱房间不允许出现区域
|
| | | if (this.room.IsLove == false)
|
| | | if (this.room == null || this.room.IsLove == false)
|
| | | {
|
| | | //所属区域
|
| | | caption = Language.StringByID(R.MyInternationalizationString.uBelongArea);
|
| | |
| | | /// </summary>
|
| | | public override void CloseFormBefore()
|
| | | {
|
| | | this.FormCloseEvent?.Invoke(this.device, this.room);
|
| | | this.FormCloseEvent?.Invoke();
|
| | | this.FormCloseEvent = null;
|
| | |
|
| | | base.CloseFormBefore();
|
| | |
| | |
|
| | | //当前房间
|
| | | 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++)
|
| | | {
|
| | |
| | | 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);
|
| | |
| | | btnRoomRightShadow.Visible = true;
|
| | | btnRoomBottomShadow.Visible = true;
|
| | | //切换当前房间
|
| | | HdlRoomLogic.Current.CurrentRoom = listRoom[curIndex];
|
| | | HdlRoomLogic.Current.NowMainPageRoom = listRoom[curIndex];
|
| | | //刷新设备桌布控件
|
| | | this.isRoomChanging = false;
|
| | | this.RefreshBodyView();
|
| | |
| | | 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);
|
| | | //判断该设备能否显示在主页
|
| | |
| | | cardContr.X = XX;
|
| | | cardContr.Y = YY;
|
| | | listDeviceBackContr.AddChidren(cardContr);
|
| | | cardContr.InitControl(device);
|
| | | cardContr.InitControl(device, HdlRoomLogic.Current.NowMainPageRoom);
|
| | | //卡片需要被移除的事件
|
| | | cardContr.CardNeedRemoveEvent += () =>
|
| | | {
|
| | |
| | | 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)
|
| | |
| | | floorFL.FloorAction = (floorId) =>
|
| | | {
|
| | | btnFloor.Text = Config.Instance.Home.GetFloorNameById(floorId);
|
| | | HdlRoomLogic.Current.CurrentRoom = HdlRoomLogic.Current.GetLoveRoom();
|
| | | HdlRoomLogic.Current.NowMainPageRoom = HdlRoomLogic.Current.GetLoveRoom();
|
| | | this.ShowForm();
|
| | | };
|
| | | }
|
| | |
| | | }
|
| | | string oldFloorId = Config.Instance.Home.CurrentFloorId;
|
| | | CommonPage.Instance.CloseLeftMenu();
|
| | | HdlRoomLogic.Current.CurrentRoom = room;
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | |
| | | frameContr.CollectEvent += (collect) =>
|
| | | {
|
| | | //如果当前是收藏房间,则需要刷新主页
|
| | | if (HdlRoomLogic.Current.CurrentRoom.IsLove == true)
|
| | | if (HdlRoomLogic.Current.NowMainPageRoom.IsLove == true)
|
| | | {
|
| | | this.dataHadChanged = true;
|
| | | }
|
| | |
| | | selectZone.ZoneAction += (selectRoom) => |
| | | { |
| | | //变更了当前房间的东西,主页需要刷新 |
| | | if (HdlRoomLogic.Current.CurrentRoom.Id == selectRoom.Id)
|
| | | if (HdlRoomLogic.Current.NowMainPageRoom.Id == selectRoom.Id)
|
| | | {
|
| | | this.dataHadChanged = true;
|
| | | } |
| | |
| | | this.MouseUpEventHandler -= ButtonBase_MouseUpEventHandler;
|
| | | return;
|
| | | }
|
| | | if (CanClick == true)
|
| | | //2020.05.14追加IsFormAdding:界面还在加载中,不能再点击
|
| | | if (CanClick == true && ControlCommonResourse.IsFormAdding == false)
|
| | | {
|
| | | //Log出力
|
| | | this.WriteLog(0);
|
| | |
| | | }
|
| | | 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
|
old mode 100644
new mode 100755
| | |
| | | /// <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
|
| | | }
|
| | |
|
old mode 100644
new mode 100755
| | |
| | | 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
|
| | | }
|
| | |
|
old mode 100644
new mode 100755
| | |
| | | /// <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
|
| | | }
|
| | |
|
old mode 100644
new mode 100755
| | |
| | | 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
|
| | | }
|
| | |
|
| | |
| | | this.InitDeviceData();
|
| | | //初始化场景
|
| | | this.InitSceneData();
|
| | | //刷新左边刷新房间视图列表
|
| | | HdlRoomLogic.Current.RefreshRoomListView();
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | 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;
|
| | |
|
| | |
| | | //温度
|
| | | 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;
|
| | |
| | | //湿度
|
| | | 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;
|
| | | }
|
| | | }
|
| | | //已经接收到状态
|
| | |
| | | {
|
| | | //温居城的要网关中是否有逻辑存在
|
| | | //参数: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(() =>
|
| | | {
|
| | | //弹出徐梅的那个窗口
|
| | |
| | | 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>
|
| | |
| | | /// </summary>
|
| | | public void InitAllRoom()
|
| | | {
|
| | | this.NowMainPageRoom = null;
|
| | | this.NowCategoryRoom = null;
|
| | |
|
| | | //清空本地缓存
|
| | | this.dicRooms.Clear();
|
| | | //检测我的喜爱这个房间对象
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | //从原来的房间移除设备
|
| | | this.DeleteDevice(device);
|
| | | //从原来的房间移除设备,这里不删除真实设备的房间
|
| | | this.DeleteDevice(device, false);
|
| | |
|
| | | //添加到新的房间
|
| | | var room = this.GetRoomById(roomId);
|
| | |
| | | /// 删除设备(这个函数不删除我的喜爱)
|
| | | /// </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)
|
| | |
| | | HdlAutoBackupLogic.AddOrEditorFile(room.FileName);
|
| | |
|
| | | //递归:删除掉以前的旧数据导致的多个房间的问题
|
| | | this.DeleteDevice(device);
|
| | | this.DeleteDevice(device, deleteReal);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// <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;
|
| | |
| | | continue;
|
| | | }
|
| | | listEsxit.Add(scene.ScenesId);
|
| | | //刷新scene的信息
|
| | | this.RefreshScene(scene);
|
| | | }
|
| | |
|
| | | var listDelete = new List<SceneUI>();
|
| | |
| | | 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 ■ 添加场景___________________________
|
| | |
| | | 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);
|
| | |
| | | {
|
| | | //调用这个方法,都需要重新刷新主页
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | |
|
| | | //如果是虚拟住宅
|
| | | if (Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | |
| | | Common.LocalDevice.Current.ReFreshByLocal();
|
| | | //初始化房间(郭雪城那边不做处理,需要这里特殊执行一步)
|
| | | HdlRoomLogic.Current.RefreshAllRoomByLocation();
|
| | | //刷新左边刷新房间视图列表
|
| | | HdlRoomLogic.Current.RefreshRoomListView();
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// 徐梅的门锁界面是否是打开的状态
|
| | | /// </summary>
|
| | | public static bool IsDoorLockPageOpen = false;
|
| | | /// <summary>
|
| | | /// 是否是界面正在加载中(底层专用,不需要理)
|
| | | /// </summary>
|
| | | public static bool IsFormAdding = false;
|
| | | #if Android
|
| | | /// <summary>
|
| | | /// 两个文本拼接时,为了看起来是正常的,需要减去它们之间的间隔误差
|
| | |
| | | {
|
| | | //方悦面板的功能配置
|
| | | var form = new DevicePanel.PanelFangyueFunctionSettionForm();
|
| | | form.AddForm(device);
|
| | | form.AddForm(device, deviceEnumInfo);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | 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);
|
| | |
| | | || 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)
|
| | |
| | | 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);
|
| | |
| | | {
|
| | | //按键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);
|
| | |
| | |
|
| | | //按键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;
|
| | |
| | |
|
| | | //按键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;
|
| | |
| | |
|
| | | //按键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;
|
| | |
| | | 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);
|
| | |
| | | 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);
|
| | |
| | | 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();
|
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | /// </summary>
|
| | | private CommonDevice deviceObj = null;
|
| | | /// <summary>
|
| | | /// 设备的类型
|
| | | /// </summary>
|
| | | private DeviceEnumInfo deviceEnum = null;
|
| | | /// <summary>
|
| | | /// 设备需要保存的设备名字
|
| | | /// </summary>
|
| | | private Dictionary<int, string> dicDeviceSaveName = new Dictionary<int, string>();
|
| | |
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
| | | /// </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));
|
| | |
| | | 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)
|
| | |
| | |
|
| | | 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);
|
| | | }
|
| | |
| | | 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);
|
| | |
| | | #region ■ 初始化二按键图标___________________
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化二按键面板的图标
|
| | | /// 初始化单开双控面板的图标
|
| | | /// </summary>
|
| | | /// <param name="frameBack">容器</param>
|
| | | /// <param name="listDevice">设备列表</param>
|
| | |
| | | #region ■ 初始化四按键图标___________________
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化四按键面板的图标
|
| | | /// 初始化双开四控键面板的图标
|
| | | /// </summary>
|
| | | /// <param name="frameBack">容器</param>
|
| | | /// <param name="listDevice">设备列表</param>
|
| | |
| | | {
|
| | | //按键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);
|
| | |
| | |
|
| | | //按键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;
|
| | |
| | |
|
| | | //按键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;
|
| | |
| | |
|
| | | //按键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;
|
| | |
| | | #region ■ 初始化八按键图标___________________
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化八按键面板的图标
|
| | | /// 初始化四开八控面板的图标
|
| | | /// </summary>
|
| | | /// <param name="frameBack">容器</param>
|
| | | /// <param name="listDevice">设备列表</param>
|
| | |
| | | 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>
|
| | |
| | | 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);
|
| | |
| | | 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);
|
| | |
| | | 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();
|
| | |
| | | public static void NormallyOpenModeValue(ZigBee.Device.DoorLock doorLock, bool value) |
| | | { |
| | | doorLock.IsDoorLockNormallyMode = value; |
| | | |
| | | if (LogicAction != null) |
| | | { |
| | | LogicAction(value); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | //上报“常开模式”已被取消,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 |
| | |
| | | if (haveLogic) |
| | | { |
| | | //此处删除温居城的常开模式特殊逻辑 |
| | | var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(); |
| | | var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(doorLock); |
| | | } |
| | | |
| | | //app重新开启“常开模式” |
| | |
| | | }); |
| | | action?.Invoke(doorLock.IsDoorLockNormallyMode); |
| | | action = null; |
| | | if (LogicAction != null) |
| | | { |
| | | LogicAction(false); |
| | | } |
| | | return; |
| | | } |
| | | if (result.defaultControlResponseData.status != 0) |
| | |
| | | NormallyOpenModeValue(doorLock, false); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | |
| | | action?.Invoke(doorLock.IsDoorLockNormallyMode); |
| | | action = null; |
| | | if (LogicAction != null) |
| | | { |
| | | LogicAction(false); |
| | | } |
| | | return; |
| | | } |
| | | else |
| | |
| | | ShowTipMsg(msg0); |
| | | NormallyOpenModeValue(doorLock, true); |
| | | CommonPage.Loading.Hide(); |
| | | if (LogicAction != null) |
| | | { |
| | | LogicAction(true); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | |
| | | 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 |
| | |
| | | }); |
| | | action?.Invoke(doorLock.IsDoorLockNormallyMode); |
| | | action = null; |
| | | if (LogicAction != null) |
| | | { |
| | | LogicAction(false); |
| | | } |
| | | return; |
| | | } |
| | | if (result.defaultControlResponseData.status != 0) |
| | |
| | | }); |
| | | action?.Invoke(doorLock.IsDoorLockNormallyMode); |
| | | action = null; |
| | | if (LogicAction != null) |
| | | { |
| | | LogicAction(false); |
| | | } |
| | | return; |
| | | } |
| | | else |
| | |
| | | if (haveLogic) |
| | | { |
| | | //此处删除温居城的常开模式特殊逻辑 |
| | | var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(); |
| | | var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(doorLock); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | ShowTipMsg(msg2); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | if (LogicAction != null) |
| | | { |
| | | LogicAction(false); |
| | | } |
| | | } |
| | | } |
| | | action?.Invoke(doorLock.IsDoorLockNormallyMode); |
| | |
| | | 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; |
| | |
| | | //开锁事件 |
| | | 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 |
| | |
| | | //关锁事件 |
| | | 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(); |
| | | }); |
| | | } |
| | | } |
| | |
| | | { |
| | | 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 |
| | |
| | | { |
| | | //上报“常开模式”已被取消 |
| | | 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); |
| | |
| | | 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 |
| | |
| | | { |
| | | 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); |
| | |
| | | {
|
| | | 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();
|
| | |
| | | {
|
| | | 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();
|
| | |
| | | //确认删除房间?
|
| | | 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();
|
| | |
| | | listDeleteId.Add(listAllRoom[i].Id);
|
| | | }
|
| | | }
|
| | | //如果当前选择的房间是删除对象的话
|
| | | if (HdlRoomLogic.Current.CurrentRoom.FloorId == keys)
|
| | | {
|
| | | HdlRoomLogic.Current.CurrentRoom = HdlRoomLogic.Current.GetLoveRoom();
|
| | | }
|
| | | //删除房间
|
| | | foreach (string roomId in listDeleteId)
|
| | | {
|
| | |
| | | //确认删除房间?
|
| | | 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);
|
| | |
| | | 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;
|
| | |
| | | }
|
| | |
|
| | | 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();
|
| | |
| | | { |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; |
| | | Tag = "Login"; |
| | | this.BackgroundImagePath = "Logo/StartBackGroud.png"; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </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); |
| | | } |
| | | } |
| | | } |
| | |
| | | public static class FindGateWaySocket |
| | | { |
| | | //本地Socket |
| | | public static System.Net.Sockets.Socket busSocket; |
| | | public static Socket busSocket; |
| | | |
| | | /// <summary> |
| | | /// 启动Socket接收和发送功能 |
| | |
| | | { |
| | | get |
| | | { |
| | | return null == busSocket ? false : true; |
| | | return busSocket == null ? false : true; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | 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> |
| | |
| | | { |
| | | 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; |
| | |
| | | /// 游客体验
|
| | | /// </summary>
|
| | | public const int uExperienceAccount = 16116;
|
| | | /// <summary>
|
| | | /// 智能改变生活 | Enjoy smart life
|
| | | /// </summary>
|
| | | public const int uLogoPageText = 16117;
|
| | | /// <summary> |
| | | /// 网络不稳定,场景列表信息缺损 |
| | | /// </summary> |
| | | public const int uNetworkUnStableAndSceneInfoIsNotFull = 16118; |
| | |
|
| | |
|
| | | //★★★★下面这些是接口的返回信息翻译,从18000开始★★★★
|