From: Paul B. <pb...@us...> - 2003-11-30 05:29:09
|
Update of /cvsroot/jmri/jmri/jmrix/lenz In directory sc8-pr-cvs1:/tmp/cvs-serv11623 Modified Files: LenzCommandStation.java XNetTurnout.java Log Message: First version that actually fixes the "multiple fire issue". Still need to test with Commander, but works on LZV100. Index: LenzCommandStation.java =================================================================== RCS file: /cvsroot/jmri/jmri/jmrix/lenz/LenzCommandStation.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** LenzCommandStation.java 30 Nov 2003 01:03:55 -0000 1.15 --- LenzCommandStation.java 30 Nov 2003 05:29:05 -0000 1.16 *************** *** 53,64 **** int hiadr = (pNumber-1)/4; int loadr = ((pNumber-1)-hiadr*4)*2; ! // Bit 4 of the upper nibble is required to be set on // The rest of the upper nibble should be zeros. ! // Bit 4 of the lower nibble says weather or not the ! // accessory line should be "on" or of, we load with a default ! // of On, and turn it off later. ! loadr |= 0x88; ! if (!pOn) loadr |= 0x80; ! // If we are sending a "throw" command, we set bit one of the // lower nibble on, otherwise, we leave it off. if (pThrow) loadr |= 0x01; --- 53,63 ---- int hiadr = (pNumber-1)/4; int loadr = ((pNumber-1)-hiadr*4)*2; ! // The MSB of the upper nibble is required to be set on // The rest of the upper nibble should be zeros. ! // The MSB of the lower nibble says weather or not the ! // accessory line should be "on" or off ! if (!pOn) { loadr |= 0x80; } ! else loadr |= 0x88; ! // If we are sending a "throw" command, we set the LSB of the // lower nibble on, otherwise, we leave it off. if (pThrow) loadr |= 0x01; Index: XNetTurnout.java =================================================================== RCS file: /cvsroot/jmri/jmri/jmrix/lenz/XNetTurnout.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** XNetTurnout.java 30 Nov 2003 01:03:55 -0000 1.8 --- XNetTurnout.java 30 Nov 2003 05:29:05 -0000 1.9 *************** *** 63,79 **** // another turnout. parseFeedbackMessage(l); - newKnownState(getCommandedState()); } } else if(XNetTrafficController.instance().getCommandStation() .isFeedbackMessage(l)) { ! // XNetMessage msg = XNetTrafficController.instance() ! // .getCommandStation() ! // .getTurnoutCommandMsg(mNumber, ! // getCommandedState()!=CLOSED, ! // getCommandedState()!=THROWN, ! // false ); ! // XNetTrafficController.instance().sendXNetMessage(msg, this); ! parseFeedbackMessage(l); ! newKnownState(getCommandedState()); // The first case is that we recieve a message for this turnout --- 63,78 ---- // another turnout. parseFeedbackMessage(l); } } else if(XNetTrafficController.instance().getCommandStation() .isFeedbackMessage(l)) { ! parseFeedbackMessage(l); ! XNetMessage msg = XNetTrafficController.instance() ! .getCommandStation() ! .getTurnoutCommandMsg(mNumber, ! getCommandedState()==CLOSED, ! getCommandedState()==THROWN, ! false ); ! XNetTrafficController.instance().sendXNetMessage(msg, this); ! XNetTrafficController.instance().sendXNetMessage(msg, this); // The first case is that we recieve a message for this turnout *************** *** 106,115 **** .getTurnoutStatus(l,1)==THROWN) { newCommandedState(THROWN); } else if(XNetTrafficController.instance() .getCommandStation() .getTurnoutStatus(l,1)==CLOSED) { newCommandedState(CLOSED); } else return -1; - newKnownState(getCommandedState()); } else if (((mNumber%2)==0) && (XNetTrafficController.instance() --- 105,115 ---- .getTurnoutStatus(l,1)==THROWN) { newCommandedState(THROWN); + newKnownState(getCommandedState()); } else if(XNetTrafficController.instance() .getCommandStation() .getTurnoutStatus(l,1)==CLOSED) { newCommandedState(CLOSED); + newKnownState(getCommandedState()); } else return -1; } else if (((mNumber%2)==0) && (XNetTrafficController.instance() *************** *** 122,131 **** .getTurnoutStatus(l,0)==THROWN) { newCommandedState(THROWN); } else if(XNetTrafficController.instance() .getCommandStation() .getTurnoutStatus(l,0)==CLOSED) { newCommandedState(CLOSED); } else return -1; - newKnownState(getCommandedState()); } return(-1); --- 122,132 ---- .getTurnoutStatus(l,0)==THROWN) { newCommandedState(THROWN); + newKnownState(getCommandedState()); } else if(XNetTrafficController.instance() .getCommandStation() .getTurnoutStatus(l,0)==CLOSED) { newCommandedState(CLOSED); + newKnownState(getCommandedState()); } else return -1; } return(-1); |