黄学彪
2020-07-06 f23ad1b3f9f6193f35f72104d690b21dc67d5c1f
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, "注意:开启或者关闭此功能会重启App", () =>
                {
                    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();
        }