Merge remote-tracking branch 'origin/dev-tzy' into dev-2020xm
| | |
| | | 238=长按5秒(按键) |
| | | 239=长按图示按键5秒以上,指示灯变绿、闪烁{0}进入配网状态。绿灯熄灭则配网成功 |
| | | ;三按键面板入网操作指示 |
| | | 241=设置常开模式后,您的门锁将始终{0}处于打开状态,确认开启? |
| | | 241=设置常开模式后,您的门锁将始终{0}处于打开状态,确认开启? |
| | | 242=电量 |
| | | 243=常开模式已开启 |
| | | 244=失效设置 |
| | |
| | | 259=失效时间不合法,请重写设置 |
| | | 260=音量设置失败 |
| | | 261=音量设置成功 |
| | | 262=当前时区 |
| | | 262=当前时区 |
| | | 263=区 |
| | | 264=东 |
| | | 265=西 |
| | | 265=西 |
| | | 266=当前设备不在线 |
| | | 267=获取音量失败 |
| | | 268=确定取消该成员的远程开锁权限 |
| | |
| | | 309=时效性常开删除失败,继续“常开模式”请前往门锁用户界面设置; |
| | | 310=请输入合法的数字 |
| | | 311=手动 |
| | | 312= 背光灯颜色 |
| | | 313=长按图示按键5秒以上,信号图标{0}快闪, 进入配网状态。信号图标常亮则配网成功 |
| | | |
| | | 5097=取消 |
| | | 5098=确定 |
| | |
| | | 5387=号 |
| | | 5388=常开自动化 |
| | | 5389=时效性常开设置 |
| | | |
| | | 5390=失效设置 |
| | | 5391=小时 |
| | | 5392=门锁始终打开 |
| | | 5393=设置常开模式后,您的门锁将始终{0}处于打开状态,确认开启? |
| | | 5394=不能小于1小时 |
| | | 5395=大于12小时 |
| | | 5396=或 |
| | | 5397=时间为空 |
| | | 5398=只支持数字输入 |
| | | |
| | | 10000=HDL Home |
| | | 10001=常用 |
| | |
| | | 16113=灯全开 |
| | | 16114=灯全关 |
| | | 16115=常开自动化手动取消 |
| | | 16116=游客体验 |
| | | |
| | | ;★★★★下面这些是接口的返回信息翻译,从18000开始★★★★
|
| | | 18004=指定网关已经被绑定
|
| | |
| | | ;方悦环境面板入网操作指示
|
| | | 21021=按住面板功能(function)按键,所有按键{0}指示灯亮起,则配网成功
|
| | | ;窗帘面板的入网操作指示
|
| | | 21022=长按面板左上角按键,所有按键{0}指示灯亮起,则配网成功 |
| | | 21022=长按面板左上角按键,所有按键{0}指示灯亮起,则配网成功
|
| | | ;吸顶燃气传感器的入网操作指示
|
| | | 21023=长按图示按键5秒以上,绿色快闪{0}进入配网状态,绿灯常亮则入网成功
|
| | |
|
| | | ;★★★★下面这些是模块ID的官方名字,从30000开始★★★★
|
| | | 30000=紧急按钮
|
| | |
| | | 30014=1代Zigbee网关(高级网关桌面模式) |
| | | 30015=调试设备 |
| | | 30016=Zigbee智能管状电机 |
| | | 30017=zigbee中继器 |
| | | 30017=Zigbee中继器 |
| | | 30018=12按键触摸面板(1路继电器底座) |
| | | 30019=4按键触摸面板(只带电源底座) |
| | | 30020=Zigbee人体移动传感器(球形) |
| | | 30021=1路调光器小模块 |
| | | 30022=zigbee转Buspro协议转换器 |
| | | 30023=zigbee转485协议转换器 |
| | | 30024=zigbee空调网关模块 |
| | | 30022=Zigbee转Buspro协议转换器 |
| | | 30023=Zigbee转485协议转换器 |
| | | 30024=Zigbee空调网关模块 |
| | | 30025=H06C |
| | | 30026=简约4按键面板 |
| | | 30027=简约3按键面板 |
| | |
| | | 30036=方悦/2路窗帘面板-Z |
| | | 30037=S-one |
| | | 30038=方悦新风小模块 |
| | | 30039=Zigbee吸顶燃气传感器 |
| | | |
| | | ;★★★★下面这些是设备所属种类的翻译名字,从40000开始★★★★ |
| | | 40000=遮阳 |
| | |
| | | 50036=Zigbee方悦2路窗帘面板 |
| | | 50037=Zigbee智能门锁 |
| | | 50038=新风控制小模块 |
| | | 50039=Zigbee吸顶燃气传感器 |
| | | |
| | | ;★★★★下面这些是模块ID的设备类型名字,从60000开始.注:它并不需要再R.cs文件中定义★★★★
|
| | | 60000=传感器 |
| | |
| | | 70021=门窗传感器 |
| | | 70022=温湿度传感器 |
| | | 70023=中继器 |
| | | 70024=智能空开 |
| | | 70024=智能空开 |
| | | 70025=吸顶燃气传感器 |
| | | 70026=PM2.5空气质量传感器 |
| | |
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\FreshAir\FreshAirRealDevicePic.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\RealDevice\SensorCeilingGas.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\Device\SensorCeilingGas.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\Device\SensorCeilingGasSelected.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\Device\SensorCeilingGasSelected2.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\Instruct\SensorCeilingGas.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\Device\SensorPMTwoPointFive.png" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <AndroidAsset Include="Assets\Phone\Instruct\SensorPMTwoPointFive.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')" />
|
| | |
| | | <Import Project="..\packages\Xamarin.Android.Support.Fragment.25.4.0.1\build\MonoAndroid70\Xamarin.Android.Support.Fragment.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Fragment.25.4.0.1\build\MonoAndroid70\Xamarin.Android.Support.Fragment.targets')" />
|
| | | <Import Project="..\packages\Xamarin.Android.Support.v4.25.4.0.1\build\MonoAndroid70\Xamarin.Android.Support.v4.targets" Condition="Exists('..\packages\Xamarin.Android.Support.v4.25.4.0.1\build\MonoAndroid70\Xamarin.Android.Support.v4.targets')" />
|
| | | <Import Project="..\packages\NETStandard.Library.2.0.0\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.0\build\netstandard2.0\NETStandard.Library.targets')" />
|
| | | </Project> |
| | | </Project>
|
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2020042701" android:installLocation="auto" android:versionName="1.0.20042701"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.home" android:versionCode="2020050601" android:installLocation="auto" android:versionName="1.0.20050601"> |
| | | <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" /> |
| | |
| | | <!-- 设置高德地图key --> |
| | | <meta-data android:name="com.amap.api.v2.apikey" android:value="1f753413955012c9594c5df69eaa0aff" /> |
| | | </application> |
| | | </manifest> |
| | | </manifest> |
| | |
| | | <BundleResource Include="Resources\Phone\Instruct\PanelFangyueFourButton.png" /> |
| | | <BundleResource Include="Resources\Phone\Instruct\PanelFourButton.png" /> |
| | | <BundleResource Include="Resources\Phone\Instruct\AirConditionerZbGateway.png" /> |
| | | <BundleResource Include="Resources\Phone\Instruct\SensorCeilingGas.png" /> |
| | | <BundleResource Include="Resources\Phone\Instruct\IntelligentLocksH06C.png" /> |
| | | <BundleResource Include="Resources\Phone\Instruct\SensorDoorWindow.png" /> |
| | | <BundleResource Include="Resources\Phone\Instruct\SensorFire.png" /> |
| | | <BundleResource Include="Resources\Phone\Instruct\SensorPMTwoPointFive.png" /> |
| | | <BundleResource Include="Resources\Phone\Instruct\PanelThreeButton.png" /> |
| | | <BundleResource Include="Resources\Phone\Instruct\SensorCarbonMonoxide.png" /> |
| | | <BundleResource Include="Resources\Phone\Instruct\DimmableLightOneLoad.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\Device\SensorCarbonMonoxideSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\ButtonPanelFour.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\RelayEpointSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\SensorCeilingGasSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\ButtonPanelSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\SensorTemperatureHumidity.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\RepeaterZigbeeSelected2.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\Device\Sensor.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\FreshAirEpointSelected2.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\RepeaterSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\SensorCeilingGasSelected2.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\AirSwitchSelected2.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\ConverterSelected2.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\AirSwitchSelected.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\Device\ButtonPanelFourSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\ButtonPanelOneSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\SensorPirSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\SensorCeilingGas.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\CurtainSiphonateSelected2.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\LightSelected2.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\ButtonPanelThreeSelected.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\Device\ButtonPanelThree.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\SensorInfraredSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\RepeaterSelected2.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\SensorPMTwoPointFive.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\ConverterSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\RepeaterZigbeeSelected.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\SensorCarbonMonoxide.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\RealDevice\CommonDevice.png" /> |
| | | <BundleResource Include="Resources\Phone\RealDevice\ButtonPanelFangyueEnvironment.png" /> |
| | | <BundleResource Include="Resources\Phone\RealDevice\AirConditionerZbGateway.png" /> |
| | | <BundleResource Include="Resources\Phone\RealDevice\SensorCeilingGas.png" /> |
| | | <BundleResource Include="Resources\Phone\RealDevice\IntelligentLocksH06C.png" /> |
| | | <BundleResource Include="Resources\Phone\RealDevice\SensorDoorWindow.png" /> |
| | | <BundleResource Include="Resources\Phone\RealDevice\ButtonPanelFangyueEight.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\Gateway\WiredGateway.png" /> |
| | | <BundleResource Include="Resources\Phone\Gateway\WirelessGateway.png" /> |
| | | <BundleResource Include="Resources\Phone\Gateway\AddGatewaySuccess.png" /> |
| | | <BundleResource Include="Resources\Phone\Device\SensorPMTwoPointFive.png" /> |
| | | <BundleResource Include="Resources\Phone\Instruct\SensorPMTwoPointFive.png" /> |
| | | </ItemGroup> |
| | | <Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" /> |
| | | <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" /> |
| | | </Project> |
| | | </Project> |
| | |
| | | 231=接近感应 |
| | | 232=接近感应功能设置置失败 |
| | | 233=获取接近感应功能失败 |
| | | 235=按住面板模式(Mode)和风速(Fan)按键{0}绿色指示灯亮起。则配网成功 |
| | | 235=按住面板模式(Mode)和风速(Fan)按键{0}绿色指示灯亮起。则配网成功 |
| | | 236=绿色指示灯闪烁 |
| | | 237=指示灯 |
| | | 238=长按5秒(按键) |
| | | 239=长按图示按键5秒以上,指示灯变绿、闪烁{0}进入配网状态。绿灯熄灭则配网成功 |
| | | 241=设置常开模式后,您的门锁将始终{0}处于打开状态,确认开启? |
| | | 239=长按图示按键5秒以上,指示灯变绿、闪烁{0}进入配网状态。绿灯熄灭则配网成功 |
| | | 241=设置常开模式后,您的门锁将始终{0}处于打开状态,确认开启? |
| | | 242=电量 |
| | | 243=常开模式已开启 |
| | | 244=失效设置 |
| | |
| | | 259=失效时间不合法,请重写设置 |
| | | 260=音量设置失败 |
| | | 261=音量设置成功 |
| | | 262=当前时区 |
| | | 262=当前时区 |
| | | 263=区 |
| | | 264=东 |
| | | 265=西 |
| | | 265=西 |
| | | 266=当前设备不在线 |
| | | 267=获取音量失败 |
| | | 268=确定取消该成员的远程开锁权限 |
| | |
| | | 5387=号 |
| | | 5388=常开自动化 |
| | | 5389=时效性常开设置 |
| | | |
| | | 5390=失效设置 |
| | | 5391=小时 |
| | | 5392=门锁始终打开 |
| | | 5393=设置常开模式后,您的门锁将始终{0}处于打开状态,确认开启? |
| | | 5394=不能小于1小时 |
| | | 5395=大于12小时 |
| | | 5396=或 |
| | | 5397=时间为空 |
| | | 5398=只支持数字输入 |
| | | |
| | | 10000=HDL Home |
| | | 10001=常用 |
| | |
| | | 16113=灯全开 |
| | | 16114=灯全关 |
| | | 16115=常开自动化手动取消 |
| | | 16116=游客体验 |
| | | |
| | | ;★★★★下面这些是接口的返回信息翻译,从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=按住面板左上角按键,所有按键指示灯{0}亮起,则配网成功 |
| | | ;方悦4按键轻触式面板入网操作指示 |
| | | 21019=按住面板左上角按键,所有按键指示灯{0}亮起,则配网成功 |
| | | ;方悦8按键轻触式面板入网操作指示 |
| | | 21020=按住面板左上角按键,所有按键指示灯{0}亮起,则配网成功 |
| | | ;方悦环境面板入网操作指示 |
| | | 21021=按住面板功能(function)按键,所有按键{0}指示灯亮起,则配网成功 |
| | | ;窗帘面板的入网操作指示 |
| | | 21022=长按面板左上角按键,所有按键{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秒以上,指示灯{0}变绿闪烁,进入配网状态{0}绿灯每5秒闪烁一次则入网成功
|
| | | ;pir传感器入网操作指示
|
| | | 21016=长按图示按键5秒以上,指示灯变绿、{0}闪烁进入配网状态。绿灯熄灭则配网成功
|
| | | ;温湿度传感器入网操作指示
|
| | | 21017=长按图示按键5秒以上,信号图标{0}快闪, 进入配网状态。图标常亮则配网成功
|
| | | ;方悦2按键轻触式面板入网操作指示
|
| | | 21018=按住面板左上角按键,所有按键指示灯{0}亮起,则配网成功
|
| | | ;方悦4按键轻触式面板入网操作指示
|
| | | 21019=按住面板左上角按键,所有按键指示灯{0}亮起,则配网成功
|
| | | ;方悦8按键轻触式面板入网操作指示
|
| | | 21020=按住面板左上角按键,所有按键指示灯{0}亮起,则配网成功
|
| | | ;方悦环境面板入网操作指示
|
| | | 21021=按住面板功能(function)按键,所有按键{0}指示灯亮起,则配网成功
|
| | | ;窗帘面板的入网操作指示
|
| | | 21022=长按面板左上角按键,所有按键{0}指示灯亮起,则配网成功
|
| | | ;吸顶燃气传感器的入网操作指示
|
| | | 21023=长按图示按键5秒以上,绿色快闪{0}进入配网状态,绿灯常亮则入网成功
|
| | |
|
| | | ;★★★★下面这些是模块ID的官方名字,从30000开始★★★★
|
| | | 30000=紧急按钮
|
| | | 30001=燃气传感器
|
| | | 30002=烟雾传感器 |
| | | 30003=水侵传感器 |
| | | 30004=钥匙扣 |
| | |
| | | 30014=1代Zigbee网关(高级网关桌面模式) |
| | | 30015=调试设备 |
| | | 30016=Zigbee智能管状电机 |
| | | 30017=zigbee中继器 |
| | | 30017=Zigbee中继器 |
| | | 30018=12按键触摸面板(1路继电器底座) |
| | | 30019=4按键触摸面板(只带电源底座) |
| | | 30020=Zigbee人体移动传感器(球形) |
| | | 30021=1路调光器小模块 |
| | | 30022=zigbee转Buspro协议转换器 |
| | | 30023=zigbee转485协议转换器 |
| | | 30024=zigbee空调网关模块 |
| | | 30022=Zigbee转Buspro协议转换器 |
| | | 30023=Zigbee转485协议转换器 |
| | | 30024=Zigbee空调网关模块 |
| | | 30025=H06C |
| | | 30026=简约4按键面板 |
| | | 30027=简约3按键面板 |
| | |
| | | 30036=方悦/2路窗帘面板-Z |
| | | 30037=S-one |
| | | 30038=方悦新风小模块 |
| | | 30039=Zigbee吸顶燃气传感器 |
| | | |
| | | ;★★★★下面这些是设备所属种类的翻译名字,从40000开始★★★★ |
| | | 40000=遮阳 |
| | |
| | | 40017=干接点 |
| | | 40018=新风 |
| | | |
| | | ;★★★★下面这些是模块ID的设备默认备注名字,从50000开始.注:它并不需要再R.cs文件中定义★★★★ |
| | | 50000=紧急按钮 |
| | | 50001=Zigbee燃气传感器 |
| | | ;★★★★下面这些是模块ID的设备默认备注名字,从50000开始.注:它并不需要再R.cs文件中定义★★★★
|
| | | 50000=紧急按钮
|
| | | 50001=Zigbee燃气传感器
|
| | | 50002=Zigbee燃气传感器 |
| | | 50003=Zigbee水浸传感器 |
| | | 50004=钥匙扣 |
| | |
| | | 50036=Zigbee方悦2路窗帘面板 |
| | | 50037=Zigbee智能门锁 |
| | | 50038=新风控制小模块 |
| | | 50039=Zigbee吸顶燃气传感器 |
| | | |
| | | ;★★★★下面这些是模块ID的设备类型名字,从60000开始.注:它并不需要再R.cs文件中定义★★★★ |
| | | ;★★★★下面这些是模块ID的设备类型名字,从60000开始.注:它并不需要再R.cs文件中定义★★★★
|
| | | 60000=传感器 |
| | | 60001=开关模块 |
| | | 60002=遮阳模块 |
| | |
| | | 70022=温湿度传感器 |
| | | 70023=中继器 |
| | | 70024=智能空开 |
| | | 70025=PM2.5空气质量传感器 |
| | | 70025=吸顶燃气传感器 |
| | | 70026=PM2.5空气质量传感器 |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string CodeIDString = "1.0.20042801"; |
| | | public static string CodeIDString = "1.0.20050601"; |
| | | /// <summary> |
| | | /// 注册来源(0:HDL On 1:Zigbee) |
| | | /// </summary> |
| | |
| | | //添加缓存
|
| | | this.AddDeviceToMemory(ref device);
|
| | |
|
| | | //移除存在的设备内存 |
| | | //移除存在的设备内存
|
| | | string maikey = this.GetDeviceMainKeys(device);
|
| | | if (dicExist.ContainsKey(maikey) == true)
|
| | | {
|
| | |
| | | /// <param name="listMac">设备Mac地址</param>
|
| | | public void DeleteRealDeviceFromRoom(List<string> listMac)
|
| | | {
|
| | | bool save = false;
|
| | | foreach (var deviceMacAddr in listMac)
|
| | | {
|
| | | this.dicDeviceRoomId.Remove(deviceMacAddr);
|
| | | if (this.dicDeviceRoomId.ContainsKey(deviceMacAddr) == true)
|
| | | {
|
| | | this.dicDeviceRoomId.Remove(deviceMacAddr);
|
| | | save = true;
|
| | | }
|
| | | }
|
| | | if (save == false)
|
| | | {
|
| | | //没有改变,不需要保存
|
| | | return;
|
| | | }
|
| | | //保存记录
|
| | | string fullName = UserCenterLogic.CombinePath(DirNameResourse.DeviceRoomIdFile);
|
| | |
| | | list.Add(DeviceBeloneType.A传感器);
|
| | |
|
| | | //其他的看着办呗,都是排在后面的,都归为这个属性
|
| | | list.Add(DeviceBeloneType.A未知设备); |
| | | |
| | | list.Add(DeviceBeloneType.A未知设备);
|
| | |
|
| | | return list;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 一般方法___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 从缓存变量检测设备是否在线
|
| | | /// </summary>
|
| | | /// <param name="i_device"></param>
|
| | | /// <returns></returns>
|
| | | public bool CheckDeviceIsOnline(CommonDevice i_device)
|
| | | {
|
| | | //0:离线 1:在线 2:正在刷新状态
|
| | | return i_device.IsOnline == 1 || i_device.IsOnline == 2;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 判断该设备是否可以显示在主页
|
| | |
| | |
|
| | | //=========★★安防类传感器类(1300-2299)★★=========
|
| | | //这里是麦乐克的
|
| | | this.dicDeviceModelIdEnum["MULTI-GASE--EA07"] = "1300-1300-60000";//燃气传感器
|
| | | this.dicDeviceModelIdEnum["MULTI-MECI--EA01"] = "1301-1300-60000";//门窗磁传感器
|
| | | this.dicDeviceModelIdEnum["MULTI-FIRE--EA05"] = "1302-1300-60000";//烟雾传感器
|
| | | this.dicDeviceModelIdEnum["MULTI-MOTI--EA04"] = "1303-1300-60000";//红外传感器
|
| | | this.dicDeviceModelIdEnum["MULTI-WATE--EA02"] = "1304-1300-60000";//水浸传感器
|
| | | this.dicDeviceModelIdEnum["MULTI-BURO--EA06"] = "1305-1300-60000";//紧急按键
|
| | | this.dicDeviceModelIdEnum["MULTI-GASE--EA07"] = "1300-1200-60000";//燃气传感器
|
| | | this.dicDeviceModelIdEnum["MULTI-MECI--EA01"] = "1301-1200-60000";//门窗磁传感器
|
| | | this.dicDeviceModelIdEnum["MULTI-FIRE--EA05"] = "1302-1200-60000";//烟雾传感器
|
| | | this.dicDeviceModelIdEnum["MULTI-MOTI--EA04"] = "1303-1200-60000";//红外传感器
|
| | | this.dicDeviceModelIdEnum["MULTI-WATE--EA02"] = "1304-1200-60000";//水浸传感器
|
| | | this.dicDeviceModelIdEnum["MULTI-BURO--EA06"] = "1305-1200-60000";//紧急按键
|
| | | //这里是河东的
|
| | | this.dicDeviceModelIdEnum["MSG01/M-ZB.10"] = "1300-1300-60000";//燃气传感器
|
| | | this.dicDeviceModelIdEnum["MSDC01/M-ZB.10"] = "1301-1300-60000";//门窗磁传感器
|
| | | this.dicDeviceModelIdEnum["MSS01/M-ZB.10"] = "1302-1300-60000";//烟雾传感器
|
| | | this.dicDeviceModelIdEnum["MSPIR01/M-ZB.10"] = "1303-1300-60000";//红外传感器
|
| | | this.dicDeviceModelIdEnum["MSW01/M-ZB.10"] = "1304-1300-60000";//水浸传感器
|
| | | this.dicDeviceModelIdEnum["MBU01/M-ZB.10"] = "1305-1300-60000";//紧急按键DZ_PM100-V1.6
|
| | |
|
| | | this.dicDeviceModelIdEnum["MSW01/M-ZB.10"] = "1306-1300-60000";//水浸传感器
|
| | | this.dicDeviceModelIdEnum["MSG01/M-ZB.10"] = "1300-1200-60000";//燃气传感器
|
| | | this.dicDeviceModelIdEnum["MSDC01/M-ZB.10"] = "1301-1200-60000";//门窗磁传感器
|
| | | this.dicDeviceModelIdEnum["MSS01/M-ZB.10"] = "1302-1200-60000";//烟雾传感器
|
| | | this.dicDeviceModelIdEnum["MSPIR01/M-ZB.10"] = "1303-1200-60000";//红外传感器
|
| | | this.dicDeviceModelIdEnum["MSW01/M-ZB.10"] = "1304-1200-60000";//水浸传感器
|
| | | this.dicDeviceModelIdEnum["MBU01/M-ZB.10"] = "1305-1200-60000";//紧急按键
|
| | | this.dicDeviceModelIdEnum["MGCD01/ZB.10"] = "1306-1200-60000";//吸顶燃气传感器
|
| | |
|
| | | //=========★★继电器类(2300-2499)★★=========
|
| | | this.dicDeviceModelIdEnum["MPR0310-ZB.10"] = "2300-2300-60001";//3路继电器小模块
|
| | |
| | | this.dicPictrueShard["ButtonPanel_SimpleFour"] = "ButtonPanel_Four";//简约4按键面板 沿用 4按键的图标
|
| | | this.dicPictrueShard["ButtonPanel_SimpleThree"] = "ButtonPanel_Three";//简约3按键面板 沿用 3按键的图标
|
| | | this.dicPictrueShard["ButtonPanel_SimpleTwo"] = "ButtonPanel_Two";//简约2按键面板 沿用 2按键的图标
|
| | | this.dicPictrueShard["IntelligentLocks_Sone"] = "IntelligentLocks_H06C";//S-one的门锁图片沿用H06C的图标
|
| | | this.dicPictrueShard["Relay_FangyueFreshAirModul"] = "Relay_ThreeLoad";//方悦新风小模块图片沿用3路继电器的图标
|
| | |
|
| | | this.dicPictrueShard["IntelligentLocks_Sone"] = "IntelligentLocks_H06C";//S-one的门锁图片 沿用 H06C的图标
|
| | | this.dicPictrueShard["Relay_FangyueFreshAirModul"] = "Relay_ThreeLoad";//方悦新风小模块图片 沿用 3路继电器的图标
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// </summary>
|
| | | Sensor_EmergencyButton = 1305,
|
| | | /// <summary>
|
| | | /// 吸顶燃气传感器
|
| | | /// </summary>
|
| | | Sensor_CeilingGas = 1306,
|
| | | /// <summary>
|
| | | /// 运动传感器
|
| | | /// </summary>
|
| | | Sensor_Motion = -1306,
|
| | |
| | | /// <summary>
|
| | | /// 方悦新风小模块 镜像id:2310
|
| | | /// </summary>
|
| | | Relay_FangyueFreshAirModul = 2310, |
| | | |
| | | //=========★★调光器类(2500-2799)★★========= |
| | | Relay_FangyueFreshAirModul = 2310,
|
| | |
|
| | | //=========★★调光器类(2500-2799)★★=========
|
| | | /// <summary>
|
| | | /// 调光器
|
| | | /// </summary>
|
| | |
| | | public uint LogicSecurity1Color = 0xFF35B87F; |
| | | public uint LogicDelay1Color = 0xFFBF64FB; |
| | | public uint LogicListWeekTextColor = 0xFF666666; |
| | | |
| | | public uint LogicTipColor = 0xFF333443; |
| | | public uint LogicTipTextColor= 0xFFcccccc; |
| | | public uint LogicEditTextBackgroundColor=0xFFD1D1D3; |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | //自动化
|
| | | else if (UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex == 2)
|
| | | {
|
| | | this.ShowAutotion();
|
| | | //自动化功能代码入口
|
| | | Device.Logic.SkipView.ShowAutotionView(functionSceneAutoBodyView);
|
| | | //隐藏楼层
|
| | | floorVisible = false;
|
| | | //显示右上角的加号
|
| | |
| | | functionSceneBodyView.Height = functionSceneAutoBodyView.Height - roomSwitchContr.Bottom;
|
| | | functionSceneAutoBodyView.AddChidren(functionSceneBodyView);
|
| | |
|
| | | //执行初始化 |
| | | //执行初始化
|
| | | roomSwitchContr.InitControl();
|
| | | }
|
| | |
|
| | |
| | | //窗帘
|
| | | if (device.Type == DeviceType.WindowCoveringDevice)
|
| | | {
|
| | | cardContr = new Controls.DeviceCurtainRowControl(listView.rowSpace / 2);
|
| | | cardContr = new Controls.DeviceCurtainRowControl();
|
| | | }
|
| | | //继电器
|
| | | else if (device.Type == DeviceType.OnOffOutput)
|
| | | {
|
| | | cardContr = new Controls.DeviceRelayRowControl(listView.rowSpace / 2);
|
| | | cardContr = new Controls.DeviceRelayRowControl();
|
| | | }
|
| | | //空气开关
|
| | | else if (device.Type == DeviceType.AirSwitch)
|
| | | {
|
| | | cardContr = new Controls.DeviceAirSwitchRowControl(listView.rowSpace / 2);
|
| | | cardContr = new Controls.DeviceAirSwitchRowControl();
|
| | | }
|
| | | //空调
|
| | | else if (device.Type == DeviceType.Thermostat)
|
| | | {
|
| | | cardContr = new Controls.DeviceAcRowControl(listView.rowSpace / 2);
|
| | | cardContr = new Controls.DeviceAcRowControl();
|
| | | }
|
| | | // 新风
|
| | | else if (device.Type == DeviceType.FreshAir)
|
| | | {
|
| | | cardContr = new Controls.DeviceFreshAirRowControl(listView.rowSpace / 2);
|
| | | cardContr = new Controls.DeviceFreshAirRowControl();
|
| | | }
|
| | | //彩灯(调光器)
|
| | | else if (device.Type == DeviceType.DimmableLight)
|
| | | {
|
| | | cardContr = new Controls.DeviceColorLightRowControl(listView.rowSpace / 2);
|
| | | cardContr = new Controls.DeviceColorLightRowControl();
|
| | | }
|
| | | //传感器
|
| | | else if (device.Type == DeviceType.IASZone)
|
| | | {
|
| | | cardContr = new Controls.DeviceSensorRowControl(listView.rowSpace / 2);
|
| | | cardContr = new Controls.DeviceSensorRowControl();
|
| | | }
|
| | | //温湿度
|
| | | else if (device.Type == DeviceType.TemperatureSensor)
|
| | | {
|
| | | cardContr = new Controls.DeviceTemperatureRowControl(listView.rowSpace / 2);
|
| | | cardContr = new Controls.DeviceTemperatureRowControl();
|
| | | }
|
| | | //门锁
|
| | | else if (device.Type == DeviceType.DoorLock)
|
| | | {
|
| | | cardContr = new Controls.DeviceDoorLockRowControl(listView.rowSpace / 2);
|
| | | cardContr = new Controls.DeviceDoorLockRowControl();
|
| | | }
|
| | | //无法识别
|
| | | else
|
| | | {
|
| | | cardContr = new Controls.DeviceRowCommon(listView.rowSpace / 2);
|
| | | cardContr = new Controls.DeviceRowCommon();
|
| | | //没有状态功能
|
| | | cardContr.hadStatuFunction = false;
|
| | | }
|
| | |
|
| | | cardContr.chidrenYaxis = listView.rowSpace / 2;
|
| | | //初始化卡片
|
| | | listView.AddChidren(cardContr);
|
| | | cardContr.InitControl(device);
|
| | |
| | | listview2 = new VerticalListControl();
|
| | | functionSceneBodyView.AddChidren(listview2);
|
| | | }
|
| | | |
| | |
|
| | | foreach (var scene in listScene)
|
| | | {
|
| | | //场景卡片控件
|
| | |
| | | if (this.dicDeviceRowControl.ContainsKey(mainKeys) == true)
|
| | | {
|
| | | //刷新卡片状态
|
| | | this.dicDeviceRowControl[mainKeys].SetRowOnlineStatu(report.IsOnline == 1);
|
| | | bool bolOnline = LocalDevice.Current.CheckDeviceIsOnline(report);
|
| | | this.dicDeviceRowControl[mainKeys].SetRowOnlineStatu(bolOnline);
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | /// 设备回路主键
|
| | | /// </summary>
|
| | | public List<string> listDeviceKeys = new List<string>();
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ◆ 自动化__________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 自动化功能代码入口
|
| | | /// </summary>
|
| | | private void ShowAutotion()
|
| | | {
|
| | | Shared.Phone.Device.Logic.SkipView.ShowAutotionView(functionSceneAutoBodyView);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// <summary>
|
| | | /// 未分配界面的设备选择控件
|
| | | /// </summary>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | public DeviceRowCommon(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | public DeviceRowCommon()
|
| | | {
|
| | | this.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
|
| | | this.Width = Application.GetRealWidth(1022);
|
| | |
| | | //设备名字
|
| | | this.btnDeviceName = new NormalViewControl(600, 60, true);
|
| | | btnDeviceName.X = Application.GetRealWidth(181);
|
| | | btnDeviceName.Y = Application.GetRealHeight(16) + this.chidrenYaxis;
|
| | | //当指定实际坐标时,这里需要的偏移量为2倍
|
| | | btnDeviceName.Y = Application.GetRealHeight(16) + this.chidrenYaxis * 2;
|
| | | btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(i_device);
|
| | | btnDeviceName.SelectedTextColor = Common.ZigbeeColor.Current.GXCTextSelectedColor;
|
| | | this.frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly);
|
| | | |
| | |
|
| | | if (this.hadStatuFunction == false)
|
| | | {
|
| | | //没有状态功能,则把设备名字控件中
|
| | |
| | | //状态
|
| | | this.btnStatu = new NormalViewControl(600, 50, true);
|
| | | btnStatu.X = Application.GetRealWidth(181);
|
| | | btnStatu.Y = Application.GetRealHeight(70) + this.chidrenYaxis;
|
| | | //当指定实际坐标时,这里需要的偏移量为2倍
|
| | | btnStatu.Y = Application.GetRealHeight(70) + this.chidrenYaxis * 2;
|
| | | btnStatu.TextSize = 10;
|
| | | btnStatu.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | this.frameTable.AddChidren(btnStatu, ChidrenBindMode.BindEventOnly);
|
| | |
| | | //如果这个函数被重写的话,则代表这个设备有开关功能
|
| | | this.isHadOpenSwitch = false;
|
| | | //默认用在线状态来判断
|
| | | return i_device.IsOnline == 1;
|
| | | return Common.LocalDevice.Current.CheckDeviceIsOnline(i_device);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | else
|
| | | { |
| | | {
|
| | | //如果这个设备改变了房间的话,回调卡片被删除的函数
|
| | | var nowRoom = HdlRoomLogic.Current.GetRoomByDevice(device);
|
| | | if (nowRoom == null || nowRoom.Id != HdlRoomLogic.Current.CurrentRoom.Id)
|
| | |
| | | #region ■ 初始化_____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 分类界面的空调设备行控件
|
| | | /// </summary>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | public DeviceAcRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化控件
|
| | | /// </summary>
|
| | | /// <param name="i_device"></param>
|
| | |
| | | #region ■ 初始化_____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 分类界面的空气开关设备行控件
|
| | | /// </summary>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | public DeviceAirSwitchRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化控件
|
| | | /// </summary>
|
| | | /// <param name="i_device"></param>
|
| | |
| | | #region ■ 初始化_____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 分类界面的彩灯(调光器)设备行控件
|
| | | /// </summary>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | public DeviceColorLightRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化控件
|
| | | /// </summary>
|
| | | /// <param name="i_device"></param>
|
| | |
| | | #region ■ 初始化_____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 分类界面的窗帘设备行控件
|
| | | /// </summary>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | public DeviceCurtainRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化控件
|
| | | /// </summary>
|
| | | /// <param name="i_device"></param>
|
| | |
| | | /// <summary>
|
| | | /// 分类界面的门锁设备行控件
|
| | | /// </summary>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | public DeviceDoorLockRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | public DeviceDoorLockRowControl()
|
| | | {
|
| | | //门锁暂时没有状态功能
|
| | | this.hadStatuFunction = false;
|
| | |
| | | public class DeviceFreshAirRowControl : DeviceRowCommon |
| | | { |
| | | /// <summary>
|
| | | /// 分类界面的新风设备行控件
|
| | | /// </summary>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param> |
| | | public DeviceFreshAirRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis) |
| | | { |
| | | } |
| | | |
| | | /// <summary>
|
| | | /// 初始化控件
|
| | | /// </summary>
|
| | | /// <param name="i_device"></param>
|
| | |
| | | #region ■ 初始化_____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 分类界面的继电器设备行控件
|
| | | /// </summary>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | public DeviceRelayRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化控件
|
| | | /// </summary>
|
| | | /// <param name="i_device"></param>
|
| | |
| | | {
|
| | | #region ■ 初始化_____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 分类界面的传感器设备行控件
|
| | | /// </summary>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | public DeviceSensorRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | #region ■ 初始化_____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 分类界面的温湿度传感器设备行控件
|
| | | /// </summary>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | public DeviceTemperatureRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 发送获取状态命令___________________
|
| | |
| | | /// </summary> |
| | | void TimeView() |
| | | { |
| | | |
| | | UserView.HomePage.Instance.ScrollEnabled = false; |
| | | Dictionary<string, string> SecurityConditionsInfo = new Dictionary<string, string>(); |
| | | #region ------界面布局部分 |
New file |
| | |
| | | using System; |
| | | using Shared.Common; |
| | | |
| | | namespace Shared.Phone.Device.Logic.LogicView |
| | | { |
| | | public class TipView |
| | | { |
| | | /// <summary> |
| | | /// 确定框 |
| | | /// </summary> |
| | | /// <param name="action"></param> |
| | | public static void ShowConfrimTip(Action action) |
| | | { |
| | | ///主控件 |
| | | Dialog dialog = new Dialog(); |
| | | dialog.Show(); |
| | | ///背景的父控件 |
| | | FrameLayout fLayout = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor }; |
| | | dialog.AddChidren(fLayout); |
| | | fLayout.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | ///弹框父控件 |
| | | FrameLayout tipFLayout = new FrameLayout |
| | | { |
| | | X = Application.GetRealWidth(144), |
| | | Y = Application.GetRealHeight(706), |
| | | Width = Application.GetRealWidth(792), |
| | | Height = Application.GetRealHeight(351 + 127), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(17) |
| | | }; |
| | | fLayout.AddChidren(tipFLayout); |
| | | ///上面快的父控件 |
| | | FrameLayout topFrame = new FrameLayout |
| | | { |
| | | Width = Application.GetRealWidth(792), |
| | | Height = Application.GetRealHeight(351), |
| | | }; |
| | | tipFLayout.AddChidren(topFrame); |
| | | ///提示控件 |
| | | Button tipBtn = new Button |
| | | { |
| | | TextID = R.MyInternationalizationString.Tip, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicTipColor, |
| | | TextSize = 16, |
| | | Y = Application.GetRealHeight(69), |
| | | X = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(63), |
| | | Width = Application.GetRealWidth(492), |
| | | }; |
| | | topFrame.AddChidren(tipBtn); |
| | | ///自定义文本控件 |
| | | Button tipTextBtn = new Button |
| | | { |
| | | Text = Language.StringByID(R.MyInternationalizationString.SetDoorLockNomallyOpen).Replace("{0}", "\r\n"), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicTipTextColor, |
| | | TextSize = 14, |
| | | Y = tipBtn.Bottom + Application.GetRealHeight(35), |
| | | X = Application.GetRealWidth(60), |
| | | Height = Application.GetRealHeight(115), |
| | | Width = Application.GetRealWidth(674), |
| | | IsMoreLines = true, |
| | | }; |
| | | topFrame.AddChidren(tipTextBtn); |
| | | ///下面快的父控件 |
| | | FrameLayout bottomFrame = new FrameLayout |
| | | { |
| | | Y = topFrame.Bottom, |
| | | Width = Application.GetRealWidth(792), |
| | | Height = Application.GetRealHeight(127), |
| | | }; |
| | | tipFLayout.AddChidren(bottomFrame); |
| | | |
| | | ///取消控件 |
| | | Button cancelBtn = new Button |
| | | { |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 14, |
| | | Height = Application.GetRealHeight(127), |
| | | Width = Application.GetRealWidth(397), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | TextID = R.MyInternationalizationString.cancel, |
| | | }; |
| | | bottomFrame.AddChidren(cancelBtn); |
| | | cancelBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomLeft); |
| | | ///确认控件 |
| | | Button okBtn = new Button |
| | | { |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | TextSize = 14, |
| | | X = cancelBtn.Right, |
| | | Height = Application.GetRealHeight(127), |
| | | Width = bottomFrame.Width - cancelBtn.Width, |
| | | BackgroundColor = ZigbeeColor.Current.LogicBtnTypeColor, |
| | | TextID = R.MyInternationalizationString.confrim, |
| | | }; |
| | | bottomFrame.AddChidren(okBtn); |
| | | okBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomRight); |
| | | ///取消点击事件 |
| | | cancelBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | ///确认点击事件 |
| | | okBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | action(); |
| | | }; |
| | | } |
| | | /// <summary> |
| | | /// 输入框 |
| | | /// </summary> |
| | | /// <param name="_if">是否需要取消按钮</param> |
| | | /// <param name="action"></param> |
| | | public static void ShowInputTip(bool _if, Action<string> action) |
| | | { |
| | | |
| | | ///主控件 |
| | | Dialog dialog = new Dialog(); |
| | | dialog.Show(); |
| | | ///背景的父控件 |
| | | FrameLayout fLayout = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor }; |
| | | dialog.AddChidren(fLayout); |
| | | fLayout.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | ///弹框父控件 |
| | | FrameLayout tipFLayout = new FrameLayout |
| | | { |
| | | X = Application.GetRealWidth(144), |
| | | Y = Application.GetRealHeight(706), |
| | | Width = Application.GetRealWidth(792), |
| | | Height = Application.GetRealHeight(351 + 127), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(17) |
| | | }; |
| | | fLayout.AddChidren(tipFLayout); |
| | | ///上面快的父控件 |
| | | FrameLayout topFrame = new FrameLayout |
| | | { |
| | | Width = Application.GetRealWidth(792), |
| | | Height = Application.GetRealHeight(351), |
| | | }; |
| | | tipFLayout.AddChidren(topFrame); |
| | | ///提示控件 |
| | | Button tipBtn = new Button |
| | | { |
| | | Y = Application.GetRealHeight(69), |
| | | X = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(63), |
| | | Width = Application.GetRealWidth(492), |
| | | TextID = R.MyInternationalizationString.invalidSetting, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicTipColor, |
| | | TextSize = 16, |
| | | |
| | | }; |
| | | topFrame.AddChidren(tipBtn); |
| | | ///文本1控件 |
| | | Button Text1Btn = new Button |
| | | { |
| | | Y = Application.GetRealHeight(187), |
| | | X = Application.GetRealWidth(50), |
| | | Height = Application.GetRealHeight(58), |
| | | Width = Application.GetRealWidth(242 + 94), |
| | | TextID = R.MyInternationalizationString.lockOpen, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 14, |
| | | |
| | | }; |
| | | topFrame.AddChidren(Text1Btn); |
| | | ///输入文本框 |
| | | EditText editTime = new EditText() |
| | | { |
| | | X = Application.GetRealWidth(409), |
| | | Y = Application.GetRealHeight(173), |
| | | Height = Application.GetRealHeight(81), |
| | | Width = Application.GetRealWidth(132), |
| | | Radius = (uint)Application.GetMinRealAverage(17), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = 14, |
| | | Text = "12", |
| | | IsNumberKeyboardType=true,//只输入数字的属性 |
| | | }; |
| | | topFrame.AddChidren(editTime); |
| | | ///文本2控件 |
| | | Button Text2Btn = new Button |
| | | { |
| | | Y = Application.GetRealHeight(187), |
| | | X = Application.GetRealWidth(564), |
| | | Height = Application.GetRealHeight(58), |
| | | Width = Application.GetRealWidth(51 + 100), |
| | | TextID = R.MyInternationalizationString.hour, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 14, |
| | | |
| | | }; |
| | | topFrame.AddChidren(Text2Btn); |
| | | |
| | | ///下面快的父控件 |
| | | FrameLayout bottomFrame = new FrameLayout |
| | | { |
| | | Y = topFrame.Bottom, |
| | | Width = Application.GetRealWidth(792), |
| | | Height = Application.GetRealHeight(127), |
| | | }; |
| | | tipFLayout.AddChidren(bottomFrame); |
| | | ///取消控件 |
| | | Button cancelBtn = new Button |
| | | { |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 14, |
| | | Height = Application.GetRealHeight(127), |
| | | Width = Application.GetRealWidth(397), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | TextID = R.MyInternationalizationString.cancel, |
| | | }; |
| | | bottomFrame.AddChidren(cancelBtn); |
| | | ///确认控件 |
| | | Button okBtn = new Button |
| | | { |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | TextSize = 14, |
| | | X = cancelBtn.Right, |
| | | Height = Application.GetRealHeight(127), |
| | | Width = bottomFrame.Width - cancelBtn.Width, |
| | | BackgroundColor = ZigbeeColor.Current.LogicBtnTypeColor, |
| | | TextID = R.MyInternationalizationString.confrim, |
| | | }; |
| | | bottomFrame.AddChidren(okBtn); |
| | | |
| | | if (_if) { |
| | | cancelBtn.X = Application.GetRealWidth(0); |
| | | cancelBtn.Width = Application.GetRealWidth(0); |
| | | okBtn.X = Application.GetRealWidth(0); |
| | | okBtn.Width = Application.GetRealWidth(792); |
| | | okBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight); |
| | | } |
| | | else |
| | | { |
| | | cancelBtn.X = Application.GetRealWidth(0); |
| | | cancelBtn.Width = Application.GetRealWidth(397); |
| | | okBtn.X = Application.GetRealWidth(397); |
| | | okBtn.Width = bottomFrame.Width - cancelBtn.Width; |
| | | cancelBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomLeft); |
| | | okBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomRight); |
| | | |
| | | } |
| | | ///取消点击事件 |
| | | cancelBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | ///确认点击事件 |
| | | okBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (string.IsNullOrEmpty(editTime.Text)) |
| | | { |
| | | ShowTip(Language.StringByID(R.MyInternationalizationString.timeNull),true); |
| | | return; |
| | | } |
| | | if (int.Parse(editTime.Text) < 1 || int.Parse(editTime.Text) > 12) |
| | | { ///限制输入数字范围; |
| | | string str = Language.StringByID(R.MyInternationalizationString.less) + Language.StringByID(R.MyInternationalizationString.or) + Language.StringByID(R.MyInternationalizationString.more); |
| | | ShowTip(str, true); |
| | | return; |
| | | |
| | | |
| | | } |
| | | dialog.Close(); |
| | | action(editTime.Text); |
| | | }; |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 提示框 |
| | | /// </summary> |
| | | public static void ShowTip(string tipText,bool _if ) |
| | | { |
| | | ///主控件 |
| | | Dialog dialog = new Dialog(); |
| | | dialog.Show(); |
| | | ///背景的父控件 |
| | | FrameLayout fLayout = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor }; |
| | | dialog.AddChidren(fLayout); |
| | | fLayout.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | ///弹框父控件 |
| | | FrameLayout tipFLayout = new FrameLayout |
| | | { |
| | | X = Application.GetRealWidth(144), |
| | | Y = Application.GetRealHeight(706), |
| | | Width = Application.GetRealWidth(792), |
| | | Height = Application.GetRealHeight(351 + 127), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(17) |
| | | }; |
| | | fLayout.AddChidren(tipFLayout); |
| | | ///上面快的父控件 |
| | | FrameLayout topFrame = new FrameLayout |
| | | { |
| | | Width = Application.GetRealWidth(792), |
| | | Height = Application.GetRealHeight(351), |
| | | }; |
| | | tipFLayout.AddChidren(topFrame); |
| | | ///提示控件 |
| | | Button tipBtn = new Button |
| | | { |
| | | Y = Application.GetRealHeight(69), |
| | | X = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(63), |
| | | Width = Application.GetRealWidth(492), |
| | | TextID = R.MyInternationalizationString.tip, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicTipColor, |
| | | TextSize = 16, |
| | | |
| | | }; |
| | | topFrame.AddChidren(tipBtn); |
| | | ///文本控件 |
| | | Button Text1Btn = new Button |
| | | { |
| | | Y = Application.GetRealHeight(187), |
| | | X = Application.GetRealWidth(50), |
| | | Height = Application.GetRealHeight(58), |
| | | Width = Application.GetRealWidth(792-100), |
| | | Text= tipText, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 14, |
| | | |
| | | }; |
| | | topFrame.AddChidren(Text1Btn); |
| | | |
| | | ///下面快的父控件 |
| | | FrameLayout bottomFrame = new FrameLayout |
| | | { |
| | | Y = topFrame.Bottom, |
| | | Width = Application.GetRealWidth(792), |
| | | Height = Application.GetRealHeight(127), |
| | | }; |
| | | tipFLayout.AddChidren(bottomFrame); |
| | | ///取消控件 |
| | | Button cancelBtn = new Button |
| | | { |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | TextSize = 14, |
| | | Height = Application.GetRealHeight(127), |
| | | Width = Application.GetRealWidth(397), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | TextID = R.MyInternationalizationString.cancel, |
| | | }; |
| | | bottomFrame.AddChidren(cancelBtn); |
| | | ///确认控件 |
| | | Button okBtn = new Button |
| | | { |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | TextSize = 14, |
| | | X = cancelBtn.Right, |
| | | Height = Application.GetRealHeight(127), |
| | | Width = bottomFrame.Width - cancelBtn.Width, |
| | | BackgroundColor = ZigbeeColor.Current.LogicBtnTypeColor, |
| | | TextID = R.MyInternationalizationString.confrim, |
| | | }; |
| | | bottomFrame.AddChidren(okBtn); |
| | | |
| | | if (_if) |
| | | { |
| | | cancelBtn.X = Application.GetRealWidth(0); |
| | | cancelBtn.Width = Application.GetRealWidth(0); |
| | | okBtn.X = Application.GetRealWidth(0); |
| | | okBtn.Width = Application.GetRealWidth(792); |
| | | okBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight); |
| | | } |
| | | else |
| | | { |
| | | cancelBtn.X = Application.GetRealWidth(0); |
| | | cancelBtn.Width = Application.GetRealWidth(397); |
| | | okBtn.X = Application.GetRealWidth(397); |
| | | okBtn.Width = bottomFrame.Width - cancelBtn.Width; |
| | | cancelBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomLeft); |
| | | okBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomRight); |
| | | |
| | | } |
| | | ///取消点击事件 |
| | | cancelBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | ///确认点击事件 |
| | | okBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | namespace Shared.Phone.Device.Logic |
| | | { |
| | | public class SkipView |
| | | public class SkipView:FrameLayout |
| | | { |
| | | /// <summary> |
| | | /// 其它界面跳进来的入口 |
| | |
| | | { |
| | | case 0: |
| | | { |
| | | //new一个新逻辑对象; |
| | | //新增正常自动化入口 |
| | | |
| | | |
| | | ////new一个新逻辑对象; |
| | | ////新增正常自动化入口 |
| | | Common.Logic.CurrentLogic = new Common.Logic(); |
| | | Common.Logic.CurrentLogic.IsEnable = 1;//默认为开 |
| | | Common.Logic.CurrentLogic.LogicType = 0;//标记逻辑类型 |
| | |
| | | doorLockLogicList.Show(); |
| | | } |
| | | break; |
| | | case 2: |
| | | { |
| | | ///Sone门锁主入口 |
| | | if (doorLock == null) |
| | | { |
| | | ///防止抛异常 |
| | | doorLock = new DoorLock(); |
| | | } |
| | | Send.CurrentDoorLock = doorLock; |
| | | ///进来刷新一次设备列表; |
| | | Common.Logic.LogicDviceList.Clear(); |
| | | if (Common.Logic.LogicDviceList.Count == 0) |
| | | { |
| | | Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray()); |
| | | } |
| | | var addLogicPage = new SoneLogicList(); |
| | | UserView.HomePage.Instance.AddChidren(addLogicPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | addLogicPage.Show(); |
| | | |
| | | } |
| | | break; |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | //实现android显示逻辑列表的圆角; |
| | | fLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); |
| | | logicRowlayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); |
| | | |
| | | |
| | | } |
| | | i++; |
| | | var logicnameBtn = new Button |
| | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 门锁取消设置用的方法(相当一个关闭常开模式按钮,分类-自动化-不需要显示该自动化) |
| | | /// 门锁失效设置用的方法(相当一个关闭常开模式按钮,分类-自动化-不需要显示该自动化) |
| | | /// </summary> |
| | | /// <param name="timeVlaue">时间值</param> |
| | | /// <param name="common">设备</param> |
| | |
| | | } |
| | | return logic; |
| | | } |
| | | |
| | | ///<summary> |
| | | ///删除所有时效性自动化 |
| | | /// 返回值:true成功;false失败; |
| | | /// </summary> |
| | | public static async System.Threading.Tasks.Task<bool> GetLogicAll() |
| | | { |
| | | bool _if = false; |
| | | var Idlist = await Send.GetLogicId(3); |
| | | if (Idlist.Count != 0) |
| | | { |
| | | _if = true; |
| | | |
| | | for (int i = 0; i < Idlist.Count; i++) |
| | | { |
| | | int id = Idlist[i]; |
| | | //本来只有一条时效性自动化, |
| | | //防止特殊情况,找到就删除掉; |
| | | Send.DelLogic(id); |
| | | } |
| | | } |
| | | return _if; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | public class SoneLogicList : FrameLayout |
| | | { |
| | | /// <summary> |
| | | /// 给Sone门锁徐梅更新界面用的 |
| | | /// </summary> |
| | | /// |
| | | public SoneLogicList() |
| | | { |
| | | Tag = "SoneLogic"; |
| | | } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="action">给徐梅刷新界面用的</param> |
| | | /// <param name="bool_If"></param> |
| | | public Action<bool> action; |
| | | public async void Show() |
| | | { |
| | | |
| | | #region 界面的布局代码 |
| | | UserView.HomePage.Instance.ScrollEnabled = false;//锁住左滑 |
| | | TopView view = new TopView(); |
| | |
| | | view.clickBtn.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | UserView.HomePage.Instance.ScrollEnabled = true; |
| | | if (action != null) |
| | | { |
| | | action(Send.CurrentDoorLock.IsDoorLockNormallyMode); |
| | | } |
| | | |
| | | RemoveFromParent(); |
| | | |
| | | }; |
| | | |
| | | var middle = new FrameLayout |
| | |
| | | SelectedImagePath = "ZigeeLogic/openMode.png", |
| | | }; |
| | | fLayout.AddChidren(modeIconBtn); |
| | | var logic = await SkipView.GetLogicIfon(); |
| | | if (logic != null) |
| | | { |
| | | |
| | | if (Send.CurrentDoorLock.IsDoorLockNormallyMode) |
| | | { |
| | | /// 查找是否存在时效性自动化;有的话就返回自动化对象; |
| | | var logic = await SkipView.GetLogicIfon(); |
| | | |
| | | fLayout.Height = Application.GetRealHeight(780);//改变高度 |
| | | modeIconBtn.IsSelected = true;//改变图标状态 |
| | |
| | | TextSize = 16, |
| | | }; |
| | | openModeFl.AddChidren(closeBtn); |
| | | closeBtn.MouseUpEventHandler += (sender,e) => { |
| | | |
| | | |
| | | var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm, |
| | | Language.StringByID(MyInternationalizationString.doyouwanttodelete), |
| | | Language.StringByID(MyInternationalizationString.confrim));
|
| | | alert.Show();
|
| | | alert.ConfirmClickEvent += () =>
|
| | | closeBtn.MouseUpEventHandler += async (sender, e) => |
| | | { |
| | | var result = await UserCenter.DoorLock.DoorLockCommonInfo.DelNormallyOpenMode(Send.CurrentDoorLock); |
| | | if (result)
|
| | | { |
| | | Send.DelLogic(logic.LogicId); |
| | | if (logic != null) |
| | | { |
| | | ///有可能只有常开模式,没有时效性自动化 |
| | | ///没有判断的话,逻辑会为空,抛出异常; |
| | | Send.DelLogic(logic.LogicId); |
| | | } |
| | | Send.CurrentDoorLock.IsDoorLockNormallyMode = false; |
| | | this.RemoveFromParent(); |
| | | var soneLogicList = new SoneLogicList(); |
| | | UserView.HomePage.Instance.AddChidren(soneLogicList); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | soneLogicList.Show();
|
| | | }; |
| | | } |
| | | else |
| | | { |
| | | ///提示失败 |
| | | } |
| | | |
| | | }; |
| | | |
| | | ///显示失效设置时间文本控件 |
| | | var timeTextBtn= new Button |
| | | var timeTextBtn = new Button |
| | | { |
| | | Y = Application.GetRealHeight(127 + 69), |
| | | X = Application.GetRealWidth(225), |
| | |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | Text = "时效性常开设置12:20", |
| | | }; |
| | | openModeFl.AddChidren(timeTextBtn); |
| | | if (logic != null) |
| | | { |
| | | ///有时效性常开才显示时间条件文本 |
| | | openModeFl.AddChidren(timeTextBtn); |
| | | } |
| | | ///时效性常开只有一个条件; |
| | | try |
| | | { |
| | | var y = DateTime.Now.ToString("yy");//那一年 |
| | | var m = DateTime.Now.ToString("mm");//那一月 |
| | | var d = DateTime.Now.ToString("dd");//那一天 |
| | | var h =int.Parse(DateTime.Now.ToString("HH"));//当前系统时间 |
| | | var h = int.Parse(DateTime.Now.ToString("HH"));//当前系统时间 |
| | | var me = DateTime.Now.ToLongDateString(); |
| | | var timeInt = int.Parse(logic.Conditions[0]["DoorLockOpenDelayTime"]); |
| | | int dayInt = (h + timeInt)/ 24;//算出几天后执行 |
| | | int dayInt = (h + timeInt) / 24;//算出几天后执行 |
| | | int hour = (h + timeInt) % 24;//算出几天后那个时间执行 |
| | | timeTextBtn.Text = "时效性常开设置" + y + "年" + m + "月" + d + dayInt + "号" + timeInt + "时"+ "执行"; |
| | | timeTextBtn.Text = "时效性常开设置" + y + "年" + m + "月" + d + dayInt + "号" + timeInt + "时" + "执行"; |
| | | } |
| | | catch { } |
| | | |
| | |
| | | TextSize = 15, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | // Text = "时效性常开设置", |
| | | TextID=MyInternationalizationString.timeSetSone, |
| | | // Text = "时效性常开设置", |
| | | TextID = MyInternationalizationString.timeSetSone, |
| | | }; |
| | | modeFl.AddChidren(modeTextBtn); |
| | | ///下一级菜单图标控件 |
| | |
| | | }; |
| | | modeFl.AddChidren(nextIconBtn); |
| | | |
| | | var clickBtn = new Button |
| | | { |
| | | Y = Application.GetRealHeight(478), |
| | | X = Application.GetRealWidth(58), |
| | | Height = Application.GetRealHeight(138), |
| | | Width = Application.GetRealWidth(1022), |
| | | }; |
| | | modeFl.AddChidren(clickBtn); |
| | | |
| | | |
| | | clickBtn.MouseUpEventHandler += async (sender, e) => |
| | | { |
| | | var d = await SkipView.LockAddModifyLogic(12, Send.CurrentDoorLock); |
| | | }; |
| | | nextIconBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | LogicView.TipView.ShowConfrimTip(() => |
| | | {///再次确认 |
| | | LogicView.TipView.ShowInputTip(true, async (str) => |
| | | {///确认发送命令 |
| | | try |
| | | { |
| | | ///xm |
| | | var result = await UserCenter.DoorLock.DoorLockCommonInfo.SetNormallyOpenModeFuncAsync(Send.CurrentDoorLock); |
| | | if (!result) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | ///提示失败 |
| | | }); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | ///因为有常开模式下才可以创建失效逻辑; |
| | | SkipView.GetLogicAll();//删除之前所有失效逻辑 |
| | | var addResult = await SkipView.LockAddModifyLogic(int.Parse(str), Send.CurrentDoorLock);//添加一条失效逻辑 |
| | | if (!addResult) |
| | | { |
| | | ///提示失败 |
| | | return; |
| | | }
|
| | | Send.CurrentDoorLock.IsDoorLockNormallyMode = true; |
| | | this.RemoveFromParent(); |
| | | var soneLogicList = new SoneLogicList(); |
| | | UserView.HomePage.Instance.AddChidren(soneLogicList); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | soneLogicList.Show(); |
| | | |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | |
| | | }; |
| | | } |
| | | |
| | | #endregion |
| | |
| | | addLogicfL.AddChidren(addIconBtn); |
| | | addIconBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | |
| | | //读取系统当前时间:时-分 |
| | | //读取系统当前时间:时-分 |
| | | var h = DateTime.Now.ToString("HH"); |
| | |
| | | private void RefreshView(VerticalRefreshLayout verticalRefresh) |
| | | { |
| | | verticalRefresh.RemoveAll(); |
| | | for (int i = 0; i < 6; i++) |
| | | { |
| | | Common.Logic.SoneLogicList.Add(new Common.Logic { LogicName = i.ToString() }); |
| | | |
| | | } |
| | | foreach (var logic in Common.Logic.SoneLogicList) |
| | | { |
| | | #region 自动化布局View |
| | |
| | | var btnTiyan = new NormalViewControl(300, 100, true);
|
| | | btnTiyan.Y = btnLoginByCode.Y;
|
| | | btnTiyan.TextAlignment = TextAlignment.Center;
|
| | | btnTiyan.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnTiyan.TextColor = UserCenterColor.Current.TextOrangeColor;
|
| | | btnTiyan.TextSize = 12;
|
| | | btnTiyan.Gravity = Gravity.CenterHorizontal;
|
| | | btnTiyan.Text = "游客体验";
|
| | | btnTiyan.TextID = R.MyInternationalizationString.uExperienceAccount;
|
| | | frameMidBack.AddChidren(btnTiyan);
|
| | | btnTiyan.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | |
| | | //字体总宽度
|
| | | int fontWidth = 0;
|
| | | int btnWidth = 0;
|
| | | #if Android
|
| | |
|
| | | //特殊的误差值
|
| | | int speceilValue = Application.GetRealWidth(20);
|
| | | #endif
|
| | | #if iOS
|
| | | //特殊的误差值
|
| | | int speceilValue = Application.GetRealWidth(10);
|
| | | #endif
|
| | | int speceilValue = ControlCommonResourse.TwoTextSpace;
|
| | |
|
| | | //我已阅读并同意
|
| | | var btnMsg1 = new NormalViewControl(100, 90, true);
|
| | | btnMsg1.Gravity = Gravity.CenterVertical;
|
| | |
| | | //如果这个函数被重写的话,则代表这个设备有开关功能
|
| | | this.isHadOpenSwitch = false;
|
| | | //默认用在线状态来判断
|
| | | return i_device.IsOnline == 1;
|
| | | return Common.LocalDevice.Current.CheckDeviceIsOnline(i_device);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | /// <summary>
|
| | | /// 未分配界面的设备选择控件
|
| | | /// </summary>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param>
|
| | | public DeviceSelectUnallocatedControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | this.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
|
| | |
| | | {
|
| | | //空调是特殊的,它的开关是属性上报来着.已经接收到网关的反馈
|
| | | this.dicDeviceCardControl[mainKeys].SetHadGetResponeResultStatu();
|
| | | } |
| | | }
|
| | | if (report.DeviceStatusReport.CluterID == 514 && report.DeviceStatusReport.AttriBute[0].AttributeId == 0)
|
| | | {
|
| | | //新风是特殊的,它的开关是属性上报来着.已经接收到网关的反馈
|
| | |
| | | if (this.dicDeviceCardControl.ContainsKey(mainKeys) == true)
|
| | | {
|
| | | //刷新卡片状态
|
| | | this.dicDeviceCardControl[mainKeys].SetCardOnlineStatu(report.IsOnline == 1);
|
| | | bool bolOnline = Common.LocalDevice.Current.CheckDeviceIsOnline(report);
|
| | | this.dicDeviceCardControl[mainKeys].SetCardOnlineStatu(bolOnline);
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | /// <summary>
|
| | | /// 所属区域的控件
|
| | | /// </summary>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param>
|
| | | public BelongAreaControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | //初始化数据
|
| | |
| | | /// 做成一个简单的选择控件
|
| | | /// </summary>
|
| | | /// <param name="i_text">显示文本</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param>
|
| | | public NormalSelectControl(string i_text, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | this.textValue = i_text;
|
| | |
| | | btnOnline.X = this.Width - Application.GetRealWidth(200 + 46);
|
| | | btnOnline.Y = btnDeviceName.Y;
|
| | | btnOnline.TextAlignment = TextAlignment.CenterRight;
|
| | | this.SetOnlineStatu(device.IsOnline == 1);
|
| | | this.SetOnlineStatu(Common.LocalDevice.Current.CheckDeviceIsOnline(device));
|
| | | this.AddChidren(btnOnline);
|
| | | }
|
| | |
|
| | |
| | | /// 做成一个显示设备类型+设备MAC备注的RowLayout
|
| | | /// </summary>
|
| | | /// <param name="i_deviceMac">设备的Mac地址</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param>
|
| | | public DeviceObjectControl(string i_deviceMac, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | this.deviceMac = i_deviceMac;
|
| | |
| | | frameTable.AddBottomLine();
|
| | |
|
| | | //设置在线状态的特效
|
| | | this.isOnline = listDevice[0].IsOnline == 1;
|
| | | this.isOnline = Common.LocalDevice.Current.CheckDeviceIsOnline(listDevice[0]);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | //设备房间
|
| | | btnDeviceRoom.Text = Common.LocalDevice.Current.GeteRealDeviceRoomName(listDevice[0]);
|
| | | //设置在线状态的特效
|
| | | this.isOnline = listDevice[0].IsOnline == 1;
|
| | | this.isOnline = Common.LocalDevice.Current.CheckDeviceIsOnline(listDevice[0]);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | /// 做成一个显示设备回路+房间的RowLayout
|
| | | /// </summary>
|
| | | /// <param name="i_device">设备对象</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param>
|
| | | public DeviceRoomControl(CommonDevice i_device, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | this.mainKey = Common.LocalDevice.Current.GetDeviceMainKeys(i_device);
|
| | |
| | | /// </summary>
|
| | | /// <param name="i_device">设备对象</param>
|
| | | /// <param name="autoSelect">当点击此控件时,是否自动设置选择状态</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param>
|
| | | public DeviceSelectControl(CommonDevice i_device, bool autoSelect, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | this.MainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(i_device);
|
| | |
| | | /// </summary>
|
| | | /// <param name="i_device">设备对象</param>
|
| | | /// <param name="autoSelect">当点击此控件时,是否自动设置选择状态</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param>
|
| | | public DeviceSimpleSelectControl(CommonDevice i_device, bool autoSelect, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | this.MainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(i_device);
|
| | |
| | | /// 做成一个显示网关信息的RowLayout,添加此控件到容器后,调用【InitControl()】完成初始化
|
| | | /// </summary>
|
| | | /// <param name="i_zbGateway">网关对象</param>
|
| | | /// <param name="ChidrenYaxis">子控件Y轴偏移量(有些界面需要这种特殊操作)</param>
|
| | | /// <param name="ChidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param>
|
| | | public GatewayRowControl(ZbGateway i_zbGateway, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | this.zbGatewayId = HdlGatewayLogic.Current.GetGatewayId(i_zbGateway);
|
| | |
| | | /// </summary>
|
| | | /// <param name="i_caption">标题文本</param>
|
| | | /// <param name="i_text">输入框的值</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param>
|
| | | public FrameCaptionInputControl(string i_caption, string i_text, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | this.UseClickStatu = false;
|
| | |
| | | /// </summary>
|
| | | /// <param name="i_caption">标题文本</param>
|
| | | /// <param name="i_text">显示文本的值</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param>
|
| | | public FrameCaptionViewControl(string i_caption, string i_text, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | btnCaption = new NormalViewControl(270, 58, true);
|
| | |
| | | /// <summary>
|
| | | /// 做成一个点击后能够显示点击状态的控件
|
| | | /// </summary>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param>
|
| | | public FrameLayoutStatuControl(int i_ChidrenYaxis = 0)
|
| | | {
|
| | | this.chidrenYaxis = i_ChidrenYaxis;
|
| | |
| | | /// <summary>
|
| | | /// 做成一个RowLayout型的FrameLayout
|
| | | /// </summary>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param>
|
| | | public FrameRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | this.Height = ControlCommonResourse.ListViewRowHeight;
|
| | |
| | | }
|
| | | var contr = this.AddLeftCaption(i_caption, i_width, Application.GetRealHeight(60), false);
|
| | | contr.TextSize = 15;
|
| | | contr.Y = Application.GetRealHeight(12) + this.chidrenYaxis;
|
| | | //当指定实际坐标时,这里需要的偏移量为2倍
|
| | | contr.Y = Application.GetRealHeight(12) + this.chidrenYaxis * 2;
|
| | | this.AddChidren(contr, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | return contr;
|
| | |
| | | i_width = Application.GetRealWidth(i_width);
|
| | | }
|
| | | var contr = this.AddLeftCaption(i_caption, i_width, Application.GetRealHeight(50), false);
|
| | | contr.Y = Application.GetRealHeight(72) + this.chidrenYaxis;
|
| | | //当指定实际坐标时,这里需要的偏移量为2倍
|
| | | contr.Y = Application.GetRealHeight(72) + this.chidrenYaxis * 2;
|
| | | contr.TextSize = 12;
|
| | | contr.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | this.AddChidren(contr, ChidrenBindMode.BindEventOnly);
|
| | |
| | | /// </summary>
|
| | | public bool SetCanSelect
|
| | | {
|
| | | set |
| | | set
|
| | | {
|
| | | m_SetCanSelect = value;
|
| | | }
|
| | |
| | | /// 设备功能类型的自定义行控件(选择功能之后,无条件直接变更类型)
|
| | | /// </summary>
|
| | | /// <param name="i_device">设备的对象</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param>
|
| | | public DeviceFunctionTypeRowControl(CommonDevice i_device, int i_ChidrenYaxis = 0) : base("", "", i_ChidrenYaxis)
|
| | | {
|
| | | this.device = i_device;
|
| | |
| | | /// <summary> |
| | | /// 做成一个点击能够显示选中状态背景色的RowLayout(拥有桌布) |
| | | /// </summary> |
| | | /// <param name="ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param> |
| | | /// <param name="ChidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param> |
| | | public RowLayoutControl(int i_ChidrenYaxis = 0) |
| | | { |
| | | this.LineColor = UserCenterColor.Current.Transparent;
|
| | |
| | | /// </summary>
|
| | | /// <param name="i_SceneId">场景ID</param>
|
| | | /// <param name="i_SceneName">场景名</param>
|
| | | /// <param name="i_chidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | /// <param name="i_chidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param>
|
| | | public SceneRoomControl(int i_SceneId, string i_SceneName, int i_chidrenYaxis) : base(i_chidrenYaxis)
|
| | | {
|
| | | this.SceneId = i_SceneId;
|
| | |
| | | /// 做成一个简单场景选择的行控件(它会自动设置选择状态)
|
| | | /// </summary>
|
| | | /// <param name="i_Scene">场景对象</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(真实值,有些界面需要这种特殊操作)</param>
|
| | | /// <param name="i_ChidrenYaxis">子控件Y轴偏移量(【列表控件的rowSpace/2】即可,不懂默认为0即可)</param>
|
| | | public SceneSimpleSelectControl(Common.SceneUI i_Scene, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis)
|
| | | {
|
| | | this.SceneId = i_Scene.Id;
|
| | |
| | | //备份设备
|
| | | await HdlGatewayLogic.Current.UpLoadDeviceBackupDataToGateway(panel, GatewayBackupEnum.A干接点颜色调节, colorData);
|
| | | return true;
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 设置面板颜色
|
| | | /// </summary>
|
| | |
| | | //备份设备
|
| | | await HdlGatewayLogic.Current.UpLoadDeviceBackupDataToGateway(panel, GatewayBackupEnum.A干接点颜色调节, colorData);
|
| | | return true;
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | #endregion
|
| | | |
| | | #region ■ 亮度调节___________________________
|
| | |
| | | /// 配置接近传感
|
| | | /// </summary>
|
| | | /// <param name="device">设备对象</param>
|
| | | /// <para>sensorEnable:传感器使能</para> |
| | | /// <para>sensorEnable:传感器使能</para>
|
| | | /// <returns></returns>
|
| | | public async Task<bool> SetProximitySensorStatus(CommonDevice device, bool sensorEnable)
|
| | | {
|
| | |
| | | /// </summary>
|
| | | /// <param name="panel">按键面板的某一个回路</param>
|
| | | /// <param name="parameter">
|
| | | /// <para>方法1:当int[]传空,返回值是“面板具有的功能大类,即返回“第一级别。1024:灯类,256:按键类,768:PIR类</para> |
| | | /// <para>方法1:当int[]传空,返回值是“面板具有的功能大类,即返回“第一级别。1024:灯类,256:按键类,768:PIR类</para> |
| | | /// <para>方法2:、当int[]值为第一级别PrivateFuncTypeFir中选择一个。</para> |
| | | /// <para>返回值是“面按键发送功能类”,即返回“第二级别。</para> |
| | | /// <para>100:Switch,开关(按键类);200:Dimmer,调光(按键类);300:Curtain,窗帘(按键类)</para> |
| | | /// <para>0:EnergySavingMode,节能模式(灯类);1:SleepMode,睡眠模式(灯类);100:WhiteBalance,白平衡(灯类);101:RGBColor,RGB指示灯颜色(灯类);102:RGBLevel,RGB指示灯亮度(灯类)</para> |
| | | /// <para>方法3:当int[]值为第一级别PrivateFuncTypeFir中选择一个,接着再选第二级别PrivateFunTypeSec中选择一个 </para> |
| | | /// <para>返回值是“面按键具体功能配置”,即返回“第二级别。</para> |
| | | /// <para>100:SwitchOpen,开关开(按键类);101:SwitchClose,开关关(按键类);102:SwitchChange,开关切换(按键类)</para> |
| | | /// <para>200:DimmerStepUp,增大调光(按键类);201:DimmerStepDown,降低调光(按键类);202:DimmerStepChange,调光切换(按键类)</para> |
| | | /// <para>100:SwitchOpen,开关开(按键类);101:SwitchClose,开关关(按键类);102:SwitchChange,开关切换(按键类)</para> |
| | | /// <para>200:DimmerStepUp,增大调光(按键类);201:DimmerStepDown,降低调光(按键类);202:DimmerStepChange,调光切换(按键类)</para> |
| | | /// <para>300:CurtainOpen,窗帘开(按键类);301:CurtainClose,窗帘关(按键类);302:CurtainStop,窗帘停;303:CurtainUpStop,窗帘上升停;304:CurtainDownstop,窗帘下降停</para>
|
| | | /// </param>
|
| | | /// <returns></returns>
|
| | |
| | | list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A空气开关, RoomId = floorKey + "_XuanGuan", DeviceCount = 1 });
|
| | | list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A1路调光器, RoomId = floorKey + "_XuanGuan", DeviceCount = 1 });
|
| | | list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A门窗磁传感器, RoomId = floorKey + "_XuanGuan", DeviceCount = 1 });
|
| | | list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A智能门锁, RoomId = floorKey + "_XuanGuan", DeviceCount = 1 });
|
| | |
|
| | | //厨房
|
| | | list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A4按键面板, RoomId = floorKey + "_ChuFang", DeviceCount = 1 });
|
| | | list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A水浸传感器, RoomId = floorKey + "_ChuFang", DeviceCount = 1 });
|
| | | list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A烟雾传感器, RoomId = floorKey + "_ChuFang", DeviceCount = 1 });
|
| | | list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A燃气传感器, RoomId = floorKey + "_ChuFang", DeviceCount = 1 });
|
| | | list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A吸顶燃气传感器, RoomId = floorKey + "_ChuFang", DeviceCount = 1 });
|
| | |
|
| | | //走廊
|
| | | list.Add(new AddDevicePra { DeviceType = VirtualDeviceEnum.A4按键面板, RoomId = floorKey + "_ZouLang", DeviceCount = 1 });
|
| | |
| | | {
|
| | | //先刷新容器
|
| | | LocalDevice.Current.ReFreshByLocal();
|
| | | //顺便也整一下网关(有可能它是从实体账号转为虚拟时,没有清空)
|
| | | HdlGatewayLogic.Current.ReFreshByLocal();
|
| | | HdlGatewayLogic.Current.RefreshAppOldSelectGatewayId();
|
| | |
|
| | | Type thisType = m_Current.GetType();
|
| | | //获取需要创建的虚拟设备列表
|
| | |
| | | device.IasDeviceType = 43;
|
| | | //设置设备的基本信息
|
| | | this.SetBaseDataToDevice(device, 1300, 1300, "MSG01/M-ZB.10", i_RoomId);
|
| | |
|
| | | this.DeviceNumber++;
|
| | | }
|
| | | }
|
| | |
|
| | | public void Zigbee吸顶燃气传感器(int i_DeviceCount, string i_RoomId)
|
| | | {
|
| | | for (int i = 0; i < i_DeviceCount; i++)
|
| | | {
|
| | | var device = new IASZone() { DeviceAddr = "DeviceAddr" + this.DeviceNumber, DeviceEpoint = 1 };
|
| | | device.IasDeviceType = 43;
|
| | | //设置设备的基本信息
|
| | | this.SetBaseDataToDevice(device, 1300, 1300, "MGCD01/ZB.10", i_RoomId);
|
| | |
|
| | | this.DeviceNumber++;
|
| | | }
|
| | |
| | | A方悦双开四控面板 = 23,
|
| | | A方悦四开八控面板 = 24,
|
| | | A方悦新风面板 = 25,
|
| | | A方悦新风小模块 = 26
|
| | | A方悦新风小模块 = 26,
|
| | | A吸顶燃气传感器 = 27,
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | if (locadevice != null)
|
| | | {
|
| | | ((IASZone)locadevice).iASInfo = ias.iASInfo;
|
| | | //如果接收到上报,即说明这个传感器是在线的
|
| | | locadevice.IsOnline = 1;
|
| | | //记录回复时间
|
| | | locadevice.LastDateTime = DateTime.Now;
|
| | | }
|
| | |
| | | {
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | //温居城的要网关中是否有逻辑存在 |
| | | //温居城的要网关中是否有逻辑存在
|
| | | //参数:2-常开自动化;3-失效时间自动化
|
| | | var result = await Shared.Phone.Device.Logic.SkipView.Exist(2);
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | |
| | | /// </summary>
|
| | | public static int BodyFrameHeight
|
| | | {
|
| | | get { return UserView.HomePage.Instance.Height - Application.GetRealHeight(184); }
|
| | | get { return UserView.HomePage.Instance.Height - TopMenuFrameHeight - TopFrameHeight; }
|
| | | }
|
| | | /// <summary>
|
| | | /// 画面BottomFrameLayout的高度(高度:141 注:此变量在个人中心不使用)
|
| | |
| | | /// 徐梅的门锁界面是否是打开的状态
|
| | | /// </summary>
|
| | | public static bool IsDoorLockPageOpen = false;
|
| | | #if Android
|
| | | /// <summary>
|
| | | /// 两个文本拼接时,为了看起来是正常的,需要减去它们之间的间隔误差
|
| | | /// </summary>
|
| | | public static int TwoTextSpace = Application.GetRealWidth(20);
|
| | | #endif
|
| | | #if iOS
|
| | | /// <summary>
|
| | | /// 两个文本拼接时,为了看起来是正常的,需要减去它们之间的间隔误差
|
| | | /// </summary>
|
| | | public static int TwoTextSpace = Application.GetRealWidth(10);
|
| | | #endif
|
| | | }
|
| | | }
|
| | |
| | | this.SetAllEpointName();
|
| | | // 设置网关所在的时区的时间给门锁时间
|
| | | this.SetDoorTime();
|
| | | //新入网的设备,清空掉它的房间
|
| | | this.ClearDeviceFromRoom();
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 一般方法___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 新入网的设备,清空掉它的房间
|
| | | /// </summary>
|
| | | private void ClearDeviceFromRoom()
|
| | | {
|
| | | foreach (var device in this.listNewDevice)
|
| | | {
|
| | | HdlRoomLogic.Current.DeleteDevice(device);
|
| | | HdlRoomLogic.Current.DeleteLoveDevice(device);
|
| | | }
|
| | | Common.LocalDevice.Current.DeleteRealDeviceFromRoom(this.listNewDevice[0]);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 画面关闭___________________________
|
| | |
|
| | | /// <summary>
|
| | |
| | | //右箭头
|
| | | rowDevice.frameTable.AddRightArrow();
|
| | | //在线状态
|
| | | rowDevice.isOnline = device.IsOnline == 1;
|
| | | rowDevice.isOnline = Common.LocalDevice.Current.CheckDeviceIsOnline(device);
|
| | |
|
| | | //保存控件
|
| | | string maikey = Common.LocalDevice.Current.GetDeviceMainKeys(device);
|
| | |
| | | {
|
| | | if (rowInfo != null)
|
| | | {
|
| | | rowInfo.MenuRow.isOnline = device.IsOnline == 1;
|
| | | rowInfo.MenuRow.isOnline = Common.LocalDevice.Current.CheckDeviceIsOnline(device);
|
| | | if (rowInfo.dicDetailRow != null)
|
| | | {
|
| | | foreach (var detailRow in rowInfo.dicDetailRow.Values)
|
| | |
| | | this.ClearBodyFrame();
|
| | |
|
| | | //图片
|
| | | var btnPic = new PicViewControl(878, 478);
|
| | | btnPic.Y = Application.GetRealHeight(251);
|
| | | btnPic.Gravity = Gravity.CenterHorizontal;
|
| | | btnPic.UnSelectedImagePath = "Instruct/DeviceSearch.png";
|
| | | bodyFrameLayout.AddChidren(btnPic);
|
| | | var framePic = new FrameLayout();
|
| | | framePic.Width = this.GetPictrueRealSize(878);
|
| | | framePic.Height = this.GetPictrueRealSize(478);
|
| | | framePic.Y = Application.GetRealHeight(251);
|
| | | framePic.Gravity = Gravity.CenterHorizontal;
|
| | | framePic.BackgroundImagePath = "Instruct/DeviceSearch.png";
|
| | | bodyFrameLayout.AddChidren(framePic);
|
| | |
|
| | | //正在搜索设备,请稍候…
|
| | | var btnSearch = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(58), false);
|
| | |
| | | this.realGateway.GwResDataAction += this.AdjustGatewayResultData;
|
| | | }
|
| | | //开启连接的假想动画效果线程
|
| | | this.StartConcetionAnimeteThread();
|
| | | this.StartConcetionAnimeteThread(framePic);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | //添加设备的缓存
|
| | | device.IsOnline = 1;
|
| | | Common.LocalDevice.Current.AddDeviceToMemory(ref device);
|
| | | |
| | |
|
| | | if (this.dicNewDevice.ContainsKey(device.DeviceAddr) == false)
|
| | | {
|
| | | this.dicNewDevice[device.DeviceAddr] = new List<CommonDevice>();
|
| | |
| | | /// <summary>
|
| | | /// 开启连接的假想动画效果线程
|
| | | /// </summary>
|
| | | private void StartConcetionAnimeteThread()
|
| | | private void StartConcetionAnimeteThread(FrameLayout framePic)
|
| | | {
|
| | | int iconSize = this.GetPictrueRealSize(23);
|
| | |
|
| | |
| | | for (int i = 0; i < 9; i++)
|
| | | {
|
| | | //X轴+Index*(图标大小+间距)
|
| | | listPoint.Add(this.GetPictrueRealSize(394) + i * (iconSize + this.GetPictrueRealSize(10)));
|
| | | listPoint.Add(this.GetPictrueRealSize(300) + i * (iconSize + this.GetPictrueRealSize(10)));
|
| | | }
|
| | |
|
| | | var btnRound = new PicViewControl(iconSize, iconSize, false);
|
| | | btnRound.Radius = (uint)iconSize / 2;
|
| | | btnRound.BackgroundColor = UserCenterColor.Current.ConcetionRoundColor;
|
| | | btnRound.X = listPoint[0];
|
| | | btnRound.Y = this.GetPictrueRealSize(475);
|
| | | bodyFrameLayout.AddChidren(btnRound);
|
| | | btnRound.Y = this.GetPictrueRealSize(225);
|
| | | framePic.AddChidren(btnRound);
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | |
| | | unSelectPic = "Device/SensorCarbonMonoxide.png"; |
| | | this.AddMenuRow(objectText, unSelectPic, "SensorCarbonMonoxideDirectionForm");
|
| | |
|
| | | //吸顶燃气传感器
|
| | | objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName26); |
| | | unSelectPic = "Device/SensorCarbonMonoxide.png"; |
| | | this.AddMenuRow(objectText, unSelectPic, "SensorCeilingGasDirectionForm");
|
| | |
|
| | | //烟雾传感器
|
| | | objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName20); |
| | | unSelectPic = "Device/SensorFire.png"; |
| | |
| | | objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName23); |
| | | unSelectPic = "Device/SensorTemperatureHumidity.png"; |
| | | this.AddMenuRow(objectText, unSelectPic, "SensorTemperatureHumidityForm");
|
| | | |
| | | //PM2.5空气质量传感器 |
| | | objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName27); |
| | | unSelectPic = "Device/SensorPMTwoPointFive.png"; |
| | | this.AddMenuRow(objectText, unSelectPic, "SensorPMTwoPointFiveForm"); |
| | |
|
| | | //PM2.5空气质量传感器
|
| | | objectText = Language.StringByID(R.MyInternationalizationString.uDeviceDirectionName26); |
New file |
| | |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | |
|
| | | namespace Shared.Phone.UserCenter.DeviceDirection
|
| | | {
|
| | | /// <summary>
|
| | | /// 吸顶燃气传感器的添加步骤界面
|
| | | /// </summary>
|
| | | public class SensorCeilingGasDirectionForm : DirectionCommonForm
|
| | | {
|
| | | #region ■ 初始化_____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
| | | /// </summary>
|
| | | public void ShowForm()
|
| | | {
|
| | | //设置头部信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddDevice));
|
| | |
|
| | | //初始化中部信息
|
| | | this.InitMiddleFrame();
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化中部信息
|
| | | /// </summary>
|
| | | private void InitMiddleFrame()
|
| | | {
|
| | | //图片
|
| | | var framePic = new FrameLayout();
|
| | | framePic.Width = this.GetPictrueRealSize(948);
|
| | | framePic.Height = this.GetPictrueRealSize(702);
|
| | | framePic.Gravity = Gravity.CenterHorizontal;
|
| | | framePic.Y = Application.GetRealHeight(138);
|
| | | bodyFrameLayout.AddChidren(framePic);
|
| | | var btnPic = new PicViewControl(framePic.Width, framePic.Height, false);
|
| | | btnPic.UnSelectedImagePath = "Instruct/SensorCeilingGas.png";
|
| | | framePic.AddChidren(btnPic);
|
| | |
|
| | | //绿色指示灯快速闪烁
|
| | | var btnGreanLinght = new NormalViewControl(this.GetPictrueRealSize(501), this.GetPictrueRealSize(45), false);
|
| | | btnGreanLinght.X = this.GetPictrueRealSize(447);
|
| | | btnGreanLinght.Y = this.GetPictrueRealSize(326);
|
| | | btnGreanLinght.TextAlignment = TextAlignment.Center;
|
| | | btnGreanLinght.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnGreanLinght.TextSize = 10;
|
| | | btnGreanLinght.TextID = R.MyInternationalizationString.uGreanPilotLampLinghtQuickly;
|
| | | framePic.AddChidren(btnGreanLinght);
|
| | |
|
| | | //长按5秒
|
| | | //(按键)
|
| | | string textMsg = Language.StringByID(R.MyInternationalizationString.uLongClickPanelSomeSecond);
|
| | | if (textMsg.Contains("{0}") == true)
|
| | | {
|
| | | textMsg = string.Format(textMsg, "5");
|
| | | }
|
| | | var btnSecond2 = new NormalViewControl(this.GetPictrueRealSize(463), this.GetPictrueRealSize(45), false);
|
| | | btnSecond2.Y = this.GetPictrueRealSize(222);
|
| | | btnSecond2.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnSecond2.TextSize = 10;
|
| | | btnSecond2.TextAlignment = TextAlignment.Center;
|
| | | btnSecond2.Text = textMsg;
|
| | | framePic.AddChidren(btnSecond2);
|
| | |
|
| | | //长按图示按键5秒以上,绿色快闪
|
| | | //进入配网状态,绿灯常亮则入网成功
|
| | | string[] msgArry = Language.StringByID(R.MyInternationalizationString.uAddSensorCeilingGasMsg).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
|
| | |
|
| | | var msg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
|
| | | msg1.Y = Application.GetRealHeight(1037);
|
| | | msg1.Text = msgArry[0];
|
| | | msg1.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | msg1.TextAlignment = TextAlignment.Center;
|
| | | bodyFrameLayout.AddChidren(msg1);
|
| | | var msg2 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
|
| | | msg2.Y = msg1.Bottom;
|
| | | if (msgArry.Length > 1)
|
| | | {
|
| | | msg2.Text = msgArry[1];
|
| | | }
|
| | | msg2.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | msg2.TextAlignment = TextAlignment.Center;
|
| | | bodyFrameLayout.AddChidren(msg2);
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 屏幕亮度级别_______________________ |
| | | #region ■ 屏幕亮度级别_______________________
|
| | | /// <summary>
|
| | | /// 添加屏幕亮度级别控件
|
| | | /// </summary>
|
| | |
| | | btnLevelView.Y = Application.GetRealHeight(54);
|
| | | btnLevelView.Gravity = Gravity.CenterVertical;
|
| | | btnLevelView.TextID = R.MyInternationalizationString.BackgroundLightColor;
|
| | | frameBack.AddChidren(btnLevelView); |
| | | |
| | | frameBack.AddChidren(btnLevelView);
|
| | |
|
| | | var frameColor = new FrameLayoutStatuControl();
|
| | | frameColor.UseClickStatu = false;
|
| | | frameColor.Width = Application.GetRealHeight(262);
|
| | | frameColor.Height = this.GetPictrueRealSize(79);
|
| | | frameColor.Gravity = Gravity.CenterVertical;
|
| | | frameColor.X = frameBack.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262);
|
| | | frameBack.AddChidren(frameColor); |
| | | |
| | | //颜色 |
| | | frameBack.AddChidren(frameColor);
|
| | |
|
| | | //颜色
|
| | | var btnColorView = new NormalViewControl(Application.GetRealHeight(110), this.GetPictrueRealSize(49), false);
|
| | | btnColorView.Gravity = Gravity.CenterVertical;
|
| | | btnColorView.TextAlignment = TextAlignment.CenterRight;
|
| | |
| | | btnColorView.Y = Application.GetRealHeight(5);
|
| | | btnColorView.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | btnColorView.TextID = R.MyInternationalizationString.uColor;
|
| | | frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEventOnly); |
| | | |
| | | frameColor.AddChidren(btnColorView, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | int R1 = Convert.ToInt32(this.keyColorData.OpenColorR, 16);
|
| | | int G1 = Convert.ToInt32(this.keyColorData.OpenColorG, 16);
|
| | | int B1 = Convert.ToInt32(this.keyColorData.OpenColorB, 16);
|
| | | uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1);
|
| | |
|
| | | //颜色外框 |
| | | //颜色外框
|
| | | var btnColorLine = new FrameLayoutStatuControl();
|
| | | btnColorLine.Width = Application.GetRealHeight(79);
|
| | | btnColorLine.Height = this.GetPictrueRealSize(79);
|
| | |
| | | btnColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2;
|
| | | btnColorLine.BorderWidth = 1;
|
| | | btnColorLine.BorderColor = 0xffcccccc;
|
| | | frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly); |
| | | |
| | | frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | var btnColor = new NormalViewControl(this.GetPictrueRealSize(69), this.GetPictrueRealSize(69), false);
|
| | | btnColor.Gravity = Gravity.Center;
|
| | | btnColor.Radius = (uint)this.GetPictrueRealSize(69) / 2;
|
| | | btnColor.BackgroundColor = backColor;
|
| | | btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEventOnly); |
| | | |
| | | btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEventOnly);
|
| | |
|
| | | var btnRight = new NormalViewControl(this.GetPictrueRealSize(58), this.GetPictrueRealSize(58), false);
|
| | | btnRight.UnSelectedImagePath = "Item/RightNext.png";
|
| | | btnRight.Y = Application.GetRealHeight(5);
|
| | |
| | | btnRight.Y += this.GetPictrueRealSize(8);
|
| | |
|
| | | frameColor.ButtonClickEvent += (sender, e) =>
|
| | | { |
| | | {
|
| | | var form = new PanelColorSelectForm();
|
| | | form.AddForm(R1, G1, B1);
|
| | | form.FinishSelectColorEvent += (Rcolor, Gcolor, Bcolor) =>
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 节能模式行_________________________ |
| | | #region ■ 节能模式行_________________________
|
| | | /// <summary>
|
| | | /// 添加节能模式行
|
| | | /// </summary>
|
| | |
| | | //关闭进度条
|
| | | this.CloseProgressBar(ShowReLoadMode.YES);
|
| | | return false;
|
| | | } |
| | | }
|
| | | keyColorData = await HdlDevicePanelLogic.Current.GetPanelColorInfo(panelDevice);
|
| | | if (this.keyColorData == null)
|
| | | {
|
| | | //关闭进度条
|
| | | this.CloseProgressBar(ShowReLoadMode.YES);
|
| | | return false;
|
| | | } |
| | | //关闭进度条 |
| | | }
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | |
|
| | | return true; |
| | | return true;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | {
|
| | | this.CloseProgressBar();
|
| | | return;
|
| | | } |
| | | |
| | | //设置按键面板颜色的信息 |
| | | }
|
| | |
|
| | | //设置按键面板颜色的信息
|
| | | result = await HdlDevicePanelLogic.Current.SetPanelColorInfo(panelDevice, this.keyColorData);
|
| | | this.CloseProgressBar();
|
| | | if (result == false)
|
| | |
| | | }
|
| | | //关闭自身
|
| | | this.CloseForm();
|
| | | } |
| | | }
|
| | | #endregion
|
| | | |
| | | #region ■ 补充容器___________________________ |
| | |
|
| | | #region ■ 补充容器___________________________
|
| | | /// <summary>
|
| | | /// 行数超过容器时,补一个空白FrameLayout,使之能滑动
|
| | | /// </summary>
|
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Org.BouncyCastle.Bcpg.OpenPgp; |
| | | using Shared.Common; |
| | | using ZigBee.Common; |
| | | using ZigBee.Device; |
| | |
| | | private string bindPmName = string.Empty; |
| | | |
| | | #endregion |
| | |
|
| | | |
| | | #region ■ 初始化_____________________________
|
| | | |
| | | /// <summary>
|
| | |
| | | public void ShowForm(CommonDevice i_device)
|
| | | {
|
| | | this.deviceObj = i_device;
|
| | | //获取数据
|
| | | ReadDoorLockUserInfo(deviceObj);
|
| | | //获取数据 |
| | | ReadDoorLockUserInfo(deviceObj); |
| | |
|
| | | //设置头部信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uPanelSettion));
|
| | |
| | | this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028);
|
| | |
|
| | | //初始化菜单行
|
| | | this.InitMenuRow(); |
| | | |
| | | //初始化桌布完成 |
| | | this.InitMenuRow();
|
| | |
|
| | | //初始化桌布完成
|
| | | tableContr.FinishInitControl();
|
| | | tableContr = null;
|
| | |
|
| | |
| | | {
|
| | | //关闭自身
|
| | | this.CloseForm();
|
| | | }; |
| | | };
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化菜单行
|
| | | /// </summary>
|
| | | private void InitMenuRow()
|
| | | { |
| | | {
|
| | | this.listview.RemoveAll();
|
| | | //添加新风目标 |
| | | this.AddFreshAirRow(); |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region ■ 初始化数据_________________________ |
| | | #region ■ 初始化数据_________________________ |
| | | |
| | | /// <summary> |
| | | /// 初始化数据 |
| | |
| | | }); |
| | | } |
| | | #endregion |
| | | |
| | | #region ■ 新风目标_________________________ |
| | |
|
| | | #region ■ 新风目标_________________________ |
| | | /// <summary> |
| | | /// 新风目标行 |
| | | /// </summary> |
| | |
| | | //底线
|
| | | rowNewWind.AddBottomLine();
|
| | | //右箭头
|
| | | rowNewWind.AddRightArrow(); |
| | | rowNewWind.AddRightArrow();
|
| | | |
| | | var msg = Language.StringByID(R.MyInternationalizationString.nothing);
|
| | | var msg = Language.StringByID(R.MyInternationalizationString.nothing); |
| | | if (!string.IsNullOrEmpty(bindFreshAirName)) |
| | | { |
| | | msg = bindFreshAirName; |
| | | } |
| | | var btnNewWindStatu = rowNewWind.AddMostRightView(msg, 700);
|
| | |
|
| | | |
| | | rowNewWind.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, 1); |
| | |
| | | return result; |
| | | } |
| | | |
| | | #region ■ PM2.5来源_________________________ |
| | | #region ■ PM2.5来源_________________________ |
| | | /// <summary> |
| | | /// PM2.5来源行 |
| | | /// </summary> |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region ■ 温度来源_________________________ |
| | | #region ■ 温度来源_________________________ |
| | | /// <summary> |
| | | /// 温度来源行 |
| | | /// </summary> |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region ■ 湿度来源_________________________ |
| | | #region ■ 湿度来源_________________________ |
| | | /// <summary> |
| | | /// 湿度来源行 |
| | | /// </summary> |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region ■ 亮度调节_________________________ |
| | | #region ■ 亮度调节_________________________ |
| | | /// <summary> |
| | | /// 亮度调节行 |
| | | /// </summary> |
| | |
| | | } |
| | | #endregion
|
| | | |
| | | #region ■ 右上角菜单_________________________ |
| | | #region ■ 右上角菜单_________________________ |
| | | /// <summary>
|
| | | /// 初始化右上角菜单
|
| | | /// </summary>
|
| | |
| | | |
| | | #region 常开模式 API |
| | | /// <summary> |
| | | /// 获取当前门锁的常开模式 |
| | | /// 获取当前门锁的常开模式 |
| | | /// </summary> |
| | | /// <param name="doorLock:当前门锁"></param> |
| | | /// <returns>null:没有回复 ; true:门锁常开;false:门锁常关</returns> |
| | | /// <param name="doorLock:当前门锁"></param> |
| | | /// <returns>null:没有回复 ; true:门锁常开;false:门锁常关</returns> |
| | | public static async System.Threading.Tasks.Task<bool?> GetNormallyOpenMode(ZigBee.Device.DoorLock doorLock) |
| | | { |
| | | bool? IsDoorLockNormallyMode = null; |
| | |
| | | /// <summary> |
| | | /// 门锁是否支持常开[这里暂时只有S-One门锁支持,H06C不支持, 后期通过能力值支持] |
| | | /// </summary> |
| | | /// <param name="doorLock:当前门锁"></param> |
| | | /// <returns>true:支持常开;false: 不支持常开</returns> |
| | | /// <param name="doorLock:当前门锁"></param> |
| | | /// <returns>true:支持常开;false: 不支持常开</returns> |
| | | public static bool CanNormallyOpen(ZigBee.Device.DoorLock doorLock) |
| | | { |
| | | var listDevice = new List<CommonDevice> { }; |
| | |
| | | { |
| | | if (doorLockMessType == DoorLockMessType.DeviceReport || doorLockMessType == DoorLockMessType.ServicePush) |
| | | { |
| | | //上报“常开模式”已被取消,app默认了“常开模式”被取消 |
| | | //上报“常开模式”已被取消,app默认了“常开模式”被取消 |
| | | DoorLockCommonInfo.NormallyOpenModeValue(doorLock, false); |
| | | } |
| | | else |
| | |
| | | } |
| | | else |
| | | { |
| | | //创建常开模式的特殊逻辑 |
| | | //创建常开模式的特殊逻辑 |
| | | var resu = await Shared.Phone.Device.Logic.SkipView.LockAddModifyLogic(DoorLockCommonInfo.NormallyOpenModeInvalidTime, doorLock); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | //app操作不取消“常开模式” |
| | | //app操作不取消“常开模式” |
| | | DoorLockCommonInfo.NormallyOpenModeValue(doorLock, true); |
| | | } |
| | | action?.Invoke(); |
| | |
| | | { |
| | | //添加App开启常开模式的历史记录 |
| | | HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(doorLock, 9002, string.Empty); |
| | | //app确认取消“常开模式”成功 |
| | | //app确认取消“常开模式”成功 |
| | | NormallyOpenModeValue(doorLock, false); |
| | | //删除设置常开模式创建的逻辑 |
| | | if (haveLogic) |
| | | { |
| | | var resTemp1 = await Shared.Phone.Device.Logic.SkipView.Exist(3); |
| | | //温居城方法??? |
| | | //此处是否要删除温居城的特殊逻辑 |
| | | //此处是否要删除温居城的特殊逻辑 |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除常开模式 |
| | | /// </summary> |
| | | /// <param name="doorLock">当前门锁</param> |
| | | /// <param name="action">回调处理更新内容</param> |
| | | /// <returns></returns> |
| | | public static async System.Threading.Tasks.Task<bool> DelNormallyOpenMode(ZigBee.Device.DoorLock doorLock, Action action = null) |
| | | { |
| | | //app操作取消“常开模式” |
| | | var result = await doorLock.SetNormallyOpenModeFuncAsync(false); |
| | | if (result == null || result.defaultControlResponseData == null || result.defaultControlResponseData.status != 0) |
| | | { |
| | | action?.Invoke(); |
| | | return false; |
| | | } |
| | | |
| | | if (result.defaultControlResponseData.status == 0) |
| | | { |
| | | //app确认取消“常开模式”成功 |
| | | NormallyOpenModeValue(doorLock, false); |
| | | action?.Invoke(); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置常开模式 |
| | | /// </summary> |
| | | /// <param name="doorLock">当前门锁</param> |
| | | /// <param name="action">回调处理更新内容</param> |
| | | /// <returns></returns> |
| | | public static async System.Threading.Tasks.Task<bool> SetNormallyOpenModeFuncAsync(ZigBee.Device.DoorLock doorLock) |
| | | { |
| | | //app设置“常开模式”失败 |
| | | var result = await doorLock.SetNormallyOpenModeFuncAsync(false); |
| | | if (result == null || result.defaultControlResponseData == null || result.defaultControlResponseData.status != 0) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (result.defaultControlResponseData.status == 0) |
| | | { |
| | | //app设置“常开模式”成功 |
| | | NormallyOpenModeValue(doorLock, false); |
| | | return true; |
| | | } |
| | | return false; |
| | | /// <summary>
|
| | | /// 删除常开模式
|
| | | /// </summary>
|
| | | /// <param name="doorLock">当前门锁</param>
|
| | | /// <param name="action">回调处理更新内容</param>
|
| | | /// <returns></returns>
|
| | | public static async System.Threading.Tasks.Task<bool> DelNormallyOpenMode(ZigBee.Device.DoorLock doorLock, Action action = null)
|
| | | {
|
| | | //app操作取消“常开模式”
|
| | | var result = await doorLock.SetNormallyOpenModeFuncAsync(false);
|
| | | if (result == null || result.defaultControlResponseData == null || result.defaultControlResponseData.status != 0)
|
| | | {
|
| | | action?.Invoke();
|
| | | return false;
|
| | | }
|
| | |
|
| | | if (result.defaultControlResponseData.status == 0)
|
| | | {
|
| | | //app确认取消“常开模式”成功
|
| | | NormallyOpenModeValue(doorLock, false);
|
| | | action?.Invoke();
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 设置常开模式
|
| | | /// </summary>
|
| | | /// <param name="doorLock">当前门锁</param>
|
| | | /// <param name="action">回调处理更新内容</param>
|
| | | /// <returns></returns>
|
| | | public static async System.Threading.Tasks.Task<bool> SetNormallyOpenModeFuncAsync(ZigBee.Device.DoorLock doorLock)
|
| | | {
|
| | | //app设置“常开模式”失败
|
| | | var result = await doorLock.SetNormallyOpenModeFuncAsync(false);
|
| | | if (result == null || result.defaultControlResponseData == null || result.defaultControlResponseData.status != 0)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | if (result.defaultControlResponseData.status == 0)
|
| | | {
|
| | | //app设置“常开模式”成功
|
| | | NormallyOpenModeValue(doorLock, false);
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | return; |
| | | } |
| | | |
| | | //设置常开模式后,您的门锁将始终处于打开状态,确认开启? |
| | | //设置常开模式后,您的门锁将始终处于打开状态,确认开启? |
| | | string msg = Language.StringByID(R.MyInternationalizationString.SetDoorLockNomallyOpen).Replace("{0}", "\r\n"); |
| | | var confirm = Language.StringByID(R.MyInternationalizationString.Confrim); |
| | | var alert = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.Confirm, msg, confirm); |
| | |
| | | /// </summary> |
| | | public static async void NomallyOpenModeInvalidTimeDialog(ZigBee.Device.DoorLock doorLock, Action action) |
| | | { |
| | | //失效设置 |
| | | //失效设置 |
| | | string msgTimeInValidSetting = Language.StringByID(R.MyInternationalizationString.DoorLockOpenAllTheTime); |
| | | var timeConfrim = Language.StringByID(R.MyInternationalizationString.Confrim); |
| | | var alertTimeInValidSetting = new ShowDoorLockMsgControl(ShowDoorLockMsgControl.DoorLockMsgType.InValid, msgTimeInValidSetting, timeConfrim); |
| | |
| | | /// <summary> |
| | | /// 门锁是否支持音量[这里暂时只有S-One门锁支持,H06C不支持,后期通过能力值支持] |
| | | /// </summary> |
| | | /// <param name="doorLock:当前门锁"></param> |
| | | /// <returns></returns> |
| | | /// <param name="doorLock:当前门锁"></param> |
| | | /// <returns></returns> |
| | | public static bool CanVolume(ZigBee.Device.DoorLock doorLock) |
| | | { |
| | | var listDevice = new List<CommonDevice> { }; |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 从云端获取的方法 |
| | | #region 从云端获取的方法 |
| | | /// <summary> |
| | | /// 获取当前账户门锁操作权限(是否被冻结) |
| | | /// </summary> |
| | |
| | | } |
| | | |
| | | |
| | | //2、读取云端门锁信息 |
| | | //2、读取云端门锁信息 |
| | | var getDoorLockInfoAllList = new List<ZigBee.Device.DoorLock.CloudDoorLockObj> { }; |
| | | var getDoorLockInfoList = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockAllAccountInfolist(doorLock); |
| | | if (getDoorLockInfoList != null) |
| | |
| | | /// <returns></returns> |
| | | public static DateTime GetDoorLockZoneTime() |
| | | { |
| | | //通过经度获取时区 |
| | | //通过经度获取时区 |
| | | var gwZone = int.Parse(CaculateTimeZone(Common.Config.Instance.Home.Longitude)); |
| | | //将本地时间转换成世界时 |
| | | var utc = DateTime.Now.AddHours(-gwZone); |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取时区 |
| | | /// 获取时区 |
| | | /// </summary> |
| | | /// <param name="currentLon">currentLon:"+"为东区,“-”为西区</param> |
| | | /// <returns></returns> |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 一般方法 |
| | | #region 一般方法 |
| | | /// <summary> |
| | | /// 显示错误信息窗口 |
| | | /// </summary> |
| | |
| | | }); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | #endregion |
| | | |
| | | /// <summary>
|
| | | /// UI显示 |
| | | /// UI显示
|
| | | /// </summary> |
| | | public void Show() |
| | | { |
| | |
| | | } |
| | | else |
| | | {
|
| | | ///备注:WJC的
|
| | | ///记录当前用户信息
|
| | | ///记录当前用户信息H06C
|
| | | ///wjc
|
| | | Shared.Phone.Device.Logic.SkipView.SkipAddLogic(1, doorLock, accountObj);
|
| | |
|
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | ((ViewGroup)nowForm).AddChidren(MsgControlFrameLayout);
|
| | | MsgControlFrameLayout.MouseDownEventHandler += (sender, e) =>
|
| | | {
|
| | | if (msgType == DoorLockMsgType.InValid) |
| | | { |
| | | return; |
| | | if (msgType == DoorLockMsgType.InValid)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | //移除界面
|
| | |
| | | /// <param name="frameBack"></param>
|
| | | private void InitInValidTimeDialog(FrameLayout frameBack)
|
| | | {
|
| | | //消息 |
| | | //消息
|
| | | string[] msgArray = msgText.Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | var btnMsg1 = new Button()
|
| | | {
|
| | |
| | | this.InvalidClickEvent?.Invoke();
|
| | | this.InvalidClickEvent = null;
|
| | | };
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 失效时间的底部按钮
|
| | | /// </summary>
|
| | | /// <param name="frameMain"></param>
|
| | | /// <param name="frameBack"></param>
|
| | | private void InitBottomInvalidTimeButton(FrameLayout frameMain, FrameLayout frameBack)
|
| | | { |
| | | //确定按钮 |
| | | {
|
| | | //确定按钮
|
| | | var btnConfirm = new BottomRightClickButton(frameBack.Width, Application.GetRealHeight(127));
|
| | | frameBack.AddChidren(btnConfirm);
|
| | | btnConfirm.InitControl(buttonOkText);
|
| | |
| | | #endregion |
| | | |
| | | /// <summary>
|
| | | /// UI显示 |
| | | /// UI显示
|
| | | /// </summary> |
| | | public void Show() |
| | | {
|
| | |
| | | |
| | | ClickHandle(); |
| | | |
| | | if (doorLock.IsOnline == 1) |
| | | if (Common.LocalDevice.Current.CheckDeviceIsOnline(doorLock) == true) |
| | | { |
| | | ReadDoorLockUserInfo(); |
| | | } |
| | |
| | | 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, |
| | | }; |
| | |
| | | {
|
| | | return;
|
| | | } |
| | | if (doorLock.IsDoorLockNormallyMode) |
| | | { |
| | | if (doorLock.IsDoorLockNormallyMode)
|
| | | {
|
| | | if (canOpenNormallyMode) |
| | | { |
| | | Application.RunOnMainThread(() => { NomallyOpenModeInvalidDialog(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; |
| | |
| | | { |
| | | if (doorLock.IsDoorLockNormallyMode) |
| | | { |
| | | if (canOpenNormallyMode) |
| | | { |
| | | NomallyOpenModeInvalidDialog(false); |
| | | if (canOpenNormallyMode)
|
| | | {
|
| | | NomallyOpenModeInvalidDialog(false);
|
| | | } |
| | | else |
| | | { |
| | | OpenDoorLockHandle(progressButton, btnDoorLockPic, btnStatus); |
| | | } |
| | | } |
| | | }
|
| | | else |
| | | { |
| | | OpenDoorLockHandle(progressButton, btnDoorLockPic, btnStatus); |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 音量 |
| | | #region 音量 |
| | | /// <summary> |
| | | /// 更新音量 |
| | | /// </summary> |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 常开模式 |
| | | #region 常开模式 |
| | | /// <summary> |
| | | /// 常开模式处理 |
| | | /// </summary> |
| | |
| | | //}; |
| | | }; |
| | | HdlCheckLogic.Current.CheckSecondarySecurity(action); |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 暂时版本 (最终去掉) |
| | | if (!btnNormallyOpen.IsSelected) |
| | |
| | | { |
| | | if (IsFromReport) |
| | | { |
| | | //上报“常开模式”已被取消,app默认了“常开模式”被取消 |
| | | //上报“常开模式”已被取消,app默认了“常开模式”被取消 |
| | | DoorLockCommonInfo.NormallyOpenModeValue(doorLock, false); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | //app默认“常开模式”还是开启 |
| | | //app默认“常开模式”还是开启 |
| | | DoorLockCommonInfo.NormallyOpenModeValue(doorLock, true); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | } |
| | | 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(() => |
| | | { |
| | |
| | | //添加App开启常开模式的历史记录
|
| | | HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog(this.doorLock, 9002, string.Empty); |
| | | |
| | | //app确认取消“常开模式”成功 |
| | | //app确认取消“常开模式”成功 |
| | | DoorLockCommonInfo.NormallyOpenModeValue(doorLock, false); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | 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) |
| | | { |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 开锁处理 |
| | | #region 开锁处理 |
| | | /// <summary> |
| | | /// 开锁处理 |
| | | /// </summary> |
| | |
| | | //设备名字
|
| | | var btnName = frameRow.AddLeftCaption(Common.LocalDevice.Current.GetDeviceEpointName(device), 700);
|
| | | btnName.TextSize = 15;
|
| | | if (device.IsOnline == 0)
|
| | | if (Common.LocalDevice.Current.CheckDeviceIsOnline(device) == false)
|
| | | {
|
| | | btnName.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | }
|
| | |
| | | {
|
| | | for (int j = 0; j < list.Count; j++)
|
| | | {
|
| | | string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(list[i]);
|
| | | string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(list[j]);
|
| | | if (listView.Parent == null || dicData.ContainsKey(mainkeys) == false || listCheck.Contains(mainkeys) == true)
|
| | | {
|
| | | return;
|
| | |
| | | listCheck.Add(mainkeys);
|
| | |
|
| | | var localDevice = Common.LocalDevice.Current.GetDevice(mainkeys);
|
| | | if (localDevice != null && localDevice.IsOnline != list[i].IsOnline)
|
| | | if (localDevice != null && localDevice.IsOnline != list[j].IsOnline)
|
| | | {
|
| | | //在线状态一样的话,不需要刷新
|
| | | localDevice.IsOnline = list[i].IsOnline;
|
| | | localDevice.IsOnline = list[j].IsOnline;
|
| | | localDevice.ReSave();
|
| | | }
|
| | | if (list[i].IsOnline == 1)
|
| | | if (Common.LocalDevice.Current.CheckDeviceIsOnline(list[j]) == true)
|
| | | {
|
| | | dicData[mainkeys].OnlineCount += 1;
|
| | | dicData[mainkeys].btnOnline.Text = dicData[mainkeys].OnlineCount + "/" + dicData[mainkeys].listDeviceKeys.Count;
|
| | |
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | //设置控件的在线状态文本效果
|
| | | control?.SetOnlineStatu(device.IsOnline == 1);
|
| | | bool bolOnline = Common.LocalDevice.Current.CheckDeviceIsOnline(device);
|
| | | control?.SetOnlineStatu(bolOnline);
|
| | | });
|
| | | }
|
| | | }
|
| | |
| | | UserCenterResourse.HideOption.CenterHideMenu = 1;
|
| | | }
|
| | | }
|
| | | if (textValue == "0001a")
|
| | | if (textValue == "1")
|
| | | {
|
| | | var form = new Guide.GuideHouseForm();
|
| | | form.ShowFrom();
|
| | | }
|
| | | if (textValue == "12349")
|
| | | {
|
| | |
| | | } |
| | | } |
| | | |
| | | #region variable |
| | | #region variable |
| | | /// <summary> |
| | | /// 远程连接成功时的时间 |
| | | /// </summary> |
| | |
| | | |
| | | return d; |
| | | }); |
| | | } |
| | | #endregion |
| | | |
| | | #region 获取已入网设备信息 |
| | | /// <summary> |
| | | /// 获取网关设备信息(注意,这个接口会被去掉) |
| | | /// </summary> |
| | | public async System.Threading.Tasks.Task<List<CommonDevice>> GetGwDeviceList() |
| | | { |
| | | DeviceList.Clear();
|
| | | return await System.Threading.Tasks.Task.Run((Func<System.Threading.Tasks.Task<List<CommonDevice>>>)(async () =>
|
| | | {
|
| | | var dateTime = DateTime.Now;
|
| | | bool canBreak = false;
|
| | | Action<string, string> action = (topic, message) =>
|
| | | {
|
| | | var gatewayID = topic.Split('/')[0];
|
| | | var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
|
| | |
|
| | | if (topic == gatewayID + "/" + "DeviceInfoRespon")
|
| | | {
|
| | | dateTime = DateTime.Now;
|
| | | var totalNum = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["TotalNum"].ToString());
|
| | | if (totalNum == 0)
|
| | | {
|
| | | canBreak = true;
|
| | | return;
|
| | | }
|
| | | var deviceID = jobject.Value<int>("Device_ID");
|
| | | switch ((DeviceType)(deviceID))
|
| | | { |
| | | //case DeviceType.DimmableLight: |
| | | // var dimmableLight = new DimmableLight() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; |
| | | // dimmableLight.DeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<DimmableLight.DeviceInfoData>(jobject["Data"].ToString()); |
| | | // if (dimmableLight.DeviceInfo == null) |
| | | // { |
| | | // return; |
| | | // } |
| | | // var light = DeviceList.Find(obj => obj.DeviceID == dimmableLight.DeviceID && obj.DeviceAddr == dimmableLight.DeviceAddr && obj.DeviceEpoint == dimmableLight.DeviceEpoint); |
| | | // if (light == null) |
| | | // { |
| | | // DeviceList.Add(dimmableLight); |
| | | // dimmableLight.DeviceName = dimmableLight.DeviceInfo.MacName; |
| | | // dimmableLight.DeviceEpointName = dimmableLight.DeviceInfo.DeviceName; |
| | | // dimmableLight.ImgVersion = dimmableLight.DeviceInfo.ImgVersion; |
| | | // dimmableLight.HwVersion = dimmableLight.DeviceInfo.HwVersion; |
| | | // dimmableLight.IsOnline = dimmableLight.DeviceInfo.IsOnline; |
| | | // dimmableLight.DriveCode = dimmableLight.DeviceInfo.DriveCode; |
| | | // dimmableLight.ImgTypeId = dimmableLight.DeviceInfo.ImgTypeId; |
| | | // dimmableLight.IasDeviceType = dimmableLight.DeviceInfo.DeviceType; |
| | | // dimmableLight.Profile = dimmableLight.DeviceInfo.Profile; |
| | | // dimmableLight.InClusterList = dimmableLight.DeviceInfo.InClusterList; |
| | | // dimmableLight.OutClusterList = dimmableLight.DeviceInfo.OutClusterList; |
| | | // dimmableLight.AttributeStatus = dimmableLight.DeviceInfo.AttributeStatus; |
| | | // //dimmableLight.Save(); |
| | | // } |
| | | // else |
| | | // { |
| | | // light.DeviceInfo = dimmableLight.DeviceInfo; |
| | | // light.DeviceName = dimmableLight.DeviceInfo.MacName; |
| | | // light.DeviceEpointName = dimmableLight.DeviceInfo.DeviceName; |
| | | // light.ImgVersion = dimmableLight.DeviceInfo.ImgVersion; |
| | | // light.HwVersion = dimmableLight.DeviceInfo.HwVersion; |
| | | // light.IsOnline = dimmableLight.DeviceInfo.IsOnline; |
| | | // light.DriveCode = dimmableLight.DeviceInfo.DriveCode; |
| | | // light.ImgTypeId = dimmableLight.DeviceInfo.ImgTypeId; |
| | | // light.IasDeviceType = dimmableLight.DeviceInfo.DeviceType; |
| | | // light.Profile = dimmableLight.DeviceInfo.Profile; |
| | | // light.InClusterList = dimmableLight.DeviceInfo.InClusterList; |
| | | // light.OutClusterList = dimmableLight.DeviceInfo.OutClusterList; |
| | | // light.AttributeStatus = dimmableLight.DeviceInfo.AttributeStatus; |
| | | // //dimmableLight.ReSave(); |
| | | // } |
| | | // DebugPrintLog($"UI收到通知后的主题_{ topic}"); |
| | | |
| | | // break; |
| | | //case DeviceType.OnOffSwitch: |
| | | // var panel = new Panel() { Time = jobject.Value<int>("Time"), DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; |
| | | // panel.DeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<Panel.DeviceInfoData>(jobject["Data"].ToString()); |
| | | // if (panel.DeviceInfo == null) |
| | | // { |
| | | // return; |
| | | // } |
| | | // var panelInfo = DeviceList.Find(obj => obj.DeviceID == panel.DeviceID && obj.DeviceAddr == panel.DeviceAddr && obj.DeviceEpoint == panel.DeviceEpoint); |
| | | // if (panelInfo == null) |
| | | // { |
| | | // DeviceList.Add(panel); |
| | | // panel.DeviceName = panel.DeviceInfo.MacName; |
| | | // panel.DeviceEpointName = panel.DeviceInfo.DeviceName; |
| | | // panel.ImgTypeId = panel.DeviceInfo.ImgTypeId; |
| | | // panel.ImgVersion = panel.DeviceInfo.ImgVersion; |
| | | // panel.HwVersion = panel.DeviceInfo.HwVersion; |
| | | // panel.IasDeviceType = panel.DeviceInfo.DeviceType; |
| | | // panel.IsOnline = panel.DeviceInfo.IsOnline; |
| | | // panel.DriveCode = panel.DeviceInfo.DriveCode; |
| | | // panel.Profile = panel.DeviceInfo.Profile; |
| | | // panel.InClusterList = panel.DeviceInfo.InClusterList; |
| | | // panel.OutClusterList = panel.DeviceInfo.OutClusterList; |
| | | // panel.AttributeStatus = panel.DeviceInfo.AttributeStatus; |
| | | // //panel.Save(); |
| | | // } |
| | | // else |
| | | // { |
| | | // panelInfo.DeviceInfo = panel.DeviceInfo; |
| | | // panelInfo.DeviceName = panel.DeviceInfo.MacName; |
| | | // panelInfo.DeviceEpointName = panel.DeviceInfo.DeviceName; |
| | | // panelInfo.ImgVersion = panel.DeviceInfo.ImgVersion; |
| | | // panelInfo.HwVersion = panel.DeviceInfo.HwVersion; |
| | | // panelInfo.IsOnline = panel.DeviceInfo.IsOnline; |
| | | // panelInfo.DriveCode = panel.DeviceInfo.DriveCode; |
| | | // panelInfo.IasDeviceType = panel.DeviceInfo.DeviceType; |
| | | // panelInfo.Profile = panel.DeviceInfo.Profile; |
| | | // panelInfo.ImgTypeId = panel.DeviceInfo.ImgTypeId; |
| | | // panelInfo.InClusterList = panel.DeviceInfo.InClusterList; |
| | | // panelInfo.OutClusterList = panel.DeviceInfo.OutClusterList; |
| | | // panelInfo.AttributeStatus = panel.DeviceInfo.AttributeStatus; |
| | | // //panel.ReSave(); |
| | | // } |
| | | // DebugPrintLog($"UI收到通知后的主题_{ topic}"); |
| | | |
| | | // break; |
| | | //case DeviceType.OnOffOutput: |
| | | // var toggleLight = new ToggleLight() { Time = jobject.Value<int>("Time"), DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; |
| | | // toggleLight.DeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<ToggleLight.DeviceInfoData>(jobject["Data"].ToString()); |
| | | // if (toggleLight.DeviceInfo == null) |
| | | // { |
| | | // return; |
| | | // } |
| | | // var toggleLightInfo = DeviceList.Find(obj => obj.DeviceID == toggleLight.DeviceID && obj.DeviceAddr == toggleLight.DeviceAddr && obj.DeviceEpoint == toggleLight.DeviceEpoint); |
| | | // if (toggleLightInfo == null) |
| | | // { |
| | | // DeviceList.Add(toggleLight); |
| | | // toggleLight.DeviceName = toggleLight.DeviceInfo.MacName; |
| | | // toggleLight.DeviceEpointName = toggleLight.DeviceInfo.DeviceName; |
| | | // toggleLight.ImgVersion = toggleLight.DeviceInfo.ImgVersion; |
| | | // toggleLight.HwVersion = toggleLight.DeviceInfo.HwVersion; |
| | | // toggleLight.IsOnline = toggleLight.DeviceInfo.IsOnline; |
| | | // toggleLight.DriveCode = toggleLight.DeviceInfo.DriveCode; |
| | | // toggleLight.IasDeviceType = toggleLight.DeviceInfo.DeviceType; |
| | | // toggleLight.Profile = toggleLight.DeviceInfo.Profile; |
| | | // toggleLight.ImgTypeId = toggleLight.DeviceInfo.ImgTypeId; |
| | | // toggleLight.InClusterList = toggleLight.DeviceInfo.InClusterList; |
| | | // toggleLight.OutClusterList = toggleLight.DeviceInfo.OutClusterList; |
| | | // toggleLight.AttributeStatus = toggleLight.DeviceInfo.AttributeStatus; |
| | | // //toggleLight.Save(); |
| | | // } |
| | | // else |
| | | // { |
| | | // toggleLightInfo.DeviceName = toggleLight.DeviceInfo.MacName; |
| | | // toggleLightInfo.DeviceEpointName = toggleLight.DeviceInfo.DeviceName; |
| | | // toggleLightInfo.ImgVersion = toggleLight.DeviceInfo.ImgVersion; |
| | | // toggleLightInfo.HwVersion = toggleLight.DeviceInfo.HwVersion; |
| | | // toggleLightInfo.IsOnline = toggleLight.DeviceInfo.IsOnline; |
| | | // toggleLightInfo.DriveCode = toggleLight.DeviceInfo.DriveCode; |
| | | // toggleLightInfo.IasDeviceType = toggleLight.DeviceInfo.DeviceType; |
| | | // toggleLightInfo.Profile = toggleLight.DeviceInfo.Profile; |
| | | // toggleLightInfo.ImgTypeId = toggleLight.DeviceInfo.ImgTypeId; |
| | | // toggleLightInfo.InClusterList = toggleLight.DeviceInfo.InClusterList; |
| | | // toggleLightInfo.OutClusterList = toggleLight.DeviceInfo.OutClusterList; |
| | | // toggleLightInfo.AttributeStatus = toggleLight.DeviceInfo.AttributeStatus; |
| | | // toggleLightInfo.DeviceInfo = toggleLight.DeviceInfo; |
| | | // //toggleLightInfo.ReSave(); |
| | | // } |
| | | // DebugPrintLog($"UI收到通知后的主题_{ topic}"); |
| | | |
| | | // break; |
| | | //case DeviceType.AirSwitch: |
| | | // var airSwitch = new AirSwitch() { Time = jobject.Value<int>("Time"), DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; |
| | | // airSwitch.DeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<AirSwitch.DeviceInfoData>(jobject["Data"].ToString()); |
| | | // if (airSwitch.DeviceInfo == null) |
| | | // { |
| | | // return; |
| | | // } |
| | | // var airSwitchInfo = DeviceList.Find(obj => obj.DeviceID == airSwitch.DeviceID && obj.DeviceAddr == airSwitch.DeviceAddr && obj.DeviceEpoint == airSwitch.DeviceEpoint); |
| | | // if (airSwitchInfo == null) |
| | | // { |
| | | // DeviceList.Add(airSwitch); |
| | | // airSwitch.DeviceName = airSwitch.DeviceInfo.MacName; |
| | | // airSwitch.DeviceEpointName = airSwitch.DeviceInfo.DeviceName; |
| | | // airSwitch.ImgVersion = airSwitch.DeviceInfo.ImgVersion; |
| | | // airSwitch.HwVersion = airSwitch.DeviceInfo.HwVersion; |
| | | // airSwitch.IsOnline = airSwitch.DeviceInfo.IsOnline; |
| | | // airSwitch.DriveCode = airSwitch.DeviceInfo.DriveCode; |
| | | // airSwitch.IasDeviceType = airSwitch.DeviceInfo.DeviceType; |
| | | // airSwitch.Profile = airSwitch.DeviceInfo.Profile; |
| | | // airSwitch.ImgTypeId = airSwitch.DeviceInfo.ImgTypeId; |
| | | // airSwitch.InClusterList = airSwitch.DeviceInfo.InClusterList; |
| | | // airSwitch.OutClusterList = airSwitch.DeviceInfo.OutClusterList; |
| | | // airSwitch.AttributeStatus = airSwitch.DeviceInfo.AttributeStatus; |
| | | // //airSwitch.Save(); |
| | | // } |
| | | // else |
| | | // { |
| | | // airSwitchInfo.DeviceName = airSwitch.DeviceInfo.MacName; |
| | | // airSwitchInfo.DeviceEpointName = airSwitch.DeviceInfo.DeviceName; |
| | | // airSwitchInfo.ImgVersion = airSwitch.DeviceInfo.ImgVersion; |
| | | // airSwitchInfo.HwVersion = airSwitch.DeviceInfo.HwVersion; |
| | | // airSwitchInfo.IsOnline = airSwitch.DeviceInfo.IsOnline; |
| | | // airSwitchInfo.DriveCode = airSwitch.DeviceInfo.DriveCode; |
| | | // airSwitchInfo.IasDeviceType = airSwitch.DeviceInfo.DeviceType; |
| | | // airSwitchInfo.Profile = airSwitch.DeviceInfo.Profile; |
| | | // airSwitchInfo.ImgTypeId = airSwitch.DeviceInfo.ImgTypeId; |
| | | // airSwitchInfo.InClusterList = airSwitch.DeviceInfo.InClusterList; |
| | | // airSwitchInfo.OutClusterList = airSwitch.DeviceInfo.OutClusterList; |
| | | // airSwitchInfo.AttributeStatus = airSwitch.DeviceInfo.AttributeStatus; |
| | | // airSwitchInfo.DeviceInfo = airSwitch.DeviceInfo; |
| | | // // airSwitchInfo.ReSave(); |
| | | // } |
| | | // DebugPrintLog($"UI收到通知后的主题_{ topic}"); |
| | | |
| | | // break; |
| | | //case DeviceType.WindowCoveringDevice: |
| | | // var windowCovering = new Rollershade() { DeviceID = jobject.Value<int>((object)"Device_ID"), DeviceAddr = jobject.Value<string>((object)"DeviceAddr"), DeviceEpoint = jobject.Value<int>((object)"Epoint"), DataID = jobject.Value<int>((object)"Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; |
| | | // windowCovering.DeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<Rollershade.DeviceInfoData>(jobject["Data"].ToString()); |
| | | // if (windowCovering.DeviceInfo == null) |
| | | // { |
| | | // return; |
| | | // } |
| | | // var wc = DeviceList.Find(obj => obj.DeviceID == windowCovering.DeviceID && obj.DeviceAddr == windowCovering.DeviceAddr && obj.DeviceEpoint == windowCovering.DeviceEpoint); |
| | | // if (wc == null) |
| | | // { |
| | | // DeviceList.Add(windowCovering); |
| | | // windowCovering.DeviceName = windowCovering.DeviceInfo.MacName; |
| | | // windowCovering.DeviceEpointName = windowCovering.DeviceInfo.DeviceName; |
| | | // windowCovering.ImgVersion = windowCovering.DeviceInfo.ImgVersion; |
| | | // windowCovering.HwVersion = windowCovering.DeviceInfo.HwVersion; |
| | | // windowCovering.IsOnline = windowCovering.DeviceInfo.IsOnline; |
| | | // windowCovering.DriveCode = windowCovering.DeviceInfo.DriveCode; |
| | | // windowCovering.IasDeviceType = windowCovering.DeviceInfo.DeviceType; |
| | | // windowCovering.Profile = windowCovering.DeviceInfo.Profile; |
| | | // windowCovering.ImgTypeId = windowCovering.DeviceInfo.ImgTypeId; |
| | | // windowCovering.InClusterList = windowCovering.DeviceInfo.InClusterList; |
| | | // windowCovering.OutClusterList = windowCovering.DeviceInfo.OutClusterList; |
| | | // windowCovering.AttributeStatus = windowCovering.DeviceInfo.AttributeStatus; |
| | | // //windowCovering.Save(); |
| | | // } |
| | | // else |
| | | // { |
| | | // wc.DeviceName = windowCovering.DeviceInfo.MacName; |
| | | // wc.DeviceEpointName = windowCovering.DeviceInfo.DeviceName; |
| | | // wc.DeviceInfo = windowCovering.DeviceInfo; |
| | | // wc.ImgVersion = windowCovering.DeviceInfo.ImgVersion; |
| | | // wc.HwVersion = windowCovering.DeviceInfo.HwVersion; |
| | | // wc.IsOnline = windowCovering.DeviceInfo.IsOnline; |
| | | // wc.DriveCode = windowCovering.DeviceInfo.DriveCode; |
| | | // wc.IasDeviceType = windowCovering.DeviceInfo.DeviceType; |
| | | // wc.Profile = windowCovering.DeviceInfo.Profile; |
| | | // wc.ImgTypeId = windowCovering.DeviceInfo.ImgTypeId; |
| | | // wc.InClusterList = windowCovering.DeviceInfo.InClusterList; |
| | | // wc.OutClusterList = windowCovering.DeviceInfo.OutClusterList; |
| | | // wc.AttributeStatus = windowCovering.DeviceInfo.AttributeStatus; |
| | | // // wc.ReSave(); |
| | | // } |
| | | // DebugPrintLog($"UI收到通知后的主题_{ topic}"); |
| | | // break; |
| | | //case DeviceType.IASZone: |
| | | // var ias = new IASZone() { Time = jobject.Value<int>("Time"), DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; |
| | | // ias.DeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<IASZone.DeviceInfoData>(jobject["Data"].ToString()); |
| | | // if (ias.DeviceInfo == null) |
| | | // { |
| | | // return; |
| | | // } |
| | | // var infoIAS = DeviceList.Find(obj => obj.DeviceID == ias.DeviceID && obj.DeviceAddr == ias.DeviceAddr && obj.DeviceEpoint == ias.DeviceEpoint); |
| | | // if (infoIAS == null) |
| | | // { |
| | | // DeviceList.Add(ias); |
| | | // ias.DeviceName = ias.DeviceInfo.MacName; |
| | | // ias.DeviceEpointName = ias.DeviceInfo.DeviceName; |
| | | // ias.ImgVersion = ias.DeviceInfo.ImgVersion; |
| | | // ias.HwVersion = ias.DeviceInfo.HwVersion; |
| | | // ias.IsOnline = ias.DeviceInfo.IsOnline; |
| | | // ias.DriveCode = ias.DeviceInfo.DriveCode; |
| | | // ias.IasDeviceType = ias.DeviceInfo.DeviceType; |
| | | // ias.Profile = ias.DeviceInfo.Profile; |
| | | // ias.ImgTypeId = ias.DeviceInfo.ImgTypeId; |
| | | // ias.InClusterList = ias.DeviceInfo.InClusterList; |
| | | // ias.OutClusterList = ias.DeviceInfo.OutClusterList; |
| | | // ias.AttributeStatus = ias.DeviceInfo.AttributeStatus; |
| | | // //ias.Save(); |
| | | // } |
| | | // else |
| | | // { |
| | | // infoIAS.DeviceName = ias.DeviceInfo.MacName; |
| | | // infoIAS.DeviceEpointName = ias.DeviceInfo.DeviceName; |
| | | // infoIAS.DeviceEpointName = ias.DeviceInfo.DeviceName; |
| | | // infoIAS.ImgVersion = ias.DeviceInfo.ImgVersion; |
| | | // infoIAS.HwVersion = ias.DeviceInfo.HwVersion; |
| | | // infoIAS.IsOnline = ias.DeviceInfo.IsOnline; |
| | | // infoIAS.DriveCode = ias.DeviceInfo.DriveCode; |
| | | // infoIAS.IasDeviceType = ias.DeviceInfo.DeviceType; |
| | | // infoIAS.Profile = ias.DeviceInfo.Profile; |
| | | // infoIAS.ImgTypeId = ias.DeviceInfo.ImgTypeId; |
| | | // infoIAS.InClusterList = ias.DeviceInfo.InClusterList; |
| | | // infoIAS.OutClusterList = ias.DeviceInfo.OutClusterList; |
| | | // infoIAS.AttributeStatus = ias.DeviceInfo.AttributeStatus; |
| | | // infoIAS.DeviceInfo = ias.DeviceInfo; |
| | | // //ias.ReSave(); |
| | | // } |
| | | // DebugPrintLog($"UI收到通知后的主题_{ topic}"); |
| | | // break; |
| | | //case DeviceType.OtaDevice: |
| | | //case DeviceType.OtaPanelDevice: |
| | | //var ota = new OTADevice() { Time = jobject.Value<int>("Time"), DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = this.getGatewayBaseInfo?.gwID }; |
| | | //ota.DeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<DeviceInfoData>(jobject["Data"].ToString()); |
| | | //if (ota.DeviceInfo == null) |
| | | //{ |
| | | // return; |
| | | //} |
| | | //var infoOta = DeviceList.Find(obj => obj.DeviceID == ota.DeviceID && obj.DeviceAddr == ota.DeviceAddr && obj.DeviceEpoint == ota.DeviceEpoint); |
| | | //if (infoOta == null) |
| | | //{ |
| | | // DeviceList.Add(ota); |
| | | // ota.DeviceName = ota.DeviceInfo.MacName; |
| | | // ota.DeviceEpointName = ota.DeviceInfo.DeviceName; |
| | | // ota.ImgVersion = ota.DeviceInfo.ImgVersion; |
| | | // ota.HwVersion = ota.DeviceInfo.HwVersion; |
| | | // ota.IsOnline = ota.DeviceInfo.IsOnline; |
| | | // ota.DriveCode = ota.DeviceInfo.DriveCode; |
| | | // ota.IasDeviceType = ota.DeviceInfo.DeviceType; |
| | | // ota.Profile = ota.DeviceInfo.Profile; |
| | | // ota.ImgTypeId = ota.DeviceInfo.ImgTypeId; |
| | | // ota.InClusterList = ota.DeviceInfo.InClusterList; |
| | | // ota.OutClusterList = ota.DeviceInfo.OutClusterList; |
| | | // ota.AttributeStatus = ota.DeviceInfo.AttributeStatus; |
| | | // //ota.Save(); |
| | | //} |
| | | //else |
| | | //{ |
| | | // infoOta.DeviceName = ota.DeviceInfo.MacName; |
| | | // infoOta.DeviceEpointName = ota.DeviceInfo.DeviceName; |
| | | // infoOta.DeviceEpointName = ota.DeviceInfo.DeviceName; |
| | | // infoOta.ImgVersion = ota.DeviceInfo.ImgVersion; |
| | | // infoOta.HwVersion = ota.DeviceInfo.HwVersion; |
| | | // infoOta.IsOnline = ota.DeviceInfo.IsOnline; |
| | | // infoOta.DriveCode = ota.DeviceInfo.DriveCode; |
| | | // infoOta.IasDeviceType = ota.DeviceInfo.DeviceType; |
| | | // infoOta.Profile = ota.DeviceInfo.Profile; |
| | | // infoOta.ImgTypeId = ota.DeviceInfo.ImgTypeId; |
| | | // infoOta.InClusterList = ota.DeviceInfo.InClusterList; |
| | | // infoOta.OutClusterList = ota.DeviceInfo.OutClusterList; |
| | | // infoOta.AttributeStatus = ota.DeviceInfo.AttributeStatus; |
| | | // infoOta.DeviceInfo = ota.DeviceInfo; |
| | | // //ota.ReSave(); |
| | | //} |
| | | //DebugPrintLog($"UI收到通知后的主题_{ topic}"); |
| | | //break; |
| | | //case DeviceType.Thermostat: |
| | | //var thermostat = new ThermostatObj() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; |
| | | //thermostat.DeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<ThermostatObj.DeviceInfoData>(jobject["Data"].ToString()); |
| | | //if (thermostat.DeviceInfo == null) |
| | | //{ |
| | | // return; |
| | | //} |
| | | //var ther = gateway.DeviceList.Find(obj => obj.DeviceID == thermostat.DeviceID && obj.DeviceAddr == thermostat.DeviceAddr && obj.DeviceEpoint == thermostat.DeviceEpoint); |
| | | //if (ther == null) |
| | | //{ |
| | | // gateway.DeviceList.Add(thermostat); |
| | | // thermostat.DeviceName = thermostat.DeviceInfo.DeviceName; |
| | | // IO.LocalFileUtils.SaveDeviceInfo(thermostat, thermostat.DeviceEpoint.ToString()); |
| | | //} |
| | | //else |
| | | //{ |
| | | // ther.DeviceName = thermostat.DeviceInfo.DeviceName; |
| | | // ther.DeviceInfo = thermostat.DeviceInfo; |
| | | // ZigBee.IO.LocalFileUtils.SaveDeviceInfo(ther, ther.DeviceEpoint.ToString()); |
| | | //} |
| | | //break; |
| | | //case DeviceType.TemperatureSensor: |
| | | //var temperatureSensor = new TemperatureSensor() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; |
| | | //temperatureSensor.DeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<TemperatureSensor.DeviceInfoData>(jobject["Data"].ToString()); |
| | | //if (temperatureSensor.DeviceInfo == null) |
| | | //{ |
| | | // return; |
| | | //} |
| | | //var ts = gateway.DeviceList.Find(obj => obj.DeviceID == temperatureSensor.DeviceID && obj.DeviceAddr == temperatureSensor.DeviceAddr && obj.DeviceEpoint == temperatureSensor.DeviceEpoint); |
| | | //if (ts == null) |
| | | //{ |
| | | // gateway.DeviceList.Add(temperatureSensor); |
| | | // temperatureSensor.DeviceName = temperatureSensor.DeviceInfo.DeviceName; |
| | | // IO.LocalFileUtils.SaveDeviceInfo(temperatureSensor, temperatureSensor.DeviceEpoint.ToString()); |
| | | //} |
| | | //else |
| | | //{ |
| | | // ts.DeviceName = temperatureSensor.DeviceInfo.DeviceName; |
| | | // ts.DeviceInfo = temperatureSensor.DeviceInfo; |
| | | // IO.LocalFileUtils.SaveDeviceInfo(ts, ts.DeviceEpoint.ToString()); |
| | | //} |
| | | //break; |
| | | |
| | | }
|
| | | }
|
| | | else if (topic == gatewayID + "/" + "DeviceInfoResponEnd")
|
| | | {
|
| | | canBreak = true;
|
| | | }
|
| | | };
|
| | |
|
| | | Actions += action;
|
| | | DebugPrintLog("DeviceInfo Actions 启动" + "_" + System.DateTime.Now.ToString());
|
| | |
|
| | | try
|
| | | {
|
| | | var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 93 } };
|
| | | Send("GetDeviceInfo", jObject.ToString());
|
| | | }
|
| | | catch { }
|
| | |
|
| | | while (canBreak == false && (DateTime.Now - dateTime).TotalMilliseconds < 6000)
|
| | | {
|
| | | await System.Threading.Tasks.Task.Delay(10);
|
| | | }
|
| | |
|
| | | Actions -= action;
|
| | | DebugPrintLog("DeviceInfo_Actions 退出" + System.DateTime.Now.ToString());
|
| | | return DeviceList;
|
| | | })); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | await RemoteMqttClient.DisconnectAsync();
|
| | | }
|
| | | }
|
| | | catch (Exception e) |
| | | catch (Exception e)
|
| | | { |
| | | DebugPrintLog($"Remote断开通讯连接出异常:{e.Message}");
|
| | | }
|
| | |
| | | }
|
| | | #endregion |
| | |
|
| | | #region 获取所有网关的节点设备信息(用于主网关) |
| | | ///// <summary>
|
| | | ///// 获取所有网关的节点设备信息(用于主网关)
|
| | | ///// </summary>
|
| | | //public static async System.Threading.Tasks.Task<List<CommonDevice>> GetAllGatewayDeviceInfoList()
|
| | | //{
|
| | | // if (ZbGateway.MainGateWay == null)
|
| | | // {
|
| | | // return null;
|
| | | // }
|
| | | // ZbGateway.MainGateWay.AllGatewayDeviceList.Clear();
|
| | | // return await System.Threading.Tasks.Task.Run((Func<System.Threading.Tasks.Task<List<CommonDevice>>>)(async () =>
|
| | | // {
|
| | | // var dateTime = DateTime.Now;
|
| | | // Action<string, string> action = (topic, message) =>
|
| | | // {
|
| | |
|
| | | // var gatewayID = topic.Split('/')[0];
|
| | | // var jobject = Newtonsoft.Json.Linq.JObject.Parse(message);
|
| | | // if (topic == gatewayID + "/" + "DeviceInfoRespon")
|
| | | // {
|
| | | // dateTime = DateTime.Now;
|
| | | // var deviceID = jobject.Value<int>("Device_ID");
|
| | | // switch ((DeviceType)(deviceID))
|
| | | // {
|
| | | // case DeviceType.ColorDimmableLight:
|
| | | // var dimmableLight = new ColorDimmableLight() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID") };
|
| | | // dimmableLight.getAllGatewayDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<ColorDimmableLight.AllGatewayDeviceInfo>(jobject["Data"].ToString());
|
| | | // if (dimmableLight.getAllGatewayDeviceInfo == null)
|
| | | // {
|
| | | // return;
|
| | | // }
|
| | | // dimmableLight.CurrentGateWayId = dimmableLight.getAllGatewayDeviceInfo.GwId;
|
| | | // var light = ZbGateway.MainGateWay.AllGatewayDeviceList.Find(obj => obj.DeviceID == dimmableLight.DeviceID && obj.DeviceAddr == dimmableLight.DeviceAddr && obj.DeviceEpoint == dimmableLight.DeviceEpoint);
|
| | | // if (light == null)
|
| | | // {
|
| | | // ZbGateway.MainGateWay.AllGatewayDeviceList.Add(dimmableLight);
|
| | | // dimmableLight.DeviceName = dimmableLight.getAllGatewayDeviceInfo.MacName;
|
| | | // dimmableLight.DeviceEpointName = dimmableLight.getAllGatewayDeviceInfo.DeviceName;
|
| | | // dimmableLight.ImgVersion = dimmableLight.getAllGatewayDeviceInfo.ImgVersion;
|
| | | // dimmableLight.IsOnline = dimmableLight.getAllGatewayDeviceInfo.IsOnline;
|
| | | // dimmableLight.IasDeviceType = dimmableLight.getAllGatewayDeviceInfo.DeviceType;
|
| | | // dimmableLight.Profile = dimmableLight.getAllGatewayDeviceInfo.Profile;
|
| | | // dimmableLight.ImgTypeId = dimmableLight.getAllGatewayDeviceInfo.ImgTypeId;
|
| | | // dimmableLight.InClusterList = dimmableLight.getAllGatewayDeviceInfo.InClusterList;
|
| | | // dimmableLight.OutClusterList = dimmableLight.getAllGatewayDeviceInfo.OutClusterList;
|
| | | // dimmableLight.AttributeStatus = dimmableLight.getAllGatewayDeviceInfo.AttributeStatus;
|
| | | // dimmableLight.Save();
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // light.getAllGatewayDeviceInfo = dimmableLight.getAllGatewayDeviceInfo;
|
| | | // light.DeviceName = dimmableLight.getAllGatewayDeviceInfo.MacName;
|
| | | // light.DeviceEpointName = dimmableLight.getAllGatewayDeviceInfo.DeviceName;
|
| | | // light.ImgVersion = dimmableLight.getAllGatewayDeviceInfo.ImgVersion;
|
| | | // light.IsOnline = dimmableLight.getAllGatewayDeviceInfo.IsOnline;
|
| | | // light.IasDeviceType = dimmableLight.getAllGatewayDeviceInfo.DeviceType;
|
| | | // light.Profile = dimmableLight.getAllGatewayDeviceInfo.Profile;
|
| | | // light.ImgTypeId = dimmableLight.getAllGatewayDeviceInfo.ImgTypeId;
|
| | | // light.InClusterList = dimmableLight.getAllGatewayDeviceInfo.InClusterList;
|
| | | // light.OutClusterList = dimmableLight.getAllGatewayDeviceInfo.OutClusterList;
|
| | | // light.AttributeStatus = dimmableLight.getAllGatewayDeviceInfo.AttributeStatus;
|
| | | // light.ReSave();
|
| | | // }
|
| | | // System.Console.WriteLine($"收到通知后的主题_{ topic}");
|
| | |
|
| | | // break;
|
| | | // case DeviceType.OnOffOutput:
|
| | | // var toggleLight = new ToggleLight() { Time = jobject.Value<int>("Time"), DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID") };
|
| | | // toggleLight.getAllGatewayDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<ToggleLight.AllGatewayDeviceInfo>(jobject["Data"].ToString());
|
| | | // if (toggleLight.getAllGatewayDeviceInfo == null)
|
| | | // {
|
| | | // return;
|
| | | // }
|
| | | // toggleLight.CurrentGateWayId = toggleLight.getAllGatewayDeviceInfo.GwId;
|
| | |
|
| | | // var localToggleLight = ZbGateway.MainGateWay.AllGatewayDeviceList.Find(obj => obj.DeviceID == toggleLight.DeviceID && obj.DeviceAddr == toggleLight.DeviceAddr && obj.DeviceEpoint == toggleLight.DeviceEpoint);
|
| | | // if (localToggleLight == null)
|
| | | // {
|
| | | // toggleLight.DeviceName = toggleLight.getAllGatewayDeviceInfo.MacName;
|
| | | // toggleLight.DeviceEpointName = toggleLight.getAllGatewayDeviceInfo.DeviceName;
|
| | | // toggleLight.ImgVersion = toggleLight.getAllGatewayDeviceInfo.ImgVersion;
|
| | | // toggleLight.IsOnline = toggleLight.getAllGatewayDeviceInfo.IsOnline;
|
| | | // toggleLight.IasDeviceType = toggleLight.getAllGatewayDeviceInfo.DeviceType;
|
| | | // toggleLight.Profile = toggleLight.getAllGatewayDeviceInfo.Profile;
|
| | | // toggleLight.ImgTypeId = toggleLight.getAllGatewayDeviceInfo.ImgTypeId;
|
| | | // toggleLight.InClusterList = toggleLight.getAllGatewayDeviceInfo.InClusterList;
|
| | | // toggleLight.OutClusterList = toggleLight.getAllGatewayDeviceInfo.OutClusterList;
|
| | | // toggleLight.AttributeStatus = toggleLight.getAllGatewayDeviceInfo.AttributeStatus;
|
| | | // ZbGateway.MainGateWay.AllGatewayDeviceList.Add(toggleLight);
|
| | | // toggleLight.Save();
|
| | |
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // localToggleLight.getAllGatewayDeviceInfo = toggleLight.getAllGatewayDeviceInfo;
|
| | | // localToggleLight.DeviceName = toggleLight.getAllGatewayDeviceInfo.MacName;
|
| | | // localToggleLight.DeviceEpointName = toggleLight.getAllGatewayDeviceInfo.DeviceName;
|
| | | // localToggleLight.ImgVersion = toggleLight.getAllGatewayDeviceInfo.ImgVersion;
|
| | | // localToggleLight.IsOnline = toggleLight.getAllGatewayDeviceInfo.IsOnline;
|
| | | // localToggleLight.IasDeviceType = toggleLight.getAllGatewayDeviceInfo.DeviceType;
|
| | | // localToggleLight.Profile = toggleLight.getAllGatewayDeviceInfo.Profile;
|
| | | // localToggleLight.ImgTypeId = toggleLight.getAllGatewayDeviceInfo.ImgTypeId;
|
| | | // localToggleLight.InClusterList = toggleLight.getAllGatewayDeviceInfo.InClusterList;
|
| | | // localToggleLight.OutClusterList = toggleLight.getAllGatewayDeviceInfo.OutClusterList;
|
| | | // localToggleLight.AttributeStatus = toggleLight.getAllGatewayDeviceInfo.AttributeStatus;
|
| | | // localToggleLight.ReSave();
|
| | | // }
|
| | | // System.Console.WriteLine($"收到通知后的主题_{ topic}");
|
| | |
|
| | | // break;
|
| | | // case DeviceType.OnOffSwitch:
|
| | | // var panel = new Panel() { Time = jobject.Value<int>("Time"), DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID") };
|
| | | // panel.getAllGatewayDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<Panel.AllGatewayDeviceInfo>(jobject["Data"].ToString());
|
| | | // if (panel.getAllGatewayDeviceInfo == null)
|
| | | // {
|
| | | // return;
|
| | | // }
|
| | | // panel.CurrentGateWayId = panel.getAllGatewayDeviceInfo.GwId;
|
| | |
|
| | | // var localPanel = ZbGateway.MainGateWay.AllGatewayDeviceList.Find(obj => obj.DeviceID == panel.DeviceID && obj.DeviceAddr == panel.DeviceAddr && obj.DeviceEpoint == panel.DeviceEpoint);
|
| | | // if (localPanel == null)
|
| | | // {
|
| | | // panel.DeviceName = panel.getAllGatewayDeviceInfo.MacName;
|
| | | // panel.DeviceEpointName = panel.getAllGatewayDeviceInfo.DeviceName;
|
| | | // panel.ImgVersion = panel.getAllGatewayDeviceInfo.ImgVersion;
|
| | | // panel.IsOnline = panel.getAllGatewayDeviceInfo.IsOnline;
|
| | | // panel.IasDeviceType = panel.getAllGatewayDeviceInfo.DeviceType;
|
| | | // panel.Profile = panel.getAllGatewayDeviceInfo.Profile;
|
| | | // panel.ImgTypeId = panel.getAllGatewayDeviceInfo.ImgTypeId;
|
| | | // panel.InClusterList = panel.getAllGatewayDeviceInfo.InClusterList;
|
| | | // panel.OutClusterList = panel.getAllGatewayDeviceInfo.OutClusterList;
|
| | | // panel.AttributeStatus = panel.getAllGatewayDeviceInfo.AttributeStatus;
|
| | | // if (panel.DeviceAddr != null)
|
| | | // {
|
| | | // ZbGateway.MainGateWay.AllGatewayDeviceList.Add(panel);
|
| | | // }
|
| | | // panel.Save();
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // localPanel.getAllGatewayDeviceInfo = panel.getAllGatewayDeviceInfo;
|
| | | // localPanel.DeviceName = panel.getAllGatewayDeviceInfo.MacName;
|
| | | // localPanel.DeviceEpointName = panel.getAllGatewayDeviceInfo.DeviceName;
|
| | | // localPanel.ImgVersion = panel.getAllGatewayDeviceInfo.ImgVersion;
|
| | | // localPanel.IsOnline = panel.getAllGatewayDeviceInfo.IsOnline;
|
| | | // localPanel.IasDeviceType = panel.getAllGatewayDeviceInfo.DeviceType;
|
| | | // localPanel.Profile = panel.getAllGatewayDeviceInfo.Profile;
|
| | | // localPanel.ImgTypeId = panel.getAllGatewayDeviceInfo.ImgTypeId;
|
| | | // localPanel.InClusterList = panel.getAllGatewayDeviceInfo.InClusterList;
|
| | | // localPanel.OutClusterList = panel.getAllGatewayDeviceInfo.OutClusterList;
|
| | | // localPanel.AttributeStatus = panel.getAllGatewayDeviceInfo.AttributeStatus;
|
| | | // localPanel.ReSave();
|
| | | // }
|
| | | // System.Console.WriteLine($"收到通知后的主题_{ topic}");
|
| | |
|
| | | // break;
|
| | | // case DeviceType.WindowCoveringDevice:
|
| | | // var windowCovering = new Rollershade() { DeviceID = jobject.Value<int>((object)"Device_ID"), DeviceAddr = jobject.Value<string>((object)"DeviceAddr"), DeviceEpoint = jobject.Value<int>((object)"Epoint"), DataID = jobject.Value<int>((object)"Data_ID") };
|
| | | // windowCovering.getAllGatewayDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<Rollershade.AllGatewayDeviceInfo>(jobject["Data"].ToString());
|
| | | // if (windowCovering.getAllGatewayDeviceInfo == null)
|
| | | // {
|
| | | // return;
|
| | | // }
|
| | | // windowCovering.CurrentGateWayId = windowCovering.getAllGatewayDeviceInfo.GwId;
|
| | |
|
| | | // var wc = ZbGateway.MainGateWay.AllGatewayDeviceList.Find(obj => obj.DeviceID == windowCovering.DeviceID && obj.DeviceAddr == windowCovering.DeviceAddr && obj.DeviceEpoint == windowCovering.DeviceEpoint);
|
| | | // if (wc == null)
|
| | | // {
|
| | | // windowCovering.DeviceName = windowCovering.getAllGatewayDeviceInfo.MacName;
|
| | | // windowCovering.DeviceEpointName = windowCovering.getAllGatewayDeviceInfo.DeviceName;
|
| | | // windowCovering.ImgVersion = windowCovering.getAllGatewayDeviceInfo.ImgVersion;
|
| | | // windowCovering.IsOnline = windowCovering.getAllGatewayDeviceInfo.IsOnline;
|
| | | // windowCovering.IasDeviceType = windowCovering.getAllGatewayDeviceInfo.DeviceType;
|
| | | // windowCovering.Profile = windowCovering.getAllGatewayDeviceInfo.Profile;
|
| | | // windowCovering.ImgTypeId = windowCovering.getAllGatewayDeviceInfo.ImgTypeId;
|
| | | // windowCovering.InClusterList = windowCovering.getAllGatewayDeviceInfo.InClusterList;
|
| | | // windowCovering.OutClusterList = windowCovering.getAllGatewayDeviceInfo.OutClusterList;
|
| | | // windowCovering.AttributeStatus = windowCovering.getAllGatewayDeviceInfo.AttributeStatus;
|
| | | // ZbGateway.MainGateWay.AllGatewayDeviceList.Add(windowCovering);
|
| | | // windowCovering.Save();
|
| | |
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // wc.getAllGatewayDeviceInfo = windowCovering.getAllGatewayDeviceInfo;
|
| | | // wc.DeviceName = windowCovering.getAllGatewayDeviceInfo.MacName;
|
| | | // wc.DeviceEpointName = windowCovering.getAllGatewayDeviceInfo.DeviceName;
|
| | | // wc.ImgVersion = windowCovering.getAllGatewayDeviceInfo.ImgVersion;
|
| | | // wc.IsOnline = windowCovering.getAllGatewayDeviceInfo.IsOnline;
|
| | | // wc.IasDeviceType = windowCovering.getAllGatewayDeviceInfo.DeviceType;
|
| | | // wc.Profile = windowCovering.getAllGatewayDeviceInfo.Profile;
|
| | | // wc.ImgTypeId = windowCovering.getAllGatewayDeviceInfo.ImgTypeId;
|
| | | // wc.InClusterList = windowCovering.getAllGatewayDeviceInfo.InClusterList;
|
| | | // wc.OutClusterList = windowCovering.getAllGatewayDeviceInfo.OutClusterList;
|
| | | // wc.AttributeStatus = windowCovering.getAllGatewayDeviceInfo.AttributeStatus;
|
| | | // wc.ReSave();
|
| | | // }
|
| | | // System.Console.WriteLine($"收到通知后的主题_{ topic}");
|
| | |
|
| | | // break;
|
| | | // case DeviceType.IASZone:
|
| | | // var ias = new IASZone() { Time = jobject.Value<int>("Time"), DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID") };
|
| | | // ias.getAllGatewayDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<IASZone.AllGatewayDeviceInfo>(jobject["Data"].ToString());
|
| | | // if (ias.getAllGatewayDeviceInfo == null)
|
| | | // {
|
| | | // return;
|
| | | // }
|
| | | // ias.CurrentGateWayId = ias.getAllGatewayDeviceInfo.GwId;
|
| | |
|
| | | // var infoIAS = ZbGateway.MainGateWay.AllGatewayDeviceList.Find(obj => obj.DeviceID == ias.DeviceID && obj.DeviceAddr == ias.DeviceAddr && obj.DeviceEpoint == ias.DeviceEpoint);
|
| | | // if (infoIAS == null)
|
| | | // {
|
| | | // ZbGateway.MainGateWay.AllGatewayDeviceList.Add(ias);
|
| | | // ias.DeviceName = ias.getAllGatewayDeviceInfo.MacName;
|
| | | // ias.DeviceEpointName = ias.getAllGatewayDeviceInfo.DeviceName;
|
| | | // ias.ImgVersion = ias.getAllGatewayDeviceInfo.ImgVersion;
|
| | | // ias.IsOnline = ias.getAllGatewayDeviceInfo.IsOnline;
|
| | | // ias.IasDeviceType = ias.getAllGatewayDeviceInfo.DeviceType;
|
| | | // ias.Profile = ias.getAllGatewayDeviceInfo.Profile;
|
| | | // ias.ImgTypeId = ias.getAllGatewayDeviceInfo.ImgTypeId;
|
| | | // ias.InClusterList = ias.getAllGatewayDeviceInfo.InClusterList;
|
| | | // ias.OutClusterList = ias.getAllGatewayDeviceInfo.OutClusterList;
|
| | | // ias.AttributeStatus = ias.getAllGatewayDeviceInfo.AttributeStatus;
|
| | | // ias.Save();
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // infoIAS.DeviceName = ias.getAllGatewayDeviceInfo.MacName;
|
| | | // infoIAS.DeviceEpointName = ias.getAllGatewayDeviceInfo.DeviceName;
|
| | | // infoIAS.getAllGatewayDeviceInfo = ias.getAllGatewayDeviceInfo;
|
| | | // infoIAS.ImgVersion = ias.getAllGatewayDeviceInfo.ImgVersion;
|
| | | // infoIAS.IsOnline = ias.getAllGatewayDeviceInfo.IsOnline;
|
| | | // infoIAS.IasDeviceType = ias.getAllGatewayDeviceInfo.DeviceType;
|
| | | // infoIAS.Profile = ias.getAllGatewayDeviceInfo.Profile;
|
| | | // infoIAS.ImgTypeId = ias.getAllGatewayDeviceInfo.ImgTypeId;
|
| | | // infoIAS.InClusterList = ias.getAllGatewayDeviceInfo.InClusterList;
|
| | | // infoIAS.OutClusterList = ias.getAllGatewayDeviceInfo.OutClusterList;
|
| | | // infoIAS.AttributeStatus = ias.getAllGatewayDeviceInfo.AttributeStatus;
|
| | | // ias.ReSave();
|
| | | // }
|
| | | // System.Console.WriteLine($"收到通知后的主题_{ topic}");
|
| | | // break;
|
| | | // case DeviceType.OtaDevice:
|
| | | // case DeviceType.OtaPanelDevice:
|
| | | // var ota = new OTADevice() { Time = jobject.Value<int>("Time"), DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID") };
|
| | | // ota.getAllGatewayDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<AllGatewayDeviceInfo>(jobject["Data"].ToString());
|
| | | // if (ota.getAllGatewayDeviceInfo == null)
|
| | | // {
|
| | | // return;
|
| | | // }
|
| | | // ota.CurrentGateWayId = ota.getAllGatewayDeviceInfo.GwId;
|
| | |
|
| | | // var infoOta = ZbGateway.MainGateWay.AllGatewayDeviceList.Find(obj => obj.DeviceID == ota.DeviceID && obj.DeviceAddr == ota.DeviceAddr && obj.DeviceEpoint == ota.DeviceEpoint);
|
| | | // if (infoOta == null)
|
| | | // {
|
| | | // ZbGateway.MainGateWay.AllGatewayDeviceList.Add(ota);
|
| | | // ota.DeviceName = ota.getAllGatewayDeviceInfo.MacName;
|
| | | // ota.DeviceEpointName = ota.getAllGatewayDeviceInfo.DeviceName;
|
| | | // ota.ImgVersion = ota.getAllGatewayDeviceInfo.ImgVersion;
|
| | | // ota.IsOnline = ota.getAllGatewayDeviceInfo.IsOnline;
|
| | | // ota.IasDeviceType = ota.getAllGatewayDeviceInfo.DeviceType;
|
| | | // ota.Profile = ota.getAllGatewayDeviceInfo.Profile;
|
| | | // ota.ImgTypeId = ota.getAllGatewayDeviceInfo.ImgTypeId;
|
| | | // ota.InClusterList = ota.getAllGatewayDeviceInfo.InClusterList;
|
| | | // ota.OutClusterList = ota.getAllGatewayDeviceInfo.OutClusterList;
|
| | | // ota.AttributeStatus = ota.getAllGatewayDeviceInfo.AttributeStatus;
|
| | | // ota.Save();
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // infoOta.DeviceName = ota.getAllGatewayDeviceInfo.MacName;
|
| | | // infoOta.DeviceEpointName = ota.getAllGatewayDeviceInfo.DeviceName;
|
| | | // infoOta.getAllGatewayDeviceInfo = ota.getAllGatewayDeviceInfo;
|
| | | // infoOta.ImgVersion = ota.getAllGatewayDeviceInfo.ImgVersion;
|
| | | // infoOta.IsOnline = ota.getAllGatewayDeviceInfo.IsOnline;
|
| | | // infoOta.IasDeviceType = ota.getAllGatewayDeviceInfo.DeviceType;
|
| | | // infoOta.Profile = ota.getAllGatewayDeviceInfo.Profile;
|
| | | // infoOta.ImgTypeId = ota.getAllGatewayDeviceInfo.ImgTypeId;
|
| | | // infoOta.InClusterList = ota.getAllGatewayDeviceInfo.InClusterList;
|
| | | // infoOta.OutClusterList = ota.getAllGatewayDeviceInfo.OutClusterList;
|
| | | // infoOta.AttributeStatus = ota.getAllGatewayDeviceInfo.AttributeStatus;
|
| | | // ota.ReSave();
|
| | | // }
|
| | | // System.Console.WriteLine($"收到通知后的主题_{ topic}");
|
| | | // break;
|
| | | // //case DeviceType.Thermostat:
|
| | | // //var thermostat = new ThermostatObj() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
|
| | | // //thermostat.DeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<ThermostatObj.DeviceInfoData>(jobject["Data"].ToString());
|
| | | // //if (thermostat.DeviceInfo == null)
|
| | | // //{
|
| | | // // return;
|
| | | // //}
|
| | | // // var ther = ZbGateway.MainGateWay.AllGatewayDeviceList.Find(obj => obj.DeviceID == thermostat.DeviceID && obj.DeviceAddr == thermostat.DeviceAddr && obj.DeviceEpoint == thermostat.DeviceEpoint);
|
| | | // //if (ther == null)
|
| | | // //{
|
| | | // // thermostat.DeviceName = thermostat.DeviceInfo.DeviceName;
|
| | | // // ZbGateway.MainGateWay.AllGatewayDeviceList.Add(thermostat);
|
| | | // //}
|
| | | // //else
|
| | | // //{
|
| | | // // thermostat.DeviceName = thermostat.DeviceInfo.DeviceName;
|
| | | // // ZigBee.IO.LocalFileUtils.SaveDeviceInfo(thermostat, thermostat.DeviceEpoint.ToString());
|
| | | // //}
|
| | | // //break;
|
| | | // //case DeviceType.TemperatureSensor:
|
| | | // // var temperatureSensor = new TemperatureSensor() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID };
|
| | | // // temperatureSensor.DeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<TemperatureSensor.DeviceInfoData>(jobject["Data"].ToString());
|
| | | // // if (temperatureSensor.DeviceInfo == null)
|
| | | // // {
|
| | | // // return;
|
| | | // // }
|
| | | // // var ts = ZbGateway.MainGateWay.AllGatewayDeviceList.Find(obj => obj.DeviceID == temperatureSensor.DeviceID && obj.DeviceAddr == temperatureSensor.DeviceAddr && obj.DeviceEpoint == temperatureSensor.DeviceEpoint);
|
| | | // // if (ts == null)
|
| | | // // {
|
| | | // // temperatureSensor.DeviceName = temperatureSensor.DeviceInfo.DeviceName;
|
| | | // // ZbGateway.MainGateWay.AllGatewayDeviceList.Add(temperatureSensor);
|
| | |
|
| | | // // }
|
| | | // // else
|
| | | // // {
|
| | | // // temperatureSensor.DeviceName = temperatureSensor.DeviceInfo.DeviceName;
|
| | | // // IO.LocalFileUtils.SaveDeviceInfo(temperatureSensor, temperatureSensor.DeviceEpoint.ToString());
|
| | | // // }
|
| | | // // break;
|
| | |
|
| | | // }
|
| | | // }
|
| | | // };
|
| | |
|
| | | // ZbGateway.MainGateWay.Actions += action;
|
| | | // System.Console.WriteLine("MainGatewayDeviceInfo_Actions 启动" + System.DateTime.Now.ToString());
|
| | |
|
| | | // var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 90 } };
|
| | | // ZbGateway.MainGateWay.CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo?.gwID;
|
| | | // ZbGateway.MainGateWay.Send("GetAllDeviceInfo", Common.SecuritySet.Encryption(jObject.ToString()));
|
| | |
|
| | | // while ((DateTime.Now - dateTime).TotalMilliseconds < 4000)
|
| | | // {
|
| | | // await System.Threading.Tasks.Task.Delay(100);
|
| | | // }
|
| | |
|
| | | // ZbGateway.MainGateWay.Actions -= action;
|
| | | // System.Console.WriteLine("MainGatewayDeviceInfo_Actions 退出" + System.DateTime.Now.ToString());
|
| | | // return ZbGateway.MainGateWay.AllGatewayDeviceList;
|
| | | // }));
|
| | | //}
|
| | | #endregion |
| | |
|
| | | #region 网关恢复出厂设置 |
| | | /// <summary> |
| | | /// 网关恢复出厂设置返回的数据. |
| | |
| | | } |
| | | #endregion |
| | | |
| | | //#region 获取协调器获取协调器当前发射功率. |
| | | /////<summary > |
| | | ///// 获取协调器获取协调器当前发射功率 |
| | | ///// </summary> |
| | | //public static async System.Threading.Tasks.Task<GwGetPowerResponData> GetPowerAsync(ZigBee.Device.ZbGateway gateway) |
| | | //{ |
| | | // if (gateway == null) |
| | | // { |
| | | // return null; |
| | | // } |
| | | // return await System.Threading.Tasks.Task.Run(async () => |
| | | // { |
| | | // GwGetPowerResponData d = null; |
| | | // Action<string, string> action = (topic, message) => |
| | | // { |
| | | // var gatewayID = topic.Split('/')[0]; |
| | | // var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); |
| | | |
| | | // if (topic == gatewayID + "/" + "Error_Respon") |
| | | // { |
| | | // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; |
| | | // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | // if (temp == null) |
| | | // { |
| | | // d = new GwGetPowerResponData { errorMessageBase = "网关错误回复,且数据是空" }; |
| | | // } |
| | | // else |
| | | // { |
| | | // d = new GwGetPowerResponData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; |
| | | |
| | | // } |
| | | // } |
| | | |
| | | // if (topic == gatewayID + "/" + "ZbGw/GetPower_Respon") |
| | | // { |
| | | // var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; |
| | | // var power = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Power"].ToString()); |
| | | |
| | | // if (power == 0) |
| | | // { |
| | | // d = new GwGetPowerResponData { errorMessageBase = "网关返回的数据为空" }; |
| | | // } |
| | | // else |
| | | // { |
| | | // d = new GwGetPowerResponData { power = power }; |
| | | // DebugPrintLog($"UI收到通知后的主题_{ topic}"); |
| | | // } |
| | | // } |
| | | // }; |
| | | |
| | | // gateway.Actions += action; |
| | | // System.Console.WriteLine("GetPower_Actions 启动" + "_" + System.DateTime.Now.ToString()); |
| | | |
| | | // var jObject = new JObject { { "Cluster_ID", 64512 }, { "Command", 10 } };
|
| | | // gateway.Send(("ZbGw/GetPower"), Common.SecuritySet.Encryption((jObject.ToString()))); |
| | | |
| | | // var dateTime = DateTime.Now; |
| | | // while ((DateTime.Now - dateTime).TotalMilliseconds < 1000) |
| | | // { |
| | | // await System.Threading.Tasks.Task.Delay(10); |
| | | // if (d != null) |
| | | // { |
| | | // break; |
| | | // } |
| | | // } |
| | | // if ((DateTime.Now - dateTime).TotalMilliseconds > 1000) |
| | | // { |
| | | // d = new GwGetPowerResponData { errorMessageBase = " 回复超时,请重新操作" }; |
| | | |
| | | // } |
| | | // gateway.Actions -= action; |
| | | // System.Console.WriteLine("GetPower_Actions 退出" + "_" + System.DateTime.Now.ToString()); |
| | | |
| | | // return d; |
| | | // }); |
| | | //} |
| | | |
| | | ///// <summary> |
| | | ///// 获取协调器获取协调器当前发射功率,网关反馈具体信息 |
| | | ///// </summary> |
| | | //public GwGetPowerResponData gwGetPowerResponData; |
| | | ///// <summary> |
| | | ///// 获取协调器获取协调器当前发射功率,网关反馈具体信息 |
| | | ///// </summary> |
| | | //[System.Serializable] |
| | | //public class GwGetPowerResponData |
| | | //{ |
| | | // /// <summary> |
| | | // /// 错误信息 |
| | | // /// </summary> |
| | | // public string errorMessageBase; |
| | | // /// <summary> |
| | | // /// 网关信息错误反馈 |
| | | // /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | // /// </summary> |
| | | // public ErrorResponData errorResponData; |
| | | // /// <summary> |
| | | // /// 协调器发射功率 |
| | | // /// </summary> |
| | | // public int power = 999; |
| | | //} |
| | | |
| | | //#endregion |
| | | |
| | | //#region 设置发射功. |
| | | /////<summary > |
| | | /////设置发射功率 |
| | | ///// <para>power:要更改的设备发射功率,可设置8,10,11,13,15,16,18,19,20,21,22(dBm)</para> |
| | | ///// </summary> |
| | | //public static async System.Threading.Tasks.Task<SetPowerResponAllData> GwSetPowerAsync(ZigBee.Device.ZbGateway gateway, int power) |
| | | //{ |
| | | // if (gateway == null) |
| | | // { |
| | | // return null; |
| | | // } |
| | | // return await System.Threading.Tasks.Task.Run(async () => |
| | | // { |
| | | // SetPowerResponAllData d = null; |
| | | // Action<string, string> action = (topic, message) => |
| | | // { |
| | | // var gatewayID = topic.Split('/')[0]; |
| | | // var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); |
| | | |
| | | // if (topic == gatewayID + "/" + "Error_Respon") |
| | | // { |
| | | // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; |
| | | // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | // if (temp == null) |
| | | // { |
| | | // d = new SetPowerResponAllData { errorMessageBase = "网关错误回复,且数据是空" }; |
| | | // } |
| | | // else |
| | | // { |
| | | // d = new SetPowerResponAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; |
| | | // } |
| | | // } |
| | | |
| | | // if (topic == gatewayID + "/" + "ZbGw/SetPower_Respon") |
| | | // { |
| | | // var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; |
| | | // var tempInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<SetPoweResponData>(jobject["Data"].ToString()); |
| | | |
| | | // if (tempInfo == null) |
| | | // { |
| | | // d = new SetPowerResponAllData { errorMessageBase = "网关返回的数据为空" }; |
| | | // } |
| | | // else |
| | | // { |
| | | // d = new SetPowerResponAllData { setPoweResponData = tempInfo }; |
| | | // DebugPrintLog($"UI收到通知后的主题_{ topic}"); |
| | | // } |
| | | // } |
| | | // }; |
| | | |
| | | // gateway.Actions += action; |
| | | // System.Console.WriteLine("ZbGw/SetPower_Actions 启动" + "_" + System.DateTime.Now.ToString()); |
| | | |
| | | // var jObject = new JObject { { "Cluster_ID", 64512 }, { "Command", 11 } }; |
| | | // var data = new JObject { { "Power", power } }; |
| | | // jObject.Add("Data", data);
|
| | | // gateway.Send(("ZbGw/SetPower"), Common.SecuritySet.Encryption(jObject.ToString(),Password)); |
| | | |
| | | // var dateTime = DateTime.Now; |
| | | // while ((DateTime.Now - dateTime).TotalMilliseconds < 1000) |
| | | // { |
| | | // await System.Threading.Tasks.Task.Delay(10); |
| | | // if (d != null) |
| | | // { |
| | | // break; |
| | | // } |
| | | // } |
| | | // if ((DateTime.Now - dateTime).TotalMilliseconds > 1000) |
| | | // { |
| | | // d = new SetPowerResponAllData { errorMessageBase = " 回复超时,请重新操作" }; |
| | | // } |
| | | // gateway.Actions -= action; |
| | | // System.Console.WriteLine("ZbGw/SetPower_Actions退出" + "_" + System.DateTime.Now.ToString()); |
| | | |
| | | // return d; |
| | | // }); |
| | | //} |
| | | |
| | | ///// <summary> |
| | | ///// 设置发射功率,网关反馈具体信息 |
| | | ///// </summary> |
| | | //public SetPowerResponAllData setPoweResponAllData; |
| | | ///// <summary> |
| | | ///// 设置发射功率,网关反馈具体信息 |
| | | ///// </summary> |
| | | //[System.Serializable] |
| | | //public class SetPowerResponAllData |
| | | //{ |
| | | // /// <summary> |
| | | // /// 错误信息 |
| | | // /// </summary> |
| | | // public string errorMessageBase; |
| | | // /// <summary> |
| | | // /// 网关信息错误反馈 |
| | | // /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | // /// </summary> |
| | | // public ErrorResponData errorResponData; |
| | | // /// <summary> |
| | | // /// 设置发射功率数据 |
| | | // /// </summary> |
| | | // public SetPoweResponData setPoweResponData; |
| | | //} |
| | | |
| | | ///// <summary> |
| | | ///// 设置发射功率数据 |
| | | ///// </summary> |
| | | //public SetPoweResponData setPoweResponData; |
| | | ///// <summary> |
| | | ///// 设置发射功率数据 |
| | | ///// </summary> |
| | | //[System.Serializable] |
| | | //public class SetPoweResponData |
| | | //{ |
| | | // /// <summary> |
| | | // /// 是否配置成功 |
| | | // ///<para>0:成功</para> |
| | | // ///<para>2:配置的信道为无效值</para> |
| | | // /// </summary> |
| | | // public int Status = 999; |
| | | // /// <summary> |
| | | // /// 功率 |
| | | // /// </summary> |
| | | // public int Power = 999; |
| | | //} |
| | | //#endregion |
| | | |
| | | //#region 读取当前局域网的PANID. |
| | | /////<summary > |
| | | ///// 读取当前局域网的PANID |
| | | ///// </summary> |
| | | //public static async System.Threading.Tasks.Task<GetPanIdResponData> ReadPanIdAsync(ZigBee.Device.ZbGateway gateway) |
| | | //{ |
| | | // if (gateway == null) |
| | | // { |
| | | // return null; |
| | | // } |
| | | // return await System.Threading.Tasks.Task.Run(async () => |
| | | // { |
| | | // GetPanIdResponData d = null; |
| | | // Action<string, string> action = (topic, message) => |
| | | // { |
| | | // var gatewayID = topic.Split('/')[0]; |
| | | // var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); |
| | | |
| | | // if (topic == gatewayID + "/" + "Error_Respon") |
| | | // { |
| | | // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; |
| | | // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | // if (temp == null) |
| | | // { |
| | | // d = new GetPanIdResponData { errorMessageBase = "网关错误回复,且数据是空" }; |
| | | // } |
| | | // else |
| | | // { |
| | | // d = new GetPanIdResponData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; |
| | | // } |
| | | // } |
| | | |
| | | // if (topic == gatewayID + "/" + "ZbGw/GetPanId_Respon") |
| | | // { |
| | | // var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; |
| | | // var panID = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["PANID"].ToString()); |
| | | |
| | | // if (panID == null) |
| | | // { |
| | | // d = new GetPanIdResponData { errorMessageBase = "网关返回的数据为空" }; |
| | | |
| | | // } |
| | | // else |
| | | // { |
| | | // d = new GetPanIdResponData { panID = panID }; |
| | | // DebugPrintLog($"UI收到通知后的主题_{ topic}"); |
| | | // } |
| | | // } |
| | | // }; |
| | | |
| | | // gateway.Actions += action; |
| | | // System.Console.WriteLine("ZbGw/GetPanId_Actions 启动" + "_" + System.DateTime.Now.ToString()); |
| | | |
| | | // var jObject = new JObject { { "Cluster_ID", 64512 }, { "Command", 12 } };
|
| | | // gateway.Send(("ZbGw/GetPanId"), Common.SecuritySet.Encryption((jObject.ToString()))); |
| | | |
| | | // var dateTime = DateTime.Now; |
| | | // while ((DateTime.Now - dateTime).TotalMilliseconds < 1000) |
| | | // { |
| | | // await System.Threading.Tasks.Task.Delay(10); |
| | | // if (d != null) |
| | | // { |
| | | // break; |
| | | // } |
| | | // } |
| | | // if ((DateTime.Now - dateTime).TotalMilliseconds > 1000) |
| | | // { |
| | | // d = new GetPanIdResponData { errorMessageBase = " 回复超时,请重新操作" }; |
| | | // } |
| | | // gateway.Actions -= action; |
| | | // System.Console.WriteLine("ZbGw/GetPanId_Actions 退出" + "_" + System.DateTime.Now.ToString()); |
| | | |
| | | // return d; |
| | | // }); |
| | | //} |
| | | |
| | | ///// <summary> |
| | | ///// 读取当前局域网的PANID,网关反馈具体信息 |
| | | ///// </summary> |
| | | //public GetPanIdResponData getPanIdResponData; |
| | | ///// <summary> |
| | | ///// 读取当前局域网的PANID,网关反馈具体信息 |
| | | ///// </summary> |
| | | //[System.Serializable] |
| | | //public class GetPanIdResponData |
| | | //{ |
| | | // /// <summary> |
| | | // /// 错误信息 |
| | | // /// </summary> |
| | | // public string errorMessageBase; |
| | | // /// <summary> |
| | | // /// 网关信息错误反馈 |
| | | // /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | // /// </summary> |
| | | // public ErrorResponData errorResponData; |
| | | // /// <summary> |
| | | // /// 当前网络的PANID |
| | | // /// </summary> |
| | | // public int panID = 999; |
| | | //} |
| | | |
| | | //#endregion |
| | | |
| | | //#region 读取协调器MAC地址. |
| | | /////<summary > |
| | | ///// 读取协调器MAC地址 |
| | | ///// </summary> |
| | | //public static async System.Threading.Tasks.Task<GetMacResponData> ReadMacAsync(ZigBee.Device.ZbGateway gateway) |
| | | //{ |
| | | // if (gateway == null) |
| | | // { |
| | | // return null; |
| | | // } |
| | | // return await System.Threading.Tasks.Task.Run(async () => |
| | | // { |
| | | // GetMacResponData d = null; |
| | | // Action<string, string> action = (topic, message) => |
| | | // { |
| | | // var gatewayID = topic.Split('/')[0]; |
| | | // var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); |
| | | |
| | | // if (topic == gatewayID + "/" + "Error_Respon") |
| | | // { |
| | | // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; |
| | | // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | // if (temp == null) |
| | | // { |
| | | // d = new GetMacResponData { errorMessageBase = "网关错误回复,且数据是空" }; |
| | | // } |
| | | // else |
| | | // { |
| | | // d = new GetMacResponData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; |
| | | // } |
| | | // } |
| | | |
| | | // if (topic == gatewayID + "/" + "ZbGw/GetMac_Respon") |
| | | // { |
| | | // var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; |
| | | // var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<MacAddrData>(jobject["Data"].ToString()); |
| | | |
| | | // if (tempData == null) |
| | | // { |
| | | // d = new GetMacResponData { errorMessageBase = "网关返回的数据为空" }; |
| | | // } |
| | | // else |
| | | // { |
| | | // d = new GetMacResponData { macAddrData = tempData }; |
| | | // DebugPrintLog($"UI收到通知后的主题_{ topic}"); |
| | | // } |
| | | // } |
| | | // }; |
| | | |
| | | // gateway.Actions += action; |
| | | // var jObject = new JObject { { "Cluster_ID", 64512 }, { "Command", 13 } };
|
| | | // gateway.Send(("ZbGw/GetMac"), Common.SecuritySet.Encryption((jObject.ToString()))); |
| | | |
| | | // var dateTime = DateTime.Now; |
| | | // while ((DateTime.Now - dateTime).TotalMilliseconds < 1000) |
| | | // { |
| | | // await System.Threading.Tasks.Task.Delay(10); |
| | | // if (d != null) |
| | | // { |
| | | // break; |
| | | // } |
| | | // } |
| | | // if ((DateTime.Now - dateTime).TotalMilliseconds > 10000) |
| | | // { |
| | | // d = new GetMacResponData { errorMessageBase = " 回复超时,请重新操作" }; |
| | | // } |
| | | // gateway.Actions -= action; |
| | | // return d; |
| | | // }); |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 读取协调器MAC地址,网关反馈具体信息 |
| | | /// </summary> |
| | |
| | | |
| | | //#endregion |
| | | |
| | | #region 添加Install Codes码 |
| | | /////<summary > |
| | | /////添加Install Codes码 |
| | | ///// <para>installCode:InstallCode码 36个字符</para> |
| | | ///// <para>installCodeAddr:InstallCodes码设备的mac地址16个字符</para> |
| | | ///// </summary> |
| | | //public static async System.Threading.Tasks.Task<InstallCodeResponData> InstallCodeAsync(ZigBee.Device.ZbGateway gateway, string installCode, string installCodeAddr) |
| | | //{ |
| | | // if (gateway == null) |
| | | // { |
| | | // return null; |
| | | // } |
| | | // return await System.Threading.Tasks.Task.Run(async () => |
| | | // { |
| | | // var d = new InstallCodeResponData { }; |
| | | // Action<string, string> action = (topic, message) => |
| | | // { |
| | | // var gatewayID = topic.Split('/')[0]; |
| | | // var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); |
| | | |
| | | // if (topic == gatewayID + "/" + "Error_Respon") |
| | | // { |
| | | // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; |
| | | // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | // if (temp == null) |
| | | // { |
| | | // d.errorMessageBase = "网关错误回复,且数据是空"; |
| | | // } |
| | | // else |
| | | // { |
| | | // d.errorResponData = temp; |
| | | // d.errorMessageBase = ErrorMess(temp.Error); |
| | | // } |
| | | // } |
| | | |
| | | // if (topic == gatewayID + "/" + "ZbGw/InstallCode_Respon") |
| | | // { |
| | | // var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; |
| | | // var code = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"].ToString()); |
| | | |
| | | // if (code == null) |
| | | // { |
| | | // d.errorMessageBase = "网关返回的数据为空"; |
| | | // } |
| | | // else |
| | | // { |
| | | // d.Status = code; |
| | | // DebugPrintLog($"UI收到通知后的主题_{ topic}"); |
| | | // } |
| | | // } |
| | | // }; |
| | | |
| | | // gateway.Actions += action; |
| | | // var jObject = new JObject { { "Cluster_ID", 64512 }, { "Command", 13 } };
|
| | | // gateway.Send(("ZbGw/GetMac"), Common.SecuritySet.Encryption((jObject.ToString()))); |
| | | |
| | | // var dateTime = DateTime.Now; |
| | | // while ((DateTime.Now - dateTime).TotalMilliseconds < 1000) |
| | | // { |
| | | // await System.Threading.Tasks.Task.Delay(10); |
| | | // //if (d.Status != 999) |
| | | // //{ |
| | | // // break; |
| | | // //} |
| | | // } |
| | | // if ((DateTime.Now - dateTime).TotalMilliseconds > 1000) |
| | | // { |
| | | // d.errorMessageBase = " 回复超时,请重新操作"; |
| | | // } |
| | | // gateway.Actions -= action; |
| | | // return d; |
| | | // }); |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 添加Install Codes码,网关反馈具体信息 |
| | | /// </summary> |
| | | public InstallCodeResponData installCodeResponData; |
| | | /// <summary> |
| | | /// 添加Install Codes码,网关反馈具体信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class InstallCodeResponData |
| | | { |
| | | /// <summary> |
| | | /// 错误信息 |
| | | /// </summary> |
| | | public string errorMessageBase; |
| | | /// <summary> |
| | | /// 网关信息错误反馈 |
| | | /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | /// </summary> |
| | | public ErrorResponData errorResponData; |
| | | /// <summary> |
| | | /// 0:成功,1:失败 |
| | | /// </summary> |
| | | public int Status = 999; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 启用或关闭透传数据上传接口 |
| | | /// <summary> |
| | | /// 透传数据上传接口,网关反馈信息 |
| | |
| | | public string passData; |
| | | } |
| | | #endregion |
| | | |
| | | //#region 协调器通用功能操作接口 |
| | | ///// <summary> |
| | | ///// 协调器通用功能操作接口 |
| | | ///// </summary> |
| | | ///// <returns>The or get all data async.</returns> |
| | | ///// <param name="gateway">Gateway.</param> |
| | | ///// <param name="commandID">Command identifier.</param> |
| | | ///// <param name="payload">Payload.</param> |
| | | //public static async System.Threading.Tasks.Task<SetOrGetAllData> SetOrGetAllDataAsync(ZigBee.Device.ZbGateway gateway, int commandID, string payload) |
| | | //{ |
| | | // if (gateway == null) |
| | | // { |
| | | // return null; |
| | | // } |
| | | // return await System.Threading.Tasks.Task.Run(async () => |
| | | // { |
| | | // var d = new SetOrGetAllData { }; |
| | | // Action<string, string> action = (topic, message) => |
| | | // { |
| | | // var gatewayID = topic.Split('/')[0]; |
| | | // var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); |
| | | |
| | | // if (topic == gatewayID + "/" + "Error_Respon") |
| | | // { |
| | | // var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; |
| | | // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); |
| | | |
| | | // if (temp == null) |
| | | // { |
| | | // d.errorMessageBase = "网关错误回复,且数据是空"; |
| | | // } |
| | | // else |
| | | // { |
| | | // d.errorResponData = temp; |
| | | // d.errorMessageBase = ErrorMess(temp.Error); |
| | | // } |
| | | // } |
| | | |
| | | // if (topic == gatewayID + "/" + "ZbGw/SetOrGetData_Respon") |
| | | // { |
| | | // var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; |
| | | // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SetOrGetData>(jobject["Data"].ToString()); |
| | | |
| | | // if (gatewayTemp.getGwVersion == null) |
| | | // { |
| | | // d.errorMessageBase = "网关返回的数据为空"; |
| | | // } |
| | | // else |
| | | // { |
| | | // d.setOrGetData = temp; |
| | | // DebugPrintLog($"UI收到通知后的主题_{ topic}"); |
| | | // } |
| | | // } |
| | | // }; |
| | | // gateway.Actions += action; |
| | | // System.Console.WriteLine("ZbDataPassthrough_Actions 启动" + "_" + System.DateTime.Now.ToString()); |
| | | |
| | | // var jObject = new JObject { { "Cluster_ID", 64512 }, { "Command", 2 } }; |
| | | // var data = new JObject { { "Command_ID", commandID }, { "Payload", payload } }; |
| | | // jObject.Add("Data", data);
|
| | | // gateway.Send("ZbGw/SetOrGetData", Common.SecuritySet.Encryption(jObject.ToString())); |
| | | // var dateTime = DateTime.Now; |
| | | // while ((DateTime.Now - dateTime).TotalMilliseconds < 1000) |
| | | // { |
| | | // await System.Threading.Tasks.Task.Delay(10); |
| | | // if (d.setOrGetData != null) |
| | | // { |
| | | // break; |
| | | // } |
| | | // } |
| | | // if ((DateTime.Now - dateTime).TotalMilliseconds > 10000) |
| | | // { |
| | | // d.errorMessageBase = " 回复超时,请重新操作"; |
| | | // } |
| | | // gateway.Actions -= action; |
| | | // System.Console.WriteLine("GetGwVersionData_Actions 退出" + System.DateTime.Now.ToString()); |
| | | |
| | | // return d; |
| | | // }); |
| | | //} |
| | | |
| | | ///// <summary> |
| | | ///// BDB接口,网关反馈信息 |
| | | ///// </summary> |
| | | //public SetOrGetAllData setOrGetAllData; |
| | | ///// <summary> |
| | | ///// BDB接口,网关反馈信息 |
| | | ///// </summary> |
| | | //[System.Serializable] |
| | | //public class SetOrGetAllData |
| | | //{ |
| | | // /// <summary> |
| | | // /// 错误信息 |
| | | // /// </summary> |
| | | // public string errorMessageBase; |
| | | // /// <summary> |
| | | // /// 网关信息错误反馈 |
| | | // /// <para>当网关接收到客户端信息后,出现以下异常情况将反馈错误。</para> |
| | | // /// </summary> |
| | | // public ErrorResponData errorResponData; |
| | | // /// <summary> |
| | | // /// BDB数据 |
| | | // /// </summary> |
| | | // public SetOrGetData setOrGetData; |
| | | |
| | | //} |
| | | |
| | | ///// <summary> |
| | | ///// BDB数据 |
| | | ///// </summary> |
| | | //public SetOrGetData setOrGetData; |
| | | ///// <summary> |
| | | ///// BDB数据 |
| | | ///// </summary> |
| | | //[System.Serializable] |
| | | //public class SetOrGetData |
| | | //{ |
| | | // /// <summary> |
| | | // /// 协调器指令的command_ID。对应《协调器串口通信协议规范》第2章节指令的command_ID |
| | | // /// </summary> |
| | | // public int commandID; |
| | | // /// <summary> |
| | | // /// 已经转换成字符格式的16进制的data数据。对应《协调器串口通信协议规范》第2章节指令的“数据”内容 |
| | | // /// </summary> |
| | | // public string payload; |
| | | //} |
| | | //#endregion |
| | | |
| | | #region 客户端发送文件流到网关 |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public const int AddFreshAirModulPanelMsg = 239; |
| | | /// <summary> |
| | | /// 设置常开模式后,您的门锁将始终{0}处于打开状态,确认开启? |
| | | /// 设置常开模式后,您的门锁将始终{0}处于打开状态,确认开启? |
| | | /// </summary> |
| | | public const int SetDoorLockNomallyOpen = 241; |
| | | /// <summary> |
| | |
| | | /// 背光灯颜色 |
| | | /// </summary> |
| | | public const int BackgroundLightColor = 312; |
| | | /// <summary>
|
| | | /// PM2.5感器 -> 长按图示按键5秒以上,信号图标{0}快闪, 进入配网状态。信号图标常亮则配网成功
|
| | | /// </summary>
|
| | | /// <summary> |
| | | /// PM2.5感器 -> 长按图示按键5秒以上,信号图标{0}快闪, 进入配网状态。信号图标常亮则配网成功 |
| | | /// </summary> |
| | | public const int AddSensorPMMsg = 313; |
| | | |
| | | public readonly static int cancel = 5097; |
| | |
| | | public readonly static int daySone = 5386; |
| | | public readonly static int numberSone = 5387; |
| | | public readonly static int openAutomationSone = 5388; |
| | | public readonly static int timeSetSone = 5389; |
| | | |
| | | public readonly static int timeSetSone= 5389; |
| | | public readonly static int invalidSetting = 5390; |
| | | public readonly static int hour = 5391; |
| | | public readonly static int lockOpen = 5392; |
| | | public readonly static int setDoorLockOpen = 5393; |
| | | public readonly static int less = 5394; |
| | | public readonly static int more = 5395; |
| | | public readonly static int or = 5396; |
| | | public readonly static int timeNull = 5397; |
| | | public readonly static int numberInput = 5398; |
| | | |
| | | #region 登录注册 |
| | | /// <summary> |
| | |
| | | /// 功能设置 |
| | | /// </summary> |
| | | public const int FunctionSetting = 11012; |
| | | /// <summary> |
| | | /// 信息编辑 |
| | | /// </summary> |
| | | public const int EditInfo = 11013; |
| | | /// <summary> |
| | | /// 功能名称 |
| | | /// </summary> |
| | | public const int FunctionName = 11014; |
| | | /// <summary> |
| | | /// 所属区域 |
| | | /// </summary> |
| | | public const int BelongZone = 11015; |
| | | /// <summary> |
| | | /// 所属设备 |
| | | /// </summary> |
| | | public const int BelongDevice = 11016; |
| | | /// <summary> |
| | | /// 未知 |
| | | /// </summary> |
| | | public const int UNKnown = 11017; |
| | | /// <summary> |
| | | /// 分享 |
| | | /// </summary> |
| | | public const int Share = 11018; |
| | | /// <summary> |
| | | /// 分享的 |
| | | /// </summary> |
| | | public const int Shared = 11019; |
| | | /// <summary> |
| | | /// 选择图标 |
| | | /// </summary> |
| | | public const int SelectIcon = 11020; |
| | | /// <summary> |
| | | /// 保存 |
| | | /// </summary> |
| | | public const int Save = 11021; |
| | | /// <summary> |
| | | /// 提醒 |
| | | /// </summary> |
| | | public const int TIP = 11022; |
| | | /// <summary> |
| | | /// 取消 |
| | | /// </summary> |
| | | public const int Cancel = 11023; |
| | | /// <summary> |
| | | /// 没有场景 {\r\n} 请点击右上角添加 |
| | | /// </summary> |
| | | public const int NoScene = 11024; |
| | | /// <summary> |
| | | /// 设置 |
| | | /// </summary> |
| | | public const int Setting = 11025; |
| | | /// <summary> |
| | | /// 延时 |
| | | /// </summary> |
| | | public const int Delay = 11026; |
| | | /// <summary> |
| | | /// 确定删除吗? |
| | | /// </summary> |
| | | public const int ConfirmDelete = 11027; |
| | | /// <summary> |
| | | /// 添加场景 |
| | | /// </summary> |
| | | public const int AddScence = 11028; |
| | | /// <summary> |
| | | /// 场景名称 |
| | | /// </summary> |
| | | public const int SceneName = 11029; |
| | | /// <summary> |
| | | /// 请输入场景名称 |
| | | /// </summary> |
| | | public const int PleaseInputSceneName = 11030; |
| | | /// <summary> |
| | | /// 添加执行目标 |
| | | /// </summary> |
| | | public const int AddScentTargetAction = 11031; |
| | | /// <summary> |
| | | /// 选择区域 |
| | | /// </summary> |
| | | public const int SelectZone = 11032; |
| | | /// <summary> |
| | | /// 选择场景图片 |
| | | /// </summary> |
| | | public const int SelectScenePic = 11033; |
| | | /// <summary> |
| | | /// 信息编辑 |
| | | /// </summary> |
| | | public const int EditInfo = 11013; |
| | | /// <summary> |
| | | /// 功能名称 |
| | | /// </summary> |
| | | public const int FunctionName = 11014; |
| | | /// <summary> |
| | | /// 所属区域 |
| | | /// </summary> |
| | | public const int BelongZone = 11015; |
| | | /// <summary> |
| | | /// 所属设备 |
| | | /// </summary> |
| | | public const int BelongDevice = 11016; |
| | | /// <summary> |
| | | /// 未知 |
| | | /// </summary> |
| | | public const int UNKnown = 11017; |
| | | /// <summary> |
| | | /// 分享 |
| | | /// </summary> |
| | | public const int Share = 11018; |
| | | /// <summary> |
| | | /// 分享的 |
| | | /// </summary> |
| | | public const int Shared = 11019; |
| | | /// <summary> |
| | | /// 选择图标 |
| | | /// </summary> |
| | | public const int SelectIcon = 11020; |
| | | /// <summary> |
| | | /// 保存 |
| | | /// </summary> |
| | | public const int Save = 11021; |
| | | /// <summary> |
| | | /// 提醒 |
| | | /// </summary> |
| | | public const int TIP = 11022; |
| | | /// <summary> |
| | | /// 取消 |
| | | /// </summary> |
| | | public const int Cancel = 11023; |
| | | /// <summary> |
| | | /// 没有场景 {\r\n} 请点击右上角添加 |
| | | /// </summary> |
| | | public const int NoScene = 11024; |
| | | /// <summary> |
| | | /// 设置 |
| | | /// </summary> |
| | | public const int Setting = 11025; |
| | | /// <summary> |
| | | /// 延时 |
| | | /// </summary> |
| | | public const int Delay = 11026; |
| | | /// <summary> |
| | | /// 确定删除吗? |
| | | /// </summary> |
| | | public const int ConfirmDelete = 11027; |
| | | /// <summary> |
| | | /// 添加场景 |
| | | /// </summary> |
| | | public const int AddScence = 11028; |
| | | /// <summary> |
| | | /// 场景名称 |
| | | /// </summary> |
| | | public const int SceneName = 11029; |
| | | /// <summary> |
| | | /// 请输入场景名称 |
| | | /// </summary> |
| | | public const int PleaseInputSceneName = 11030; |
| | | /// <summary> |
| | | /// 添加执行目标 |
| | | /// </summary> |
| | | public const int AddScentTargetAction = 11031; |
| | | /// <summary> |
| | | /// 选择区域 |
| | | /// </summary> |
| | | public const int SelectZone = 11032; |
| | | /// <summary> |
| | | /// 选择场景图片 |
| | | /// </summary> |
| | | public const int SelectScenePic = 11033; |
| | | /// <summary> |
| | | /// 确定要移除该功能? |
| | | /// </summary> |
| | |
| | | /// 常开自动化手动取消
|
| | | /// </summary>
|
| | | public const int uNormallyOpenLogicManualClose = 16115;
|
| | | /// <summary>
|
| | | /// 游客体验
|
| | | /// </summary>
|
| | | public const int uExperienceAccount = 16116;
|
| | |
|
| | |
|
| | | //★★★★下面这些是接口的返回信息翻译,从18000开始★★★★
|
| | |
| | | /// </summary>
|
| | | public const int uAddFangyueEnvironmentPanelMsg = 21021;
|
| | | /// <summary>
|
| | | /// 窗帘面板 -> 长按面板左上角按键,所有按键{0}指示灯亮起,则配网成功 |
| | | /// 窗帘面板 -> 长按面板左上角按键,所有按键{0}指示灯亮起,则配网成功
|
| | | /// </summary>
|
| | | public const int uAddCurtaunPanelMsg = 21022;
|
| | | /// <summary>
|
| | | /// 吸顶燃气传感器 -> 长按图示按键5秒以上,绿色快闪{0}进入配网状态,绿灯常亮则入网成功
|
| | | /// </summary>
|
| | | public const int uAddSensorCeilingGasMsg = 21023;
|
| | |
|
| | |
|
| | | //★★★★下面这些是模块ID的官方名字,从30000开始★★★★
|
| | |
| | | /// 镜像ID为2310的设备的默认名字:方悦新风小模块 |
| | | /// </summary> |
| | | public const int uDeviceModelId2310 = 30038;
|
| | | /// <summary> |
| | | /// 镜像ID为1306的设备的默认名字:Zigbee吸顶燃气传感器 |
| | | /// </summary> |
| | | public const int uDeviceModelId1306 = 30039;
|
| | |
|
| | | //★★★★下面这些是设备所属种类的翻译名字,从40000开始★★★★
|
| | | /// <summary>
|
| | |
| | | /// </summary> |
| | | public const int uDeviceDirectionName25 = 70024; |
| | | /// <summary> |
| | | /// PM2.5空气质量传感器 |
| | | /// 吸顶燃气传感器 |
| | | /// </summary> |
| | | public const int uDeviceDirectionName26 = 70025; |
| | | /// <summary> |
| | | /// PM2.5空气质量传感器 |
| | | /// </summary> |
| | | public const int uDeviceDirectionName27 = 70026; |
| | | } |
| | | } |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\mFunView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\SaveView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\SelectedDeviceView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\TipView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\TopView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\TypeView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\Method.cs" />
|
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceCurtainDetailCardForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceFreshAirDetailCardForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\ControlForm\DeviceRelayDetailCardForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceCard\DeviceFreshAirCardControl.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceFunctionUnallocatedControl.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\Controls\DeviceSelectUnallocatedControl.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\MainPage\SelectLocalDeviceImageForm.cs" />
|
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\PanelFangyueTwoButtonDirectionForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\RepeaterZigbeeDirectionForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\SensorCarbonMonoxideDirectionForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\SensorCeilingGasDirectionForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\SensorDoorWindowDirectionForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\SensorFireDirectionForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\SensorInfraredDirectionForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\SensorPirDirectionForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\SensorPMTwoPointFiveForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\SensorTemperatureHumidityForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Direction\SensorWaterDirectionForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelBackLighWithSensorForm.cs" />
|
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueEnvironmentButtonSettionForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueEnvironmentLightSettionForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueEnvironmentTargetForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueFreshAirBackLightSettionForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueFreshAirButtonSettionForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueFreshAirTargetsForm.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\Device\Panel\PanelFangyueFunctionSettionForm.cs" />
|
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\FunctionSetting.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\MasterManagementPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\MemberFrozenPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\ShowDoorLockMsgControl.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\TemporaryPassword.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\TimeSettignPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\DoorLock\UndistributeDoorlockUserPage.cs" />
|
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\UserView\LoginLoading.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\AC.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\DimmableLight.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\DoorLock.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\FreshAir.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\HumiditySensor.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)Phone\ZigBee\Device\Repeater.cs" />
|
| | |
| | | <None Include="$(MSBuildThisFileDirectory)DLL\ZigBee.Droid.dll" />
|
| | | <None Include="$(MSBuildThisFileDirectory)DLL\ZigBee.Ios.xml" />
|
| | | </ItemGroup>
|
| | | </Project> |
| | | </Project>
|