| | |
| | | /// </summary> |
| | | public void Clear() |
| | | { |
| | | aCs = new List<AC>(); |
| | | lights = new List<Light>(); |
| | | curtains = new List<Curtain>(); |
| | | floorHeatings = new List<FloorHeating>(); |
| | | tVs = new List<TV>(); |
| | | switchSockets = new List<SwitchSocket>(); |
| | | fans = new List<Fan>(); |
| | | sensorsEnvironmentalScience = new List<Sensor>(); |
| | | scenes = new List<Scene>(); |
| | | deviceFunctionList = null; |
| | | _FunctionList.aCs = new List<AC>(); |
| | | _FunctionList.lights = new List<Light>(); |
| | | _FunctionList.curtains = new List<Curtain>(); |
| | | _FunctionList.floorHeatings = new List<FloorHeating>(); |
| | | _FunctionList.tVs = new List<TV>(); |
| | | _FunctionList.switchSockets = new List<SwitchSocket>(); |
| | | _FunctionList.fans = new List<Fan>(); |
| | | _FunctionList.sensorsEnvironmentalScience = new List<Sensor>(); |
| | | _FunctionList.scenes = new List<Scene>(); |
| | | _FunctionList.deviceFunctionList = null; |
| | | _FunctionList = null; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | var deviceList = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(pack.Data.ToString()); |
| | | if (deviceList != null) |
| | | { |
| | | foreach(var serverFunction in deviceList.list) |
| | | { |
| | | MainPage.Log($"deviceId:{serverFunction.deviceId}"); |
| | | } |
| | | |
| | | ////将下载到到数据全部保存 |
| | | //new Thread(() => { |
| | | // foreach (var temp in deviceList.list) |
| | | // { |
| | | // temp.SaveFunctionData(); |
| | | // } |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | for (int i =0;i < List.GetDeviceFunctionList().Count;) |
| | | { |
| | | var localFunction = List.GetDeviceFunctionList()[i]; |
| | |
| | | i++; |
| | | if (localFunction.modifyTime != newFunction.modifyTime) |
| | | { |
| | | MainPage.Log($"local:{localFunction.modifyTime}\r\n server:{newFunction.modifyTime}"); |
| | | localFunction.name = newFunction.name; |
| | | localFunction.collect = newFunction.collect; |
| | | localFunction.modifyTime = newFunction.modifyTime; |