HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-12-17 9f326f4000847e6167d8166fa2f6a66f53cb3734
ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceMacInfoEditorForm.cs
@@ -91,28 +91,44 @@
            //设置标题信息
            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uDeviceSettion));
            //初始化右上角菜单
            this.InitTopRightMenu();
            //重新获取硬件信息(false:不需要获取,true:需要获取)
            var result = this.RefreshHardFirmwareInfo();
            //初始化中部控件
            this.InitMiddleFrame();
            //重新获取硬件信息
            this.RefreshHardFirmwareInfo();
            //简约多功能面板获取绑定目标的显示
            if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction)
            HdlThreadLogic.Current.RunThread(() =>
            {
                //简约面板随便一个回路来获取设备信息
                var dev = HdlDeviceCommonLogic.Current.GetDevice(deviceMac, 62);
                if (dev != null)
                if (result == true)
                {
                    var key = new ZigBee.Device.Panel();
                    key.DeviceAddr = deviceMac;
                    key.CurrentGateWayId = dev.CurrentGateWayId;
                    InitBindInfo(key);
                    //如果需要重新去读取设备的信息才能显示界面的话,等待一段时间
                    this.ShowProgressBar();
                    System.Threading.Thread.Sleep(1500);
                }
            }
                HdlThreadLogic.Current.RunMain(() =>
                {
                    //初始化右上角菜单
                    this.InitTopRightMenu();
                    //初始化中部控件
                    this.InitMiddleFrame();
                    //简约多功能面板获取绑定目标的显示
                    if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction)
                    {
                        //简约面板随便一个回路来获取设备信息
                        var dev = HdlDeviceCommonLogic.Current.GetDevice(deviceMac, 62);
                        if (dev != null)
                        {
                            var key = new ZigBee.Device.Panel();
                            key.DeviceAddr = deviceMac;
                            key.CurrentGateWayId = dev.CurrentGateWayId;
                            InitBindInfo(key);
                        }
                    }
                    if (result == true)
                    {
                        this.CloseProgressBar();
                    }
                });
            });
        }
        /// <summary>
@@ -968,13 +984,13 @@
            if (Common.Config.Instance.Home.IsShowTemplate == true)
            {
                btnSwitch.CanClick = false;
                btnSwitch.IsSelected = TemplateData.TemplateDeviceDataLogic.Current.GetCurtainHandPullControl(deviceCurtain);
                btnSwitch.IsSelected = HdlTemplateDeviceDataLogic.Current.GetCurtainHandPullControl(deviceCurtain);
                return;
            }
            //如果是虚拟住宅
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                btnSwitch.IsSelected = TemplateData.TemplateDeviceDataLogic.Current.GetCurtainHandPullControl(deviceCurtain);
                btnSwitch.IsSelected = HdlTemplateDeviceDataLogic.Current.GetCurtainHandPullControl(deviceCurtain);
                return;
            }
@@ -1779,17 +1795,19 @@
        #region ■ 硬件信息___________________________
        /// <summary>
        /// 重新获取硬件信息
        /// 重新获取硬件信息(false:不需要获取,true:需要获取)
        /// </summary>
        private void RefreshHardFirmwareInfo()
        private bool RefreshHardFirmwareInfo()
        {
            if (listNewDevice[0].DriveCode > 0 || Common.Config.Instance.Home.IsShowTemplate == true)
            {
                //虚拟设备没有这种操作
                return;
                return false;
            }
            //重新获取硬件信息
            HdlDeviceAttributeLogic.Current.ReadDeviceAllHardFirmwareInfo(listNewDevice[0]);
            //获取设备的固定属性
            return HdlDeviceAttributeLogic.Current.ReadDeviceAllFixedAttribute(listNewDevice[0]);
        }
        #endregion