mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Work in progress
This commit is contained in:
@@ -19,6 +19,7 @@ package module.decode.fleetsync2;
|
||||
|
||||
import instrument.Instrumentable;
|
||||
import instrument.tap.Tap;
|
||||
import instrument.tap.TapGroup;
|
||||
import instrument.tap.stream.BinaryTap;
|
||||
import instrument.tap.stream.FloatBufferTap;
|
||||
|
||||
@@ -56,7 +57,7 @@ public class Fleetsync2Decoder extends Decoder implements IRealBufferListener,
|
||||
private static final int sMESSAGE_LENGTH = 537;
|
||||
|
||||
/* Instrumentation Taps */
|
||||
private ArrayList<Tap> mAvailableTaps;
|
||||
private ArrayList<TapGroup> mAvailableTaps;
|
||||
private static final String INSTRUMENT_BANDPASS_FILTER_TO_FSK2_DEMOD =
|
||||
"Tap Point: Bandpass Filter > < FSK2 Decoder";
|
||||
private static final String INSTRUMENT_FSK2_DECODER_TO_MESSAGE_FRAMER =
|
||||
@@ -113,26 +114,31 @@ public class Fleetsync2Decoder extends Decoder implements IRealBufferListener,
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Tap> getTaps()
|
||||
public List<TapGroup> getTapGroups()
|
||||
{
|
||||
if( mAvailableTaps == null )
|
||||
{
|
||||
mAvailableTaps = new ArrayList<Tap>();
|
||||
mAvailableTaps = new ArrayList<TapGroup>();
|
||||
|
||||
TapGroup group = new TapGroup( "Fleetsync 2 Decoder" );
|
||||
|
||||
mAvailableTaps.add( new FloatBufferTap(
|
||||
group.add( new FloatBufferTap(
|
||||
INSTRUMENT_BANDPASS_FILTER_TO_FSK2_DEMOD, 0, 0.5f ) );
|
||||
mAvailableTaps.addAll( mFSKDecoder.getTaps() );
|
||||
mAvailableTaps.add( new BinaryTap(
|
||||
group.add( new BinaryTap(
|
||||
INSTRUMENT_FSK2_DECODER_TO_MESSAGE_FRAMER, 0, 0.025f ) );
|
||||
|
||||
mAvailableTaps.add( group );
|
||||
|
||||
mAvailableTaps.addAll( mFSKDecoder.getTapGroups() );
|
||||
}
|
||||
|
||||
return mAvailableTaps;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTap( Tap tap )
|
||||
public void registerTap( Tap tap )
|
||||
{
|
||||
mFSKDecoder.addTap( tap );
|
||||
mFSKDecoder.registerTap( tap );
|
||||
|
||||
switch( tap.getName() )
|
||||
{
|
||||
@@ -150,9 +156,9 @@ public class Fleetsync2Decoder extends Decoder implements IRealBufferListener,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeTap( Tap tap )
|
||||
public void unregisterTap( Tap tap )
|
||||
{
|
||||
mFSKDecoder.removeTap( tap );
|
||||
mFSKDecoder.unregisterTap( tap );
|
||||
|
||||
switch( tap.getName() )
|
||||
{
|
||||
|
||||
@@ -20,8 +20,13 @@ package module.decode.fleetsync2;
|
||||
import java.awt.EventQueue;
|
||||
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JSeparator;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import alias.Alias;
|
||||
import module.decode.DecoderFactory;
|
||||
import module.decode.state.ChangedAttribute;
|
||||
import module.decode.state.DecoderPanel;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
@@ -32,23 +37,25 @@ import settings.SettingsManager;
|
||||
|
||||
public class Fleetsync2DecoderPanel extends DecoderPanel
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final static Logger mLog = LoggerFactory.getLogger( Fleetsync2DecoderPanel.class );
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final String PROTOCOL = "FSync II";
|
||||
|
||||
private JLabel mFromLabel = new JLabel( " " );
|
||||
private JLabel mFrom = new JLabel();
|
||||
private JLabel mFromAlias = new JLabel();
|
||||
|
||||
private JLabel mToLabel = new JLabel();
|
||||
private JLabel mToLabel = new JLabel( " " );
|
||||
private JLabel mTo = new JLabel( " " );
|
||||
private JLabel mToAlias = new JLabel();
|
||||
private JLabel mToAlias = new JLabel( " " );
|
||||
|
||||
private JLabel mFromLabel = new JLabel( " " );
|
||||
private JLabel mFrom = new JLabel( " " );
|
||||
private JLabel mFromAlias = new JLabel( " " );
|
||||
|
||||
private JLabel mProtocol = new JLabel( PROTOCOL );
|
||||
private JLabel mMessage = new JLabel();
|
||||
private JLabel mMessageType = new JLabel();
|
||||
private JLabel mMessage = new JLabel( " " );
|
||||
private JLabel mMessageType = new JLabel( " " );
|
||||
|
||||
public Fleetsync2DecoderPanel( SettingsManager settingsManager,
|
||||
Fleetsync2Decoder decoder )
|
||||
Fleetsync2Decoder decoder )
|
||||
{
|
||||
super( settingsManager, decoder );
|
||||
|
||||
@@ -73,25 +80,40 @@ public class Fleetsync2DecoderPanel extends DecoderPanel
|
||||
|
||||
setLayout( new MigLayout( "insets 1 0 0 0", "[grow,fill]", "[]0[]0[]") );
|
||||
|
||||
mFromLabel.setFont( mFontAuxDecoder );
|
||||
add( mFromLabel );
|
||||
mFrom.setFont( mFontAuxDecoder );
|
||||
add( mFrom );
|
||||
mFromAlias.setFont( mFontAuxDecoder );
|
||||
add( mFromAlias, "wrap" );
|
||||
|
||||
mToLabel.setFont( mFontAuxDecoder );
|
||||
mToLabel.setForeground( mColorLabelAuxDecoder );
|
||||
add( mToLabel );
|
||||
|
||||
mTo.setFont( mFontAuxDecoder );
|
||||
mTo.setForeground( mColorLabelAuxDecoder );
|
||||
add( mTo );
|
||||
|
||||
mToAlias.setFont( mFontAuxDecoder );
|
||||
mToAlias.setForeground( mColorLabelAuxDecoder );
|
||||
add( mToAlias, "wrap" );
|
||||
|
||||
mFromLabel.setFont( mFontAuxDecoder );
|
||||
mFromLabel.setForeground( mColorLabelAuxDecoder );
|
||||
add( mFromLabel );
|
||||
|
||||
mFrom.setFont( mFontAuxDecoder );
|
||||
mFrom.setForeground( mColorLabelAuxDecoder );
|
||||
add( mFrom );
|
||||
|
||||
mFromAlias.setFont( mFontAuxDecoder );
|
||||
mFromAlias.setForeground( mColorLabelAuxDecoder );
|
||||
add( mFromAlias, "wrap" );
|
||||
|
||||
mProtocol.setFont( mFontAuxDecoder );
|
||||
mProtocol.setForeground( mColorLabelAuxDecoder );
|
||||
add( mProtocol );
|
||||
|
||||
mMessageType.setFont( mFontAuxDecoder );
|
||||
mMessageType.setForeground( mColorLabelAuxDecoder );
|
||||
add( mMessageType );
|
||||
|
||||
mMessage.setFont( mFontAuxDecoder );
|
||||
mMessage.setForeground( mColorLabelAuxDecoder );
|
||||
add( mMessage, "wrap" );
|
||||
}
|
||||
|
||||
@@ -110,21 +132,23 @@ public class Fleetsync2DecoderPanel extends DecoderPanel
|
||||
|
||||
if( from != null )
|
||||
{
|
||||
mFromLabel.setText( "FM:" );
|
||||
mFromLabel.setText( "FROM:" );
|
||||
mFrom.setText( from );
|
||||
}
|
||||
else
|
||||
{
|
||||
mFromLabel.setText( " " );
|
||||
mFrom.setText( " " );
|
||||
}
|
||||
mFrom.setText( from );
|
||||
break;
|
||||
case FROM_TALKGROUP_ALIAS:
|
||||
Alias fromAlias = getState().getFromIDAlias();
|
||||
|
||||
if( fromAlias != null )
|
||||
{
|
||||
mFromAlias.setText( fromAlias.getName() );
|
||||
}
|
||||
setAliasLabel( mFromAlias, getState().getFromIDAlias() );
|
||||
break;
|
||||
case MESSAGE:
|
||||
mMessage.setText( getState().getMessage() );
|
||||
break;
|
||||
case MESSAGE_TYPE:
|
||||
mMessageType.setText( getState().getMessageType() );
|
||||
break;
|
||||
case TO_TALKGROUP:
|
||||
String to = getState().getToID();
|
||||
@@ -132,26 +156,16 @@ public class Fleetsync2DecoderPanel extends DecoderPanel
|
||||
if( to != null )
|
||||
{
|
||||
mToLabel.setText( "TO:" );
|
||||
mTo.setText( to );
|
||||
}
|
||||
else
|
||||
{
|
||||
mToLabel.setText( " " );
|
||||
mTo.setText( " " );
|
||||
}
|
||||
mTo.setText( to );
|
||||
break;
|
||||
case TO_TALKGROUP_ALIAS:
|
||||
Alias toAlias = getState().getToIDAlias();
|
||||
|
||||
if( toAlias != null )
|
||||
{
|
||||
mToAlias.setText( toAlias.getName() );
|
||||
}
|
||||
break;
|
||||
case MESSAGE:
|
||||
mMessage.setText( getState().getMessage() );
|
||||
break;
|
||||
case MESSAGE_TYPE:
|
||||
mMessageType.setText( getState().getMessageType() );
|
||||
setAliasLabel( mToAlias, getState().getToIDAlias() );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -52,8 +52,6 @@ public class FleetsyncDecoderState extends DecoderState
|
||||
public void dispose()
|
||||
{
|
||||
super.dispose();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -96,6 +94,8 @@ public class FleetsyncDecoderState extends DecoderState
|
||||
|
||||
if( fleetsync.isValid() )
|
||||
{
|
||||
State state = State.CALL;
|
||||
|
||||
setFromID( fleetsync.getFromID() );
|
||||
setFromIDAlias( fleetsync.getFromIDAlias() );
|
||||
mIdents.add( fleetsync.getFromID() );
|
||||
@@ -115,6 +115,7 @@ public class FleetsyncDecoderState extends DecoderState
|
||||
{
|
||||
case GPS:
|
||||
setMessage( fleetsync.getGPSLocation() );
|
||||
state = State.DATA;
|
||||
break;
|
||||
case STATUS:
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@@ -129,10 +130,12 @@ public class FleetsyncDecoderState extends DecoderState
|
||||
}
|
||||
|
||||
setMessage( sb.toString() );
|
||||
state = State.DATA;
|
||||
break;
|
||||
case EMERGENCY:
|
||||
case LONE_WORKER_EMERGENCY:
|
||||
mEmergencyIdents.add( fleetsync.getFromID() );
|
||||
state = State.DATA;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -145,9 +148,9 @@ public class FleetsyncDecoderState extends DecoderState
|
||||
|
||||
broadcast( fsCallEvent );
|
||||
|
||||
/* Broadcast decode event. If the primary state is not already
|
||||
* in a call state, then we'll use a default decoded data state */
|
||||
broadcast( new DecoderStateEvent( this, Event.DECODE, State.DATA ) );
|
||||
/* Broadcast decode event so that the channel state will
|
||||
* kick in and reset everything */
|
||||
broadcast( new DecoderStateEvent( this, Event.DECODE, state ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user