Beispiel #1
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;
    }
  }
Beispiel #2
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;
    }
  }