Skip to content

Commit

Permalink
LE Layout Turnout fix
Browse files Browse the repository at this point in the history
  • Loading branch information
icklesteve committed Aug 1, 2019
1 parent 41f4c0b commit 4e8d2a0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions java/src/jmri/jmrit/display/layoutEditor/LayoutTurnout.java
Expand Up @@ -2342,10 +2342,10 @@ private void activateTurnout() {
namedTurnout.getBean().addPropertyChangeListener(
mTurnoutListener = (java.beans.PropertyChangeEvent e) -> {
if (secondNamedTurnout != null) {
int new2ndState = secondNamedTurnout.getBean().getState();
int new2ndState = secondNamedTurnout.getBean().getCommandedState();
if (e.getSource().equals(secondNamedTurnout.getBean())
&& e.getNewValue().equals(new2ndState)) {
int old1stState = namedTurnout.getBean().getState();
int old1stState = namedTurnout.getBean().getCommandedState();
int new1stState = new2ndState;
if (secondTurnoutInverted) {
new1stState = Turnout.invertTurnoutState(new1stState);
Expand Down Expand Up @@ -2420,6 +2420,15 @@ public int getState() {
if (getTurnout() != null) {
result = getTurnout().getKnownState();
}
if (getSecondTurnout() != null) {
int t2state = getSecondTurnout().getKnownState();
if (secondTurnoutInverted) {
t2state = Turnout.invertTurnoutState(getSecondTurnout().getKnownState());
}
if (result!=t2state) {
return INCONSISTENT;
}
}
return result;
}

Expand Down

0 comments on commit 4e8d2a0

Please sign in to comment.