xm
2020-05-19 136b9e2fc48249a5ff89874f1080ba94130e7a9e
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DevicePmSensorDetailCardForm.cs
@@ -52,7 +52,7 @@
        /// 初始化PM2.5传感器控件
        /// </summary>
        /// <param name="frameWhiteBack"></param>
        private void InitPmControl(FrameLayout frameWhiteBack)
        private void InitPmControl(FrameLayout frameWhiteBack)
        {
            //湿度容器
            var frameHumidityPic = new FrameLayout();
@@ -147,7 +147,7 @@
            framePmPic.AddChidren(btnPmText);
            //PM2.5数据(第3个,listControl【2】)
            var btnPmStatus = new NormalViewControl(162, 92, true);
            var btnPmStatus = new NormalViewControl(162, 92, true);
            btnPmStatus.Y = Application.GetRealHeight(181);
            btnPmStatus.Text = "155";
            btnPmStatus.TextSize = 30;
@@ -156,8 +156,8 @@
            framePmPic.AddChidren(btnPmStatus);
            this.listControl.Add(btnPmStatus);
            //PM2.5单位
            var btnPmUnit = new NormalViewControl(120 + 26, 43, true);
            //PM2.5单位  (第4个,listControl【3】)
            var btnPmUnit = new NormalViewControl(120 + 26, 43, true);
            btnPmUnit.Y = Application.GetRealHeight(181 + 46);
            btnPmUnit.X = Application.GetRealWidth(153);
            btnPmUnit.Text = "μg/m³";
@@ -165,6 +165,7 @@
            btnPmUnit.TextColor = ZigbeeColor.Current.XMWhite;
            btnPmUnit.TextAlignment = TextAlignment.CenterLeft;
            framePmPic.AddChidren(btnPmUnit);
            this.listControl.Add(btnPmUnit);
        }
        #endregion
@@ -229,10 +230,10 @@
                            //已经接收到网关的反馈
                            return true;
                        }
                    }
                }
            }
            return false;
                    }
                }
            }
            return false;
        }
        #endregion
@@ -261,30 +262,63 @@
            if (pMSensor.currentPmData <= 35 && pMSensor.currentPmData >= 0)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                if (pMSensor.currentPmData < 10)
                {
                    this.listControl[2].Width = Application.GetRealWidth(188 - 70);
                    this.listControl[3].X = Application.GetRealWidth(180 - 70);
                }
                else
                {
                    this.listControl[2].Width = Application.GetRealWidth(193 - 40);
                    this.listControl[3].X = Application.GetRealWidth(137);
                }
            }
            else if (pMSensor.currentPmData <= 75 && pMSensor.currentPmData > 35)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                this.listControl[2].Width = Application.GetRealWidth(193 - 40);
                this.listControl[3].X = Application.GetRealWidth(137);
            }
            else if (pMSensor.currentPmData <= 115 && pMSensor.currentPmData > 75)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                if (pMSensor.currentPmData < 100)
                {
                    this.listControl[2].Width = Application.GetRealWidth(193 - 40);
                    this.listControl[3].X = Application.GetRealWidth(137);
                }
                else
                {
                    this.listControl[2].Width = Application.GetRealWidth(162);
                    this.listControl[3].X = Application.GetRealWidth(153);
                }
            }
            else if (pMSensor.currentPmData <= 150 && pMSensor.currentPmData > 115)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                this.listControl[2].Width = Application.GetRealWidth(162);
                this.listControl[3].X = Application.GetRealWidth(153);
            }
            else if (pMSensor.currentPmData <= 250 && pMSensor.currentPmData > 150)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                this.listControl[2].Width = Application.GetRealWidth(162);
                this.listControl[3].X = Application.GetRealWidth(153);
            }
            else if (pMSensor.currentPmData > 250)
            {
                curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality);
                this.listControl[2].Width = Application.GetRealWidth(162);
                this.listControl[3].X = Application.GetRealWidth(153);
            }
            else
            {
                curQuality = "";
                this.listControl[2].Width = Application.GetRealWidth(162);
                this.listControl[3].X = Application.GetRealWidth(153);
            }
            //设置状态文字
            return curQuality;