From 9cc8fd11b13813adbdd3c6c31554e5c0bebf4026 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期五, 21 八月 2020 19:53:49 +0800 Subject: [PATCH] 发布到商店的版本 --- ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs | 95 ++++++++++++++++++++++++++++++----------------- 1 files changed, 61 insertions(+), 34 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs index 07b2928..afd1449 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/AirConditioner/IndoorUnitListForm.cs @@ -57,7 +57,7 @@ var frameTemp = new FrameLayout(); frameTemp.Height = Application.GetRealHeight(69); - listView.AddChidrenFrame(frameTemp); + listView.AddChidren(frameTemp); HdlThreadLogic.Current.RunMainInThread(() => { @@ -68,7 +68,7 @@ } var frameTemp2 = new FrameLayout(); frameTemp2.Height = Application.GetRealHeight(29); - listView.AddChidrenFrame(frameTemp2); + listView.AddChidren(frameTemp2); //鏁版嵁鎺ユ敹 this.StartReceiveDataEvent(); @@ -86,21 +86,21 @@ { var rowInfo = new RowControlInfo(); - var frameTable = new FrameLayoutControl(); + var frameTable = new FrameLayoutStatuControl(); frameTable.UseClickStatu = false; frameTable.Width = Application.GetRealWidth(994); frameTable.Height = Application.GetRealHeight(337); frameTable.BackgroundImagePath = "Item/IndoorUnitGround.png"; frameTable.Gravity = Gravity.CenterHorizontal; - listView.AddChidrenFrame(frameTable); + listView.AddChidren(frameTable); //璁惧鍥炬爣 var btnIconBack = new FrameLayout(); btnIconBack.X = Application.GetRealWidth(46); btnIconBack.Y = Application.GetRealHeight(43); - btnIconBack.Height = Application.GetMinRealAverage(112); - btnIconBack.Width = Application.GetMinRealAverage(112); - btnIconBack.Radius = (uint)Application.GetMinRealAverage(112) / 2; + btnIconBack.Height = this.GetPictrueRealSize(112); + btnIconBack.Width = this.GetPictrueRealSize(112); + btnIconBack.Radius = (uint)this.GetPictrueRealSize(112) / 2; btnIconBack.BackgroundColor = 0xfff5f6fa; frameTable.AddChidren(btnIconBack, ChidrenBindMode.NotBind); rowInfo.btnIconBack = btnIconBack; @@ -109,7 +109,7 @@ btnIcon.Gravity = Gravity.Center; Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, device); btnIconBack.AddChidren(btnIcon); - frameTable.ChangedChidrenBindMode(btnIconBack, ChidrenBindMode.BindEventOnly); + frameTable.ChangedChidrenBindMode(btnIconBack, ChidrenBindMode.BindEvent); rowInfo.btnIcon = btnIcon; //璁惧鍚嶇О @@ -117,7 +117,7 @@ btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device); btnDeviceName.X = Application.GetRealWidth(193); btnDeviceName.Y = Application.GetRealHeight(45); - frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEventOnly); + frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEvent); rowInfo.btnDeviceName = btnDeviceName; //鎴块棿 var btnRoom = new NormalViewControl(400, 50, true); @@ -126,16 +126,26 @@ btnRoom.TextSize = 12; btnRoom.TextColor = UserCenterColor.Current.TextGrayColor1; btnRoom.Text = HdlRoomLogic.Current.GetRoomNameByDevice(device); - frameTable.AddChidren(btnRoom, ChidrenBindMode.BindEventOnly); + frameTable.AddChidren(btnRoom, ChidrenBindMode.BindEvent); rowInfo.btnRoom = btnRoom; //鎽勬皬搴� var btnValue = new NormalViewControl(300, 60, true); btnValue.Y = Application.GetRealHeight(58); btnValue.X = frameTable.Width - Application.GetRealWidth(300 + 58); btnValue.TextAlignment = TextAlignment.CenterRight; - btnValue.TextID = R.MyInternationalizationString.uGetting; - frameTable.AddChidren(btnValue, ChidrenBindMode.BindEventOnly); + frameTable.AddChidren(btnValue, ChidrenBindMode.BindEvent); rowInfo.btnValue = btnValue; + //瀹ゅ唴娓╁害 + if (device.currentLocalTemperature == 0) + { + //0鈩� + btnValue.Text = "0.0鈩�"; + } + else + { + btnValue.Text = device.currentLocalTemperature + ".0鈩�"; + } + //璀﹀憡鍥炬爣 var btnWarningIcon = new IconViewControl(69); btnWarningIcon.X = btnIconBack.X; @@ -164,28 +174,46 @@ { if (btnSwitch.IsSelected == false) { - //鎵撳紑绌鸿皟 - var result = await HdlDeviceAirConditionerLogic.Current.OpenAirConditioner(device); - if (result == false) + //濡傛灉涓嶆槸铏氭嫙浣忓畢鐨勮瘽 + if (Common.Config.Instance.Home.IsVirtually == false) { - return; + //鎵撳紑绌鸿皟 + var result = await HdlDeviceAirConditionerLogic.Current.OpenAirConditioner(device); + if (result == false) + { + return; + } } btnIcon.IsSelected = true; btnIconBack.BackgroundColor = 0xfffef1ed; } else { - //鍏抽棴绌鸿皟 - var result = await HdlDeviceAirConditionerLogic.Current.CloseAirConditioner(device); - if (result == false) + //濡傛灉涓嶆槸铏氭嫙浣忓畢鐨勮瘽 + if (Common.Config.Instance.Home.IsVirtually == false) { - return; + //鍏抽棴绌鸿皟 + var result = await HdlDeviceAirConditionerLogic.Current.CloseAirConditioner(device); + if (result == false) + { + return; + } } btnIcon.IsSelected = false; btnIconBack.BackgroundColor = 0xfff5f6fa; } btnSwitch.IsSelected = !btnSwitch.IsSelected; + //濡傛灉鏄櫄鎷熶綇瀹呯殑璇� + if (Common.Config.Instance.Home.IsVirtually == true) + { + device.currentSystemMode = btnSwitch.IsSelected == true ? 3 : 0; + } }; + //濡傛灉鏄睍绀烘ā鏉跨殑璇� + if (Common.Config.Instance.Home.IsShowTemplate == true) + { + btnSwitch.CanClick = false; + } frameTable.ButtonClickEvent += (sender, e) => { @@ -207,6 +235,11 @@ /// </summary> private void SetReadAttributeComand() { + //濡傛灉鏄櫄鎷熶綇瀹呮垨鑰呭睍绀烘ā鏉跨殑璇� + if (Common.Config.Instance.Home.IsShowTemplate == true || Common.Config.Instance.Home.IsVirtually == true) + { + return; + } HdlThreadLogic.Current.RunThread(() => { for (int i = 0; i < listDevice.Count; i++) @@ -216,7 +249,7 @@ return; } //璇诲彇鐘舵�� - Phone.Device.DeviceLogic.ReadDeviceAttributeLogic.Instance.SendThermostatStatuComand(listDevice[i]); + HdlDeviceAttributeLogic.Current.SendThermostatStatuComand(listDevice[i]); System.Threading.Thread.Sleep(200); } }); @@ -238,6 +271,11 @@ { return; } + var localDevice = Common.LocalDevice.Current.GetDevice(mainkeys); + if (localDevice == null) + { + return; + } var rowInfo = dicControl[mainkeys]; for (int i = 0; i < device.DeviceStatusReport.AttriBute.Count; i++) @@ -248,25 +286,14 @@ HdlThreadLogic.Current.RunMain(() => { //瀹ゅ唴娓╁害 - if (data.AttriButeData == 0) + if (((AC)localDevice).currentLocalTemperature == 0) { //0鈩� rowInfo.btnValue.Text = "0.0鈩�"; } - else if (data.AttriButeData > 32767) - { - //璐熸暟(鐗规畩澶勭悊) - string strValue = (data.AttriButeData - 65536).ToString(); - //灏忔暟鐐归渶瑕佷竴浣� - strValue = strValue.Substring(0, strValue.Length - 1); - rowInfo.btnValue.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�"; - } else { - //灏忔暟鐐归渶瑕佷竴浣� - string strValue = data.AttriButeData.ToString(); - strValue = strValue.Substring(0, strValue.Length - 1); - rowInfo.btnValue.Text = strValue.Insert(strValue.Length - 1, ".") + "鈩�"; + rowInfo.btnValue.Text = ((AC)localDevice).currentLocalTemperature + ".0鈩�"; } }); } -- Gitblit v1.8.0