JLChen
2020-12-16 d724f7f21c5cc8c5dd5aa0cf7345a62a662eb2bf
HDL_ON/Entity/DB_ResidenceData.cs
@@ -7,6 +7,7 @@
namespace HDL_ON.Entity
{
    [System.Serializable]
    public class DB_ResidenceData
    {
        public DB_ResidenceData()
@@ -18,7 +19,8 @@
        /// </summary>
        public string MasterToken;
        RegionInfoRes _residecenInfo;
        //RegionInfoRes _residecenInfo;
        RegionInfoRes _residecenInfo = new RegionInfoRes();
        /// <summary>
        /// 住宅基础信息
        /// </summary>
@@ -53,36 +55,6 @@
            }
        }
        ///// <summary>
        ///// 获取网关列表
        ///// </summary>
        //void GetHomeGatewayList()
        //{
        //    new Thread(() =>
        //    {
        //        //切换住宅后,查询一次网关列表
        //        new HttpServerRequest().GetHomeGatewayList();
        //    })
        //    { IsBackground = true }.Start();
        //}
        //string curReginID;
        ///// <summary>
        ///// 当前选择的住宅索引
        ///// </summary>
        //public string CurReginID
        //{
        //    set
        //    {
        //        curReginID = value;
        //        GetHomeGatewayList();
        //    }
        //    get
        //    {
        //        return curReginID;
        //    }
        //}
        /// <summary>
        /// 功能类型列表
        /// </summary>
@@ -151,6 +123,8 @@
            HomeGateway = null;
            SpatialInfo.CurrentSpatial.Clear();
            FunctionList.List.Clear();
            ///切换住宅清空前住宅缓存自动化列表;
            HDL_ON.UI.UI2.Intelligence.Automation.Logic.LogicList.Clear();
            if (MainPage.IsRemote)
            {
                DAL.Mqtt.MqttClient.DisConnectRemote("退出登录,或者切换住宅");
@@ -185,7 +159,10 @@
                }
            }
        }
        /// <summary>
        /// 记录窗帘全开全关状态
        /// </summary>
        public bool GlobalCurtainStatus = false;
        /// <summary>
        /// 检测住宅是否绑定了网关
        /// gatewayId 判空
@@ -267,11 +244,21 @@
            var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this));
            WirteResidenceInfo(ssd);
        }
        /// <summary>
        /// 当前选择的楼层
        /// </summary>
        public string CurFoor = Language.StringByID(StringId.All);
        /// <summary>
        /// 当前选择的楼层
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public SpatialInfo CurFloor = new SpatialInfo() { roomId = "", roomName = Language.StringByID(StringId.All)};
        /// <summary>
        /// 分类界面显示的楼层
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public SpatialInfo ClassificationChooseFloor = new SpatialInfo() { roomId = "", roomName = Language.StringByID(StringId.All) };
        /// <summary>
        /// 根目录
@@ -283,6 +270,7 @@
        /// <returns></returns>
        static byte[] ReadResidenceInfo()
        {
                MainPage.Log("get file Instance ");
            var fileName = "DB_ResidenceData";
            FileStream fs = null;
            try
@@ -310,6 +298,7 @@
            }
            finally
            {
                MainPage.Log("get file  ");
                try
                {
                    if (fs != null)