MPT1327 - adds sync pattern for French variant of MPT1327. Channel decode configuration editor now contains a combo box that allows selection of normal or French variant.

This commit is contained in:
dennis.sheirer
2014-08-04 00:06:00 +00:00
parent 44faeb9351
commit 63de9c6d7d
6 changed files with 108 additions and 9 deletions

View File

@@ -68,18 +68,32 @@ public enum SyncPattern
MPT1327_CONTROL( new boolean[]
{
true, false, true, false, //Includes 4 of 16 rev bits
// false, true, false, true, //Includes 4 of 16 rev bits
true, true, false, false, //1100 0xA
false, true, false, false, //0100 0x4
true, true, false, true, //1101 0xD
false, true, true, true //0111 0x7
}),
/**
* French variant of MPT-1327. This variant uses the following reversal
* pattern and sync pattern:
*
* REV: 0101 0101 0100 1011
* SYNC: 1100 1100 0111 1111
*/
MPT1327_CONTROL_FRENCH( new boolean[]
{
true, false, true, true, //Includes final 4 of 16 rev bits
true, true, false, false, //1100 0xA
true, true, false, false, //1100 0xA
false, true, true, true, //0111 0x7
true, true, true, true, //1111 0xF
}),
/* Revs (0xA) and Sync(0x3B28) = 1010 0011101100101000 */
MPT1327_TRAFFIC( new boolean[]
{
true, false, true, false, //1010 Includes 4 of 16 rev bits
// false, true, false, true, //1010 Includes 4 of 16 rev bits
false, false, true, true, //0011 0x3
true, false, true, true, //1011 0xB
false, false, true, false, //0010 0x2

View File

@@ -79,7 +79,11 @@ public class DecoderFactory
ltrNetConfig.getMessageDirection() );
break;
case MPT1327:
retVal = new MPT1327Decoder( sampleType, aliasList );
DecodeConfigMPT1327 mptConfig = (DecodeConfigMPT1327)config;
retVal = new MPT1327Decoder( sampleType, aliasList,
mptConfig.getSync() );
break;
case PASSPORT:
retVal = new PassportDecoder( sampleType, aliasList );

View File

@@ -17,13 +17,16 @@
******************************************************************************/
package decode.config;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import decode.DecoderType;
import decode.mpt1327.MPT1327Decoder.Sync;
public class DecodeConfigMPT1327 extends DecodeConfiguration
{
private String mChannelMapName;
private Sync mSync = Sync.NORMAL;
public DecodeConfigMPT1327()
{
@@ -40,4 +43,15 @@ public class DecodeConfigMPT1327 extends DecodeConfiguration
{
mChannelMapName = name;
}
@XmlAttribute( name="sync" )
public Sync getSync()
{
return mSync;
}
public void setSync( Sync sync )
{
mSync = sync;
}
}

View File

@@ -82,7 +82,9 @@ public class MPT1327Decoder extends Decoder implements Instrumentable
private MessageFramer mTrafficMessageFramer;
private MPT1327MessageProcessor mMessageProcessor;
public MPT1327Decoder( SampleType sampleType, AliasList aliasList )
public MPT1327Decoder( SampleType sampleType,
AliasList aliasList,
Sync sync )
{
super( sampleType );
@@ -134,13 +136,13 @@ public class MPT1327Decoder extends Decoder implements Instrumentable
/* Message framer for control channel messages */
mControlMessageFramer =
new MessageFramer( SyncPattern.MPT1327_CONTROL.getPattern(),
new MessageFramer( sync.getControlSyncPattern().getPattern(),
sMESSAGE_LENGTH );
mSymbolBroadcaster.addListener( mControlMessageFramer );
/* Message framer for traffic channel massages */
mTrafficMessageFramer =
new MessageFramer( SyncPattern.MPT1327_TRAFFIC.getPattern(),
new MessageFramer( sync.getTrafficSyncPattern().getPattern(),
sMESSAGE_LENGTH );
mSymbolBroadcaster.addListener( mTrafficMessageFramer );
@@ -280,4 +282,47 @@ public class MPT1327Decoder extends Decoder implements Instrumentable
break;
}
}
public enum Sync
{
NORMAL( "Normal",
SyncPattern.MPT1327_CONTROL,
SyncPattern.MPT1327_TRAFFIC ),
FRENCH( "French",
SyncPattern.MPT1327_CONTROL_FRENCH,
SyncPattern.MPT1327_TRAFFIC );
private String mLabel;
private SyncPattern mControlSyncPattern;
private SyncPattern mTrafficSyncPattern;
private Sync( String label,
SyncPattern controlPattern,
SyncPattern trafficPattern )
{
mLabel = label;
mControlSyncPattern = controlPattern;
mTrafficSyncPattern = trafficPattern;
}
public String getLabel()
{
return mLabel;
}
public SyncPattern getControlSyncPattern()
{
return mControlSyncPattern;
}
public SyncPattern getTrafficSyncPattern()
{
return mTrafficSyncPattern;
}
public String toString()
{
return getLabel();
}
}
}

View File

@@ -28,12 +28,14 @@ import controller.channel.ChannelNode;
import decode.DecodeEditor;
import decode.config.DecodeConfigMPT1327;
import decode.config.DecodeConfiguration;
import decode.mpt1327.MPT1327Decoder.Sync;
public class MPT1327Editor extends DecodeEditor
{
private static final long serialVersionUID = 1L;
private JComboBox<ChannelMap> mComboChannelMaps;
private JComboBox<Sync> mComboSync;
private ChannelNode mChannelNode;
public MPT1327Editor( DecodeConfiguration config, ChannelNode channelNode )
@@ -62,24 +64,41 @@ public class MPT1327Editor extends DecodeEditor
add( new JLabel( "Channel Map" ), "wrap" );
add( mComboChannelMaps, "wrap" );
mComboSync = new JComboBox<Sync>();
mComboSync.setModel( new DefaultComboBoxModel<Sync>( Sync.values() ) );
add( new JLabel( "Sync" ), "wrap" );
add( mComboSync, "wrap" );
reset();
}
@Override
public void save()
{
DecodeConfigMPT1327 config = (DecodeConfigMPT1327)mConfig;
ChannelMap selected = (ChannelMap)mComboChannelMaps.getSelectedItem();
if( selected != null )
{
((DecodeConfigMPT1327)mConfig).setChannelMapName( selected.getName() );
config.setChannelMapName( selected.getName() );
}
Sync selectedSync = (Sync)mComboSync.getSelectedItem();
if( selectedSync != null )
{
config.setSync( selectedSync );
}
}
@Override
public void reset()
{
String name = ((DecodeConfigMPT1327)mConfig).getChannelMapName();
DecodeConfigMPT1327 config = (DecodeConfigMPT1327)mConfig;
String name = config.getChannelMapName();
ChannelMap selected = null;
@@ -99,5 +118,7 @@ public class MPT1327Editor extends DecodeEditor
mComboChannelMaps.setSelectedItem( selected );
mComboChannelMaps.requestFocus();
mComboChannelMaps.requestFocusInWindow();
mComboSync.setSelectedItem( config.getSync() );
}
}

View File

@@ -46,6 +46,7 @@ import decode.fleetsync2.Fleetsync2Decoder;
import decode.ltrnet.LTRNetDecoder;
import decode.mdc1200.MDCDecoder;
import decode.mpt1327.MPT1327Decoder;
import decode.mpt1327.MPT1327Decoder.Sync;
import decode.p25.P25Decoder;
import decode.passport.PassportDecoder;
@@ -143,7 +144,7 @@ public class WaveSourceFrame extends JInternalFrame implements PositionListener
decoder = new MDCDecoder( null );
break;
case MPT1327:
decoder = new MPT1327Decoder( SampleType.FLOAT, null );
decoder = new MPT1327Decoder( SampleType.FLOAT, null, Sync.NORMAL );
break;
case PASSPORT:
decoder = new PassportDecoder( SampleType.FLOAT, null );