use of jmri.DccThrottle in project JMRI by JMRI.
the class LnThrottleManager method notifyChangedSlot.
/**
* 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 = createThrottle((LocoNetSystemConnectionMemo) adapterMemo, s);
notifyThrottleKnown(throttle, new DccLocoAddress(s.locoAddr(), isLongAddress(s.locoAddr())));
//end the waiting thread since we got a response
if (waitingForNotification.containsKey(s.locoAddr())) {
waitingForNotification.get(s.locoAddr()).interrupt();
waitingForNotification.remove(s.locoAddr());
}
}
use of jmri.DccThrottle 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