| | |
| | | {
|
| | | //简约面板随便一个回路来获取设备信息
|
| | | var dev = Common.LocalDevice.Current.GetDevice(deviceMac, 62);
|
| | | var key = new ZigBee.Device.Panel();
|
| | | key.DeviceAddr = deviceMac;
|
| | | key.CurrentGateWayId = dev.CurrentGateWayId;
|
| | | InitBindInfo(key);
|
| | | if (dev != null)
|
| | | {
|
| | | var key = new ZigBee.Device.Panel();
|
| | | key.DeviceAddr = deviceMac;
|
| | | key.CurrentGateWayId = dev.CurrentGateWayId;
|
| | | InitBindInfo(key);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | private void AddPirSensorWorkModeRow()
|
| | | {
|
| | | if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.Sensor_Pir
|
| | | || deviceEnumInfo.IsHdlDevice == false)
|
| | | || deviceEnumInfo.IsHdlDevice == false
|
| | | || this.listNewDevice.Count != 2)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | /// </summary>
|
| | | private void AddPirSensorBindRow()
|
| | | {
|
| | | if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.Sensor_Pir)
|
| | | if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.Sensor_Pir
|
| | | || this.listNewDevice.Count != 2)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | foreach (var bDev in bindList)
|
| | | {
|
| | | var device = Common.LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint);
|
| | | if (device == null)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (device.Type == DeviceType.TemperatureSensor)
|
| | | {
|
| | | var bD = device as TemperatureSensor;
|
| | |
| | | //检测此回路是否拥有定位功能(拿端点最小的那个回路去定位)
|
| | | bool canTest = Common.LocalDevice.Current.DeviceIsCanFixedPosition(listNewDevice[0]);
|
| | |
|
| | | var frame = new TopRightMenuControl(canTest == true ? 2 : 1, 1);
|
| | | TopRightMenuControl frame = null;
|
| | |
|
| | | if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction)
|
| | | {
|
| | | frame = new TopRightMenuControl(3, 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | frame = new TopRightMenuControl(canTest == true ? 2 : 1, 1);
|
| | | }
|
| | |
|
| | | string deviceMenu = string.Empty;
|
| | | if (canTest == true)
|
| | | {
|
| | |
| | | });
|
| | | });
|
| | |
|
| | | //同步
|
| | | deviceMenu = Language.StringByID(R.MyInternationalizationString.Synchronization);
|
| | | if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(listNewDevice[0]))
|
| | | {
|
| | | frame.AddRowMenu(deviceMenu, "", "Item/SynchronizationSelected.png", () =>
|
| | | {
|
| | | //如果当前住宅是虚拟住宅,此功能无效
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | //同步指定设备
|
| | | this.SynchronizationDevice();
|
| | | });
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | });
|
| | | });
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 同步指定设备
|
| | | /// </summary>
|
| | | private void SynchronizationDevice()
|
| | | {
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | |
|
| | | //同步设备
|
| | | bool result = await Common.LocalDevice.Current.SynchronizationDevice(listNewDevice);
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | });
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region ■ 关闭界面___________________________
|