mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 00:57:31 -05:00
work in progress
This commit is contained in:
65
src/instrument/InstrumentableProcessingChain.java
Normal file
65
src/instrument/InstrumentableProcessingChain.java
Normal file
@@ -0,0 +1,65 @@
|
||||
package instrument;
|
||||
|
||||
import instrument.tap.Tap;
|
||||
import instrument.tap.TapGroup;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import source.Source;
|
||||
import source.tuner.TunerChannelSource;
|
||||
import source.tuner.frequency.FrequencyCorrectionControl;
|
||||
import module.Module;
|
||||
import module.ProcessingChain;
|
||||
|
||||
public class InstrumentableProcessingChain extends ProcessingChain implements Instrumentable
|
||||
{
|
||||
public InstrumentableProcessingChain()
|
||||
{
|
||||
}
|
||||
|
||||
public void setSource( Source source ) throws IllegalStateException
|
||||
{
|
||||
mSource = source;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TapGroup> getTapGroups()
|
||||
{
|
||||
List<TapGroup> groups = new ArrayList<>();
|
||||
|
||||
for( Module module: getModules() )
|
||||
{
|
||||
if( module instanceof Instrumentable )
|
||||
{
|
||||
groups.addAll( ((Instrumentable)module).getTapGroups() );
|
||||
}
|
||||
}
|
||||
|
||||
return groups;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTap( Tap tap )
|
||||
{
|
||||
for( Module module: getModules() )
|
||||
{
|
||||
if( module instanceof Instrumentable )
|
||||
{
|
||||
((Instrumentable)module).registerTap( tap );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterTap( Tap tap )
|
||||
{
|
||||
for( Module module: getModules() )
|
||||
{
|
||||
if( module instanceof Instrumentable )
|
||||
{
|
||||
((Instrumentable)module).unregisterTap( tap );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
85
src/instrument/gui/DecoderSelectionFrame.java
Normal file
85
src/instrument/gui/DecoderSelectionFrame.java
Normal file
@@ -0,0 +1,85 @@
|
||||
package instrument.gui;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JDesktopPane;
|
||||
import javax.swing.JInternalFrame;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import module.decode.DecodeComponentEditor;
|
||||
import module.decode.config.DecodeConfiguration;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import source.IControllableFileSource;
|
||||
import controller.ResourceManager;
|
||||
|
||||
public class DecoderSelectionFrame extends JInternalFrame
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private DecodeComponentEditor mDecodeEditor = new DecodeComponentEditor();
|
||||
private ResourceManager mResourceManager = new ResourceManager();
|
||||
|
||||
private IControllableFileSource mSource;
|
||||
private JDesktopPane mDesktop;
|
||||
|
||||
public DecoderSelectionFrame( JDesktopPane desktop,
|
||||
IControllableFileSource source )
|
||||
{
|
||||
mDesktop = desktop;
|
||||
mSource = source;
|
||||
|
||||
initGUI();
|
||||
}
|
||||
|
||||
private void initGUI()
|
||||
{
|
||||
setTitle( "Decoders" );
|
||||
setPreferredSize( new Dimension( 700, 150 ) );
|
||||
setSize( 700, 150 );
|
||||
|
||||
setResizable( true );
|
||||
setClosable( true );
|
||||
setIconifiable( true );
|
||||
setMaximizable( false );
|
||||
|
||||
add( mDecodeEditor );
|
||||
}
|
||||
|
||||
public class AddDecoderButton extends JButton
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public AddDecoderButton()
|
||||
{
|
||||
super( "Add" );
|
||||
|
||||
addActionListener( new ActionListener()
|
||||
{
|
||||
@Override
|
||||
public void actionPerformed( ActionEvent arg0 )
|
||||
{
|
||||
DecodeConfiguration config = mDecodeEditor.getDecodeConfig();
|
||||
|
||||
if( config != null )
|
||||
{
|
||||
DecoderViewFrame decoderFrame = new DecoderViewFrame(
|
||||
mResourceManager,
|
||||
config,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
mSource );
|
||||
|
||||
decoderFrame.setVisible( true );
|
||||
|
||||
mDesktop.add( decoderFrame );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
34
src/instrument/tap/TapGroup.java
Normal file
34
src/instrument/tap/TapGroup.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package instrument.tap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TapGroup
|
||||
{
|
||||
private String mName;
|
||||
private List<Tap> mTaps = new ArrayList<>();
|
||||
|
||||
public TapGroup( String name )
|
||||
{
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return mName;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return getName();
|
||||
}
|
||||
|
||||
public List<Tap> getTaps()
|
||||
{
|
||||
return mTaps;
|
||||
}
|
||||
|
||||
public void add( Tap tap )
|
||||
{
|
||||
mTaps.add( tap );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user