Work in progress - program compiles and runs

This commit is contained in:
denny
2016-01-02 12:29:40 -05:00
parent d8a20b5adb
commit c405ddad96
36 changed files with 374 additions and 694 deletions

View File

@@ -1,6 +1,6 @@
/******************************************************************************* /*******************************************************************************
* SDR Trunk * SDR Trunk
* Copyright (C) 2015 Dennis Sheirer * Copyright (C) 2014-2016 Dennis Sheirer
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@@ -9,7 +9,7 @@ import org.slf4j.LoggerFactory;
import sample.Listener; import sample.Listener;
import alias.Alias; import alias.Alias;
import controller.ResourceManager; import controller.ThreadPoolManager;
/** /**
* Manages all alias action events. Each received message is interrogated for * Manages all alias action events. Each received message is interrogated for
@@ -23,11 +23,11 @@ public class AliasActionManager implements Listener<Message>
private final static Logger mLog = private final static Logger mLog =
LoggerFactory.getLogger( AliasActionManager.class ); LoggerFactory.getLogger( AliasActionManager.class );
private ResourceManager mResourceManager; private ThreadPoolManager mThreadPoolManager;
public AliasActionManager( ResourceManager resourceManager ) public AliasActionManager( ThreadPoolManager threadPoolManager )
{ {
mResourceManager = resourceManager; mThreadPoolManager = threadPoolManager;
} }
@Override @Override
@@ -51,8 +51,7 @@ public class AliasActionManager implements Listener<Message>
* action needs to setup a timer, and provide the original * action needs to setup a timer, and provide the original
* message to be used as part of the action (e.g. sending * message to be used as part of the action (e.g. sending
* the message as a text message to a cell phone */ * the message as a text message to a cell phone */
action.execute( mResourceManager.getThreadPoolManager(), action.execute( mThreadPoolManager, alias, message );
alias, message );
} }
} }
} }

View File

@@ -183,10 +183,10 @@ public class AudioModule extends Module implements IAudioPacketProvider,
{ {
switch( event.getEvent() ) switch( event.getEvent() )
{ {
case CHANNEL_STATE_RESET: case NOTIFICATION_STATE_RESET:
mAudioMetadata.reset(); mAudioMetadata.reset();
break; break;
case CHANGE_SELECTED: case NOTIFICATION_SELECTION_CHANGE:
mAudioMetadata.setSelected( event.getChannel().isSelected() ); mAudioMetadata.setSelected( event.getChannel().isSelected() );
break; break;
default: default:

View File

@@ -30,21 +30,14 @@ import javax.swing.tree.TreePath;
import map.IconManager; import map.IconManager;
import module.decode.DecoderType; import module.decode.DecoderType;
import module.decode.config.DecodeConfigFactory;
import playlist.PlaylistNode; import playlist.PlaylistNode;
import source.config.SourceConfigTuner;
import source.tuner.Tuner; import source.tuner.Tuner;
import source.tuner.TunerGroupNode; import source.tuner.TunerGroupNode;
import source.tuner.TunerNode; import source.tuner.TunerNode;
import source.tuner.TunerSelectionListener; import source.tuner.TunerSelectionListener;
import controller.channel.Channel; import controller.channel.Channel;
import controller.channel.ChannelEvent; import controller.channel.ChannelModel;
import controller.channel.ChannelEvent.Event;
import controller.channel.ChannelNode; import controller.channel.ChannelNode;
import controller.site.Site;
import controller.system.System;
import controller.system.SystemListNode;
import controller.system.SystemNode;
public class ConfigurationControllerModel extends DefaultTreeModel public class ConfigurationControllerModel extends DefaultTreeModel
{ {
@@ -62,6 +55,7 @@ public class ConfigurationControllerModel extends DefaultTreeModel
// private RecordingGroupNode mRecordingGroupNode; // private RecordingGroupNode mRecordingGroupNode;
private IconManager mIconManagerFrame; private IconManager mIconManagerFrame;
private ChannelModel mChannelModel;
/** /**
* Implements a merged system controller and (tree) model. The user will * Implements a merged system controller and (tree) model. The user will
@@ -69,9 +63,12 @@ public class ConfigurationControllerModel extends DefaultTreeModel
* design perspective, the model and the control are necessarily merged to * design perspective, the model and the control are necessarily merged to
* work well with the JTree as the system view. * work well with the JTree as the system view.
*/ */
public ConfigurationControllerModel( ResourceManager resourceManager ) public ConfigurationControllerModel( ChannelModel channelModel,
ResourceManager resourceManager )
{ {
super( new BaseNode( null ) ); super( new BaseNode( null ) );
mChannelModel = channelModel;
mResourceManager = resourceManager; mResourceManager = resourceManager;
@@ -156,7 +153,7 @@ public class ConfigurationControllerModel extends DefaultTreeModel
for( Tuner tuner: tuners ) for( Tuner tuner: tuners )
{ {
TunerNode child = new TunerNode( tuner ); TunerNode child = new TunerNode( mChannelModel, tuner );
insertNodeInto( child, parent, parent.getChildCount() ); insertNodeInto( child, parent, parent.getChildCount() );
@@ -173,29 +170,30 @@ public class ConfigurationControllerModel extends DefaultTreeModel
*/ */
public void createChannel( long frequency, DecoderType decoder ) public void createChannel( long frequency, DecoderType decoder )
{ {
System system = new System(); throw new UnsupportedOperationException( "This has to be updated to new channel model format" );
// System system = new System();
Site site = new Site(); //
system.addSite( site ); // Site site = new Site();
// system.addSite( site );
Channel channel = new Channel(); //
channel.setDecodeConfiguration( // Channel channel = new Channel();
DecodeConfigFactory.getDecodeConfiguration( decoder ) ); // channel.setDecodeConfiguration(
SourceConfigTuner sourceConfig = new SourceConfigTuner(); // DecodeConfigFactory.getDecodeConfiguration( decoder ) );
sourceConfig.setFrequency( frequency ); // SourceConfigTuner sourceConfig = new SourceConfigTuner();
channel.setSourceConfiguration( sourceConfig ); // sourceConfig.setFrequency( frequency );
mResourceManager.getChannelManager().channelChanged( new ChannelEvent( channel, Event.CHANNEL_ADDED ) ); // channel.setSourceConfiguration( sourceConfig );
channel.setEnabled( true, true ); // mResourceManager.getChannelManager().channelChanged( new ChannelEvent( channel, Event.NOTIFICATION_ADD ) );
site.addChannel( channel ); // channel.setEnabled( true, true );
// site.addChannel( channel );
mPlaylistNode.getPlaylist().getSystemList().addSystem( system ); //
// mPlaylistNode.getPlaylist().getSystemList().addSystem( system );
SystemNode systemNode = new SystemNode( system ); //
SystemListNode systemListNode = mPlaylistNode.getSystemListNode(); // SystemNode systemNode = new SystemNode( system );
addNode( systemNode, systemListNode, systemListNode.getChildCount() ); // SystemListNode systemListNode = mPlaylistNode.getSystemListNode();
systemNode.init(); // addNode( systemNode, systemListNode, systemListNode.getChildCount() );
// systemNode.init();
systemNode.save(); //
// systemNode.save();
} }
public void addNode( BaseNode child, BaseNode parent, int index ) public void addNode( BaseNode child, BaseNode parent, int index )

View File

@@ -42,7 +42,8 @@ import audio.AudioPanel;
import com.jidesoft.swing.JideSplitPane; import com.jidesoft.swing.JideSplitPane;
import com.jidesoft.swing.JideTabbedPane; import com.jidesoft.swing.JideTabbedPane;
import controller.channel.ChannelManager; import controller.channel.ChannelModel;
import controller.channel.ChannelProcessingManager;
public class ControllerPanel extends JPanel public class ControllerPanel extends JPanel
{ {
@@ -67,24 +68,25 @@ public class ControllerPanel extends JPanel
private AudioPanel mAudioPanel; private AudioPanel mAudioPanel;
private MapPanel mMapPanel; private MapPanel mMapPanel;
private ChannelManager mChannelManager; private ChannelModel mChannelModel;
private ConfigurationControllerModel mController; private ConfigurationControllerModel mController;
protected SettingsManager mSettingsManager; protected SettingsManager mSettingsManager;
public ControllerPanel( AudioManager audioManager, public ControllerPanel( AudioManager audioManager,
ConfigurationControllerModel controller, ConfigurationControllerModel controller,
ChannelManager channelManager, ChannelModel channelModel,
ChannelProcessingManager channelProcessingManager,
MapService mapService, MapService mapService,
PlaylistManager playlistManager, PlaylistManager playlistManager,
SettingsManager settingsManager ) SettingsManager settingsManager )
{ {
mChannelManager = channelManager; mChannelModel = channelModel;
mController = controller; mController = controller;
mSettingsManager = settingsManager; mSettingsManager = settingsManager;
mAudioPanel = new AudioPanel( mSettingsManager, audioManager ); mAudioPanel = new AudioPanel( mSettingsManager, audioManager );
mMapPanel = new MapPanel( mapService, mSettingsManager, mChannelManager ); mMapPanel = new MapPanel( mapService, mSettingsManager, channelProcessingManager );
mCallEventPanel = new CallEventPanel( mSettingsManager ); mCallEventPanel = new CallEventPanel( mSettingsManager );
@@ -120,6 +122,10 @@ public class ControllerPanel extends JPanel
mTabbedPane.addTab( "Channel Spectrum", mChannelSpectrumPanel ); mTabbedPane.addTab( "Channel Spectrum", mChannelSpectrumPanel );
mTabbedPane.addTab( "Events", mCallEventPanel ); mTabbedPane.addTab( "Events", mCallEventPanel );
mTabbedPane.addTab( "Messages", mMessageActivityPanel ); mTabbedPane.addTab( "Messages", mMessageActivityPanel );
JTable channelsTable = new JTable( mChannelModel );
JScrollPane channelsScroller = new JScrollPane( channelsTable );
mTabbedPane.addTab( "Channels", channelsScroller );
/** /**
* Change listener to enable/disable the channel spectrum display * Change listener to enable/disable the channel spectrum display
@@ -152,10 +158,10 @@ public class ControllerPanel extends JPanel
/* Register each of the components to receive channel events when the /* Register each of the components to receive channel events when the
* channels are selected or change */ * channels are selected or change */
mChannelManager.addListener( mCallEventPanel ); mChannelModel.addListener( mCallEventPanel );
mChannelManager.addListener( mChannelStateList ); mChannelModel.addListener( mChannelStateList );
mChannelManager.addListener( mChannelSpectrumPanel ); mChannelModel.addListener( mChannelSpectrumPanel );
mChannelManager.addListener( mMessageActivityPanel ); mChannelModel.addListener( mMessageActivityPanel );
JScrollPane channelStateListScroll = new JScrollPane(); JScrollPane channelStateListScroll = new JScrollPane();
channelStateListScroll.getViewport().setView( mChannelStateList ); channelStateListScroll.getViewport().setView( mChannelStateList );

View File

@@ -26,7 +26,7 @@ import source.SourceManager;
import source.recording.RecordingSourceManager; import source.recording.RecordingSourceManager;
import source.tuner.TunerManager; import source.tuner.TunerManager;
import audio.AudioManager; import audio.AudioManager;
import controller.channel.ChannelManager; import controller.channel.ChannelModel;
/** /**
* Manager for system wide resources * Manager for system wide resources
@@ -34,7 +34,6 @@ import controller.channel.ChannelManager;
public class ResourceManager public class ResourceManager
{ {
private AudioManager mAudioManager; private AudioManager mAudioManager;
private ChannelManager mChannelManager;
private EventLogManager mEventLogManager; private EventLogManager mEventLogManager;
private PlaylistManager mPlaylistManager; private PlaylistManager mPlaylistManager;
private RecorderManager mRecorderManager; private RecorderManager mRecorderManager;
@@ -46,17 +45,24 @@ public class ResourceManager
private MapService mMapService; private MapService mMapService;
private ThreadPoolManager mThreadPoolManager; private ThreadPoolManager mThreadPoolManager;
public ResourceManager() public ResourceManager( PlaylistManager playlistManager,
ThreadPoolManager threadPoolManager,
ChannelModel channelModel )
{ {
this( new SettingsManager(), this( threadPoolManager,
new PlaylistManager(), new SettingsManager(),
new EventLogManager() ); playlistManager,
new EventLogManager(),
channelModel );
} }
public ResourceManager( SettingsManager settingsManager, public ResourceManager( ThreadPoolManager threadPoolManager,
SettingsManager settingsManager,
PlaylistManager playlistManager, PlaylistManager playlistManager,
EventLogManager eventLogManager ) EventLogManager eventLogManager,
ChannelModel channelModel )
{ {
mThreadPoolManager = threadPoolManager;
mSettingsManager = settingsManager; mSettingsManager = settingsManager;
mPlaylistManager = playlistManager; mPlaylistManager = playlistManager;
mEventLogManager = eventLogManager; mEventLogManager = eventLogManager;
@@ -65,14 +71,12 @@ public class ResourceManager
* ChannelManager requires a reference to the ResourceManager so that * ChannelManager requires a reference to the ResourceManager so that
* channel processing chains can access system wide resources * channel processing chains can access system wide resources
*/ */
mThreadPoolManager = new ThreadPoolManager();
mAudioManager = new AudioManager( mThreadPoolManager ); mAudioManager = new AudioManager( mThreadPoolManager );
mRecorderManager = new RecorderManager( mThreadPoolManager ); mRecorderManager = new RecorderManager( mThreadPoolManager );
mChannelManager = new ChannelManager( this );
mSourceManager = new SourceManager( this ); mSourceManager = new SourceManager( this );
mRecordingSourceManager = new RecordingSourceManager( this ); mRecordingSourceManager = new RecordingSourceManager( this );
mTunerManager = new TunerManager( this ); mTunerManager = new TunerManager( this );
mController = new ConfigurationControllerModel( this ); mController = new ConfigurationControllerModel( channelModel, this );
mMapService = new MapService( this ); mMapService = new MapService( this );
} }
@@ -170,14 +174,4 @@ public class ResourceManager
{ {
mRecordingSourceManager = manager; mRecordingSourceManager = manager;
} }
public ChannelManager getChannelManager()
{
return mChannelManager;
}
public void setChannelManager( ChannelManager channelManager )
{
mChannelManager = channelManager;
}
} }

View File

@@ -17,12 +17,7 @@
******************************************************************************/ ******************************************************************************/
package controller.channel; package controller.channel;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
@@ -49,7 +44,6 @@ import org.slf4j.LoggerFactory;
import record.RecorderManager; import record.RecorderManager;
import record.RecorderType; import record.RecorderType;
import record.config.RecordConfiguration; import record.config.RecordConfiguration;
import sample.Listener;
import source.Source; import source.Source;
import source.SourceException; import source.SourceException;
import source.SourceType; import source.SourceType;
@@ -63,10 +57,7 @@ import alias.AliasList;
import audio.metadata.Metadata; import audio.metadata.Metadata;
import audio.metadata.MetadataType; import audio.metadata.MetadataType;
import controller.ResourceManager; import controller.ResourceManager;
import controller.channel.ChannelEvent.Event;
import controller.config.Configuration; import controller.config.Configuration;
import controller.site.Site;
import controller.system.System;
import filter.FilterSet; import filter.FilterSet;
@XmlSeeAlso( { Configuration.class } ) @XmlSeeAlso( { Configuration.class } )
@@ -75,9 +66,7 @@ public class Channel extends Configuration
{ {
private final static Logger mLog = LoggerFactory.getLogger( Channel.class ); private final static Logger mLog = LoggerFactory.getLogger( Channel.class );
private static final boolean ENABLED = true;
private static final boolean DISABLED = false; private static final boolean DISABLED = false;
private static final boolean BROADCAST_CHANGE = true;
public enum ChannelType public enum ChannelType
{ {
@@ -85,15 +74,6 @@ public class Channel extends Configuration
TRAFFIC TRAFFIC
}; };
private CopyOnWriteArrayList<ChannelEventListener> mChannelListeners =
new CopyOnWriteArrayList<ChannelEventListener>();
private CopyOnWriteArrayList<Listener<Message>> mMessageListeners =
new CopyOnWriteArrayList<Listener<Message>>();
private Map<String,Channel> mTrafficChannels = new HashMap<>();
private DecodeConfiguration mDecodeConfiguration = private DecodeConfiguration mDecodeConfiguration =
DecodeConfigFactory.getDefaultDecodeConfiguration(); DecodeConfigFactory.getDefaultDecodeConfiguration();
private AuxDecodeConfiguration mAuxDecodeConfiguration = private AuxDecodeConfiguration mAuxDecodeConfiguration =
@@ -106,19 +86,19 @@ public class Channel extends Configuration
private ResourceManager mResourceManager; private ResourceManager mResourceManager;
private String mAliasListName; private String mAliasListName;
private System mSystem; private String mSystem;
private Site mSite; private String mSite;
private String mName; private String mName;
private boolean mEnabled; private boolean mEnabled;
private boolean mSelected; private boolean mSelected;
private ChannelType mChannelType; private ChannelType mChannelType;
private ChannelState mChannelState;
private CallEventModel mCallEventModel; private CallEventModel mCallEventModel;
private MessageActivityModel mMessageActivityModel; private MessageActivityModel mMessageActivityModel;
private MessageEventLogger mEventLogger; private MessageEventLogger mEventLogger;
private ProcessingChain mProcessingChain; private ProcessingChain mProcessingChain;
private ChannelState mChannelState;
private long mTrafficChannelTimeout = private long mTrafficChannelTimeout =
DecodeConfiguration.DEFAULT_CALL_TIMEOUT_SECONDS; DecodeConfiguration.DEFAULT_CALL_TIMEOUT_SECONDS;
@@ -191,13 +171,12 @@ public class Channel extends Configuration
* Note: resource manager instance is applied after object construction * Note: resource manager instance is applied after object construction
* since we construct the channel objects from the xml playlist * since we construct the channel objects from the xml playlist
*/ */
//TODO: remove this
public void setResourceManager( ResourceManager resourceManager ) public void setResourceManager( ResourceManager resourceManager )
{ {
mResourceManager = resourceManager; mResourceManager = resourceManager;
/* Add system-wide channel listeners onto this channel */
addListeners( mResourceManager.getChannelManager().getChannelListeners() );
/* If we're enabled, fire enable changed event to get processing started */ /* If we're enabled, fire enable changed event to get processing started */
if( mEnabled ) if( mEnabled )
{ {
@@ -205,6 +184,7 @@ public class Channel extends Configuration
} }
} }
//TODO: remove this
@XmlTransient @XmlTransient
public ResourceManager getResourceManager() public ResourceManager getResourceManager()
{ {
@@ -242,8 +222,6 @@ public class Channel extends Configuration
public void setSelected( boolean selected ) public void setSelected( boolean selected )
{ {
mSelected = selected; mSelected = selected;
fireChannelEvent( Event.CHANGE_SELECTED );
} }
@XmlTransient @XmlTransient
@@ -293,10 +271,7 @@ public class Channel extends Configuration
*/ */
public void dispose() public void dispose()
{ {
setEnabled( DISABLED, BROADCAST_CHANGE ); setEnabled( DISABLED );
/* Broadcast channel deleted event */
fireChannelEvent( Event.CHANNEL_DELETED );
} }
/** /**
@@ -306,28 +281,8 @@ public class Channel extends Configuration
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
if( mSystem != null ) sb.append( ( mSystem == null ? "-" : mSystem ) );
{ sb.append( ( mSite == null ? "-" : mSite ) );
sb.append( mSystem.getName() );
}
else
{
sb.append( "-" );
}
sb.append( "/" );
if( mSite != null )
{
sb.append( mSite.getName() );
}
else
{
sb.append( "-" );
}
sb.append( "/" );
sb.append( mName ); sb.append( mName );
return sb.toString(); return sb.toString();
@@ -366,57 +321,41 @@ public class Channel extends Configuration
/** /**
* Returns the owning system for this channel. * Returns the owning system for this channel.
*/ */
public System getSystem() @XmlAttribute( name = "system" )
public String getSystem()
{ {
return mSystem; return mSystem;
} }
public void setSystem( String system )
{
mSystem = system;
}
public boolean hasSystem() public boolean hasSystem()
{ {
return mSystem != null; return mSystem != null;
} }
/**
* Sets the owning system for this channel and optionally broadcasts a
* system change channel event.
*/
public void setSystem( System system, boolean fireChangeEvent )
{
mSystem = system;
if( fireChangeEvent )
{
fireChannelEvent( Event.CHANGE_SYSTEM );
}
}
/** /**
* Returns the owning site for this channel. * Returns the owning site for this channel.
*/ */
public Site getSite() @XmlAttribute( name = "site" )
public String getSite()
{ {
return mSite; return mSite;
} }
public void setSite( String site )
{
mSite = site;
}
public boolean hasSite() public boolean hasSite()
{ {
return mSite != null; return mSite != null;
} }
/**
* Sets the owning site for this channel and optionally broadcasts a site
* change channel event.
*/
public void setSite( Site site, boolean fireChangeEvent )
{
mSite = site;
if( fireChangeEvent )
{
fireChannelEvent( Event.CHANGE_SITE );
}
}
/** /**
* Default display string for this channel -- the channel name. * Default display string for this channel -- the channel name.
*/ */
@@ -444,28 +383,6 @@ public class Channel extends Configuration
enableChanged(); enableChanged();
} }
/**
* Enables/disables this channel for processing. Automatically starts or
* stops channel processing in response to this change. Optionally
* broadcasts a enabled change channel event.
*/
public void setEnabled( boolean enabled, boolean fireChannelEvent )
{
setEnabled( enabled );
if( fireChannelEvent )
{
if( enabled )
{
fireChannelEvent( Event.CHANNEL_ENABLED );
}
else
{
fireChannelEvent( Event.CHANNEL_DISABLED );
}
}
}
/** /**
* Returns the alias list that is used by this channel for looking up alias * Returns the alias list that is used by this channel for looking up alias
@@ -485,22 +402,6 @@ public class Channel extends Configuration
{ {
mAliasListName = name; mAliasListName = name;
} }
/**
* Sets the alias list to be used for looking up the alias values for the
* various identifiers produced by the decoder. This method is the same
* as setAliasName(name) and optionally broadcasts an alias list change
* channel event.
*/
public void setAliasListName( String name, boolean fireChangeEvent )
{
mAliasListName = name;
if( fireChangeEvent )
{
fireChannelEvent( Event.CHANGE_ALIAS_LIST );
}
}
/** /**
* Gets the decoder configuration used by this channel * Gets the decoder configuration used by this channel
@@ -536,21 +437,6 @@ public class Channel extends Configuration
mAuxDecodeConfiguration = config; mAuxDecodeConfiguration = config;
} }
/**
* Sets the decoder configuration used by this channel and optionally
* broadcasts a decoder change channel event.
*/
public void setDecodeConfiguration( DecodeConfiguration config,
boolean fireChangeEvent )
{
setDecodeConfiguration( config );
if( fireChangeEvent )
{
fireChannelEvent( Event.CHANGE_DECODER );
}
}
/** /**
* Returns the source configuration for this channel. * Returns the source configuration for this channel.
*/ */
@@ -568,21 +454,6 @@ public class Channel extends Configuration
mSourceConfiguration = config; mSourceConfiguration = config;
} }
/**
* Sets the source configuration for this channel and optionally broadcasts
* a source change channel event.
*/
public void setSourceConfiguration( SourceConfiguration config,
boolean fireChangeEvent )
{
setSourceConfiguration( config );
if( fireChangeEvent )
{
fireChannelEvent( Event.CHANGE_SOURCE );
}
}
/** /**
* Returns the event logger configuration for this channel. * Returns the event logger configuration for this channel.
*/ */
@@ -600,21 +471,6 @@ public class Channel extends Configuration
mEventLogConfiguration = config; mEventLogConfiguration = config;
} }
/**
* Sets the event logger configuration for this channel and optionally
* broadcasts an event logger change channel event.
*/
public void setEventLogConfiguration( EventLogConfiguration config,
boolean fireChangeEvent )
{
setEventLogConfiguration( config );
if( fireChangeEvent )
{
fireChannelEvent( Event.CHANGE_EVENT_LOGGER );
}
}
/** /**
* Returns the recorder configuration for this channel. * Returns the recorder configuration for this channel.
*/ */
@@ -632,21 +488,6 @@ public class Channel extends Configuration
mRecordConfiguration = config; mRecordConfiguration = config;
} }
/**
* Sets the recorder configuration for this channel and optionally broadcasts
* a recorder configuration change channel event.
*/
public void setRecordConfiguration( RecordConfiguration config,
boolean fireChangeEvent )
{
setRecordConfiguration( config );
if( fireChangeEvent )
{
fireChannelEvent( Event.CHANGE_RECORDER );
}
}
/** /**
* Returns the name of this channel. * Returns the name of this channel.
*/ */
@@ -664,20 +505,6 @@ public class Channel extends Configuration
mName = name; mName = name;
} }
/**
* Sets the name of this channel and optionally broadcasts a name change
* channel event.
*/
public void setName( String name, boolean fireChangeEvent )
{
mName = name;
if( fireChangeEvent )
{
fireChannelEvent( Event.CHANGE_NAME );
}
}
/** /**
* Responds to changes in the enabled setting by starting the processing * Responds to changes in the enabled setting by starting the processing
* change if the channel is now enabled, or stopping the procesing chain * change if the channel is now enabled, or stopping the procesing chain
@@ -709,8 +536,6 @@ public class Channel extends Configuration
setup(); setup();
mProcessingChain.start(); mProcessingChain.start();
fireChannelEvent( Event.CHANNEL_PROCESSING_STARTED );
} }
catch( SourceException se ) catch( SourceException se )
{ {
@@ -837,13 +662,6 @@ public class Channel extends Configuration
mProcessingChain.addAudioPacketListener( mProcessingChain.addAudioPacketListener(
mResourceManager.getAudioManager() ); mResourceManager.getAudioManager() );
/* Add system-wide message listeners */
mProcessingChain.addMessageListeners(
mResourceManager.getChannelManager().getMessageListeners() );
/* Add individual message listeners */
mProcessingChain.addMessageListeners( mMessageListeners );
/* Create the call event model to receive call events */ /* Create the call event model to receive call events */
mCallEventModel = new CallEventModel(); mCallEventModel = new CallEventModel();
mProcessingChain.addCallEventListener( mCallEventModel ); mProcessingChain.addCallEventListener( mCallEventModel );
@@ -855,9 +673,9 @@ public class Channel extends Configuration
/* Inject channel metadata that will be inserted into audio packets /* Inject channel metadata that will be inserted into audio packets
* for the recorder manager and streaming */ * for the recorder manager and streaming */
mProcessingChain.broadcast( mProcessingChain.broadcast(
new Metadata( MetadataType.SYSTEM, mSystem.getName() ) ); new Metadata( MetadataType.SYSTEM, mSystem ) );
mProcessingChain.broadcast( mProcessingChain.broadcast(
new Metadata( MetadataType.SITE_ID, mSite.getName() ) ); new Metadata( MetadataType.SITE_ID, mSite ) );
mProcessingChain.broadcast( mProcessingChain.broadcast(
new Metadata( MetadataType.CHANNEL_NAME, mName ) ); new Metadata( MetadataType.CHANNEL_NAME, mName ) );
} }
@@ -914,86 +732,6 @@ public class Channel extends Configuration
} }
} }
/**
* Broadcasts a channel change event to all registered listeners
*/
public void fireChannelEvent( Event event )
{
ChannelEvent channelEvent = new ChannelEvent( this, event );
for( ChannelEventListener listener: mChannelListeners )
{
listener.channelChanged( channelEvent );
}
/* Send event to processing chain so modules can respond to channel
* selection events */
if( mProcessingChain != null )
{
mProcessingChain.getChannelEventListener().receive( channelEvent );
}
}
/**
* Adds a channel listener to receive all channel events from this channel
* and automatically sends the listener a channel add event.
*/
public void addListener( ChannelEventListener listener )
{
if( !mChannelListeners.contains( listener ) )
{
mChannelListeners.add( listener );
listener.channelChanged(
new ChannelEvent( this, Event.CHANNEL_ADDED ) );
}
else
{
mLog.error( "Channel - attempt to add already existing channel "
+ "listener [" + listener.getClass() + "]" );
}
}
/**
* Adds a list of channel listeners to receive all channel events from this
* channel and automatically sends each one a channel add event.
*/
public void addListeners( List<ChannelEventListener> listeners )
{
for( ChannelEventListener listener: listeners )
{
addListener( listener );
}
}
/**
* Removes a channel listener from receiving channel events from this channel
*/
public void removeListener( ChannelEventListener listener )
{
mChannelListeners.remove( listener );
}
public void addListener( Listener<Message> listener )
{
mMessageListeners.add( listener );
if( isProcessing() )
{
mProcessingChain.addMessageListener( listener );
}
}
public void removeListener( Listener<Message> listener )
{
mMessageListeners.remove( listener );
if( mProcessingChain != null )
{
mProcessingChain.removeMessageListener( listener );
}
}
/** /**
* Indicates if any part of this channel is contained within the * Indicates if any part of this channel is contained within the
* minimum and maximum frequency values. * minimum and maximum frequency values.
@@ -1005,35 +743,4 @@ public class Channel extends Configuration
return tunerChannel != null && return tunerChannel != null &&
tunerChannel.overlaps( minimum, maximum ); tunerChannel.overlaps( minimum, maximum );
} }
public void addTrafficChannel( String channelID, Channel channel )
{
mTrafficChannels.put( channelID, channel );
}
public boolean hasTrafficChannel( Channel channel )
{
return mTrafficChannels.containsValue( channel );
}
public void removeTrafficChannel( Channel channel )
{
String name = channel.getChannelDisplayName();
if( mTrafficChannels.containsKey( name ) )
{
mTrafficChannels.remove( name );
}
}
public Collection<Channel> getTrafficChannels()
{
return Collections.unmodifiableCollection( mTrafficChannels.values() );
}
public boolean hasTrafficChannel( String name )
{
return mTrafficChannels.containsKey( name );
}
} }

View File

@@ -200,14 +200,14 @@ public class ChannelEditor extends Editor implements ActionListener
mEventLogEditor.save(); mEventLogEditor.save();
mRecordEditor.save(); mRecordEditor.save();
mChannelNode.getChannel().setName( mChannelName.getText(), false ); mChannelNode.getChannel().setName( mChannelName.getText() );
mChannelNode.getChannel().setEnabled( mChannelEnabled.isSelected(), false ); mChannelNode.getChannel().setEnabled( mChannelEnabled.isSelected() );
AliasList selected = mComboAliasLists.getItemAt( AliasList selected = mComboAliasLists.getItemAt(
mComboAliasLists.getSelectedIndex() ); mComboAliasLists.getSelectedIndex() );
if( selected != null ) if( selected != null )
{ {
mChannelNode.getChannel().setAliasListName( selected.getName(), false ); mChannelNode.getChannel().setAliasListName( selected.getName() );
} }

View File

@@ -1,3 +1,20 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014,2015 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package controller.channel; package controller.channel;
public class ChannelEvent public class ChannelEvent
@@ -27,33 +44,33 @@ public class ChannelEvent
} }
/** /**
* Channel Events - used to specify channel events and changes to channel * Channel events to describe the specific event
* configurations and settings.
*/ */
public enum Event public enum Event
{ {
CHANGE_ALIAS_LIST, //Channel is added
CHANGE_DECODER, NOTIFICATION_ADD,
CHANGE_EVENT_LOGGER, //Channel configuration has changed
CHANGE_NAME, NOTIFICATION_CONFIGURATION_CHANGE,
CHANGE_SELECTED, //Channel is deleted/removed
CHANGE_SITE, NOTIFICATION_DELETE,
CHANGE_RECORDER, //Channel enable request was rejected
CHANGE_SOURCE, NOTIFICATION_ENABLE_REJECTED,
CHANGE_SYSTEM, //Channel has started processing/decoding
NOTIFICATION_PROCESSING_START,
CHANNEL_ADDED, //Channel has stopped processing/decoding
CHANNEL_DELETED, NOTIFICATION_PROCESSING_STOP,
//Channel's selection state has changed
CHANNEL_ENABLED, NOTIFICATION_SELECTION_CHANGE,
CHANNEL_DISABLED, //Channel's channel-state has been reset
NOTIFICATION_STATE_RESET,
CHANNEL_PROCESSING_STARTED, //Request to deselect the channel
CHANNEL_PROCESSING_STOPPED, REQUEST_DESELECT,
//Request to disable a channel - response will be a PROCESSING_STOP_NOTIFICATION
CHANNEL_STATE_RESET, REQUEST_DISABLE,
//Request to enable a channel - response will be a PROCESSING_START_NOTIFICATION
TRAFFIC_CHANNEL_ADDED, REQUEST_ENABLE,
TRAFFIC_CHANNEL_DELETED; //Request to select the channel
REQUEST_SELECT;
} }
} }

View File

@@ -1,6 +1,6 @@
/******************************************************************************* /*******************************************************************************
* SDR Trunk * SDR Trunk
* Copyright (C) 2014 Dennis Sheirer * Copyright (C) 2014-2016 Dennis Sheirer
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@@ -1,143 +0,0 @@
/*******************************************************************************
* SDR Trunk
* Copyright (C) 2014,2015 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
******************************************************************************/
package controller.channel;
import java.util.ArrayList;
import java.util.List;
import message.Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sample.Listener;
import alias.action.AliasActionManager;
import controller.ResourceManager;
public class ChannelManager implements ChannelEventListener
{
private final static Logger mLog = LoggerFactory.getLogger( ChannelManager.class );
private List<Channel> mChannels = new ArrayList<>();
private List<ChannelEventListener> mChannelListeners = new ArrayList<>();
private List<Listener<Message>> mMessageListeners = new ArrayList<>();
private AliasActionManager mAliasActionManager;
public ChannelManager( ResourceManager resourceManager )
{
mAliasActionManager = new AliasActionManager( resourceManager );
mChannelListeners.add( this );
/* Add alias action manager as listener to all channels/messages */
mMessageListeners.add( mAliasActionManager );
}
/**
* Notification that a channel has been added or deleted, so that we can
* keep track of all channels and manage system-wide listeners for each
* of those channels
*/
@SuppressWarnings( "incomplete-switch" )
@Override
public void channelChanged( ChannelEvent event )
{
switch( event.getEvent() )
{
case CHANNEL_ADDED:
if( !mChannels.contains( event.getChannel() ) )
{
mChannels.add( event.getChannel() );
}
break;
case CHANNEL_DELETED:
mChannels.remove( event.getChannel() );
break;
}
}
/**
* Adds a channel listener that will be added to all channels to receive
* any channel change events. This listener will automatically receive
* a channel add event as it is added to each of the existing channels.
*/
public void addListener( ChannelEventListener listener )
{
mChannelListeners.add( listener );
for( Channel channel: mChannels )
{
channel.addListener( listener );
}
}
public List<Channel> getChannels()
{
return mChannels;
}
/**
* Removes a channel listener from being automatically added to all channels
* to receive channel change events.
*/
public void removeListener( ChannelEventListener listener )
{
mChannelListeners.remove( listener );
for( Channel channel: mChannels )
{
channel.removeListener( listener );
}
}
/**
* Returns the list of channel change listeners that will be automatically
* added to all channels to receive channel change events
*/
public List<ChannelEventListener> getChannelListeners()
{
return mChannelListeners;
}
/**
* Returns the list of channel change listeners that will be automatically
* added to all channels to receive channel change events
*/
public List<Listener<Message>> getMessageListeners()
{
return mMessageListeners;
}
/**
* Adds a message listener that will be added to all channels to receive
* any messages.
*/
public void addListener( Listener<Message> listener )
{
mMessageListeners.add( listener );
}
/**
* Removes a message listener.
*/
public void removeListener( Listener<Message> listener )
{
mMessageListeners.remove( listener );
}
}

View File

@@ -56,18 +56,18 @@ public class ChannelNode extends ConfigurableNode implements ChannelEventListene
if( siteNode != null ) if( siteNode != null )
{ {
getChannel().setSite( siteNode.getSite(), false ); getChannel().setSite( siteNode.getSite().getName() );
SystemNode systemNode = (SystemNode)siteNode.getParent(); SystemNode systemNode = (SystemNode)siteNode.getParent();
if( systemNode != null ) if( systemNode != null )
{ {
getChannel().setSystem( systemNode.getSystem(), false ); getChannel().setSystem( systemNode.getSystem().getName() );
} }
} }
/* Add this node as listener to receive changes from underlying channel */ /* Add this node as listener to receive changes from underlying channel */
getChannel().addListener( this ); // getChannel().addListener( this );
/* Add the resource manager to the channel so that the channel /* Add the resource manager to the channel so that the channel
* can provide channel change events to all system resources */ * can provide channel change events to all system resources */
@@ -83,19 +83,13 @@ public class ChannelNode extends ConfigurableNode implements ChannelEventListene
switch( event.getEvent() ) switch( event.getEvent() )
{ {
/* Refresh the node for each of these events */ /* Refresh the node for each of these events */
case CHANGE_DECODER: case NOTIFICATION_SELECTION_CHANGE:
case CHANGE_NAME: case NOTIFICATION_PROCESSING_START:
case CHANGE_SELECTED: case NOTIFICATION_PROCESSING_STOP:
case CHANGE_SITE:
case CHANGE_SYSTEM:
case CHANNEL_ENABLED:
case CHANNEL_DISABLED:
case CHANNEL_PROCESSING_STARTED:
case CHANNEL_PROCESSING_STOPPED:
this.refresh(); this.refresh();
break; break;
/* We're being deleted, so cleanup */ /* We're being deleted, so cleanup */
case CHANNEL_DELETED: case NOTIFICATION_DELETE:
delete(); delete();
break; break;
default: default:

View File

@@ -39,7 +39,7 @@ public class ChannelUtils
@Override @Override
public void actionPerformed( ActionEvent e ) public void actionPerformed( ActionEvent e )
{ {
channel.setEnabled( DISABLED, BROADCAST_CHANGE ); channel.setEnabled( DISABLED );
if( playlistManager != null ) if( playlistManager != null )
{ {
@@ -82,7 +82,7 @@ public class ChannelUtils
@Override @Override
public void actionPerformed( ActionEvent e ) public void actionPerformed( ActionEvent e )
{ {
channel.setEnabled( ENABLED, BROADCAST_CHANGE ); channel.setEnabled( ENABLED );
if( playlistManager != null ) if( playlistManager != null )
{ {
@@ -109,10 +109,10 @@ public class ChannelUtils
if( response == JOptionPane.YES_OPTION ) if( response == JOptionPane.YES_OPTION )
{ {
/* Disable the channel */ /* Disable the channel */
channel.setEnabled( DISABLED, BROADCAST_CHANGE ); channel.setEnabled( DISABLED );
/* Broadcast channel deleted event */ /* Broadcast channel deleted event */
channel.fireChannelEvent( Event.CHANNEL_DELETED ); // channel.fireChannelEvent( Event.NOTIFICATION_DELETE );
if( playlistManager != null ) if( playlistManager != null )
{ {

View File

@@ -125,8 +125,8 @@ public class SiteNode extends ConfigurableNode
System system = ((SystemNode)getParent()).getSystem(); System system = ((SystemNode)getParent()).getSystem();
Channel channel = new Channel(); Channel channel = new Channel();
channel.setSystem( system, false ); channel.setSystem( system.getName() );
channel.setSite( getSite(), false ); channel.setSite( getSite().getName() );
getSite().addChannel( channel ); getSite().addChannel( channel );

View File

@@ -5,6 +5,7 @@ import java.text.NumberFormat;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import controller.channel.Channel.ChannelType;
import controller.channel.ChannelEvent; import controller.channel.ChannelEvent;
import controller.channel.ChannelEventListener; import controller.channel.ChannelEventListener;
@@ -46,33 +47,40 @@ public class ChannelMemoryLogger implements Runnable, ChannelEventListener
{ {
switch( event.getEvent() ) switch( event.getEvent() )
{ {
case CHANNEL_ADDED: case NOTIFICATION_ADD:
mChannelCount++; if( event.getChannel().getChannelType() == ChannelType.TRAFFIC )
{
mTrafficChannelCount++;
}
else
{
mChannelCount++;
}
break; break;
case CHANNEL_DELETED: case NOTIFICATION_DELETE:
mChannelCount--; if( event.getChannel().getChannelType() == ChannelType.TRAFFIC )
{
mTrafficChannelCount--;
}
else
{
mChannelCount--;
}
break; break;
case CHANNEL_DISABLED: case REQUEST_DISABLE:
break; break;
case CHANNEL_ENABLED: case REQUEST_ENABLE:
break; break;
case CHANNEL_PROCESSING_STARTED: case NOTIFICATION_PROCESSING_START:
mChannelProcessingCount++; mChannelProcessingCount++;
break; break;
case CHANNEL_PROCESSING_STOPPED: case NOTIFICATION_PROCESSING_STOP:
mChannelProcessingCount--; mChannelProcessingCount--;
break; break;
case CHANNEL_STATE_RESET: case NOTIFICATION_STATE_RESET:
break;
case TRAFFIC_CHANNEL_ADDED:
mTrafficChannelCount++;
break;
case TRAFFIC_CHANNEL_DELETED:
mTrafficChannelCount--;
break; break;
default: default:
break; break;
} }
} }
} }

View File

@@ -56,6 +56,7 @@ import source.tuner.Tuner;
import source.tuner.TunerSelectionListener; import source.tuner.TunerSelectionListener;
import spectrum.SpectralDisplayPanel; import spectrum.SpectralDisplayPanel;
import util.TimeStamp; import util.TimeStamp;
import alias.action.AliasActionManager;
import audio.AudioManager; import audio.AudioManager;
import com.jidesoft.swing.JideSplitPane; import com.jidesoft.swing.JideSplitPane;
@@ -63,9 +64,12 @@ import com.jidesoft.swing.JideSplitPane;
import controller.ConfigurationControllerModel; import controller.ConfigurationControllerModel;
import controller.ControllerPanel; import controller.ControllerPanel;
import controller.ResourceManager; import controller.ResourceManager;
import controller.ThreadPoolManager;
import controller.ThreadPoolManager.ThreadType; import controller.ThreadPoolManager.ThreadType;
import controller.channel.ChannelEventListener; import controller.channel.ChannelEventListener;
import controller.channel.ChannelManager; import controller.channel.ChannelModel;
import controller.channel.ChannelProcessingManager;
import controller.channel.ChannelSelectionManager;
public class SDRTrunk public class SDRTrunk
{ {
@@ -104,27 +108,48 @@ public class SDRTrunk
//Log current properties setting //Log current properties setting
SystemProperties.getInstance().logCurrentSettings(); SystemProperties.getInstance().logCurrentSettings();
ChannelModel channelModel = new ChannelModel();
ChannelProcessingManager channelProcessingManager =
new ChannelProcessingManager( channelModel );
channelModel.addListener( channelProcessingManager );
ThreadPoolManager threadPoolManager = new ThreadPoolManager();
AliasActionManager aliasActionManager = new AliasActionManager( threadPoolManager );
channelProcessingManager.addListener( aliasActionManager );
ChannelSelectionManager channelSelectionManager =
new ChannelSelectionManager( channelModel );
channelModel.addListener( channelSelectionManager );
/** /**
* Construct the resource manager now, so that it can use the system * Construct the resource manager now, so that it can use the system
* properties that were just loaded * properties that were just loaded
*/ */
ResourceManager resource = new ResourceManager();
//TODO: get rid of resource manager ... below is start of breaking out //TODO: get rid of resource manager ... below is start of breaking out
//the encapsulated pieces from the resource manager //the encapsulated pieces from the resource manager
PlaylistManager playlistManager = new PlaylistManager( channelModel );
ResourceManager resource =
new ResourceManager( playlistManager, threadPoolManager, channelModel );
AudioManager audio = resource.getAudioManager(); AudioManager audio = resource.getAudioManager();
ChannelManager channel = resource.getChannelManager(); ConfigurationControllerModel configurationControllerModel = resource.getController();
ConfigurationControllerModel controller = resource.getController();
MapService map = resource.getMapService(); MapService map = resource.getMapService();
PlaylistManager playlist = resource.getPlaylistManager();
SettingsManager settings = resource.getSettingsManager(); SettingsManager settings = resource.getSettingsManager();
mControllerPanel = new ControllerPanel( audio, controller, channel, mControllerPanel =
map, playlist, settings ); new ControllerPanel( audio,
configurationControllerModel,
channelModel,
channelProcessingManager,
map,
playlistManager,
settings );
mSpectralPanel = new SpectralDisplayPanel( channel, controller, mSpectralPanel = new SpectralDisplayPanel( channelModel,
playlist, settings ); configurationControllerModel, playlistManager, settings );
mTitle = getTitle(); mTitle = getTitle();
@@ -136,7 +161,7 @@ public class SDRTrunk
if( mLogChannelAndMemoryUsage ) if( mLogChannelAndMemoryUsage )
{ {
Runnable cml = new ChannelMemoryLogger(); Runnable cml = new ChannelMemoryLogger();
resource.getChannelManager().addListener( (ChannelEventListener)cml ); channelModel.addListener( (ChannelEventListener)cml );
resource.getThreadPoolManager().scheduleFixedRate( resource.getThreadPoolManager().scheduleFixedRate(
ThreadType.DECODER, cml, 5, TimeUnit.SECONDS ); ThreadType.DECODER, cml, 5, TimeUnit.SECONDS );
} }

View File

@@ -11,15 +11,18 @@ import javax.swing.JInternalFrame;
import module.decode.DecodeComponentEditor; import module.decode.DecodeComponentEditor;
import module.decode.config.DecodeConfiguration; import module.decode.config.DecodeConfiguration;
import net.miginfocom.swing.MigLayout; import net.miginfocom.swing.MigLayout;
import playlist.PlaylistManager;
import source.IControllableFileSource; import source.IControllableFileSource;
import controller.ResourceManager; import controller.ResourceManager;
import controller.ThreadPoolManager;
import controller.channel.ChannelModel;
public class DecoderSelectionFrame extends JInternalFrame public class DecoderSelectionFrame extends JInternalFrame
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private DecodeComponentEditor mDecodeEditor = new DecodeComponentEditor( null ); private DecodeComponentEditor mDecodeEditor = new DecodeComponentEditor( null );
private ResourceManager mResourceManager = new ResourceManager(); private ResourceManager mResourceManager;
private IControllableFileSource mSource; private IControllableFileSource mSource;
private JDesktopPane mDesktop; private JDesktopPane mDesktop;
@@ -27,6 +30,11 @@ public class DecoderSelectionFrame extends JInternalFrame
public DecoderSelectionFrame( JDesktopPane desktop, public DecoderSelectionFrame( JDesktopPane desktop,
IControllableFileSource source ) IControllableFileSource source )
{ {
ChannelModel channelModel = new ChannelModel();
mResourceManager = new ResourceManager( new PlaylistManager( channelModel ),
new ThreadPoolManager(), channelModel );
mDesktop = desktop; mDesktop = desktop;
mSource = source; mSource = source;

View File

@@ -108,8 +108,8 @@ public class DecoderViewFrame extends JInternalFrame
recordConfig, recordConfig,
auxConfig, auxConfig,
aliasList, aliasList,
new System( "Instrumented" ), "Instrumented",
new Site( "Instrumented" ), "Instrumented",
"Channel Name" ); "Channel Name" );
mProcessingChain.addModules( modules ); mProcessingChain.addModules( modules );

View File

@@ -35,7 +35,7 @@ import org.jdesktop.swingx.mapviewer.TileFactoryInfo;
import sample.Listener; import sample.Listener;
import settings.MapViewSetting; import settings.MapViewSetting;
import settings.SettingsManager; import settings.SettingsManager;
import controller.channel.ChannelManager; import controller.channel.ChannelProcessingManager;
public class MapPanel extends JPanel implements PlottableUpdateListener public class MapPanel extends JPanel implements PlottableUpdateListener
{ {
@@ -48,14 +48,14 @@ public class MapPanel extends JPanel implements PlottableUpdateListener
public MapPanel( MapService mapService, public MapPanel( MapService mapService,
SettingsManager settingsManager, SettingsManager settingsManager,
ChannelManager channelManager ) ChannelProcessingManager channelProcessingManager )
{ {
mSettingsManager = settingsManager; mSettingsManager = settingsManager;
mMapService = mapService; mMapService = mapService;
mMapPainter = new PlottableEntityPainter( mSettingsManager ); mMapPainter = new PlottableEntityPainter( mSettingsManager );
/* Add Map Service as message listener to receive all messages */ /* Add Map Service as message listener to receive all messages */
channelManager.addListener( (Listener<Message>)mMapService ); channelProcessingManager.addListener( (Listener<Message>)mMapService );
init(); init();
} }

View File

@@ -156,7 +156,7 @@ public class DecodeComponentEditor extends AbstractChannelEditor
//The component that calls save will invoke the change broadcast //The component that calls save will invoke the change broadcast
mChannelNode.getChannel() mChannelNode.getChannel()
.setDecodeConfiguration( mEditor.getConfig(), false ); .setDecodeConfiguration( mEditor.getConfig() );
} }
/** /**

View File

@@ -135,8 +135,8 @@ public class DecoderFactory
RecordConfiguration recordConfig, RecordConfiguration recordConfig,
AuxDecodeConfiguration auxConfig, AuxDecodeConfiguration auxConfig,
AliasList aliasList, AliasList aliasList,
System system, String system,
Site site, String site,
String channelName ) String channelName )
{ {
List<Module> modules = getPrimaryModules( channelType, decodeConfig, List<Module> modules = getPrimaryModules( channelType, decodeConfig,
@@ -176,8 +176,8 @@ public class DecoderFactory
DecodeConfiguration decodeConfig, DecodeConfiguration decodeConfig,
RecordConfiguration recordConfig, RecordConfiguration recordConfig,
AliasList aliasList, AliasList aliasList,
System system, String system,
Site site, String site,
String channelName, String channelName,
ResourceManager resourceManager ) ResourceManager resourceManager )
{ {

View File

@@ -62,7 +62,7 @@ public class CallEventPanel extends JPanel implements ChannelEventListener
@Override @Override
public void channelChanged( final ChannelEvent event ) public void channelChanged( final ChannelEvent event )
{ {
if( event.getEvent() == Event.CHANGE_SELECTED && if( event.getEvent() == Event.NOTIFICATION_SELECTION_CHANGE &&
event.getChannel().isSelected() ) event.getChannel().isSelected() )
{ {
if( mDisplayedChannel == null || if( mDisplayedChannel == null ||
@@ -99,8 +99,8 @@ public class CallEventPanel extends JPanel implements ChannelEventListener
} }
} }
else if( event.getEvent() == Event.CHANNEL_PROCESSING_STOPPED || else if( event.getEvent() == Event.NOTIFICATION_PROCESSING_STOP ||
event.getEvent() == Event.CHANNEL_DISABLED ) event.getEvent() == Event.REQUEST_DISABLE )
{ {
if( mDisplayedChannel != null && if( mDisplayedChannel != null &&
mDisplayedChannel == event.getChannel() ) mDisplayedChannel == event.getChannel() )

View File

@@ -82,7 +82,7 @@ public class MessageActivityPanel extends JPanel implements ChannelEventListener
{ {
boolean changed = false; boolean changed = false;
if( event.getEvent() == Event.CHANGE_SELECTED && if( event.getEvent() == Event.NOTIFICATION_SELECTION_CHANGE &&
event.getChannel().isSelected() ) event.getChannel().isSelected() )
{ {
if( mDisplayedChannel == null || if( mDisplayedChannel == null ||
@@ -105,8 +105,8 @@ public class MessageActivityPanel extends JPanel implements ChannelEventListener
changed = true; changed = true;
} }
} }
else if( event.getEvent() == Event.CHANNEL_PROCESSING_STOPPED || else if( event.getEvent() == Event.NOTIFICATION_PROCESSING_STOP ||
event.getEvent() == Event.CHANNEL_DISABLED ) event.getEvent() == Event.REQUEST_DISABLE )
{ {
if( mDisplayedChannel != null && if( mDisplayedChannel != null &&
mDisplayedChannel == event.getChannel() ) mDisplayedChannel == event.getChannel() )

View File

@@ -232,10 +232,10 @@ public class P25AudioModule extends Module implements Listener<Message>,
{ {
switch( event.getEvent() ) switch( event.getEvent() )
{ {
case CHANNEL_STATE_RESET: case NOTIFICATION_STATE_RESET:
mAudioMetadata.reset(); mAudioMetadata.reset();
break; break;
case CHANGE_SELECTED: case NOTIFICATION_SELECTION_CHANGE:
mAudioMetadata.setSelected( event.getChannel().isSelected() ); mAudioMetadata.setSelected( event.getChannel().isSelected() );
break; break;
default: default:

View File

@@ -81,10 +81,10 @@ public class ChannelList extends JPanel implements ChannelEventListener
{ {
switch( event.getEvent() ) switch( event.getEvent() )
{ {
case CHANNEL_PROCESSING_STARTED: case NOTIFICATION_PROCESSING_START:
addChannelPanel( event.getChannel() ); addChannelPanel( event.getChannel() );
break; break;
case CHANNEL_PROCESSING_STOPPED: case NOTIFICATION_PROCESSING_STOP:
removeChannelPanel( event.getChannel() ); removeChannelPanel( event.getChannel() );
break; break;
default: default:

View File

@@ -111,12 +111,12 @@ public class ChannelStatePanel extends JPanel
setLayout( new MigLayout( "insets 1 1 1 1", "[grow,fill]", "[]0[]0[]") ); setLayout( new MigLayout( "insets 1 1 1 1", "[grow,fill]", "[]0[]0[]") );
mSystemLabel = new JLabel( mChannel.getSystem().getName() ); mSystemLabel = new JLabel( mChannel.getSystem() );
mSystemLabel.setFont( mFontDetails ); mSystemLabel.setFont( mFontDetails );
mSystemLabel.setForeground( mColorLabelDetails ); mSystemLabel.setForeground( mColorLabelDetails );
add( mSystemLabel ); add( mSystemLabel );
mSiteLabel = new JLabel( mChannel.getSite().getName() ); mSiteLabel = new JLabel( mChannel.getSite() );
mSiteLabel.setFont( mFontDetails ); mSiteLabel.setFont( mFontDetails );
mSiteLabel.setForeground( mColorLabelDetails ); mSiteLabel.setForeground( mColorLabelDetails );
add( mSiteLabel ); add( mSiteLabel );

View File

@@ -15,7 +15,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import record.config.RecordConfiguration; import record.config.RecordConfiguration;
import sample.Broadcaster;
import sample.Listener; import sample.Listener;
import source.config.SourceConfigTuner; import source.config.SourceConfigTuner;
import source.tuner.TunerChannel; import source.tuner.TunerChannel;
@@ -44,8 +43,8 @@ public class TrafficChannelManager extends Module
private DecodeConfiguration mDecodeConfiguration; private DecodeConfiguration mDecodeConfiguration;
private RecordConfiguration mRecordConfiguration; private RecordConfiguration mRecordConfiguration;
private ResourceManager mResourceManager; private ResourceManager mResourceManager;
private System mSystem; private String mSystem;
private Site mSite; private String mSite;
private String mAliasListName; private String mAliasListName;
private long mTrafficChannelTimeout; private long mTrafficChannelTimeout;
private CallEvent mPreviousDoNotMonitorCallEvent; private CallEvent mPreviousDoNotMonitorCallEvent;
@@ -72,8 +71,8 @@ public class TrafficChannelManager extends Module
public TrafficChannelManager( ResourceManager resourceManager, public TrafficChannelManager( ResourceManager resourceManager,
DecodeConfiguration decodeConfiguration, DecodeConfiguration decodeConfiguration,
RecordConfiguration recordConfiguration, RecordConfiguration recordConfiguration,
System system, String system,
Site site, String site,
String aliasListName, String aliasListName,
long trafficChannelTimeout, long trafficChannelTimeout,
int trafficChannelPoolSize ) int trafficChannelPoolSize )
@@ -145,8 +144,8 @@ public class TrafficChannelManager extends Module
{ {
channel.setSourceConfiguration( new SourceConfigTuner( tunerChannel ) ); channel.setSourceConfiguration( new SourceConfigTuner( tunerChannel ) );
channel.setSystem( mSystem, false ); channel.setSystem( mSystem );
channel.setSite( mSite, false ); channel.setSite( mSite );
channel.setName( channelNumber ); channel.setName( channelNumber );
channel.setEnabled( true ); channel.setEnabled( true );
@@ -160,8 +159,8 @@ public class TrafficChannelManager extends Module
{ {
channel.setEnabled( false ); channel.setEnabled( false );
channel.setSystem( mSystem, false ); channel.setSystem( mSystem );
channel.setSite( mSite, false ); channel.setSite( mSite );
channel.setName( "Traffic" ); channel.setName( "Traffic" );
} }
} }
@@ -399,7 +398,7 @@ public class TrafficChannelManager extends Module
mTrafficChannelsInUse.remove( channelNumber ); mTrafficChannelsInUse.remove( channelNumber );
/* Disable the channel and broadcast a notification */ /* Disable the channel and broadcast a notification */
channel.setEnabled( false, true ); channel.setEnabled( false );
} }
} }
} }

View File

@@ -17,15 +17,20 @@
******************************************************************************/ ******************************************************************************/
package playlist; package playlist;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlSeeAlso;
import alias.AliasDirectory; import alias.AliasDirectory;
import controller.channel.Channel;
import controller.channel.map.ChannelMapList; import controller.channel.map.ChannelMapList;
import controller.system.SystemList; import controller.system.SystemList;
@XmlSeeAlso( { AliasDirectory.class, @XmlSeeAlso( { AliasDirectory.class,
Channel.class,
ChannelMapList.class, ChannelMapList.class,
SystemList.class } ) SystemList.class } )
@@ -35,11 +40,23 @@ public class Playlist
private AliasDirectory mAliasDirectory = new AliasDirectory(); private AliasDirectory mAliasDirectory = new AliasDirectory();
private ChannelMapList mChannelMapList = new ChannelMapList(); private ChannelMapList mChannelMapList = new ChannelMapList();
private SystemList mSystemList = new SystemList(); private SystemList mSystemList = new SystemList();
private List<Channel> mChannels = new ArrayList<>();
public Playlist() public Playlist()
{ {
} }
@XmlElement( name = "channel" )
public List<Channel> getChannels()
{
return mChannels;
}
public void setChannels( List<Channel> channels )
{
mChannels = channels;
}
@XmlElement( name = "alias_directory" ) @XmlElement( name = "alias_directory" )
public AliasDirectory getAliasDirectory() public AliasDirectory getAliasDirectory()
{ {
@@ -64,6 +81,13 @@ public class Playlist
mSystemList = list; mSystemList = list;
} }
public boolean hasSystemList()
{
return mSystemList != null &&
mSystemList.getSystem() != null &&
!mSystemList.getSystem().isEmpty();
}
@XmlElement( name = "channel_maps" ) @XmlElement( name = "channel_maps" )
public ChannelMapList getChannelMapList() public ChannelMapList getChannelMapList()
{ {

View File

@@ -35,6 +35,10 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import properties.SystemProperties; import properties.SystemProperties;
import controller.channel.Channel;
import controller.channel.ChannelModel;
import controller.site.Site;
import controller.system.SystemList;
public class PlaylistManager public class PlaylistManager
{ {
@@ -43,8 +47,11 @@ public class PlaylistManager
private Playlist mPlaylist = new Playlist(); private Playlist mPlaylist = new Playlist();
public PlaylistManager() private ChannelModel mChannelModel;
public PlaylistManager( ChannelModel channelModel )
{ {
mChannelModel = channelModel;
init(); init();
} }
@@ -52,6 +59,15 @@ public class PlaylistManager
{ {
return mPlaylist; return mPlaylist;
} }
/**
* Transfers data from persisted playlist into system models
*/
private void transferPlaylistToModels()
{
//Load channels
mChannelModel.addChannels( mPlaylist.getChannels() );
}
/** /**
* Loads playlist from the current playlist file, or the default playlist file, * Loads playlist from the current playlist file, or the default playlist file,
@@ -70,6 +86,8 @@ public class PlaylistManager
props.get( "playlist.currentfilename", defaultPlaylistFile ); props.get( "playlist.currentfilename", defaultPlaylistFile );
load( playlistFolder.resolve( playlistFile ) ); load( playlistFolder.resolve( playlistFile ) );
transferPlaylistToModels();
} }
@@ -205,5 +223,44 @@ public class PlaylistManager
{ {
mPlaylist = new Playlist(); mPlaylist = new Playlist();
} }
//Check for and convert from legacy play list format
if( mPlaylist.hasSystemList() )
{
convertPlaylistFormat();
}
}
/**
* Converts playlist data over to new format
*/
private void convertPlaylistFormat()
{
mLog.info( "Legacy playlist format detected - converting ..." );
//Playlist version 1 to version 2 format conversion. In order to keep
//backwards compatibility, transfer all of the System-Site-Channel
//objects over to the new channel list format
SystemList systemList = mPlaylist.getSystemList();
for( controller.system.System system: systemList.getSystem() )
{
for( Site site: system.getSite() )
{
for( Channel channel: site.getChannel() )
{
channel.setSystem( system.getName() );
channel.setSite( site.getName() );
mPlaylist.getChannels().add( channel );
}
}
}
mPlaylist.getSystemList().clearSystems();
mLog.info( "Converted [" + mPlaylist.getChannels().size() + "] channels to new playlist format" );
save();
} }
} }

View File

@@ -124,6 +124,6 @@ public class SourceComponentEditor extends AbstractChannelEditor
//Let the calling save method send the config change event //Let the calling save method send the config change event
mChannelNode.getChannel() mChannelNode.getChannel()
.setSourceConfiguration( mEditor.getConfig(), false ); .setSourceConfiguration( mEditor.getConfig() );
} }
} }

View File

@@ -42,6 +42,7 @@ public class SourceConfigMixer extends SourceConfiguration
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append( "Mixer: " );
sb.append( mMixer ); sb.append( mMixer );
sb.append( "-" ); sb.append( "-" );
sb.append( mChannel.toString() ); sb.append( mChannel.toString() );

View File

@@ -34,6 +34,7 @@ import source.tuner.frequency.FrequencyChangeListener;
import spectrum.SpectrumFrame; import spectrum.SpectrumFrame;
import controller.BaseNode; import controller.BaseNode;
import controller.ResourceManager; import controller.ResourceManager;
import controller.channel.ChannelModel;
public class TunerNode extends BaseNode implements FrequencyChangeListener public class TunerNode extends BaseNode implements FrequencyChangeListener
{ {
@@ -46,11 +47,14 @@ public class TunerNode extends BaseNode implements FrequencyChangeListener
private long mFrequency; private long mFrequency;
private int mSampleRate; private int mSampleRate;
private ChannelModel mChannelModel;
public TunerNode( Tuner tuner ) public TunerNode( ChannelModel channelModel, Tuner tuner )
{ {
super( tuner ); //does this make it a super tuner? super( tuner ); //does this make it a super tuner?
mChannelModel = channelModel;
tuner.addListener( this ); tuner.addListener( this );
try try
@@ -115,7 +119,7 @@ public class TunerNode extends BaseNode implements FrequencyChangeListener
{ {
ResourceManager rm = getModel().getResourceManager(); ResourceManager rm = getModel().getResourceManager();
SpectrumFrame frame = new SpectrumFrame( rm.getChannelManager(), SpectrumFrame frame = new SpectrumFrame( mChannelModel,
rm.getController(), rm.getPlaylistManager(), rm.getController(), rm.getPlaylistManager(),
rm.getSettingsManager(), getTuner() ); rm.getSettingsManager(), getTuner() );
} }

View File

@@ -166,7 +166,7 @@ public class ChannelSpectrumPanel extends JPanel
{ {
switch( event.getEvent() ) switch( event.getEvent() )
{ {
case CHANGE_SELECTED: case NOTIFICATION_SELECTION_CHANGE:
if( !event.getChannel().isSelected() ) if( !event.getChannel().isSelected() )
{ {
stop(); stop();
@@ -192,7 +192,7 @@ public class ChannelSpectrumPanel extends JPanel
start(); start();
} }
break; break;
case CHANNEL_DISABLED: case REQUEST_DISABLE:
if( event.getChannel() == mCurrentChannel ) if( event.getChannel() == mCurrentChannel )
{ {
if( mEnabled.get() ) if( mEnabled.get() )
@@ -203,7 +203,7 @@ public class ChannelSpectrumPanel extends JPanel
mCurrentChannel = null; mCurrentChannel = null;
} }
break; break;
case CHANNEL_ENABLED: case REQUEST_ENABLE:
if( event.getChannel() == mCurrentChannel && if( event.getChannel() == mCurrentChannel &&
!event.getChannel().isProcessing() ) !event.getChannel().isProcessing() )
{ {

View File

@@ -32,7 +32,6 @@ import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import javax.swing.JPanel; import javax.swing.JPanel;
@@ -52,7 +51,7 @@ import controller.channel.Channel;
import controller.channel.Channel.ChannelType; import controller.channel.Channel.ChannelType;
import controller.channel.ChannelEvent; import controller.channel.ChannelEvent;
import controller.channel.ChannelEventListener; import controller.channel.ChannelEventListener;
import controller.channel.ChannelManager; import controller.channel.ChannelModel;
public class OverlayPanel extends JPanel public class OverlayPanel extends JPanel
implements ChannelEventListener, implements ChannelEventListener,
@@ -111,14 +110,14 @@ public class OverlayPanel extends JPanel
private LabelSizeManager mLabelSizeMonitor = new LabelSizeManager(); private LabelSizeManager mLabelSizeMonitor = new LabelSizeManager();
private SettingsManager mSettingsManager; private SettingsManager mSettingsManager;
private ChannelManager mChannelManager; private ChannelModel mChannelModel;
/** /**
* Translucent overlay panel for displaying channel configurations, * Translucent overlay panel for displaying channel configurations,
* processing channels, selected channels, frequency labels and lines, and * processing channels, selected channels, frequency labels and lines, and
* a cursor with a frequency readout. * a cursor with a frequency readout.
*/ */
public OverlayPanel( SettingsManager settingsManager, public OverlayPanel( SettingsManager settingsManager,
ChannelManager channelManager ) ChannelModel channelModel )
{ {
mSettingsManager = settingsManager; mSettingsManager = settingsManager;
@@ -127,11 +126,11 @@ public class OverlayPanel extends JPanel
mSettingsManager.addListener( this ); mSettingsManager.addListener( this );
} }
mChannelManager = channelManager; mChannelModel = channelModel;
if( mChannelManager != null ) if( mChannelModel != null )
{ {
mChannelManager.addListener( this ); mChannelModel.addListener( this );
} }
addComponentListener( mLabelSizeMonitor ); addComponentListener( mLabelSizeMonitor );
@@ -145,14 +144,13 @@ public class OverlayPanel extends JPanel
public void dispose() public void dispose()
{ {
if( mChannelManager != null ) if( mChannelModel != null )
{ {
mChannelManager.removeListener( this ); mChannelModel.removeListener( this );
} }
mChannelManager = null; mChannelModel = null;
// mChannels.clear();
mVisibleChannels.clear(); mVisibleChannels.clear();
if( mSettingsManager != null ) if( mSettingsManager != null )
@@ -571,7 +569,7 @@ public class OverlayPanel extends JPanel
double yAxis = 0; double yAxis = 0;
//Draw the system label and adjust the y-axis position //Draw the system label and adjust the y-axis position
String system = channel.hasSystem() ? channel.getSystem().getName() : " "; String system = channel.hasSystem() ? channel.getSystem() : " ";
yAxis += drawLabel( graphics, yAxis += drawLabel( graphics,
system, system,
@@ -581,7 +579,7 @@ public class OverlayPanel extends JPanel
width ); width );
//Draw the site label and adjust the y-axis position //Draw the site label and adjust the y-axis position
String site = channel.hasSite() ? channel.getSite().getName() : " "; String site = channel.hasSite() ? channel.getSite() : " ";
yAxis += drawLabel( graphics, yAxis += drawLabel( graphics,
site, site,
@@ -689,20 +687,12 @@ public class OverlayPanel extends JPanel
} }
/** /**
* Reset the visible channel configs list * Reset the visible channels list
*/ */
mVisibleChannels.clear(); mVisibleChannels.clear();
mVisibleChannels.addAll(
long minimum = getMinFrequency(); mChannelModel.getChannelsInFrequencyRange( getMinFrequency(),
long maximum = getMaxFrequency(); getMaxFrequency() ) );
for( Channel channel: mChannelManager.getChannels() )
{
if( channel.isWithin( minimum, maximum ) )
{
mVisibleChannels.add( channel );
}
}
} }
/** /**
@@ -716,27 +706,20 @@ public class OverlayPanel extends JPanel
switch( event.getEvent() ) switch( event.getEvent() )
{ {
// case CHANNEL_ADDED: case NOTIFICATION_ADD:
case CHANNEL_ENABLED: case NOTIFICATION_PROCESSING_START:
// if( !mChannels.contains( channel ) ) if( !mVisibleChannels.contains( channel ) &&
// { channel.isWithin( getMinFrequency(), getMaxFrequency() ) )
// mChannels.add( channel );
// }
if( channel.isWithin( getMinFrequency(), getMaxFrequency() ) &&
!mVisibleChannels.contains( channel ) )
{ {
mVisibleChannels.add( channel ); mVisibleChannels.add( channel );
} }
break; break;
case CHANNEL_DELETED: case NOTIFICATION_DELETE:
// mChannels.remove( channel );
mVisibleChannels.remove( channel ); mVisibleChannels.remove( channel );
break; break;
case CHANNEL_PROCESSING_STOPPED: case NOTIFICATION_PROCESSING_STOP:
if( channel.getChannelType() == ChannelType.TRAFFIC ) if( channel.getChannelType() == ChannelType.TRAFFIC )
{ {
// mChannels.remove( channel );
mVisibleChannels.remove( channel ); mVisibleChannels.remove( channel );
} }
break; break;

View File

@@ -28,7 +28,6 @@ import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelEvent;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Hashtable; import java.util.Hashtable;
import javax.swing.JCheckBoxMenuItem; import javax.swing.JCheckBoxMenuItem;
@@ -82,7 +81,7 @@ import com.jidesoft.swing.JideSplitPane;
import controller.ConfigurationControllerModel; import controller.ConfigurationControllerModel;
import controller.channel.Channel; import controller.channel.Channel;
import controller.channel.ChannelManager; import controller.channel.ChannelModel;
import controller.channel.ChannelUtils; import controller.channel.ChannelUtils;
import dsp.filter.Window.WindowType; import dsp.filter.Window.WindowType;
import dsp.filter.smoothing.SmoothingFilter.SmoothingType; import dsp.filter.smoothing.SmoothingFilter.SmoothingType;
@@ -133,7 +132,7 @@ public class SpectralDisplayPanel extends JPanel
* the DFT is translated to decibels for display in the spectrum and * the DFT is translated to decibels for display in the spectrum and
* waterfall components. * waterfall components.
*/ */
public SpectralDisplayPanel( ChannelManager channelManager, public SpectralDisplayPanel( ChannelModel channelModel,
ConfigurationControllerModel controller, ConfigurationControllerModel controller,
PlaylistManager playlistManager, PlaylistManager playlistManager,
SettingsManager settingsManager ) SettingsManager settingsManager )
@@ -143,7 +142,7 @@ public class SpectralDisplayPanel extends JPanel
mSettingsManager = settingsManager; mSettingsManager = settingsManager;
mSpectrumPanel = new SpectrumPanel( mSettingsManager ); mSpectrumPanel = new SpectrumPanel( mSettingsManager );
mOverlayPanel = new OverlayPanel( mSettingsManager, channelManager ); mOverlayPanel = new OverlayPanel( mSettingsManager, channelModel );
mWaterfallPanel = new WaterfallPanel( mSettingsManager ); mWaterfallPanel = new WaterfallPanel( mSettingsManager );
//Register to receive tuner selection events //Register to receive tuner selection events

View File

@@ -23,13 +23,13 @@ import java.awt.event.WindowListener;
import javax.swing.JFrame; import javax.swing.JFrame;
import playlist.PlaylistManager;
import net.miginfocom.swing.MigLayout; import net.miginfocom.swing.MigLayout;
import playlist.PlaylistManager;
import settings.SettingsManager; import settings.SettingsManager;
import source.tuner.Tuner; import source.tuner.Tuner;
import controller.ConfigurationControllerModel; import controller.ConfigurationControllerModel;
import controller.ResourceManager; import controller.ResourceManager;
import controller.channel.ChannelManager; import controller.channel.ChannelModel;
public class SpectrumFrame extends JFrame implements WindowListener public class SpectrumFrame extends JFrame implements WindowListener
{ {
@@ -38,7 +38,7 @@ public class SpectrumFrame extends JFrame implements WindowListener
private ResourceManager mResourceManager; private ResourceManager mResourceManager;
private SpectralDisplayPanel mSpectralDisplayPanel; private SpectralDisplayPanel mSpectralDisplayPanel;
public SpectrumFrame( ChannelManager channelManager, public SpectrumFrame( ChannelModel channelModel,
ConfigurationControllerModel controller, ConfigurationControllerModel controller,
PlaylistManager playlistManager, PlaylistManager playlistManager,
SettingsManager settingsManager, SettingsManager settingsManager,
@@ -50,7 +50,7 @@ public class SpectrumFrame extends JFrame implements WindowListener
setLayout( new MigLayout( "insets 0 0 0 0", "[grow]", "[grow]") ); setLayout( new MigLayout( "insets 0 0 0 0", "[grow]", "[grow]") );
mSpectralDisplayPanel = new SpectralDisplayPanel( channelManager, mSpectralDisplayPanel = new SpectralDisplayPanel( channelModel,
controller, playlistManager, settingsManager ); controller, playlistManager, settingsManager );
mSpectralDisplayPanel.tunerSelected( tuner ); mSpectralDisplayPanel.tunerSelected( tuner );