| | |
| | | btnSetLight.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | //设置灯事件 |
| | | //var AirQualitySensorLedBindTime = new Shared.Phone.UserCenter.DeviceBind.AirQualitySensorLedBindTime(aqSensor); |
| | | //Shared.Phone.UserView.HomePage.Instance.AddChidren(AirQualitySensorLedBindTime); |
| | | //Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | //AirQualitySensorLedBindTime.Show(); |
| | | var AirQualitySensorLedBindTime = new Shared.Phone.UserCenter.DeviceBind.AirQualitySensorLedBindTime(aqSensor); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(AirQualitySensorLedBindTime); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | AirQualitySensorLedBindTime.Show(); |
| | | }; |
| | | btnHistoryText.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | //查看历史记录事件 |
| | | var form = new DeviceTemperatureHistoryForm(); |
| | | form.AddForm(this.device); |
| | | }; |
| | | } |
| | | |
| | |
| | | btnPmUnit.TextColor = ZigbeeColor.Current.XMWhite; |
| | | btnPmUnit.TextAlignment = TextAlignment.BottomLeft; |
| | | framePmTextFrameLayout.AddChidren(btnPmUnit); |
| | | |
| | | //产品部要求,暂时去掉Co2 |
| | | //Co2容器 |
| | | var frameCo2Pic = new FrameLayout(); |
| | | /* var frameCo2Pic = new FrameLayout(); |
| | | frameCo2Pic.X = Application.GetRealWidth(518); |
| | | frameCo2Pic.Y = framePmPic.Y; |
| | | frameCo2Pic.Width = Application.GetMinRealAverage(311); |
| | | frameCo2Pic.Height = Application.GetMinRealAverage(351); |
| | | frameCo2Pic.BackgroundImagePath = "AirQualitySensor/CO2Pic.png"; |
| | | frameWhiteBack.AddChidren(frameCo2Pic); |
| | | frameWhiteBack.AddChidren(frameCo2Pic);*/ |
| | | //Co2文本 |
| | | var btnCo2Text = new NormalViewControl(338, 49, true); |
| | | /*var btnCo2Text = new NormalViewControl(338, 49, true); |
| | | btnCo2Text.Y = Application.GetRealHeight(45); |
| | | btnCo2Text.Text = "CO₂"; |
| | | btnCo2Text.TextSize = 12; |
| | | btnCo2Text.TextColor = ZigbeeColor.Current.XMWhite; |
| | | btnCo2Text.TextAlignment = TextAlignment.Center; |
| | | frameCo2Pic.AddChidren(btnCo2Text); |
| | | frameCo2Pic.AddChidren(btnCo2Text);*/ |
| | | |
| | | // Co2文本容器 |
| | | var frameCo2TextFrameLayout = new FrameLayout(); |
| | | /* var frameCo2TextFrameLayout = new FrameLayout(); |
| | | frameCo2TextFrameLayout.Y = Application.GetRealHeight(113); |
| | | frameCo2TextFrameLayout.Gravity = Gravity.CenterHorizontal; |
| | | frameCo2TextFrameLayout.Height = Application.GetRealHeight(160); |
| | | frameCo2Pic.AddChidren(frameCo2TextFrameLayout); |
| | | frameCo2Pic.AddChidren(frameCo2TextFrameLayout);*/ |
| | | |
| | | //Co2数据 |
| | | var btnCo2Status = new NormalViewControl(162, 160, true); |
| | | /*var btnCo2Status = new NormalViewControl(162, 160, true); |
| | | btnCo2Status.Text = "155"; |
| | | btnCo2Status.TextSize = 30; |
| | | btnCo2Status.TextColor = ZigbeeColor.Current.XMWhite; |
| | | btnCo2Status.TextAlignment = TextAlignment.BottomRight; |
| | | frameCo2TextFrameLayout.AddChidren(btnCo2Status); |
| | | frameCo2TextFrameLayout.AddChidren(btnCo2Status);*/ |
| | | |
| | | //Co2单位 (第4个,listControl【4】) |
| | | var btnCo2Unit = new NormalViewControl(112, 148, true); |
| | | /*var btnCo2Unit = new NormalViewControl(112, 148, true); |
| | | btnCo2Unit.X = btnPmStatus.Right; |
| | | btnCo2Unit.Text = "ppm³"; |
| | | btnCo2Unit.TextSize = 14; |
| | | btnCo2Unit.TextColor = ZigbeeColor.Current.XMWhite; |
| | | btnCo2Unit.TextAlignment = TextAlignment.BottomLeft; |
| | | frameCo2TextFrameLayout.AddChidren(btnCo2Unit); |
| | | frameCo2TextFrameLayout.AddChidren(btnCo2Unit);*/ |
| | | |
| | | this.listControl.Add(btnHumidityStatus);//(第1个,listControl【0】) |
| | | this.listControl.Add(btnTemperatureStatus);//(第2个,listControl【1】) |
| | |
| | | this.listControl.Add(btnPmUnit);//(第4个,listControl【3】) |
| | | this.listControl.Add(btnHumidityUnit);//(第5个,listControl【4】) |
| | | this.listControl.Add(btnTemperatureUnit);//(第6个,listControl【5】) |
| | | this.listControl.Add(btnCo2Status);//(第7个,listControl【6】) |
| | | this.listControl.Add(btnCo2Unit);//(第8个,listControl【7】) |
| | | //this.listControl.Add(btnCo2Status);//(第7个,listControl【6】) |
| | | //this.listControl.Add(btnCo2Unit);//(第8个,listControl【7】) |
| | | |
| | | this.listFrameLayout.Add(frameHumidityTextFrameLayout);//(第1个,listFrameLayout【0】) |
| | | this.listFrameLayout.Add(frameTemperatureTextFrameLayout);//(第2个,listFrameLayout【1】) |
| | | this.listFrameLayout.Add(framePmTextFrameLayout);//(第3个,listFrameLayout【2】) |
| | | this.listFrameLayout.Add(frameCo2TextFrameLayout);//(第4个,listFrameLayout【3】) |
| | | //this.listFrameLayout.Add(frameCo2TextFrameLayout);//(第4个,listFrameLayout【3】) |
| | | } |
| | | |
| | | #endregion |
| | |
| | | this.listControl[0].Text = aqSensor.currentHumidity.ToString(); |
| | | this.listControl[1].Text = aqSensor.currentTemperature.ToString(); |
| | | this.listControl[2].Text = aqSensor.currentPmData.ToString(); |
| | | this.listControl[6].Text = aqSensor.currentCO2.ToString(); |
| | | //this.listControl[6].Text = aqSensor.currentCO2.ToString(); |
| | | //设置状态文字 |
| | | var curText = Language.StringByID(R.MyInternationalizationString.AirQuality) + QuailityType(); |
| | | this.SetStatuText(curText); |
| | |
| | | this.listControl[3].X = this.listControl[2].Right; |
| | | this.listControl[3].Width = this.listControl[3].GetRealWidthByText(); |
| | | |
| | | this.listControl[6].Width = this.listControl[6].GetRealWidthByText(); |
| | | this.listControl[7].X = this.listControl[6].Right; |
| | | //this.listControl[6].Width = this.listControl[6].GetRealWidthByText(); |
| | | //this.listControl[7].X = this.listControl[6].Right; |
| | | |
| | | this.listFrameLayout[0].Width = this.listControl[0].Width + this.listControl[4].Width; |
| | | this.listFrameLayout[1].Width = this.listControl[1].Width + this.listControl[5].Width; |
| | | this.listFrameLayout[2].Width = this.listControl[2].Width + this.listControl[3].Width; |
| | | this.listFrameLayout[3].Width = this.listControl[6].Width + this.listControl[7].Width; |
| | | //this.listFrameLayout[3].Width = this.listControl[6].Width + this.listControl[7].Width; |
| | | this.listFrameLayout[0].Gravity = Gravity.CenterHorizontal; |
| | | this.listFrameLayout[1].Gravity = Gravity.CenterHorizontal; |
| | | this.listFrameLayout[2].Gravity = Gravity.CenterHorizontal; |
| | | this.listFrameLayout[3].Gravity = Gravity.CenterHorizontal; |
| | | //this.listFrameLayout[3].Gravity = Gravity.CenterHorizontal; |
| | | } |
| | | |
| | | /// <summary> |