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