| | |
| | | framePic.Width = Application.GetMinRealAverage(887);
|
| | | framePic.Height = Application.GetMinRealAverage(444);
|
| | | framePic.Gravity = Gravity.CenterHorizontal;
|
| | | framePic.Radius = 8;
|
| | | framePic.Radius = (uint)Application.GetRealHeight(17);
|
| | | framePic.BackgroundColor = UserCenterColor.Current.BodyFrameLayout;
|
| | | bodyFrameLayout.AddChidren(framePic);
|
| | | var btnPic = new ImageView();
|
| | | btnPic.Radius = 8;
|
| | | btnPic.Radius = (uint)Application.GetRealHeight(17);
|
| | | btnPic.ImagePath = "RoomIcon/0.JPG";
|
| | | framePic.AddChidren(btnPic);
|
| | | btnPic.MouseUpEventHandler += (sender, e) =>
|
| | | //在上面放一层阴影
|
| | | var btnPicBack = new FrameLayout();
|
| | | btnPicBack.Radius = (uint)Application.GetRealHeight(17);
|
| | | btnPicBack.BackgroundColor = 0x26000000;
|
| | | framePic.AddChidren(btnPicBack);
|
| | | btnPicBack.MouseUpEventHandler += (sender, e) =>
|
| | | {
|
| | | //房间图片选择
|
| | | this.RoomPictrueSelect(btnPic);
|
| | |
| | | btnTemper.Text = Language.StringByID(R.MyInternationalizationString.uGetting);
|
| | |
|
| | | HdlGatewayReceiveLogic.Current.RemoveEvent("TemperatrueDevice");
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("TemperatrueDevice", ReceiveComandDiv.A设备属性上报, (Action<ZigBee.Device.CommonDevice>)((report) =>
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("TemperatrueDevice", ReceiveComandDiv.A设备属性上报, ((report) =>
|
| | | {
|
| | | string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(report);
|
| | | if (newRoom.TemperatrueDevice != mainKeys || btnTemper == null)
|
| | |
| | | {
|
| | | if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue)
|
| | | {
|
| | | if (data.AttriButeData == 0)
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //0℃
|
| | | btnTemper.Text = "0.0℃";
|
| | | }
|
| | | else if (data.AttriButeData > 32767)
|
| | | {
|
| | | //负数(特殊处理)
|
| | | string strValue = (data.AttriButeData - 65536).ToString();
|
| | | //小数点需要一位
|
| | | strValue = strValue.Substring(0, strValue.Length - 1);
|
| | | btnTemper.Text = strValue.Insert(strValue.Length - 1, ".") + "℃";
|
| | | }
|
| | | else
|
| | | {
|
| | | //小数点需要一位
|
| | | string strValue = data.AttriButeData.ToString();
|
| | | strValue = strValue.Substring(0, strValue.Length - 1);
|
| | | btnTemper.Text = strValue.Insert(strValue.Length - 1, ".") + "℃";
|
| | | }
|
| | | if (data.AttriButeData == 0)
|
| | | {
|
| | | //0℃
|
| | | btnTemper.Text = "0.0℃";
|
| | | }
|
| | | else if (data.AttriButeData > 32767)
|
| | | {
|
| | | //负数(特殊处理)
|
| | | string strValue = (data.AttriButeData - 65536).ToString();
|
| | | //小数点需要一位
|
| | | strValue = strValue.Substring(0, strValue.Length - 1);
|
| | | btnTemper.Text = strValue.Insert(strValue.Length - 1, ".") + "℃";
|
| | | }
|
| | | else
|
| | | {
|
| | | //小数点需要一位
|
| | | string strValue = data.AttriButeData.ToString();
|
| | | strValue = strValue.Substring(0, strValue.Length - 1);
|
| | | btnTemper.Text = strValue.Insert(strValue.Length - 1, ".") + "℃";
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | }));
|
| | |
| | | {
|
| | | if (data.AttributeId == (int)ZigBee.Device.AttriButeId.MeasuredValue)
|
| | | {
|
| | | if (data.AttriButeData == 0)
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //0
|
| | | btnHumi.Text = "0.0%";
|
| | | }
|
| | | else
|
| | | {
|
| | | //小数点需要一位(湿度没有负数)
|
| | | string strValue = data.AttriButeData.ToString();
|
| | | strValue = strValue.Substring(0, strValue.Length - 1);
|
| | | btnHumi.Text = strValue.Insert(strValue.Length - 1, ".") + "%";
|
| | | }
|
| | | if (data.AttriButeData == 0)
|
| | | {
|
| | | //0
|
| | | btnHumi.Text = "0.0%";
|
| | | }
|
| | | else
|
| | | {
|
| | | //小数点需要一位(湿度没有负数)
|
| | | string strValue = data.AttriButeData.ToString();
|
| | | strValue = strValue.Substring(0, strValue.Length - 1);
|
| | | btnHumi.Text = strValue.Insert(strValue.Length - 1, ".") + "%";
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | | });
|