From 7e42cc13a14b7de31c9f5d5c61cdf24f3246335d Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 31 三月 2023 11:36:45 +0800
Subject: [PATCH] 1

---
 Crabtree/SmartHome/HDL/Operation/Control.cs |   41 +++++++++++++++++++++++++++++++++++++++--
 1 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/Crabtree/SmartHome/HDL/Operation/Control.cs b/Crabtree/SmartHome/HDL/Operation/Control.cs
index c30e693..0b0b1b2 100644
--- a/Crabtree/SmartHome/HDL/Operation/Control.cs
+++ b/Crabtree/SmartHome/HDL/Operation/Control.cs
@@ -393,8 +393,43 @@
                     //MainPage.AddTip (Language.StringByID (SimpleControl.R.MyInternationalizationString.OperationFailed));
                 }
             }
-        }
+            return;
+            //if (Shared.SimpleControl.CommonPage.IsRemote && !isLocal) {
+            //    System.Console.WriteLine ("杩滅▼鍙戦�佹暟鎹�:" + SendFlag);
+            //    SmartHome.MqttCommon.MqttRemoteSend (Packet.Bytes);
+            //    Packet.FlagDateTime = DateTime.Now;
+            //    Packet.HaveSendCount--;
+            //    //杩欓噷鏄噸鍙戜袱娆�
+            //    while (Packet.HaveSendCount < 3) {
+            //        if (Packet.FlagDateTime.AddMilliseconds (1000).Ticks <= System.DateTime.Now.Ticks) {
+            //            SmartHome.MqttCommon.MqttRemoteSend (Packet.Bytes);
+            //            System.Console.WriteLine ("閲嶅彂杩滅▼鍙戦�佹暟鎹�:" + SendFlag);
+            //            Packet.FlagDateTime = DateTime.Now;
+            //            Packet.HaveSendCount++;
+            //        }
+            //        System.Threading.Thread.Sleep (100);
+            //    }鈥�            //    allDone.Set ();鈥�            //} else {
+            //    try {
+            //        System.Console.WriteLine ("鍙戦�佹暟鎹�:" + SendFlag);
+            //        BusSocket.AsyncBeginSend (Packet);
+            //        Packet.HaveSendCount--;
 
+            //        //杩欓噷鏄噸鍙戜袱娆�
+            //        while (Packet.HaveSendCount < 3) {
+            //            if (Packet.FlagDateTime.AddMilliseconds (1000).Ticks <= System.DateTime.Now.Ticks) {
+            //                System.Console.WriteLine ("閲嶅彂鏁版嵁:" + SendFlag);
+            //                BusSocket.AsyncBeginSend (Packet);
+            //            }
+            //            System.Threading.Thread.Sleep (100);
+            //        }
+
+            //    } catch (Exception ex) {
+            //        Console.WriteLine ("managerSendCount:" + ex.ToString ());
+            //    } finally {
+            //        allDone.Set ();
+            //    }
+            //}
+        }
         /// <summary>
         /// 褰撳墠鏁版嵁鍖�
         /// </summary>
@@ -586,8 +621,9 @@
         /// </summary>
         /// <param name="target">鍙戦�佸璞�</param>
         /// <param name="sendCount">閲嶅彂娆℃暟</param>
-        public void Send (Target target, SendCount sendCount, bool isWait)
+        public void Send (Target target, SendCount sendCount, bool isWait, bool needLocal = false)
         {
+            isLocal = needLocal;
             Packet = new Packet (target.SendBytes, target.IPEndPoint);
             Packet.HaveSendCount = 3 - (int)sendCount;
 
@@ -597,5 +633,6 @@
                 this.wait ();
             }
         }
+        bool isLocal = false;
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0