bugfixes
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>de.srsoftware</groupId>
|
||||
<artifactId>web4rail</artifactId>
|
||||
<version>1.4.29</version>
|
||||
<version>1.4.30</version>
|
||||
<name>Web4Rail</name>
|
||||
<packaging>jar</packaging>
|
||||
<description>Java Model Railway Control</description>
|
||||
|
||||
@@ -295,13 +295,17 @@ h4,ul{
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
svg.disabled{
|
||||
background: red;
|
||||
}
|
||||
|
||||
svg.disabled circle,
|
||||
svg.disabled line,
|
||||
svg.disabled polygon,
|
||||
svg.disabled rect{
|
||||
fill: #ddddef;
|
||||
fill: #572e2e;
|
||||
stroke-width:5;
|
||||
stroke: red;
|
||||
stroke: black;
|
||||
}
|
||||
|
||||
#train-wait-form input{
|
||||
@@ -384,6 +388,11 @@ svg.Block text{
|
||||
fill: black;
|
||||
}
|
||||
|
||||
svg.Block.disabled text{
|
||||
fill: white;
|
||||
}
|
||||
|
||||
|
||||
.window > .tabs > legend {
|
||||
float:left;
|
||||
background: lightgray;
|
||||
|
||||
@@ -200,9 +200,7 @@ public abstract class Block extends StretchableTile{
|
||||
@Override
|
||||
protected HashSet<String> classes() {
|
||||
HashSet<String> classes = super.classes();
|
||||
if (!isNull(occupyingTrain()) || !parkedTrains.isEmpty()) classes.add(OCCUPIED);
|
||||
if (!isNull(lockingTrain())) classes.add(LOCKED);
|
||||
if (isDisabled()) classes.add(DISABLED);
|
||||
if (!parkedTrains.isEmpty()) classes.add(OCCUPIED);
|
||||
return classes;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@ public abstract class Tile extends BaseClass implements Comparable<Tile> {
|
||||
if (isSet(reservingTrain)) classes.add(RESERVED);
|
||||
if (isSet(lockingTrain)) classes.add(LOCKED);
|
||||
if (isSet(occupyingTrain)) classes.add(OCCUPIED);
|
||||
if (disabled) classes.add(DISABLED);
|
||||
return classes;
|
||||
}
|
||||
|
||||
@@ -554,6 +555,7 @@ public abstract class Tile extends BaseClass implements Comparable<Tile> {
|
||||
if (isSet(len)) length(Integer.parseInt(len));
|
||||
super.update(params);
|
||||
plan.place(this);
|
||||
plan.alter();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -162,10 +162,16 @@ public abstract class Turnout extends Tile implements Device{
|
||||
public Reply state(State newState,boolean shift) {
|
||||
Train lockingTrain = lockingTrain();
|
||||
|
||||
if (isSet(lockingTrain)) {
|
||||
if (newState != state && !shift) return new Reply(415, t("{} locked by {}!",this,lockingTrain));
|
||||
// shift allows to switch locked turnouts...
|
||||
} else if (shift) return new Reply(200,"OK"); // shift on a non-locked turnout skips the switch process
|
||||
if (isDisabled()) {
|
||||
// shift allows to switch disabled turnouts...
|
||||
if (newState != state && !shift) return new Reply(415, t("{} is disabled!",this));
|
||||
} else {
|
||||
if (isSet(lockingTrain)) {
|
||||
// shift allows to switch locked turnouts...
|
||||
if (newState != state && !shift) return new Reply(415, t("{} locked by {}!",this,lockingTrain));
|
||||
|
||||
} else if (shift) return new Reply(200,"OK"); // shift on a non-locked turnout skips the switch process
|
||||
}
|
||||
if (address == 0) {
|
||||
sleep(300);
|
||||
state = newState;
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import de.srsoftware.web4rail.Command.Reply;
|
||||
import de.srsoftware.web4rail.tags.Fieldset;
|
||||
import de.srsoftware.web4rail.tags.Input;
|
||||
import de.srsoftware.web4rail.tags.Window;
|
||||
@@ -15,7 +16,8 @@ public abstract class TurnoutL extends Turnout {
|
||||
@Override
|
||||
public Object click(boolean shift) throws IOException {
|
||||
Object o = super.click(shift);
|
||||
state(state == State.STRAIGHT ? State.LEFT : State.STRAIGHT,shift);
|
||||
Reply reply = state(state == State.STRAIGHT ? State.LEFT : State.STRAIGHT,shift);
|
||||
if (!reply.succeeded()) plan.stream(reply.message());
|
||||
return o;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user