From 9a4b76398009cf76c508d61f7e48fb6f5cb7ac2d Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期二, 21 七月 2020 09:46:53 +0800 Subject: [PATCH] 请合并最新多功能面板代码 --- ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs | 56 ++++++++++++++++++++++++++------------------------------ 1 files changed, 26 insertions(+), 30 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs index f502459..4d17c9a 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/Base/DeviceDetailCardCommonForm.cs @@ -26,6 +26,10 @@ /// </summary> public Common.Room nowSelectRoom = null; /// <summary> + /// 鏍囪瀹冩槸鐢卞摢涓帶浠惰皟璧风殑 + /// </summary> + public ViewGroup RowOrCardControl = null; + /// <summary> /// 鐘舵�佹帶浠� /// </summary> private NormalViewControl btnStatu = null; @@ -40,7 +44,7 @@ /// <summary> /// 鏄惁鑾峰彇缃戝叧鍙嶉鐨勭粨鏋� 0:娌℃湁鑾峰彇寰楀埌 1:宸茬粡鑾峰彇寰楀埌 /// </summary> - private int ResponeResult = 0; + public int ResponeResult = 0; /// <summary> /// 褰撳墠绔偣鐨勫姛鑳界被鍨� /// </summary> @@ -228,16 +232,14 @@ this.ResponeResult = 0; //鍏堣鎸囧畾鎺т欢涓嶈兘鐐瑰嚮 - var listSelect = new List<bool>(); foreach (var myContr in listControl) { myContr.CanClick = false; - listSelect.Add(myContr.IsSelected); } HdlThreadLogic.Current.RunThread(() => { - int waitime = 30; + int waitime = 40; while (waitime > 0) { System.Threading.Thread.Sleep(100); @@ -247,22 +249,24 @@ break; } waitime--; + //2绉掔殑鏃跺��,杩樻槸鎺ュ彈涓嶅埌鐨勮瘽,寮哄埗鍐嶆鍒锋柊璁惧鐘舵�� + if (waitime == 20) + { + //浠庢柊鍙戦�佽幏鍙栬澶囩殑鐘舵��(寮哄埗) + this.device.HadReadDeviceStatu = false; + if (this.RowOrCardControl != null) + { + this.RowOrCardControl.GetType().InvokeMember("SendStatuComand", System.Reflection.BindingFlags.InvokeMethod, null, this.RowOrCardControl, null); + } + } } - if (waitime <= 0) + if (waitime <= 0 && this.Parent != null) { //娌℃湁鑾峰彇寰楀埌缁撴灉 HdlThreadLogic.Current.RunMain(() => { var msgContr = new ShowMsgControl(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.FAIL)); msgContr.Show(); - //鍙樻洿鍥炲師鏉ョ殑鐘舵�� - for (int i = 0; i < listSelect.Count; i++) - { - if (listSelect[i] != listControl[i].IsSelected) - { - listControl[i].IsSelected = listSelect[i]; - } - } }); } //寮�鍏虫寜閽彲浠ュ啀鐐瑰嚮 @@ -292,22 +296,6 @@ private void AddDeviceReportEvent() { string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(this.device); - //鑺傜偣鍙嶉 - HdlGatewayReceiveLogic.Current.AddAttributeEvent("DeviceDetailCardControl" + mainKeys, ReceiveComandDiv.A鑺傜偣鎺у埗鍙嶉, (report) => - { - string mainKey2 = Common.LocalDevice.Current.GetDeviceMainKeys(report); - if (mainKeys != mainKey2) - { - //涓嶆槸鍚屼竴涓笢瑗� - return; - } - //妫�娴嬬粨鏋� - if (this.CheckResponeResultStatu(ReceiveComandDiv.A鑺傜偣鎺у埗鍙嶉, report) == true) - { - //缁撴灉宸茬粡鎺ユ敹鍒� - this.ResponeResult = 1; - } - }); //灞炴�т笂鎶� HdlGatewayReceiveLogic.Current.AddAttributeEvent("DeviceDetailCardAttribute" + mainKeys, ReceiveComandDiv.A璁惧灞炴�т笂鎶�, (report) => { @@ -376,7 +364,6 @@ public override void CloseFormBefore() { string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(this.device); - HdlGatewayReceiveLogic.Current.RemoveEvent("DeviceDetailCardControl" + mainKeys); HdlGatewayReceiveLogic.Current.RemoveEvent("DeviceDetailCardAttribute" + mainKeys); //鍥炶皟鍑芥暟 @@ -400,6 +387,15 @@ } /// <summary> + /// 璁剧疆PM2.5浼犳劅鍣ㄧ姸鎬佹枃鏈�(涓嶉渶瑕佹寚瀹氥�愬綋鍓嶄袱涓瓧銆�) + /// </summary> + /// <param name="text"></param> + public void SetPmTwoPointFiveStatuText(string text) + { + this.btnStatu.Text = text; + } + + /// <summary> /// 閲嶆柊璁剧疆璁惧鍚嶅瓧鎺т欢鍜岀姸鎬佹帶浠剁殑Y杞� /// </summary> /// <param name="i_NameY">璁惧鍚嶅瓧鎺т欢鐨刌杞�(鐪熷疄鍊�)</param> -- Gitblit v1.8.0