| | |
| | | fLayout.AddChidren(succeedBtn); |
| | | #endregion |
| | | #region 点击事件 |
| | | //表示库列表索引值 |
| | | int index= 1; |
| | | //表示测试码索引值 |
| | | //表示库列表索引值(目前只20个库) |
| | | int index = 1; |
| | | //表示测试码索引值(目前只测试3个码) |
| | | int code = 1; |
| | | //表示测试最后一个码; |
| | | bool if_bool = false; |
| | | //左 |
| | | leftIconBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | 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); |
| | | }; |
| | | //控制成功 |
| | |
| | | { |
| | | 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,(cont) => { |
| | | //发送库添加遥控器命令 |
| | | method.ThreadAddControl(control, this, (cont) => |
| | | { |
| | | MainPage.BasePageView.RemoveViewByTag("PirView"); |
| | | AddControlComplete addControlComplete = new AddControlComplete(); |
| | | MainPage.BasePageView.AddChidren(addControlComplete); |
| | | addControlComplete.Show(cont,true); |
| | | addControlComplete.Show(cont, true); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }); |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | Method method = new Method(); |
| | | method.ErrorShow(responsePackNew); |
| | | //Method method = new Method(); |
| | | //method.ErrorShow(responsePackNew); |
| | | } |
| | | |
| | | }); |