mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 17:17:29 -05:00
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:
@@ -68,18 +68,32 @@ public enum SyncPattern
|
|||||||
MPT1327_CONTROL( new boolean[]
|
MPT1327_CONTROL( new boolean[]
|
||||||
{
|
{
|
||||||
true, false, true, false, //Includes 4 of 16 rev bits
|
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
|
true, true, false, false, //1100 0xA
|
||||||
false, true, false, false, //0100 0x4
|
false, true, false, false, //0100 0x4
|
||||||
true, true, false, true, //1101 0xD
|
true, true, false, true, //1101 0xD
|
||||||
false, true, true, true //0111 0x7
|
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 */
|
/* Revs (0xA) and Sync(0x3B28) = 1010 0011101100101000 */
|
||||||
MPT1327_TRAFFIC( new boolean[]
|
MPT1327_TRAFFIC( new boolean[]
|
||||||
{
|
{
|
||||||
true, false, true, false, //1010 Includes 4 of 16 rev bits
|
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
|
false, false, true, true, //0011 0x3
|
||||||
true, false, true, true, //1011 0xB
|
true, false, true, true, //1011 0xB
|
||||||
false, false, true, false, //0010 0x2
|
false, false, true, false, //0010 0x2
|
||||||
|
|||||||
@@ -79,7 +79,11 @@ public class DecoderFactory
|
|||||||
ltrNetConfig.getMessageDirection() );
|
ltrNetConfig.getMessageDirection() );
|
||||||
break;
|
break;
|
||||||
case MPT1327:
|
case MPT1327:
|
||||||
retVal = new MPT1327Decoder( sampleType, aliasList );
|
DecodeConfigMPT1327 mptConfig = (DecodeConfigMPT1327)config;
|
||||||
|
|
||||||
|
|
||||||
|
retVal = new MPT1327Decoder( sampleType, aliasList,
|
||||||
|
mptConfig.getSync() );
|
||||||
break;
|
break;
|
||||||
case PASSPORT:
|
case PASSPORT:
|
||||||
retVal = new PassportDecoder( sampleType, aliasList );
|
retVal = new PassportDecoder( sampleType, aliasList );
|
||||||
|
|||||||
@@ -17,13 +17,16 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package decode.config;
|
package decode.config;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
|
||||||
import decode.DecoderType;
|
import decode.DecoderType;
|
||||||
|
import decode.mpt1327.MPT1327Decoder.Sync;
|
||||||
|
|
||||||
public class DecodeConfigMPT1327 extends DecodeConfiguration
|
public class DecodeConfigMPT1327 extends DecodeConfiguration
|
||||||
{
|
{
|
||||||
private String mChannelMapName;
|
private String mChannelMapName;
|
||||||
|
private Sync mSync = Sync.NORMAL;
|
||||||
|
|
||||||
public DecodeConfigMPT1327()
|
public DecodeConfigMPT1327()
|
||||||
{
|
{
|
||||||
@@ -40,4 +43,15 @@ public class DecodeConfigMPT1327 extends DecodeConfiguration
|
|||||||
{
|
{
|
||||||
mChannelMapName = name;
|
mChannelMapName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlAttribute( name="sync" )
|
||||||
|
public Sync getSync()
|
||||||
|
{
|
||||||
|
return mSync;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSync( Sync sync )
|
||||||
|
{
|
||||||
|
mSync = sync;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,9 @@ public class MPT1327Decoder extends Decoder implements Instrumentable
|
|||||||
private MessageFramer mTrafficMessageFramer;
|
private MessageFramer mTrafficMessageFramer;
|
||||||
private MPT1327MessageProcessor mMessageProcessor;
|
private MPT1327MessageProcessor mMessageProcessor;
|
||||||
|
|
||||||
public MPT1327Decoder( SampleType sampleType, AliasList aliasList )
|
public MPT1327Decoder( SampleType sampleType,
|
||||||
|
AliasList aliasList,
|
||||||
|
Sync sync )
|
||||||
{
|
{
|
||||||
super( sampleType );
|
super( sampleType );
|
||||||
|
|
||||||
@@ -134,13 +136,13 @@ public class MPT1327Decoder extends Decoder implements Instrumentable
|
|||||||
|
|
||||||
/* Message framer for control channel messages */
|
/* Message framer for control channel messages */
|
||||||
mControlMessageFramer =
|
mControlMessageFramer =
|
||||||
new MessageFramer( SyncPattern.MPT1327_CONTROL.getPattern(),
|
new MessageFramer( sync.getControlSyncPattern().getPattern(),
|
||||||
sMESSAGE_LENGTH );
|
sMESSAGE_LENGTH );
|
||||||
mSymbolBroadcaster.addListener( mControlMessageFramer );
|
mSymbolBroadcaster.addListener( mControlMessageFramer );
|
||||||
|
|
||||||
/* Message framer for traffic channel massages */
|
/* Message framer for traffic channel massages */
|
||||||
mTrafficMessageFramer =
|
mTrafficMessageFramer =
|
||||||
new MessageFramer( SyncPattern.MPT1327_TRAFFIC.getPattern(),
|
new MessageFramer( sync.getTrafficSyncPattern().getPattern(),
|
||||||
sMESSAGE_LENGTH );
|
sMESSAGE_LENGTH );
|
||||||
mSymbolBroadcaster.addListener( mTrafficMessageFramer );
|
mSymbolBroadcaster.addListener( mTrafficMessageFramer );
|
||||||
|
|
||||||
@@ -280,4 +282,47 @@ public class MPT1327Decoder extends Decoder implements Instrumentable
|
|||||||
break;
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,12 +28,14 @@ import controller.channel.ChannelNode;
|
|||||||
import decode.DecodeEditor;
|
import decode.DecodeEditor;
|
||||||
import decode.config.DecodeConfigMPT1327;
|
import decode.config.DecodeConfigMPT1327;
|
||||||
import decode.config.DecodeConfiguration;
|
import decode.config.DecodeConfiguration;
|
||||||
|
import decode.mpt1327.MPT1327Decoder.Sync;
|
||||||
|
|
||||||
public class MPT1327Editor extends DecodeEditor
|
public class MPT1327Editor extends DecodeEditor
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private JComboBox<ChannelMap> mComboChannelMaps;
|
private JComboBox<ChannelMap> mComboChannelMaps;
|
||||||
|
private JComboBox<Sync> mComboSync;
|
||||||
private ChannelNode mChannelNode;
|
private ChannelNode mChannelNode;
|
||||||
|
|
||||||
public MPT1327Editor( DecodeConfiguration config, ChannelNode channelNode )
|
public MPT1327Editor( DecodeConfiguration config, ChannelNode channelNode )
|
||||||
@@ -62,24 +64,41 @@ public class MPT1327Editor extends DecodeEditor
|
|||||||
add( new JLabel( "Channel Map" ), "wrap" );
|
add( new JLabel( "Channel Map" ), "wrap" );
|
||||||
add( mComboChannelMaps, "wrap" );
|
add( mComboChannelMaps, "wrap" );
|
||||||
|
|
||||||
|
mComboSync = new JComboBox<Sync>();
|
||||||
|
mComboSync.setModel( new DefaultComboBoxModel<Sync>( Sync.values() ) );
|
||||||
|
|
||||||
|
add( new JLabel( "Sync" ), "wrap" );
|
||||||
|
add( mComboSync, "wrap" );
|
||||||
|
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void save()
|
public void save()
|
||||||
{
|
{
|
||||||
|
DecodeConfigMPT1327 config = (DecodeConfigMPT1327)mConfig;
|
||||||
|
|
||||||
ChannelMap selected = (ChannelMap)mComboChannelMaps.getSelectedItem();
|
ChannelMap selected = (ChannelMap)mComboChannelMaps.getSelectedItem();
|
||||||
|
|
||||||
if( selected != null )
|
if( selected != null )
|
||||||
{
|
{
|
||||||
((DecodeConfigMPT1327)mConfig).setChannelMapName( selected.getName() );
|
config.setChannelMapName( selected.getName() );
|
||||||
|
}
|
||||||
|
|
||||||
|
Sync selectedSync = (Sync)mComboSync.getSelectedItem();
|
||||||
|
|
||||||
|
if( selectedSync != null )
|
||||||
|
{
|
||||||
|
config.setSync( selectedSync );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset()
|
public void reset()
|
||||||
{
|
{
|
||||||
String name = ((DecodeConfigMPT1327)mConfig).getChannelMapName();
|
DecodeConfigMPT1327 config = (DecodeConfigMPT1327)mConfig;
|
||||||
|
|
||||||
|
String name = config.getChannelMapName();
|
||||||
|
|
||||||
ChannelMap selected = null;
|
ChannelMap selected = null;
|
||||||
|
|
||||||
@@ -99,5 +118,7 @@ public class MPT1327Editor extends DecodeEditor
|
|||||||
mComboChannelMaps.setSelectedItem( selected );
|
mComboChannelMaps.setSelectedItem( selected );
|
||||||
mComboChannelMaps.requestFocus();
|
mComboChannelMaps.requestFocus();
|
||||||
mComboChannelMaps.requestFocusInWindow();
|
mComboChannelMaps.requestFocusInWindow();
|
||||||
|
|
||||||
|
mComboSync.setSelectedItem( config.getSync() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ import decode.fleetsync2.Fleetsync2Decoder;
|
|||||||
import decode.ltrnet.LTRNetDecoder;
|
import decode.ltrnet.LTRNetDecoder;
|
||||||
import decode.mdc1200.MDCDecoder;
|
import decode.mdc1200.MDCDecoder;
|
||||||
import decode.mpt1327.MPT1327Decoder;
|
import decode.mpt1327.MPT1327Decoder;
|
||||||
|
import decode.mpt1327.MPT1327Decoder.Sync;
|
||||||
import decode.p25.P25Decoder;
|
import decode.p25.P25Decoder;
|
||||||
import decode.passport.PassportDecoder;
|
import decode.passport.PassportDecoder;
|
||||||
|
|
||||||
@@ -143,7 +144,7 @@ public class WaveSourceFrame extends JInternalFrame implements PositionListener
|
|||||||
decoder = new MDCDecoder( null );
|
decoder = new MDCDecoder( null );
|
||||||
break;
|
break;
|
||||||
case MPT1327:
|
case MPT1327:
|
||||||
decoder = new MPT1327Decoder( SampleType.FLOAT, null );
|
decoder = new MPT1327Decoder( SampleType.FLOAT, null, Sync.NORMAL );
|
||||||
break;
|
break;
|
||||||
case PASSPORT:
|
case PASSPORT:
|
||||||
decoder = new PassportDecoder( SampleType.FLOAT, null );
|
decoder = new PassportDecoder( SampleType.FLOAT, null );
|
||||||
|
|||||||
Reference in New Issue
Block a user