minor improvements
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.33</version>
|
<version>1.3.34</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>
|
||||||
|
|||||||
@@ -369,6 +369,7 @@ public class Locomotive extends Car implements Constants,Device{
|
|||||||
private Locomotive setAddress(int newAddress) {
|
private Locomotive setAddress(int newAddress) {
|
||||||
address = newAddress;
|
address = newAddress;
|
||||||
cvs.put(CV_ADDR, newAddress);
|
cvs.put(CV_ADDR, newAddress);
|
||||||
|
init = false;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -464,10 +465,7 @@ public class Locomotive extends Car implements Constants,Device{
|
|||||||
if (params.containsKey(PROTOCOL)) proto = Protocol.valueOf(params.get(PROTOCOL));
|
if (params.containsKey(PROTOCOL)) proto = Protocol.valueOf(params.get(PROTOCOL));
|
||||||
if (params.containsKey(ADDRESS)) {
|
if (params.containsKey(ADDRESS)) {
|
||||||
int newAddress = Integer.parseInt(params.get(ADDRESS));
|
int newAddress = Integer.parseInt(params.get(ADDRESS));
|
||||||
if (newAddress != address) {
|
if (newAddress != address) setAddress(newAddress);
|
||||||
init = false;
|
|
||||||
setAddress(newAddress);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
String error = null;
|
String error = null;
|
||||||
if (params.get(ACTION).equals(ACTION_PROGRAM)) try {
|
if (params.get(ACTION).equals(ACTION_PROGRAM)) try {
|
||||||
|
|||||||
@@ -310,7 +310,15 @@ public class Train extends BaseClass implements Comparable<Train> {
|
|||||||
new Input(ACTION, ACTION_ADD).hideIn(addCarForm);
|
new Input(ACTION, ACTION_ADD).hideIn(addCarForm);
|
||||||
new Input(ID,id).hideIn(addCarForm);
|
new Input(ID,id).hideIn(addCarForm);
|
||||||
Select select = new Select(CAR_ID);
|
Select select = new Select(CAR_ID);
|
||||||
for (Car car : cars) select.addOption(car.id(), car+(car.stockId.isEmpty()?"":" ("+car.stockId+")"));
|
|
||||||
|
for (Car car : cars) {
|
||||||
|
String caption = null;
|
||||||
|
|
||||||
|
if (!car.stockId.isEmpty()) caption = car.stockId;
|
||||||
|
if (!car.tags().isEmpty()) caption = (isSet(caption) ? caption+" / " :"") + String.join(" ",car.tags());
|
||||||
|
caption = car.toString() + (isNull(caption) ? "" : " ("+caption+")");
|
||||||
|
select.addOption(car.id(), caption);
|
||||||
|
}
|
||||||
select.addTo(addCarForm);
|
select.addTo(addCarForm);
|
||||||
new Button(t("add"),addCarForm).addTo(addCarForm);
|
new Button(t("add"),addCarForm).addTo(addCarForm);
|
||||||
carList.addRow(t("add car"),addCarForm);
|
carList.addRow(t("add car"),addCarForm);
|
||||||
|
|||||||
Reference in New Issue
Block a user