Decouples DecoderState from the Decoder and makes DecoderState inherit

from Module so that Decoder can function independent of DecoderSTate and
DecoderState can more cleanly interface with other modules. 

Resolves issue with LTR-type decoders where the AudioModule was
filtering demodulated audio buffers before the decoder received the
audio - demodulated audio buffers are now copied before creating
AudioPackets.
This commit is contained in:
denny
2015-09-26 05:45:34 -04:00
parent eb1c2fc7a1
commit 9c69733034
57 changed files with 885 additions and 480 deletions

View File

@@ -41,7 +41,6 @@ import alias.AliasList;
import bits.MessageFramer;
import bits.SyncPattern;
import controller.channel.Channel.ChannelType;
import controller.channel.map.ChannelMap;
import dsp.filter.FilterFactory;
import dsp.filter.Filters;
import dsp.filter.Window.WindowType;
@@ -89,12 +88,8 @@ public class MPT1327Decoder extends Decoder
private MessageFramer mTrafficMessageFramer;
private MPT1327MessageProcessor mMessageProcessor;
public MPT1327Decoder( ChannelMap channelMap,
ChannelType channelType,
AliasList aliasList,
Sync sync )
public MPT1327Decoder( AliasList aliasList, Sync sync )
{
super( new MPT1327DecoderState( aliasList, channelMap, channelType ) );
/* Decimation filter - 48000 / 2 = 24000 output */
mDecimationFilter = new HalfBandFilter_RB_RB(
@@ -303,4 +298,25 @@ public class MPT1327Decoder extends Decoder
return getLabel();
}
}
@Override
public void reset()
{
// TODO Auto-generated method stub
}
@Override
public void start()
{
// TODO Auto-generated method stub
}
@Override
public void stop()
{
// TODO Auto-generated method stub
}
}

View File

@@ -41,16 +41,17 @@ public class MPT1327DecoderPanel extends DecoderPanel
private JLabel mFromTalkgroup = new JLabel( "" );
private JLabel mFromTalkgroupAliasLabel = new JLabel( "" );
public MPT1327DecoderPanel( SettingsManager settingsManager, MPT1327Decoder decoder )
public MPT1327DecoderPanel( SettingsManager settingsManager,
MPT1327DecoderState decoderState )
{
super( settingsManager, decoder );
super( settingsManager, decoderState );
init();
}
private MPT1327DecoderState getDecoderState()
public MPT1327DecoderState getDecoderState()
{
return (MPT1327DecoderState)getDecoder().getDecoderState();
return (MPT1327DecoderState)super.getDecoderState();
}
public void dispose()

View File

@@ -25,6 +25,7 @@ import java.util.List;
import java.util.TreeSet;
import message.Message;
import module.decode.DecoderType;
import module.decode.event.CallEvent;
import module.decode.event.CallEvent.CallEventType;
import module.decode.mpt1327.MPT1327Message.IdentType;
@@ -70,6 +71,22 @@ public class MPT1327DecoderState extends DecoderState
mChannelType = channelType;
}
@Override
public DecoderType getDecoderType()
{
return DecoderType.MPT1327;
}
@Override
public void start()
{
}
@Override
public void stop()
{
}
public ChannelType getChannelType()
{
return mChannelType;

View File

@@ -40,16 +40,16 @@ public class MPT1327TrafficPanel extends DecoderPanel
private JLabel mToTalkgroupLabel;
private JLabel mToTalkgroupAliasLabel;
public MPT1327TrafficPanel( SettingsManager settingsManager, MPT1327Decoder decoder )
public MPT1327TrafficPanel( SettingsManager settingsManager, MPT1327DecoderState decoderState )
{
super( settingsManager, decoder );
super( settingsManager, decoderState );
init();
}
private MPT1327DecoderState getDecoderState()
public MPT1327DecoderState getDecoderState()
{
return (MPT1327DecoderState)getDecoder().getDecoderState();
return (MPT1327DecoderState)super.getDecoderState();
}
public void dispose()