From e22fdb94322e6cec38e5e4a9aec13d431a133fde Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期二, 28 四月 2020 16:32:35 +0800 Subject: [PATCH] 上传合并后的代码 --- ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs | 130 +++++++++++++++++++++--------------------- 1 files changed, 65 insertions(+), 65 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs index 0c3df7d..9a5f16c 100755 --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs +++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/RoomView.cs @@ -5,7 +5,7 @@ namespace Shared.Phone.Device.CommonForm { - public class RoomView : FrameLayout + public class RoomView : FrameLayoutBase { /// <summary> /// Room @@ -21,12 +21,12 @@ Button temperatureText; Button humidityText; - /// <summary> - /// 娓╁害璁惧 + /// <summary> + /// 娓╁害璁惧 /// </summary> private CommonDevice temperDevice = null; - /// <summary> - /// 婀垮害璁惧 + /// <summary> + /// 婀垮害璁惧 /// </summary> private CommonDevice humidDevice = null; @@ -121,8 +121,8 @@ var temperatureIcon = new Button { X = Application.GetRealWidth(12), - Width = Application.GetMinRealAverage(58), - Height = Application.GetMinRealAverage(58), + Width = this.GetPictrueRealSize(58), + Height = this.GetPictrueRealSize(58), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Room/Temperature.png" }; @@ -137,8 +137,8 @@ TextAlignment = TextAlignment.CenterLeft }; if (LocalDevice.Current.GetDevice(room.TemperatrueDevice) != null) - { - //杩欎釜璁惧瑕佸瓨鍦ㄦ湰鍦版墠琛� + { + //杩欎釜璁惧瑕佸瓨鍦ㄦ湰鍦版墠琛� temperatureText.Text = room.Temperatrue == 0 ? "0.0鈩�" : room.Temperatrue.ToString() + "鈩�"; } roomTemperatureBackground.AddChidren(temperatureText); @@ -147,8 +147,8 @@ var humidityIcon = new Button { X = temperatureText.Right, - Width = Application.GetMinRealAverage(58), - Height = Application.GetMinRealAverage(58), + Width = this.GetPictrueRealSize(58), + Height = this.GetPictrueRealSize(58), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "Room/Humidity.png" }; @@ -163,8 +163,8 @@ TextAlignment = TextAlignment.CenterLeft }; if (LocalDevice.Current.GetDevice(room.HumidityDevice) != null) - { - //杩欎釜璁惧瑕佸瓨鍦ㄦ湰鍦版墠琛� + { + //杩欎釜璁惧瑕佸瓨鍦ㄦ湰鍦版墠琛� humidityText.Text = room.Humidity == 0 ? "0.0%" : room.Humidity.ToString() + "%"; } roomTemperatureBackground.AddChidren(humidityText); @@ -172,7 +172,7 @@ roomTemperatureBackground.Width = (humidityText.Width + temperatureText.Width + Application.GetRealWidth(150)) > Application.GetRealWidth(600) ? Application.GetRealWidth(600) : (humidityText.Width + temperatureText.Width + Application.GetRealWidth(150)); if (string.IsNullOrEmpty(room.TemperatrueDevice) == false) - { + { //鍙戦�佽幏鍙栨俯搴︾殑鍛戒护 var dev = Common.LocalDevice.Current.GetDevice(room.TemperatrueDevice); HdlDeviceAttributeLogic.Current.SendTemperatureStatuComand(dev); @@ -180,7 +180,7 @@ if (string.IsNullOrEmpty(room.HumidityDevice) == false) { - var dev = Common.LocalDevice.Current.GetDevice(room.HumidityDevice); + var dev = Common.LocalDevice.Current.GetDevice(room.HumidityDevice); HdlDeviceAttributeLogic.Current.SendHumidityStatuComand(dev); } @@ -188,8 +188,8 @@ { X = roomBackView.Width - Application.GetRealWidth(100 + 20), Y = Application.GetRealHeight(20), - Width = Application.GetMinRealAverage(100), - Height = Application.GetMinRealAverage(100), + Width = this.GetPictrueRealSize(100), + Height = this.GetPictrueRealSize(100), UnSelectedImagePath = "Room/List.png", }; roomBackView.AddChidren(roomListBtn); @@ -200,50 +200,50 @@ var form = new UserCenter.Residence.EditorRoomInforForm(); form.AddForm(room); - form.FinishEditorEvent += (roomName2) => - { - //閲嶆柊鍒锋柊鎺т欢 - this.Init(this.room); + form.FinishEditorEvent += (roomName2) => + { + //閲嶆柊鍒锋柊鎺т欢 + this.Init(this.room); }; }; //璁惧灞炴�т笂鎶� - HdlGatewayReceiveLogic.Current.AddAttributeEvent("RoomView" + this.room.Id, ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) => + HdlGatewayReceiveLogic.Current.AddAttributeEvent("RoomView" + this.room.Id, ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) => { - if (this.temperDevice != null) - { - //娓╁害璁惧 - if (report.DeviceAddr == temperDevice.DeviceAddr && report.DeviceEpoint == temperDevice.DeviceEpoint) - { - HdlThreadLogic.Current.RunMain(() => - { - if (((TemperatureSensor)temperDevice).Temperatrue == 0) - { - temperatureText.Text = "0.0鈩�"; - } - else - { - temperatureText.Text = ((TemperatureSensor)temperDevice).Temperatrue + "鈩�"; - } - }, ShowErrorMode.NO); - } + if (this.temperDevice != null) + { + //娓╁害璁惧 + if (report.DeviceAddr == temperDevice.DeviceAddr && report.DeviceEpoint == temperDevice.DeviceEpoint) + { + HdlThreadLogic.Current.RunMain(() => + { + if (((TemperatureSensor)temperDevice).Temperatrue == 0) + { + temperatureText.Text = "0.0鈩�"; + } + else + { + temperatureText.Text = ((TemperatureSensor)temperDevice).Temperatrue + "鈩�"; + } + }, ShowErrorMode.NO); + } } - if (this.humidDevice != null) - { - //婀垮害璁惧 - if (report.DeviceAddr == humidDevice.DeviceAddr && report.DeviceEpoint == humidDevice.DeviceEpoint) - { - HdlThreadLogic.Current.RunMain(() => - { - if (((TemperatureSensor)temperDevice).Humidity == 0) - { - humidityText.Text = "--%"; - } - else - { - humidityText.Text = ((TemperatureSensor)temperDevice).Humidity + "%"; - } - }, ShowErrorMode.NO); - } + if (this.humidDevice != null) + { + //婀垮害璁惧 + if (report.DeviceAddr == humidDevice.DeviceAddr && report.DeviceEpoint == humidDevice.DeviceEpoint) + { + HdlThreadLogic.Current.RunMain(() => + { + if (((TemperatureSensor)temperDevice).Humidity == 0) + { + humidityText.Text = "--%"; + } + else + { + humidityText.Text = ((TemperatureSensor)temperDevice).Humidity + "%"; + } + }, ShowErrorMode.NO); + } } }); } @@ -254,15 +254,15 @@ public void HideName(bool statu) { roomNameBackground.Visible = roomTemperatureBackground.Visible = roomListBtn.Visible = !statu; - } - - /// <summary> - /// - /// </summary> - public override void RemoveFromParent() - { - HdlGatewayReceiveLogic.Current.RemoveEvent("RoomView" + this.room.Id); - base.RemoveFromParent(); + } + + /// <summary> + /// + /// </summary> + public override void RemoveFromParent() + { + HdlGatewayReceiveLogic.Current.RemoveEvent("RoomView" + this.room.Id); + base.RemoveFromParent(); } } } -- Gitblit v1.8.0