WaitForContact now using new assignment function
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.3.23</version>
|
||||
<version>1.3.24</version>
|
||||
<name>Web4Rail</name>
|
||||
<packaging>jar</packaging>
|
||||
<description>Java Model Railway Control</description>
|
||||
|
||||
@@ -41,6 +41,7 @@ Availability : Verfügbarkeit
|
||||
Back : zurück
|
||||
backward : rückwärts
|
||||
Basic properties : Grundlegende Eigenschaften
|
||||
block : Block
|
||||
BlockFree : Blockbelegung
|
||||
block from context : Block aus Kontext
|
||||
Block {} is free : Block {} ist frei
|
||||
@@ -59,7 +60,7 @@ Car manager : Waggon-Verwaltung
|
||||
CarOrientation : Wagen-Laufrichtung
|
||||
Cars : Waggons
|
||||
cars : Fahrzeugen teilen
|
||||
Clicked tile is not a block! : Angeklickte Kachel ist kein Block!
|
||||
Clicked tile is not a {}! : Angeklickte Kachel ist kein {}!
|
||||
Click here to add conditions : Hier klicken, um Bedingungen hinzuzufügen
|
||||
Click here to select block! : Hier klicken, um Block auszuwählen!
|
||||
Click here to select car! : Hier klicken, um Fahrzeug auszuwählen!
|
||||
@@ -78,6 +79,7 @@ Conditions : Bedingungen
|
||||
Condition type : Bedingungs-Typ
|
||||
Connected to {}. : Mit {} verbunden.
|
||||
Confirmation required : Bestätigung erforderlich
|
||||
contact : Kontakt
|
||||
Contact : Kontakt
|
||||
Control : Steuerung
|
||||
Control unit : Zentrale
|
||||
|
||||
@@ -2,6 +2,7 @@ package de.srsoftware.web4rail.actions;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
@@ -13,6 +14,7 @@ import de.srsoftware.web4rail.tags.Fieldset;
|
||||
import de.srsoftware.web4rail.tags.Input;
|
||||
import de.srsoftware.web4rail.tiles.Contact;
|
||||
import de.srsoftware.web4rail.tiles.Contact.Listener;
|
||||
import de.srsoftware.web4rail.tiles.Tile;
|
||||
|
||||
public class WaitForContact extends ActionList {
|
||||
|
||||
@@ -109,7 +111,7 @@ public class WaitForContact extends ActionList {
|
||||
|
||||
@Override
|
||||
protected Window properties(List<Fieldset> preForm, FormInput formInputs, List<Fieldset> postForm) {
|
||||
formInputs.add(t("Contact"),Contact.selector(contact));
|
||||
formInputs.add(t("Contact")+": "+(isNull(contact) ? t("unset") : contact),button(t("Select from plan"),Map.of(ACTION,ACTION_UPDATE,ASSIGN,CONTACT)));
|
||||
formInputs.add(t("Timeout"),new Input(TIMEOUT,timeout).numeric().addTo(new Tag("span")).content(NBSP+"ms"));
|
||||
|
||||
Fieldset fieldset = new Fieldset(t("Actions on timeout"));
|
||||
@@ -127,7 +129,14 @@ public class WaitForContact extends ActionList {
|
||||
|
||||
@Override
|
||||
protected Object update(HashMap<String, String> params) {
|
||||
if (params.containsKey(CONTACT)) contact = BaseClass.get(new Id(params.get(CONTACT)));
|
||||
if (params.containsKey(CONTACT)) {
|
||||
Tile tile = BaseClass.get(new Id(params.get(CONTACT)));
|
||||
if (tile instanceof Contact) {
|
||||
contact = (Contact) tile;
|
||||
} else {
|
||||
return t("Clicked tile is not a {}!",t("contact"));
|
||||
}
|
||||
}
|
||||
if (params.containsKey(TIMEOUT)) timeout = Integer.parseInt(params.get(TIMEOUT));
|
||||
return super.update(params);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class BlockFree extends Condition {
|
||||
|
||||
@Override
|
||||
protected Window properties(List<Fieldset> preForm, FormInput formInputs, List<Fieldset> postForm) {
|
||||
formInputs.add(t("Block: {}",isNull(block) ? t("unset") : block),button(t("Select from plan"),Map.of(ACTION,ACTION_UPDATE,ASSIGN,BLOCK)));
|
||||
formInputs.add(t("Block")+": "+(isNull(block) ? t("unset") : block),button(t("Select from plan"),Map.of(ACTION,ACTION_UPDATE,ASSIGN,BLOCK)));
|
||||
return super.properties(preForm, formInputs, postForm);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class BlockFree extends Condition {
|
||||
if (tile instanceof Block) {
|
||||
block = (Block) tile;
|
||||
} else {
|
||||
return t("Clicked tile is not a block!");
|
||||
return t("Clicked tile is not a {}!",t("block"));
|
||||
}
|
||||
|
||||
return super.update(params);
|
||||
|
||||
Reference in New Issue
Block a user