| | |
| | | 6092=The device does not exist |
| | | 6093=The device is not online |
| | | 6094=The gateway device does not exist |
| | | 6095=More than 30 add buttons |
| | | |
| | | |
| | | 7108=Leak/No Leak |
| | |
| | | 6092=设备不存在 |
| | | 6093=设备不在线 |
| | | 6094=网关设备不存在 |
| | | |
| | | 6095=添加按钮超出30个 |
| | | |
| | | |
| | | 7000=新建自动化 |
| | |
| | | 6092=The device does not exist |
| | | 6093=The device is not online |
| | | 6094=The gateway device does not exist |
| | | 6095=More than 30 add buttons |
| | | |
| | | |
| | | 7108=Leak/No Leak |
| | |
| | | 6092=设备不存在 |
| | | 6093=设备不在线 |
| | | 6094=网关设备不存在 |
| | | 6095=添加按钮超出30个 |
| | | |
| | | |
| | | |
| | |
| | | public const int shebeibucunzai = 6092; |
| | | public const int shebeibuzaixian = 6093; |
| | | public const int wangguanshebeibuzaixian = 6094; |
| | | public const int anniuchaochu30 = 6095; |
| | | |
| | | |
| | | public const int newAutomation = 7000; |
| | | public const int editAutomation = 7001; |
| | |
| | | ///下一步的点击事件 |
| | | saveBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (control.status.Count > 29) |
| | | { |
| | | ///超出30个红外宝内存满了会出现异常 |
| | | new PirMethod().ErrorShow(null, "添加按钮超出30个"); |
| | | return; |
| | | } |
| | | |
| | | var texts = editText.Text.Trim(); |
| | | if (string.IsNullOrEmpty(editText.Text)) |
| | | { |
| | |
| | | |
| | | //添加数据对象 |
| | | Entity.AttributesStatus buttonObj = new Entity.AttributesStatus(); |
| | | buttonObj.key = "key" + control.status.Count.ToString(); |
| | | string keyName = GetKeyName(control.status); |
| | | buttonObj.key = keyName; |
| | | buttonObj.value = texts; |
| | | |
| | | PirSend.CodeStudy(control, buttonObj, (mqttdate) => |
| | |
| | | { |
| | | replication.RemView(); |
| | | PirMethod method = new PirMethod(); |
| | | method.ErrorShow(null,"添加失败"); |
| | | method.ErrorShow(null, "添加失败"); |
| | | } |
| | | |
| | | }); |
| | |
| | | PirMethod.RefreshView("PirMain"); |
| | | base.RemoveFromParent(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查找唯一健名值 |
| | | /// </summary> |
| | | /// <param name="listKeyName">已经存在健名列表</param> |
| | | /// <returns></returns> |
| | | private string GetKeyName(List<Entity.AttributesStatus> listKeyName) |
| | | { |
| | | //目前红外宝学习按钮最多是30个; |
| | | for (int i = 0; i < 50; i++) |
| | | { |
| | | string keyName = "key" + i.ToString(); |
| | | ///查找是否存在 |
| | | var currKeyName = listKeyName.Find((c) => c.key == keyName); |
| | | if (currKeyName == null) |
| | | { |
| | | return keyName; |
| | | } |
| | | } |
| | | |
| | | return "key" + listKeyName.Count; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | str = Language.StringByID(StringId.tianjiashibai); |
| | | } |
| | | else if (text== "添加按钮超出30个") { |
| | | str = Language.StringByID(StringId.anniuchaochu30); |
| | | } |
| | | else |
| | | { |
| | | if (responsePackNew != null) |