黄学彪
2020-07-20 2029e64ec0491f7e511dc15bffaf821bfbabe2de
ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceCard/Base/DeviceCardCommon.cs
@@ -50,6 +50,10 @@
        /// </summary>
        private IconViewControl btnCollect = null;
        /// <summary>
        /// 电池控件
        /// </summary>
        private IconViewControl btnBattery = null;
        /// <summary>
        /// 是否获取网关反馈的结果  0:没有获取得到  1:已经获取得到
        /// </summary>
        private int ResponeResult = 0;
@@ -165,6 +169,21 @@
            btnSwitch.Y = HdlControlLogic.Current.GetPictrueRealSize(202);
            btnSwitch.UnSelectedImagePath = "Item/Switch1.png";
            btnSwitch.SelectedImagePath = "Item/SwitchSelected1.png";
            //电池控件
            if (this.device.Type == DeviceType.IASZone)
            {
                this.btnBattery = new IconViewControl(69);
                btnBattery.X = HdlControlLogic.Current.GetPictrueRealSize(348);
                btnBattery.Y = HdlControlLogic.Current.GetPictrueRealSize(236);
                btnBattery.UnSelectedImagePath = "Item/Battery.png";
                btnBattery.SelectedImagePath = "Item/BatterySelected.png";
                this.AddChidren(btnBattery, ChidrenBindMode.BindEvent);
                if (this.device.IsBatteryDown == false)
                {
                    btnBattery.Visible = false;
                }
            }
            //刷新信息
            this.RefreshControlInfo(i_device);
@@ -384,6 +403,34 @@
        #endregion
        #region ■ 显示低电量_________________________
        /// <summary>
        /// 刷新电池电量状态
        /// </summary>
        public void RefreshBatteryStatu()
        {
            if (this.btnBattery == null) { return; }
            if (this.device.IsBatteryDown == true)
            {
                //电量低,显示图标
                if (this.btnBattery.Visible == false)
                {
                    this.btnBattery.Visible = true;
                }
            }
            else
            {
                //电量足够,隐藏图标
                if (this.btnBattery.Visible == true)
                {
                    this.btnBattery.Visible = false;
                }
            }
        }
        #endregion
        #region ■ 一般方法___________________________
        /// <summary>
@@ -481,6 +528,11 @@
            this.btnDeviceIcon.IsSelected = isOpen;
            //状态文本控件
            this.btnStatu.IsSelected = isOpen;
            //电池控件
            if (this.btnBattery != null && this.btnBattery.Visible == true)
            {
                this.btnBattery.IsSelected = isOpen;
            }
        }
        #endregion