Merge branch 'dev-tzy' into dev-2020xm
| | |
| | | 16114=灯全关 |
| | | 16115=常开自动化手动取消 |
| | | 16116=游客体验 |
| | | 16117=智能改变生活 | Enjoy smart life |
| | | 16118=网络不稳定,场景列表信息缺损 |
| | | 16119=DATA绿色指示灯闪烁 |
| | | |
| | | ;★★★★下面这些是接口的返回信息翻译,从18000开始★★★★
|
| | | 18004=指定网关已经被绑定
|
| | |
| | | ;中继器入网操作指示
|
| | | 21014=长按图示按键5秒以上,指示灯变绿闪烁{0}进入配网状态,绿灯熄灭则入网成功
|
| | | ;空调入网操作指示
|
| | | 21015=长按图示按键5秒以上,指示灯{0}变绿闪烁,进入配网状态{0}绿灯每5秒闪烁一次则入网成功
|
| | | 21015=长按编程按键5秒,DATA绿色LED闪烁,{0}频率为亮0.5秒,灭0.5秒
|
| | | ;pir传感器入网操作指示
|
| | | 21016=长按图示按键5秒以上,指示灯变绿、{0}闪烁进入配网状态。绿灯熄灭则配网成功
|
| | | ;温湿度传感器入网操作指示
|
| | |
| | | <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" /> |
| | |
| | | { |
| | | base.ViewDidLoad(); |
| | | |
| | | //11.0版本以下自动偏移取消 |
| | | if (!UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) |
| | | { |
| | | this.AutomaticallyAdjustsScrollViewInsets = false; |
| | | } |
| | | |
| | | if (NSLocale.PreferredLanguages[0].Contains("zh-")) |
| | | { |
| | | //if (NSLocale.PreferredLanguages [0].Contains (@"zh-") && NSLocale.PreferredLanguages [0].Contains (@"-CN")) { |
| | |
| | | 319=轻度污染 |
| | | 320=中度污染 |
| | | 321=重度污染 |
| | | 322=严重污染 |
| | | 322=严重污染 |
| | | |
| | | 5097=取消 |
| | | 5098=确定 |
| | |
| | | 16114=灯全关 |
| | | 16115=常开自动化手动取消 |
| | | 16116=游客体验 |
| | | 16117=智能改变生活 | Enjoy smart life |
| | | 16118=网络不稳定,场景列表信息缺损 |
| | | 16119=DATA绿色指示灯闪烁 |
| | | |
| | | ;★★★★下面这些是接口的返回信息翻译,从18000开始★★★★ |
| | | 18004=指定网关已经被绑定 |
| | | 18005=用户不存在于此住宅 |
| | | 18006=账号已经存在于此住宅 |
| | | 18009=操作权限不足 |
| | | 18010=被绑定的子账号不存在,请注册后再试 |
| | | 18011=操作的子账号不存在 |
| | | 18012=解除绑定的子账号不存在 |
| | | 18013=验证码发送失败 |
| | | 18015=账号已经存在 |
| | | 18016=验证码错误 |
| | | 18017=验证码已失效 |
| | | 18018=绑定的账号不存在 |
| | | 18019=指定账号已存在 |
| | | 18022=验证码发送失败 |
| | | 18024=指定账号不存在 |
| | | 18025=原密码和新密码相同 |
| | | 18026=原密码错误 |
| | | 18034=账号未注册 |
| | | 18035=请求参数错误 |
| | | 18036=无效的登录密匙 |
| | | 18039=当前编辑的住宅名称已经存在 |
| | | 18040=当前添加的住宅名称已经存在 |
| | | 18041=指定的住宅不存在 |
| | | 18042=当前备份不属于您当前的住宅 |
| | | 18043=备注名称已经存在,请更换后重试! |
| | | 18044=指定的网关ID并不存在 |
| | | 18045=当前住宅下并没有绑定指定的网关 |
| | | 18046=当前住宅还存在着未解除绑定的网关 |
| | | 18047=共享数据不存在 |
| | | 18048=分享的目标账号不存在 |
| | | 18049=分享数据操作失败 |
| | | 18050=不能把自己添加为成员 |
| | | 18051=不能把主账号添加为成员 |
| | | |
| | | |
| | | ;★★★★下面这些是设备的入网步骤,从21000开始★★★★ |
| | | ;智能门锁入网操作指示 |
| | | 21000=唤醒门锁,输入“*”、“#”、“管理员密码”{0}按语音提示,输入“4”选择功能菜单{0}输入“1”,确认设备入网 |
| | | ;3路继电器入网操作指示 |
| | | 21001=长按图示按键5秒以上,指示灯变绿、闪烁{0}进入配网状态。绿灯熄灭则配网成功 |
| | | ;1路调光器小模块入网操作指示 |
| | | 21002=长按图示按键5秒以上,指示灯变绿、闪烁{0}进入配网状态。绿灯熄灭则配网成功 |
| | | ;二按键面板入网操作指示 |
| | | 21003=长按图示按键5秒以上,指示灯变绿、闪烁{0}进入配网状态。绿灯快闪3秒则配网成功 |
| | | ;三按键面板入网操作指示 |
| | | 21004=长按图示按键5秒以上,指示灯变绿、闪烁{0}进入配网状态。绿灯快闪3秒则配网成功 |
| | | ;四按键面板入网操作指示 |
| | | 21005=长按图示按键5秒以上,指示灯变绿、闪烁{0}进入配网状态。绿灯快闪3秒则配网成功 |
| | | ;Zigbee智能开合帘电机入网操作指示 |
| | | 21006=长按图示按键5秒以上,指示灯{0}变绿闪烁,则进入配网状态{0}绿灯熄灭则配网成功 |
| | | ;Zigbee智能管状电机入网操作指示 |
| | | 21007=长按图示按键5秒以上,指示灯{0}变绿闪烁,则进入配网状态{0}绿灯熄灭则配网成功 |
| | | ;红外传感器入网操作指示 |
| | | 21008=长按图示按键5秒以上,绿色快闪{0}进入配网状态,绿灯常亮则入网成功 |
| | | ;门窗传感器入网操作指示 |
| | | 21009=长按图示按键5秒以上,绿色快闪{0}进入配网状态,绿灯常亮则入网成功 |
| | | ;燃气传感器入网操作指示 |
| | | 21010=长按图示按键5秒以上,绿色快闪{0}进入配网状态,绿灯常亮则入网成功 |
| | | ;烟雾传感器入网操作指示 |
| | | 21011=长按图示按键5秒以上,绿色快闪{0}进入配网状态,绿灯常亮则入网成功 |
| | | ;水浸传感器入网操作指示 |
| | | 21012=长按图示按键5秒以上,绿色快闪{0}进入配网状态,绿灯常亮则入网成功 |
| | | ;空气开关入网操作指示 |
| | | 21013=按键从工作模式拨到配对模式,5秒后红灯{0}慢闪烁时拨回工作模式,{0}进入配网模式,红灯常亮则配网成功 |
| | | ;中继器入网操作指示 |
| | | 21014=长按图示按键5秒以上,指示灯变绿闪烁{0}进入配网状态,绿灯熄灭则入网成功 |
| | | ;空调入网操作指示 |
| | | 21015=长按图示按键5秒以上,指示灯{0}变绿闪烁,进入配网状态{0}绿灯每5秒闪烁一次则入网成功 |
| | | ;pir传感器入网操作指示 |
| | | 21016=长按图示按键5秒以上,指示灯变绿、{0}闪烁进入配网状态。绿灯熄灭则配网成功 |
| | | ;温湿度传感器入网操作指示 |
| | | 21017=长按图示按键5秒以上,信号图标{0}快闪, 进入配网状态。图标常亮则配网成功 |
| | | ;方悦2按键轻触式面板入网操作指示 |
| | | 21018=长按BUTTON1按键5秒,所有指示灯{0}变为绿色并闪烁,进入配网状态 |
| | | ;方悦4按键轻触式面板入网操作指示 |
| | | 21019=长按BUTTON1按键5秒,所有指示灯{0}变为绿色并闪烁,进入配网状态 |
| | | ;方悦8按键轻触式面板入网操作指示 |
| | | 21020=长按BUTTON1按键5秒,所有指示灯{0}变为绿色并闪烁,进入配网状态 |
| | | ;方悦环境面板入网操作指示 |
| | | 21021=按住面板功能(function)按键,所有按键{0}指示灯亮起,则配网成功 |
| | | ;窗帘面板的入网操作指示 |
| | | 21022=长按面板左上角按键,所有按键{0}指示灯亮起,则配网成功 |
| | | ;吸顶燃气传感器的入网操作指示 |
| | | 21023=长按图示按键5秒以上,绿色快闪{0}进入配网状态,绿灯常亮则入网成功 |
| | | |
| | | ;★★★★下面这些是模块ID的官方名字,从30000开始★★★★ |
| | | 30000=紧急按钮 |
| | | 30001=燃气传感器 |
| | | ;★★★★下面这些是接口的返回信息翻译,从18000开始★★★★
|
| | | 18004=指定网关已经被绑定
|
| | | 18005=用户不存在于此住宅
|
| | | 18006=账号已经存在于此住宅
|
| | | 18009=操作权限不足
|
| | | 18010=被绑定的子账号不存在,请注册后再试
|
| | | 18011=操作的子账号不存在
|
| | | 18012=解除绑定的子账号不存在
|
| | | 18013=验证码发送失败
|
| | | 18015=账号已经存在
|
| | | 18016=验证码错误
|
| | | 18017=验证码已失效
|
| | | 18018=绑定的账号不存在
|
| | | 18019=指定账号已存在
|
| | | 18022=验证码发送失败
|
| | | 18024=指定账号不存在
|
| | | 18025=原密码和新密码相同
|
| | | 18026=原密码错误
|
| | | 18034=账号未注册
|
| | | 18035=请求参数错误
|
| | | 18036=无效的登录密匙
|
| | | 18039=当前编辑的住宅名称已经存在
|
| | | 18040=当前添加的住宅名称已经存在
|
| | | 18041=指定的住宅不存在
|
| | | 18042=当前备份不属于您当前的住宅
|
| | | 18043=备注名称已经存在,请更换后重试!
|
| | | 18044=指定的网关ID并不存在
|
| | | 18045=当前住宅下并没有绑定指定的网关
|
| | | 18046=当前住宅还存在着未解除绑定的网关
|
| | | 18047=共享数据不存在
|
| | | 18048=分享的目标账号不存在
|
| | | 18049=分享数据操作失败
|
| | | 18050=不能把自己添加为成员
|
| | | 18051=不能把主账号添加为成员
|
| | |
|
| | |
|
| | | ;★★★★下面这些是设备的入网步骤,从21000开始★★★★
|
| | | ;智能门锁入网操作指示
|
| | | 21000=唤醒门锁,输入“*”、“#”、“管理员密码”{0}按语音提示,输入“4”选择功能菜单{0}输入“1”,确认设备入网
|
| | | ;3路继电器入网操作指示
|
| | | 21001=长按图示按键5秒以上,指示灯变绿、闪烁{0}进入配网状态。绿灯熄灭则配网成功
|
| | | ;1路调光器小模块入网操作指示
|
| | | 21002=长按图示按键5秒以上,指示灯变绿、闪烁{0}进入配网状态。绿灯熄灭则配网成功
|
| | | ;二按键面板入网操作指示
|
| | | 21003=长按图示按键5秒以上,指示灯变绿、闪烁{0}进入配网状态。绿灯快闪3秒则配网成功
|
| | | ;三按键面板入网操作指示
|
| | | 21004=长按图示按键5秒以上,指示灯变绿、闪烁{0}进入配网状态。绿灯快闪3秒则配网成功
|
| | | ;四按键面板入网操作指示
|
| | | 21005=长按图示按键5秒以上,指示灯变绿、闪烁{0}进入配网状态。绿灯快闪3秒则配网成功
|
| | | ;Zigbee智能开合帘电机入网操作指示
|
| | | 21006=长按图示按键5秒以上,指示灯{0}变绿闪烁,则进入配网状态{0}绿灯熄灭则配网成功
|
| | | ;Zigbee智能管状电机入网操作指示
|
| | | 21007=长按图示按键5秒以上,指示灯{0}变绿闪烁,则进入配网状态{0}绿灯熄灭则配网成功
|
| | | ;红外传感器入网操作指示
|
| | | 21008=长按图示按键5秒以上,绿色快闪{0}进入配网状态,绿灯常亮则入网成功
|
| | | ;门窗传感器入网操作指示
|
| | | 21009=长按图示按键5秒以上,绿色快闪{0}进入配网状态,绿灯常亮则入网成功
|
| | | ;燃气传感器入网操作指示
|
| | | 21010=长按图示按键5秒以上,绿色快闪{0}进入配网状态,绿灯常亮则入网成功
|
| | | ;烟雾传感器入网操作指示
|
| | | 21011=长按图示按键5秒以上,绿色快闪{0}进入配网状态,绿灯常亮则入网成功
|
| | | ;水浸传感器入网操作指示
|
| | | 21012=长按图示按键5秒以上,绿色快闪{0}进入配网状态,绿灯常亮则入网成功
|
| | | ;空气开关入网操作指示
|
| | | 21013=按键从工作模式拨到配对模式,5秒后红灯{0}慢闪烁时拨回工作模式,{0}进入配网模式,红灯常亮则配网成功
|
| | | ;中继器入网操作指示
|
| | | 21014=长按图示按键5秒以上,指示灯变绿闪烁{0}进入配网状态,绿灯熄灭则入网成功
|
| | | ;空调入网操作指示
|
| | | 21015=长按编程按键5秒,DATA绿色LED闪烁,{0}频率为亮0.5秒,灭0.5秒
|
| | | ;pir传感器入网操作指示
|
| | | 21016=长按图示按键5秒以上,指示灯变绿、{0}闪烁进入配网状态。绿灯熄灭则配网成功
|
| | | ;温湿度传感器入网操作指示
|
| | | 21017=长按图示按键5秒以上,信号图标{0}快闪, 进入配网状态。图标常亮则配网成功
|
| | | ;方悦2按键轻触式面板入网操作指示
|
| | | 21018=长按BUTTON1按键5秒,所有指示灯{0}变为绿色并闪烁,进入配网状态
|
| | | ;方悦4按键轻触式面板入网操作指示
|
| | | 21019=长按BUTTON1按键5秒,所有指示灯{0}变为绿色并闪烁,进入配网状态
|
| | | ;方悦8按键轻触式面板入网操作指示
|
| | | 21020=长按BUTTON1按键5秒,所有指示灯{0}变为绿色并闪烁,进入配网状态
|
| | | ;方悦环境面板入网操作指示
|
| | | 21021=按住面板功能(function)按键,所有按键{0}指示灯亮起,则配网成功
|
| | | ;窗帘面板的入网操作指示
|
| | | 21022=长按面板左上角按键,所有按键{0}指示灯亮起,则配网成功
|
| | | ;吸顶燃气传感器的入网操作指示
|
| | | 21023=长按图示按键5秒以上,绿色快闪{0}进入配网状态,绿灯常亮则入网成功
|
| | |
|
| | | ;★★★★下面这些是模块ID的官方名字,从30000开始★★★★
|
| | | 30000=紧急按钮
|
| | | 30001=燃气传感器
|
| | | 30002=烟雾传感器 |
| | | 30003=水侵传感器 |
| | | 30004=钥匙扣 |
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.20051801"; |
| | | /// <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;
|
| | | }
|
| | | else
|
| | | {
|
| | | //2020.05.18追加:如果记录的房间ID是不存在的话,则重新覆盖
|
| | | var room = HdlRoomLogic.Current.GetRoomById(this.dicDeviceRoomId[listDevice[0].DeviceAddr]);
|
| | | if (room == null)
|
| | | {
|
| | | 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);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | //添加自动备份
|
| | | HdlAutoBackupLogic.AddOrEditorFile(DirNameResourse.DeviceRoomIdFile);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 根据房间ID,移除指定的真实物理设备的所属房间记录
|
| | | /// </summary>
|
| | | /// <param name="i_RoomId"></param>
|
| | | public void DeleteRealDeviceByRoomId(string i_RoomId)
|
| | | {
|
| | | var listDeleteKey = new List<string>();
|
| | | foreach (var deviceAddr in this.dicDeviceRoomId.Keys)
|
| | | {
|
| | | if (this.dicDeviceRoomId[deviceAddr] == i_RoomId
|
| | | && listDeleteKey.Contains(deviceAddr) == false)
|
| | | {
|
| | | listDeleteKey.Add(deviceAddr);
|
| | | }
|
| | | }
|
| | | //将真实物理设备从房间中移除
|
| | | this.DeleteRealDeviceFromRoom(listDeleteKey);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | 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(logic); |
| | | //bool yes = false; |
| | | //for (int a = 0; a < logic.Accounts.Count; a++) |
| | | //{ |
| | | // //Option4是设备mac;Option2是设备端口; |
| | | // if (logic.Accounts[a]["Option4"].ToString() != Send.CurrentDoorLock.DeviceAddr) |
| | | // { |
| | | // //查找是否是那个门锁; |
| | | // //如果不是该门锁联动事件不显示出来; |
| | | // 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]); |
| | | //} |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <returns></returns> |
| | | private bool Exist(Common.Logic logic) |
| | | { |
| | | bool yes = false; |
| | | for (int j = 0; j < logic.Accounts.Count; j++) |
| | | { |
| | | //Option4是设备mac;Option2是设备端口; |
| | | if (logic.Accounts[j]["Option4"].ToString() != Send.CurrentDoorLock.DeviceAddr && logic.Accounts[j]["Option2"].ToString() != Send.CurrentDoorLock.DeviceEpoint.ToString()) |
| | | if (logic.Accounts[j]["Option4"].ToString() == Send.CurrentDoorLock.DeviceAddr) |
| | | { |
| | | //查找是否是那个门锁; |
| | | //如果不是该门锁联动事件不显示出来; |
| | | yes = false; |
| | | break; |
| | | return true; |
| | | } |
| | | if (logic.Accounts[j]["Account"].ToString() == Config.Instance.Guid) |
| | | { |
| | | //查找自己账号下的创建联动事件; |
| | | yes = true; |
| | | break; |
| | | } |
| | | |
| | | } |
| | | return yes; |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | if (LogicView.IfString._SoneLogic == if_logic) |
| | | { |
| | | //Sone门锁联动事件逻辑列表 |
| | | //Sone门锁常开模式逻辑列表 |
| | | Common.Logic.SoneLogicList.Add(CurrentLogic); |
| | | |
| | | } |
| | |
| | | return await System.Threading.Tasks.Task.Run(async () => |
| | | { |
| | | List<int> logicIdList = new List<int>(); |
| | | |
| | | Action<string, string> action = (topic, data) => |
| | | { |
| | | var gatewayID = topic.Split('/')[0]; |
| | |
| | | { |
| | | return; |
| | | } |
| | | |
| | | |
| | | if (topic == $"{gatewayID}/Logic/GetLogicList_Respon") |
| | | { |
| | | |
| | |
| | | { |
| | | var logicId = int.Parse(listIfon["LogicId"].ToString()); |
| | | logicIdList.Add(logicId); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | accounts.Add(location); |
| | | } |
| | | break; |
| | | case 8: |
| | | { |
| | | var accounts1 = new JObject(); |
| | | if (dictionary.ContainsKey("Type")) |
| | | { |
| | | accounts1.Add("Type", dictionary["Type"]); |
| | | } |
| | | if (dictionary.ContainsKey("Option4")) |
| | | { |
| | | accounts1.Add("Option4", dictionary["Option4"]); |
| | | } |
| | | if (dictionary.ContainsKey("Option2")) |
| | | { |
| | | accounts1.Add("Option2", int.Parse(dictionary["Option2"])); |
| | | } |
| | | accounts.Add(accounts1); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | } |
| | |
| | | timeConditionsInfo.Add("DelayTime", "0"); |
| | | timeConditionsInfo.Add("StartHour", h); |
| | | timeConditionsInfo.Add("StartMin", m); |
| | | timeConditionsInfo.Add("DoorLockOpenDelayTime", timeVlaue.ToString()); |
| | | timeConditionsInfo.Add("DoorLockOpenDelayTime", (timeVlaue*60*60).ToString()); |
| | | //timeConditionsInfo.Add("DoorLockOpenDelayTime", (timeVlaue * 3600).ToString()); |
| | | Dictionary<string, object> actionsInfo = new Dictionary<string, object>(); |
| | | actionsInfo.Add("LinkType", 8); |
| | | actionsInfo.Add("DeviceAddr", common.DeviceAddr); |
| | | actionsInfo.Add("Epoint", common.DeviceEpoint); |
| | | actionsInfo.Add("Epoint", "200"); |
| | | actionsInfo.Add("PassData", "055704010113");//默认门锁常关 |
| | | |
| | | Dictionary<string, string> accounts = new Dictionary<string, string>(); |
| | | accounts.Add("Type", "8"); |
| | | accounts.Add("Option4", common.DeviceAddr.ToString());//用于判断识别是哪个门锁; |
| | | accounts.Add("Option2", common.DeviceEpoint.ToString()); |
| | | |
| | | Common.Logic currentLogic = new Common.Logic(); |
| | | currentLogic.IsEnable = 1;//默认为开 |
| | |
| | | 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) |
| | | { |
| | | for (int j = 0; j < logic.Accounts.Count; j++) |
| | | { |
| | | //Option4是设备mac;Option2是设备端口; |
| | | if (logic.Accounts[j]["Option4"].ToString() == doorLock.DeviceAddr) |
| | | { |
| | | //查找是否是那个门锁; |
| | | //如果不是该门锁联动事件不显示出来; |
| | | return true; |
| | | } |
| | | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | /// 记录选中时间 |
| | | /// </summary> |
| | | public int timeValue = 0; |
| | | /// <summary> |
| | | /// 标记显示执行日期(用网关的,还是用系统的时间) |
| | | /// </summary> |
| | | public bool _if = false; |
| | | /// <summary> |
| | | /// 时间戳 |
| | | /// </summary> |
| | | public int timeLong = 0; |
| | | public async void Show() |
| | | { |
| | | |
| | |
| | | this.AddChidren(middle); |
| | | #endregion |
| | | //是常开模式再去读取 |
| | | |
| | | if (Send.CurrentDoorLock.IsDoorLockNormallyMode) |
| | | { |
| | | //进来更新一次 |
| | | //查找是否存在时效性自动化;有的话就返回自动化对象; |
| | | var logic = await SkipView.GetLogicIfon(); |
| | | var logic = await SkipView.GetLogicIfon(Send.CurrentDoorLock); |
| | | if (logic != null) |
| | | { |
| | | try |
| | |
| | | //进来更新一次值 |
| | | logicId = logic.LogicId; |
| | | timeValue = int.Parse(logic.Conditions[0]["DoorLockOpenDelayTime"]); |
| | | timeLong = int.Parse(logic.Conditions[0]["TriggerTime"]); |
| | | |
| | | } |
| | | catch { } |
| | | } |
| | |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | }; |
| | | middle.AddChidren(fLayout); |
| | | ModeView(); |
| | | #endregion |
| | | #region 常开自动化 |
| | | ///第三块第一级父控件 |
| | |
| | | }; |
| | | middle.AddChidren(listLogicFl); |
| | | listLogicFl.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); |
| | | |
| | | ModeView(); |
| | | ///添加常开自动化的父控件 |
| | | var addLogicfL = new FrameLayout |
| | | { |
| | |
| | | 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("Type", "8"); |
| | | 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); |
| | | } |
| | | Send.CurrentDoorLock.IsDoorLockNormallyMode = false; |
| | | _if = false; |
| | | ModeView(); |
| | | } |
| | | else |
| | |
| | | var timeTextBtn = new Button |
| | | { |
| | | Y = Application.GetRealHeight(127 + 69), |
| | | X = Application.GetRealWidth(125), |
| | | Width = Application.GetRealWidth(634 + 200), |
| | | X = Application.GetRealWidth(86),//125 |
| | | Width = Application.GetRealWidth(907),//634 + 200 |
| | | Height = Application.GetRealHeight(60), |
| | | TextSize = 15, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | |
| | | if (logicId != 0) |
| | | { |
| | | openModeFl.AddChidren(timeTextBtn); |
| | | ///有时效性常开才显示时间条件文本 |
| | | var y = DateTime.Now.Year.ToString();//那一年 |
| | | var m = DateTime.Now.Month.ToString();//那一月 |
| | | var d = DateTime.Now.ToString("dd");//那一天 |
| | | var h = int.Parse(DateTime.Now.ToString("HH"));//当前系统时间 |
| | | int dayInt = (h + timeValue) / 24;//算出几天后执行 |
| | | int hour = (h + timeValue) % 24;//算出几天后那个时间执行 |
| | | int days = int.Parse(d) + dayInt; |
| | | string text1 = Language.StringByID(MyInternationalizationString.timeSensitive); |
| | | string text2 = Language.StringByID(MyInternationalizationString.yearSone); |
| | | string text3 = Language.StringByID(MyInternationalizationString.monthSone); |
| | | string text4 = Language.StringByID(MyInternationalizationString.numberSone); |
| | | string text5 = Language.StringByID(MyInternationalizationString.executeSone); |
| | | timeTextBtn.Text = text1 + y + text2 + m + text3 + days.ToString() + text4 + hour.ToString() + text5; |
| | | string text5 = Language.StringByID(MyInternationalizationString.hour1); |
| | | string text6 = Language.StringByID(MyInternationalizationString.executeSone); |
| | | if (_if) |
| | | { |
| | | |
| | | ///第一次进来读取网关时间; |
| | | var datetime = GetLocalTime(timeLong); |
| | | ///有时效性常开才显示时间条件文本 |
| | | var y = datetime.Year.ToString();//那一年 |
| | | var m = datetime.Month.ToString();//那一月 |
| | | var d = datetime.ToString("dd");//那一天 |
| | | var h = int.Parse(datetime.ToString("HH"));//小时 |
| | | int minute = datetime.Minute;//分钟 |
| | | timeTextBtn.Text = text1 + y + text2 + m + text3 + d + text4 + h + text5 + minute.ToString() + text6; |
| | | |
| | | } |
| | | else |
| | | { |
| | | |
| | | ///有时效性常开才显示时间条件文本 |
| | | var y = DateTime.Now.Year.ToString();//那一年 |
| | | var m = DateTime.Now.Month.ToString();//那一月 |
| | | var d = DateTime.Now.ToString("dd");//那一天 |
| | | var h = int.Parse(DateTime.Now.ToString("HH"));//小时 |
| | | int dayInt = (h + timeValue) / 24;//算出几天后执行 |
| | | int hour = (h + timeValue) % 24;//算出几天后那个时间执行 |
| | | int days = int.Parse(d) + dayInt; |
| | | int minute = DateTime.Now.Minute;//分钟 |
| | | timeTextBtn.Text = text1 + y + text2 + m + text3 + days.ToString() + text4 + hour.ToString() + text5 + minute.ToString() + text6; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | clickBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | LogicView.TipView.ShowConfrimTip(() => |
| | | LogicView.TipView.ShowConfrimTip(() => |
| | | {///再次确认 |
| | | LogicView.TipView.ShowInputTip(true, async (str) => |
| | | {///确认发送命令 |
| | | CommonPage.Loading.Start(); |
| | | try |
| | | { |
| | | ///xm |
| | | var result = await UserCenter.DoorLock.DoorLockCommonInfo.SetNormallyOpenModeFuncAsync(Send.CurrentDoorLock); |
| | | if (!result) |
| | | { |
| | | LogicView.TipView.ShowFlashTip(Language.StringByID(MyInternationalizationString.openFailed)); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | ///因为有常开模式下才可以创建失效逻辑; |
| | | SkipView.GetLogicAll(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; |
| | | } |
| | | else |
| | | { |
| | | logicId = addResult; |
| | | timeValue = int.Parse(str); |
| | | Send.CurrentDoorLock.IsDoorLockNormallyMode = true; |
| | | _if = false; |
| | | ModeView();
|
| | | ///添加APP开启常开模式的历史记录
|
| | | UserCenter.HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(Send.CurrentDoorLock, 9001, string.Empty); |
| | | } |
| | | |
| | | {///再次确认 |
| | | LogicView.TipView.ShowInputTip(true, async (str) => |
| | | {///确认发送命令 |
| | | CommonPage.Loading.Start(); |
| | | try |
| | | { |
| | | ///xm |
| | | var result = await UserCenter.DoorLock.DoorLockCommonInfo.SetNormallyOpenModeFuncAsync(Send.CurrentDoorLock); |
| | | if (!result) |
| | | { |
| | | LogicView.TipView.ShowFlashTip(Language.StringByID(MyInternationalizationString.openFailed)); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | ///因为有常开模式下才可以创建失效逻辑; |
| | | SkipView.GetLogicAll();//删除之前所有失效逻辑 |
| | | var addResult = await SkipView.LockAddModifyLogic(int.Parse(str), Send.CurrentDoorLock);//添加一条失效逻辑 |
| | | if (addResult == 0) |
| | | { |
| | | ///可欣说如果常开模式开,创建自动化失败,那么将要发一条常开模式关闭命令; |
| | | UserCenter.DoorLock.DoorLockCommonInfo.DelNormallyOpenMode(Send.CurrentDoorLock); |
| | | ///提示失败 |
| | | LogicView.TipView.ShowFlashTip(Language.StringByID(MyInternationalizationString.addFailed)); |
| | | return; |
| | | } |
| | | logicId = addResult; |
| | | timeValue = int.Parse(str); |
| | | Send.CurrentDoorLock.IsDoorLockNormallyMode = true; |
| | | ModeView(); |
| | | //添加App开启常开模式的历史记录 |
| | | UserCenter.HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(Send.CurrentDoorLock, 9001, string.Empty); |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | }; |
| | | }); |
| | | |
| | | }; |
| | | } |
| | | |
| | | listLogicFl.Y = fLayout.Bottom; |
| | | listLogicFl.X = Application.GetRealWidth(58); |
| | | listLogicFl.Height = Application.GetRealHeight(Method.H - 184) - fLayout.Height; |
| | | listLogicFl.Width = Application.GetRealWidth(1022); |
| | | listLogicFl.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; |
| | | |
| | | verticalRefresh.Y = Application.GetRealHeight(187); |
| | | verticalRefresh.X = Application.GetRealWidth(46); |
| | | verticalRefresh.Height = listLogicFl.Height - Application.GetRealHeight(187);//动态改动上下滑动view高度; |
| | | verticalRefresh.Width = listLogicFl.Width - Application.GetRealWidth(46); |
| | | } |
| | | /// <summary> |
| | | /// 读取自动化列表数据; |
| | |
| | | if (logic.LogicType != 2) |
| | | { |
| | | continue; |
| | | }
|
| | | if (SkipView.ExistLogic(logic, Send.CurrentDoorLock))
|
| | | {
|
| | | Common.Logic.SoneLogicList.Add(logic);
|
| | | } |
| | | Common.Logic.SoneLogicList.Add(logic); |
| | | } |
| | | } |
| | | } |
| | |
| | | verticalRefresh.RemoveAll(); |
| | | foreach (var logic in Common.Logic.SoneLogicList) |
| | | { |
| | | if (!SkipView.ExistLogic(logic, Send.CurrentDoorLock)) |
| | | { |
| | | continue; |
| | | } |
| | | #region 自动化布局View |
| | | ///自动化父控件 |
| | | var fLayoutLogic = new FrameLayout |
| | |
| | | else |
| | | { |
| | | //逻辑关 |
| | | logic.IsEnable = 0; |
| | | typeIconBtn.UnSelectedImagePath = "ZigeeLogic/nofunction.png"; |
| | | typeBjBtn.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 将UNIX时间戳转换成系统时间(精确到秒) |
| | | /// <returns></returns> |
| | | public DateTime GetLocalTime(int unixTimeStamp) |
| | | { |
| | | DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); |
| | | long lTime = long.Parse(unixTimeStamp + "0000000"); |
| | | TimeSpan toNow = new TimeSpan(lTime); |
| | | DateTime dtResult = dtStart.Add(toNow); |
| | | return dtResult; |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <param name="account">登陆账号</param>
|
| | | public void ShowForm(string account = "")
|
| | | {
|
| | | if (Config.Instance.IsLogin == true)
|
| | | if (account == string.Empty)
|
| | | {
|
| | | return;
|
| | | //使用上一次登陆的账号
|
| | | account = Common.Config.Instance.Account;
|
| | | }
|
| | | CommonPage.Instance.IsDrawerLockMode = true;
|
| | | this.Tag = "Login";
|
| | |
| | | /// <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>
|
| | | /// <param name="text"></param>
|
| | | public void SetPmTwoPointFiveStatuText(string text)
|
| | | { |
| | | {
|
| | | this.btnStatu.Text = text;
|
| | | }
|
| | |
|
| | |
| | | /// 初始化PM2.5传感器控件
|
| | | /// </summary>
|
| | | /// <param name="frameWhiteBack"></param>
|
| | | private void InitPmControl(FrameLayout frameWhiteBack) |
| | | private void InitPmControl(FrameLayout frameWhiteBack)
|
| | | { |
| | | //湿度容器 |
| | | var frameHumidityPic = new FrameLayout(); |
| | |
| | | framePmPic.AddChidren(btnPmText); |
| | | |
| | | //PM2.5数据(第3个,listControl【2】) |
| | | var btnPmStatus = new NormalViewControl(162, 92, true); |
| | | var btnPmStatus = new NormalViewControl(162, 92, true);
|
| | | btnPmStatus.Y = Application.GetRealHeight(181); |
| | | btnPmStatus.Text = "155"; |
| | | btnPmStatus.TextSize = 30; |
| | |
| | | framePmPic.AddChidren(btnPmStatus); |
| | | this.listControl.Add(btnPmStatus); |
| | | |
| | | //PM2.5单位 (第4个,listControl【3】) |
| | | var btnPmUnit = new NormalViewControl(120 + 26, 43, true); |
| | | //PM2.5单位 (第4个,listControl【3】) |
| | | var btnPmUnit = new NormalViewControl(120 + 26, 43, true);
|
| | | btnPmUnit.Y = Application.GetRealHeight(181 + 46); |
| | | btnPmUnit.X = Application.GetRealWidth(153); |
| | | btnPmUnit.Text = "μg/m³"; |
| | |
| | | //已经接收到网关的反馈 |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | } |
| | | #endregion |
| | | |
| | |
| | | /// 判断是否有开关功能
|
| | | /// </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;
|
| | | } |
| | |
| | | }
|
| | | var newVersion = results[0]["version"]?.ToString();
|
| | | var updateContent = results[0]["releaseNotes"]?.ToString();
|
| | | if (newVersion != CommonPage.CodeIDString)
|
| | | if (newVersion.CompareTo(CommonPage.CodeIDString) > 0)
|
| | | {
|
| | | return 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
|
| | |
| | | public VerticalFrameControl(int i_rowSpace = 0)
|
| | | {
|
| | | rowSpace = Application.GetRealHeight(i_rowSpace);
|
| | | #if iOS
|
| | | //自动偏移取消
|
| | | if (UIKit.UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
|
| | | {
|
| | | (this.uiView as UIKit.UIScrollView).ContentInsetAdjustmentBehavior = UIKit.UIScrollViewContentInsetAdjustmentBehavior.Never;
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | {
|
| | | rowSpace = Application.GetRealHeight(i_rowSpace);
|
| | | this.VerticalScrollBarEnabled = false;
|
| | | #if iOS
|
| | | //自动偏移取消
|
| | | if (UIKit.UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
|
| | | {
|
| | | (this.uiView as UIKit.UIScrollView).ContentInsetAdjustmentBehavior = UIKit.UIScrollViewContentInsetAdjustmentBehavior.Never;
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | public VerticalListControl(int i_rowSpace = 0)
|
| | | {
|
| | | this.rowSpace = Application.GetRealHeight(i_rowSpace);
|
| | | #if iOS
|
| | | //自动偏移取消
|
| | | if (UIKit.UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
|
| | | {
|
| | | (this.uiView as UIKit.UIScrollView).ContentInsetAdjustmentBehavior = UIKit.UIScrollViewContentInsetAdjustmentBehavior.Never;
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | {
|
| | | this.rowSpace = Application.GetRealHeight(i_rowSpace);
|
| | | this.VerticalScrollBarEnabled = false;
|
| | | #if iOS
|
| | | //自动偏移取消
|
| | | if (UIKit.UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
|
| | | {
|
| | | (this.uiView as UIKit.UIScrollView).ContentInsetAdjustmentBehavior = UIKit.UIScrollViewContentInsetAdjustmentBehavior.Never;
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | |
|
| | | #endregion |
| | | |
| | | #region ■ PM2.5_______________________________
|
| | | /// <summary>
|
| | | /// SendPmSensorComand
|
| | | /// </summary>
|
| | | /// <param name="device">设备</param>
|
| | | public void SendPmSensorComand(CommonDevice device)
|
| | | {
|
| | | if (device == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | new System.Threading.Thread(() =>
|
| | | {
|
| | | SendPmSensorStatuComand(device);
|
| | | //读取Pm2.5传感器的温度数据
|
| | | HdlDeviceAttributeLogic.Current.SendTemperatureStatuComand(device);
|
| | | //读取Pm2.5传感器的湿度数据
|
| | | HdlDeviceAttributeLogic.Current.SendHumidityStatuComand(device);
|
| | | System.Threading.Thread.Sleep(300);
|
| | | })
|
| | | { IsBackground = true }.Start();
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// SendFanStatuComand
|
| | | /// </summary>
|
| | | /// <param name="device">设备</param>
|
| | | private void SendPmSensorStatuComand(CommonDevice device)
|
| | | {
|
| | | if (device == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var jObject = new Newtonsoft.Json.Linq.JObject
|
| | | {
|
| | | { "DeviceAddr",device.DeviceAddr },
|
| | | { "Epoint", device.DeviceEpoint },
|
| | | { "Cluster_ID", (int)Cluster_ID.PmTwoPointFiveMeasurement },
|
| | | { "Command", 108 }
|
| | | };
|
| | | var attriBute = new Newtonsoft.Json.Linq.JArray
|
| | | {
|
| | | new Newtonsoft.Json.Linq.JObject
|
| | | {
|
| | | { "AttriButeId", (int)AttriButeId.MeasuredValue}
|
| | | }
|
| | | };
|
| | | var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } };
|
| | | jObject.Add("Data", data);
|
| | | device.Gateway?.Send("GetDeviceStatus", jObject.ToString());
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 窗帘_______________________________ |
| | | /// <summary>
|
| | | /// 发送获取窗帘状态命令
|
| | |
| | | if (device.HadReadDeviceStatu == false)
|
| | | {
|
| | | return Language.StringByID(R.MyInternationalizationString.uOffLine);
|
| | | } |
| | | //空气质量 |
| | | }
|
| | | //空气质量
|
| | | string curQuality = "";
|
| | | //温度
|
| | | string temperature = string.Empty;
|
| | | //湿度
|
| | | string humidity = string.Empty;
|
| | | //PM2.5
|
| | | string pm = string.Empty; |
| | | var pMSensor = device as PMSensor; |
| | | if (pMSensor.currentPmData <= 35 && pMSensor.currentPmData >= 0) |
| | | { |
| | | curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); |
| | | } |
| | | else if (pMSensor.currentPmData <= 75 && pMSensor.currentPmData > 35) |
| | | { |
| | | curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); |
| | | } |
| | | else if (pMSensor.currentPmData <= 115 && pMSensor.currentPmData > 75) |
| | | { |
| | | curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); |
| | | } |
| | | else if (pMSensor.currentPmData <= 150 && pMSensor.currentPmData > 115) |
| | | { |
| | | curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); |
| | | } |
| | | else if (pMSensor.currentPmData <= 250 && pMSensor.currentPmData > 150) |
| | | { |
| | | curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); |
| | | } |
| | | else if (pMSensor.currentPmData > 250) |
| | | { |
| | | curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); |
| | | } |
| | | else |
| | | { |
| | | curQuality = "--"; |
| | | } |
| | | |
| | | humidity = $"{pMSensor.currentHumidity}%"; |
| | | temperature = $"{pMSensor.currentTemperature}℃"; |
| | | pm = $"{pMSensor.currentPmData}μg/m³"; |
| | | string pm = string.Empty;
|
| | | var pMSensor = device as PMSensor;
|
| | | if (pMSensor.currentPmData <= 35 && pMSensor.currentPmData >= 0)
|
| | | {
|
| | | curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
|
| | | }
|
| | | else if (pMSensor.currentPmData <= 75 && pMSensor.currentPmData > 35)
|
| | | {
|
| | | curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
|
| | | }
|
| | | else if (pMSensor.currentPmData <= 115 && pMSensor.currentPmData > 75)
|
| | | {
|
| | | curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
|
| | | }
|
| | | else if (pMSensor.currentPmData <= 150 && pMSensor.currentPmData > 115)
|
| | | {
|
| | | curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
|
| | | }
|
| | | else if (pMSensor.currentPmData <= 250 && pMSensor.currentPmData > 150)
|
| | | {
|
| | | curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
|
| | | }
|
| | | else if (pMSensor.currentPmData > 250)
|
| | | {
|
| | | curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
|
| | | }
|
| | | else
|
| | | {
|
| | | curQuality = "--";
|
| | | }
|
| | |
|
| | | humidity = $"{pMSensor.currentHumidity}%";
|
| | | temperature = $"{pMSensor.currentTemperature}℃";
|
| | | pm = $"{pMSensor.currentPmData}μg/m³";
|
| | | return $"{curQuality},{pm},{temperature},{humidity}";
|
| | |
|
| | | }
|
| | |
| | | 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;
|
| | |
|
| | |
| | | } |
| | | |
| | | #endregion
|
| | |
|
| | | #region ■ PM2.5数据
|
| | | //PM2.5数据
|
| | | else if (report.DeviceStatusReport.CluterID == 1066)
|
| | | {
|
| | | foreach (var attData in report.DeviceStatusReport.AttriBute)
|
| | | {
|
| | | //PM2.5
|
| | | if (attData.AttributeId == (int)AttriButeId.MeasuredValue)
|
| | | {
|
| | |
|
| | | if (attData.AttriButeDataType == 57)
|
| | | {
|
| | | ((PMSensor)locadevice).currentPmData = attData.AttriButeData;
|
| | | }
|
| | | }
|
| | | //已经接收到状态
|
| | | locadevice.HadReadDeviceStatu = true;
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | |
|
| | | this.DeviceReportPush(report, ReceiveComandDiv.A设备属性上报);
|
| | |
| | | {
|
| | | //温居城的要网关中是否有逻辑存在
|
| | | //参数: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();
|
| | | //检测我的喜爱这个房间对象
|
| | |
| | | Global.DeleteFilebyHomeId(roomFilePath);
|
| | | }
|
| | | HdlAutoBackupLogic.DeleteFile(roomFilePath);
|
| | |
|
| | | //根据房间ID,移除指定的真实物理设备的所属房间记录
|
| | | Common.LocalDevice.Current.DeleteRealDeviceByRoomId(roomId);
|
| | |
|
| | | //刷新房间视图列表
|
| | | this.RefreshRoomListView();
|
| | | }
|
| | |
| | | {
|
| | | 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)
|
| | |
| | | {
|
| | | //图片
|
| | | var framePic = new FrameLayout();
|
| | | framePic.Width = this.GetPictrueRealSize(893);
|
| | | framePic.Height = this.GetPictrueRealSize(852);
|
| | | framePic.Width = this.GetPictrueRealSize(842);
|
| | | framePic.Height = this.GetPictrueRealSize(764);
|
| | | framePic.Gravity = Gravity.CenterHorizontal;
|
| | | framePic.Y = Application.GetRealHeight(75);
|
| | | framePic.Y = Application.GetRealHeight(78);
|
| | | bodyFrameLayout.AddChidren(framePic);
|
| | | var btnPic = new PicViewControl(framePic.Width, framePic.Height, false);
|
| | | btnPic.UnSelectedImagePath = "Instruct/AirConditionerZbGateway.png";
|
| | | framePic.AddChidren(btnPic);
|
| | |
|
| | | //绿色指示灯闪烁
|
| | | var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(475), this.GetPictrueRealSize(45), false);
|
| | | btnGreanLinght.X = this.GetPictrueRealSize(415);
|
| | | btnGreanLinght.Y = this.GetPictrueRealSize(272);
|
| | | //DATA绿色指示灯闪烁
|
| | | var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(512), this.GetPictrueRealSize(45), false);
|
| | | btnGreanLinght.Y = this.GetPictrueRealSize(352);
|
| | | btnGreanLinght.TextAlignment = TextAlignment.Center;
|
| | | btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnGreanLinght.TextSize = 10;
|
| | | btnGreanLinght.TextID = R.MyInternationalizationString.uGreanPilotLampLinght;
|
| | | btnGreanLinght.TextID = R.MyInternationalizationString.uDataGreanPilotLampLinght;
|
| | | framePic.AddChidren(btnGreanLinght);
|
| | |
|
| | | //长按5秒
|
| | |
| | | {
|
| | | textMsg = string.Format(textMsg, "5");
|
| | | }
|
| | | var btnSecond = new NormalViewControl(this.GetPictrueRealSize(360), this.GetPictrueRealSize(45), false);
|
| | | btnSecond.X = this.GetPictrueRealSize(573);
|
| | | btnSecond.Y = this.GetPictrueRealSize(718);
|
| | | var btnSecond = new NormalViewControl(this.GetPictrueRealSize(167), this.GetPictrueRealSize(45), false);
|
| | | btnSecond.Y = this.GetPictrueRealSize(629);
|
| | | btnSecond.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnSecond.TextSize = 10;
|
| | | btnSecond.Text = textMsg;
|
| | | btnSecond.TextAlignment = TextAlignment.Center;
|
| | | framePic.AddChidren(btnSecond);
|
| | |
|
| | | //长按图示按键5秒以上,指示灯
|
| | | //变绿闪烁,进入配网状态
|
| | | //绿灯每5秒闪烁一次则入网成功
|
| | | //长按编程按键5秒,DATA绿色LED闪烁,
|
| | | //频率为亮0.5秒,灭0.5秒
|
| | | string[] msgArry = Language.StringByID(R.MyInternationalizationString.uAddAirConditionerZbGatewayMsg).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
|
| | |
|
| | | var msg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
|
| | |
| | | msg2.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | msg2.TextAlignment = TextAlignment.Center;
|
| | | bodyFrameLayout.AddChidren(msg2);
|
| | | var msg3 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
|
| | | msg3.Y = msg2.Bottom;
|
| | | if (msgArry.Length > 2)
|
| | | {
|
| | | msg3.Text = msgArry[2];
|
| | | }
|
| | | msg3.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | msg3.TextAlignment = TextAlignment.Center;
|
| | | bodyFrameLayout.AddChidren(msg3);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | {
|
| | | public class PanelBackLighWithSensorForm : EditorCommonForm
|
| | | {
|
| | | #region ■ 变量声明___________________________ |
| | | #region ■ 变量声明___________________________
|
| | | /// <summary>
|
| | | /// 列表控件
|
| | | /// </summary>
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 节能模式行_________________________ |
| | | #region ■ 节能模式行_________________________
|
| | | /// <summary>
|
| | | /// 添加节能模式行
|
| | | /// </summary>
|
| | |
| | | int B1 = Convert.ToInt32(this.keyColorData.CloseColorB, 16);
|
| | | uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1);
|
| | |
|
| | | //颜色外框 |
| | | //颜色外框
|
| | | var btnColorLine = new FrameLayoutStatuControl();
|
| | | btnColorLine.Width = Application.GetRealHeight(79);
|
| | | btnColorLine.Height = this.GetPictrueRealSize(79);
|
| | |
| | | frameColor.ButtonClickEvent += (sender, e) =>
|
| | | { |
| | | PanelColor(btnColor, seekBar1, R1, G1, B1);
|
| | | }; |
| | | }; |
| | | btnColorView.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | PanelColor(btnColor, seekBar1, R1, G1, B1);
|
| | | }; |
| | | };
|
| | | btnColor.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | PanelColor(btnColor, seekBar1, R1, G1, B1);
|
| | | }; |
| | | };
|
| | | btnColorLine.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | PanelColor(btnColor, seekBar1, R1, G1, B1);
|
| | | }; |
| | | };
|
| | | btnRight.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | PanelColor(btnColor, seekBar1, R1, G1, B1);
|
| | | };
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// PanelColorBefore
|
| | | /// </summary>
|
| | | private void PanelColor(NormalViewControl btnColor, SeekBarControl seekBar1, int R1, int G1, int B1)
|
| | | {
|
| | | var form = new PanelColorSelectForm();
|
| | | form.AddForm(R1, G1, B1);
|
| | | form.FinishSelectColorEvent += (Rcolor, Gcolor, Bcolor) =>
|
| | | {
|
| | | R1 = Rcolor;
|
| | | G1 = Gcolor;
|
| | | B1 = Bcolor;
|
| | |
|
| | | this.keyColorData.CloseColorR = Convert.ToString(Rcolor, 16);
|
| | | this.keyColorData.CloseColorG = Convert.ToString(Gcolor, 16);
|
| | | this.keyColorData.CloseColorB = Convert.ToString(Bcolor, 16);
|
| | |
|
| | | btnColor.BackgroundColor = this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
|
| | | //变更滑动条的颜色
|
| | | seekBar1.ProgressBarColor = btnColor.BackgroundColor;
|
| | | };
|
| | | }
|
| | |
|
| | |
| | | frameColor.ButtonClickEvent += (sender, e) =>
|
| | | { |
| | | PanelColor(btnColor, seekBar1, R1, G1, B1);
|
| | | }; |
| | | };
|
| | | btnColorView.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | PanelColor(btnColor, seekBar1, R1, G1, B1);
|
| | | }; |
| | | };
|
| | | btnColor.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | PanelColor(btnColor, seekBar1, R1, G1, B1);
|
| | | }; |
| | | };
|
| | | btnColorLine.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | PanelColor(btnColor, seekBar1, R1, G1, B1);
|
| | | }; |
| | | };
|
| | | btnRight.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | PanelColor(btnColor, seekBar1, R1, G1, B1);
|
| | | };
|
| | | } |
| | | }
|
| | | #endregion
|
| | | |
| | | #region ■ 获取初始数据_______________________
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 补充容器___________________________ |
| | | #region ■ 补充容器___________________________
|
| | | /// <summary>
|
| | | /// 行数超过容器时,补一个空白FrameLayout,使之能滑动
|
| | | /// </summary>
|
| | |
| | | return (uint)(0xFF000000 + R * 256 * 256 + G * 256 + B);
|
| | | }
|
| | |
|
| | | #endregion |
| | | #endregion
|
| | | }
|
| | | }
|
| | |
| | | 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();
|
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 变量申明 |
| | | #region 变量申明 |
| | | /// <summary> |
| | | /// 当前新风面板【控制设备】 |
| | | /// </summary> |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region UI设计 |
| | | #region UI设计 |
| | | /// <summary> |
| | | /// 目标页显示 |
| | | /// </summary> |
| | |
| | | BindDownFrameLayout(); |
| | | //标题栏下的UI |
| | | MidFrameLayoutContent(); |
| | | //初始化设备数据 |
| | | //初始化设备数据 |
| | | InitData(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加楼层UI |
| | | /// </summary> |
| | | /// </summary> |
| | | void BindDownFrameLayout() |
| | | { |
| | | var btnAddFrameLayout = new FrameLayout |
| | |
| | | curControlDev.currentSelectFloorId = curFloorId; |
| | | btnFloorText.Text = dicFloorList[floorId]; |
| | | |
| | | //获取楼层中房间列表 |
| | | //获取楼层中房间列表 |
| | | supportRoomList = GetFloorRoomList(); |
| | | if (!btnMethodText.IsSelected) |
| | | { |
| | |
| | | //获取所有房间中匹配的能绑的目标 |
| | | currentPanelSupportBindDeviceList = GetAllRoomSupportDeviceList(); |
| | | |
| | | //获取面板中存在的绑定目标 |
| | | //获取面板中存在的绑定目标 |
| | | var panelBindListRes = await this.curControlDev.GetDeviceBindAsync(); |
| | | if (panelBindListRes != null && panelBindListRes.getAllBindResponseData != null) |
| | | { |
| | |
| | | { |
| | | foreach (var dev in targetList) |
| | | { |
| | | //获取本地设备列表 |
| | | //获取本地设备列表 |
| | | var localDeviceList = Shared.Common.LocalDevice.Current.listAllDevice; |
| | | var tempDev = localDeviceList.Find(obj => obj.DeviceAddr == dev.DeviceAddr && obj.DeviceEpoint == dev.DeviceEpoint); |
| | | if (tempDev != null) |
| | |
| | | { |
| | | return; |
| | | } |
| | | //获取本地设备列表 |
| | | //获取本地设备列表 |
| | | var localDeviceList = Shared.Common.LocalDevice.Current.listAllDevice; |
| | | var tempDev = localDeviceList.Find(obj => obj.DeviceAddr == bindDev.DeviceAddr && obj.DeviceEpoint == bindDev.DeviceEpoint); |
| | | if (tempDev != null) |
| | |
| | | { |
| | | var device = LocalDevice.Current.GetDevice(de); |
| | | if (device != null) |
| | | { |
| | | //电池设备不支持绑定 |
| | | if (device.ZigbeeType != 1) |
| | | { |
| | | continue; |
| | | {
|
| | | //电池设备不支持绑定
|
| | | if (device.ZigbeeType != 1)
|
| | | {
|
| | | continue;
|
| | | } |
| | | if (device.Type == DeviceType.TemperatureSensor) |
| | | { |
| | |
| | | { |
| | | var device = LocalDevice.Current.GetDevice(de); |
| | | if (device != null) |
| | | { |
| | | //电池设备不支持绑定 |
| | | if (device.ZigbeeType != 1) |
| | | { |
| | | continue; |
| | | {
|
| | | //电池设备不支持绑定
|
| | | if (device.ZigbeeType != 1)
|
| | | {
|
| | | continue;
|
| | | } |
| | | if (device.Type == DeviceType.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();
|
| | |
| | | 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重新开启“常开模式” |
| | |
| | | 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); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | #endregion |
| | | |
| | | /// <summary>
|
| | | /// UI显示 |
| | | /// UI显示
|
| | | /// </summary> |
| | | public void Show() |
| | | {
|
| | |
| | | this.midFrameLayout.AddChidren(midTopFrameLayout); |
| | | |
| | | //设备名称 |
| | | btnDoorLockTitle = new NormalViewControl(100, 60, true);
|
| | | btnDoorLockTitle.Y = Application.GetRealHeight(46);
|
| | | btnDoorLockTitle.TextSize = 15;
|
| | | btnDoorLockTitle = new NormalViewControl(100, 60, true); |
| | | btnDoorLockTitle.Y = Application.GetRealHeight(46); |
| | | btnDoorLockTitle.TextSize = 15; |
| | | btnDoorLockTitle.IsBold = true; |
| | | btnDoorLockTitle.Text = Common.LocalDevice.Current.GetDeviceMacName(doorLock);
|
| | | btnDoorLockTitle.Width = btnDoorLockTitle.GetRealWidthByText();
|
| | | btnDoorLockTitle.TextAlignment = TextAlignment.Center;
|
| | | btnDoorLockTitle.Gravity = Gravity.CenterHorizontal;
|
| | | btnDoorLockTitle.Text = Common.LocalDevice.Current.GetDeviceMacName(doorLock); |
| | | btnDoorLockTitle.Width = btnDoorLockTitle.GetRealWidthByText(); |
| | | btnDoorLockTitle.TextAlignment = TextAlignment.Center; |
| | | btnDoorLockTitle.Gravity = Gravity.CenterHorizontal; |
| | | midTopFrameLayout.AddChidren(btnDoorLockTitle); |
| | | |
| | | //记录 |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | }; |
| | | btnCurrentFrameLayout.AddChidren(btnCurrentRoomName); |
| | | #endregion |
| | | #endregion |
| | | } |
| | | |
| | | #region 音量弹窗 |
| | |
| | | ThumbImagePath = "DoorLock/UnLockButton.png",//进度条按钮图标 |
| | | ThumbImageHeight = Application.GetRealHeight(81),//进度条按钮图标的高度(默认正方形:宽和高一样) |
| | | ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | ProgressTextSize = 12,//显示百分比字体大小 |
| | | ProgressTextSize = 12,//显示百分比字体大小 |
| | | SeekBarViewHeight = Application.GetRealHeight(17),//进度条的宽度 |
| | | Progress = currentVolume, |
| | | }; |
| | |
| | | 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; |
| | |
| | | canVolume = DoorLockCommonInfo.CanVolume(doorLock); |
| | | if (canVolume) |
| | | { |
| | | //读取音量 |
| | | //读取音量 |
| | | var resultRes = await doorLock.GetVolumeAsync(); |
| | | if (resultRes == null || resultRes.volumeResponseData == null) |
| | | { |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 公共事件处理 |
| | | #region 公共事件处理 |
| | | /// <summary> |
| | | /// 事件处理 |
| | | /// 事件处理 |
| | | /// </summary> |
| | | public void ClickHandle() |
| | | { |
| | |
| | | btnCollect.IsSelected = !btnCollect.IsSelected; |
| | | if (btnCollect.IsSelected) |
| | | { |
| | | HdlRoomLogic.Current.AddLoveDevice(deviceUI);//收藏 |
| | | HdlRoomLogic.Current.AddLoveDevice(deviceUI);//收藏 |
| | | } |
| | | else |
| | | { |
| | | HdlRoomLogic.Current.DeleteLoveDevice(deviceUI);//取消收藏 |
| | | HdlRoomLogic.Current.DeleteLoveDevice(deviceUI);//取消收藏 |
| | | } |
| | | }; |
| | | btnCollectFrameLayout.MouseDownEventHandler += handerCollect; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 音量 |
| | | #region 音量 |
| | | /// <summary> |
| | | /// 更新音量 |
| | | /// </summary> |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 常开模式 |
| | | #region 常开模式 |
| | | /// <summary> |
| | | /// 常开模式处理 |
| | | /// </summary> |
| | |
| | | addLogicPage.Show();
|
| | | addLogicPage.action += (w) =>
|
| | | {
|
| | | doorLock.IsDoorLockNormallyMode = w; |
| | | UpdateNomallyOpenStatus(); |
| | | doorLock.IsDoorLockNormallyMode = w;
|
| | | UpdateNomallyOpenStatus();
|
| | | //返回按键清空当前逻辑定义的LogicAction |
| | | UserCenter.DoorLock.DoorLockCommonInfo.LogicAction = null;
|
| | | UserCenter.DoorLock.DoorLockCommonInfo.LogicAction = null; |
| | | }; |
| | | }; |
| | | HdlCheckLogic.Current.CheckSecondarySecurity(action); |
| | |
| | | { |
| | | if (IsFromReport) |
| | | { |
| | | //上报“常开模式”已被取消,app默认了“常开模式”被取消 |
| | | //上报“常开模式”已被取消,app默认了“常开模式”被取消 |
| | | DoorLockCommonInfo.NormallyOpenModeValue(doorLock, false); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | if (haveLogicNormallyOpenMode) |
| | | { |
| | | //此处删除温居城的常开模式特殊逻辑 |
| | | var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(); |
| | | var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(doorLock); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //app默认“常开模式”还是开启 |
| | | //app默认“常开模式”还是开启 |
| | | DoorLockCommonInfo.NormallyOpenModeValue(doorLock, true); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | if (haveLogicNormallyOpenMode) |
| | | { |
| | | //此处删除温居城的常开模式特殊逻辑 |
| | | var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(); |
| | | var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(doorLock); |
| | | } |
| | | //app重新开启“常开模式” |
| | | var result = await doorLock.SetNormallyOpenModeFuncAsync(true); |
| | |
| | | } |
| | | else |
| | | { |
| | | //保持“常开成功” |
| | | //保持“常开成功” |
| | | DoorLockCommonInfo.NormallyOpenModeValue(doorLock, true); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | UpdateNomallyOpenStatus(); |
| | | }); |
| | | |
| | | //创建常开模式的特殊逻辑 |
| | | //创建常开模式的特殊逻辑 |
| | | var resu = await Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock); |
| | | //if (!resu) |
| | | //{ |
| | |
| | | } |
| | | else |
| | | { |
| | | //app操作不取消“常开模式” |
| | | //app操作不取消“常开模式” |
| | | DoorLockCommonInfo.NormallyOpenModeValue(doorLock, true); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | { |
| | | if (IsFromReport) |
| | | { |
| | | //上报门锁“常开模式”已经取消,现在app确认“常开模式”取消 |
| | | //上报门锁“常开模式”已经取消,现在app确认“常开模式”取消 |
| | | DoorLockCommonInfo.NormallyOpenModeValue(doorLock, false); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | if (haveLogicNormallyOpenMode) |
| | | { |
| | | //此处删除温居城的常开模式特殊逻辑 |
| | | var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(); |
| | | var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(doorLock); |
| | | } |
| | | } |
| | | else |
| | |
| | | //添加App开启常开模式的历史记录
|
| | | HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(this.doorLock, 9002, string.Empty); |
| | | |
| | | //app确认取消“常开模式”成功 |
| | | //app确认取消“常开模式”成功 |
| | | DoorLockCommonInfo.NormallyOpenModeValue(doorLock, false); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | if (haveLogicNormallyOpenMode) |
| | | { |
| | | //此处删除温居城的常开模式特殊逻辑 |
| | | var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(); |
| | | var resTemp1 = await Shared.Phone.Device.Logic.SkipView.GetLogicAll(doorLock); |
| | | } |
| | | string msg2 = Language.StringByID(R.MyInternationalizationString.CloseNormallyOpenModeSuccess); |
| | | this.ShowTipMsg(msg2); |
| | |
| | | alertNomallyModeIsTurnOn.Show(); |
| | | alertNomallyModeIsTurnOn.MsgControlClickEvent += async () => |
| | | { |
| | | //默认创建常开模式的特殊逻辑 |
| | | //默认创建常开模式的特殊逻辑 |
| | | var res = await Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock); |
| | | //if (!res) |
| | | //{ |
| | |
| | | /// </summary> |
| | | private void NomallyOpenModeInvalidTimeDialog() |
| | | { |
| | | //失效设置 |
| | | //失效设置 |
| | | string msgTimeInValidSetting = Language.StringByID(R.MyInternationalizationString.DoorLockOpenAllTheTime); |
| | | var timeConfrim = Language.StringByID(R.MyInternationalizationString.Confrim); |
| | | var alertTimeInValidSetting = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.InValid, msgTimeInValidSetting, timeConfrim); |
| | |
| | | //常开模式失效时间设置成功 |
| | | var temp = int.Parse(obj); |
| | | DoorLockCommonInfo.NormallyOpenModeInvalidTime = temp; |
| | | //默认创建常开模式的特殊逻辑 |
| | | //默认创建常开模式的特殊逻辑 |
| | | var res = await Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock); |
| | | if (res == 0) |
| | | { |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 开锁处理 |
| | | #region 开锁处理 |
| | | /// <summary> |
| | | /// 开锁处理 |
| | | /// </summary> |
| | |
| | | {
|
| | | 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();
|
| | |
| | | CommonPage.Loading.Hide();
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | | //设定一个时间
|
| | | Config.Instance.LoginDateTime = new DateTime(1970, 1, 1);
|
| | | Config.Instance.Save();
|
| | |
|
| | | UserCenter.HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | CommonPage.Loading.Hide();
|
| | | CommonPage.Instance.RemoveViewByTag("Login");
|
| | | //登录弹出登录界面
|
| | | var accountLogin = new Login.AccountLoginForm { };
|
| | | Shared.Common.CommonPage.Instance.AddChidren(accountLogin);
|
| | | accountLogin.ShowForm();
|
| | | });
|
| | | }
|
| | | }); |
| | | } |
| | | else |
| | |
| | | { |
| | | 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>
|
| | | /// 计时器
|
| | | /// </summary> |
| | | private static int timeCount = 0; |
| | | |
| | | /// <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; }
|
| | | timeCount++;
|
| | | if (timeCount < 20)
|
| | | {
|
| | | //每10秒检测一次
|
| | | return;
|
| | | }
|
| | | timeCount = 0;
|
| | |
|
| | | 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> |
| | |
| | | { |
| | | return Newtonsoft.Json.JsonConvert.DeserializeObject<PMSensor>(strDeviceByte); |
| | | } |
| | | return null; |
| | | else { return null; } |
| | | //能少存一个变量就少存一个 |
| | | device.Type = (DeviceType)device.DeviceID; |
| | | |
| | | return device; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | //2020.05.11 删除 |
| | | |
| | | #endregion |
| | | |
| | | #region 设备状态上报 |
| | | if (topic == gatewayID + "/" + "DeviceStatusReport" + "/" + addr + "/" + epoint + "/" + cluID + "/" + attrId) |
| | | { |
| | | var deviceID = jobject.Value<int>("Device_ID"); |
| | | var deviceAddr = jobject.Value<string>("DeviceAddr"); |
| | | var tempEpoint = jobject.Value<int>("Epoint"); |
| | | var dataId = jobject.Value<int>("Data_ID"); |
| | | |
| | | var tempDevice = new CommonDevice { DeviceID = deviceID, DeviceAddr = deviceAddr, DeviceEpoint = tempEpoint };
|
| | | tempDevice.DeviceStatusReport = Newtonsoft.Json.JsonConvert.DeserializeObject<CommonDevice.DeviceStatusReportData>(jobject["Data"].ToString());
|
| | | UpdateDeviceInfo(tempDevice, "DeviceStatusReport"); |
| | | } |
| | | #endregion |
| | | #region 门锁操作事件通知 |
| | | else if (topic == gatewayID + "/" + "DoorLock/DoorLockOperatingEventNotificationCommand") |
| | | { |
| | |
| | | public readonly static int addFailed = 5401; |
| | | public readonly static int timeSensitive = 5402; |
| | | public readonly static int executeSone = 5403; |
| | | public readonly static int hour1 = 5404; |
| | | |
| | | |
| | | |
| | |
| | | /// 游客体验
|
| | | /// </summary>
|
| | | public const int uExperienceAccount = 16116;
|
| | | /// <summary>
|
| | | /// 智能改变生活 | Enjoy smart life
|
| | | /// </summary>
|
| | | public const int uLogoPageText = 16117;
|
| | | /// <summary> |
| | | /// 网络不稳定,场景列表信息缺损 |
| | | /// </summary> |
| | | public const int uNetworkUnStableAndSceneInfoIsNotFull = 16118; |
| | | /// <summary>
|
| | | /// DATA绿色指示灯闪烁
|
| | | /// </summary>
|
| | | public const int uDataGreanPilotLampLinght = 16119;
|
| | |
|
| | |
|
| | | //★★★★下面这些是接口的返回信息翻译,从18000开始★★★★
|
| | |
| | | /// </summary>
|
| | | public const int uAddRepeaterZigbeeMsg = 21014;
|
| | | /// <summary>
|
| | | /// 空调 -> 长按图示按键5秒以上,指示灯{0}变绿闪烁,进入配网状态{0}绿灯每5秒闪烁一次则入网成功
|
| | | /// 空调 -> 长按编程按键5秒,DATA绿色LED闪烁,{0}频率为亮0.5秒,灭0.5秒
|
| | | /// </summary>
|
| | | public const int uAddAirConditionerZbGatewayMsg = 21015;
|
| | | /// <summary>
|