| | |
| | | complateDevice = true; |
| | | MainPage.Log($"============设备============完成" + FunctionList.List.Functions.Count); |
| | | } |
| | | |
| | | |
| | | #if DEBUG |
| | | DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl = true; |
| | | #endif |
| | | if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl) |
| | | { |
| | | var pack = Ins.HttpRequest.GetGroupControlList(); |
| | | if (pack != null) |
| | | { |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | try |
| | | { |
| | | var groupControlList = JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString()); |
| | | var readSidList = new List<string>(); |
| | | foreach(var temp in groupControlList) |
| | | { |
| | | FunctionList.List.groupControls.Clear(); |
| | | readSidList.Add(temp.userDeviceGroupControlId); |
| | | if (readSidList.Count >= 20) |
| | | { |
| | | var data = Ins.httpRequest.GetGroupControInfo(readSidList); |
| | | if(data != null) |
| | | { |
| | | if(data.Code == StateCode.SUCCESS) |
| | | { |
| | | var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString()); |
| | | FunctionList.List.groupControls.AddRange(groupControlInfoList); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | readSidList.Clear(); |
| | | } |
| | | } |
| | | if (readSidList.Count > 0) |
| | | { |
| | | var data = Ins.httpRequest.GetGroupControInfo(readSidList); |
| | | if (data != null) |
| | | { |
| | | if (data.Code == StateCode.SUCCESS) |
| | | { |
| | | var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString()); |
| | | FunctionList.List.groupControls.AddRange(groupControlInfoList); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | readSidList.Clear(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"读取组控列表失败:{ex.Message}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | |
| | | ////===================场景========================== |
| | | //new System.Threading.Thread(() => |
| | | //{ |
| | | |
| | | try |
| | | { |