From: Bob J. <jac...@us...> - 2006-12-30 01:45:14
|
Update of /cvsroot/jmri/jmri/jmrix/nce In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv3674/src/jmri/jmrix/nce Modified Files: NceProgrammer.java Log Message: swtich to more subtle control of ASCII vs binary commands. Only allow direct programming if binary operations in use Index: NceProgrammer.java =================================================================== RCS file: /cvsroot/jmri/jmri/jmrix/nce/NceProgrammer.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** NceProgrammer.java 28 Dec 2006 17:16:46 -0000 1.12 --- NceProgrammer.java 30 Dec 2006 01:45:11 -0000 1.13 *************** *** 40,46 **** _mode = mode; } ! if (_mode != Programmer.PAGEMODE && ! _mode != Programmer.DIRECTBYTEMODE && ! _mode != Programmer.REGISTERMODE) { // attempt to switch to unsupported mode, switch back to previous _mode = oldMode; --- 40,44 ---- _mode = mode; } ! if (!hasMode(_mode)) { // attempt to switch to unsupported mode, switch back to previous _mode = oldMode; *************** *** 56,62 **** public boolean hasMode(int mode) { if ( mode == Programmer.PAGEMODE || - mode == Programmer.DIRECTBYTEMODE || mode == Programmer.REGISTERMODE ) { ! log.debug("hasMode request on mode "+mode+" returns true"); return true; } --- 54,64 ---- public boolean hasMode(int mode) { if ( mode == Programmer.PAGEMODE || mode == Programmer.REGISTERMODE ) { ! log.debug("hasMode request on mode "+mode+" returns true (1)"); ! return true; ! } ! if ( mode == Programmer.DIRECTBYTEMODE && ! NceMessage.getCommandOptions() >= NceMessage.OPTION_2006) { ! log.debug("hasMode request on mode "+mode+" returns true (2)"); return true; } |