mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-14 01:27:34 -05:00
Interim checkin for call recording.
This commit is contained in:
@@ -26,6 +26,9 @@ import instrument.tap.stream.FloatTap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import module.decode.Decoder;
|
||||
import module.decode.DecoderType;
|
||||
import sample.Broadcaster;
|
||||
@@ -35,6 +38,7 @@ import sample.real.RealBuffer;
|
||||
import alias.AliasList;
|
||||
import bits.MessageFramer;
|
||||
import bits.SyncPattern;
|
||||
import controller.channel.Channel;
|
||||
import controller.channel.Channel.ChannelType;
|
||||
import controller.channel.map.ChannelMap;
|
||||
import dsp.filter.FilterFactory;
|
||||
@@ -54,6 +58,8 @@ import dsp.fsk.FSK2Decoder.Output;
|
||||
public class MPT1327Decoder extends Decoder
|
||||
implements IRealBufferListener, Instrumentable
|
||||
{
|
||||
private final static Logger mLog = LoggerFactory.getLogger( MPT1327Decoder.class );
|
||||
|
||||
/* Decimated sample rate ( 48,000 / 2 = 24,000 ) feeding the decoder */
|
||||
private static final int sDECIMATED_SAMPLE_RATE = 24000;
|
||||
|
||||
|
||||
@@ -35,12 +35,12 @@ public class MPT1327DecoderPanel extends DecoderPanel
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private JLabel mProtocol = new JLabel( "" );
|
||||
private JLabel mSiteOrFromTalkgroup = new JLabel( "" );
|
||||
private JLabel mSiteOrFromTalkgroupAlias = new JLabel( "" );
|
||||
private JLabel mSiteOrToTalkgroup = new JLabel( "" );
|
||||
private JLabel mSiteOrToTalkgroupAlias = new JLabel( "" );
|
||||
|
||||
private JLabel mToTalkgroupLabel = new JLabel( "" );
|
||||
private JLabel mToTalkgroup = new JLabel( "" );
|
||||
private JLabel mToTalkgroupAliasLabel = new JLabel( "" );
|
||||
private JLabel mFromTalkgroupLabel = new JLabel( "" );
|
||||
private JLabel mFromTalkgroup = new JLabel( "" );
|
||||
private JLabel mFromTalkgroupAliasLabel = new JLabel( "" );
|
||||
|
||||
public MPT1327DecoderPanel( SettingsManager settingsManager, MPT1327Decoder decoder )
|
||||
{
|
||||
@@ -71,35 +71,35 @@ public class MPT1327DecoderPanel extends DecoderPanel
|
||||
|
||||
MPT1327DecoderState mptState = getDecoderState();
|
||||
|
||||
mSiteOrFromTalkgroup.setFont( mFontDecoder );
|
||||
mSiteOrFromTalkgroup.setForeground( mColorLabelDecoder );
|
||||
mSiteOrToTalkgroup.setFont( mFontDecoder );
|
||||
mSiteOrToTalkgroup.setForeground( mColorLabelDecoder );
|
||||
|
||||
mSiteOrFromTalkgroupAlias.setFont( mFontDecoder );
|
||||
mSiteOrFromTalkgroupAlias.setForeground( mColorLabelDecoder );
|
||||
mSiteOrToTalkgroupAlias.setFont( mFontDecoder );
|
||||
mSiteOrToTalkgroupAlias.setForeground( mColorLabelDecoder );
|
||||
|
||||
mToTalkgroupLabel.setFont( mFontDetails );
|
||||
mToTalkgroupLabel.setForeground( mColorLabelDetails );
|
||||
mFromTalkgroupLabel.setFont( mFontDetails );
|
||||
mFromTalkgroupLabel.setForeground( mColorLabelDetails );
|
||||
|
||||
mToTalkgroup.setFont( mFontDecoder );
|
||||
mToTalkgroup.setForeground( mColorLabelDecoder );
|
||||
mFromTalkgroup.setFont( mFontDecoder );
|
||||
mFromTalkgroup.setForeground( mColorLabelDecoder );
|
||||
|
||||
mToTalkgroupAliasLabel.setFont( mFontDecoder );
|
||||
mToTalkgroupAliasLabel.setForeground( mColorLabelDecoder );
|
||||
mFromTalkgroupAliasLabel.setFont( mFontDecoder );
|
||||
mFromTalkgroupAliasLabel.setForeground( mColorLabelDecoder );
|
||||
|
||||
|
||||
switch( mptState.getChannelType() )
|
||||
{
|
||||
case STANDARD:
|
||||
mSiteOrFromTalkgroup.setText( mptState.getSite() );
|
||||
setAliasLabel( mSiteOrFromTalkgroupAlias, mptState.getSiteAlias() );
|
||||
mSiteOrToTalkgroup.setText( mptState.getSite() );
|
||||
setAliasLabel( mSiteOrToTalkgroupAlias, mptState.getSiteAlias() );
|
||||
break;
|
||||
case TRAFFIC:
|
||||
mSiteOrFromTalkgroup.setText( mptState.getFromTalkgroup() );
|
||||
setAliasLabel( mSiteOrFromTalkgroupAlias, mptState.getFromTalkgroupAlias() );
|
||||
mSiteOrToTalkgroup.setText( mptState.getToTalkgroup() );
|
||||
setAliasLabel( mSiteOrToTalkgroupAlias, mptState.getToTalkgroupAlias() );
|
||||
|
||||
mToTalkgroupLabel.setText( "To:" );
|
||||
mToTalkgroup.setText( getDecoderState().getToTalkgroup() );
|
||||
setAliasLabel( mToTalkgroupAliasLabel, mptState.getToTalkgroupAlias() );
|
||||
mFromTalkgroupLabel.setText( "From:" );
|
||||
mFromTalkgroup.setText( getDecoderState().getFromTalkgroup() );
|
||||
setAliasLabel( mFromTalkgroupAliasLabel, mptState.getFromTalkgroupAlias() );
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException( "Unrecognized channel "
|
||||
@@ -108,14 +108,14 @@ public class MPT1327DecoderPanel extends DecoderPanel
|
||||
}
|
||||
|
||||
add( mProtocol );
|
||||
add( mSiteOrFromTalkgroup );
|
||||
add( mSiteOrFromTalkgroupAlias, "wrap" );
|
||||
add( mSiteOrToTalkgroup );
|
||||
add( mSiteOrToTalkgroupAlias, "wrap" );
|
||||
|
||||
if( mptState.getChannelType() == ChannelType.TRAFFIC )
|
||||
{
|
||||
add( mToTalkgroupLabel );
|
||||
add( mToTalkgroup );
|
||||
add( mToTalkgroupAliasLabel, "wrap" );
|
||||
add( mFromTalkgroupLabel );
|
||||
add( mFromTalkgroup );
|
||||
add( mFromTalkgroupAliasLabel, "wrap" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,18 +156,18 @@ public class MPT1327DecoderPanel extends DecoderPanel
|
||||
switch( changedAttribute )
|
||||
{
|
||||
case CHANNEL_SITE_NUMBER:
|
||||
mSiteOrFromTalkgroup.setText( String.valueOf( state.getSite() ) );
|
||||
setAliasLabel( mSiteOrFromTalkgroupAlias, state.getSiteAlias() );
|
||||
repaint();
|
||||
break;
|
||||
case FROM_TALKGROUP:
|
||||
mSiteOrFromTalkgroup.setText( state.getFromTalkgroup() );
|
||||
setAliasLabel( mSiteOrFromTalkgroupAlias, state.getFromTalkgroupAlias() );
|
||||
mSiteOrToTalkgroup.setText( String.valueOf( state.getSite() ) );
|
||||
setAliasLabel( mSiteOrToTalkgroupAlias, state.getSiteAlias() );
|
||||
repaint();
|
||||
break;
|
||||
case TO_TALKGROUP:
|
||||
mToTalkgroup.setText( state.getToTalkgroup() );
|
||||
setAliasLabel( mToTalkgroupAliasLabel, state.getToTalkgroupAlias() );
|
||||
mSiteOrToTalkgroup.setText( state.getToTalkgroup() );
|
||||
setAliasLabel( mSiteOrToTalkgroupAlias, state.getToTalkgroupAlias() );
|
||||
repaint();
|
||||
break;
|
||||
case FROM_TALKGROUP:
|
||||
mFromTalkgroup.setText( state.getFromTalkgroup() );
|
||||
setAliasLabel( mFromTalkgroupAliasLabel, state.getFromTalkgroupAlias() );
|
||||
repaint();
|
||||
break;
|
||||
default:
|
||||
@@ -193,27 +193,27 @@ public class MPT1327DecoderPanel extends DecoderPanel
|
||||
{
|
||||
mProtocol.setForeground( mColorLabelDecoder );
|
||||
}
|
||||
if( mSiteOrFromTalkgroup != null )
|
||||
if( mSiteOrToTalkgroup != null )
|
||||
{
|
||||
mSiteOrFromTalkgroup.setForeground( mColorLabelDecoder );
|
||||
mSiteOrToTalkgroup.setForeground( mColorLabelDecoder );
|
||||
}
|
||||
if( mSiteOrFromTalkgroupAlias != null )
|
||||
if( mSiteOrToTalkgroupAlias != null )
|
||||
{
|
||||
mSiteOrFromTalkgroupAlias.setForeground( mColorLabelDecoder );
|
||||
mSiteOrToTalkgroupAlias.setForeground( mColorLabelDecoder );
|
||||
}
|
||||
if( mToTalkgroup != null )
|
||||
if( mFromTalkgroup != null )
|
||||
{
|
||||
mToTalkgroup.setForeground( mColorLabelDecoder );
|
||||
mFromTalkgroup.setForeground( mColorLabelDecoder );
|
||||
}
|
||||
if( mToTalkgroupAliasLabel != null )
|
||||
if( mFromTalkgroupAliasLabel != null )
|
||||
{
|
||||
mToTalkgroupAliasLabel.setForeground( mColorLabelDecoder );
|
||||
mFromTalkgroupAliasLabel.setForeground( mColorLabelDecoder );
|
||||
}
|
||||
break;
|
||||
case CHANNEL_STATE_LABEL_DETAILS:
|
||||
if( mToTalkgroupLabel != null )
|
||||
if( mFromTalkgroupLabel != null )
|
||||
{
|
||||
mToTalkgroupLabel.setForeground( mColorLabelDetails );
|
||||
mFromTalkgroupLabel.setForeground( mColorLabelDetails );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -245,42 +245,6 @@ public class MPT1327DecoderState extends DecoderState
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Intercept the fade event so that we can generate a call end event
|
||||
// */
|
||||
// @Override
|
||||
// public void fade( final CallEventType type )
|
||||
// {
|
||||
// /*
|
||||
// * We can receive multiple call tear-down messages -- only post a call
|
||||
// * end event for the one that can change the state to fade
|
||||
// */
|
||||
// if( getState().canChangeTo( State.FADE ) )
|
||||
// {
|
||||
// CallEvent current = getCurrentCallEvent();
|
||||
//
|
||||
// if( current != null )
|
||||
// {
|
||||
// mCallEventModel.setEnd( current );
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// mCallEventModel.add(
|
||||
// new MPT1327CallEvent.Builder( type )
|
||||
// .aliasList( getAliasList() )
|
||||
// .channel( String.valueOf( mChannelNumber ) )
|
||||
// .frequency( mChannelMap.getFrequency( mChannelNumber ) )
|
||||
// .from( mFromTalkgroup )
|
||||
// .to( mToTalkgroup )
|
||||
// .build() );
|
||||
// }
|
||||
//
|
||||
// setCurrentCall( null );
|
||||
// }
|
||||
//
|
||||
// super.fade( type );
|
||||
// }
|
||||
|
||||
public void reset()
|
||||
{
|
||||
mIdents.clear();
|
||||
@@ -343,7 +307,7 @@ public class MPT1327DecoderState extends DecoderState
|
||||
{
|
||||
if( hasAliasList() )
|
||||
{
|
||||
return getAliasList().getTalkgroupAlias( mFromTalkgroup );
|
||||
return getAliasList().getMPT1327Alias( mFromTalkgroup );
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -370,7 +334,7 @@ public class MPT1327DecoderState extends DecoderState
|
||||
{
|
||||
if( hasAliasList() )
|
||||
{
|
||||
return getAliasList().getTalkgroupAlias( mToTalkgroup );
|
||||
return getAliasList().getMPT1327Alias( mToTalkgroup );
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user