Search in sources :

Example 1 with LocoNetThrottle

use of jmri.jmrix.loconet.LocoNetThrottle in project JMRI by JMRI.

the class UhlenbrockLnThrottleManager method notifyChangedSlot.

/**
     * SlotListener contract. Get notification that an address has changed slot.
     * This method creates a throttle for all ThrottleListeners of that address
     * and notifies them via the ThrottleListener.notifyThrottleFound method.
     */
@Override
public void notifyChangedSlot(LocoNetSlot s) {
    DccThrottle throttle = new LocoNetThrottle((LocoNetSystemConnectionMemo) adapterMemo, s);
    notifyThrottleKnown(throttle, new DccLocoAddress(s.locoAddr(), isLongAddress(s.locoAddr())));
    if (waitingForNotification.containsKey(s.locoAddr())) {
        Thread r = waitingForNotification.get(s.locoAddr());
        synchronized (r) {
            r.interrupt();
        }
        waitingForNotification.remove(s.locoAddr());
    }
}
Also used : LocoNetThrottle(jmri.jmrix.loconet.LocoNetThrottle) DccThrottle(jmri.DccThrottle) DccLocoAddress(jmri.DccLocoAddress)

Aggregations

DccLocoAddress (jmri.DccLocoAddress)1 DccThrottle (jmri.DccThrottle)1 LocoNetThrottle (jmri.jmrix.loconet.LocoNetThrottle)1