黄学彪
2020-07-13 23420922845c9e77019a55c3b3e3271eb1ec261e
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
@@ -102,10 +102,13 @@
            {
                //简约面板随便一个回路来获取设备信息
                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);
                }
            }
        }
@@ -710,7 +713,8 @@
        private void AddPirSensorWorkModeRow()
        {
            if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.Sensor_Pir
                || deviceEnumInfo.IsHdlDevice == false)
                || deviceEnumInfo.IsHdlDevice == false
                || this.listNewDevice.Count != 2)
            {
                return;
            }
@@ -739,7 +743,8 @@
        /// </summary>
        private void AddPirSensorBindRow()
        {
            if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.Sensor_Pir)
            if (this.deviceEnumInfo.ConcreteType != DeviceConcreteType.Sensor_Pir
                || this.listNewDevice.Count != 2)
            {
                return;
            }
@@ -1207,6 +1212,10 @@
                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;
@@ -1499,7 +1508,17 @@
            //检测此回路是否拥有定位功能(拿端点最小的那个回路去定位)
            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)
            {
@@ -1530,6 +1549,23 @@
                });
            });
            //同步
            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>
@@ -1557,6 +1593,27 @@
                });
            });
        }
        /// <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 ■ 关闭界面___________________________