minor 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>0.11.12</version>
|
<version>0.11.13</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>
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
|
|
||||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
<!-- encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
|
<!-- encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
|
||||||
<encoder>
|
<encoder>
|
||||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n</pattern>
|
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n</pattern>
|
||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
|
<logger name="de.srsoftware.web4rail" level="DEBUG"/>
|
||||||
|
<logger name="de.srsoftware.web4rail.Application" level="INFO"/>
|
||||||
|
<logger name="de.srsoftware.web4rail.Command" level="INFO"/>
|
||||||
|
<logger name="de.srsoftware.web4rail.ControlUnit" level="INFO"/>
|
||||||
|
|
||||||
<root level="debug">
|
<root level="debug">
|
||||||
<appender-ref ref="STDOUT" />
|
<appender-ref ref="STDOUT" />
|
||||||
<logger name="de.srsoftware.web4rail.ControlUnit" level="WARN"/>
|
|
||||||
</root>
|
</root>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -525,7 +525,6 @@ public class Route extends BaseClass implements Comparable<Route>{
|
|||||||
if (o instanceof JSONObject) new Route().load((JSONObject)o, plan);
|
if (o instanceof JSONObject) new Route().load((JSONObject)o, plan);
|
||||||
}
|
}
|
||||||
fis.close();
|
fis.close();
|
||||||
LOG.debug("json: {}",json.getClass());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadConditions(JSONArray arr) {
|
private void loadConditions(JSONArray arr) {
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ public class DelayedAction extends Action {
|
|||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(delay);
|
Thread.sleep(delay);
|
||||||
|
LOG.debug("{} ms passed by, firing actions:",delay);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
LOG.warn("Interrupted Exception thrown while waiting:",e);
|
LOG.warn("Interrupted Exception thrown while waiting:",e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,11 +18,9 @@ public class SetSpeed extends Action{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean fire(Context context) {
|
public boolean fire(Context context) {
|
||||||
if (context.train != null && context.train.speed > maxSpeed) {
|
if (isNull(context.train)) return false;
|
||||||
context.train.setSpeed(maxSpeed);
|
context.train.setSpeed(maxSpeed);
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -631,6 +631,7 @@ public class Train extends BaseClass implements Comparable<Train> {
|
|||||||
if (isNull(error) && !route.train(this)) error = t("Was not able to assign {} to {}!",this,route);
|
if (isNull(error) && !route.train(this)) error = t("Was not able to assign {} to {}!",this,route);
|
||||||
if (isSet(error)) {
|
if (isSet(error)) {
|
||||||
route.reset();
|
route.reset();
|
||||||
|
route = null;
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
setSpeed(128);
|
setSpeed(128);
|
||||||
|
|||||||
@@ -47,8 +47,9 @@ public class Contact extends Tile{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Contact addr(int address) {
|
public Contact addr(int address) {
|
||||||
|
contactsByAddr.remove(addr); // alte ID aus der Map löschen
|
||||||
addr = address;
|
addr = address;
|
||||||
contactsByAddr.put(addr, this);
|
if (addr != 0) contactsByAddr.put(addr, this); // neue ID setzen
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user