From 63a1e0dd7fcda5948c26490d5d7e4c84d6dbf99f Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期二, 16 三月 2021 17:06:19 +0800
Subject: [PATCH] 4

---
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs |   43 ++++++++++++++++++++++++++++---------------
 1 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs
index 077b5f8..8ef498e 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs
@@ -140,10 +140,12 @@
             fLayout.AddChidren(succeedBtn);
             #endregion
             #region 鐐瑰嚮浜嬩欢
-            //琛ㄧず搴撳垪琛ㄧ储寮曞��
-            int index= 1; 
-            //琛ㄧず娴嬭瘯鐮佺储寮曞��
+            //琛ㄧず搴撳垪琛ㄧ储寮曞��(鐩墠鍙�20涓簱)
+            int index = 1; 
+            //琛ㄧず娴嬭瘯鐮佺储寮曞��(鐩墠鍙祴璇�3涓爜)
             int code = 1;
+            //琛ㄧず娴嬭瘯鏈�鍚庝竴涓爜锛�
+            bool if_bool = false;
             //宸�
             leftIconBtn.MouseUpEventHandler += (sender, e) =>
             {
@@ -165,22 +167,31 @@
                 code = 1;
                 GetBtnText(testBtn, code, spk);
             };
+           
             //娴嬭瘯Text
             testBtn.MouseUpEventHandler += (sender, e) =>
             {
                 var library = libraryList[index];
                 var control = GetControl(spk, testBtn.TextID, library);
+                //鍙戦�佹祴璇曠爜鍛戒护
                 CodeTest(control);
+                if (code == 3) {
+                    //鏍囪鏈�鍚庨偅涓爜
+                    if_bool = true;
+                }
             };
             //鎺у埗澶辫触
             failedBtn.MouseUpEventHandler += (sender, e) =>
             {
                 if (index < 20)
                 {
+                    //鍏堝姞
                     index++;
+                    //鏇存柊鏂囨湰
                     sumBtn.Text = "(" + index.ToString() + "/20)";
                 }
                 code = 1;
+                //鏇存柊鐘舵��
                 GetBtnText(testBtn, code, spk);
             };
             //鎺у埗鎴愬姛
@@ -190,17 +201,20 @@
                 {
                     code++;
                 }
+                //鏇存柊鐘舵��
                 GetBtnText(testBtn, code, spk);
-                if (code == 3)
+                if (if_bool)
                 {
                     var library = libraryList[index];
                     var control = GetControl(spk, testBtn.TextID, library);
                     Method method = new Method();
-                    method.ThreadAddControl(control, this,(control1) => {
+                    //鍙戦�佸簱娣诲姞閬ユ帶鍣ㄥ懡浠�
+                    method.ThreadAddControl(control, this, (cont) =>
+                    {
                         MainPage.BasePageView.RemoveViewByTag("PirView");
                         AddControlComplete addControlComplete = new AddControlComplete();
                         MainPage.BasePageView.AddChidren(addControlComplete);
-                        addControlComplete.Show(control1,true);
+                        addControlComplete.Show(cont, true);
                         MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                     });
 
@@ -247,11 +261,11 @@
                         }
                     }
                     break;
-                case SPK.ElectricTV:
+                case SPK.TvIr:
                     {
                         switch (textInt)
                         {
-                            case StringId.dianshi:
+                            case StringId.dianyuan:
                                 {
                                     key = "on_off";
                                     value = "on";
@@ -259,8 +273,8 @@
                                 break;
                             case StringId.yinliangjia:
                                 {
-                                    key = "on_off";
-                                    value = "on";
+                                    key = "volume+";
+                                    value = "50";
                                 }
                                 break;
                             case StringId.jingyin:
@@ -284,12 +298,11 @@
             control.type = "library";
             control.status.Add(buttonObj);
             control.deviceId = Pir.currPir.deviceId;
+            control.sid = "";
             string[] strings = library.irCode.Split(',');
             for (int arrayStr = 0; arrayStr < strings.Length; arrayStr++) 
             {
                 //var intValue = Convert.ToInt32(strings[arrayStr],16);
-                //intValue
-                //control.library1.Add((uint)intValue);
                 control.library.Add(strings[arrayStr].Replace("0x",""));
             }
 
@@ -326,8 +339,8 @@
                         }
                         else
                         {
-                            Method method = new Method();
-                            method.ErrorShow(responsePackNew);
+                            //Method method = new Method();
+                            //method.ErrorShow(responsePackNew);
                         }
 
                     });
@@ -370,7 +383,7 @@
                         }
                     }
                     break;
-                case SPK.ElectricTV:
+                case SPK.TvIr:
                     {
                         switch (code)
                         {

--
Gitblit v1.8.0