From 9eec81850e418a3c16410b4870910bde142b06e3 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期三, 14 九月 2022 15:50:00 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/Dev-Branch' into wjc

---
 HDL_ON/Common/ApiUtlis.cs |   75 +++++++++++++++++++++++++++++++++++--
 1 files changed, 71 insertions(+), 4 deletions(-)

diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index 22953a6..10b28ef 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -285,7 +285,8 @@
 
                     //======================鑾峰彇鍙瀵硅璁惧鍒楄〃====================
                     bool isInterphoneType_HDL = false;//鏄惁涓篐DLLinphone鍙瀵硅
-                    var videoInfo= VideoSend.GetVideoInfoList();
+                    bool isInterphoneType_FREEVIEW = false;//鏄惁涓哄叏瑙嗛�氬彲瑙嗗璁�
+                    var videoInfo = VideoSend.GetVideoInfoList();
                     if (videoInfo.Code == StateCode.SUCCESS)
                     {
                         string videoList = videoInfo.Data.ToString();
@@ -300,6 +301,19 @@
                                 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;
+
                             }
                         }
                     }
@@ -311,7 +325,18 @@
                         if (isInterphoneType_HDL)
                         {
                             //HDLLinphone鍙瀵硅,鑾峰彇Sip璐﹀彿骞跺垵濮嬪寲SDK
-                            HDLLinphone.Current.GetHDLSipInfoAndInitSDK(DB_ResidenceData.Instance.CurrentRegion.id);
+                            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
                         {
@@ -320,6 +345,16 @@
                             HDLLinphone.Current.LogoutAllAccount();
                         }
                     }
+
+                    //======================鐧诲綍鍏ㄨ閫�====================
+                    if (isInterphoneType_FREEVIEW)
+                    {
+#if __IOS__
+                        //鐧诲綍鍏ㄨ閫�
+                        Shared.IOS.HDLFVSDK.Video.Init("", DB_ResidenceData.Instance.CurrentRegion.id);
+#endif
+                    }
+
 
                     //======================瀹夐槻====================
                     GetSecurityList();
@@ -387,17 +422,48 @@
                 {
                     if (DB_ResidenceData.Instance.CurrentRegion != null)
                     {
-                        #region 璇诲彇鏈湴鏁版嵁
+#region 璇诲彇鏈湴鏁版嵁
                         //鎼滅储缃戝叧
                         DriverLayer.Control.Ins.SearchLoaclGateway();
                         //閲嶆柊杩炴帴mqtt
                         DAL.Mqtt.MqttClient.DisConnectRemote("鍒锋柊鏁版嵁锛岄噸杩瀖qtt",false);
-                        #endregion
+#endregion
 
                     }
                 }
             })
             { IsBackground = true }.Start();
+
+
+
+
+            //涓嬭浇鍏変紡鏁版嵁
+            new System.Threading.Thread(() => {
+                try
+                {
+                    HttpServerRequest http = new HttpServerRequest();
+                    var packData = http.GetInverterList();
+                    if (packData != null)
+                    {
+                        if (packData.Code == StateCode.SUCCESS)
+                        {
+                            var inverterList = JsonConvert.DeserializeObject<List<InverterInfo>>(packData.Data.ToString());
+                            if (inverterList!= null)
+                            {
+                                FunctionList.List.InverterList = inverterList;
+                            }
+                        }
+                    }
+                }
+                catch (Exception ex)
+                {
+                    MainPage.Log($"璇诲彇鍏変紡鏁版嵁寮傚父:{ex.Message}");
+                }
+
+            }) { IsBackground = true }.Start();
+
+
+
         }
 
         /// <summary>
@@ -445,6 +511,7 @@
                             FileUtlis.Files.DeleteFile(file);
                         }
                     }
+                    FunctionList.List.securities.Clear();
                     foreach (var function in infoList)
                     {
                         function.SaveFile();

--
Gitblit v1.8.0