| | |
| | | /// </summary>
|
| | | public class DeviceMacInfoEditorForm : EditorCommonForm
|
| | | {
|
| | | #region ■ 变量声明___________________________ |
| | | #region ■ 变量声明___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 设备对象
|
| | | /// </summary>
|
| | |
| | | {
|
| | | //简约面板随便一个回路来获取设备信息
|
| | | 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;
|
| | | }
|
| | |
| | | {
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
|
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "5007_2" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
|
| | | });
|
| | | return;
|
| | | }
|
| | |
| | | {
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
|
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "5007_3" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
|
| | | });
|
| | | 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;
|
| | |
| | | /// <param name="oTADevice">ota设备</param>
|
| | | private void SetDeviceVersionInfo(PicViewControl btnNewVersion, OTADevice oTADevice)
|
| | | {
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | bool receiveImageInfo = false;
|
| | | //设置设备全部的镜像信息
|
| | |
| | | while (receiveImageInfo == false && count > 0)
|
| | | {
|
| | | //等待设备镜像的反馈
|
| | | await Task.Delay(300);
|
| | | System.Threading.Thread.Sleep(300);
|
| | | count--;
|
| | | }
|
| | | //移除事件
|
| | |
| | |
|
| | | oTADevice = Common.LocalDevice.Current.GetOTADevice(listNewDevice[0].DeviceAddr);
|
| | | //添加升级固件信息(成不成功都无所谓)
|
| | | var result = await HdlFirmwareUpdateLogic.AddFirmwareVersionInfo(FirmwareLevelType.ZigbeeDevice, oTADevice.HwVersion.ToString(), oTADevice.ImgTypeId.ToString());
|
| | | var result = HdlFirmwareUpdateLogic.AddFirmwareVersionInfo(FirmwareLevelType.ZigbeeDevice, oTADevice.HwVersion.ToString(), oTADevice.ImgTypeId.ToString());
|
| | |
|
| | | //获取设备最新版本
|
| | | var deviceFirmware = HdlFirmwareUpdateLogic.GetFirmwareMostVersionInfo(FirmwareLevelType.ZigbeeDevice,
|
| | |
| | | //检测此回路是否拥有定位功能(拿端点最小的那个回路去定位)
|
| | | bool canTest = Common.LocalDevice.Current.DeviceIsCanFixedPosition(listNewDevice[0]);
|
| | |
|
| | | TopRightMenuControl frame = null; |
| | | |
| | | if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction) |
| | | { |
| | | frame = new TopRightMenuControl(3, 1); |
| | | } |
| | | else |
| | | { |
| | | 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)
|
| | |
| | | //删除指定设备
|
| | | this.DoDeleteDevice();
|
| | | });
|
| | | }); |
| | | |
| | | //同步 |
| | | });
|
| | |
|
| | | //同步
|
| | | 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(); |
| | | }); |
| | | if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(listNewDevice[0]))
|
| | | {
|
| | | frame.AddRowMenu(deviceMenu, "", "Item/SynchronizationSelected.png", () =>
|
| | | {
|
| | | //如果当前住宅是虚拟住宅,此功能无效
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | //同步指定设备
|
| | | this.SynchronizationDevice();
|
| | | });
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | this.CloseForm();
|
| | | });
|
| | | });
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 同步指定设备
|
| | | /// </summary>
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //关闭界面
|
| | | this.CloseForm();
|
| | | });
|
| | | });
|
| | | }
|
| | | #endregion
|