What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

Cancel "gps.GpsMove"

nick1988

New Member
Joined
Sep 1, 2014
Messages
163
Reaction score
2
Maybe I am blind, but I cant find this within the API documentation. How can I cancel my current "gps.GpsMove"
 
Run it in a different thread, and abort the thread when you dont want to move again
 
is there a way without treads? I don't quite understand how to do it with threads :( I was hoping there is something like "gps.CancelMove"

What I do have right now, looks like this:

while (GetGroupStatus("DoStuff"))
{
gps = new Gps(this);
gps.LoadDataBase(Application.StartupPath + "\\plugins\\plugin\\plugin.db3");
gps.onGpsPreMove += gpsPreMove;
gps.GpsMove(path);
}

So if I was thinking, that he would just move, while "DoStuff" is == true.
But unfortunately, he keeps moving even when "DoStuff" is == false.
Only completly killing the plugin by pressing "stop" in the manager, he stops moving :(
 
gps.SuspendGpsMove();
gps.ResumeGpsMove();
 
I don't think that SuspendGpsMove() will work while executing the GpsMove() method in single threaded application. The reasoning is that that thread is actively executing the GpsMove() method and other methods aren't executed until it has finished the path. If you want to be able to cancel you will need to go with a multi-threaded approach. You can keep the GpsMove() method in the mail thread after starting a "monitoring" thread, or you can start a thread for GpsMove() while the main thread monitors conditions for suspending it.
 
Back
Top