From 1c6d19959aa5091f99832adf90e818b1305a5323 Mon Sep 17 00:00:00 2001 From: Denny Date: Wed, 5 Sep 2018 06:34:13 -0400 Subject: [PATCH] Class renaming and cleanup. --- ...ate2.java => ComplexPrimeCICDecimate.java} | 6 ++--- .../github/dsheirer/source/tuner/Tuner.java | 2 +- ...ource2.java => CICTunerChannelSource.java} | 14 ++++++------ .../HeterodyneChannelSourceManager.java | 22 +++++++++---------- ...ava => PolyphaseChannelSourceManager.java} | 8 +++---- 5 files changed, 26 insertions(+), 26 deletions(-) rename src/main/java/io/github/dsheirer/dsp/filter/cic/{ComplexPrimeCICDecimate2.java => ComplexPrimeCICDecimate.java} (98%) rename src/main/java/io/github/dsheirer/source/tuner/channel/{CICTunerChannelSource2.java => CICTunerChannelSource.java} (94%) rename src/main/java/io/github/dsheirer/source/tuner/manager/{TunerChannelSourceManager.java => PolyphaseChannelSourceManager.java} (98%) diff --git a/src/main/java/io/github/dsheirer/dsp/filter/cic/ComplexPrimeCICDecimate2.java b/src/main/java/io/github/dsheirer/dsp/filter/cic/ComplexPrimeCICDecimate.java similarity index 98% rename from src/main/java/io/github/dsheirer/dsp/filter/cic/ComplexPrimeCICDecimate2.java rename to src/main/java/io/github/dsheirer/dsp/filter/cic/ComplexPrimeCICDecimate.java index cc9bbab6..768432c7 100644 --- a/src/main/java/io/github/dsheirer/dsp/filter/cic/ComplexPrimeCICDecimate2.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/cic/ComplexPrimeCICDecimate.java @@ -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 +public class ComplexPrimeCICDecimate implements Listener { -// 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 * @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]); diff --git a/src/main/java/io/github/dsheirer/source/tuner/Tuner.java b/src/main/java/io/github/dsheirer/source/tuner/Tuner.java index 67e8131e..cfe6eae3 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/Tuner.java +++ b/src/main/java/io/github/dsheirer/source/tuner/Tuner.java @@ -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 diff --git a/src/main/java/io/github/dsheirer/source/tuner/channel/CICTunerChannelSource2.java b/src/main/java/io/github/dsheirer/source/tuner/channel/CICTunerChannelSource.java similarity index 94% rename from src/main/java/io/github/dsheirer/source/tuner/channel/CICTunerChannelSource2.java rename to src/main/java/io/github/dsheirer/source/tuner/channel/CICTunerChannelSource.java index 4bb77429..c84df3fb 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/channel/CICTunerChannelSource2.java +++ b/src/main/java/io/github/dsheirer/source/tuner/channel/CICTunerChannelSource.java @@ -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 +public class CICTunerChannelSource extends TunerChannelSource implements Listener { -// 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 mBuffer; private ReusableComplexBufferQueue mReusableComplexBufferQueue = new ReusableComplexBufferQueue("CICTunerChannelSource"); private IOscillator mFrequencyCorrectionMixer; - private ComplexPrimeCICDecimate2 mDecimationFilter; + private ComplexPrimeCICDecimate mDecimationFilter; private Listener mListener; private List 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 producerSourceEventListener, TunerChannel tunerChannel, - double sampleRate, int decimation) throws FilterDesignException + public CICTunerChannelSource(Listener 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 diff --git a/src/main/java/io/github/dsheirer/source/tuner/manager/HeterodyneChannelSourceManager.java b/src/main/java/io/github/dsheirer/source/tuner/manager/HeterodyneChannelSourceManager.java index 8520146a..1a1ed9e6 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/manager/HeterodyneChannelSourceManager.java +++ b/src/main/java/io/github/dsheirer/source/tuner/manager/HeterodyneChannelSourceManager.java @@ -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 mChannelSources = new CopyOnWriteArrayList<>(); + private List mChannelSources = new CopyOnWriteArrayList<>(); private SortedSet 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(); diff --git a/src/main/java/io/github/dsheirer/source/tuner/manager/TunerChannelSourceManager.java b/src/main/java/io/github/dsheirer/source/tuner/manager/PolyphaseChannelSourceManager.java similarity index 98% rename from src/main/java/io/github/dsheirer/source/tuner/manager/TunerChannelSourceManager.java rename to src/main/java/io/github/dsheirer/source/tuner/manager/PolyphaseChannelSourceManager.java index 496f119f..6b879060 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/manager/TunerChannelSourceManager.java +++ b/src/main/java/io/github/dsheirer/source/tuner/manager/PolyphaseChannelSourceManager.java @@ -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;