| | |
| | | GoUserPage(); |
| | | //启动密码验证 |
| | | new AppUnlockPage().LoadPage(); |
| | | //读取音乐信息 |
| | | UI.Music.A31MusicModel.ReadMusicStates(); |
| | | //搜索网关 |
| | | |
| | | #if DEBUG |
| | | //Entity.DB_ResidenceData.residenceData.residenceGatewayMAC = "4E47323347591243"; |
| | | //Entity.DB_ResidenceData.residenceData.GatewayType = 0; |
| | | Entity.DB_ResidenceData.residenceData.residenceGatewayMAC = "123456789AAAAAAA"; |
| | | Entity.DB_ResidenceData.residenceData.GatewayType = 1; |
| | | #endif |
| | | DriverLayer.Control.Ins.SearchLoaclGateway(); |
| | | ///初始化app数据 |
| | | InitializationData(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | BasePageView.PageIndex = 0; |
| | | } |
| | | |
| | | public static void GetRoomList() |
| | | /// <summary> |
| | | /// 初始化app所需要的数据 |
| | | /// </summary> |
| | | public static void InitializationData() |
| | | { |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | var packNew = pm.GetRoomList();//刷新房间列表 |
| | | var floorPack = pm.GetRoomList("FLOOR"); |
| | | var rooms = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.RoomApiPack>(packNew.Data.ToString()); |
| | | var floors = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.RoomApiPack>(packNew.Data.ToString()); |
| | | MainPage.Log(packNew.Data.ToString()); |
| | | MainPage.Log(floorPack.Data.ToString()); |
| | | } |
| | | new System.Threading.Thread(() => |
| | | { |
| | | while (true) |
| | | { |
| | | if (Entity.DB_ResidenceData.residenceData == null || |
| | | Entity.DB_ResidenceData.residenceData.HomeGateway == null) |
| | | { |
| | | System.Threading.Thread.Sleep(100); |
| | | } |
| | | else |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | #region 读取云端数据-- |
| | | //todo数据覆盖处理 |
| | | //读取云端房间、楼层数据 |
| | | Entity.SpatialInfo.CurrentSpatial.DownloadRoomList(); |
| | | //读取云端设备数据 |
| | | Entity.FunctionList.List.DownloadFunctionList(); |
| | | //读取云端场景数据 |
| | | Entity.FunctionList.List.DownloadSceneList(); |
| | | #endregion |
| | | |
| | | public static void GetDeviceList() |
| | | { |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | var packNew = pm.GetDeviceList(); |
| | | var functions = Newtonsoft.Json.JsonConvert.DeserializeObject<Entity.DevcieApiPack>(packNew.Data.ToString()); |
| | | MainPage.Log(packNew.Data.ToString()); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | #region 读取本地数据 |
| | | //读取音乐信息 |
| | | UI.Music.A31MusicModel.ReadMusicStates(); |
| | | //搜索网关 |
| | | DriverLayer.Control.Ins.SearchLoaclGateway(); |
| | | #endregion |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 自定义日志输出 |