From 8fb23eec1a0d4a20b654a437f3f3625fe72caf47 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Wed, 16 Dec 2020 23:01:52 +0100 Subject: [PATCH] minot gui improvement --- pom.xml | 2 +- src/main/java/de/srsoftware/web4rail/moving/Train.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index f41abdb..c457cde 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 de.srsoftware web4rail - 1.2.49 + 1.2.50 Web4Rail jar Java Model Railway Control diff --git a/src/main/java/de/srsoftware/web4rail/moving/Train.java b/src/main/java/de/srsoftware/web4rail/moving/Train.java index 93d3467..8504dc5 100644 --- a/src/main/java/de/srsoftware/web4rail/moving/Train.java +++ b/src/main/java/de/srsoftware/web4rail/moving/Train.java @@ -99,7 +99,8 @@ public class Train extends BaseClass implements Comparable { if (waitTime > 100) waitTime /=2; if (stop) return; if (isNull(route)) { // may have been set by start action in between - Train.this.start(); + Object o = Train.this.start(); + if (o instanceof String) plan.stream((String)o); if (isSet(destination)) Thread.sleep(1000); // limit load on PathFinder } } else Thread.sleep(250); @@ -742,11 +743,11 @@ public class Train extends BaseClass implements Comparable { Context context = new Context(this).block(currentBlock).direction(direction).train(this); route = PathFinder.chooseRoute(context); if (isNull(route)) return t("No free routes from {}",currentBlock); - if (!route.lock()) return t("Was not able to lock {}",route); + if (!route.lock()) error = t("Was not able to lock {}",route); route.set(context); if (isNull(error) && !route.fireSetupActions()) error = t("Was not able to fire all setup actions of route!"); } - if (direction != route.startDirection) turn(); + if (isNull(error) && direction != route.startDirection) turn(); if (isNull(error) && !route.start(this)) error = t("Was not able to assign {} to {}!",this,route); if (isSet(error)) {