re-implemented basic autopilot

This commit is contained in:
Stephan Richter
2021-03-12 16:55:52 +01:00
parent 6bf7882f3b
commit 9effb8d337
6 changed files with 57 additions and 55 deletions

View File

@@ -28,6 +28,9 @@ public class BrakeProcessor extends BaseClass implements Runnable {
public BrakeProcessor(Train train) {
this.train = train;
Thread thread = new Thread(this);
thread.setName(getClass().getSimpleName());
thread.start();
}
public void end() {
@@ -88,12 +91,4 @@ public class BrakeProcessor extends BaseClass implements Runnable {
}
LOG.debug("{} reached final speed.", train);
}
public BrakeProcessor start() {
Thread thread = new Thread(this);
thread.setName(getClass().getSimpleName());
thread.start();
return this;
}
}

View File

@@ -30,6 +30,10 @@ public abstract class PathFinder extends BaseClass implements Runnable{
this.train = train;
this.startBlock = start;
this.direction = direction;
Thread thread = new Thread(this);
thread.setName("Pathfinder("+train+")");
thread.start();
}
public void abort() {
@@ -178,11 +182,4 @@ public abstract class PathFinder extends BaseClass implements Runnable{
public abstract void locked(Route r);
public abstract void found(Route r);
public abstract void prepared(Route r);
public PathFinder start() {
Thread thread = new Thread(this);
thread.setName("Pathfinder("+train+")");
thread.start();
return this;
}
}