陈嘉乐
2021-03-25 1cba5ec1959f9012c66f96254afb3206904ff671
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs
@@ -180,10 +180,10 @@
            //测试Text
            testBtn.MouseUpEventHandler += (sender, e) =>
            {
                var library = libraryList[index-1];
                var library = libraryList[index - 1];
                var control = GetControl(spk, testBtn.TextID, library);
                //发送测试码命令
                CodeTest(control);
                Method.ThreadSend(control, (responsePackNew) => { }, "库码测试", "frame", this, null);
                if (code == 3) {
                    //标记最后那个码
                    if_bool = true;
@@ -218,12 +218,12 @@
                    var control = GetControl(spk, testBtn.TextID, library);
                    Method method = new Method();
                    //发送库添加遥控器命令
                    method.ThreadAddControl(control, this, (cont) =>
                    method.ThreadAddControl(control, this, (device) =>
                    {
                        MainPage.BasePageView.RemoveViewByTag("PirView");
                        AddControlComplete addControlComplete = new AddControlComplete();
                        MainPage.BasePageView.AddChidren(addControlComplete);
                        addControlComplete.Show(cont, true);
                        addControlComplete.Show(device, true);
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    });
@@ -316,47 +316,6 @@
            }
            return control;
        }
        /// <summary>
        /// 发送库码测试命令
        /// </summary>
        /// <param name="control"></param>
        private void CodeTest(Control control)
        {
            //加载log
            Loading loading = new Loading();
            this.AddChidren(loading);
            HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null;
            loading.Start();
            new System.Threading.Thread(() =>
            {
                try
                {
                    responsePackNew = PirSend.CodeTest(control);
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        loading.Hide();
                        if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                        {
                        }
                        else
                        {
                            //Method method = new Method();
                            //method.ErrorShow(responsePackNew);
                        }
                    });
                }
            })
            { IsBackground = true }.Start();
        }
        /// <summary>