Class renaming and cleanup.

This commit is contained in:
Denny
2018-09-05 06:34:13 -04:00
parent 50bc3088b7
commit 1c6d19959a
5 changed files with 26 additions and 26 deletions

View File

@@ -41,9 +41,9 @@ import java.util.Map;
* This filter currently supports a maximum decimation rate of 2801. Higher decimation rates can be added by
* adding additional prime factors to the PRIMES array.
*/
public class ComplexPrimeCICDecimate2 implements Listener<ReusableComplexBuffer>
public class ComplexPrimeCICDecimate implements Listener<ReusableComplexBuffer>
{
// private final static Logger mLog = LoggerFactory.getLogger(ComplexPrimeCICDecimate2.class);
// private final static Logger mLog = LoggerFactory.getLogger(ComplexPrimeCICDecimate.class);
/**
* PRIME numbers to use for decimation stage sizing. This list contains values that should
@@ -104,7 +104,7 @@ public class ComplexPrimeCICDecimate2 implements Listener<ReusableComplexBuffer>
* @throws FilterDesignException if a final low-pass cleanup filter cannot be created for the output channel rate
* and specified pass/stop frequencies.
*/
public ComplexPrimeCICDecimate2(double sampleRate, int decimation, int passFrequency, int stopFrequency)
public ComplexPrimeCICDecimate(double sampleRate, int decimation, int passFrequency, int stopFrequency)
throws FilterDesignException
{
Validate.isTrue(decimation <= PRIMES[PRIMES.length - 1]);

View File

@@ -51,7 +51,7 @@ public abstract class Tuner implements ISourceEventProcessor
//Register to receive frequency and sample rate change notifications
mTunerController.addListener(this::process);
// mChannelSourceManager = new TunerChannelSourceManager(mTunerController);
// mChannelSourceManager = new PolyphaseChannelSourceManager(mTunerController);
mChannelSourceManager = new HeterodyneChannelSourceManager(mTunerController);
//Register to receive channel count change notifications

View File

@@ -15,7 +15,7 @@
******************************************************************************/
package io.github.dsheirer.source.tuner.channel;
import io.github.dsheirer.dsp.filter.cic.ComplexPrimeCICDecimate2;
import io.github.dsheirer.dsp.filter.cic.ComplexPrimeCICDecimate;
import io.github.dsheirer.dsp.filter.design.FilterDesignException;
import io.github.dsheirer.dsp.mixer.IOscillator;
import io.github.dsheirer.dsp.mixer.LowPhaseNoiseOscillator;
@@ -34,9 +34,9 @@ import java.util.List;
* CIC decimation filter that requires the decimation rate to be an integer multiple. Sample buffer processing
* occurs on a scheduled runnable thread.
*/
public class CICTunerChannelSource2 extends TunerChannelSource implements Listener<ReusableComplexBuffer>
public class CICTunerChannelSource extends TunerChannelSource implements Listener<ReusableComplexBuffer>
{
// private final static Logger mLog = LoggerFactory.getLogger(CICTunerChannelSource2.class);
// private final static Logger mLog = LoggerFactory.getLogger(CICTunerChannelSource.class);
//Maximum number of filled buffers for the blocking queue
private static final int BUFFER_MAX_CAPACITY = 300;
@@ -53,7 +53,7 @@ public class CICTunerChannelSource2 extends TunerChannelSource implements Listen
private OverflowableReusableBufferTransferQueue<ReusableComplexBuffer> mBuffer;
private ReusableComplexBufferQueue mReusableComplexBufferQueue = new ReusableComplexBufferQueue("CICTunerChannelSource");
private IOscillator mFrequencyCorrectionMixer;
private ComplexPrimeCICDecimate2 mDecimationFilter;
private ComplexPrimeCICDecimate mDecimationFilter;
private Listener<ReusableComplexBuffer> mListener;
private List<ReusableComplexBuffer> mSampleBuffers = new ArrayList<>();
private double mChannelSampleRate;
@@ -70,12 +70,12 @@ public class CICTunerChannelSource2 extends TunerChannelSource implements Listen
* @throws FilterDesignException if a final cleanup filter cannot be designed using the remez filter
* designer and the filter parameters.
*/
public CICTunerChannelSource2(Listener<SourceEvent> producerSourceEventListener, TunerChannel tunerChannel,
double sampleRate, int decimation) throws FilterDesignException
public CICTunerChannelSource(Listener<SourceEvent> producerSourceEventListener, TunerChannel tunerChannel,
double sampleRate, int decimation) throws FilterDesignException
{
super(producerSourceEventListener, tunerChannel);
mDecimationFilter = new ComplexPrimeCICDecimate2(sampleRate, decimation, CHANNEL_PASS_FREQUENCY, CHANNEL_STOP_FREQUENCY);
mDecimationFilter = new ComplexPrimeCICDecimate(sampleRate, decimation, CHANNEL_PASS_FREQUENCY, CHANNEL_STOP_FREQUENCY);
mBuffer = new OverflowableReusableBufferTransferQueue<>(BUFFER_MAX_CAPACITY, BUFFER_OVERFLOW_RESET_THRESHOLD);
//Setup the frequency mixer to the current source frequency

View File

@@ -20,7 +20,7 @@ import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.source.SourceEvent;
import io.github.dsheirer.source.SourceException;
import io.github.dsheirer.source.tuner.TunerController;
import io.github.dsheirer.source.tuner.channel.CICTunerChannelSource2;
import io.github.dsheirer.source.tuner.channel.CICTunerChannelSource;
import io.github.dsheirer.source.tuner.channel.TunerChannel;
import io.github.dsheirer.source.tuner.channel.TunerChannelSource;
import org.slf4j.Logger;
@@ -40,7 +40,7 @@ public class HeterodyneChannelSourceManager extends ChannelSourceManager
private final static int OBJECTIVE_CHANNEL_SAMPLE_RATE = 30000;
private List<CICTunerChannelSource2> mChannelSources = new CopyOnWriteArrayList<>();
private List<CICTunerChannelSource> mChannelSources = new CopyOnWriteArrayList<>();
private SortedSet<TunerChannel> mTunerChannels = new TreeSet<>();
private TunerController mTunerController;
private ChannelSourceEventProcessor mChannelSourceEventProcessor = new ChannelSourceEventProcessor();
@@ -73,7 +73,7 @@ public class HeterodyneChannelSourceManager extends ChannelSourceManager
try
{
//Attempt to create the channel source first, in case we get a filter design exception
CICTunerChannelSource2 tunerChannelSource = new CICTunerChannelSource2(mChannelSourceEventProcessor,
CICTunerChannelSource tunerChannelSource = new CICTunerChannelSource(mChannelSourceEventProcessor,
tunerChannel, mTunerController.getSampleRate(), decimation);
//Add to the list of channel sources so that it will receive the tuner frequency change
@@ -156,7 +156,7 @@ public class HeterodyneChannelSourceManager extends ChannelSourceManager
*/
private void broadcastToChannels(SourceEvent sourceEvent)
{
for(CICTunerChannelSource2 channelSource: mChannelSources)
for(CICTunerChannelSource channelSource: mChannelSources)
{
try
{
@@ -176,7 +176,7 @@ public class HeterodyneChannelSourceManager extends ChannelSourceManager
*/
private void updateTunerFrequency(long tunerFrequency)
{
for(CICTunerChannelSource2 channelSource : mChannelSources)
for(CICTunerChannelSource channelSource : mChannelSources)
{
channelSource.setFrequency(tunerFrequency);
}
@@ -193,21 +193,21 @@ public class HeterodyneChannelSourceManager extends ChannelSourceManager
switch(sourceEvent.getEvent())
{
case REQUEST_START_SAMPLE_STREAM:
if(sourceEvent.getSource() instanceof CICTunerChannelSource2)
if(sourceEvent.getSource() instanceof CICTunerChannelSource)
{
mTunerController.addBufferListener((CICTunerChannelSource2)sourceEvent.getSource());
mTunerController.addBufferListener((CICTunerChannelSource)sourceEvent.getSource());
}
break;
case REQUEST_STOP_SAMPLE_STREAM:
if(sourceEvent.getSource() instanceof CICTunerChannelSource2)
if(sourceEvent.getSource() instanceof CICTunerChannelSource)
{
mTunerController.removeBufferListener((CICTunerChannelSource2)sourceEvent.getSource());
mTunerController.removeBufferListener((CICTunerChannelSource)sourceEvent.getSource());
}
break;
case REQUEST_SOURCE_DISPOSE:
if(sourceEvent.getSource() instanceof CICTunerChannelSource2)
if(sourceEvent.getSource() instanceof CICTunerChannelSource)
{
CICTunerChannelSource2 channelSource = (CICTunerChannelSource2)sourceEvent.getSource();
CICTunerChannelSource channelSource = (CICTunerChannelSource)sourceEvent.getSource();
mChannelSources.remove(channelSource);
mTunerChannels.remove(channelSource.getTunerChannel());
channelSource.dispose();

View File

@@ -26,20 +26,20 @@ import org.slf4j.LoggerFactory;
import java.util.SortedSet;
public class TunerChannelSourceManager extends ChannelSourceManager
public class PolyphaseChannelSourceManager extends ChannelSourceManager
{
private final static Logger mLog = LoggerFactory.getLogger(TunerChannelSourceManager.class);
private final static Logger mLog = LoggerFactory.getLogger(PolyphaseChannelSourceManager.class);
private PolyphaseChannelManager mPolyphaseChannelManager;
private TunerController mTunerController;
/**
* TunerChannelSourceManager is responsible for managing the tuner's center tuned frequency and providing access to
* PolyphaseChannelSourceManager is responsible for managing the tuner's center tuned frequency and providing access to
* polyphase tuner channel sources (ie DDCs). This class is responsible for determining IF a requested channel can
* be provided and then adjusting the center frequency and provisioning a DDC Polyphase Tuner channel source.
*
* @param tunerController with a center tuned frequency that will be managed by this instance
*/
public TunerChannelSourceManager(TunerController tunerController)
public PolyphaseChannelSourceManager(TunerController tunerController)
{
mTunerController = tunerController;