| | |
| | | btnHumidityText.TextAlignment = TextAlignment.Center; |
| | | frameHumidityPic.AddChidren(btnHumidityText); |
| | | |
| | | //湿度数据(第1个,listControl【0】) |
| | | //湿度数据 |
| | | var btnHumidityStatus = new NormalViewControl(193, 92, true);
|
| | | btnHumidityStatus.Y = Application.GetRealHeight(181); |
| | | btnHumidityStatus.Text = "20"; |
| | |
| | | btnHumidityStatus.TextColor = ZigbeeColor.Current.XMWhite; |
| | | btnHumidityStatus.TextAlignment = TextAlignment.CenterRight; |
| | | frameHumidityPic.AddChidren(btnHumidityStatus); |
| | | this.listControl.Add(btnHumidityStatus); |
| | | |
| | | //湿度单位 |
| | | var btnHumidityUnit = new NormalViewControl(37 + 81, 40, true);
|
| | | var btnHumidityUnit = new NormalViewControl(60, 40, true);
|
| | | btnHumidityUnit.Y = Application.GetRealHeight(181 + 46); |
| | | btnHumidityUnit.X = Application.GetRealWidth(180); |
| | | btnHumidityUnit.X = btnHumidityStatus.Right; |
| | | btnHumidityUnit.Text = "%"; |
| | | btnHumidityUnit.TextSize = 14; |
| | | btnHumidityUnit.TextColor = ZigbeeColor.Current.XMWhite; |
| | |
| | | btnTemperatureText.TextAlignment = TextAlignment.Center; |
| | | frameTemperaturePic.AddChidren(btnTemperatureText); |
| | | |
| | | //温度数据(第2个,listControl【1】) |
| | | //温度数据 |
| | | var btnTemperatureStatus = new NormalViewControl(193, 92, true);
|
| | | btnTemperatureStatus.Y = Application.GetRealHeight(181); |
| | | btnTemperatureStatus.Text = "20"; |
| | |
| | | btnTemperatureStatus.TextColor = ZigbeeColor.Current.XMWhite; |
| | | btnTemperatureStatus.TextAlignment = TextAlignment.CenterRight; |
| | | frameTemperaturePic.AddChidren(btnTemperatureStatus); |
| | | this.listControl.Add(btnTemperatureStatus); |
| | | |
| | | //温度单位 |
| | | var btnTemperatureUnit = new NormalViewControl(40 + 81, 40, true);
|
| | | var btnTemperatureUnit = new NormalViewControl(50, 40, true);
|
| | | btnTemperatureUnit.Y = Application.GetRealHeight(181 + 46); |
| | | btnTemperatureUnit.X = Application.GetRealWidth(180); |
| | | btnTemperatureUnit.X = btnTemperatureStatus.Right; |
| | | btnTemperatureUnit.Text = "℃"; |
| | | btnTemperatureUnit.TextSize = 14; |
| | | btnTemperatureUnit.TextColor = ZigbeeColor.Current.XMWhite; |
| | |
| | | btnPmText.TextAlignment = TextAlignment.Center; |
| | | framePmPic.AddChidren(btnPmText); |
| | | |
| | | //PM2.5数据(第3个,listControl【2】) |
| | | //PM2.5数据 |
| | | var btnPmStatus = new NormalViewControl(162, 92, true);
|
| | | btnPmStatus.Y = Application.GetRealHeight(181); |
| | | btnPmStatus.Text = "155"; |
| | |
| | | btnPmStatus.TextColor = ZigbeeColor.Current.XMWhite; |
| | | btnPmStatus.TextAlignment = TextAlignment.CenterRight; |
| | | framePmPic.AddChidren(btnPmStatus); |
| | | this.listControl.Add(btnPmStatus); |
| | | |
| | | //PM2.5单位 (第4个,listControl【3】) |
| | | var btnPmUnit = new NormalViewControl(120 + 26, 43, true);
|
| | | btnPmUnit.Y = Application.GetRealHeight(181 + 46); |
| | | btnPmUnit.X = Application.GetRealWidth(153); |
| | | var btnPmUnit = new NormalViewControl(144, 48, true);
|
| | | btnPmUnit.Y = Application.GetRealHeight(181 + 41); |
| | | btnPmUnit.X = btnPmStatus.Right; |
| | | btnPmUnit.Text = "μg/m³"; |
| | | btnPmUnit.TextSize = 14; |
| | | btnPmUnit.TextColor = ZigbeeColor.Current.XMWhite; |
| | | btnPmUnit.TextAlignment = TextAlignment.CenterLeft; |
| | | framePmPic.AddChidren(btnPmUnit); |
| | | this.listControl.Add(btnPmUnit); |
| | | |
| | | this.listControl.Add(btnHumidityStatus);//(第1个,listControl【0】) |
| | | this.listControl.Add(btnTemperatureStatus);//(第2个,listControl【1】) |
| | | this.listControl.Add(btnPmStatus);//(第3个,listControl【2】) |
| | | this.listControl.Add(btnPmUnit);//(第4个,listControl【3】) |
| | | this.listControl.Add(btnHumidityUnit);//(第5个,listControl【4】) |
| | | this.listControl.Add(btnTemperatureUnit);//(第6个,listControl【5】) |
| | | |
| | | } |
| | | #endregion |
| | | |
| | |
| | | private void UpdateStatus() |
| | | { |
| | | //设置状态文字 |
| | | this.listControl[0].Text = pMSensor.currentTemperature.ToString(); |
| | | this.listControl[1].Text = pMSensor.currentHumidity.ToString(); |
| | | this.listControl[0].Text = pMSensor.currentHumidity.ToString(); |
| | | this.listControl[1].Text = pMSensor.currentTemperature.ToString(); |
| | | this.listControl[2].Text = pMSensor.currentPmData.ToString(); |
| | | //设置状态文字 |
| | | var curText = Language.StringByID(R.MyInternationalizationString.AirQuality) + QuailityType(); |
| | | this.SetStatuText(curText); |
| | | |
| | | |
| | | if (pMSensor.currentHumidity <= 9 && pMSensor.currentHumidity >= 0) |
| | | { |
| | | this.listControl[0].Width = Application.GetRealWidth(168); |
| | | this.listControl[4].X = this.listControl[0].Right; |
| | | } |
| | | else if (pMSensor.currentHumidity < 100 && pMSensor.currentHumidity >= 10) |
| | | { |
| | | this.listControl[0].Width = Application.GetRealWidth(184); |
| | | this.listControl[4].X = this.listControl[0].Right; |
| | | } |
| | | else |
| | | { |
| | | this.listControl[0].Width = Application.GetRealWidth(188 + 30); |
| | | this.listControl[4].X = this.listControl[0].Right; |
| | | } |
| | | |
| | | if (pMSensor.currentTemperature <= 9 && pMSensor.currentTemperature >= 0) |
| | | { |
| | | this.listControl[1].Width = Application.GetRealWidth(168); |
| | | this.listControl[5].X = this.listControl[1].Right; |
| | | } |
| | | else if (pMSensor.currentTemperature < 100 && pMSensor.currentTemperature >= 10) |
| | | { |
| | | this.listControl[1].Width = Application.GetRealWidth(190); |
| | | this.listControl[5].X = this.listControl[1].Right; |
| | | } |
| | | else |
| | | { |
| | | this.listControl[1].Width = Application.GetRealWidth(188 + 30); |
| | | this.listControl[5].X = this.listControl[1].Right; |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | if (pMSensor.currentPmData < 10) |
| | | { |
| | | this.listControl[2].Width = Application.GetRealWidth(188 - 70); |
| | | this.listControl[3].X = Application.GetRealWidth(180 - 70); |
| | | this.listControl[2].Width = Application.GetRealWidth(125); |
| | | this.listControl[3].X = this.listControl[2].Right; |
| | | } |
| | | else |
| | | { |
| | | this.listControl[2].Width = Application.GetRealWidth(193 - 40); |
| | | this.listControl[3].X = Application.GetRealWidth(137); |
| | | this.listControl[2].Width = Application.GetRealWidth(145); |
| | | this.listControl[3].X = this.listControl[2].Right; |
| | | } |
| | | } |
| | | |
| | | 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); |
| | | curQuality = Language.StringByID(R.MyInternationalizationString.GoodAirQuality); |
| | | this.listControl[2].Width = Application.GetRealWidth(145); |
| | | this.listControl[3].X = this.listControl[2].Right; |
| | | } |
| | | else if (pMSensor.currentPmData <= 115 && pMSensor.currentPmData > 75) |
| | | { |
| | | curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); |
| | | curQuality = Language.StringByID(R.MyInternationalizationString.LightPollution); |
| | | |
| | | if (pMSensor.currentPmData < 100) |
| | | { |
| | | this.listControl[2].Width = Application.GetRealWidth(193 - 40); |
| | | this.listControl[3].X = Application.GetRealWidth(137); |
| | | this.listControl[2].Width = Application.GetRealWidth(145); |
| | | this.listControl[3].X = this.listControl[2].Right; |
| | | } |
| | | else |
| | | { |
| | | this.listControl[2].Width = Application.GetRealWidth(162); |
| | | this.listControl[3].X = Application.GetRealWidth(153); |
| | | this.listControl[3].X = this.listControl[2].Right; |
| | | } |
| | | } |
| | | else if (pMSensor.currentPmData <= 150 && pMSensor.currentPmData > 115) |
| | | { |
| | | curQuality = Language.StringByID(R.MyInternationalizationString.ExcellentAirQuality); |
| | | curQuality = Language.StringByID(R.MyInternationalizationString.Moderatelyolluted); |
| | | this.listControl[2].Width = Application.GetRealWidth(162); |
| | | this.listControl[3].X = Application.GetRealWidth(153); |
| | | this.listControl[3].X = this.listControl[2].Right; |
| | | } |
| | | 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); |
| | | curQuality = Language.StringByID(R.MyInternationalizationString.HeavyPollution); |
| | | this.listControl[2].Width = Application.GetRealWidth(176); |
| | | this.listControl[3].X = this.listControl[2].Right; |
| | | } |
| | | 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); |
| | | curQuality = Language.StringByID(R.MyInternationalizationString.SeriousPollution); |
| | | this.listControl[2].Width = Application.GetRealWidth(176); |
| | | this.listControl[3].X = this.listControl[2].Right; |
| | | } |
| | | else |
| | | { |
| | | curQuality = ""; |
| | | this.listControl[2].Width = Application.GetRealWidth(162); |
| | | this.listControl[3].X = Application.GetRealWidth(153); |
| | | this.listControl[3].X = this.listControl[2].Right; |
| | | } |
| | | //设置状态文字 |
| | | return curQuality; |