From 6ae83acae578c6746201fbd61074a7b93747ef4f Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 08 三月 2021 17:47:52 +0800
Subject: [PATCH] 2021-3-8-4

---
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs |   30 +++++++++++++++++++-----------
 1 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs
index b6bdd3b..077b5f8 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs
@@ -196,7 +196,13 @@
                     var library = libraryList[index];
                     var control = GetControl(spk, testBtn.TextID, library);
                     Method method = new Method();
-                    method.ThreadAddControl(control, this, true);
+                    method.ThreadAddControl(control, this,(control1) => {
+                        MainPage.BasePageView.RemoveViewByTag("PirView");
+                        AddControlComplete addControlComplete = new AddControlComplete();
+                        MainPage.BasePageView.AddChidren(addControlComplete);
+                        addControlComplete.Show(control1,true);
+                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                    });
 
                 }
             };
@@ -216,11 +222,11 @@
             string value = "";
             switch (spk)
             {
-                case SPK.AcStandard:
+                case SPK.AcIr:
                     {
                         switch (textInt)
                         {
-                            case StringId.dianshi:
+                            case StringId.dianyuan:
                                 {
                                     key = "on_off";
                                     value = "on";
@@ -267,21 +273,24 @@
                     }
                     break;
             }
-            ButtonObj buttonObj = new ButtonObj();
-            buttonObj.Key = key;
+            AttributesStatus buttonObj = new AttributesStatus();
+            buttonObj.key = key;
             buttonObj.value = value;
 
             Control control = new Control();
             control.spk = spk;
             control.name = spk;
-            control.group_id = library.irIndex;
+            control.groupId = library.irIndex;
             control.type = "library";
             control.status.Add(buttonObj);
+            control.deviceId = Pir.currPir.deviceId;
             string[] strings = library.irCode.Split(',');
-            for (int array = 0; array < strings.Length; array++)
+            for (int arrayStr = 0; arrayStr < strings.Length; arrayStr++) 
             {
-                //var intValue = Convert.ToInt32(strings[array],16);
-                control.library.Add(strings[array]);
+                //var intValue = Convert.ToInt32(strings[arrayStr],16);
+                //intValue
+                //control.library1.Add((uint)intValue);
+                control.library.Add(strings[arrayStr].Replace("0x",""));
             }
 
             return control;
@@ -303,7 +312,6 @@
             {
                 try
                 {
-                    //鍙戦�佹寜閿垹闄わ紱
                     responsePackNew = PirSend.CodeTest(control);
                 }
                 catch { }
@@ -340,7 +348,7 @@
             int textValue = 0;
             switch (spk)
             {
-                case SPK.AcStandard:
+                case SPK.AcIr:
                     {
                         switch (code)
                         {

--
Gitblit v1.8.0