Skip to content

Commit

Permalink
notifyThrottleReleaseEnabled notifyThrottleDispatchEnabled
Browse files Browse the repository at this point in the history
  • Loading branch information
icklesteve committed May 17, 2019
1 parent 5d23099 commit a49124b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
18 changes: 18 additions & 0 deletions java/src/jmri/Throttle.java
Expand Up @@ -459,4 +459,22 @@ public interface Throttle {
public void setRosterEntry(BasicRosterEntry re);

public BasicRosterEntry getRosterEntry();

/**
* Notify listeners that a Throttle has Release enabled or disabled.
* <p>
* For systems where release availability is variable.
*
* @param newVal true if Release enabled, else false
*/
public void notifyThrottleReleaseEnabled( boolean newVal );

/**
* Notify listeners that a Throttle has Dispatch enabled or disabled.
* <p>
* For systems where dispatch availability is variable.
*
* @param newVal true if Dispatch enabled, else false
*/
public void notifyThrottleDispatchEnabled( boolean newVal );
}
5 changes: 0 additions & 5 deletions java/src/jmri/ThrottleManager.java
Expand Up @@ -193,15 +193,10 @@ public interface ThrottleManager {
/**
* Cancel a request for a throttle.
* <P>
* This is a convenience version of the call, which uses system-specific
* logic to tell whether the address is a short or long form.
* @deprecated since 4.15.7; use
* #cancelThrottleRequest(LocoAddress, ThrottleListener) instead
*
* @param re desired Roster Entry
* @param l ThrottleListener canceling the request for a throttle
*/
@Deprecated
public void cancelThrottleRequest(BasicRosterEntry re, ThrottleListener l);

/**
Expand Down
2 changes: 2 additions & 0 deletions java/src/jmri/jmrix/AbstractThrottle.java
Expand Up @@ -661,6 +661,7 @@ protected void notifyThrottleDisconnect() {
* @param newVal true if Dispatch enabled, else false
*
*/
@Override
public void notifyThrottleDispatchEnabled( boolean newVal ) {
if (_dispatchEnabled == null){
_dispatchEnabled = !newVal; // make sure the 1st time is always sent
Expand All @@ -684,6 +685,7 @@ public void notifyThrottleDispatchEnabled( boolean newVal ) {
* @param newVal true if Release enabled, else false
*
*/
@Override
public void notifyThrottleReleaseEnabled( boolean newVal ) {
if (_releaseEnabled == null){
_releaseEnabled = !newVal; // make sure the 1st time is always sent
Expand Down

0 comments on commit a49124b

Please sign in to comment.