bugfixes
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>de.srsoftware</groupId>
|
<groupId>de.srsoftware</groupId>
|
||||||
<artifactId>web4rail</artifactId>
|
<artifactId>web4rail</artifactId>
|
||||||
<version>1.2.25</version>
|
<version>1.2.26</version>
|
||||||
<name>Web4Rail</name>
|
<name>Web4Rail</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<description>Java Model Railway Control</description>
|
<description>Java Model Railway Control</description>
|
||||||
|
|||||||
@@ -135,7 +135,8 @@ public abstract class BaseClass implements Constants{
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuffer sb = new StringBuffer(getClass().getSimpleName());
|
StringBuffer sb = new StringBuffer(getClass().getSimpleName());
|
||||||
sb.append("(");
|
sb.append("(");
|
||||||
sb.append(t("Train: {}",train));
|
sb.append("main: "+main);
|
||||||
|
if (isSet(train)) sb.append(", "+t("Train: {}",train));
|
||||||
if (isSet(direction)) sb.append(", "+t("Direction: {}",direction));
|
if (isSet(direction)) sb.append(", "+t("Direction: {}",direction));
|
||||||
if (isSet(block)) sb.append(", "+t("Block: {}",block));
|
if (isSet(block)) sb.append(", "+t("Block: {}",block));
|
||||||
if (isSet(route)) sb.append(", "+t("Route: {}",route));
|
if (isSet(route)) sb.append(", "+t("Route: {}",route));
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public class ActionList extends Action implements Iterable<Action>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean fire(Context context) {
|
public boolean fire(Context context) {
|
||||||
if (!isEmpty()) LOG.debug(t("Firing {}"),this);
|
if (!isEmpty()) LOG.debug(t("Firing {}"),actions);
|
||||||
for (Action action : actions) {
|
for (Action action : actions) {
|
||||||
if (!action.fire(context)) return false;
|
if (!action.fire(context)) return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class ConditionalAction extends ActionList {
|
|||||||
@Override
|
@Override
|
||||||
public boolean fire(Context context) {
|
public boolean fire(Context context) {
|
||||||
for (Condition condition : conditions) {
|
for (Condition condition : conditions) {
|
||||||
if (!condition.fulfilledBy(context)) return false;
|
if (!condition.fulfilledBy(context)) return true; // wenn die Bedingung nicht erfüllt ist, ist das kein Fehler!
|
||||||
}
|
}
|
||||||
return super.fire(context.clone()); // actions, that happen within the conditional action list must not modify the global context.
|
return super.fire(context.clone()); // actions, that happen within the conditional action list must not modify the global context.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ public class StartStopAuto extends Action {
|
|||||||
@Override
|
@Override
|
||||||
public boolean fire(Context context) {
|
public boolean fire(Context context) {
|
||||||
if (isNull(context.train())) return false;
|
if (isNull(context.train())) return false;
|
||||||
context.train().quitAutopilot();
|
if (inverted) {
|
||||||
|
context.train().automatic();
|
||||||
|
} else context.train().quitAutopilot();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ public class Train extends BaseClass implements Comparable<Train> {
|
|||||||
car.train(this);
|
car.train(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String automatic() {
|
public String automatic() {
|
||||||
if (isNull(autopilot)) {
|
if (isNull(autopilot)) {
|
||||||
autopilot = new Autopilot();
|
autopilot = new Autopilot();
|
||||||
autopilot.start();
|
autopilot.start();
|
||||||
|
|||||||
Reference in New Issue
Block a user