From 452e8cef1c740d18ee398be6971d9952e41dbd4a Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 12 四月 2023 16:11:50 +0800
Subject: [PATCH] 1
---
HDL_ON/Common/ApiUtlis.cs | 542 +++++++++++++++++++++++++++++++++--------------------
1 files changed, 339 insertions(+), 203 deletions(-)
diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index c2ac822..9661856 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -5,6 +5,7 @@
using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using HDL_ON.UI.UI2.FuntionControlView.Video;
+using HDL_ON.UI.UI2.Intelligence.Automation;
using Newtonsoft.Json;
using Shared;
@@ -43,6 +44,17 @@
}
}
/// <summary>
+ /// 璇诲彇璁惧鍔熻兘鏁版嵁瀹屾垚
+ /// </summary>
+ bool complateDevice = false;
+ /// <summary>
+ /// 璇诲彇鍦烘櫙鏁版嵁瀹屾垚
+ /// </summary>
+ bool complateScene = false;
+ //绾跨▼缁撴潫鏃堕棿
+ DateTime endTime1;
+
+ /// <summary>
/// 鏍¢獙缃戝叧鏄惁鍦ㄧ嚎
/// </summary>
public bool GatewayOnlineVerification()
@@ -59,7 +71,7 @@
/// <summary>
/// 涓嬭浇鏁版嵁瀹屾垚鏍囪
/// </summary>
- public bool DownloadDataComplete = true;
+ public bool DownloadDataComplete = false;
/// <summary>
/// 涓嬭浇鏁版嵁
/// </summary>
@@ -67,8 +79,8 @@
{
if (MainPage.InternetStatus == 0 || MainPage.NoLoginMode)
return;
- //绾跨▼寮�濮嬫椂闂�
- var endTime = DateTime.Now.AddSeconds(5);
+ endTime1 = DateTime.Now.AddSeconds(25);
+ complateDevice = complateScene = false;
MainPage.Log($"寮�濮嬪悓姝ヤ簯绔暟鎹�");
@@ -80,6 +92,8 @@
string code = StateCode.SUCCESS;
+ Inverter.Ins.H5Page = null;//閲嶇疆鍏変紡椤甸潰
+
var downloadDataThread = new System.Threading.Thread(() =>
{
MainPage.Log($"杩涘叆璇诲彇浜戠鏁版嵁绾跨▼");
@@ -90,7 +104,6 @@
MainPage.Log($"鍒锋柊token澶辫触");
return;
}
- endTime = DateTime.Now.AddSeconds(5);
MainPage.Log($"鍒锋柊token鎴愬姛");
//===================鍒锋柊浣忓畢淇℃伅=======================
code = Ins.HttpRequest.GetHomePager();
@@ -99,7 +112,6 @@
MainPage.Log($"鍒锋柊浣忓畢淇℃伅澶辫触");
return;
}
- endTime = DateTime.Now.AddSeconds(5);
MainPage.Log($"鍒锋柊浣忓畢淇℃伅鎴愬姛");
//===================鍒锋柊涓汉淇℃伅=======================
code = Ins.HttpRequest.GetUserInfo();
@@ -108,7 +120,6 @@
MainPage.Log($"鍒锋柊涓汉淇℃伅澶辫触");
return;
}
- endTime = DateTime.Now.AddSeconds(5);
MainPage.Log($"鍒锋柊涓汉淇℃伅鎴愬姛");
//int count = 0;
@@ -129,6 +140,7 @@
// return;
//}
+ //return;
try
{
@@ -136,7 +148,6 @@
var roomResult = Ins.HttpRequest.GetRoomList();
if (roomResult.Code == StateCode.SUCCESS)
{
- endTime = DateTime.Now.AddSeconds(100);
MainPage.Log($"璇诲彇鎴块棿淇℃伅鎴愬姛");
var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<SpatialApiPack>(roomResult.Data.ToString());
if (revData == null)
@@ -146,217 +157,344 @@
{
SpatialInfo.CurrentSpatial.UpdateSpatialList(revData.list);
}
- endTime = DateTime.Now.AddSeconds(5);
}
else
{
MainPage.Log($"璇诲彇鎴块棿鏁版嵁澶辫触:Code:{roomResult.Code}; msg:{roomResult.message}");
}
- //===================璁惧=======================
- var deviceResult = Ins.HttpRequest.GetDeviceList("30","1");
- if (deviceResult.Code == StateCode.SUCCESS)
- {
- endTime = DateTime.Now.AddSeconds(5);
- MainPage.Log($"璇诲彇璁惧淇℃伅鎴愬姛");
- var deviceList = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
- if (deviceList == null)
- {
- deviceList = new DevcieApiPack();
- }
+ //===================璁惧=======================
+ new System.Threading.Thread(() =>
+ {
try
{
- while (deviceList.totalPage != deviceList.pageNo)
+ complateDevice = false;
+ var deviceResult = Ins.HttpRequest.GetDeviceList("30", "1");
+ if (deviceResult.Code == StateCode.SUCCESS)
{
- var deviceResult2 = Ins.HttpRequest.GetDeviceList("30", Convert.ToInt32(deviceList.pageNo) + 1 + "");
- if (deviceResult2.Code == StateCode.SUCCESS)
+ FunctionList.List.ClearDatas();
+ MainPage.Log($"============璁惧============寮�濮�" + FunctionList.List.Functions.Count);
+ //MainPage.Log($"璇诲彇璁惧淇℃伅鎴愬姛");
+ //MainPage.Log($"sid鍒楄〃鑾峰彇====" + deviceResult.Data.ToString());
+ var deviceList = JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
+ if (deviceList == null)
{
- var deviceList2 = Newtonsoft.Json.JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
- deviceList.pageNo = deviceList2.pageNo;
- deviceList.list.AddRange(deviceList2.list);
+ deviceList = new DevcieApiPack();
}
- }
- }catch(Exception ex)
- {
-
- }
-
- string delFile = "";
- if (FunctionList.List.GetDeviceFunctionList().Count > 0)
- {
-
- for (int i = 0; i < FunctionList.List.GetDeviceFunctionList().Count;)
- {
- var localFunction = FunctionList.List.GetDeviceFunctionList()[i];
- //if (SPK.MusicSpkList().Contains(localFunction.spk))
- //{
- // i++;
- // continue;
- //}
- var newFunction = deviceList.list.Find((obj) => obj.deviceId == localFunction.deviceId);
-
- if (delFile == localFunction.savePath)
+ try
{
- i++;
- continue;
- }
- delFile = localFunction.savePath;
- FunctionList.List.DeleteFunction(localFunction);
- }
- }
- //澶勭悊鍓╀笅鐨勬柊澧炲姛鑳�
- foreach (var newFunction in deviceList.list)
- {
- newFunction.AssembleStatus();
- newFunction.SaveFunctionFile();
- FunctionList.List.IniFunctionList(newFunction.savePath);
- }
- endTime = DateTime.Now.AddSeconds(5);
- }
- else
- {
- MainPage.Log($"璇诲彇浜戠璁惧鏁版嵁澶辫触:Code:{deviceResult.Code}; Msg:{deviceResult.message}");
- }
-
- //===================鍦烘櫙==========================
- var pack = Ins.HttpRequest.GetSceneList();
- if (pack.Code == StateCode.SUCCESS)
- {
- endTime = DateTime.Now.AddSeconds(100);
- MainPage.Log($"璇诲彇鍦烘櫙鏁版嵁鎴愬姛");
- var sceneList = JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString());
- if (sceneList == null)
- {
- sceneList = new List<Scene>();
- }
- FunctionList.List.scenes.Clear();
-
- //澶勭悊鍓╀笅鐨勬柊澧炲姛鑳�
- foreach (var tempScene in sceneList)
- {
- tempScene.SaveSceneFile();
- FunctionList.List.scenes.Add(tempScene);
- }
- //濡傛灉鏄竴绔彛闇�瑕佹彁鍓嶄笅杞藉満鏅暟鎹紝鍚﹀垯鎺у埗涓嶄簡涓�绔彛鍦烘櫙
- if (DB_ResidenceData.Instance.GatewayType == 0)
- {
- var sceneIds = new List<string>();
- foreach (var tempScene in FunctionList.List.scenes)
- {
- sceneIds.Add(tempScene.userSceneId);
- }
- var packInfo = HttpRequest.GetSceneListInfo(sceneIds);
- if (packInfo.Code == StateCode.SUCCESS)
- {
- var serverTempList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(packInfo.Data.ToString());
- foreach (var localScene in FunctionList.List.scenes)
- {
- var serverTemp = serverTempList.Find((obj) => obj.userSceneId == localScene.userSceneId);
- if (serverTemp != null)
+ while (deviceList.totalPage != deviceList.pageNo)
{
- localScene.functions = serverTemp.functions;
- localScene.SaveSceneFile();
+ var deviceResult2 = Ins.HttpRequest.GetDeviceList("30", Convert.ToInt32(deviceList.pageNo) + 1 + "");
+ if (deviceResult2.Code == StateCode.SUCCESS)
+ {
+ var deviceList2 = JsonConvert.DeserializeObject<DevcieApiPack>(deviceResult.Data.ToString());
+ deviceList.pageNo = deviceList2.pageNo;
+ deviceList.list.AddRange(deviceList2.list);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ }
+ finally
+ {
+
+ }
+
+ string delFile = "";
+ if (FunctionList.List.GetDeviceFunctionList().Count > 0)
+ {
+
+ for (int i = 0; i < FunctionList.List.GetDeviceFunctionList().Count;)
+ {
+ var localFunction = FunctionList.List.GetDeviceFunctionList()[i];
+ //if (SPK.MusicSpkList().Contains(localFunction.spk))
+ //{
+ // i++;
+ // continue;
+ //}
+ var newFunction = deviceList.list.Find((obj) => obj.deviceId == localFunction.deviceId);
+
+ if (delFile == localFunction.savePath)
+ {
+ i++;
+ continue;
+ }
+ delFile = localFunction.savePath;
+ FunctionList.List.DeleteFunction(localFunction);
+ }
+ }
+ //澶勭悊鍓╀笅鐨勬柊澧炲姛鑳�
+ int iiii = 0;
+ foreach (var newFunction in deviceList.list)
+ {
+ newFunction.AssembleStatus();
+ newFunction.SaveFunctionFile();
+ FunctionList.List.IniFunctionList(newFunction.savePath,true);
+ MainPage.Log($"============璁惧============{iiii++}");
+ }
+
+
+
+ //===================璇诲彇鍙瀵硅鏁版嵁==========================
+ //鍒ゆ柇鏄惁鏈夊彲瑙嗗璁叉暟鎹紝鏈夊垯鏄剧ず鍙瀵硅icon
+ //var flVideoInfo = HttpRequest.CheckFlVideo();
+ //if(flVideoInfo.Code == StateCode.SUCCESS)
+ //{
+ // FunctionList.List.videoIntercom1111 = Newtonsoft.Json.JsonConvert.DeserializeObject<UI.UI2.FuntionControlView.Video.VideoClouds>(flVideoInfo.Data.ToString());
+ //}
+
+ //======================鑾峰彇鍙瀵硅璁惧鍒楄〃====================
+ bool isInterphoneType_HDL = false;//鏄惁涓篐DLLinphone鍙瀵硅
+ bool isInterphoneType_FREEVIEW = false;//鏄惁涓哄叏瑙嗛�氬彲瑙嗗璁�
+ var videoInfo = VideoSend.GetVideoInfoList();
+ if (videoInfo.Code == StateCode.SUCCESS)
+ {
+ string videoList = videoInfo.Data.ToString();
+ FunctionList.List.videoIntercom = JsonConvert.DeserializeObject<List<UI.UI2.FuntionControlView.Video.Video>>(videoList);
+
+ foreach (var video in FunctionList.List.videoIntercom)
+ {
+ if (video.interphoneType == InterphoneType.IMOUVISIAL.ToString())
+ {
+ UI.UI2.PersonalCenter.PirDevice.PirSend.LcSubAccessToken = video.subAccountToken;
+ }
+ else if (video.interphoneType == InterphoneType.HDL.ToString())
+ {
+ isInterphoneType_HDL = true;
+ DB_ResidenceData.Instance.SupportFacePass = true;
+ DB_ResidenceData.Instance.SaveResidenceData();
+
+ Entity.DB_ResidenceData.Instance.SupportFVDevice = true;
+ }
+ else if (video.interphoneType == InterphoneType.FREEVIEW.ToString())
+ {
+ //涓哄叏瑙嗛�氬彲瑙嗗璁�
+ DB_ResidenceData.Instance.SupportFacePass = true;
+ Entity.DB_ResidenceData.Instance.SupportVisitorManage = true;
+ Entity.DB_ResidenceData.Instance.SupportFVDevice = true;
+
+ //isInterphoneType_HDL = true;
+ isInterphoneType_FREEVIEW = true;
+
+ }
+ }
+ }
+
+
+ //======================鑾峰彇Sip璐﹀彿骞朵笖鍒濆鍖朣DK鍙瀵硅璁惧鍒楄〃====================
+ //濡傛灉妫�娴嬬嚎绋嬫病鍚姩锛屾墠缁х画涓嬮潰鎿嶄綔 鍥犱负App鏈夊彲鑳藉垰鍚姩椹笂鏀跺埌鎺ㄩ�佷簡锛岀劧鍚庢墠鎵ц鍒拌繖閲�
+ if (HDLLinphone.Current.CheckIncomingCallThreadIsNull())
+ {
+ //褰撳墠浣忓畢鏄疕DL鍙瀵硅绫诲瀷鐨勮澶�
+ if (isInterphoneType_HDL)
+ {
+ //HDLLinphone鍙瀵硅,鑾峰彇Sip璐﹀彿骞跺垵濮嬪寲SDK
+ HDLCallVideoInfo callVideoInfo = new HDLCallVideoInfo();
+ callVideoInfo.HomeId = DB_ResidenceData.Instance.CurrentRegion.id;
+ callVideoInfo.InterphoneType = InterphoneType.HDL.ToString();
+ HDLLinphone.Current.GetHDLSipInfoAndInitSDK(callVideoInfo);
+ }
+ else if (isInterphoneType_FREEVIEW)
+ {
+
+ //HDLLinphone鍙瀵硅,鑾峰彇Sip璐﹀彿骞跺垵濮嬪寲SDK
+ HDLCallVideoInfo callVideoInfo = new HDLCallVideoInfo();
+ callVideoInfo.HomeId = DB_ResidenceData.Instance.CurrentRegion.id;
+ callVideoInfo.InterphoneType = InterphoneType.FREEVIEW.ToString();
+ HDLLinphone.Current.GetHDLSipInfoAndInitSDK(callVideoInfo);
+ }
+ else
+ {
+ Utlis.WriteLine("褰撳墠浣忓畢涓嶆敮鎸丠DL鍙瀵硅,閫�鍑虹櫥褰曟墍鏈夎处鍙�");
+ //褰撳墠浣忓畢涓嶆敮鎸丠DL鍙瀵硅
+ HDLLinphone.Current.LogoutAllAccount();
+ }
+ }
+
+
+
+ //======================鐧诲綍鍏ㄨ閫�====================
+ if (isInterphoneType_FREEVIEW)
+ {
+
+#if __IOS__
+ List<VisitorTempPassword> dataList = new List<VisitorTempPassword>();
+ Dictionary<string, object> dictionary = new Dictionary<string, object>();
+ dictionary.Add("homeId", Entity.DB_ResidenceData.Instance.CurrentRegion.id);
+ var requestJson = HttpUtil.GetSignRequestJson(dictionary);
+ ResponsePackNew pack = HttpUtil.RequestHttpsPost(NewAPI.Api_Post_GetExtMemberInfo, requestJson);
+ if(pack!= null)
+ {
+ var data = Newtonsoft.Json.JsonConvert.DeserializeObject<FreeviewMemberInfo>(pack.Data.ToString());
+ //鐧诲綍鍏ㄨ閫�
+ Shared.IOS.HDLFVSDK.Video.Init("", data.extUserId, DB_ResidenceData.Instance.CurrentRegion.id, "78FF1E4D-FC0A-4E71-9B79-0448E4460BD7", "T0001", "120.77.53.170:9700", "120.77.53.170:21664");
+
+ }
+#endif
+ }
+
+ }
+ else
+ {
+ MainPage.Log($"璇诲彇浜戠璁惧鏁版嵁澶辫触:Code:{deviceResult.Code}; Msg:{deviceResult.message}");
+ }
+ }catch (Exception ex)
+ {
+ MainPage.Log($"============璁惧============{ex.Message}");
+ }
+ finally
+ {
+ complateDevice = true;
+ MainPage.Log($"============璁惧============瀹屾垚" + FunctionList.List.Functions.Count);
+ }
+
+
+#if DEBUG
+ DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl = true;
+#endif
+ if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl)
+ {
+ var pack = Ins.HttpRequest.GetGroupControlList();
+ if (pack != null)
+ {
+ if (pack.Code == StateCode.SUCCESS)
+ {
+ try
+ {
+ var groupControlList = JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString());
+ var readSidList = new List<string>();
+ foreach(var temp in groupControlList)
+ {
+ FunctionList.List.groupControls.Clear();
+ readSidList.Add(temp.userDeviceGroupControlId);
+ if (readSidList.Count >= 20)
+ {
+ var data = Ins.httpRequest.GetGroupControInfo(readSidList);
+ if(data != null)
+ {
+ if(data.Code == StateCode.SUCCESS)
+ {
+ var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString());
+ FunctionList.List.groupControls.AddRange(groupControlInfoList);
+ }
+ else
+ {
+ IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+ }
+ }
+ readSidList.Clear();
+ }
+ }
+ if (readSidList.Count > 0)
+ {
+ var data = Ins.httpRequest.GetGroupControInfo(readSidList);
+ if (data != null)
+ {
+ if (data.Code == StateCode.SUCCESS)
+ {
+ var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString());
+ FunctionList.List.groupControls.AddRange(groupControlInfoList);
+ }
+ else
+ {
+ IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+ }
+ }
+ readSidList.Clear();
+ }
+ }
+ catch (Exception ex)
+ {
+ MainPage.Log($"璇诲彇缁勬帶鍒楄〃澶辫触:{ex.Message}");
+ }
+ }
+ else
+ {
+ IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+ }
+ }
+ }
+
+
+ //})
+ //{ IsBackground = true }.Start();
+
+ try
+ {
+ complateScene = false;
+ var pack = Ins.HttpRequest.GetSceneList();
+ if (pack.Code == StateCode.SUCCESS)
+ {
+ MainPage.Log($"璇诲彇鍦烘櫙鏁版嵁鎴愬姛");
+ var sceneList = JsonConvert.DeserializeObject<List<Scene>>(pack.Data.ToString());
+ if (sceneList == null)
+ {
+ sceneList = new List<Scene>();
+ }
+ FunctionList.List.scenes.Clear();
+
+ //澶勭悊鍓╀笅鐨勬柊澧炲姛鑳�
+ foreach (var tempScene in sceneList)
+ {
+ tempScene.SaveSceneFile();
+ FunctionList.List.scenes.Add(tempScene);
+ }
+ //濡傛灉鏄竴绔彛闇�瑕佹彁鍓嶄笅杞藉満鏅暟鎹紝鍚﹀垯鎺у埗涓嶄簡涓�绔彛鍦烘櫙
+ if (DB_ResidenceData.Instance.GatewayType == 0)
+ {
+ var sceneIds = new List<string>();
+ foreach (var tempScene in FunctionList.List.scenes)
+ {
+ sceneIds.Add(tempScene.userSceneId);
+ }
+ var packInfo = HttpRequest.GetSceneListInfo(sceneIds);
+ if (packInfo.Code == StateCode.SUCCESS)
+ {
+ var serverTempList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Scene>>(packInfo.Data.ToString());
+ foreach (var localScene in FunctionList.List.scenes)
+ {
+ var serverTemp = serverTempList.Find((obj) => obj.userSceneId == localScene.userSceneId);
+ if (serverTemp != null)
+ {
+ localScene.functions = serverTemp.functions;
+ localScene.SaveSceneFile();
+ }
+ }
+ }
+ else
+ {
+ IMessageCommon.Current.ShowErrorInfoAlter(packInfo.Code);
}
}
}
else
{
- IMessageCommon.Current.ShowErrorInfoAlter(packInfo.Code);
+ MainPage.Log($"璇诲彇浜戠鍦烘櫙鏁版嵁澶辫触:Code:{pack.Code}; Msg:{pack.message}");
}
+ }catch(Exception ex)
+ {
+ MainPage.Log($"===鍦烘櫙==={ex.Message}");
}
- endTime = DateTime.Now.AddSeconds(5);
- }
- else
- {
- MainPage.Log($"璇诲彇浜戠鍦烘櫙鏁版嵁澶辫触:Code:{pack.Code}; Msg:{pack.message}");
- }
+ finally
+ {
+ complateScene = true;
+ }
+ })
+ { IsBackground = true }.Start();
//===================璇诲彇閫昏緫鍒楄〃==========================
- UI.UI2.Intelligence.Automation.MainView.GetLogicList();
+ Logic.LogicList.Clear();//涓婚〉涓嬫媺寮哄埗鍒锋柊鑷姩鍖栧垪琛�
+ //UI.UI2.Intelligence.Automation.MainView.GetLogicList();
- //===================璇诲彇鍙瀵硅鏁版嵁==========================
- //鍒ゆ柇鏄惁鏈夊彲瑙嗗璁叉暟鎹紝鏈夊垯鏄剧ず鍙瀵硅icon
- //var flVideoInfo = HttpRequest.CheckFlVideo();
- //if(flVideoInfo.Code == StateCode.SUCCESS)
- //{
- // FunctionList.List.videoIntercom1111 = Newtonsoft.Json.JsonConvert.DeserializeObject<UI.UI2.FuntionControlView.Video.VideoClouds>(flVideoInfo.Data.ToString());
- //}
-
- //======================鑾峰彇鍙瀵硅璁惧鍒楄〃====================
- bool isInterphoneType_HDL = false;//鏄惁涓篐DLLinphone鍙瀵硅
- bool isInterphoneType_FREEVIEW = false;//鏄惁涓哄叏瑙嗛�氬彲瑙嗗璁�
- var videoInfo = VideoSend.GetVideoInfoList();
- if (videoInfo.Code == StateCode.SUCCESS)
- {
- string videoList = videoInfo.Data.ToString();
- FunctionList.List.videoIntercom = JsonConvert.DeserializeObject<List<UI.UI2.FuntionControlView.Video.Video>>(videoList);
-
- foreach (var video in FunctionList.List.videoIntercom)
- {
- if (video.interphoneType == InterphoneType.IMOUVISIAL.ToString())
- {
- UI.UI2.PersonalCenter.PirDevice.PirSend.LcSubAccessToken = video.subAccountToken;
- } else if (video.interphoneType == InterphoneType.HDL.ToString()) {
- isInterphoneType_HDL = true;
- DB_ResidenceData.Instance.SupportFacePass = true;
- DB_ResidenceData.Instance.SaveResidenceData();
-
- Entity.DB_ResidenceData.Instance.SupportFVDevice = true;
-
- }
- else if (video.interphoneType == InterphoneType.FREEVIEW.ToString())
- {//涓哄叏瑙嗛�氬彲瑙嗗璁�
- DB_ResidenceData.Instance.SupportFacePass = true;
- Entity.DB_ResidenceData.Instance.SupportVisitorManage = true;
- Entity.DB_ResidenceData.Instance.SupportFVDevice = true;
-
- //isInterphoneType_HDL = true;
- isInterphoneType_FREEVIEW = true;
-
- }
- }
- }
-
- //======================鑾峰彇Sip璐﹀彿骞朵笖鍒濆鍖朣DK鍙瀵硅璁惧鍒楄〃====================
- //濡傛灉妫�娴嬬嚎绋嬫病鍚姩锛屾墠缁х画涓嬮潰鎿嶄綔 鍥犱负App鏈夊彲鑳藉垰鍚姩椹笂鏀跺埌鎺ㄩ�佷簡锛岀劧鍚庢墠鎵ц鍒拌繖閲�
- if (HDLLinphone.Current.CheckIncomingCallThreadIsNull()) {
- //褰撳墠浣忓畢鏄疕DL鍙瀵硅绫诲瀷鐨勮澶�
- if (isInterphoneType_HDL)
- {
- //HDLLinphone鍙瀵硅,鑾峰彇Sip璐﹀彿骞跺垵濮嬪寲SDK
- HDLCallVideoInfo callVideoInfo = new HDLCallVideoInfo();
- callVideoInfo.HomeId = DB_ResidenceData.Instance.CurrentRegion.id;
- callVideoInfo.InterphoneType = InterphoneType.HDL.ToString();
- HDLLinphone.Current.GetHDLSipInfoAndInitSDK(callVideoInfo);
- }
- else if (isInterphoneType_FREEVIEW)
- {
- //HDLLinphone鍙瀵硅,鑾峰彇Sip璐﹀彿骞跺垵濮嬪寲SDK
- HDLCallVideoInfo callVideoInfo = new HDLCallVideoInfo();
- callVideoInfo.HomeId = DB_ResidenceData.Instance.CurrentRegion.id;
- callVideoInfo.InterphoneType = InterphoneType.FREEVIEW.ToString();
- HDLLinphone.Current.GetHDLSipInfoAndInitSDK(callVideoInfo);
- }
- else
- {
- Utlis.WriteLine("褰撳墠浣忓畢涓嶆敮鎸丠DL鍙瀵硅,閫�鍑虹櫥褰曟墍鏈夎处鍙�");
- //褰撳墠浣忓畢涓嶆敮鎸丠DL鍙瀵硅
- HDLLinphone.Current.LogoutAllAccount();
- }
- }
-
- //======================鐧诲綍鍏ㄨ閫�====================
- if (isInterphoneType_FREEVIEW)
- {
-#if __IOS__
- //鐧诲綍鍏ㄨ閫�
- Shared.IOS.HDLFVSDK.Video.Init("", DB_ResidenceData.Instance.CurrentRegion.id);
-#endif
- }
//======================瀹夐槻====================
GetSecurityList();
+ //======================娉ㄥ唽鎺ㄩ��====================
+ httpRequest.RegisteredPush();
+
}
catch (Exception ex)
@@ -368,8 +506,6 @@
Application.RunOnMainThread(() =>
{
MainPage.Log($"缁撴潫璇诲彇浜戠鏁版嵁绾跨▼");
- endTime = DateTime.MinValue;
- DownloadDataComplete = true;
if (waitPage != null)
{
waitPage.RemoveFromParent();
@@ -379,7 +515,13 @@
//涓嶈�冭檻缃戝叧鎯呭喌锛岀洿鎺ヨ闃�
DAL.Mqtt.MqttClient.InitState();
- FunctionList.List.Read3tyFunctionStatus();
+ try
+ {
+ FunctionList.List.Read3tyFunctionStatus();
+ }catch(Exception ex)
+ {
+ MainPage.Log("璇诲彇绗笁鏂硅澶囩姸鎬佸け璐�:"+ex.Message);
+ }
}
});
downloadDataThread.IsBackground = true;
@@ -391,17 +533,13 @@
{
try
{
- while (endTime > DateTime.Now)
+ while (endTime1 > DateTime.Now)
{
- if (DownloadDataComplete)
+ if ( complateDevice && complateScene)
{
break;
}
System.Threading.Thread.Sleep(100);
- }
- if (!DownloadDataComplete)
- {
- //downloadDataThread.Abort();
}
DownloadDataComplete = true;
Application.RunOnMainThread(() =>
@@ -412,9 +550,6 @@
waitPage = null;
}
});
- //鍒濆鍖栨暟鎹�
- //SpatialInfo.CurrentSpatial.Clear();
-
}
catch { }
finally
@@ -479,6 +614,7 @@
FileUtlis.Files.DeleteFile(file);
}
}
+ FunctionList.List.securities.Clear();
foreach (var function in infoList)
{
function.SaveFile();
--
Gitblit v1.8.0