Esempio n. 1
0
 // internal method to notify of the final result
 protected void notifyProgListenerEnd(int value, int status) {
   log.debug("notifyProgListenerEnd value {} status {}", value, status); // IN18N
   // the programmingOpReply handler might send an immediate reply, so
   // clear the current listener _first_
   tc.removeTrafficListener(MrcInterface.PROGRAMMING, this);
   jmri.ProgListener temp = _usingProgrammer;
   _usingProgrammer = null;
   temp.programmingOpReply(value, status);
 }
Esempio n. 2
0
  // programming interface
  public synchronized void writeCV(int CV, int val, jmri.ProgListener p)
      throws jmri.ProgrammerException {
    log.debug("writeCV {} listens {}", CV, p); // IN18N
    useProgrammer(p);
    _progRead = false;
    // set state
    progState = WRITECOMMANDSENT;
    _val = val;
    _cv = CV;

    try {
      // start the error timer
      startShortTimer(); // we get no confirmation back that the packet has been read.
      // format and send the write message
      tc.addTrafficListener(MrcInterface.PROGRAMMING, this);
      tc.sendMrcMessage(progTaskStart(getMode(), _val, _cv));
    } catch (jmri.ProgrammerException e) {
      progState = NOTPROGRAMMING;
      throw e;
    }
  }
Esempio n. 3
0
  public synchronized void readCV(int CV, jmri.ProgListener p) throws jmri.ProgrammerException {
    log.debug("readCV {} listens {}", CV, p); // IN18N
    useProgrammer(p);
    _progRead = true;

    // set commandPending state
    progState = READCOMMANDSENT;
    _cv = CV;

    try {
      // start the error timer
      startLongTimer();

      // format and send the write message
      tc.addTrafficListener(MrcInterface.PROGRAMMING, this);
      tc.sendMrcMessage(progTaskStart(getMode(), -1, _cv));
    } catch (jmri.ProgrammerException e) {
      progState = NOTPROGRAMMING;
      throw e;
    }
  }