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.3.15</version>
|
<version>1.3.16</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>
|
||||||
|
|||||||
@@ -334,7 +334,6 @@ TurnoutRN : WeicheRN
|
|||||||
TurnoutRS : WeicheRS
|
TurnoutRS : WeicheRS
|
||||||
TurnoutRW : WeicheRW
|
TurnoutRW : WeicheRW
|
||||||
Turnouts : Weichen
|
Turnouts : Weichen
|
||||||
TurnTrain : Fahrtrichtung umkehren
|
|
||||||
turn within train : innerhalb des Zugs drehen
|
turn within train : innerhalb des Zugs drehen
|
||||||
Turns the train, as if it went through a loop. : Dreht den ZUg, als wenn er eine Wendeschleife passiert hätte.
|
Turns the train, as if it went through a loop. : Dreht den ZUg, als wenn er eine Wendeschleife passiert hätte.
|
||||||
Unknown action\: {} : Unbekannte Aktion: {}
|
Unknown action\: {} : Unbekannte Aktion: {}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class ActionList extends Action implements Iterable<Action>{
|
|||||||
|
|
||||||
public ActionList add(Action action) {
|
public ActionList add(Action action) {
|
||||||
action.parent(this);
|
action.parent(this);
|
||||||
actions.add(action);
|
actions.add(action);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ public class ActionList extends Action implements Iterable<Action>{
|
|||||||
if (isNull(type)) return actionTypeForm();
|
if (isNull(type)) return actionTypeForm();
|
||||||
Action action = Action.create(type,this);
|
Action action = Action.create(type,this);
|
||||||
if (action instanceof Action) {
|
if (action instanceof Action) {
|
||||||
add(action);
|
prepend(action);
|
||||||
return context().properties();
|
return context().properties();
|
||||||
}
|
}
|
||||||
return new Tag("span").content(t("Unknown action type: {}",type)).addTo(actionTypeForm());
|
return new Tag("span").content(t("Unknown action type: {}",type)).addTo(actionTypeForm());
|
||||||
@@ -200,6 +200,12 @@ public class ActionList extends Action implements Iterable<Action>{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ActionList prepend(Action action) {
|
||||||
|
action.parent(this);
|
||||||
|
actions.insertElementAt(action, 0);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public static Object process(HashMap<String, String> params, Plan plan) {
|
public static Object process(HashMap<String, String> params, Plan plan) {
|
||||||
String command = params.get(ACTION);
|
String command = params.get(ACTION);
|
||||||
if (command == null) return t("No action passed to ActionList.process()!");
|
if (command == null) return t("No action passed to ActionList.process()!");
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import de.srsoftware.web4rail.Application;
|
||||||
import de.srsoftware.web4rail.BaseClass;
|
import de.srsoftware.web4rail.BaseClass;
|
||||||
import de.srsoftware.web4rail.Window;
|
import de.srsoftware.web4rail.Window;
|
||||||
import de.srsoftware.web4rail.tags.Fieldset;
|
import de.srsoftware.web4rail.tags.Fieldset;
|
||||||
@@ -36,7 +37,21 @@ public class DetermineTrainInBlock extends Action {
|
|||||||
public Action load(JSONObject json) {
|
public Action load(JSONObject json) {
|
||||||
super.load(json);
|
super.load(json);
|
||||||
Id blockId = Id.from(json,BLOCK);
|
Id blockId = Id.from(json,BLOCK);
|
||||||
if (isSet(blockId)) block = Block.get(blockId);
|
if (isSet(blockId)) {
|
||||||
|
block = Block.get(blockId);
|
||||||
|
if (isNull(block)) {
|
||||||
|
Application.threadPool.execute(new Thread() {
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
sleep(1000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
block = Block.get(blockId);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class SetDisplayText extends TextAction{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return isNull(display) ? t("[Click here to select display!]") : t("Display \"{}\" on {}.",text,display);
|
return isNull(display) ? "["+t("Click here to select display!")+"]" : t("Display \"{}\" on {}.",text,display);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public class SetRelay extends Action {
|
|||||||
protected Object update(HashMap<String, String> params) {
|
protected Object update(HashMap<String, String> params) {
|
||||||
LOG.debug("update: {}",params);
|
LOG.debug("update: {}",params);
|
||||||
Id relayId = new Id(params.get(Relay.class.getSimpleName()));
|
Id relayId = new Id(params.get(Relay.class.getSimpleName()));
|
||||||
relay = Relay.get(relayId);
|
relay = BaseClass.get(relayId);
|
||||||
String st = params.get(Relay.STATE);
|
String st = params.get(Relay.STATE);
|
||||||
if (isSet(st)) state = st.equals("true");
|
if (isSet(st)) state = st.equals("true");
|
||||||
return context().properties();
|
return context().properties();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import java.util.List;
|
|||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import de.srsoftware.tools.Tag;
|
import de.srsoftware.tools.Tag;
|
||||||
|
import de.srsoftware.web4rail.Application;
|
||||||
import de.srsoftware.web4rail.BaseClass;
|
import de.srsoftware.web4rail.BaseClass;
|
||||||
import de.srsoftware.web4rail.Window;
|
import de.srsoftware.web4rail.Window;
|
||||||
import de.srsoftware.web4rail.tags.Fieldset;
|
import de.srsoftware.web4rail.tags.Fieldset;
|
||||||
@@ -47,12 +48,25 @@ public class SetTurnout extends Action {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Action load(JSONObject json) {
|
public Action load(JSONObject json) {
|
||||||
super.load(json);
|
super.load(json);
|
||||||
String turnoutId = json.getString(TURNOUT);
|
Id turnoutId = json.has(TURNOUT) ? new Id(json.getString(TURNOUT)) : null;
|
||||||
if (isSet(turnoutId)) {
|
if (isSet(turnoutId)) {
|
||||||
turnout = BaseClass.get(new Id(turnoutId));
|
turnout = BaseClass.get(turnoutId);
|
||||||
state = Turnout.State.valueOf(json.getString(Turnout.STATE));
|
if (isNull(turnout)) {
|
||||||
|
Application.threadPool.execute(new Thread() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
sleep(1000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
turnout = BaseClass.get(turnoutId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (json.has(Turnout.STATE)) state = Turnout.State.valueOf(json.getString(Turnout.STATE));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import de.srsoftware.web4rail.Application;
|
||||||
import de.srsoftware.web4rail.BaseClass;
|
import de.srsoftware.web4rail.BaseClass;
|
||||||
import de.srsoftware.web4rail.Window;
|
import de.srsoftware.web4rail.Window;
|
||||||
import de.srsoftware.web4rail.tags.Fieldset;
|
import de.srsoftware.web4rail.tags.Fieldset;
|
||||||
@@ -32,7 +33,23 @@ public class BlockFree extends Condition {
|
|||||||
|
|
||||||
public Condition load(JSONObject json) {
|
public Condition load(JSONObject json) {
|
||||||
super.load(json);
|
super.load(json);
|
||||||
if (json.has(BLOCK)) block(Block.get(new Id(json.getString(BLOCK))));
|
if (json.has(BLOCK)) {
|
||||||
|
Id bid = new Id(json.getString(BLOCK));
|
||||||
|
block(BaseClass.get(bid));
|
||||||
|
if (isNull(block)) {
|
||||||
|
Application.threadPool.execute(new Thread() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
sleep(1000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
block(BaseClass.get(bid));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -186,12 +186,6 @@ public abstract class Block extends StretchableTile{
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Block get(Id blockId) {
|
|
||||||
Tile tile = plan.get(blockId, false);
|
|
||||||
if (tile instanceof Block) return (Block) tile;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private WaitTime getWaitTime(String tag) {
|
private WaitTime getWaitTime(String tag) {
|
||||||
if (tag == null) return null;
|
if (tag == null) return null;
|
||||||
for (WaitTime wt : waitTimes) {
|
for (WaitTime wt : waitTimes) {
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ public class Contact extends Tile{
|
|||||||
formInputs.add(t("Address"),span);
|
formInputs.add(t("Address"),span);
|
||||||
|
|
||||||
Fieldset fieldset = new Fieldset(t("Actions"));
|
Fieldset fieldset = new Fieldset(t("Actions"));
|
||||||
|
fieldset.id("actions");
|
||||||
actions.list().addTo(fieldset);
|
actions.list().addTo(fieldset);
|
||||||
postForm.add(fieldset);
|
postForm.add(fieldset);
|
||||||
return super.properties(preForm, formInputs, postForm);
|
return super.properties(preForm, formInputs, postForm);
|
||||||
|
|||||||
Reference in New Issue
Block a user