| | |
| | | this.AddChidren(btnBackGroud, ChidrenBindMode.BindEvent);
|
| | |
|
| | | //设备名称控件
|
| | | this.btnDeviceName = new NormalViewControl(320, 63, true);
|
| | | this.btnDeviceName = new NormalViewControl(360, 63, true);
|
| | | btnDeviceName.X = HdlControlLogic.Current.GetPictrueRealSize(40);
|
| | | btnDeviceName.Y = HdlControlLogic.Current.GetPictrueRealSize(17);
|
| | | btnDeviceName.TextSize = 16;
|
| | |
| | | this.ChangedChidrenBindMode(fraDeviceRound, ChidrenBindMode.BindEvent);
|
| | |
|
| | | //状态文本控件
|
| | | this.btnStatu = new NormalViewControl(HdlControlLogic.Current.GetPictrueRealSize(300), HdlControlLogic.Current.GetPictrueRealSize(63), false);
|
| | | this.btnStatu = new NormalViewControl(HdlControlLogic.Current.GetPictrueRealSize(400), HdlControlLogic.Current.GetPictrueRealSize(63), false);
|
| | | btnStatu.X = HdlControlLogic.Current.GetPictrueRealSize(46);
|
| | | btnStatu.Y = HdlControlLogic.Current.GetPictrueRealSize(236);
|
| | | btnStatu.TextColor = UserCenterColor.Current.TextColor1;
|
| | |
| | | //等待网关回复后会重新刷新,不然一直是关闭状态
|
| | | isOpen = false;
|
| | | }
|
| | | //如果是传感器类,则默认是关的效果
|
| | | if (this.device.Type == DeviceType.PMSensor || this.device.Type == DeviceType.IASZone
|
| | | || this.device.Type == DeviceType.TemperatureSensor)
|
| | | {
|
| | | isOpen = false;
|
| | | }
|
| | |
|
| | | this.SetCardOpenStatu(isOpen);
|
| | | }
|
| | |
|
| | |
| | | /// <param name="isOpen"></param>
|
| | | public void SetCardOpenStatu(bool isOpen)
|
| | | {
|
| | | //设备状态必须刷新
|
| | | this.btnStatu.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device);
|
| | | //获取设备类型
|
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
|
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor)
|
| | | {
|
| | | var aqSensor = (TemperatureSensor)this.device;
|
| | | //空气质量传感器 |
| | | var tempAirQuality = aqSensor.AirQuality(aqSensor);
|
| | | string curQuality = string.Empty;
|
| | | if (tempAirQuality == 1)
|
| | | {
|
| | | curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
|
| | | }
|
| | | else if (tempAirQuality == 2)
|
| | | {
|
| | | curQuality = Language.StringByID(R.MyInternationalizationString.GoodAirQuality);
|
| | | }
|
| | | else if (tempAirQuality == 3)
|
| | | {
|
| | | curQuality = Language.StringByID(R.MyInternationalizationString.Pollution);
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | curQuality = "";
|
| | | }
|
| | | this.btnStatu.Text = curQuality;
|
| | | }
|
| | | else
|
| | | {
|
| | | //设备状态必须刷新
|
| | | this.btnStatu.Text = HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device);
|
| | | }
|
| | |
|
| | | //开关控件
|
| | | if (btnSwitch != null && this.btnSwitch.IsSelected != isOpen)
|
| | | {
|
| | |
| | | this.ResponeResult = 1;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 接收网关回复的状态(true:已经接收到网关的回复 false:还没有接收到网关回复)
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | public bool ReceiveResponeResultStatu()
|
| | | {
|
| | | return this.ResponeResult == 1;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 显示低电量_________________________
|
| | |
| | | /// <summary>
|
| | | /// 切换卡片状态特效
|
| | | /// </summary>
|
| | | private void SwitchCardStatuAppeal(bool isOpen)
|
| | | public void SwitchCardStatuAppeal(bool isOpen)
|
| | | {
|
| | | if (this.btnBackGroud.IsSelected == isOpen)
|
| | | {
|