コード例 #1
0
ファイル: MrcProgrammer.java プロジェクト: NomDInet/JMRI
 // 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);
 }
コード例 #2
0
ファイル: MrcProgrammer.java プロジェクト: NomDInet/JMRI
  // 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;
    }
  }
コード例 #3
0
ファイル: MrcProgrammer.java プロジェクト: NomDInet/JMRI
  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;
    }
  }