| | |
| | | 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; |
| | | }); |
| | | |
| | |
| | | string value = ""; |
| | | switch (spk) |
| | | { |
| | | case SPK.AcStandard: |
| | | case SPK.AcIr: |
| | | { |
| | | switch (textInt) |
| | | { |
| | | case StringId.dianshi: |
| | | case StringId.dianyuan: |
| | | { |
| | | key = "on_off"; |
| | | value = "on"; |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.ElectricTV: |
| | | case SPK.TvIr: |
| | | { |
| | | switch (textInt) |
| | | { |
| | | case StringId.dianshi: |
| | | case StringId.dianyuan: |
| | | { |
| | | key = "on_off"; |
| | | value = "on"; |
| | |
| | | break; |
| | | case StringId.yinliangjia: |
| | | { |
| | | key = "on_off"; |
| | | value = "on"; |
| | | key = "volume+"; |
| | | value = "50"; |
| | | } |
| | | break; |
| | | case StringId.jingyin: |
| | |
| | | } |
| | | 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; |
| | | control.sid = ""; |
| | | 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); |
| | | control.library.Add(strings[arrayStr].Replace("0x","")); |
| | | } |
| | | |
| | | return control; |
| | |
| | | { |
| | | try |
| | | { |
| | | //发送按键删除; |
| | | responsePackNew = PirSend.CodeTest(control); |
| | | } |
| | | catch { } |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.ElectricTV: |
| | | case SPK.TvIr: |
| | | { |
| | | switch (code) |
| | | { |