- added else branch to conditional actions

- implemented history for any object extending BaseClass (i.e. almost any)
- added distance() calculation method to base class
- Button "edit JSON" in Action Lists now hidden by default, can be enabled in plan properties

- fixed bugs:
    - updating json of DisplayText was not working properly
    - log output in Tile.isFreeFor was broken
This commit is contained in:
Stephan Richter
2021-04-09 18:55:20 +02:00
parent 559e095e33
commit 77166acf91
18 changed files with 252 additions and 38 deletions

View File

@@ -189,7 +189,7 @@ public class Contact extends Tile{
formInputs.add(t("Address"),span);
Fieldset fieldset = new Fieldset(t("Actions")).id("props-actions");
actions.list().addTo(fieldset);
actions.listAt(fieldset);
postForm.add(fieldset);
return super.properties(preForm, formInputs, postForm,errors);
}

View File

@@ -129,11 +129,11 @@ public class Switch extends Tile{
protected Window properties(List<Fieldset> preForm, FormInput formInputs, List<Fieldset> postForm,String...errors) {
Fieldset fieldset = new Fieldset(t("Actions (On)"));
fieldset.id("actionsOn");
actionsOn.list().addTo(fieldset);
actionsOn.listAt(fieldset);
postForm.add(fieldset);
fieldset = new Fieldset(t("Actions (Off)"));
fieldset.id("actionsOff");
actionsOff.list().addTo(fieldset);
actionsOff.listAt(fieldset);
postForm.add(fieldset);
return super.properties(preForm, formInputs, postForm,errors);
}

View File

@@ -149,18 +149,18 @@ public abstract class Tile extends BaseClass implements Comparable<Tile> {
Train train = newTrain.train();
if (isSet(reservingTrain) && reservingTrain != train) {
LOG.debug("{} is reserved for {}",reservingTrain);
LOG.debug("{} is reserved for {}",this,reservingTrain);
return false; // nicht in reservierten Block einfahren!
}
if (isSet(lockingTrain) && lockingTrain != train) {
LOG.debug("{} is locked for {}",lockingTrain);
LOG.debug("{} is locked for {}",this,lockingTrain);
return false; // nicht in reservierten Block einfahren!
}
if (isSet(occupyingTrain) && occupyingTrain != train) {
LOG.debug("{} is occupied by {}",occupyingTrain);
return train.isShunting(); // nur in belegte Blöcke einfahren, wenn Rangiermodus aktiv!
LOG.debug("{} is occupied by {}",this,occupyingTrain);
return isSet(train) && train.isShunting(); // nur in belegte Blöcke einfahren, wenn Rangiermodus aktiv!
}
return true;