From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 17 十二月 2020 09:07:13 +0800 Subject: [PATCH] 新云端Ver1.3 --- ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/PaneTargetsBaseForm.cs | 95 ++++++++++++++++++++++++++--------------------- 1 files changed, 53 insertions(+), 42 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/PaneTargetsBaseForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/PaneTargetsBaseForm.cs index 7fdf549..0fdd8c3 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/PaneTargetsBaseForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/PaneTargetsBaseForm.cs @@ -7,6 +7,9 @@ using static ZigBee.Device.Panel; namespace Shared.Phone.UserCenter.Device.Bind { + /// <summary> + /// 鐗规畩闈㈡澘鐨勭粦瀹氱晫闈€�愬彧鑳界粦瀹氱壒瀹氱被鍨嬶紝姣忕绫诲瀷鍙湁涓�涓洰鏍囥�� + /// </summary> public class PaneTargetsBaseForm : BindCommonLayout { #region 鏋勯�犲嚱鏁� @@ -14,7 +17,7 @@ /// 鏋勯�犲嚱鏁� /// </summary> /// <param name="device"></param> - /// <param name="deviceBindType">1:鏂伴;2:娓╁害浼犳劅鍣�;3:婀垮害浼犳劅鍣�;4:PM2.5浼犳劅鍣�;5:绌鸿皟鐩爣</param> + /// <param name="deviceBindType">1:鏂伴;2:娓╁害浼犳劅鍣�;3:婀垮害浼犳劅鍣�;4:PM2.5浼犳劅鍣�;5:绌鸿皟鐩爣,6:鍦版殩鐩爣銆愭殏鏃舵病鍋氾紝鍥犱负娌℃湁璇ヨ澶囷紝鍚庢湡澧炲姞銆�</param> /// <param name="bindDev">缁戝畾鐩爣 </param> public PaneTargetsBaseForm(CommonDevice device, CommonDevice bindDev, DeviceBind.BindInfo.BindType deviceBindType) { @@ -68,6 +71,7 @@ /// 3:婀垮害浼犳劅鍣� /// 4:PM2.5浼犳劅鍣� /// 5:绌鸿皟鐩爣 + /// 6:鍦版殩鐩爣銆愭殏鏃舵病鍋氾紝鍥犱负娌℃湁璇ヨ澶囷紝鍚庢湡澧炲姞銆� /// </summary> DeviceBind.BindInfo.BindType curDeviceBindType = 0; /// <summary> @@ -131,6 +135,10 @@ /// </summary> public Action<string> actionAcTarget = null; /// <summary> + /// Fh缁戝畾鐩爣鍥炶皟 + /// </summary> + public Action<string> actionFhTarget = null; + /// <summary> /// 鏄惁鑳藉埛鏂� /// </summary> private bool canFresh = false; @@ -172,6 +180,9 @@ break; case DeviceBind.BindInfo.BindType.AC: titleText = Language.StringByID(R.MyInternationalizationString.AcTargets); + break; + case DeviceBind.BindInfo.BindType.Fh: + titleText = Language.StringByID(R.MyInternationalizationString.uFloorHeatingTarget); break; } this.TopFrameLayout(this, titleText); @@ -260,7 +271,7 @@ TextAlignment = TextAlignment.CenterLeft, }; bottomTipPicFrameLayout.AddChidren(btnTipText); - bottomTipPicFrameLayout.Width = btnTipPicFrameLayout.Width + Application.GetMinReal(2) + btnTipText.GetTextWidth(); + bottomTipPicFrameLayout.Width = btnTipPicFrameLayout.Width + Application.GetMinReal(12) + btnTipText.GetTextWidth(); bottomTipPicFrameLayout.Gravity = Gravity.CenterHorizontal; EventHandler<MouseEventArgs> eHandlerEmptyTargets = (sender, e) => @@ -291,8 +302,8 @@ btnFinifh = new Button() { - Width = Application.GetRealWidth(907), - Height = Application.GetRealHeight(127), + Width = Application.GetRealWidth(907), + Height = Application.GetRealHeight(127), Y = Application.GetRealHeight(49 + 35), Gravity = Gravity.CenterHorizontal, Radius = (uint)Application.GetRealHeight(127) / 2, @@ -389,7 +400,7 @@ } } - if (index == roomTempList.Count - 1 && index > 3) + if (index == roomTempList.Count - 1 && index > 2) { var btnRoomFrameLayoutEmpty = new FrameLayout { @@ -516,7 +527,7 @@ X = devicePic.Right + Application.GetRealWidth(20), TextAlignment = TextAlignment.CenterLeft, TextSize = 15, - Text = Common.LocalDevice.Current.GetDeviceEpointName(device), + Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device), }; rowLayout.AddChidren(btnBindName); @@ -545,13 +556,13 @@ { line2.Visible = false; } - if (Common.LocalDevice.Current.CheckDeviceIsOnline(device) == true) - { - btnBindName.TextColor = Shared.Common.ZigbeeColor.Current.TextBlack; - } - else - { - btnBindName.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3; + if (HdlDeviceCommonLogic.Current.CheckDeviceIsOnline(device) == true) + { + btnBindName.TextColor = Shared.Common.ZigbeeColor.Current.TextBlack; + } + else + { + btnBindName.TextColor = Shared.Common.ZigbeeColor.Current.XMGray3; } switch (curDeviceBindType) { @@ -562,14 +573,14 @@ devicePic.UnSelectedImagePath = "Device/SensorTemperature.png"; if (device.Type == DeviceType.PMSensor) { - btnBindName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); + btnBindName.Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); } break; case DeviceBind.BindInfo.BindType.Humidity: devicePic.UnSelectedImagePath = "Device/SensorHumidity.png"; if (device.Type == DeviceType.PMSensor) { - btnBindName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); + btnBindName.Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); } break; case DeviceBind.BindInfo.BindType.PM: @@ -715,7 +726,7 @@ canFresh = false; midVerticalScrolViewLayout.EndHeaderRefreshing(); CommonPage.Loading.Hide(); - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "5007" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance); this.midFrameLayout.RemoveAll(); @@ -741,12 +752,12 @@ var mainKey = bindDev.BindMacAddr + bindDev.BindEpoint; //鍒嗛厤鐨勭洰鏍囧垪琛� - if (Shared.Common.LocalDevice.Current.listAllDevice.Count != 0) + if (HdlDeviceCommonLogic.Current.listAllDevice.Count != 0) { var dev = currentPanelSupportBindDeviceList.Find(obj => (obj != null) && (obj.DeviceAddr + obj.DeviceEpoint == mainKey)); if (dev != null) { - var device = LocalDevice.Current.GetDevice(dev.DeviceAddr, dev.DeviceEpoint); + var device = HdlDeviceCommonLogic.Current.GetDevice(dev.DeviceAddr, dev.DeviceEpoint); if (device != null) { BindTypeTargetsList(device, bindDev); @@ -760,7 +771,7 @@ var dev = undistruibuteDevList.Find(obj => (obj != null) && (obj.DeviceAddr + obj.DeviceEpoint == mainKey)); if (dev != null) { - var device = LocalDevice.Current.GetDevice(dev.DeviceAddr, dev.DeviceEpoint); + var device = HdlDeviceCommonLogic.Current.GetDevice(dev.DeviceAddr, dev.DeviceEpoint); if (device != null) { BindTypeTargetsList(device, bindDev); @@ -823,7 +834,7 @@ foreach (var dev in targetList) { //鑾峰彇鏈湴璁惧鍒楄〃 - var localDeviceList = Shared.Common.LocalDevice.Current.listAllDevice; + var localDeviceList = HdlDeviceCommonLogic.Current.listAllDevice; var tempDev = localDeviceList.Find(obj => obj.DeviceAddr == dev.DeviceAddr && obj.DeviceEpoint == dev.DeviceEpoint); if (tempDev != null) { @@ -833,17 +844,17 @@ { curControlDev.currentSelectRoomId = tempDevRoom.Id; curControlDev.currentSelectFloorId = tempDevRoom.FloorId; - } - else - { - curControlDev.currentSelectRoomId = "UndistributedId"; + } + else + { + curControlDev.currentSelectRoomId = "UndistributedId"; } } if (canUpdateBindName) { //鏇存柊澶栭潰鐩爣鍚嶅瓧锛氬叿浣撳悕瀛椼�愬埛鏂版湰鍦扮晫闈細瀵艰嚧澶栭儴鐩爣鍙樺寲銆� - string bindName = Common.LocalDevice.Current.GetDeviceEpointName(dev); + string bindName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(dev); switch (curDeviceBindType) { case BindInfo.BindType.Temperature: @@ -901,7 +912,7 @@ Application.RunOnMainThread(() => { CommonPage.Loading.Start(""); }); if (btnTipPic.IsSelected) { - //鍒犻櫎鎯呭喌1:缁戝畾绌虹洰鏍囧繀椤诲彇娑堟寜閿腑宸茬粡瀛樺湪鐨勭洰鏍� + //褰撶粦瀹氱┖鐩爣锛岃鍒犻櫎宸茬粡瀛樺湪鎸夐敭鐨勭洰鏍� if (oldTargetList.Count != 0) { //鍒犻櫎鎸夐敭涓凡缁忕粦瀹氱殑鐩爣涓暟銆愬垹闄ゆ垚鍔熶釜鏁般�� @@ -920,7 +931,7 @@ { Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5003_1" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); CommonPage.Loading.Hide(); ShowReLoadView(); @@ -968,7 +979,7 @@ { Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5003_3" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); btnFinifh.Enable = true; btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; CommonPage.Loading.Hide(); @@ -1000,7 +1011,7 @@ { Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5003_2" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); btnFinifh.Enable = true; btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; CommonPage.Loading.Hide(); @@ -1082,7 +1093,7 @@ { Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5003_4" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); CommonPage.Loading.Hide(); ShowReLoadView(); @@ -1109,7 +1120,7 @@ { Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5003_6" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); btnFinifh.Enable = true; btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; CommonPage.Loading.Hide(); @@ -1131,7 +1142,7 @@ { Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5003_5" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); btnFinifh.Enable = true; btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; CommonPage.Loading.Hide(); @@ -1147,7 +1158,7 @@ { Application.RunOnMainThread(() => { - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5003_7" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); btnFinifh.Enable = true; btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; CommonPage.Loading.Hide(); @@ -1185,19 +1196,19 @@ addBindInfo.BindType = 0; addBindInfo.BindMacAddr = de.DeviceAddr; addBindInfo.BindEpoint = de.DeviceEpoint; - addBindeDev.BindName = Common.LocalDevice.Current.GetDeviceEpointName(de); + addBindeDev.BindName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(de); switch (curDeviceBindType) { case BindInfo.BindType.Temperature: if (de.Type == DeviceType.PMSensor) { - addBindeDev.BindName = Common.LocalDevice.Current.GetDeviceEpointName(de) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); + addBindeDev.BindName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(de) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); } break; case BindInfo.BindType.Humidity: if (de.Type == DeviceType.PMSensor) { - addBindeDev.BindName = Common.LocalDevice.Current.GetDeviceEpointName(de) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); + addBindeDev.BindName = HdlDeviceCommonLogic.Current.GetDeviceEpointName(de) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); } break; } @@ -1225,7 +1236,7 @@ Application.RunOnMainThread(() => { CommonPage.Loading.Hide(); - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "5001" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); ShowReLoadView(); ReLoadAction += () => @@ -1265,7 +1276,7 @@ new Tip() { MaxWidth = 150, - Text = Language.StringByID(R.MyInternationalizationString.BindFailed), + Text = Language.StringByID(R.MyInternationalizationString.BindFailed) + "(" + "5001_1" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); @@ -1281,7 +1292,7 @@ new Tip() { MaxWidth = 150, - Text = Language.StringByID(R.MyInternationalizationString.BindUnknownError), + Text = Language.StringByID(R.MyInternationalizationString.BindUnknownError) + "(" + "5001_2" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(CommonPage.Instance); @@ -1395,9 +1406,9 @@ { case BindInfo.BindType.FreshAir: //鑾峰彇璁惧绫诲瀷鐨� - var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); + var deviceEnumInfo = HdlDeviceCommonLogic.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); //鏂伴闈㈡澘鐨勬柊椋庤澶囷紝鍒欎笉鏄剧ず - if (deviceEnumInfo.ConcreteType != Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir) + if (deviceEnumInfo.ConcreteType != DeviceConcreteType.ButtonPanel_FangyueFreshAir) { if (device.Type == DeviceType.FreshAir) { @@ -1487,7 +1498,7 @@ return; } //鑾峰彇鏈湴璁惧鍒楄〃 - var localDeviceList = Shared.Common.LocalDevice.Current.listAllDevice; + var localDeviceList = HdlDeviceCommonLogic.Current.listAllDevice; var tempDev = localDeviceList.Find(obj => obj.DeviceAddr == bindDev.DeviceAddr && obj.DeviceEpoint == bindDev.DeviceEpoint); if (tempDev != null) { -- Gitblit v1.8.0