From 78c5b5715518c0017d9f629ce16ee9c173a48690 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 28 八月 2020 09:59:18 +0800
Subject: [PATCH] 2020-08-28-1

---
 ZigbeeApp/Shared/Phone/Device/Logic/Method.cs |   50 ++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 40 insertions(+), 10 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
index 560bd30..62ce91a 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
@@ -901,28 +901,58 @@
             UserView.HomePage.Instance.RemoveViewByTag("Logic");//绉婚櫎鎵�鏈夋爣璁癓ogic鐣岄潰
             if (LogicView.IfString._Logic == if_logic)
             {
-                //鏌ヨ閫昏緫鏄惁娣诲姞鍦扮悊浣嶇疆浣滀负鏉′欢
+
+                //鏌ヨ-褰撳墠閫昏緫-鏄惁娣诲姞鍦扮悊浣嶇疆浣滀负鏉′欢
                 var exist = Common.Logic.CurrentLogic.Conditions.Find((obj) => obj["Type"] == "7");
                 if (exist==null)
                 {
-                    //濡傛灉鎵句笉鍒板湴鐞嗕綅缃綔涓烘潯浠剁殑璇�,鍏抽棴GPS鏈嶅姟(鍑忓皯鑰楃數)
-                    if (Send.It_Exist == "1")
+                    bool if_type = false;
+                    //鏌ヨ-閫昏緫鍒楄〃-鏄惁娣诲姞杩囧湴鐞嗕綅缃綔涓烘潯浠�
+                    for (int a = 0; a < Common.Logic.LogicList.Count; a++)
                     {
-                        //鍏抽棴GPS鏈嶅姟
-                        Application.StopGPSLocationService();
-                        //淇濆瓨GPS鏈嶅姟鍏抽棴鐘舵��
-                        Send.SaveLocalFile("GPS_File", "0");
+                        var logic = Common.Logic.LogicList[a];
+                        var exist_logic = logic.Conditions.Find((obj) => obj["Type"] == "7");
+                        if (exist_logic != null)
+                        {
+                            //鏄惁瀛樺湪鍦扮悊浣嶇疆鏉′欢
+                            if_type = true;
+                            //閫�鍑篺or寰幆
+                            break;
+                        }
+                    }
+                    if (if_type)
+                    {
+                        //鏌ヨ涔嬪墠鐘舵�佹槸鍚﹀凡缁忓紑鍚疓PS鏈嶅姟(浠ユ湰鍦板瓨鍌ㄧ姸鎬佷负涓� 0:娌″紑鍚�; 1锛氬紑鍚�)
+                        if (Send.If_Exist == "0")
+                        {
+                            //寮�鍚疓PS鏈嶅姟
+                            Application.StartGPSLocationService();
+                            //淇濆瓨GPS鏈嶅姟寮�鍚姸鎬�
+                            Send.SaveLocalFile(Config.Instance.HomeId + "_GPS_File", "1");
+                        }
+
+                    }
+                    else
+                    {
+                        //濡傛灉鎵句笉鍒板湴鐞嗕綅缃綔涓烘潯浠剁殑璇�,鍏抽棴GPS鏈嶅姟(鍑忓皯鑰楃數)
+                        if (Send.If_Exist == "1")
+                        {
+                            //鍏抽棴GPS鏈嶅姟
+                            Application.StopGPSLocationService();
+                            //淇濆瓨GPS鏈嶅姟鍏抽棴鐘舵��
+                            Send.SaveLocalFile(Config.Instance.HomeId + "_GPS_File", "0");
+                        }
                     }
                 }
                 else
                 {
-                    if (Send.It_Exist == "0")
+                    //鏌ヨ涔嬪墠鐘舵�佹槸鍚﹀凡缁忓紑鍚疓PS鏈嶅姟(浠ユ湰鍦板瓨鍌ㄧ姸鎬佷负涓� 0:娌″紑鍚�; 1锛氬紑鍚�)
+                    if (Send.If_Exist == "0")
                     {
-                    
                         //寮�鍚疓PS鏈嶅姟
                         Application.StartGPSLocationService();
                         //淇濆瓨GPS鏈嶅姟寮�鍚姸鎬�
-                        Send.SaveLocalFile("GPS_File", "1");
+                        Send.SaveLocalFile(Config.Instance.HomeId + "_GPS_File", "1");
                     }
                 }
                 //鍙埛鏂板垎绫�-鑷姩鍖栦笂涓嬫粦鍔╲iew锛�

--
Gitblit v1.8.0