From e1a8f2f7e4d850beedeb1469610b878c1427e976 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期三, 15 十二月 2021 09:01:53 +0800 Subject: [PATCH] 更新 --- HDL_ON/Entity/DB_ResidenceData.cs | 71 ++++++++++++++++++++++++++++++----- 1 files changed, 61 insertions(+), 10 deletions(-) diff --git a/HDL_ON/Entity/DB_ResidenceData.cs b/HDL_ON/Entity/DB_ResidenceData.cs index f1fd99e..7e9c6f8 100644 --- a/HDL_ON/Entity/DB_ResidenceData.cs +++ b/HDL_ON/Entity/DB_ResidenceData.cs @@ -19,7 +19,6 @@ /// </summary> public string MasterToken; - //RegionInfoRes _residecenInfo; RegionInfoRes _residecenInfo = new RegionInfoRes(); /// <summary> /// 浣忓畢鍩虹淇℃伅 @@ -30,7 +29,7 @@ { if (MainPage.NoLoginMode) { - return new RegionInfoRes() { Name = "鏈湴妯″紡" }; + return new RegionInfoRes() { homeName = "HDL Home" ,id = "text000001"}; } else { @@ -58,6 +57,7 @@ /// <summary> /// 鍔熻兘绫诲瀷鍒楄〃 /// </summary> + [Newtonsoft.Json.JsonIgnore] public List<ShowFunction> functionTypeList = new List<ShowFunction>(); static DB_ResidenceData instance; @@ -67,6 +67,32 @@ { if (instance == null) { + if(MainPage.NoLoginMode) + { + instance = new DB_ResidenceData(); + instance.functionTypeList.AddRange(new List<ShowFunction> { + ShowFunction.Light,ShowFunction.AC,ShowFunction.Curtain, + ShowFunction.FloorHeating,ShowFunction.Music, + ShowFunction.Electric,ShowFunction.Environmental, + ShowFunction.EnergyMonitoring, + ShowFunction.FreshAir,ShowFunction.DoorLock, + ShowFunction.Panel,ShowFunction.SecurityMonitoring, + ShowFunction.Sensor,ShowFunction.VideoIntercom, + ShowFunction.SecurityCenter + }); + instance.SaveResidenceData(); + instance.residenceImage = "Classification/Room/Roombg.png"; + instance.HomeGateway = new HomeGatewayInfo() + { + homeId = "1396717478877241345", + gatewayId = "1396997079658602498", + mac = "123457890123456", + }; + //鍒濆鍖栦綇瀹呭姛鑳芥暟鎹� + SpatialInfo.CurrentSpatial.InitRoomListFunctions(); + return instance; + } + try { var residenceDataBytes = ReadResidenceInfo(); @@ -85,9 +111,7 @@ { instance = temp; } - if (instance.functionTypeList.Count == 0) - { - instance.functionTypeList.AddRange(new List<ShowFunction> { + instance.functionTypeList.AddRange(new List<ShowFunction> { ShowFunction.Light,ShowFunction.AC,ShowFunction.Curtain, ShowFunction.FloorHeating,ShowFunction.Music, ShowFunction.Electric,ShowFunction.Environmental, @@ -97,8 +121,8 @@ ShowFunction.Sensor,ShowFunction.VideoIntercom, ShowFunction.SecurityCenter }); - instance.SaveResidenceData(); - } + instance.SupportFacePass = false; + instance.SaveResidenceData(); } catch (Exception ex) { @@ -132,6 +156,10 @@ HDL_ON.UI.UI2.Intelligence.Automation.Logic.LogicList.Clear(); DAL.Mqtt.MqttClient.DisConnectRemote("閫�鍑虹櫥褰曪紝鎴栬�呭垏鎹綇瀹�"); } + /// <summary> + /// 鏄惁鏀寔浜鸿劯閫氳 + /// </summary> + public bool SupportFacePass = false; /// <summary> /// 缃戝叧璇︾粏淇℃伅 @@ -139,8 +167,8 @@ public HomeGatewayInfo HomeGateway; /// <summary> - /// 0:bus缃戝叧 - /// 1:A鍗忚缃戝叧 + /// 0:涓�绔彛 + /// 1:Link鍗忚缃戝叧 /// </summary> public int GatewayType { @@ -151,7 +179,7 @@ //#endif if (HomeGateway == null) return -1; - if (HomeGateway.gatewayType == "AGATEWAY") + if (HomeGateway.gatewayType != "BUSUDPGATEWAY") { return 1; } @@ -227,6 +255,11 @@ } } + + ///// <summary> + ///// 鍩庡競淇℃伅 + ///// </summary> + //public static Entity.CityInfo cityInfo = new Entity.CityInfo(); /// <summary> /// 浣忓畢鍥剧墖 @@ -419,5 +452,23 @@ } #endregion + + + + /// <summary> + /// 涓婁竴娆℃彁绀虹殑鏃堕棿 + /// </summary> + public DateTime LastTipTime = DateTime.MinValue; + /// <summary> + /// 鏄惁闇�瑕佹彁绀� + /// </summary> + public bool NeedTip + { + get + { + return (DateTime.Now - LastTipTime).TotalDays > 2; + } + } + } } -- Gitblit v1.8.0