sorting methods

This commit is contained in:
Stephan Richter
2020-11-05 21:19:28 +01:00
parent 806502b459
commit 5499d5a82b
6 changed files with 117 additions and 99 deletions

View File

@@ -17,25 +17,29 @@ import de.srsoftware.web4rail.tags.Input;
import de.srsoftware.web4rail.tags.Label;
import de.srsoftware.web4rail.tags.Radio;
/**
* Base class for Turnouts
* @author Stephan Richter, SRSoftware
*
*/
public abstract class Turnout extends Tile implements Device{
public static final String STATE = "state";
private static final String PORT_A = "port_a";
private static final String PORT_B = "port_b";
private static final String PORT_A = "port_a";
private static final String PORT_B = "port_b";
public static final String STATE = "state";
protected static final String STRAIGHT = "straight";
private Protocol protocol = Protocol.DCC128;
protected int address = 0;
protected int portA = 0, portB = 1;
protected int delay = 400;
protected boolean initialized = false;
protected boolean error = false;
protected int address = 0;
protected int delay = 400;
protected boolean error = false;
protected boolean initialized = false;
private Protocol protocol = Protocol.DCC128;
protected int portA = 0, portB = 1;
protected State state = State.STRAIGHT;
public enum State{
LEFT,STRAIGHT,RIGHT,UNDEF;
}
protected State state = State.STRAIGHT;
@Override
public Object click() throws IOException {
LOG.debug(getClass().getSimpleName()+".click()");
@@ -197,4 +201,4 @@ public abstract class Turnout extends Tile implements Device{
if (params.containsKey(PORT_B)) portB = Integer.parseInt(params.get(PORT_B));
return super.update(params);
}
}
}