Browse Source

minor bugfix. next step: implementing the preserveNextRoute action.

Must work in the following conditions:
- called from route.setupActions
- called from route.startActions
- called from route.contactActions
- called from autopilot after reaching route.endBlock
lookup-tables
Stephan Richter 4 years ago
parent
commit
fd254db358
  1. 2
      pom.xml
  2. 2
      src/main/java/de/srsoftware/web4rail/actions/PreserveRoute.java
  3. 7
      src/main/java/de/srsoftware/web4rail/moving/Train.java

2
pom.xml

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.srsoftware</groupId>
<artifactId>web4rail</artifactId>
<version>1.3.69</version>
<version>1.3.70</version>
<name>Web4Rail</name>
<packaging>jar</packaging>
<description>Java Model Railway Control</description>

2
src/main/java/de/srsoftware/web4rail/actions/PreserveRoute.java

@ -30,7 +30,7 @@ public class PreserveRoute extends Action { @@ -30,7 +30,7 @@ public class PreserveRoute extends Action {
return false; // train is expected to wait in next block.
}
train.reserveNext();
train.reserveRouteAfter(route);
return true;
}
}

7
src/main/java/de/srsoftware/web4rail/moving/Train.java

@ -715,10 +715,10 @@ public class Train extends BaseClass implements Comparable<Train> { @@ -715,10 +715,10 @@ public class Train extends BaseClass implements Comparable<Train> {
return tags().iterator();
}
public void reserveNext() {
LOG.debug("{}.reserveNext()",this);
public void reserveRouteAfter(Route r) {
LOG.debug("reserveRouteAfter({})",r);
}
/**
* This turns the train as if it went through a loop. Example:
* before: CabCar MiddleCar Loco
@ -886,6 +886,7 @@ public class Train extends BaseClass implements Comparable<Train> { @@ -886,6 +886,7 @@ public class Train extends BaseClass implements Comparable<Train> {
if (trace.contains(tile)) stuckTrace.add(tile);
}
route.reset();
route = null;
}
return properties();
}

Loading…
Cancel
Save