added new action ReactivateContact
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.2.52</version>
|
||||
<version>1.2.53</version>
|
||||
<name>Web4Rail</name>
|
||||
<packaging>jar</packaging>
|
||||
<description>Java Model Railway Control</description>
|
||||
|
||||
@@ -172,6 +172,7 @@ PushPullTrain : Wendezug
|
||||
Push-pull train : Wendezug
|
||||
quit autopilot : Autopilot beenden
|
||||
{} reached it`s destination! : {} ist am Ziel angekommen!
|
||||
ReactivateContact : Kontakt reaktivieren
|
||||
Relay : Relais
|
||||
Relays and Turnouts : Relais und Weichen
|
||||
Relay/Turnout : Relais/Weiche
|
||||
|
||||
@@ -763,7 +763,10 @@ public class Route extends BaseClass {
|
||||
Window win = super.properties(preForm, formInputs, postForm);
|
||||
previewScript().addTo(win);
|
||||
return win;
|
||||
}
|
||||
|
||||
public boolean reactivate(Contact contact) {
|
||||
return triggeredContacts.remove(contact);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -50,6 +50,7 @@ public abstract class Action extends BaseClass {
|
||||
FinishRoute.class,
|
||||
Loop.class,
|
||||
PreserveRoute.class,
|
||||
ReactivateContact.class,
|
||||
SavePlan.class,
|
||||
SendCommand.class,
|
||||
SetContextTrain.class,
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package de.srsoftware.web4rail.actions;
|
||||
|
||||
import de.srsoftware.web4rail.BaseClass;
|
||||
|
||||
public class ReactivateContact extends Action{
|
||||
|
||||
public ReactivateContact(BaseClass parent) {
|
||||
super(parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean fire(Context context) {
|
||||
if (isNull(context.contact())) return false;
|
||||
if (isNull(context.route())) return false;
|
||||
return context.route().reactivate(context.contact());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user