mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-10 23:57:25 -05:00
Work in progress.
-Started work on new channel editor channel viewer/controller -Removed a number of unused buffer package classes -Moved automatic frequency control to be a module and removed special handling -Added IUnfilteredRealBufferListener & Provider interfaces -Completely removed the ResourceManager class
This commit is contained in:
@@ -63,10 +63,10 @@ import module.decode.nbfm.NBFMDecoder;
|
||||
import module.decode.nbfm.NBFMDecoderPanel;
|
||||
import module.decode.nbfm.NBFMEditor;
|
||||
import module.decode.p25.DecodeConfigP25Phase1;
|
||||
import module.decode.p25.P25DecodeEditor;
|
||||
import module.decode.p25.P25Decoder.Modulation;
|
||||
import module.decode.p25.P25DecoderPanel;
|
||||
import module.decode.p25.P25DecoderState;
|
||||
import module.decode.p25.P25DecodeEditor;
|
||||
import module.decode.p25.P25_C4FMDecoder;
|
||||
import module.decode.p25.P25_LSMDecoder;
|
||||
import module.decode.p25.audio.P25AudioModule;
|
||||
@@ -84,6 +84,7 @@ import module.decode.tait.Tait1200Decoder;
|
||||
import module.decode.tait.Tait1200DecoderPanel;
|
||||
import module.decode.tait.Tait1200DecoderState;
|
||||
import module.demodulate.am.AMDemodulatorModule;
|
||||
import module.demodulate.audio.DemodulatedAudioFilterModule;
|
||||
import module.demodulate.fm.FMDemodulatorModule;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
@@ -97,12 +98,11 @@ import settings.SettingsManager;
|
||||
import util.TimeStamp;
|
||||
import alias.AliasList;
|
||||
import audio.AudioModule;
|
||||
import controller.ResourceManager;
|
||||
import controller.channel.Channel;
|
||||
import controller.channel.Channel.ChannelType;
|
||||
import controller.channel.ChannelNode;
|
||||
import controller.channel.ChannelModel;
|
||||
import controller.channel.ChannelProcessingManager;
|
||||
import controller.channel.map.ChannelMap;
|
||||
import controller.site.Site;
|
||||
import controller.system.System;
|
||||
import filter.AllPassFilter;
|
||||
import filter.FilterSet;
|
||||
import filter.IFilter;
|
||||
@@ -120,72 +120,46 @@ public class DecoderFactory
|
||||
* Returns a list of one primary decoder and any auxiliary decoders, as
|
||||
* specified in the configurations.
|
||||
*
|
||||
* @param channelType - standard or traffic channel type
|
||||
* @param resourceManager
|
||||
* @param decodeConfig - primary decoder configuration
|
||||
* @param recordConfig - recording configuration used by traffic channel manager
|
||||
* @param auxConfig - auxiliary decoder(s) configuration
|
||||
* @param optional alias list - (null is ok)
|
||||
*
|
||||
* @return list of configured decoders
|
||||
*/
|
||||
public static List<Module> getModules( ChannelType channelType,
|
||||
ResourceManager resourceManager,
|
||||
DecodeConfiguration decodeConfig,
|
||||
RecordConfiguration recordConfig,
|
||||
AuxDecodeConfiguration auxConfig,
|
||||
AliasList aliasList,
|
||||
String system,
|
||||
String site,
|
||||
String channelName )
|
||||
public static List<Module> getModules( ChannelModel channelModel,
|
||||
ChannelProcessingManager channelProcessingManager,
|
||||
PlaylistManager playlistManager,
|
||||
Channel channel )
|
||||
{
|
||||
List<Module> modules = getPrimaryModules( channelType, decodeConfig,
|
||||
recordConfig, aliasList, system, site, channelName, resourceManager );
|
||||
|
||||
modules.addAll( getAuxiliaryDecoders( auxConfig, aliasList ) );
|
||||
/* Get the optional alias list for the decode modules to use */
|
||||
AliasList aliasList = playlistManager.getPlayist()
|
||||
.getAliasDirectory().getAliasList( channel.getAliasListName() );
|
||||
|
||||
List<Module> modules = getPrimaryModules( channelModel, channelProcessingManager,
|
||||
playlistManager, aliasList, channel );
|
||||
|
||||
modules.addAll( getAuxiliaryDecoders( channel.getAuxDecodeConfiguration(), aliasList ) );
|
||||
|
||||
return modules;
|
||||
}
|
||||
|
||||
public static FMDemodulatorModule getFMDemodulator(
|
||||
DecodeConfiguration config, int pass, int stop, boolean removeDC )
|
||||
{
|
||||
if( config.isAFCEnabled() )
|
||||
{
|
||||
return new FMDemodulatorModule( pass, stop,
|
||||
config.getAFCMaximumCorrection(), removeDC );
|
||||
}
|
||||
else
|
||||
{
|
||||
return new FMDemodulatorModule( pass, stop,
|
||||
NO_FREQUENCY_CORRECTION, removeDC );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a primary decoder as specified in the decode configuration
|
||||
*
|
||||
* @param channelType - traffic or standard decode channel
|
||||
* @param decodeConfig - primary decoder configuration
|
||||
* @param recordConfig - recording options
|
||||
* @param aliasList - optional alias list
|
||||
* @param resourceManager - shared resource manager
|
||||
* @return configured decoder or null
|
||||
*/
|
||||
public static List<Module> getPrimaryModules( ChannelType channelType,
|
||||
DecodeConfiguration decodeConfig,
|
||||
RecordConfiguration recordConfig,
|
||||
public static List<Module> getPrimaryModules( ChannelModel channelModel,
|
||||
ChannelProcessingManager channelProcessingManager,
|
||||
PlaylistManager playlistManager,
|
||||
AliasList aliasList,
|
||||
String system,
|
||||
String site,
|
||||
String channelName,
|
||||
ResourceManager resourceManager )
|
||||
Channel channel )
|
||||
{
|
||||
List<Module> modules = new ArrayList<Module>();
|
||||
|
||||
ChannelType channelType = channel.getChannelType();
|
||||
|
||||
/* Baseband low-pass filter pass and stop frequencies */
|
||||
int pass = decodeConfig.getDecoderType().getChannelBandwidth() / 2;
|
||||
int stop = pass + 1250;
|
||||
DecodeConfiguration decodeConfig = channel.getDecodeConfiguration();
|
||||
|
||||
int iqPass = decodeConfig.getDecoderType().getChannelBandwidth() / 2;
|
||||
int iqStop = iqPass + 1250;
|
||||
|
||||
RecordConfiguration recordConfig = channel.getRecordConfiguration();
|
||||
|
||||
boolean recordAudio = recordConfig == null ? false :
|
||||
recordConfig.getRecorders().contains( RecorderType.AUDIO );
|
||||
@@ -193,41 +167,44 @@ public class DecoderFactory
|
||||
switch( decodeConfig.getDecoderType() )
|
||||
{
|
||||
case AM:
|
||||
modules.add( new AMDemodulatorModule() );
|
||||
modules.add( new AMDecoder( decodeConfig ) );
|
||||
modules.add( new AlwaysUnsquelchedDecoderState( DecoderType.AM, channelName ) );
|
||||
modules.add( new AudioModule( recordAudio, REMOVE_DC ) );
|
||||
modules.add( new AlwaysUnsquelchedDecoderState( DecoderType.AM, channel.getName() ) );
|
||||
modules.add( new AMDemodulatorModule() );
|
||||
modules.add( new DemodulatedAudioFilterModule( 4000, 6000 ));
|
||||
modules.add( new AudioModule( recordAudio ) );
|
||||
break;
|
||||
case NBFM:
|
||||
modules.add( new AudioModule( recordAudio, NO_REMOVE_DC ) );
|
||||
modules.add( new NBFMDecoder( decodeConfig ) );
|
||||
modules.add( new AlwaysUnsquelchedDecoderState( DecoderType.NBFM, channelName ) );
|
||||
modules.add( getFMDemodulator( decodeConfig, pass, stop, REMOVE_DC ) );
|
||||
modules.add( new AlwaysUnsquelchedDecoderState( DecoderType.NBFM, channel.getName() ) );
|
||||
modules.add( new FMDemodulatorModule( iqPass, iqStop ) );
|
||||
modules.add( new DemodulatedAudioFilterModule( 4000, 6000 ));
|
||||
modules.add( new AudioModule( recordAudio ) );
|
||||
break;
|
||||
case LTR_STANDARD:
|
||||
modules.add( new AudioModule( recordAudio, REMOVE_DC ) );
|
||||
MessageDirection direction = ((DecodeConfigLTRStandard)decodeConfig).getMessageDirection();
|
||||
modules.add( new LTRStandardDecoder( aliasList, direction ) );
|
||||
modules.add( new LTRStandardDecoderState( aliasList ) );
|
||||
modules.add( getFMDemodulator( decodeConfig, pass, stop, NO_REMOVE_DC ) );
|
||||
modules.add( new FMDemodulatorModule( iqPass, iqStop ) );
|
||||
modules.add( new DemodulatedAudioFilterModule( 4000, 6000 ));
|
||||
modules.add( new AudioModule( recordAudio ) );
|
||||
break;
|
||||
case LTR_NET:
|
||||
modules.add( new AudioModule( recordAudio, REMOVE_DC ) );
|
||||
modules.add( new LTRNetDecoder( (DecodeConfigLTRNet)decodeConfig, aliasList ) );
|
||||
modules.add( new LTRNetDecoderState( aliasList ) );
|
||||
modules.add( getFMDemodulator( decodeConfig, pass, stop, NO_REMOVE_DC ) );
|
||||
modules.add( new FMDemodulatorModule( iqPass, iqStop ) );
|
||||
modules.add( new DemodulatedAudioFilterModule( 4000, 6000 ));
|
||||
modules.add( new AudioModule( recordAudio ) );
|
||||
break;
|
||||
case MPT1327:
|
||||
DecodeConfigMPT1327 mptConfig = (DecodeConfigMPT1327)decodeConfig;
|
||||
|
||||
modules.add( new AudioModule( recordAudio, NO_REMOVE_DC ) );
|
||||
|
||||
ChannelMap channelMap = resourceManager.getPlaylistManager().getPlayist()
|
||||
ChannelMap channelMap = playlistManager.getPlayist()
|
||||
.getChannelMapList().getChannelMap( mptConfig.getChannelMapName() );
|
||||
|
||||
Sync sync = mptConfig.getSync();
|
||||
|
||||
modules.add( new MPT1327Decoder( aliasList, sync ) );
|
||||
|
||||
modules.add( new MPT1327DecoderState( aliasList, channelMap,
|
||||
channelType, mptConfig.getCallTimeout() * 1000 ) );
|
||||
|
||||
@@ -235,30 +212,34 @@ public class DecoderFactory
|
||||
{
|
||||
long timeout = mptConfig.getCallTimeout() * 1000; //convert to milliseconds
|
||||
|
||||
modules.add( new TrafficChannelManager( resourceManager,
|
||||
decodeConfig, recordConfig, system, site,
|
||||
( aliasList != null ? aliasList.getName() : null ), timeout,
|
||||
modules.add( new TrafficChannelManager( channelModel, channelProcessingManager,
|
||||
decodeConfig, recordConfig, channel.getSystem(),
|
||||
channel.getSite(), ( aliasList != null ? aliasList.getName() : null ), timeout,
|
||||
mptConfig.getTrafficChannelPoolSize() ) );
|
||||
}
|
||||
|
||||
modules.add( getFMDemodulator( decodeConfig, pass, stop, REMOVE_DC ) );
|
||||
modules.add( new FMDemodulatorModule( iqPass, iqStop ) );
|
||||
modules.add( new DemodulatedAudioFilterModule( 4000, 6000 ));
|
||||
modules.add( new AudioModule( recordAudio ) );
|
||||
break;
|
||||
case PASSPORT:
|
||||
modules.add( new AudioModule( recordAudio, REMOVE_DC ) );
|
||||
modules.add( new PassportDecoder( decodeConfig, aliasList ) );
|
||||
modules.add( new PassportDecoderState( aliasList ) );
|
||||
modules.add( getFMDemodulator( decodeConfig, pass, stop, NO_REMOVE_DC ) );
|
||||
modules.add( new FMDemodulatorModule( iqPass, iqStop ) );
|
||||
modules.add( new DemodulatedAudioFilterModule( 4000, 6000 ));
|
||||
modules.add( new AudioModule( recordAudio ) );
|
||||
break;
|
||||
case P25_PHASE1:
|
||||
DecodeConfigP25Phase1 p25Config = (DecodeConfigP25Phase1)decodeConfig;
|
||||
|
||||
Modulation modulation = p25Config.getModulation();
|
||||
|
||||
|
||||
switch( modulation )
|
||||
{
|
||||
case C4FM:
|
||||
modules.add( getFMDemodulator( decodeConfig, 6750, 7500, NO_REMOVE_DC ) );
|
||||
modules.add( new P25_C4FMDecoder( aliasList ) );
|
||||
modules.add( new FMDemodulatorModule( 6750, 7500 ) );
|
||||
modules.add( new P25_C4FMDecoder( aliasList, decodeConfig.getAFCMaximumCorrection() ) );
|
||||
modules.add( new P25DecoderState( aliasList, channelType,
|
||||
Modulation.C4FM, p25Config.getIgnoreDataCalls() ) );
|
||||
break;
|
||||
@@ -277,8 +258,9 @@ public class DecoderFactory
|
||||
//Set call timeout to 3 seconds for P25 traffic channels
|
||||
long timeout = 3000;
|
||||
|
||||
modules.add( new TrafficChannelManager( resourceManager,
|
||||
decodeConfig, recordConfig, system, site,
|
||||
modules.add( new TrafficChannelManager( channelModel,
|
||||
channelProcessingManager, decodeConfig,
|
||||
recordConfig, channel.getSystem(), channel.getSite(),
|
||||
( aliasList != null ? aliasList.getName() : null ), timeout,
|
||||
p25Config.getTrafficChannelPoolSize() ) );
|
||||
}
|
||||
@@ -449,7 +431,7 @@ public class DecoderFactory
|
||||
}
|
||||
|
||||
public static DecodeEditor getEditorPanel( DecodeConfiguration config,
|
||||
ChannelNode channelNode, PlaylistManager playlistManager )
|
||||
Channel channel, PlaylistManager playlistManager )
|
||||
{
|
||||
DecodeEditor configuredPanel;
|
||||
|
||||
@@ -466,7 +448,7 @@ public class DecoderFactory
|
||||
break;
|
||||
case MPT1327:
|
||||
configuredPanel = new MPT1327ConfigEditor( config,
|
||||
channelNode, playlistManager );
|
||||
channel, playlistManager );
|
||||
break;
|
||||
case PASSPORT:
|
||||
configuredPanel = new PassportEditor( config );
|
||||
|
||||
Reference in New Issue
Block a user