| | |
| | | /// 临时储存设备类型列表 |
| | | /// </summary> |
| | | List<DeviceType> DeviceTypeList = new List<DeviceType>(); |
| | | public void Show() |
| | | public void Show(Entity.Function function) |
| | | { |
| | | #region 界面布局 |
| | | this.BackgroundColor = CSS.CSS_Color.viewMiddle; |
| | |
| | | |
| | | if (Pir.pirDeviceList.Count != 0) |
| | | { |
| | | |
| | | //if (function != null) |
| | | //{ |
| | | // Pir pir = new Pir(); |
| | | // pir.name = function.name; |
| | | // pir.deviceId = function.deviceId; |
| | | // pir.sid = function.sid; |
| | | // Pir.currPir = pir; |
| | | //} |
| | | //else |
| | | //{ |
| | | // Pir.currPir = Pir.pirDeviceList[0]; |
| | | //} |
| | | //默认第一个红外宝 |
| | | Pir.currPir = Pir.pirDeviceList[0]; |
| | | int sum = 0; |
| | | for (int i = 0; i < Pir.pirDeviceList.Count; i++) |
| | | { |
| | |
| | | mainView.numberDeviceBtn.Text = Pir.pirDeviceList.Count.ToString() + Language.StringByID(StringId.ge); |
| | | mainView.currDeviceNumberControlBtn.Text = sum.ToString() + Language.StringByID(StringId.ge); |
| | | } |
| | | |
| | | ///设备管理的点击事件 |
| | | mainView.clickBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | case 3: |
| | | { |
| | | //风扇 |
| | | type = "fan-" + SPK.ElectricFan; |
| | | // type = "fan-" + SPK.ElectricFan; |
| | | } |
| | | break; |
| | | case 4: |
| | |
| | | /// </summary> |
| | | /// <param name="tag">标识要不要提示(true=提示)</param> |
| | | /// <param name="action">回调函数</param> |
| | | public void GetDeviceTypeList(bool tag, Action action) |
| | | public void GetDeviceTypeList(bool tag, Action action) |
| | | { |
| | | PirSend.GetDeviceTypesList(this, (responsePackNew) => |
| | | { |
| | |
| | | /// <summary> |
| | | /// 读取红外设备类型的品牌列表 |
| | | /// </summary> |
| | | public void GetBrandList(string id, Action<List<Brand>> actionBrand) |
| | | public void GetBrandList(string id, Action<List<Brand>> actionBrand) |
| | | { |
| | | List<Brand> brandList = new List<Brand>(); |
| | | PirSend.GetDeviceTypesList(this, (responsePackNew) => |