From f23ad1b3f9f6193f35f72104d690b21dc67d5c1f Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 06 七月 2020 12:35:25 +0800 Subject: [PATCH] 去掉了访问外网的异步 --- ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs | 82 ++++++++++++++++++++++++++--------------- 1 files changed, 52 insertions(+), 30 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs index 8734356..7bfb326 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/HideOption/HideOptionMainForm.cs @@ -55,7 +55,7 @@ this.AddTopButtomRowControl("浣忓畢ID", 400, Common.Config.Instance.Home.Id, 900); - this.AddTopButtomRowControl("璐﹀彿GUID", 400, Common.Config.Instance.Home.MainUserDistributedMark, 900); + this.AddTopButtomRowControl("璐﹀彿GUID", 400, string.IsNullOrEmpty(Common.Config.Instance.Guid) == true ? Common.Config.Instance.Home.MainUserDistributedMark : Common.Config.Instance.Guid, 900); this.AddNormalRowControl("浣忓畢鍒嗕韩", 400, Common.Config.Instance.Home.IsOthreShare == true ? "鏄�" : "鍚�", 400); @@ -66,6 +66,15 @@ this.AddNormalRowControl("鎷ユ湁杩滅▼鏉冮檺", 400, ZigBee.Device.ZbGateway.AllowRemoteCtrl == true ? "鏄�" : "鍚�", 400); this.AddNormalRowControl("WIFI鍙橀噺", 400, Shared.Application.IsWifi == true ? "true" : "false", 400); + + if (ZigBee.Common.Application.FindGateWaySocket.busSocket == null) + { + this.AddNormalRowControl("Socket閾炬帴", 400, "鏈垵濮嬪寲", 400); + } + else + { + this.AddNormalRowControl("Socket閾炬帴", 400, ZigBee.Common.Application.FindGateWaySocket.busSocket.Connected == true ? "true" : "false", 400); + } int count = HdlGatewayLogic.Current.GetAllLocalGateway().Count; var row1 = new FrameRowControl(listView.rowSpace / 2); @@ -108,7 +117,7 @@ row1 = new FrameRowControl(listView.rowSpace / 2); listView.AddChidren(row1); - row1.AddLeftCaption("娓呴櫎缂撳瓨鏂囦欢", 500); + row1.AddLeftCaption("鏌ョ湅缂撳瓨鏂囦欢", 500); row1.AddRightArrow(); row1.AddBottomLine(); row1.ButtonClickEvent += (sender, e) => @@ -117,36 +126,47 @@ form.AddForm(); }; -#if Android row1 = new FrameRowControl(listView.rowSpace / 2); - row1.UseClickStatu = false; listView.AddChidren(row1); - row1.AddLeftCaption("GBS瀹氫綅", 500); + row1.AddLeftCaption("璁惧缂撳瓨鍙橀噺", 500); + row1.AddRightArrow(); row1.AddBottomLine(); - var btnGbsSwitch = row1.AddMostRightSwitchIcon(); - string checkFile = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Shared.Phone.UserCenter.DirNameResourse.OpenGbsFile); - if (System.IO.File.Exists(checkFile) == true) + row1.ButtonClickEvent += (sender, e) => { - btnGbsSwitch.IsSelected = true; - } - btnGbsSwitch.ButtonClickEvent += (sender, e) => - { - this.ShowMassage(ShowMsgType.Confirm, "娉ㄦ剰:寮�鍚垨鑰呭叧闂鍔熻兘浼氶噸鍚疉pp", () => - { - btnGbsSwitch.IsSelected = !btnGbsSwitch.IsSelected; - if (btnGbsSwitch.IsSelected == true) - { - var file = System.IO.File.Create(checkFile); - file.Close(); - } - else - { - System.IO.File.Delete(checkFile); - } - HDLUtils.RestartApp(); - }); + var form = new HideOptionMemoryListDeviceForm(); + form.AddForm(); }; -#endif + + row1 = new FrameRowControl(listView.rowSpace / 2); + listView.AddChidren(row1); + row1.AddLeftCaption("鏀堕泦鍙戦�佸拰鎺ユ敹鐨勬暟鎹�", 600); + row1.AddBottomLine(); + var btnSwitchLog = row1.AddMostRightSwitchIcon(); + btnSwitchLog.ButtonClickEvent += (sender, e) => + { + if (btnSwitchLog.IsSelected == false) + { + this.ShowMassage(ShowMsgType.Confirm, "鏄惁鎵撳紑璁板綍鍙戦�佸強鎺ユ敹鏁版嵁鐨勮褰�?", () => + { + btnSwitchLog.IsSelected = true; + HdlFileLogic.Current.DeleteFile(DirNameResourse.SendAndReceveDataLog); + UserCenterResourse.HideOption.WriteSendAndReceveDataToFile = 1; + }); + } + else + { + btnSwitchLog.IsSelected = false; + var txtvalue = HdlFileLogic.Current.ReadFileTextContent(DirNameResourse.SendAndReceveDataLog); + if (txtvalue != null) + { + var form = new HideOptionFileContentForm(); + form.AddForm(string.Empty); + + form.SetTextContent(txtvalue); + } + } + }; + row1 = new FrameRowControl(listView.rowSpace / 2); listView.AddChidren(row1); row1.AddLeftCaption("涓婁紶Log", 500); @@ -155,9 +175,9 @@ { this.ShowMassage(ShowMsgType.Confirm, "鏄惁涓婁紶Log鏂囦欢", () => { - HdlThreadLogic.Current.RunThread(async () => + HdlThreadLogic.Current.RunThread(() => { - await HdlBackupLogic.Current.UpLoadLogBackup(); + HdlBackupLogic.Current.UpLoadLogBackup(); }); }); }; @@ -263,7 +283,9 @@ public override void CloseFormBefore() { Shared.Phone.UserCenter.UserCenterResourse.DicReceiveGatewayTest = null; - UserCenterResourse.HideOption.CheckCanReceiveGateway = 1; + UserCenterResourse.HideOption.CheckCanReceiveGateway = 0; + UserCenterResourse.HideOption.WriteSendAndReceveDataToFile = 1; + base.CloseFormBefore(); } -- Gitblit v1.8.0