| | |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | if (isAdd) |
| | | { |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.CombinedDimming)).LoadTopView(); |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.GroupControl)).LoadTopView(); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | FunctionList.List.groupControls.Remove(groupControl); |
| | | var delTemp = FunctionList.List.groupControls.Find((obj) => groupControl.sid == obj.sid); |
| | | FunctionList.List.groupControls.Remove(delTemp); |
| | | //list.Remove(groupControl); |
| | | this.RemoveFromParent(); |
| | | delAction?.Invoke(); |
| | |
| | | { |
| | | try |
| | | { |
| | | var newEditDataString = Newtonsoft.Json.JsonConvert.SerializeObject(this.groupControl); |
| | | //没有更新数据则直接退出 |
| | | if (newEditDataString == editDataString) |
| | | { |
| | | this.RemoveFromParent(); |
| | | return; |
| | | } |
| | | //var newEditDataString = Newtonsoft.Json.JsonConvert.SerializeObject(this.groupControl); |
| | | //var newEditDataString1 = Newtonsoft.Json.JsonConvert.SerializeObject(groupControlLightList); |
| | | //var newEditDataString2 = Newtonsoft.Json.JsonConvert.SerializeObject(this.groupControl.sids); |
| | | ////没有更新数据则直接退出 |
| | | //if (newEditDataString == editDataString && newEditDataString1 == newEditDataString2) |
| | | //{ |
| | | // this.RemoveFromParent(); |
| | | // return; |
| | | //} |
| | | groupControl.sids.Clear(); |
| | | foreach (var light in groupControlLightList) |
| | | { |
| | |
| | | var groupControlTypes = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControlType>>(pack.Data.ToString()); |
| | | if (groupControlTypes != null && groupControlTypes.Count > 0) |
| | | { |
| | | //groupControlType = new GroupControlType { |
| | | // type = "LIGHT", |
| | | // typeName ="灯光控制", |
| | | // spks = new List<string> { "light.switch" }, |
| | | // spkAttrs = new List<string> { "on_off" } |
| | | //}; |
| | | groupControlType = groupControlTypes[0]; |
| | | Application.RunOnMainThread(() => { |
| | | LoadLightRow(lightList); |