Browse Source

fixed delay 3 second

main
jkpete 3 weeks ago
parent
commit
9a545a7dff
  1. 12
      Script/Model/ModelTrackControl.cs

12
Script/Model/ModelTrackControl.cs

@ -44,12 +44,18 @@ public class ModelTrackControl : EGModule, IEGFramework
if (CurrentRotation != 0) if (CurrentRotation != 0)
{ {
this.EGSendMessage(new RequestTargetControl(2000, 500, true), this.GetModule<ModelSerialTest>().EngineSerialPort, ProtocolType.SerialPort); this.EGSendMessage(new RequestTargetControl(2000, 500, true), this.GetModule<ModelSerialTest>().EngineSerialPort, ProtocolType.SerialPort);
this.EGSendMessage(new RequestTargetResetPosition(), this.GetModule<ModelSerialTest>().EngineSerialPort, ProtocolType.SerialPort); DelayClear();
CurrentRotation = 0;
this.GetModule<ModelActionStatus>().SetRotation(CurrentRotation);
} }
} }
public async void DelayClear()
{
await Task.Delay(3000);
this.EGSendMessage(new RequestTargetResetPosition(), this.GetModule<ModelSerialTest>().EngineSerialPort, ProtocolType.SerialPort);
CurrentRotation = 0;
this.GetModule<ModelActionStatus>().SetRotation(CurrentRotation);
}
} }
public enum StatusTrack public enum StatusTrack

Loading…
Cancel
Save