| | |
| | | { |
| | | if (MainPage.NoLoginMode) |
| | | { |
| | | return new RegionInfoRes() { Name = "本地模式" }; |
| | | return new RegionInfoRes() { Name = "本地模式" , }; |
| | | } |
| | | else |
| | | { |
| | |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"住宅数据初始化失败:{ex.Message}"); |
| | | instance = new DB_ResidenceData { }; |
| | | return instance; |
| | | } |
| | | instance.residenceImage = "Classification/Room/Roombg.png"; |
| | | //初始化住宅功能数据 |
| | |
| | | { |
| | | instance = null; |
| | | ins_OidList = null; |
| | | functionList = null; |
| | | HomeGateway = null; |
| | | SpatialInfo.CurrentSpatial.ClearRooms(); |
| | | //UserInfo.Current.ClearUserInfo(); |
| | | FunctionList.List.Clear(); |
| | | if (MainPage.IsRemote) |
| | | { |
| | | DAL.Mqtt.MqttClient.DisConnectRemote("退出登录,或者切换住宅"); |
| | |
| | | return; |
| | | var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)); |
| | | Common.FileUtlis.Files.WriteFileByBytes("DB_ResidenceData", ssd); |
| | | MainPage.Log("Save DB_ResidenceData"); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | ///// </summary> |
| | | //[Newtonsoft.Json.JsonIgnore] |
| | | //public List<Room> Rooms = SpatialInfo.CurrentSpatial.RoomList; |
| | | |
| | | #region 功能数据 |
| | | static FunctionList _functionList; |
| | | public static FunctionList functionList |
| | | { |
| | | get |
| | | { |
| | | if (_functionList == null) |
| | | { |
| | | _functionList = FunctionList.List; |
| | | } |
| | | return _functionList; |
| | | } |
| | | set |
| | | { |
| | | _functionList = value; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region oid列表 a协议转bus协议控制使用 |
| | | /// <summary> |