From 9a545a7dffc67a0476270a095207cbd26765cec7 Mon Sep 17 00:00:00 2001 From: jkpete <1031139173@qq.com> Date: Thu, 25 Dec 2025 16:16:01 +0800 Subject: [PATCH] fixed delay 3 second --- Script/Model/ModelTrackControl.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Script/Model/ModelTrackControl.cs b/Script/Model/ModelTrackControl.cs index c17e7e8..d293642 100644 --- a/Script/Model/ModelTrackControl.cs +++ b/Script/Model/ModelTrackControl.cs @@ -44,12 +44,18 @@ public class ModelTrackControl : EGModule, IEGFramework if (CurrentRotation != 0) { this.EGSendMessage(new RequestTargetControl(2000, 500, true), this.GetModule().EngineSerialPort, ProtocolType.SerialPort); - this.EGSendMessage(new RequestTargetResetPosition(), this.GetModule().EngineSerialPort, ProtocolType.SerialPort); - CurrentRotation = 0; - this.GetModule().SetRotation(CurrentRotation); + DelayClear(); } } + public async void DelayClear() + { + await Task.Delay(3000); + this.EGSendMessage(new RequestTargetResetPosition(), this.GetModule().EngineSerialPort, ProtocolType.SerialPort); + CurrentRotation = 0; + this.GetModule().SetRotation(CurrentRotation); + } + } public enum StatusTrack