#296 APCO25 Phase II Decoder Implementation (#589)

P25 Phase 2 Decoder implementation.
This commit is contained in:
Denny Sheirer
2019-11-17 06:56:52 -05:00
committed by GitHub
parent d5b802e794
commit f934676bd0
561 changed files with 35609 additions and 6215 deletions

View File

@@ -46,39 +46,52 @@ public abstract class Tuner implements ISourceEventProcessor
private TunerFrequencyErrorMonitor mTunerFrequencyErrorMonitor;
private String mName;
/**
* Abstract tuner class.
* @param name of the tuner
* @param tunerController for the tuner
*/
public Tuner(String name, TunerController tunerController, UserPreferences userPreferences)
public Tuner(String name, TunerController tunerController)
{
mName = name;
mTunerController = tunerController;
//Register to receive frequency and sample rate change notifications
mTunerController.addListener(this::process);
ChannelizerType channelizerType = userPreferences.getTunerPreference().getChannelizerType();
mTunerFrequencyErrorMonitor = new TunerFrequencyErrorMonitor(this);
mTunerFrequencyErrorMonitor.start();
}
/**
* Abstract tuner class.
* @param name of the tuner
* @param tunerController for the tuner
* @param userPreferences to discover preferred channelizer type
*/
public Tuner(String name, TunerController tunerController, UserPreferences userPreferences)
{
this(name, tunerController);
ChannelizerType channelizerType = userPreferences.getTunerPreference().getChannelizerType();
if(channelizerType == ChannelizerType.POLYPHASE)
{
mChannelSourceManager = new PolyphaseChannelSourceManager(mTunerController);
setChannelSourceManager(new PolyphaseChannelSourceManager(mTunerController));
}
else if(channelizerType == ChannelizerType.HETERODYNE)
{
mChannelSourceManager = new HeterodyneChannelSourceManager(mTunerController);
setChannelSourceManager(new HeterodyneChannelSourceManager(mTunerController));
}
else
{
throw new IllegalArgumentException("Unrecognized channelizer type: " + channelizerType);
}
}
/**
* Sets the channel source manager
* @param manager to use
*/
protected void setChannelSourceManager(ChannelSourceManager manager)
{
mChannelSourceManager = manager;
//Register to receive channel count change notifications
mChannelSourceManager.addSourceEventListener(this::process);
mTunerFrequencyErrorMonitor = new TunerFrequencyErrorMonitor(this);
mTunerFrequencyErrorMonitor.start();
}
@Override
@@ -105,6 +118,9 @@ public abstract class Tuner implements ISourceEventProcessor
case NOTIFICATION_MEASURED_FREQUENCY_ERROR_SYNC_LOCKED:
mTunerFrequencyErrorMonitor.receive(event);
break;
case NOTIFICATION_RECORDING_FILE_LOADED:
//ignore
break;
default:
mLog.debug("Unrecognized Source Event: " + event.toString());
break;