[WIP] Creates a new AFSK-1200 correlation decoder and updates the

Fleetsync II decoder to use it.  Adds instrumented version of the decoder
and a new Fleetsync2 FX pane to the DemodulatorViewerFX tool.

Note: the remaining AFSK-1200 based decoders will all be ported to use
this new AFSK1200 decoder (MDC1200, Tait1200, LowJack1200).
This commit is contained in:
Denny
2018-06-09 08:17:18 -04:00
parent a5c8552937
commit 9dda1f95a1
14 changed files with 547 additions and 207 deletions

View File

@@ -20,34 +20,25 @@ package io.github.dsheirer.module.decode.fleetsync2;
import io.github.dsheirer.alias.AliasList;
import io.github.dsheirer.bits.MessageFramer;
import io.github.dsheirer.bits.SyncPattern;
import io.github.dsheirer.dsp.fsk.AFSK1200Decoder;
import io.github.dsheirer.dsp.symbol.ISyncDetectListener;
import io.github.dsheirer.dsp.symbol.SyncDetectProvider;
import io.github.dsheirer.module.decode.Decoder;
import io.github.dsheirer.dsp.afsk.AFSK1200Decoder;
import io.github.dsheirer.module.decode.DecoderType;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.buffer.IReusableBufferListener;
import io.github.dsheirer.sample.buffer.ReusableBuffer;
import io.github.dsheirer.module.decode.afsk.AbstractAFSKDecoder;
/**
* Fleetsync II Decoder
*/
public class Fleetsync2Decoder extends Decoder implements IReusableBufferListener, Listener<ReusableBuffer>,
SyncDetectProvider
public class Fleetsync2Decoder extends AbstractAFSKDecoder
{
/* Message length - 5 x REVS + 16 x SYNC + 8 x 64Bit Blocks */
protected static final int MESSAGE_LENGTH = 537;
protected AFSK1200Decoder mAFSK1200Decoder;
//Message length - 5 x REVS + 16 x SYNC + 8 x 64Bit Blocks
private static final int MESSAGE_LENGTH = 537;
private MessageFramer mMessageFramer;
private Fleetsync2MessageProcessor mMessageProcessor;
public Fleetsync2Decoder(AFSK1200Decoder afsk1200Decoder, AliasList aliasList)
{
mAFSK1200Decoder = afsk1200Decoder;
super(afsk1200Decoder);
mMessageFramer = new MessageFramer(SyncPattern.FLEETSYNC2.getPattern(), MESSAGE_LENGTH);
mAFSK1200Decoder.setMessageFramer(mMessageFramer);
mMessageFramer.setSyncDetectListener(mAFSK1200Decoder);
getDecoder().setMessageFramer(mMessageFramer);
mMessageProcessor = new Fleetsync2MessageProcessor(aliasList);
mMessageFramer.addMessageListener(mMessageProcessor);
mMessageProcessor.setMessageListener(getMessageListener());
@@ -55,12 +46,7 @@ public class Fleetsync2Decoder extends Decoder implements IReusableBufferListene
public Fleetsync2Decoder(AliasList aliasList)
{
this(new AFSK1200Decoder(MESSAGE_LENGTH, false), aliasList);
}
public void dispose()
{
super.dispose();
this(new AFSK1200Decoder(AFSK1200Decoder.Output.NORMAL), aliasList);
}
@Override
@@ -69,27 +55,9 @@ public class Fleetsync2Decoder extends Decoder implements IReusableBufferListene
return DecoderType.FLEETSYNC2;
}
@Override
public Listener<ReusableBuffer> getReusableBufferListener()
{
return mAFSK1200Decoder;
}
@Override
public void receive(ReusableBuffer reusableBuffer)
{
mAFSK1200Decoder.receive(reusableBuffer);
}
@Override
public void reset()
{
mMessageFramer.reset();
}
@Override
public void setSyncDetectListener(ISyncDetectListener listener)
{
mMessageFramer.setSyncDetectListener(listener);
}
}

View File

@@ -15,28 +15,25 @@
******************************************************************************/
package io.github.dsheirer.module.decode.fleetsync2;
import io.github.dsheirer.alias.AliasList;
import io.github.dsheirer.dsp.fsk.AFSK1200Decoder;
import io.github.dsheirer.dsp.fsk.AFSK1200DecoderInstrumented;
import io.github.dsheirer.dsp.fsk.SampleBufferInstrumented;
import io.github.dsheirer.dsp.fsk.ZeroCrossingErrorDetectorInstrumented;
import io.github.dsheirer.dsp.afsk.AFSK1200DecoderInstrumented;
import io.github.dsheirer.sample.buffer.ReusableBuffer;
import javafx.beans.property.SimpleIntegerProperty;
/**
* Instrumented version of the AFSK-1200 decoder for use with DemodulatorViewerFX
*/
public class Fleetsync2DecoderInstrumented extends Fleetsync2Decoder
{
public SimpleIntegerProperty bufferCount = new SimpleIntegerProperty();
public Fleetsync2DecoderInstrumented(AliasList aliasList)
public Fleetsync2DecoderInstrumented()
{
super(new AFSK1200DecoderInstrumented(MESSAGE_LENGTH,
new SampleBufferInstrumented(AFSK1200Decoder.SAMPLES_PER_SYMBOL, AFSK1200Decoder.COARSE_TIMING_GAIN),
new ZeroCrossingErrorDetectorInstrumented(AFSK1200Decoder.SAMPLES_PER_SYMBOL), false), aliasList);
super(new AFSK1200DecoderInstrumented(false), null);
}
public AFSK1200DecoderInstrumented getAFSK1200Decoder()
{
return (AFSK1200DecoderInstrumented)mAFSK1200Decoder;
return (AFSK1200DecoderInstrumented)getDecoder();
}
@Override