| | |
| | | { |
| | | deviceList = new DevcieApiPack(); |
| | | } |
| | | if (FunctionList.List.GetDeviceFunctionList().Count > 0) |
| | | { |
| | | if (FunctionList.List.GetDeviceFunctionList().Count > 0) |
| | | { |
| | | for (int i = 0; i < FunctionList.List.GetDeviceFunctionList().Count;) |
| | | { |
| | | var localFunction = FunctionList.List.GetDeviceFunctionList()[i]; |
| | |
| | | deviceList.list.Remove(newFunction);//操作完的数据清理掉,剩下的就是新增的功能 |
| | | } |
| | | } |
| | | //处理剩下的新增功能 |
| | | foreach (var newFunction in deviceList.list) |
| | | { |
| | | newFunction.SaveFunctionFile(); |
| | | FunctionList.List.IniFunctionList(newFunction.savePath); |
| | | } |
| | | } |
| | | //处理剩下的新增功能 |
| | | foreach (var newFunction in deviceList.list) |
| | | { |
| | | newFunction.SaveFunctionFile(); |
| | | FunctionList.List.IniFunctionList(newFunction.savePath); |
| | | } |
| | | endTime = DateTime.Now.AddSeconds(5); |
| | | } |
| | |
| | | { |
| | | sceneList = new List<Scene>(); |
| | | } |
| | | for (int i = 0; i < FunctionList.List.scenes.Count;) |
| | | for (int i = 0; i < FunctionList.List.scenes.Count;) |
| | | { |
| | | var localScene = FunctionList.List.scenes[i]; |
| | | if (localScene == null) |
| | | { |
| | | var localScene = FunctionList.List.scenes[i]; |
| | | if (localScene == null) |
| | | { |
| | | FunctionList.List.scenes.Remove(localScene); |
| | | continue; |
| | | } |
| | | var newScene = sceneList.Find((obj) => obj.userSceneId == localScene.userSceneId); |
| | | FunctionList.List.scenes.Remove(localScene); |
| | | continue; |
| | | } |
| | | var newScene = sceneList.Find((obj) => obj.userSceneId == localScene.userSceneId); |
| | | if (newScene == null)//如果云端最新数据没有该条数据,则本地需要删掉该数据记录 |
| | | { |
| | | FunctionList.List.DeleteScene(localScene, false); |
| | |
| | | } |
| | | sceneList.Remove(newScene);//操作完的数据清理掉,剩下的就是新增的功能 |
| | | } |
| | | //处理剩下的新增功能 |
| | | foreach (var tempScene in sceneList) |
| | | { |
| | | tempScene.SaveSceneFile(); |
| | | FunctionList.List.scenes.Add(tempScene); |
| | | } |
| | | } |
| | | //处理剩下的新增功能 |
| | | foreach (var tempScene in sceneList) |
| | | { |
| | | tempScene.SaveSceneFile(); |
| | | FunctionList.List.scenes.Add(tempScene); |
| | | } |
| | | //如果是一端口需要提前下载场景数据,否则控制不了一端口场景 |
| | | if (DB_ResidenceData.Instance.GatewayType == 0) |