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());
}
}
Aggregations