Resolves #165 - P25 decoding channel stops arbitrarily and never recovers.

Issue identified with Patch Group management and circular dependencies that can develop because of stale patch groups.  Refactored all patch group management into a new PatchGroupManager.  Patch groups are now automatically deleted if we don't receive any update messages within 5 seconds.  The PatchGroupAlias was also updated to not roll-up attributes from subordinate patched group aliases when those aliases are also patch group aliases -- this eliminates the circular dependency chaining.

Added IOverflowListener interface and updated Sources to support overflow listeners.  Updated ChannelState to register as an overflow listener so that it can visually depict to the user when the channel enters/exits source overflow state.  Added new color pattern for OVERFLOW with yellow text on red.
This commit is contained in:
Denny
2017-02-10 06:36:57 -05:00
parent 767b302ed7
commit 183eb2f7c7
17 changed files with 615 additions and 354 deletions

View File

@@ -19,6 +19,7 @@ package source;
import module.Module;
import sample.SampleType;
import sample.real.IOverflowListener;
/**
* Abstract class to define the minimum functionality of a sample data provider.
@@ -26,6 +27,7 @@ import sample.SampleType;
public abstract class Source extends Module
{
protected SampleType mSampleType;
protected IOverflowListener mOverflowListener;
public Source( SampleType sampleType )
{
@@ -47,4 +49,25 @@ public abstract class Source extends Module
{
mSampleType = sampleType;
}
/**
* Registers the listener to receive overflow state changes. Use null argument to clear the listener
*/
public void setOverflowListener(IOverflowListener listener)
{
mOverflowListener = listener;
}
/**
* Broadcasts an overflow state
*
* @param overflow true if overlow, false if normal
*/
protected void broadcastOverflowState(boolean overflow)
{
if(mOverflowListener != null)
{
mOverflowListener.sourceOverflow(overflow);
}
}
}