| | |
| | | framePmPic.AddChidren(btnPmStatus); |
| | | this.listControl.Add(btnPmStatus); |
| | | |
| | | //PM2.5单位 |
| | | //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.TextColor = ZigbeeColor.Current.XMWhite; |
| | | btnPmUnit.TextAlignment = TextAlignment.CenterLeft; |
| | | framePmPic.AddChidren(btnPmUnit); |
| | | this.listControl.Add(btnPmUnit); |
| | | |
| | | frameHumidityPic.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | pMSensor.currentPmData = 35; |
| | | UpdateStatus(); |
| | | }; |
| | | frameTemperaturePic.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | pMSensor.currentPmData = 99; |
| | | UpdateStatus(); |
| | | }; |
| | | framePmPic.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | pMSensor.currentPmData = 100; |
| | | UpdateStatus(); |
| | | }; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | if (pMSensor.currentPmData <= 35 && pMSensor.currentPmData >= 0) |
| | | { |
| | | curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); |
| | | |
| | | if (pMSensor.currentPmData < 10) |
| | | { |
| | | this.listControl[2].Width = Application.GetRealWidth(193 - 70); |
| | | this.listControl[3].X = Application.GetRealWidth(180 - 70); |
| | | } |
| | | else |
| | | { |
| | | this.listControl[2].Width = Application.GetRealWidth(193 - 40); |
| | | this.listControl[3].X = Application.GetRealWidth(153 - 25); |
| | | |
| | | this.listControl[2].BackgroundColor = 0xff00ff00; |
| | | this.listControl[3].BackgroundColor = 0xff00ffff; |
| | | } |
| | | } |
| | | |
| | | 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(153 - 25); |
| | | } |
| | | 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(153 - 25); |
| | | this.listControl[2].BackgroundColor = 0xff00ff00; |
| | | this.listControl[3].BackgroundColor = 0xff00ffff; |
| | | } |
| | | else |
| | | { |
| | | this.listControl[2].Width = Application.GetRealWidth(162); |
| | | this.listControl[3].X = Application.GetRealWidth(153); |
| | | this.listControl[2].BackgroundColor = 0xff00ff00; |
| | | this.listControl[3].BackgroundColor = 0xff00ffff; |
| | | } |
| | | } |
| | | 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(0); |
| | | this.listControl[3].Gravity = Gravity.CenterHorizontal; |
| | | } |
| | | //设置状态文字 |
| | | return curQuality; |