mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-14 01:27:34 -05:00
Work in progress - program compiles and runs
This commit is contained in:
@@ -166,7 +166,7 @@ public class ChannelSpectrumPanel extends JPanel
|
||||
{
|
||||
switch( event.getEvent() )
|
||||
{
|
||||
case CHANGE_SELECTED:
|
||||
case NOTIFICATION_SELECTION_CHANGE:
|
||||
if( !event.getChannel().isSelected() )
|
||||
{
|
||||
stop();
|
||||
@@ -192,7 +192,7 @@ public class ChannelSpectrumPanel extends JPanel
|
||||
start();
|
||||
}
|
||||
break;
|
||||
case CHANNEL_DISABLED:
|
||||
case REQUEST_DISABLE:
|
||||
if( event.getChannel() == mCurrentChannel )
|
||||
{
|
||||
if( mEnabled.get() )
|
||||
@@ -203,7 +203,7 @@ public class ChannelSpectrumPanel extends JPanel
|
||||
mCurrentChannel = null;
|
||||
}
|
||||
break;
|
||||
case CHANNEL_ENABLED:
|
||||
case REQUEST_ENABLE:
|
||||
if( event.getChannel() == mCurrentChannel &&
|
||||
!event.getChannel().isProcessing() )
|
||||
{
|
||||
|
||||
@@ -32,7 +32,6 @@ import java.awt.geom.Line2D;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
@@ -52,7 +51,7 @@ import controller.channel.Channel;
|
||||
import controller.channel.Channel.ChannelType;
|
||||
import controller.channel.ChannelEvent;
|
||||
import controller.channel.ChannelEventListener;
|
||||
import controller.channel.ChannelManager;
|
||||
import controller.channel.ChannelModel;
|
||||
|
||||
public class OverlayPanel extends JPanel
|
||||
implements ChannelEventListener,
|
||||
@@ -111,14 +110,14 @@ public class OverlayPanel extends JPanel
|
||||
private LabelSizeManager mLabelSizeMonitor = new LabelSizeManager();
|
||||
|
||||
private SettingsManager mSettingsManager;
|
||||
private ChannelManager mChannelManager;
|
||||
private ChannelModel mChannelModel;
|
||||
/**
|
||||
* Translucent overlay panel for displaying channel configurations,
|
||||
* processing channels, selected channels, frequency labels and lines, and
|
||||
* a cursor with a frequency readout.
|
||||
*/
|
||||
public OverlayPanel( SettingsManager settingsManager,
|
||||
ChannelManager channelManager )
|
||||
ChannelModel channelModel )
|
||||
{
|
||||
mSettingsManager = settingsManager;
|
||||
|
||||
@@ -127,11 +126,11 @@ public class OverlayPanel extends JPanel
|
||||
mSettingsManager.addListener( this );
|
||||
}
|
||||
|
||||
mChannelManager = channelManager;
|
||||
mChannelModel = channelModel;
|
||||
|
||||
if( mChannelManager != null )
|
||||
if( mChannelModel != null )
|
||||
{
|
||||
mChannelManager.addListener( this );
|
||||
mChannelModel.addListener( this );
|
||||
}
|
||||
|
||||
addComponentListener( mLabelSizeMonitor );
|
||||
@@ -145,14 +144,13 @@ public class OverlayPanel extends JPanel
|
||||
|
||||
public void dispose()
|
||||
{
|
||||
if( mChannelManager != null )
|
||||
if( mChannelModel != null )
|
||||
{
|
||||
mChannelManager.removeListener( this );
|
||||
mChannelModel.removeListener( this );
|
||||
}
|
||||
|
||||
mChannelManager = null;
|
||||
mChannelModel = null;
|
||||
|
||||
// mChannels.clear();
|
||||
mVisibleChannels.clear();
|
||||
|
||||
if( mSettingsManager != null )
|
||||
@@ -571,7 +569,7 @@ public class OverlayPanel extends JPanel
|
||||
double yAxis = 0;
|
||||
|
||||
//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,
|
||||
system,
|
||||
@@ -581,7 +579,7 @@ public class OverlayPanel extends JPanel
|
||||
width );
|
||||
|
||||
//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,
|
||||
site,
|
||||
@@ -689,20 +687,12 @@ public class OverlayPanel extends JPanel
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the visible channel configs list
|
||||
* Reset the visible channels list
|
||||
*/
|
||||
mVisibleChannels.clear();
|
||||
|
||||
long minimum = getMinFrequency();
|
||||
long maximum = getMaxFrequency();
|
||||
|
||||
for( Channel channel: mChannelManager.getChannels() )
|
||||
{
|
||||
if( channel.isWithin( minimum, maximum ) )
|
||||
{
|
||||
mVisibleChannels.add( channel );
|
||||
}
|
||||
}
|
||||
mVisibleChannels.addAll(
|
||||
mChannelModel.getChannelsInFrequencyRange( getMinFrequency(),
|
||||
getMaxFrequency() ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -716,27 +706,20 @@ public class OverlayPanel extends JPanel
|
||||
|
||||
switch( event.getEvent() )
|
||||
{
|
||||
// case CHANNEL_ADDED:
|
||||
case CHANNEL_ENABLED:
|
||||
// if( !mChannels.contains( channel ) )
|
||||
// {
|
||||
// mChannels.add( channel );
|
||||
// }
|
||||
|
||||
if( channel.isWithin( getMinFrequency(), getMaxFrequency() ) &&
|
||||
!mVisibleChannels.contains( channel ) )
|
||||
case NOTIFICATION_ADD:
|
||||
case NOTIFICATION_PROCESSING_START:
|
||||
if( !mVisibleChannels.contains( channel ) &&
|
||||
channel.isWithin( getMinFrequency(), getMaxFrequency() ) )
|
||||
{
|
||||
mVisibleChannels.add( channel );
|
||||
}
|
||||
break;
|
||||
case CHANNEL_DELETED:
|
||||
// mChannels.remove( channel );
|
||||
case NOTIFICATION_DELETE:
|
||||
mVisibleChannels.remove( channel );
|
||||
break;
|
||||
case CHANNEL_PROCESSING_STOPPED:
|
||||
case NOTIFICATION_PROCESSING_STOP:
|
||||
if( channel.getChannelType() == ChannelType.TRAFFIC )
|
||||
{
|
||||
// mChannels.remove( channel );
|
||||
mVisibleChannels.remove( channel );
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -28,7 +28,6 @@ import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseWheelEvent;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
|
||||
import javax.swing.JCheckBoxMenuItem;
|
||||
@@ -82,7 +81,7 @@ import com.jidesoft.swing.JideSplitPane;
|
||||
|
||||
import controller.ConfigurationControllerModel;
|
||||
import controller.channel.Channel;
|
||||
import controller.channel.ChannelManager;
|
||||
import controller.channel.ChannelModel;
|
||||
import controller.channel.ChannelUtils;
|
||||
import dsp.filter.Window.WindowType;
|
||||
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
|
||||
* waterfall components.
|
||||
*/
|
||||
public SpectralDisplayPanel( ChannelManager channelManager,
|
||||
public SpectralDisplayPanel( ChannelModel channelModel,
|
||||
ConfigurationControllerModel controller,
|
||||
PlaylistManager playlistManager,
|
||||
SettingsManager settingsManager )
|
||||
@@ -143,7 +142,7 @@ public class SpectralDisplayPanel extends JPanel
|
||||
mSettingsManager = settingsManager;
|
||||
|
||||
mSpectrumPanel = new SpectrumPanel( mSettingsManager );
|
||||
mOverlayPanel = new OverlayPanel( mSettingsManager, channelManager );
|
||||
mOverlayPanel = new OverlayPanel( mSettingsManager, channelModel );
|
||||
mWaterfallPanel = new WaterfallPanel( mSettingsManager );
|
||||
|
||||
//Register to receive tuner selection events
|
||||
|
||||
@@ -23,13 +23,13 @@ import java.awt.event.WindowListener;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
|
||||
import playlist.PlaylistManager;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import playlist.PlaylistManager;
|
||||
import settings.SettingsManager;
|
||||
import source.tuner.Tuner;
|
||||
import controller.ConfigurationControllerModel;
|
||||
import controller.ResourceManager;
|
||||
import controller.channel.ChannelManager;
|
||||
import controller.channel.ChannelModel;
|
||||
|
||||
public class SpectrumFrame extends JFrame implements WindowListener
|
||||
{
|
||||
@@ -38,7 +38,7 @@ public class SpectrumFrame extends JFrame implements WindowListener
|
||||
private ResourceManager mResourceManager;
|
||||
private SpectralDisplayPanel mSpectralDisplayPanel;
|
||||
|
||||
public SpectrumFrame( ChannelManager channelManager,
|
||||
public SpectrumFrame( ChannelModel channelModel,
|
||||
ConfigurationControllerModel controller,
|
||||
PlaylistManager playlistManager,
|
||||
SettingsManager settingsManager,
|
||||
@@ -50,7 +50,7 @@ public class SpectrumFrame extends JFrame implements WindowListener
|
||||
|
||||
setLayout( new MigLayout( "insets 0 0 0 0", "[grow]", "[grow]") );
|
||||
|
||||
mSpectralDisplayPanel = new SpectralDisplayPanel( channelManager,
|
||||
mSpectralDisplayPanel = new SpectralDisplayPanel( channelModel,
|
||||
controller, playlistManager, settingsManager );
|
||||
|
||||
mSpectralDisplayPanel.tunerSelected( tuner );
|
||||
|
||||
Reference in New Issue
Block a user