HDL Home App 第二版本 旧平台金堂用 正在使用
wjc
2022-12-01 351bdda734832d821a9764b0cde8be5d83c4ec50
ZigbeeApp/Shared/Phone/Category/Controls/DeviceRow/Base/DeviceRowCommon.cs
@@ -46,6 +46,10 @@
        /// </summary>
        private MostRightIconControl btnSwitch = null;
        /// <summary>
        /// 电池控件
        /// </summary>
        private IconViewControl btnBattery = null;
        /// <summary>
        /// 是否获取网关反馈的结果  0:没有获取得到  1:已经获取得到
        /// </summary>
        private int ResponeResult = 0;
@@ -104,9 +108,9 @@
            //设备名字
            this.btnDeviceName = new NormalViewControl(600, 60, true);
            if (this.device.Type == DeviceType.WindowCoveringDevice)
            if (this.device.Type == DeviceType.WindowCoveringDevice || this.device.Type == DeviceType.Airer)
            {
                //窗帘因为右边有三个按钮,所以需要所有名字的宽度
                //窗帘因为右边有三个按钮,所以需要缩小名字的宽度
                this.btnDeviceName.Width = Application.GetRealWidth(360);
            }
            btnDeviceName.X = Application.GetRealWidth(181);
@@ -146,6 +150,24 @@
            this.btnSwitch = new MostRightIconControl(69, 69);
            btnSwitch.UnSelectedImagePath = "Item/Switch.png";
            btnSwitch.SelectedImagePath = "Item/SwitchSelected.png";
            //电池控件
            if (this.device.Type == DeviceType.IASZone)
            {
                this.btnBattery = new IconViewControl(69);
                btnBattery.X = this.Width - Application.GetRealWidth(69 + 29);
                btnBattery.UnSelectedImagePath = "Item/Battery.png";
                btnBattery.Gravity = Gravity.CenterVertical;
                this.frameTable.AddChidren(btnBattery, ChidrenBindMode.BindEvent);
                if (chidrenYaxis != 0)
                {
                    btnBattery.Y += chidrenYaxis;
                }
                if (this.device.IsBatteryDown == false)
                {
                    btnBattery.Visible = false;
                }
            }
            //分享的房间,则不能编辑和删除
            if (this.nowSelectRoom.IsSharedRoom == false)
@@ -202,6 +224,8 @@
                        //回调控件被移除的事件
                        this.RowNeedRemoveEvent?.Invoke();
                        this.RemoveFromParent();
                        //上传空间区域信息
                        HdlRoomLogic.Current.SetRoomInfoToGateway();
                    };
                };
            }
@@ -249,6 +273,13 @@
                //等待网关回复后会重新刷新,不然一直是关闭状态
                isOpen = false;
            }
            //如果是传感器类,则默认是关的效果
            if (this.device.Type == DeviceType.PMSensor || this.device.Type == DeviceType.IASZone
                || this.device.Type == DeviceType.TemperatureSensor)
            {
                isOpen = false;
            }
            this.SetRowOpenStatu(isOpen);
        }
@@ -421,6 +452,43 @@
            this.ResponeResult = 1;
        }
        /// <summary>
        /// 接收网关回复的状态(true:已经接收到网关的回复 false:还没有接收到网关回复)
        /// </summary>
        /// <returns></returns>
        public bool ReceiveResponeResultStatu()
        {
            return this.ResponeResult == 1;
        }
        #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 ■ 一般方法___________________________
@@ -495,7 +563,7 @@
        /// <summary>
        /// 切换卡片状态特效
        /// </summary>
        private void SwitchRowStatuAppeal(bool isOpen)
        public void SwitchRowStatuAppeal(bool isOpen)
        {
            if (this.btnDeviceName.IsSelected == isOpen)
            {