From e63d7efbe2a41783989bdaea94d37bb6f16deb22 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期日, 06 六月 2021 16:41:19 +0800
Subject: [PATCH] 兆观传感器

---
 HDL_ON/Entity/Function/Function.cs   |   27 ++++++++++++-
 .vs/HDL_APP_Project/xs/UserPrefs.xml |   18 ++++++---
 HDL_ON/DAL/DriverLayer/Control.cs    |   25 ++++++++----
 HDL_ON/Entity/FunctionList.cs        |   22 +++++++++++
 4 files changed, 75 insertions(+), 17 deletions(-)

diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml
index 922e5e6..47df2ca 100644
--- a/.vs/HDL_APP_Project/xs/UserPrefs.xml
+++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,6 +1,6 @@
 锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
   <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" />
-  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/DAL/Mqtt/MqttClient.cs">
+  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/DAL/DriverLayer/Control.cs">
     <Files>
       <File FileName="HDL_ON/Common/R.cs" Line="9" Column="19" />
       <File FileName="HDL-ON_iOS/Resources/Language.ini" />
@@ -18,14 +18,13 @@
       <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmSensor/ArmSensorHistroyPaging.cs" />
       <File FileName="HDL_ON/UI/UI0-Stan/Form/DeviceFunctionCardCommonForm.cs" />
       <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SenesorMegahealthPage.cs" />
-      <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" />
+      <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="675" Column="34" />
       <File FileName="HDL_ON/DAL/Server/NewApiRes.cs" />
       <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs" />
       <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs" />
-      <File FileName="HDL_ON/Entity/Function/Function.cs" />
       <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" />
       <File FileName="HDL_ON/DAL/Server/NewAPI.cs" />
-      <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="681" Column="5" />
+      <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="424" Column="69" />
     </Files>
     <Pads>
       <Pad Id="ProjectPad">
@@ -33,10 +32,16 @@
           <Node name="HDL_APP_Project" expanded="True">
             <Node name="HDL_ON" expanded="True">
               <Node name="DAL" expanded="True">
-                <Node name="Mqtt" expanded="True">
-                  <Node name="MqttClient.cs" selected="True" />
+                <Node name="DriverLayer" expanded="True">
+                  <Node name="Control.cs" selected="True" />
                 </Node>
+                <Node name="Mqtt" expanded="True" />
+                <Node name="Server" expanded="True" />
               </Node>
+              <Node name="Entity" expanded="True">
+                <Node name="Function" expanded="True" />
+              </Node>
+              <Node name="UI" expanded="True" />
             </Node>
           </Node>
         </State>
@@ -59,6 +64,7 @@
       <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="1857" column="1" />
       <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorMegahealth/AddSenesorMegahealthDirection1Page.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorMegahealth/AddSenesorMegahealthDirection1Page.cs" line="119" column="1" />
       <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Mqtt/MqttClient.cs" relfile="HDL_ON/DAL/Mqtt/MqttClient.cs" line="678" column="1" />
+      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/DriverLayer/Control.cs" relfile="HDL_ON/DAL/DriverLayer/Control.cs" line="673" column="1" />
     </BreakpointStore>
   </MonoDevelop.Ide.DebuggingService.Breakpoints>
   <MultiItemStartupConfigurations />
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index 8319edc..559605c 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -669,15 +669,6 @@
         /// <param name="updateBytes"></param>
         public void UpdataFunctionStatus(string revString, byte[] usefulBytes,bool isCloudData = false)
         {
-
-            if (Ins.GatewayOnline_Local && isCloudData)//鏈湴閾炬帴锛岄櫎浜嗘秱楦﹁澶囨暟鎹箣澶栫殑浜戠鏁版嵁涓嶅鐞�
-            {
-                if (FunctionList.List.GetDeviceFunctionList(SPK.BrandType.Tuya).Count == 0)
-                {
-                    //MainPage.Log($"A鍗忚鏇存柊鐘舵��:鏈湴閾炬帴锛岄櫎浜嗘秱楦﹁澶囨暟鎹箣澶栫殑浜戠鏁版嵁涓嶅鐞�...");
-                    return;
-                }
-            }
             var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<AlinkFunctionStatusObj>(revString);
             if (temp != null)
             {
@@ -687,6 +678,22 @@
                 {
                     try
                     {
+
+                        if (Ins.GatewayOnline_Local && isCloudData)//鏈湴閾炬帴锛岄櫎浜嗘秱楦﹁澶囨暟鎹箣澶栫殑浜戠鏁版嵁涓嶅鐞�
+                        {
+                            if (FunctionList.List.OtherBrandFunction.Count != 0)
+                            {
+                                if (FunctionList.List.OtherBrandFunction.Find((obj) => obj.sid == updateTemp.sid) == null)
+                                {
+                                    //MainPage.Log($"A鍗忚鏇存柊鐘舵��:鏈湴閾炬帴锛岄櫎浜嗘秱楦﹁澶囨暟鎹箣澶栫殑浜戠鏁版嵁涓嶅鐞�...");
+                                    return;
+                                }
+                            }
+                        }
+
+
+
+
                         var localFunction = allLocalFuntion.Find((obj) => obj.sid == updateTemp.sid);
                         if (localFunction == null)
                         {
diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index 307f038..35baaa8 100644
--- a/HDL_ON/Entity/Function/Function.cs
+++ b/HDL_ON/Entity/Function/Function.cs
@@ -945,6 +945,8 @@
 
     public static class SPK
     {
+       
+
 
         #region 鐏厜
         /// <summary>
@@ -1349,7 +1351,21 @@
         }
         #endregion
 
-
+        #region 绗笁鏂箂pk鍒楄〃
+        /// <summary>
+        /// 鑾峰彇鎵�鏈夌涓夋柟鍝佺墝鍔熻兘鐨剆pk
+        /// </summary>
+        /// <returns></returns>
+        public static List<string> GetAll3tySPK()
+        {
+            var spkList = new List<string>();
+            spkList.Add(ElectricTuyaAirCleaner);
+            spkList.Add(ElectricTuyaFan);
+            spkList.Add(ElectricTuyaWaterValve);
+            spkList.Add(ElectricTuyaWeepRobot);
+            spkList.Add(SenesorMegahealth);
+            return spkList;
+        }
         /// <summary>
         /// 鑾峰彇绗笁鏂硅澶噑pk
         /// </summary>
@@ -1360,16 +1376,19 @@
 
             switch (brandType)
             {
-                case BrandType.All3tyBrand:
                 case BrandType.Tuya:
                     list.Add(ElectricTuyaAirCleaner);
                     list.Add(ElectricTuyaFan);
                     list.Add(ElectricTuyaWaterValve);
                     list.Add(ElectricTuyaWeepRobot);
                     break;
+                case BrandType.All3tyBrand:
+                    list.Add(SenesorMegahealth);//鍏嗚
+                    break;
             }
             return list;
         }
+        #endregion
 
 
         /// <summary>
@@ -1380,6 +1399,10 @@
             All = 0,
             Hdl = 1,
             Tuya = 2,
+            /// <summary>
+            /// 鍏嗚
+            /// </summary>
+            Megahealth = 3,
 
 
             All3tyBrand = 999,
diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs
index bef3882..62b1fee 100644
--- a/HDL_ON/Entity/FunctionList.cs
+++ b/HDL_ON/Entity/FunctionList.cs
@@ -143,6 +143,25 @@
         /// </summary>
         public UI.UI2.FuntionControlView.Video.VideoClouds videoIntercom;
 
+        List<Function> _OtherBrandFunction;
+        /// <summary>
+        /// 绗笁鏂瑰搧鐗屽姛鑳�
+        /// </summary>
+        public List<Function> OtherBrandFunction
+        {
+            get
+            {
+                if(_OtherBrandFunction == null)
+                {
+                    _OtherBrandFunction = new List<Function>();
+                    var spkList = SPK.GetAll3tySPK();
+                    _OtherBrandFunction = Functions.FindAll((obj) => spkList.Contains(obj.spk));
+                }
+                return _OtherBrandFunction;
+            }
+        }
+
+
         /// <summary>
         /// 鍦烘櫙鍒楄〃
         /// </summary>
@@ -271,6 +290,9 @@
             return Functions;
         }
 
+
+
+
         /// <summary>
         /// 娓呯┖璁惧鍔熻兘鍒楄〃
         /// </summary>

--
Gitblit v1.8.0