minor improvements

This commit is contained in:
Stephan Richter
2021-04-01 22:05:37 +02:00
parent f7c895620a
commit 744fb3eb32
4 changed files with 13 additions and 5 deletions

View File

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

View File

@@ -172,6 +172,7 @@ Falls aktiviert, wird die Strecke anhand von Zug- und Kachel-Länge hinter dem Z
internal contacts : interne Kontakte
inverted : invertiert
Inverts the direction {} is heading to. : Kehrt die Richtung, in welche {} fährt, um.
{} is not a block! : {} ist kein Block!
{} is off : {} ist Aus
{} is on : {} ist Ein
{} is oriented {} : {} ist {} gerichtet

View File

@@ -888,7 +888,14 @@ public class Route extends BaseClass {
return true;
}
public boolean start() {
public boolean start() {
if (isNull(context) || context.invalidated()) {
LOG.debug("Invalid context: {}",context);
return false;
}
Train train = context.train();
if (train.direction() != startDirection) train.turn();
if (isSet(startDelay)) sleep(startDelay.random());
return startNow();
}

View File

@@ -141,6 +141,7 @@ public class Train extends BaseClass implements Comparable<Train> {
case ACTION_QUIT:
return train.properties(train.quitAutopilot());
case ACTION_REVERSE:
train.quitAutopilot();
return train.reverse().properties();
case ACTION_SLOWER10:
return train.slower(Train.defaultSpeedStep);
@@ -748,12 +749,11 @@ public class Train extends BaseClass implements Comparable<Train> {
button(t("reverse"), Map.of(ACTION,ACTION_REVERSE)).title(t("Turns the train, as if it went through a loop.")).addTo(directionLi).addTo(propList);
Tag dest = new Tag("li").content(t("Destination")+COL);
if (isNull(destination)) {
button(t("Select from plan"),Map.of(ACTION,ACTION_MOVE,ASSIGN,DESTINATION)).addTo(dest);
} else {
if (isSet(destination)) {
link("span",destination,Map.of(REALM,REALM_PLAN,ID,destination.id().toString(),ACTION,ACTION_CLICK)).addTo(dest);
new Button(t("Drop"),Map.of(REALM,REALM_TRAIN,ID,id,ACTION,ACTION_MOVE,DESTINATION,"")).addTo(dest);
}
button(t("Select from plan"),Map.of(ACTION,ACTION_MOVE,ASSIGN,DESTINATION)).addTo(dest);
dest.addTo(propList);
if (isSet(route)) route.link("li", route).addTo(propList);