Instrumentation updates ... work in progress

This commit is contained in:
denny
2015-09-19 12:26:04 -04:00
parent 8c2207e37c
commit ba41022853
8 changed files with 92 additions and 47 deletions

View File

@@ -29,6 +29,7 @@ import javax.swing.SwingUtilities;
import module.decode.config.DecodeConfigFactory;
import module.decode.config.DecodeConfiguration;
import net.miginfocom.swing.MigLayout;
import playlist.PlaylistManager;
import controller.Editor;
import controller.channel.AbstractChannelEditor;
import controller.channel.Channel;
@@ -43,14 +44,19 @@ public class DecodeComponentEditor extends AbstractChannelEditor
private DecodeEditor mEditor;
public DecodeComponentEditor()
private PlaylistManager mPlaylistManager;
public DecodeComponentEditor( PlaylistManager playlistManager )
{
this( new ChannelNode( new Channel() ) );
this( new ChannelNode( new Channel() ), playlistManager );
}
public DecodeComponentEditor( ChannelNode channelNode )
public DecodeComponentEditor( ChannelNode channelNode,
PlaylistManager playlistMangager )
{
super( channelNode );
mPlaylistManager = playlistMangager;
setLayout( new MigLayout( "fill,wrap 2", "[right,grow][grow]", "[][][grow]" ) );
@@ -101,7 +107,8 @@ public class DecodeComponentEditor extends AbstractChannelEditor
}
//Change to the new one
mEditor = DecoderFactory.getEditorPanel( config, mChannelNode );
mEditor = DecoderFactory.getEditorPanel( config,
mChannelNode, mPlaylistManager );
add( mEditor, "span 2,center" );

View File

@@ -78,6 +78,7 @@ import module.demodulate.fm.FMDemodulatorModule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import playlist.PlaylistManager;
import properties.SystemProperties;
import record.RecorderType;
import record.config.RecordConfiguration;
@@ -173,7 +174,8 @@ public class DecoderFactory
int pass = decodeConfig.getDecoderType().getChannelBandwidth() / 2;
int stop = pass + 1250;
boolean recordAudio = recordConfig.getRecorders().contains( RecorderType.AUDIO );
boolean recordAudio = recordConfig == null ? false :
recordConfig.getRecorders().contains( RecorderType.AUDIO );
switch( decodeConfig.getDecoderType() )
{
@@ -273,25 +275,28 @@ public class DecoderFactory
{
List<Decoder> decoders = new ArrayList<Decoder>();
for( DecoderType auxDecoder: config.getAuxDecoders() )
if( config != null )
{
switch( auxDecoder )
for( DecoderType auxDecoder: config.getAuxDecoders() )
{
case FLEETSYNC2:
decoders.add( new Fleetsync2Decoder( aliasList ) );
break;
case MDC1200:
decoders.add( new MDCDecoder( aliasList ) );
break;
case LJ_1200:
decoders.add( new LJ1200Decoder( aliasList ) );
break;
case TAIT_1200:
decoders.add( new Tait1200Decoder( aliasList ) );
break;
default:
throw new IllegalArgumentException( "Unrecognized auxiliary "
+ "decoder type [" + auxDecoder + "]" );
switch( auxDecoder )
{
case FLEETSYNC2:
decoders.add( new Fleetsync2Decoder( aliasList ) );
break;
case MDC1200:
decoders.add( new MDCDecoder( aliasList ) );
break;
case LJ_1200:
decoders.add( new LJ1200Decoder( aliasList ) );
break;
case TAIT_1200:
decoders.add( new Tait1200Decoder( aliasList ) );
break;
default:
throw new IllegalArgumentException( "Unrecognized auxiliary "
+ "decoder type [" + auxDecoder + "]" );
}
}
}
@@ -400,7 +405,7 @@ public class DecoderFactory
}
public static DecodeEditor getEditorPanel( DecodeConfiguration config,
ChannelNode channelNode )
ChannelNode channelNode, PlaylistManager playlistManager )
{
DecodeEditor configuredPanel;
@@ -416,7 +421,8 @@ public class DecoderFactory
configuredPanel = new LTRNetEditor( config );
break;
case MPT1327:
configuredPanel = new MPT1327ConfigEditor( config, channelNode );
configuredPanel = new MPT1327ConfigEditor( config,
channelNode, playlistManager );
break;
case PASSPORT:
configuredPanel = new PassportEditor( config );

View File

@@ -18,6 +18,7 @@
package module.decode.mpt1327;
import java.util.ArrayList;
import java.util.List;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
@@ -29,6 +30,7 @@ import javax.swing.event.ChangeListener;
import module.decode.DecodeEditor;
import module.decode.config.DecodeConfiguration;
import module.decode.mpt1327.MPT1327Decoder.Sync;
import playlist.PlaylistManager;
import controller.channel.ChannelNode;
import controller.channel.map.ChannelMap;
@@ -43,12 +45,16 @@ public class MPT1327ConfigEditor extends DecodeEditor
private JLabel mTrafficChannelPoolSizeLabel;
private JSlider mTrafficChannelPoolSize;
private ChannelNode mChannelNode;
private PlaylistManager mPlaylistManager;
public MPT1327ConfigEditor( DecodeConfiguration config, ChannelNode channelNode )
public MPT1327ConfigEditor( DecodeConfiguration config,
ChannelNode channelNode,
PlaylistManager playlistManager )
{
super( config );
mChannelNode = channelNode;
mPlaylistManager = playlistManager;
initGUI();
}
@@ -63,8 +69,9 @@ public class MPT1327ConfigEditor extends DecodeEditor
/**
* ComboBox: Alias Lists
*/
ArrayList<ChannelMap> maps = mChannelNode.getModel().getResourceManager()
.getPlaylistManager().getPlayist().getChannelMapList().getChannelMap();
List<ChannelMap> maps = ( mPlaylistManager == null ?
new ArrayList<ChannelMap>() : mPlaylistManager.getPlayist()
.getChannelMapList().getChannelMap() );
ChannelMap[] mapArray = maps.toArray( new ChannelMap[ maps.size() ] );