| | |
| | | }; |
| | | pirDeviceFLayout.AddChidren(text2Btn); |
| | | |
| | | // |
| | | //红外宝数量 |
| | | Button numberDeviceBtn = new Button |
| | | { |
| | | Y = Application.GetRealHeight(137), |
| | |
| | | TextID = StringId.dangqianhongwaishebei, |
| | | }; |
| | | pirDeviceFLayout.AddChidren(numberDeviceTextBtn); |
| | | // |
| | | //所有红外宝的遥控器数量 |
| | | Button currDeviceNumberControlBtn = new Button |
| | | { |
| | | Y = Application.GetRealHeight(137), |
| | |
| | | deviceListFLayout.AddChidren(deviceNameBtn); |
| | | if (Pir.pirDeviceList.Count != 0) |
| | | { |
| | | deviceNameBtn.Text = Pir.pirDeviceList[0].name; |
| | | Pir.currPir = Pir.pirDeviceList[0]; |
| | | int sum = 0; |
| | | for (int i = 0; i < Pir.pirDeviceList.Count; i++) |
| | | { |
| | | sum += Pir.pirDeviceList[i].FunctioList.Count; |
| | | } |
| | | deviceNameBtn.Text = Pir.pirDeviceList[0].name; |
| | | numberDeviceBtn.Text = Pir.pirDeviceList.Count.ToString() + Language.StringByID(StringId.ge); |
| | | currDeviceNumberControlBtn.Text = sum.ToString() + Language.StringByID(StringId.ge); |
| | | } |
| | | |
| | | //下拉图标 |
| | |
| | | } |
| | | |
| | | }; |
| | | |
| | | /// |
| | | clickFLayout.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | DeviceSet deviceSet = new DeviceSet(); |
| | | MainPage.BasePageView.AddChidren(deviceSet); |
| | | deviceSet.Show(() => { |
| | | deviceSet.Show(() => |
| | | { |
| | | if (Pir.currPir != null) |
| | | { |
| | | deviceNameBtn.Text = Pir.currPir.name; |
| | | deviceNameBtn.Text = Pir.pirDeviceList[0].name; |
| | | numberDeviceBtn.Text = Pir.pirDeviceList.Count.ToString() + Language.StringByID(StringId.ge); |
| | | } |
| | | int sum = 0; |
| | | for (int i = 0; i < Pir.pirDeviceList.Count; i++) |
| | | { |
| | | sum += Pir.pirDeviceList[i].FunctioList.Count; |
| | | } |
| | | currDeviceNumberControlBtn.Text = sum.ToString() + Language.StringByID(StringId.ge); |
| | | |
| | | |
| | | }); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | |
| | | } |
| | | else |
| | | { |
| | | if (DeviceTypeList.Count == 0) |
| | | { |
| | | GetDeviceTypeList(true,() => |
| | | { |
| | | DeviceTypeViewClick(if_value); |
| | | |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | DeviceTypeViewClick(if_value); |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | GetDeviceTypeList(false,() => { }); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 设备进入下一级方法 |
| | | /// </summary> |
| | | /// <param name="if_value"></param> |
| | | void DeviceTypeViewClick(int if_value) { |
| | | var strings = GetTypeString(if_value).Split('-'); |
| | | var jobDeviceType = DeviceTypeList.Find((c) => c.deviceType == strings[0]); |
| | | if (jobDeviceType == null) |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | }; |
| | | |
| | | } |
| | | GetDeviceTypeList(); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 获取品牌支持 |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// 读取红外设备类型列表 |
| | | /// </summary> |
| | | private void GetDeviceTypeList() |
| | | /// <param name="tag">标识要不要提示(true=提示)</param> |
| | | /// <param name="action">回调函数</param> |
| | | private void GetDeviceTypeList(bool tag,Action action) |
| | | { |
| | | PirSend.GetDeviceTypesList(this, (responsePackNew) => |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | action(); |
| | | } |
| | | else |
| | | { |
| | | if (tag) { |
| | | Method method = new Method(); |
| | | method.ErrorShow(responsePackNew); |
| | | method.ErrorShow(responsePackNew,""); |
| | | } |
| | | } |
| | | }, "", "设备类型列表"); |
| | | } |
| | |
| | | else |
| | | { |
| | | Method method = new Method(); |
| | | method.ErrorShow(responsePackNew); |
| | | method.ErrorShow(responsePackNew,""); |
| | | } |
| | | }, id, "品牌列表"); |
| | | } |