| | |
| | | /// <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)
|
| | | {
|