mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-17 11:07:35 -05:00
Adds event logging, code cleanup and some decoder issue resolution.
This commit is contained in:
@@ -24,6 +24,6 @@
|
|||||||
<classpathentry kind="lib" path="imports/logback-classic-1.1.2.jar"/>
|
<classpathentry kind="lib" path="imports/logback-classic-1.1.2.jar"/>
|
||||||
<classpathentry kind="lib" path="imports/logback-core-1.1.2.jar"/>
|
<classpathentry kind="lib" path="imports/logback-core-1.1.2.jar"/>
|
||||||
<classpathentry kind="lib" path="imports/commons-io-2.4.jar"/>
|
<classpathentry kind="lib" path="imports/commons-io-2.4.jar"/>
|
||||||
<classpathentry kind="lib" path="imports/jmbe-interface-0.2.0.jar"/>
|
<classpathentry kind="lib" path="imports/jmbe-interface-0.2.1.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import java.util.HashMap;
|
|||||||
import javax.xml.bind.annotation.XmlAttribute;
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||||
import javax.xml.bind.annotation.XmlTransient;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ package alias.action;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import message.Message;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import message.Message;
|
|
||||||
import module.decode.p25.P25_LSMDecoder;
|
|
||||||
import sample.Listener;
|
import sample.Listener;
|
||||||
import alias.Alias;
|
import alias.Alias;
|
||||||
import controller.ResourceManager;
|
import controller.ResourceManager;
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import alias.action.RecurringAction.Interval;
|
import alias.action.RecurringAction.Interval;
|
||||||
import alias.action.script.ScriptActionEditor;
|
|
||||||
|
|
||||||
public class ClipActionEditor extends JPanel implements ActionListener
|
public class ClipActionEditor extends JPanel implements ActionListener
|
||||||
{
|
{
|
||||||
@@ -52,7 +51,6 @@ public class ClipActionEditor extends JPanel implements ActionListener
|
|||||||
LoggerFactory.getLogger( ClipActionEditor.class );
|
LoggerFactory.getLogger( ClipActionEditor.class );
|
||||||
|
|
||||||
private ClipActionNode mClipActionNode;
|
private ClipActionNode mClipActionNode;
|
||||||
private JTextField mTextSiteID;
|
|
||||||
private JComboBox<Interval> mComboInterval;
|
private JComboBox<Interval> mComboInterval;
|
||||||
private JSpinner mSpinnerPeriod;
|
private JSpinner mSpinnerPeriod;
|
||||||
private JTextField mTextFilePath;
|
private JTextField mTextFilePath;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package alias.esn;
|
|||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
import javax.swing.BorderFactory;
|
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package alias.fleetsync;
|
|||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
import javax.swing.BorderFactory;
|
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package alias.mdc;
|
|||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
import javax.swing.BorderFactory;
|
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package alias.mobileID;
|
|||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
import javax.swing.BorderFactory;
|
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package alias.talkgroup;
|
|||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
import javax.swing.BorderFactory;
|
|
||||||
import javax.swing.DefaultComboBoxModel;
|
import javax.swing.DefaultComboBoxModel;
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
|
|||||||
@@ -347,6 +347,8 @@ public class AudioChannelPanel extends JPanel
|
|||||||
mToLabel.setForeground( mDetailsColor );
|
mToLabel.setForeground( mDetailsColor );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ public class MultiSyncPatternMatcher
|
|||||||
mMask = (long)( ( Math.pow( 2, syncSize ) ) - 1 );
|
mMask = (long)( ( Math.pow( 2, syncSize ) ) - 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dispose()
|
||||||
|
{
|
||||||
|
mSyncProcessors.clear();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes two bits before checking sync processors for a match.
|
* Processes two bits before checking sync processors for a match.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -18,6 +18,11 @@ public class SoftSyncDetector implements ISyncProcessor
|
|||||||
mPattern = pattern;
|
mPattern = pattern;
|
||||||
mThreshold = threshold;
|
mThreshold = threshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dispose()
|
||||||
|
{
|
||||||
|
mListener = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void checkSync( long value )
|
public void checkSync( long value )
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ package controller;
|
|||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Font;
|
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
package controller;
|
package controller;
|
||||||
|
|
||||||
import map.MapService;
|
import map.MapService;
|
||||||
|
import module.log.EventLogManager;
|
||||||
import playlist.PlaylistManager;
|
import playlist.PlaylistManager;
|
||||||
import record.RecorderManager;
|
import record.RecorderManager;
|
||||||
import settings.SettingsManager;
|
import settings.SettingsManager;
|
||||||
@@ -26,7 +27,6 @@ import source.recording.RecordingSourceManager;
|
|||||||
import source.tuner.TunerManager;
|
import source.tuner.TunerManager;
|
||||||
import audio.AudioManager;
|
import audio.AudioManager;
|
||||||
import controller.channel.ChannelManager;
|
import controller.channel.ChannelManager;
|
||||||
import eventlog.EventLogManager;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manager for system wide resources
|
* Manager for system wide resources
|
||||||
|
|||||||
@@ -19,14 +19,10 @@ package controller;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
|
||||||
import java.util.concurrent.RejectedExecutionException;
|
import java.util.concurrent.RejectedExecutionException;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.ScheduledFuture;
|
import java.util.concurrent.ScheduledFuture;
|
||||||
import java.util.concurrent.ThreadFactory;
|
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ import module.decode.config.DecodeConfiguration;
|
|||||||
import module.decode.event.CallEventModel;
|
import module.decode.event.CallEventModel;
|
||||||
import module.decode.event.MessageActivityModel;
|
import module.decode.event.MessageActivityModel;
|
||||||
import module.decode.state.ChannelState;
|
import module.decode.state.ChannelState;
|
||||||
|
import module.log.MessageEventLogger;
|
||||||
|
import module.log.config.EventLogConfiguration;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -61,8 +63,6 @@ import controller.channel.ChannelEvent.Event;
|
|||||||
import controller.config.Configuration;
|
import controller.config.Configuration;
|
||||||
import controller.site.Site;
|
import controller.site.Site;
|
||||||
import controller.system.System;
|
import controller.system.System;
|
||||||
import eventlog.MessageEventLogger;
|
|
||||||
import eventlog.config.EventLogConfiguration;
|
|
||||||
import filter.FilterSet;
|
import filter.FilterSet;
|
||||||
|
|
||||||
@XmlSeeAlso( { Configuration.class } )
|
@XmlSeeAlso( { Configuration.class } )
|
||||||
@@ -739,10 +739,34 @@ public class Channel extends Configuration
|
|||||||
|
|
||||||
setupSource();
|
setupSource();
|
||||||
|
|
||||||
//TODO: Add logging
|
setupLogging();
|
||||||
//TODO: Add recorder(s)
|
//TODO: Add recorder(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setupLogging()
|
||||||
|
{
|
||||||
|
mLog.debug( "Setting up logging ..." );
|
||||||
|
if( mProcessingChain != null )
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append( mSystem );
|
||||||
|
sb.append( "_" );
|
||||||
|
sb.append( mSite );
|
||||||
|
sb.append( "_" );
|
||||||
|
sb.append( mName );
|
||||||
|
|
||||||
|
List<Module> loggers = mResourceManager.getEventLogManager()
|
||||||
|
.getLoggers( mEventLogConfiguration, sb.toString() );
|
||||||
|
|
||||||
|
mLog.debug( "Created [" + loggers.size() + "] loggers for [" + sb.toString() + "]" );
|
||||||
|
|
||||||
|
if( !loggers.isEmpty() )
|
||||||
|
{
|
||||||
|
mProcessingChain.addModules( loggers );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void setupProcessingChain()
|
private void setupProcessingChain()
|
||||||
{
|
{
|
||||||
if( mProcessingChain == null )
|
if( mProcessingChain == null )
|
||||||
@@ -764,7 +788,7 @@ public class Channel extends Configuration
|
|||||||
mProcessingChain.addModules( modules );
|
mProcessingChain.addModules( modules );
|
||||||
|
|
||||||
/* Get message filters for the set of processing modules */
|
/* Get message filters for the set of processing modules */
|
||||||
FilterSet messageFilter = DecoderFactory.getMessageFilters( modules );
|
FilterSet<Message> messageFilter = DecoderFactory.getMessageFilters( modules );
|
||||||
|
|
||||||
/* Setup the message activity model and add message listeners */
|
/* Setup the message activity model and add message listeners */
|
||||||
mMessageActivityModel = new MessageActivityModel( messageFilter );
|
mMessageActivityModel = new MessageActivityModel( messageFilter );
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import javax.swing.tree.TreePath;
|
|||||||
|
|
||||||
import module.decode.AuxDecodeComponentEditor;
|
import module.decode.AuxDecodeComponentEditor;
|
||||||
import module.decode.DecodeComponentEditor;
|
import module.decode.DecodeComponentEditor;
|
||||||
|
import module.log.EventLogComponentEditor;
|
||||||
import net.miginfocom.swing.MigLayout;
|
import net.miginfocom.swing.MigLayout;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -49,7 +50,6 @@ import alias.AliasList;
|
|||||||
import com.jidesoft.swing.JideTabbedPane;
|
import com.jidesoft.swing.JideTabbedPane;
|
||||||
|
|
||||||
import controller.Editor;
|
import controller.Editor;
|
||||||
import eventlog.EventLogComponentEditor;
|
|
||||||
|
|
||||||
public class ChannelEditor extends Editor implements ActionListener
|
public class ChannelEditor extends Editor implements ActionListener
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,16 +17,15 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package controller.channel;
|
package controller.channel;
|
||||||
|
|
||||||
import gui.SDRTrunk;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import message.Message;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import alias.action.AliasActionManager;
|
|
||||||
import message.Message;
|
|
||||||
import sample.Listener;
|
import sample.Listener;
|
||||||
|
import alias.action.AliasActionManager;
|
||||||
import controller.ResourceManager;
|
import controller.ResourceManager;
|
||||||
|
|
||||||
public class ChannelManager implements ChannelEventListener
|
public class ChannelManager implements ChannelEventListener
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package controller.channel;
|
|
||||||
|
|
||||||
import module.ProcessingChainOld;
|
|
||||||
|
|
||||||
public interface ChannelSelectionListener
|
|
||||||
{
|
|
||||||
public void channelSelected( ProcessingChainOld channel );
|
|
||||||
}
|
|
||||||
@@ -22,9 +22,9 @@ import javax.xml.bind.annotation.XmlSeeAlso;
|
|||||||
|
|
||||||
import module.decode.config.AuxDecodeConfiguration;
|
import module.decode.config.AuxDecodeConfiguration;
|
||||||
import module.decode.config.DecodeConfiguration;
|
import module.decode.config.DecodeConfiguration;
|
||||||
|
import module.log.config.EventLogConfiguration;
|
||||||
import record.config.RecordConfiguration;
|
import record.config.RecordConfiguration;
|
||||||
import source.config.SourceConfiguration;
|
import source.config.SourceConfiguration;
|
||||||
import eventlog.config.EventLogConfiguration;
|
|
||||||
|
|
||||||
@XmlSeeAlso( { AuxDecodeConfiguration.class,
|
@XmlSeeAlso( { AuxDecodeConfiguration.class,
|
||||||
DecodeConfiguration.class,
|
DecodeConfiguration.class,
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import javax.swing.JSeparator;
|
|||||||
import javax.swing.tree.DefaultMutableTreeNode;
|
import javax.swing.tree.DefaultMutableTreeNode;
|
||||||
|
|
||||||
import controller.ConfigurableNode;
|
import controller.ConfigurableNode;
|
||||||
import controller.channel.ChannelNode;
|
|
||||||
import controller.site.Site;
|
import controller.site.Site;
|
||||||
import controller.site.SiteNode;
|
import controller.site.SiteNode;
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import java.util.Arrays;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
|
|
||||||
import org.jtransforms.fft.DoubleFFT_1D;
|
|
||||||
import org.jtransforms.fft.FloatFFT_1D;
|
import org.jtransforms.fft.FloatFFT_1D;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package dsp.filter;
|
package dsp.filter;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package dsp.fm;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import record.wave.ComplexWaveRecorder;
|
|
||||||
import sample.Listener;
|
import sample.Listener;
|
||||||
import sample.complex.ComplexBuffer;
|
import sample.complex.ComplexBuffer;
|
||||||
import sample.real.RateCounter_RB;
|
import sample.real.RateCounter_RB;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package dsp.gain;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import sample.Listener;
|
|
||||||
import sample.complex.Complex;
|
import sample.complex.Complex;
|
||||||
import sample.complex.ComplexSampleListener;
|
import sample.complex.ComplexSampleListener;
|
||||||
import buffer.FloatCircularBuffer;
|
import buffer.FloatCircularBuffer;
|
||||||
@@ -62,6 +61,11 @@ public class ComplexFeedForwardGainControl implements ComplexSampleListener
|
|||||||
{
|
{
|
||||||
mEnvelopeHistory = new FloatCircularBuffer( window );
|
mEnvelopeHistory = new FloatCircularBuffer( window );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dispose()
|
||||||
|
{
|
||||||
|
mListener = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive( float inphase, float quadrature )
|
public void receive( float inphase, float quadrature )
|
||||||
|
|||||||
@@ -57,6 +57,11 @@ public class DirectGainControl implements GainController, RealSampleListener
|
|||||||
mMaximum = maximum;
|
mMaximum = maximum;
|
||||||
mIncrement = increment;
|
mIncrement = increment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dispose()
|
||||||
|
{
|
||||||
|
mListener = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive( float sample )
|
public void receive( float sample )
|
||||||
|
|||||||
@@ -84,6 +84,12 @@ public class CQPSKDemodulator implements Instrumentable, ComplexSampleListener
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dispose()
|
||||||
|
{
|
||||||
|
mSymbolListener = null;
|
||||||
|
mFrequencyChangeListener = null;
|
||||||
|
}
|
||||||
|
|
||||||
public void setSymbolListener( Listener<Complex> listener )
|
public void setSymbolListener( Listener<Complex> listener )
|
||||||
{
|
{
|
||||||
mSymbolListener = listener;
|
mSymbolListener = listener;
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ public class CQPSKDemodulator2 implements Instrumentable, ComplexSampleListener,
|
|||||||
* Constrains timing error to +/- the maximum value and corrects any
|
* Constrains timing error to +/- the maximum value and corrects any
|
||||||
* floating point invalid numbers
|
* floating point invalid numbers
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private float normalize( float error, float maximum )
|
private float normalize( float error, float maximum )
|
||||||
{
|
{
|
||||||
if( Float.isNaN( error ) )
|
if( Float.isNaN( error ) )
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package edac;
|
package edac;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|||||||
@@ -27,16 +27,12 @@ import java.awt.event.ActionListener;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.nio.file.FileSystems;
|
import java.nio.file.FileSystems;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.ServiceLoader;
|
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import javax.sound.sampled.spi.FormatConversionProvider;
|
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JMenu;
|
import javax.swing.JMenu;
|
||||||
import javax.swing.JMenuBar;
|
import javax.swing.JMenuBar;
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ package instrument.tap.stream;
|
|||||||
|
|
||||||
import instrument.tap.TapListener;
|
import instrument.tap.TapListener;
|
||||||
import instrument.tap.TapType;
|
import instrument.tap.TapType;
|
||||||
import sample.Listener;
|
|
||||||
import sample.complex.Complex;
|
import sample.complex.Complex;
|
||||||
import sample.complex.ComplexSampleListener;
|
import sample.complex.ComplexSampleListener;
|
||||||
|
|
||||||
|
|||||||
@@ -17,13 +17,12 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package instrument.tap.stream;
|
package instrument.tap.stream;
|
||||||
|
|
||||||
import module.decode.p25.P25_LSMDecoder;
|
import instrument.tap.TapListener;
|
||||||
|
import instrument.tap.TapType;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import instrument.tap.TapListener;
|
|
||||||
import instrument.tap.TapType;
|
|
||||||
import sample.Listener;
|
import sample.Listener;
|
||||||
|
|
||||||
public class EyeDiagramDataTap extends StreamTap implements Listener<EyeDiagramData>
|
public class EyeDiagramDataTap extends StreamTap implements Listener<EyeDiagramData>
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package instrument.tap.stream;
|
|||||||
import instrument.gui.SampleModel;
|
import instrument.gui.SampleModel;
|
||||||
import instrument.tap.TapViewPanel;
|
import instrument.tap.TapViewPanel;
|
||||||
|
|
||||||
import java.awt.BasicStroke;
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package instrument.tap.stream;
|
package instrument.tap.stream;
|
||||||
|
|
||||||
import gui.SDRTrunk;
|
|
||||||
import instrument.gui.SampleModel;
|
import instrument.gui.SampleModel;
|
||||||
import instrument.tap.Tap;
|
import instrument.tap.Tap;
|
||||||
import instrument.tap.TapViewPanel;
|
import instrument.tap.TapViewPanel;
|
||||||
|
|||||||
@@ -17,8 +17,6 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package map;
|
package map;
|
||||||
|
|
||||||
import gui.SDRTrunk;
|
|
||||||
|
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
@@ -45,10 +43,11 @@ import javax.swing.event.ListSelectionEvent;
|
|||||||
import javax.swing.event.ListSelectionListener;
|
import javax.swing.event.ListSelectionListener;
|
||||||
import javax.swing.filechooser.FileFilter;
|
import javax.swing.filechooser.FileFilter;
|
||||||
|
|
||||||
|
import net.miginfocom.swing.MigLayout;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
import settings.Setting;
|
import settings.Setting;
|
||||||
import settings.SettingChangeListener;
|
import settings.SettingChangeListener;
|
||||||
import controller.ResourceManager;
|
import controller.ResourceManager;
|
||||||
@@ -420,6 +419,8 @@ public class IconManager extends JFrame
|
|||||||
JOptionPane.ERROR_MESSAGE );
|
JOptionPane.ERROR_MESSAGE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,10 +24,12 @@ import java.util.concurrent.ScheduledFuture;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
|
import message.IMessageListener;
|
||||||
import message.IMessageProvider;
|
import message.IMessageProvider;
|
||||||
import message.Message;
|
import message.Message;
|
||||||
import module.decode.Decoder;
|
import module.decode.Decoder;
|
||||||
import module.decode.event.CallEvent;
|
import module.decode.event.CallEvent;
|
||||||
|
import module.decode.event.ICallEventListener;
|
||||||
import module.decode.event.ICallEventProvider;
|
import module.decode.event.ICallEventProvider;
|
||||||
import module.decode.state.DecoderStateEvent;
|
import module.decode.state.DecoderStateEvent;
|
||||||
import module.decode.state.DecoderStateEvent.Event;
|
import module.decode.state.DecoderStateEvent.Event;
|
||||||
@@ -82,7 +84,7 @@ import controller.channel.IChannelEventProvider;
|
|||||||
* 5) Invoke the stop() method to stop processing.
|
* 5) Invoke the stop() method to stop processing.
|
||||||
*
|
*
|
||||||
* Optional: if you want to reuse the processing chain with a new sample source,
|
* Optional: if you want to reuse the processing chain with a new sample source,
|
||||||
* invoke the following method sequence: stop(), reset(), setSource(), start()
|
* invoke the following method sequence: stop(), setSource(), start()
|
||||||
*/
|
*/
|
||||||
public class ProcessingChain implements IChannelEventListener
|
public class ProcessingChain implements IChannelEventListener
|
||||||
{
|
{
|
||||||
@@ -271,11 +273,11 @@ public class ProcessingChain implements IChannelEventListener
|
|||||||
{
|
{
|
||||||
mModules.add( module );
|
mModules.add( module );
|
||||||
|
|
||||||
/* Listeners */
|
/* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Listeners <<<<<<<<<<<<<<<<<<<<<<<<<<< */
|
||||||
if( module instanceof IMetadataListener )
|
if( module instanceof ICallEventListener )
|
||||||
{
|
{
|
||||||
mMetadataBroadcaster.addListener(
|
mCallEventBroadcaster.addListener(
|
||||||
((IMetadataListener)module).getMetadataListener() );
|
((ICallEventListener)module).getCallEventListener() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( module instanceof IChannelEventListener )
|
if( module instanceof IChannelEventListener )
|
||||||
@@ -295,6 +297,18 @@ public class ProcessingChain implements IChannelEventListener
|
|||||||
mDecoderStateEventBroadcaster.addListener(
|
mDecoderStateEventBroadcaster.addListener(
|
||||||
((IDecoderStateEventListener)module).getDecoderStateListener() );
|
((IDecoderStateEventListener)module).getDecoderStateListener() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( module instanceof IMessageListener )
|
||||||
|
{
|
||||||
|
mMessageBroadcaster.addListener(
|
||||||
|
((IMessageListener)module).getMessageListener() );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( module instanceof IMetadataListener )
|
||||||
|
{
|
||||||
|
mMetadataBroadcaster.addListener(
|
||||||
|
((IMetadataListener)module).getMetadataListener() );
|
||||||
|
}
|
||||||
|
|
||||||
if( module instanceof IRealBufferListener )
|
if( module instanceof IRealBufferListener )
|
||||||
{
|
{
|
||||||
@@ -308,13 +322,7 @@ public class ProcessingChain implements IChannelEventListener
|
|||||||
((ISquelchStateListener)module).getSquelchStateListener() );
|
((ISquelchStateListener)module).getSquelchStateListener() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Providers */
|
/* >>>>>>>>>>>>>>>>>>> Providers <<<<<<<<<<<<<<<<<<<<<<<<< */
|
||||||
if( module instanceof IMetadataProvider )
|
|
||||||
{
|
|
||||||
((IMetadataProvider)module).setMetadataListener(
|
|
||||||
mMetadataBroadcaster );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( module instanceof IAudioPacketProvider )
|
if( module instanceof IAudioPacketProvider )
|
||||||
{
|
{
|
||||||
((IAudioPacketProvider)module).setAudioPacketListener(
|
((IAudioPacketProvider)module).setAudioPacketListener(
|
||||||
@@ -348,6 +356,12 @@ public class ProcessingChain implements IChannelEventListener
|
|||||||
((IMessageProvider)module).addMessageListener( mMessageBroadcaster );
|
((IMessageProvider)module).addMessageListener( mMessageBroadcaster );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( module instanceof IMetadataProvider )
|
||||||
|
{
|
||||||
|
((IMetadataProvider)module).setMetadataListener(
|
||||||
|
mMetadataBroadcaster );
|
||||||
|
}
|
||||||
|
|
||||||
if( module instanceof IRealBufferProvider )
|
if( module instanceof IRealBufferProvider )
|
||||||
{
|
{
|
||||||
((IRealBufferProvider)module).setRealBufferListener( mRealBufferBroadcaster );
|
((IRealBufferProvider)module).setRealBufferListener( mRealBufferBroadcaster );
|
||||||
|
|||||||
@@ -1,747 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* SDR Trunk
|
|
||||||
* Copyright (C) 2014 Dennis Sheirer
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
||||||
******************************************************************************/
|
|
||||||
package module;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.LinkedTransferQueue;
|
|
||||||
import java.util.concurrent.RejectedExecutionException;
|
|
||||||
import java.util.concurrent.ScheduledFuture;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
|
||||||
|
|
||||||
import message.Message;
|
|
||||||
import module.decode.Decoder;
|
|
||||||
import module.decode.state.ChannelState;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import record.Recorder;
|
|
||||||
import record.wave.ComplexWaveRecorder;
|
|
||||||
import record.wave.FloatWaveRecorder;
|
|
||||||
import sample.Broadcaster;
|
|
||||||
import sample.Listener;
|
|
||||||
import sample.complex.Complex;
|
|
||||||
import sample.real.RealBuffer;
|
|
||||||
import sample.real.RealSampleListener;
|
|
||||||
import source.ComplexSource;
|
|
||||||
import source.RealSource;
|
|
||||||
import source.Source;
|
|
||||||
import source.config.SourceConfigMixer;
|
|
||||||
import source.tuner.Tuner;
|
|
||||||
import source.tuner.TunerChannelSource;
|
|
||||||
import source.tuner.frequency.AutomaticFrequencyControl_R;
|
|
||||||
import alias.AliasList;
|
|
||||||
import controller.ResourceManager;
|
|
||||||
import controller.ThreadPoolManager.ThreadType;
|
|
||||||
import controller.channel.Channel;
|
|
||||||
import controller.channel.Channel.ChannelType;
|
|
||||||
import eventlog.EventLogType;
|
|
||||||
import eventlog.EventLogger;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A channel has all of the pieces needed to wire together a source, decoder,
|
|
||||||
* event logger and recorder and be started and stopped.
|
|
||||||
*/
|
|
||||||
public class ProcessingChainOld implements Listener<Message>
|
|
||||||
{
|
|
||||||
private final static Logger mLog = LoggerFactory.getLogger( ProcessingChainOld.class );
|
|
||||||
|
|
||||||
protected AtomicBoolean mRunning = new AtomicBoolean();
|
|
||||||
protected Channel mChannel;
|
|
||||||
protected Source mSource;
|
|
||||||
protected Decoder mDecoder;
|
|
||||||
protected List<Recorder> mRecorders = new ArrayList<Recorder>();
|
|
||||||
protected ArrayList<EventLogger> mEventLoggers = new ArrayList<EventLogger>();
|
|
||||||
protected AutomaticFrequencyControl_R mAFC;
|
|
||||||
protected ChannelState mChannelState;
|
|
||||||
protected ResourceManager mResourceManager;
|
|
||||||
private ScheduledFuture<?> mSampleProcessorTask;
|
|
||||||
private AliasList mAliasList;
|
|
||||||
|
|
||||||
private ComplexSampleReceiver mComplexReceiver = new ComplexSampleReceiver();
|
|
||||||
private LinkedTransferQueue<List<Complex>> mComplexQueue =
|
|
||||||
new LinkedTransferQueue<List<Complex>>();
|
|
||||||
|
|
||||||
private RealSampleReceiver mRealReceiver = new RealSampleReceiver();
|
|
||||||
private LinkedTransferQueue<RealBuffer> mRealQueue =
|
|
||||||
new LinkedTransferQueue<RealBuffer>();
|
|
||||||
|
|
||||||
protected Broadcaster<Message> mBroadcaster = new Broadcaster<Message>();
|
|
||||||
|
|
||||||
public ProcessingChainOld( Channel channel, ResourceManager resourceManager )
|
|
||||||
{
|
|
||||||
mChannel = channel;
|
|
||||||
mResourceManager = resourceManager;
|
|
||||||
|
|
||||||
if( mResourceManager != null )
|
|
||||||
{
|
|
||||||
mAliasList = mResourceManager.getPlaylistManager()
|
|
||||||
.getPlayist().getAliasDirectory().getAliasList(
|
|
||||||
mChannel.getAliasListName() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// public IAudioOutput getAudioOutput()
|
|
||||||
// {
|
|
||||||
// if( mDecoder != null )
|
|
||||||
// {
|
|
||||||
// return mDecoder.getAudioOutput();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
|
|
||||||
public Listener<List<Complex>> getComplexReceiver()
|
|
||||||
{
|
|
||||||
return mComplexReceiver;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Listener<RealBuffer> getRealReceiver()
|
|
||||||
{
|
|
||||||
return (Listener<RealBuffer>)mRealReceiver;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
return mChannel.getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
public AliasList getAliasList()
|
|
||||||
{
|
|
||||||
return mAliasList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void dispose()
|
|
||||||
{
|
|
||||||
if( mSampleProcessorTask != null )
|
|
||||||
{
|
|
||||||
mResourceManager.getThreadPoolManager().cancel( mSampleProcessorTask );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( mChannelState != null )
|
|
||||||
{
|
|
||||||
mChannelState.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
mChannelState = null;
|
|
||||||
|
|
||||||
if( mDecoder != null )
|
|
||||||
{
|
|
||||||
mDecoder.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
mBroadcaster.dispose();
|
|
||||||
mEventLoggers.clear();
|
|
||||||
mRecorders.clear();
|
|
||||||
|
|
||||||
mResourceManager = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ResourceManager getResourceManager()
|
|
||||||
{
|
|
||||||
return mResourceManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void start()
|
|
||||||
{
|
|
||||||
if( !mRunning.get() && mChannel.getEnabled() )
|
|
||||||
{
|
|
||||||
updateSource();
|
|
||||||
|
|
||||||
updateDecoder();
|
|
||||||
|
|
||||||
updateEventLogging();
|
|
||||||
|
|
||||||
updateRecording();
|
|
||||||
|
|
||||||
mRunning.set( true );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mLog.info( getLogPrefix() + "start() invoked, but processing chain is "
|
|
||||||
+ "already started" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Performs closeout operations to prepare for channel deletion
|
|
||||||
*/
|
|
||||||
public void stop()
|
|
||||||
{
|
|
||||||
if( mRunning.get() )
|
|
||||||
{
|
|
||||||
updateSource();
|
|
||||||
|
|
||||||
updateDecoder();
|
|
||||||
|
|
||||||
updateRecording();
|
|
||||||
|
|
||||||
/* Flush call events to the logger */
|
|
||||||
if( getChannel().getChannelType() == ChannelType.STANDARD )
|
|
||||||
{
|
|
||||||
// getChannelState().getCallEventModel().flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
updateEventLogging();
|
|
||||||
|
|
||||||
mRunning.set( false );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mLog.info( getLogPrefix() + "stop() invoked, but processing chain was "
|
|
||||||
+ "already stopped" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getLogPrefix()
|
|
||||||
{
|
|
||||||
return "Channel [" + mChannel.getName() + "] - ";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void releaseSource()
|
|
||||||
{
|
|
||||||
if( mSource != null )
|
|
||||||
{
|
|
||||||
if( mSource instanceof ComplexSource )
|
|
||||||
{
|
|
||||||
// ((ComplexSource)mSource).removeAttributeListener( this.getComplexReceiver() );
|
|
||||||
}
|
|
||||||
else if( mSource instanceof RealSource )
|
|
||||||
{
|
|
||||||
((RealSource)mSource)
|
|
||||||
.removeListener( this.getRealReceiver() );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( mSampleProcessorTask != null )
|
|
||||||
{
|
|
||||||
mResourceManager.getThreadPoolManager().cancel( mSampleProcessorTask );
|
|
||||||
}
|
|
||||||
|
|
||||||
mSource.dispose();
|
|
||||||
|
|
||||||
mSource = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void obtainSource()
|
|
||||||
{
|
|
||||||
if( mSource != null )
|
|
||||||
{
|
|
||||||
releaseSource();
|
|
||||||
}
|
|
||||||
|
|
||||||
if( mChannel.getEnabled() && mResourceManager != null )
|
|
||||||
{
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// mSource = mResourceManager.getSourceManager()
|
|
||||||
// .getSource( ProcessingChainOld.this );
|
|
||||||
// }
|
|
||||||
// catch ( SourceException e )
|
|
||||||
// {
|
|
||||||
// mLog.error( "Couldn't obtain source for processing chain [" +
|
|
||||||
// toString() + "]", e );
|
|
||||||
//
|
|
||||||
// mSource = null;
|
|
||||||
// }
|
|
||||||
|
|
||||||
if( mSource != null )
|
|
||||||
{
|
|
||||||
if( mSource instanceof ComplexSource )
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
mSampleProcessorTask =
|
|
||||||
mResourceManager.getThreadPoolManager()
|
|
||||||
.scheduleFixedRate( ThreadType.DECODER,
|
|
||||||
new ComplexProcessor(),
|
|
||||||
50, TimeUnit.MILLISECONDS );
|
|
||||||
|
|
||||||
// ((ComplexSource)mSource)
|
|
||||||
// .setListener( this.getComplexReceiver() );
|
|
||||||
}
|
|
||||||
catch( RejectedExecutionException ree )
|
|
||||||
{
|
|
||||||
mLog.error( getLogPrefix() + "ProcessingChain - "
|
|
||||||
+ "error scheduling complex sample processing "
|
|
||||||
+ "thread - " + ree.getLocalizedMessage() );
|
|
||||||
|
|
||||||
mSource.dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if( mSource instanceof RealSource )
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
mSampleProcessorTask =
|
|
||||||
mResourceManager.getThreadPoolManager()
|
|
||||||
.scheduleFixedRate( ThreadType.DECODER,
|
|
||||||
new RealProcessor(),
|
|
||||||
50, TimeUnit.MILLISECONDS );
|
|
||||||
|
|
||||||
((RealSource)mSource)
|
|
||||||
.setListener( this.getRealReceiver() );
|
|
||||||
}
|
|
||||||
catch( RejectedExecutionException ree )
|
|
||||||
{
|
|
||||||
mLog.error( getLogPrefix() + "ProcessingChain - "
|
|
||||||
+ "error scheduling float sample processing "
|
|
||||||
+ "thread", ree );
|
|
||||||
|
|
||||||
mSource.dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateSource()
|
|
||||||
{
|
|
||||||
/* Cleanup existing source */
|
|
||||||
releaseSource();
|
|
||||||
|
|
||||||
/* Get a new source if needed and start the sample processor thread */
|
|
||||||
obtainSource();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateDecoder()
|
|
||||||
{
|
|
||||||
if( mChannel.getEnabled() )
|
|
||||||
{
|
|
||||||
if( mDecoder != null )
|
|
||||||
{
|
|
||||||
mDecoder.init();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// /* Setup the channel state */
|
|
||||||
// mChannelState = DecoderFactory.getChannelStateNew( this, mAliasList );
|
|
||||||
|
|
||||||
if( mSource == null )
|
|
||||||
{
|
|
||||||
// mChannelState.setState( State.NO_TUNER );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// mDecoder = DecoderFactory.
|
|
||||||
// getDecoder( this, mSource.getSampleType(), mAliasList );
|
|
||||||
|
|
||||||
if( mDecoder != null )
|
|
||||||
{
|
|
||||||
/* Register to receive decoded messages and auxiliary messages */
|
|
||||||
mDecoder.addMessageListener( ProcessingChainOld.this );
|
|
||||||
|
|
||||||
/* Establish two-way communication between the frequency
|
|
||||||
* correction controller and the tuner channel source */
|
|
||||||
// if( mSource instanceof TunerChannelSource &&
|
|
||||||
// mDecoder.hasFrequencyCorrectionControl() )
|
|
||||||
// {
|
|
||||||
// TunerChannelSource tcs = (TunerChannelSource)mSource;
|
|
||||||
//
|
|
||||||
// FrequencyCorrectionControl fcc =
|
|
||||||
// mDecoder.getFrequencyCorrectionController();
|
|
||||||
//
|
|
||||||
// if( fcc != null )
|
|
||||||
// {
|
|
||||||
// tcs.addListener( fcc );
|
|
||||||
// fcc.setListener( tcs );
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Register audio output to be controlled by the channel state */
|
|
||||||
// mChannelState.addListener( (SquelchListener)mDecoder.getAudioOutput() );
|
|
||||||
// mChannelState.setListener( (IAudioTypeListener)mDecoder.getAudioOutput() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Starts, stops or changes event logging
|
|
||||||
*/
|
|
||||||
public void updateEventLogging()
|
|
||||||
{
|
|
||||||
/* Shutdown and remove existing event loggers */
|
|
||||||
if( mEventLoggers != null )
|
|
||||||
{
|
|
||||||
for( EventLogger logger: mEventLoggers )
|
|
||||||
{
|
|
||||||
logger.stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
mEventLoggers.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Construct event loggers and add as message listeners */
|
|
||||||
if( mChannel.getEnabled() &&
|
|
||||||
mResourceManager != null )
|
|
||||||
{
|
|
||||||
//Get the event loggers
|
|
||||||
ArrayList<EventLogType> types = getChannel()
|
|
||||||
.getEventLogConfiguration().getLoggers();
|
|
||||||
|
|
||||||
for( EventLogType type: types )
|
|
||||||
{
|
|
||||||
EventLogger logger;
|
|
||||||
|
|
||||||
if( type == EventLogType.CALL_EVENT )
|
|
||||||
{
|
|
||||||
logger = mResourceManager.getEventLogManager()
|
|
||||||
.getLogger( this, type );
|
|
||||||
|
|
||||||
// getChannelState().getCallEventModel()
|
|
||||||
// .addListener( (Listener<CallEvent>)logger );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
logger = mResourceManager.getEventLogManager()
|
|
||||||
.getLogger( this, type );
|
|
||||||
|
|
||||||
addListener( (Listener<Message>)logger );
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.start();
|
|
||||||
|
|
||||||
mEventLoggers.add( logger );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Starts, stops or changes data recording
|
|
||||||
*/
|
|
||||||
public void updateRecording()
|
|
||||||
{
|
|
||||||
/* Remove any existing recorders */
|
|
||||||
if( mRecorders != null )
|
|
||||||
{
|
|
||||||
for( Recorder recorder: mRecorders )
|
|
||||||
{
|
|
||||||
if( recorder != null )
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
recorder.stop();
|
|
||||||
}
|
|
||||||
catch ( IOException ioe )
|
|
||||||
{
|
|
||||||
mLog.error( getLogPrefix() + "Couldn't stop recorder [" +
|
|
||||||
recorder.getFileName() + "]", ioe );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Start any new recorders */
|
|
||||||
if( mChannel.getEnabled() &&
|
|
||||||
mResourceManager != null &&
|
|
||||||
mDecoder != null )
|
|
||||||
{
|
|
||||||
mRecorders = mResourceManager.getRecorderManager()
|
|
||||||
.getRecorder( this );
|
|
||||||
|
|
||||||
/* Iterate any returned recorders and start/add them */
|
|
||||||
for( Recorder recorder: mRecorders )
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
recorder.start();
|
|
||||||
|
|
||||||
if( recorder instanceof FloatWaveRecorder )
|
|
||||||
{
|
|
||||||
mLog.info( getLogPrefix() + "- started audio recording [" +
|
|
||||||
recorder.getFileName() + "]" );
|
|
||||||
|
|
||||||
// mDecoder.addRealSampleListener( (FloatWaveRecorder)recorder );
|
|
||||||
}
|
|
||||||
else if( recorder instanceof ComplexWaveRecorder )
|
|
||||||
{
|
|
||||||
mLog.info( getLogPrefix() + "- started baseband recording [" +
|
|
||||||
recorder.getFileName() + "]" );
|
|
||||||
|
|
||||||
// mDecoder.addComplexListener( (ComplexWaveRecorder )recorder );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
catch ( IOException e )
|
|
||||||
{
|
|
||||||
mLog.error( getLogPrefix() + "Unable to start recorder [" +
|
|
||||||
recorder.getFileName() + "]" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Channel getChannel()
|
|
||||||
{
|
|
||||||
return mChannel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Source getSource()
|
|
||||||
{
|
|
||||||
return mSource;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the tuner that is sourcing this channel, or null if it's being
|
|
||||||
* sourced from some other source
|
|
||||||
*/
|
|
||||||
public Tuner getTuner()
|
|
||||||
{
|
|
||||||
Tuner retVal = null;
|
|
||||||
|
|
||||||
if( mSource instanceof TunerChannelSource )
|
|
||||||
{
|
|
||||||
retVal = ((TunerChannelSource)mSource).getTuner();
|
|
||||||
}
|
|
||||||
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Decoder getDecoder()
|
|
||||||
{
|
|
||||||
return mDecoder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ChannelState getChannelState()
|
|
||||||
{
|
|
||||||
return mChannelState;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isRunning()
|
|
||||||
{
|
|
||||||
return mRunning.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isProcessing()
|
|
||||||
{
|
|
||||||
return isRunning() && mSource != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private source.mixer.MixerChannel getMixerChannel()
|
|
||||||
{
|
|
||||||
source.mixer.MixerChannel retVal = null;
|
|
||||||
|
|
||||||
if( mChannel.getSourceConfiguration() instanceof SourceConfigMixer )
|
|
||||||
{
|
|
||||||
SourceConfigMixer mixer = (SourceConfigMixer)mChannel.getSourceConfiguration();
|
|
||||||
|
|
||||||
retVal = mixer.getChannel();
|
|
||||||
}
|
|
||||||
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void receive( Message message )
|
|
||||||
{
|
|
||||||
if( message.isValid() )
|
|
||||||
{
|
|
||||||
mBroadcaster.receive( message );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds the listener to receive demodulated samples from the decoder
|
|
||||||
*/
|
|
||||||
public void addRealListener( RealSampleListener listener )
|
|
||||||
{
|
|
||||||
if( mDecoder != null )
|
|
||||||
{
|
|
||||||
// mDecoder.addRealSampleListener( listener );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes the listener from receiving demodulated samples from the decoder
|
|
||||||
*/
|
|
||||||
public void removeRealListener( RealSampleListener listener )
|
|
||||||
{
|
|
||||||
if( mDecoder != null )
|
|
||||||
{
|
|
||||||
// mDecoder.removeRealSampleListener( listener );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds a listener to receive a copy of complex (I/Q) baseband samples
|
|
||||||
* received by this processing chain
|
|
||||||
*/
|
|
||||||
public void addComplexListener( Listener<Complex> listener )
|
|
||||||
{
|
|
||||||
if( mDecoder != null )
|
|
||||||
{
|
|
||||||
// mDecoder.addComplexListener( listener );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mLog.error( getLogPrefix() + "attempt to add a complex sample "
|
|
||||||
+ "listener, but the decoder is null" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes the listener from receiving a copy of complex (I/Q) baseband
|
|
||||||
* samples received by this processing chain
|
|
||||||
*/
|
|
||||||
public void removeComplexListener( Listener<Complex> listener )
|
|
||||||
{
|
|
||||||
if( mDecoder != null )
|
|
||||||
{
|
|
||||||
// mDecoder.removeComplexListener( listener );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mLog.error( getLogPrefix() + "attempt to remove a complex sample "
|
|
||||||
+ "listener, but the decoder is null" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers the listener to receive messages
|
|
||||||
*/
|
|
||||||
public void addListener( Listener<Message> listener )
|
|
||||||
{
|
|
||||||
mBroadcaster.addListener( listener );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers all listeners in the list to receive messages
|
|
||||||
*/
|
|
||||||
public void addListeners( List<Listener<Message>> listeners )
|
|
||||||
{
|
|
||||||
for( Listener<Message> listener: listeners )
|
|
||||||
{
|
|
||||||
addListener( listener );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes the listener from receiving messages
|
|
||||||
*/
|
|
||||||
public void removeListener( Listener<Message> listener )
|
|
||||||
{
|
|
||||||
mBroadcaster.removeListener( listener );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Manages the real sample queue and distributes samples to the decoder.
|
|
||||||
*/
|
|
||||||
private class RealProcessor implements Runnable
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
List<RealBuffer> sampleBuffers = new ArrayList<RealBuffer>();
|
|
||||||
|
|
||||||
mRealQueue.drainTo( sampleBuffers, 4 );
|
|
||||||
|
|
||||||
for( RealBuffer sampleBuffer: sampleBuffers )
|
|
||||||
{
|
|
||||||
if( mDecoder != null )
|
|
||||||
{
|
|
||||||
float[] samples = sampleBuffer.getSamples();
|
|
||||||
|
|
||||||
for( float sample: samples )
|
|
||||||
{
|
|
||||||
// mDecoder.getRealReceiver().receive( sample );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sampleBuffer.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
sampleBuffers.clear();
|
|
||||||
}
|
|
||||||
catch( Exception e )
|
|
||||||
{
|
|
||||||
mLog.error( "error during processing chain real processor run", e );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Manages the complex sample queue and distributes samples to the decoder.
|
|
||||||
*/
|
|
||||||
private class ComplexProcessor implements Runnable
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
List<List<Complex>> sampleSets =
|
|
||||||
new ArrayList<List<Complex>>();
|
|
||||||
|
|
||||||
mComplexQueue.drainTo( sampleSets, 16 );
|
|
||||||
|
|
||||||
for( List<Complex> samples: sampleSets )
|
|
||||||
{
|
|
||||||
for( Complex sample: samples )
|
|
||||||
{
|
|
||||||
if( sample != null && mDecoder != null )
|
|
||||||
{
|
|
||||||
// mDecoder.getComplexReceiver().receive( sample );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
samples.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
sampleSets.clear();
|
|
||||||
}
|
|
||||||
catch( Exception e )
|
|
||||||
{
|
|
||||||
mLog.error( "error during processing chain complex processor run", e );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Internal listener to receive complex (I/Q) baseband samples. Places
|
|
||||||
* received samples into the queue managed by the ComplexProcessor.
|
|
||||||
*/
|
|
||||||
public class ComplexSampleReceiver implements Listener<List<Complex>>
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void receive( List<Complex> samples )
|
|
||||||
{
|
|
||||||
mComplexQueue.add( samples );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Internal listener to receive real(ie demodulated) samples. Places
|
|
||||||
* received samples into the queue managed by the RealProcessor
|
|
||||||
*/
|
|
||||||
public class RealSampleReceiver implements Listener<RealBuffer>
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void receive( RealBuffer samples )
|
|
||||||
{
|
|
||||||
mRealQueue.add( samples );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -25,10 +25,8 @@ import javax.swing.JCheckBox;
|
|||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
|
|
||||||
import module.decode.config.AuxDecodeConfiguration;
|
import module.decode.config.AuxDecodeConfiguration;
|
||||||
import controller.Editor;
|
|
||||||
import controller.channel.AbstractChannelEditor;
|
import controller.channel.AbstractChannelEditor;
|
||||||
import controller.channel.ChannelNode;
|
import controller.channel.ChannelNode;
|
||||||
import controller.channel.ChannelValidationException;
|
|
||||||
|
|
||||||
public class AuxDecodeComponentEditor extends AbstractChannelEditor
|
public class AuxDecodeComponentEditor extends AbstractChannelEditor
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,11 +29,9 @@ import javax.swing.SwingConstants;
|
|||||||
import javax.swing.event.ChangeEvent;
|
import javax.swing.event.ChangeEvent;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
import module.decode.config.DecodeConfiguration;
|
import module.decode.config.DecodeConfiguration;
|
||||||
|
import net.miginfocom.swing.MigLayout;
|
||||||
import controller.Editor;
|
import controller.Editor;
|
||||||
import controller.channel.Channel;
|
|
||||||
import controller.channel.ChannelValidationException;
|
|
||||||
|
|
||||||
public class DecodeEditor extends Editor
|
public class DecodeEditor extends Editor
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -258,6 +258,9 @@ public class DecoderFactory
|
|||||||
case TAIT_1200:
|
case TAIT_1200:
|
||||||
decoders.add( new Tait1200Decoder( aliasList ) );
|
decoders.add( new Tait1200Decoder( aliasList ) );
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException( "Unrecognized auxiliary "
|
||||||
|
+ "decoder type [" + auxDecoder + "]" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import java.awt.Component;
|
|||||||
import java.awt.EventQueue;
|
import java.awt.EventQueue;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
|
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
|
|||||||
8
src/module/decode/event/ICallEventListener.java
Normal file
8
src/module/decode/event/ICallEventListener.java
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
package module.decode.event;
|
||||||
|
|
||||||
|
import sample.Listener;
|
||||||
|
|
||||||
|
public interface ICallEventListener
|
||||||
|
{
|
||||||
|
public Listener<CallEvent> getCallEventListener();
|
||||||
|
}
|
||||||
@@ -19,7 +19,6 @@ package module.decode.fleetsync1;
|
|||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -167,6 +167,8 @@ public class FleetsyncCallEvent extends CallEvent
|
|||||||
sbDetails.append( message.getStatusAlias().getName() );
|
sbDetails.append( message.getStatusAlias().getName() );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( type == CallEventType.ID_ANI ||
|
if( type == CallEventType.ID_ANI ||
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ public class LJ1200Message extends Message
|
|||||||
case PASSED:
|
case PASSED:
|
||||||
mLog.debug( "PASS:" + message.toString() );
|
mLog.debug( "PASS:" + message.toString() );
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import alias.Alias;
|
|||||||
import alias.AliasList;
|
import alias.AliasList;
|
||||||
import bits.BinaryMessage;
|
import bits.BinaryMessage;
|
||||||
import edac.CRC;
|
import edac.CRC;
|
||||||
import edac.CRCLJ;
|
|
||||||
|
|
||||||
public class LJ1200TransponderMessage extends Message
|
public class LJ1200TransponderMessage extends Message
|
||||||
{
|
{
|
||||||
@@ -66,6 +65,8 @@ public class LJ1200TransponderMessage extends Message
|
|||||||
case UNKNOWN:
|
case UNKNOWN:
|
||||||
mLog.debug( "UNKNOWN:" + message.toString() );
|
mLog.debug( "UNKNOWN:" + message.toString() );
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -160,6 +160,8 @@ public class LTRNetDecoderPanel extends DecoderPanel
|
|||||||
mDescription.setForeground( mColorLabelDecoder );
|
mDescription.setForeground( mColorLabelDecoder );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import java.util.Iterator;
|
|||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
|
|
||||||
import message.Message;
|
import message.Message;
|
||||||
import module.decode.event.CallEvent;
|
|
||||||
import module.decode.event.CallEvent.CallEventType;
|
import module.decode.event.CallEvent.CallEventType;
|
||||||
import module.decode.state.ChangedAttribute;
|
import module.decode.state.ChangedAttribute;
|
||||||
import module.decode.state.DecoderState;
|
import module.decode.state.DecoderState;
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import java.awt.event.ActionEvent;
|
|||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
import javax.swing.DefaultComboBoxModel;
|
import javax.swing.DefaultComboBoxModel;
|
||||||
import javax.swing.JCheckBox;
|
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
|
|
||||||
|
|||||||
@@ -17,13 +17,12 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package module.decode.ltrstandard;
|
package module.decode.ltrstandard;
|
||||||
|
|
||||||
import sample.Listener;
|
|
||||||
import sample.real.IRealBufferListener;
|
|
||||||
import sample.real.RealBuffer;
|
|
||||||
import message.MessageDirection;
|
import message.MessageDirection;
|
||||||
import module.decode.Decoder;
|
import module.decode.Decoder;
|
||||||
import module.decode.DecoderType;
|
import module.decode.DecoderType;
|
||||||
import module.decode.config.DecodeConfiguration;
|
import sample.Listener;
|
||||||
|
import sample.real.IRealBufferListener;
|
||||||
|
import sample.real.RealBuffer;
|
||||||
import alias.AliasList;
|
import alias.AliasList;
|
||||||
import bits.MessageFramer;
|
import bits.MessageFramer;
|
||||||
import bits.SyncPattern;
|
import bits.SyncPattern;
|
||||||
|
|||||||
@@ -148,6 +148,8 @@ public class MDCCallEvent extends CallEvent
|
|||||||
case PAGING:
|
case PAGING:
|
||||||
type = CallEventType.PAGE;
|
type = CallEventType.PAGE;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new MDCCallEvent.Builder( type )
|
return new MDCCallEvent.Builder( type )
|
||||||
|
|||||||
@@ -216,6 +216,8 @@ public class MPT1327DecoderPanel extends DecoderPanel
|
|||||||
mToTalkgroupLabel.setForeground( mColorLabelDetails );
|
mToTalkgroupLabel.setForeground( mColorLabelDetails );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -238,6 +238,8 @@ public class MPT1327DecoderState extends DecoderState
|
|||||||
case MAINT:
|
case MAINT:
|
||||||
broadcast( new DecoderStateEvent( this, Event.END, State.END ) );
|
broadcast( new DecoderStateEvent( this, Event.END, State.END ) );
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -581,6 +581,7 @@ public class MPT1327Message extends Message
|
|||||||
sb.append( " " );
|
sb.append( " " );
|
||||||
sb.append( type.getLabel() );
|
sb.append( type.getLabel() );
|
||||||
sb.append( " REQUEST" );
|
sb.append( " REQUEST" );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACKI:
|
case ACKI:
|
||||||
@@ -726,8 +727,6 @@ public class MPT1327Message extends Message
|
|||||||
sb.append( getChannel() );
|
sb.append( getChannel() );
|
||||||
sb.append( " SER:" );
|
sb.append( " SER:" );
|
||||||
sb.append( getAdjacentSiteSerialNumber() );
|
sb.append( getAdjacentSiteSerialNumber() );
|
||||||
//debug
|
|
||||||
sb.append( " *************************" );
|
|
||||||
break;
|
break;
|
||||||
case SPECIFY_CALL_MAINTENANCE_PARAMETERS:
|
case SPECIFY_CALL_MAINTENANCE_PARAMETERS:
|
||||||
sb.append( " PERIODIC MAINT MSG REQD:" );
|
sb.append( " PERIODIC MAINT MSG REQD:" );
|
||||||
@@ -738,6 +737,8 @@ public class MPT1327Message extends Message
|
|||||||
sb.append( getPresselOnRequired() );
|
sb.append( getPresselOnRequired() );
|
||||||
sb.append( " IDENT1 VALUE:" );
|
sb.append( " IDENT1 VALUE:" );
|
||||||
sb.append( getMaintMessageIDENT1Value() );
|
sb.append( getMaintMessageIDENT1Value() );
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CLEAR:
|
case CLEAR:
|
||||||
@@ -777,6 +778,8 @@ public class MPT1327Message extends Message
|
|||||||
sb.append( " " );
|
sb.append( " " );
|
||||||
sb.append( getSDM() );
|
sb.append( getSDM() );
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
@@ -849,6 +852,8 @@ public class MPT1327Message extends Message
|
|||||||
sb.append( "SEND SHORT DATA MESSAGE USING " );
|
sb.append( "SEND SHORT DATA MESSAGE USING " );
|
||||||
sb.append( slots.getLabel() );
|
sb.append( slots.getLabel() );
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1253,6 +1258,8 @@ public class MPT1327Message extends Message
|
|||||||
12 ) );
|
12 ) );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
@@ -1278,6 +1285,8 @@ public class MPT1327Message extends Message
|
|||||||
case HEAD_PLUS4:
|
case HEAD_PLUS4:
|
||||||
blocks = 4;
|
blocks = 4;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( blocks >= 1 )
|
if( blocks >= 1 )
|
||||||
@@ -1347,6 +1356,8 @@ public class MPT1327Message extends Message
|
|||||||
case HEAD_PLUS4:
|
case HEAD_PLUS4:
|
||||||
blocks = 4;
|
blocks = 4;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( blocks >= 1 )
|
if( blocks >= 1 )
|
||||||
@@ -1446,6 +1457,8 @@ public class MPT1327Message extends Message
|
|||||||
case HEAD_PLUS4:
|
case HEAD_PLUS4:
|
||||||
blocks = 4;
|
blocks = 4;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( blocks >= 1 )
|
if( blocks >= 1 )
|
||||||
|
|||||||
@@ -17,11 +17,11 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package module.decode.mpt1327;
|
package module.decode.mpt1327;
|
||||||
|
|
||||||
|
import message.Message;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import message.Message;
|
|
||||||
import module.decode.DecoderFactory;
|
|
||||||
import sample.Listener;
|
import sample.Listener;
|
||||||
import alias.AliasList;
|
import alias.AliasList;
|
||||||
import bits.BinaryMessage;
|
import bits.BinaryMessage;
|
||||||
|
|||||||
@@ -171,6 +171,8 @@ public class MPT1327TrafficPanel extends DecoderPanel
|
|||||||
case CHANNEL_STATE_LABEL_DETAILS:
|
case CHANNEL_STATE_LABEL_DETAILS:
|
||||||
mToLabel.setForeground( mColorLabelDetails );
|
mToLabel.setForeground( mColorLabelDetails );
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,12 @@ public class C4FMSlicer implements RealSampleListener
|
|||||||
|
|
||||||
private Broadcaster<Dibit> mBroadcaster = new Broadcaster<Dibit>();
|
private Broadcaster<Dibit> mBroadcaster = new Broadcaster<Dibit>();
|
||||||
|
|
||||||
|
public void dispose()
|
||||||
|
{
|
||||||
|
mBroadcaster.dispose();
|
||||||
|
mBroadcaster = null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Primary method for receiving output from the C4FMSymbolFilter. Slices
|
* Primary method for receiving output from the C4FMSymbolFilter. Slices
|
||||||
* (converts) the filtered sample value into a C4FMSymbol decision.
|
* (converts) the filtered sample value into a C4FMSymbol decision.
|
||||||
|
|||||||
@@ -229,6 +229,13 @@ public class C4FMSymbolFilter implements FrequencyCorrectionResetListener,
|
|||||||
mFrequencyCorrectionControl.setListener( this );
|
mFrequencyCorrectionControl.setListener( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dispose()
|
||||||
|
{
|
||||||
|
mGainController = null;
|
||||||
|
mFrequencyCorrectionControl = null;
|
||||||
|
mListener = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive( float sample )
|
public void receive( float sample )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,6 +19,14 @@ public abstract class P25Decoder extends Decoder
|
|||||||
mMessageProcessor = new P25MessageProcessor( aliasList );
|
mMessageProcessor = new P25MessageProcessor( aliasList );
|
||||||
mMessageProcessor.setMessageListener( mMessageBroadcaster );
|
mMessageProcessor.setMessageListener( mMessageBroadcaster );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dispose()
|
||||||
|
{
|
||||||
|
super.dispose();
|
||||||
|
|
||||||
|
mMessageProcessor.dispose();
|
||||||
|
mMessageProcessor = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DecoderType getDecoderType()
|
public DecoderType getDecoderType()
|
||||||
|
|||||||
@@ -21,10 +21,9 @@ import java.awt.EventQueue;
|
|||||||
|
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
|
|
||||||
import net.miginfocom.swing.MigLayout;
|
|
||||||
import module.decode.state.ChangedAttribute;
|
import module.decode.state.ChangedAttribute;
|
||||||
import module.decode.state.DecoderPanel;
|
import module.decode.state.DecoderPanel;
|
||||||
import module.decode.state.State;
|
import net.miginfocom.swing.MigLayout;
|
||||||
import settings.ColorSetting;
|
import settings.ColorSetting;
|
||||||
import settings.Setting;
|
import settings.Setting;
|
||||||
import settings.SettingsManager;
|
import settings.SettingsManager;
|
||||||
@@ -168,6 +167,8 @@ public class P25DecoderPanel extends DecoderPanel
|
|||||||
mToAlias.setIcon( null );
|
mToAlias.setIcon( null );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
repaint();
|
repaint();
|
||||||
|
|||||||
@@ -2264,43 +2264,45 @@ public class P25DecoderState extends DecoderState
|
|||||||
{
|
{
|
||||||
switch( message.getOpcode() )
|
switch( message.getOpcode() )
|
||||||
{
|
{
|
||||||
case GROUP_DATA_CHANNEL_ANNOUNCEMENT:
|
case GROUP_DATA_CHANNEL_ANNOUNCEMENT:
|
||||||
GroupDataChannelAnnouncement gdca = (GroupDataChannelAnnouncement)message;
|
GroupDataChannelAnnouncement gdca = (GroupDataChannelAnnouncement)message;
|
||||||
|
|
||||||
broadcast( new P25CallEvent.Builder( CallEventType.ANNOUNCEMENT )
|
|
||||||
.aliasList( getAliasList() )
|
|
||||||
.channel( gdca.getChannel1() )
|
|
||||||
.details( ( gdca.isEncrypted() ? "ENCRYPTED" : "" ) +
|
|
||||||
( gdca.isEmergency() ? " EMERGENCY" : "") )
|
|
||||||
.frequency( gdca.getDownlinkFrequency1() )
|
|
||||||
.to( gdca.getGroupAddress1() )
|
|
||||||
.build() );
|
|
||||||
|
|
||||||
if( gdca.hasChannelNumber2() )
|
|
||||||
{
|
|
||||||
broadcast( new P25CallEvent.Builder( CallEventType.ANNOUNCEMENT )
|
broadcast( new P25CallEvent.Builder( CallEventType.ANNOUNCEMENT )
|
||||||
.aliasList( getAliasList() )
|
.aliasList( getAliasList() )
|
||||||
.channel( gdca.getChannel2() )
|
.channel( gdca.getChannel1() )
|
||||||
.details( ( gdca.isEncrypted() ? "ENCRYPTED" : "" ) +
|
.details( ( gdca.isEncrypted() ? "ENCRYPTED" : "" ) +
|
||||||
( gdca.isEmergency() ? " EMERGENCY" : "") )
|
( gdca.isEmergency() ? " EMERGENCY" : "") )
|
||||||
.frequency( gdca.getDownlinkFrequency2() )
|
.frequency( gdca.getDownlinkFrequency1() )
|
||||||
.to( gdca.getGroupAddress2() )
|
.to( gdca.getGroupAddress1() )
|
||||||
.build() );
|
.build() );
|
||||||
}
|
|
||||||
break;
|
if( gdca.hasChannelNumber2() )
|
||||||
case GROUP_DATA_CHANNEL_ANNOUNCEMENT_EXPLICIT:
|
{
|
||||||
GroupDataChannelAnnouncementExplicit gdcae =
|
broadcast( new P25CallEvent.Builder( CallEventType.ANNOUNCEMENT )
|
||||||
(GroupDataChannelAnnouncementExplicit)message;
|
.aliasList( getAliasList() )
|
||||||
|
.channel( gdca.getChannel2() )
|
||||||
broadcast( new P25CallEvent.Builder( CallEventType.DATA_CALL )
|
.details( ( gdca.isEncrypted() ? "ENCRYPTED" : "" ) +
|
||||||
.aliasList( getAliasList() )
|
( gdca.isEmergency() ? " EMERGENCY" : "") )
|
||||||
.channel( gdcae.getTransmitChannel() )
|
.frequency( gdca.getDownlinkFrequency2() )
|
||||||
.details( ( gdcae.isEncrypted() ? "ENCRYPTED" : "" ) +
|
.to( gdca.getGroupAddress2() )
|
||||||
( gdcae.isEmergency() ? " EMERGENCY" : "") )
|
.build() );
|
||||||
.frequency( gdcae.getDownlinkFrequency() )
|
}
|
||||||
.to( gdcae.getGroupAddress() )
|
break;
|
||||||
.build() );
|
case GROUP_DATA_CHANNEL_ANNOUNCEMENT_EXPLICIT:
|
||||||
break;
|
GroupDataChannelAnnouncementExplicit gdcae =
|
||||||
|
(GroupDataChannelAnnouncementExplicit)message;
|
||||||
|
|
||||||
|
broadcast( new P25CallEvent.Builder( CallEventType.DATA_CALL )
|
||||||
|
.aliasList( getAliasList() )
|
||||||
|
.channel( gdcae.getTransmitChannel() )
|
||||||
|
.details( ( gdcae.isEncrypted() ? "ENCRYPTED" : "" ) +
|
||||||
|
( gdcae.isEmergency() ? " EMERGENCY" : "") )
|
||||||
|
.frequency( gdcae.getDownlinkFrequency() )
|
||||||
|
.to( gdcae.getGroupAddress() )
|
||||||
|
.build() );
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import bits.MultiSyncPatternMatcher;
|
|||||||
import bits.SoftSyncDetector;
|
import bits.SoftSyncDetector;
|
||||||
import bits.SyncDetector;
|
import bits.SyncDetector;
|
||||||
import dsp.psk.CQPSKDemodulator;
|
import dsp.psk.CQPSKDemodulator;
|
||||||
import dsp.psk.CQPSKDemodulator2;
|
|
||||||
import dsp.symbol.Dibit;
|
import dsp.symbol.Dibit;
|
||||||
import dsp.symbol.FrameSync;
|
import dsp.symbol.FrameSync;
|
||||||
import edac.BCH_63_16_11;
|
import edac.BCH_63_16_11;
|
||||||
@@ -47,20 +46,12 @@ public class P25MessageFramer implements Listener<Dibit>
|
|||||||
private static final int SYNC_MATCH_THRESHOLD = 2;
|
private static final int SYNC_MATCH_THRESHOLD = 2;
|
||||||
private static final int SYNC_IN_CALL_THRESHOLD = 4;
|
private static final int SYNC_IN_CALL_THRESHOLD = 4;
|
||||||
|
|
||||||
private SoftSyncDetector mPrimarySyncDetector = new SoftSyncDetector(
|
|
||||||
FrameSync.P25_PHASE1_NORMAL.getSync(), SYNC_MATCH_THRESHOLD );
|
|
||||||
|
|
||||||
/* Costas Loop phase lock error correction values. A phase lock error of
|
/* Costas Loop phase lock error correction values. A phase lock error of
|
||||||
* 90 degrees requires a correction of 1/4 of the symbol rate (1200Hz). An
|
* 90 degrees requires a correction of 1/4 of the symbol rate (1200Hz). An
|
||||||
* error of 180 degrees requires a correction of 1/2 of the symbol rate */
|
* error of 180 degrees requires a correction of 1/2 of the symbol rate */
|
||||||
public static final double SYMBOL_FREQUENCY = 2.0d * Math.PI * 4800.0d / 48000.0d;
|
public static final double SYMBOL_FREQUENCY = 2.0d * Math.PI * 4800.0d / 48000.0d;
|
||||||
public static final double PHASE_CORRECTION_90_DEGREES = SYMBOL_FREQUENCY / 4.0d;
|
public static final double PHASE_CORRECTION_90_DEGREES = SYMBOL_FREQUENCY / 4.0d;
|
||||||
public static final double PHASE_CORRECTION_180_DEGREES = SYMBOL_FREQUENCY / 2.0d;
|
public static final double PHASE_CORRECTION_180_DEGREES = SYMBOL_FREQUENCY / 2.0d;
|
||||||
|
|
||||||
private MultiSyncPatternMatcher mMatcher = new MultiSyncPatternMatcher( 48 );
|
|
||||||
private ArrayList<P25MessageAssembler> mAssemblers =
|
|
||||||
new ArrayList<P25MessageAssembler>();
|
|
||||||
|
|
||||||
public static final int TSBK_BEGIN = 64;
|
public static final int TSBK_BEGIN = 64;
|
||||||
public static final int TSBK_CRC_START = 144;
|
public static final int TSBK_CRC_START = 144;
|
||||||
public static final int TSBK_END = 260;
|
public static final int TSBK_END = 260;
|
||||||
@@ -77,6 +68,13 @@ public class P25MessageFramer implements Listener<Dibit>
|
|||||||
public static final int PDU3_END = 548;
|
public static final int PDU3_END = 548;
|
||||||
public static final int PDU3_DECODED_END = 448;
|
public static final int PDU3_DECODED_END = 448;
|
||||||
|
|
||||||
|
private SoftSyncDetector mPrimarySyncDetector = new SoftSyncDetector(
|
||||||
|
FrameSync.P25_PHASE1_NORMAL.getSync(), SYNC_MATCH_THRESHOLD );
|
||||||
|
|
||||||
|
private MultiSyncPatternMatcher mMatcher = new MultiSyncPatternMatcher( 48 );
|
||||||
|
private ArrayList<P25MessageAssembler> mAssemblers =
|
||||||
|
new ArrayList<P25MessageAssembler>();
|
||||||
|
|
||||||
private Listener<Message> mListener;
|
private Listener<Message> mListener;
|
||||||
private AliasList mAliasList;
|
private AliasList mAliasList;
|
||||||
|
|
||||||
@@ -143,6 +141,26 @@ public class P25MessageFramer implements Listener<Dibit>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dispose()
|
||||||
|
{
|
||||||
|
for( P25MessageAssembler a: mAssemblers )
|
||||||
|
{
|
||||||
|
a.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
mAssemblers.clear();
|
||||||
|
|
||||||
|
mListener = null;
|
||||||
|
mAliasList = null;
|
||||||
|
|
||||||
|
mMatcher.dispose();
|
||||||
|
mMatcher = null;
|
||||||
|
|
||||||
|
mPrimarySyncDetector.dispose();
|
||||||
|
mPrimarySyncDetector = null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void dispatch( Message message )
|
private void dispatch( Message message )
|
||||||
{
|
{
|
||||||
if( mListener != null )
|
if( mListener != null )
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import module.decode.p25.message.ldu.LDUMessage;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import sample.Broadcaster;
|
|
||||||
import sample.Listener;
|
import sample.Listener;
|
||||||
import alias.AliasList;
|
import alias.AliasList;
|
||||||
|
|
||||||
|
|||||||
@@ -110,6 +110,33 @@ public class P25_C4FMDecoder extends P25Decoder implements IRealBufferListener
|
|||||||
/* Process and broadcast messages */
|
/* Process and broadcast messages */
|
||||||
mMessageFramer.setListener( getMessageProcessor() );
|
mMessageFramer.setListener( getMessageProcessor() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dispose()
|
||||||
|
{
|
||||||
|
super.dispose();
|
||||||
|
|
||||||
|
mC4FMPreFilter.dispose();
|
||||||
|
mC4FMPreFilter = null;
|
||||||
|
|
||||||
|
mDGC.dispose();
|
||||||
|
mDGC = null;
|
||||||
|
|
||||||
|
mStreamConverter.dispose();
|
||||||
|
mStreamConverter = null;
|
||||||
|
|
||||||
|
mFrequencyCorrectionControl.dispose();
|
||||||
|
mFrequencyCorrectionControl = null;
|
||||||
|
|
||||||
|
mSymbolFilter.dispose();
|
||||||
|
mSymbolFilter = null;
|
||||||
|
|
||||||
|
mMessageFramer.dispose();
|
||||||
|
mMessageFramer = null;
|
||||||
|
|
||||||
|
mC4FMSlicer.dispose();
|
||||||
|
mC4FMSlicer = null;
|
||||||
|
}
|
||||||
|
|
||||||
public Modulation getModulation()
|
public Modulation getModulation()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import instrument.tap.Tap;
|
|||||||
import instrument.tap.stream.ComplexSampleTap;
|
import instrument.tap.stream.ComplexSampleTap;
|
||||||
import instrument.tap.stream.ComplexTap;
|
import instrument.tap.stream.ComplexTap;
|
||||||
import instrument.tap.stream.DibitTap;
|
import instrument.tap.stream.DibitTap;
|
||||||
import instrument.tap.stream.FloatTap;
|
|
||||||
import instrument.tap.stream.QPSKTap;
|
import instrument.tap.stream.QPSKTap;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -30,13 +29,13 @@ import java.util.List;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import controller.channel.Channel.ChannelType;
|
|
||||||
import sample.Listener;
|
import sample.Listener;
|
||||||
import sample.complex.ComplexBuffer;
|
import sample.complex.ComplexBuffer;
|
||||||
import sample.complex.ComplexBufferToStreamConverter;
|
import sample.complex.ComplexBufferToStreamConverter;
|
||||||
import sample.complex.IComplexBufferListener;
|
import sample.complex.IComplexBufferListener;
|
||||||
import source.tuner.frequency.FrequencyCorrectionControl;
|
import source.tuner.frequency.FrequencyCorrectionControl;
|
||||||
import alias.AliasList;
|
import alias.AliasList;
|
||||||
|
import controller.channel.Channel.ChannelType;
|
||||||
import dsp.filter.FilterFactory;
|
import dsp.filter.FilterFactory;
|
||||||
import dsp.filter.Window.WindowType;
|
import dsp.filter.Window.WindowType;
|
||||||
import dsp.filter.fir.complex.ComplexFIRFilter_CB_CB;
|
import dsp.filter.fir.complex.ComplexFIRFilter_CB_CB;
|
||||||
@@ -88,6 +87,29 @@ public class P25_LSMDecoder extends P25Decoder implements IComplexBufferListener
|
|||||||
mMessageFramer.setListener( getMessageProcessor() );
|
mMessageFramer.setListener( getMessageProcessor() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dispose()
|
||||||
|
{
|
||||||
|
super.dispose();
|
||||||
|
|
||||||
|
mBasebandFilter.dispose();
|
||||||
|
mBasebandFilter = null;
|
||||||
|
|
||||||
|
mStreamConverter.dispose();
|
||||||
|
mStreamConverter = null;
|
||||||
|
|
||||||
|
mAGC.dispose();
|
||||||
|
mAGC = null;
|
||||||
|
|
||||||
|
mCQPSKDemodulator.dispose();
|
||||||
|
mCQPSKDemodulator = null;
|
||||||
|
|
||||||
|
mCQPSKSlicer.dispose();
|
||||||
|
mCQPSKSlicer = null;
|
||||||
|
|
||||||
|
mMessageFramer.dispose();
|
||||||
|
mMessageFramer = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Listener<ComplexBuffer> getComplexBufferListener()
|
public Listener<ComplexBuffer> getComplexBufferListener()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -67,35 +67,35 @@ public class Trellis_1_2_Rate
|
|||||||
mConstellationNodes.clear();
|
mConstellationNodes.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String constellationsToString( String label )
|
// private String constellationsToString( String label )
|
||||||
{
|
// {
|
||||||
StringBuilder sb = new StringBuilder();
|
// StringBuilder sb = new StringBuilder();
|
||||||
|
//
|
||||||
sb.append( label );
|
// sb.append( label );
|
||||||
|
//
|
||||||
for( ConstellationNode node: mConstellationNodes )
|
// for( ConstellationNode node: mConstellationNodes )
|
||||||
{
|
// {
|
||||||
sb.append( " " + node.getConstellation().name() );
|
// sb.append( " " + node.getConstellation().name() );
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
return sb.toString();
|
// return sb.toString();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
private String inputsToString()
|
// private String inputsToString()
|
||||||
{
|
// {
|
||||||
StringBuilder sb = new StringBuilder();
|
// StringBuilder sb = new StringBuilder();
|
||||||
|
//
|
||||||
sb.append( " INPUTS: " );
|
// sb.append( " INPUTS: " );
|
||||||
|
//
|
||||||
for( ConstellationNode node: mConstellationNodes )
|
// for( ConstellationNode node: mConstellationNodes )
|
||||||
{
|
// {
|
||||||
sb.append( " " );
|
// sb.append( " " );
|
||||||
sb.append( ( node.getConstellation().getInput().getBit1() ? "1" : "0" ) );
|
// sb.append( ( node.getConstellation().getInput().getBit1() ? "1" : "0" ) );
|
||||||
sb.append( ( node.getConstellation().getInput().getBit2() ? "1" : "0" ) );
|
// sb.append( ( node.getConstellation().getInput().getBit2() ? "1" : "0" ) );
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
return sb.toString();
|
// return sb.toString();
|
||||||
}
|
// }
|
||||||
|
|
||||||
public boolean decode( BinaryMessage message, int start, int end )
|
public boolean decode( BinaryMessage message, int start, int end )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import java.util.List;
|
|||||||
|
|
||||||
import message.Message;
|
import message.Message;
|
||||||
import module.decode.p25.message.hdu.HDUMessage;
|
import module.decode.p25.message.hdu.HDUMessage;
|
||||||
import module.decode.p25.message.tdu.lc.TDULinkControlMessage;
|
|
||||||
import filter.Filter;
|
import filter.Filter;
|
||||||
import filter.FilterElement;
|
import filter.FilterElement;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import message.Message;
|
import message.Message;
|
||||||
import module.decode.p25.message.tdu.TDUMessage;
|
|
||||||
import module.decode.p25.message.tdu.lc.TDULinkControlMessage;
|
import module.decode.p25.message.tdu.lc.TDULinkControlMessage;
|
||||||
import filter.Filter;
|
import filter.Filter;
|
||||||
import filter.FilterElement;
|
import filter.FilterElement;
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package module.decode.p25.message.ldu.lc;
|
|||||||
|
|
||||||
import module.decode.p25.message.IBandIdentifier;
|
import module.decode.p25.message.IBandIdentifier;
|
||||||
import module.decode.p25.message.IdentifierReceiver;
|
import module.decode.p25.message.IdentifierReceiver;
|
||||||
import module.decode.p25.message.P25Message.DuplexMode;
|
|
||||||
import module.decode.p25.message.P25Message.SessionMode;
|
|
||||||
import module.decode.p25.message.ldu.LDU1Message;
|
import module.decode.p25.message.ldu.LDU1Message;
|
||||||
import module.decode.p25.reference.LinkControlOpcode;
|
import module.decode.p25.reference.LinkControlOpcode;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package module.decode.p25.message.ldu.lc;
|
package module.decode.p25.message.ldu.lc;
|
||||||
|
|
||||||
import module.decode.p25.message.P25Message.DuplexMode;
|
|
||||||
import module.decode.p25.message.P25Message.SessionMode;
|
|
||||||
import module.decode.p25.message.ldu.LDU1Message;
|
import module.decode.p25.message.ldu.LDU1Message;
|
||||||
import module.decode.p25.reference.LinkControlOpcode;
|
import module.decode.p25.reference.LinkControlOpcode;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package module.decode.p25.message.ldu.lc;
|
package module.decode.p25.message.ldu.lc;
|
||||||
|
|
||||||
import module.decode.p25.message.P25Message.DuplexMode;
|
|
||||||
import module.decode.p25.message.P25Message.SessionMode;
|
|
||||||
import module.decode.p25.message.ldu.LDU1Message;
|
import module.decode.p25.message.ldu.LDU1Message;
|
||||||
import module.decode.p25.reference.LinkControlOpcode;
|
import module.decode.p25.reference.LinkControlOpcode;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package module.decode.p25.message.ldu.lc;
|
package module.decode.p25.message.ldu.lc;
|
||||||
|
|
||||||
import module.decode.p25.message.P25Message.DuplexMode;
|
|
||||||
import module.decode.p25.message.P25Message.SessionMode;
|
|
||||||
import module.decode.p25.message.ldu.LDU1Message;
|
import module.decode.p25.message.ldu.LDU1Message;
|
||||||
import module.decode.p25.reference.LinkControlOpcode;
|
import module.decode.p25.reference.LinkControlOpcode;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package module.decode.p25.message.pdu;
|
|||||||
import module.decode.p25.message.IBandIdentifier;
|
import module.decode.p25.message.IBandIdentifier;
|
||||||
import module.decode.p25.message.IdentifierReceiver;
|
import module.decode.p25.message.IdentifierReceiver;
|
||||||
import module.decode.p25.reference.DataUnitID;
|
import module.decode.p25.reference.DataUnitID;
|
||||||
import module.decode.p25.reference.Opcode;
|
|
||||||
import alias.AliasList;
|
import alias.AliasList;
|
||||||
import bits.BinaryMessage;
|
import bits.BinaryMessage;
|
||||||
import edac.CRCP25;
|
import edac.CRCP25;
|
||||||
|
|||||||
@@ -1,20 +1,10 @@
|
|||||||
package module.decode.p25.message.pdu.confirmed;
|
package module.decode.p25.message.pdu.confirmed;
|
||||||
|
|
||||||
import module.decode.p25.message.pdu.PDUMessage;
|
|
||||||
import module.decode.p25.reference.DataUnitID;
|
|
||||||
import module.decode.p25.reference.MDPConfigurationOption;
|
import module.decode.p25.reference.MDPConfigurationOption;
|
||||||
import module.decode.p25.reference.PDUType;
|
|
||||||
import module.decode.p25.reference.SNDCPActivationRejectReason;
|
|
||||||
import module.decode.p25.reference.Vendor;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import alias.AliasList;
|
|
||||||
import bits.BinaryMessage;
|
|
||||||
import edac.CRC;
|
|
||||||
import edac.CRCP25;
|
|
||||||
|
|
||||||
public class SNDCPActivateTDSContextAccept extends PDUConfirmedMessage
|
public class SNDCPActivateTDSContextAccept extends PDUConfirmedMessage
|
||||||
{
|
{
|
||||||
public final static Logger mLog =
|
public final static Logger mLog =
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package module.decode.p25.message.pdu.confirmed;
|
package module.decode.p25.message.pdu.confirmed;
|
||||||
|
|
||||||
import module.decode.p25.reference.PDUType;
|
import module.decode.p25.reference.PDUType;
|
||||||
import module.decode.p25.reference.SNDCPActivationRejectReason;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package module.decode.p25.message.pdu.osp.data;
|
package module.decode.p25.message.pdu.osp.data;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import module.decode.p25.message.IBandIdentifier;
|
import module.decode.p25.message.IBandIdentifier;
|
||||||
import module.decode.p25.message.IdentifierReceiver;
|
import module.decode.p25.message.IdentifierReceiver;
|
||||||
import module.decode.p25.message.pdu.PDUMessage;
|
import module.decode.p25.message.pdu.PDUMessage;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package module.decode.p25.message.tdu.lc;
|
|||||||
|
|
||||||
import module.decode.p25.message.IBandIdentifier;
|
import module.decode.p25.message.IBandIdentifier;
|
||||||
import module.decode.p25.message.IdentifierReceiver;
|
import module.decode.p25.message.IdentifierReceiver;
|
||||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
|
||||||
import module.decode.p25.reference.LinkControlOpcode;
|
import module.decode.p25.reference.LinkControlOpcode;
|
||||||
import module.decode.p25.reference.Service;
|
import module.decode.p25.reference.Service;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package module.decode.p25.message.tdu.lc;
|
package module.decode.p25.message.tdu.lc;
|
||||||
|
|
||||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
|
||||||
import module.decode.p25.reference.LinkControlOpcode;
|
import module.decode.p25.reference.LinkControlOpcode;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package module.decode.p25.message.tdu.lc;
|
|||||||
|
|
||||||
import module.decode.p25.message.IBandIdentifier;
|
import module.decode.p25.message.IBandIdentifier;
|
||||||
import module.decode.p25.message.IdentifierReceiver;
|
import module.decode.p25.message.IdentifierReceiver;
|
||||||
import module.decode.p25.message.P25Message.DuplexMode;
|
|
||||||
import module.decode.p25.message.P25Message.SessionMode;
|
|
||||||
import module.decode.p25.reference.LinkControlOpcode;
|
import module.decode.p25.reference.LinkControlOpcode;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package module.decode.p25.message.tdu.lc;
|
|||||||
import module.decode.p25.message.IBandIdentifier;
|
import module.decode.p25.message.IBandIdentifier;
|
||||||
import module.decode.p25.message.IdentifierReceiver;
|
import module.decode.p25.message.IdentifierReceiver;
|
||||||
import module.decode.p25.reference.LinkControlOpcode;
|
import module.decode.p25.reference.LinkControlOpcode;
|
||||||
import module.decode.p25.reference.Service;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|||||||
@@ -149,22 +149,22 @@ public abstract class GroupMultiChannelGrant extends ChannelGrant
|
|||||||
|
|
||||||
public long getDownlinkFrequency1()
|
public long getDownlinkFrequency1()
|
||||||
{
|
{
|
||||||
return calculateDownlink( mIdentifierUpdate1, getChannelNumber() );
|
return calculateDownlink( mIdentifierUpdate1, getChannelNumber1() );
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getUplinkFrequency1()
|
public long getUplinkFrequency1()
|
||||||
{
|
{
|
||||||
return calculateUplink( mIdentifierUpdate1, getChannelNumber() );
|
return calculateUplink( mIdentifierUpdate1, getChannelNumber1() );
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getDownlinkFrequency2()
|
public long getDownlinkFrequency2()
|
||||||
{
|
{
|
||||||
return calculateDownlink( mIdentifierUpdate2, getChannelNumber() );
|
return calculateDownlink( mIdentifierUpdate2, getChannelNumber2() );
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getUplinkFrequency2()
|
public long getUplinkFrequency2()
|
||||||
{
|
{
|
||||||
return calculateUplink( mIdentifierUpdate2, getChannelNumber() );
|
return calculateUplink( mIdentifierUpdate2, getChannelNumber2() );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package module.decode.p25.message.tsbk.motorola;
|
package module.decode.p25.message.tsbk.motorola;
|
||||||
|
|
||||||
import module.decode.p25.message.tsbk.TSBKMessage;
|
|
||||||
import module.decode.p25.reference.DataUnitID;
|
import module.decode.p25.reference.DataUnitID;
|
||||||
import alias.AliasList;
|
import alias.AliasList;
|
||||||
import bits.BinaryMessage;
|
import bits.BinaryMessage;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package module.decode.p25.message.tsbk.osp.control;
|
|||||||
import module.decode.p25.message.tsbk.TSBKMessage;
|
import module.decode.p25.message.tsbk.TSBKMessage;
|
||||||
import module.decode.p25.reference.DataUnitID;
|
import module.decode.p25.reference.DataUnitID;
|
||||||
import module.decode.p25.reference.Opcode;
|
import module.decode.p25.reference.Opcode;
|
||||||
import module.decode.p25.reference.Response;
|
|
||||||
import module.decode.p25.reference.StackOperation;
|
import module.decode.p25.reference.StackOperation;
|
||||||
import alias.AliasList;
|
import alias.AliasList;
|
||||||
import bits.BinaryMessage;
|
import bits.BinaryMessage;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package module.decode.p25.message.tsbk.osp.control;
|
|||||||
import module.decode.p25.message.tsbk.TSBKMessage;
|
import module.decode.p25.message.tsbk.TSBKMessage;
|
||||||
import module.decode.p25.reference.DataUnitID;
|
import module.decode.p25.reference.DataUnitID;
|
||||||
import module.decode.p25.reference.Opcode;
|
import module.decode.p25.reference.Opcode;
|
||||||
import module.decode.p25.reference.Response;
|
|
||||||
import alias.AliasList;
|
import alias.AliasList;
|
||||||
import bits.BinaryMessage;
|
import bits.BinaryMessage;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package module.decode.p25.message.tsbk.osp.voice;
|
package module.decode.p25.message.tsbk.osp.voice;
|
||||||
|
|
||||||
import module.decode.p25.message.tsbk.UnitChannelGrant;
|
import module.decode.p25.message.tsbk.UnitChannelGrant;
|
||||||
import module.decode.p25.message.tsbk.osp.control.IdentifierUpdate;
|
|
||||||
import module.decode.p25.reference.DataUnitID;
|
import module.decode.p25.reference.DataUnitID;
|
||||||
import module.decode.p25.reference.Opcode;
|
import module.decode.p25.reference.Opcode;
|
||||||
import alias.AliasList;
|
import alias.AliasList;
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import settings.ColorSetting;
|
|||||||
import settings.Setting;
|
import settings.Setting;
|
||||||
import settings.SettingsManager;
|
import settings.SettingsManager;
|
||||||
import alias.Alias;
|
import alias.Alias;
|
||||||
import controller.channel.Channel;
|
|
||||||
|
|
||||||
public class PassportDecoderPanel extends DecoderPanel
|
public class PassportDecoderPanel extends DecoderPanel
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ public class PassportDecoderState extends DecoderState
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ArrayList<Integer> channels = new ArrayList( mSiteLCNs.keySet() );
|
ArrayList<Integer> channels = new ArrayList<>( mSiteLCNs.keySet() );
|
||||||
Collections.sort( channels );
|
Collections.sort( channels );
|
||||||
|
|
||||||
for( Integer channel: channels )
|
for( Integer channel: channels )
|
||||||
@@ -339,7 +339,7 @@ public class PassportDecoderState extends DecoderState
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ArrayList<Integer> channels = new ArrayList( mNeighborLCNs.keySet() );
|
ArrayList<Integer> channels = new ArrayList<>( mNeighborLCNs.keySet() );
|
||||||
Collections.sort( channels );
|
Collections.sort( channels );
|
||||||
|
|
||||||
for( Integer channel: channels )
|
for( Integer channel: channels )
|
||||||
|
|||||||
@@ -285,17 +285,6 @@ public class PassportMessage extends Message
|
|||||||
return mMessage.toString();
|
return mMessage.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a value formatted in hex notation.
|
|
||||||
*
|
|
||||||
* @param value - integer value
|
|
||||||
* @return - hex digits returned
|
|
||||||
*/
|
|
||||||
private static String getHex( int value, int digits )
|
|
||||||
{
|
|
||||||
return String.format( "%0" + digits + "X", value );
|
|
||||||
}
|
|
||||||
|
|
||||||
private int getInt( int[] bits )
|
private int getInt( int[] bits )
|
||||||
{
|
{
|
||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
|
|||||||
@@ -17,13 +17,12 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package module.decode.state;
|
package module.decode.state;
|
||||||
|
|
||||||
|
import message.Message;
|
||||||
|
import module.decode.state.DecoderStateEvent.Event;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import message.Message;
|
|
||||||
import module.ProcessingChain;
|
|
||||||
import module.decode.state.DecoderStateEvent.Event;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Basic decoder channel state - provides the minimum channel state functionality
|
* Basic decoder channel state - provides the minimum channel state functionality
|
||||||
* to support an always un-squelched audio decoder.
|
* to support an always un-squelched audio decoder.
|
||||||
|
|||||||
@@ -156,11 +156,6 @@ public class Tait1200ANIMessage extends Message
|
|||||||
return (char)value;
|
return (char)value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkCRC()
|
|
||||||
{
|
|
||||||
// mCRC = CRCLJ.checkAndCorrect( mMessage );
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isValid()
|
public boolean isValid()
|
||||||
{
|
{
|
||||||
// return mCRC == CRC.PASSED || mCRC == CRC.CORRECTED;
|
// return mCRC == CRC.PASSED || mCRC == CRC.CORRECTED;
|
||||||
|
|||||||
@@ -15,14 +15,16 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package eventlog;
|
package module.log;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
import module.decode.event.CallEvent;
|
import module.decode.event.CallEvent;
|
||||||
|
import module.decode.event.ICallEventListener;
|
||||||
import sample.Listener;
|
import sample.Listener;
|
||||||
|
|
||||||
public class CallEventLogger extends EventLogger implements Listener<CallEvent>
|
public class CallEventLogger extends EventLogger implements ICallEventListener,
|
||||||
|
Listener<CallEvent>
|
||||||
{
|
{
|
||||||
public CallEventLogger( Path logDirectory, String fileNameSuffix )
|
public CallEventLogger( Path logDirectory, String fileNameSuffix )
|
||||||
{
|
{
|
||||||
@@ -40,4 +42,22 @@ public class CallEventLogger extends EventLogger implements Listener<CallEvent>
|
|||||||
{
|
{
|
||||||
return CallEvent.getCSVHeader();
|
return CallEvent.getCSVHeader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Listener<CallEvent> getCallEventListener()
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dispose()
|
||||||
|
{
|
||||||
|
super.stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init()
|
||||||
|
{
|
||||||
|
super.start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -15,18 +15,16 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package eventlog;
|
package module.log;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
|
|
||||||
import controller.Editor;
|
import module.log.config.EventLogConfiguration;
|
||||||
import controller.channel.AbstractChannelEditor;
|
import controller.channel.AbstractChannelEditor;
|
||||||
import controller.channel.ChannelNode;
|
import controller.channel.ChannelNode;
|
||||||
import controller.channel.ChannelValidationException;
|
|
||||||
import eventlog.config.EventLogConfiguration;
|
|
||||||
|
|
||||||
public class EventLogComponentEditor extends AbstractChannelEditor
|
public class EventLogComponentEditor extends AbstractChannelEditor
|
||||||
{
|
{
|
||||||
@@ -55,7 +53,7 @@ public class EventLogComponentEditor extends AbstractChannelEditor
|
|||||||
{
|
{
|
||||||
SwingUtilities.invokeLater(new Runnable()
|
SwingUtilities.invokeLater(new Runnable()
|
||||||
{
|
{
|
||||||
final ArrayList<EventLogType> mLoggers = mChannelNode.getChannel()
|
final List<EventLogType> mLoggers = mChannelNode.getChannel()
|
||||||
.getEventLogConfiguration().getLoggers();
|
.getEventLogConfiguration().getLoggers();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -15,13 +15,16 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package eventlog;
|
package module.log;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import module.ProcessingChainOld;
|
import module.Module;
|
||||||
|
import module.log.MessageEventLogger.Type;
|
||||||
|
import module.log.config.EventLogConfiguration;
|
||||||
import properties.SystemProperties;
|
import properties.SystemProperties;
|
||||||
import eventlog.MessageEventLogger.Type;
|
|
||||||
|
|
||||||
public class EventLogManager
|
public class EventLogManager
|
||||||
{
|
{
|
||||||
@@ -32,16 +35,24 @@ public class EventLogManager
|
|||||||
mDirectory = SystemProperties.getInstance()
|
mDirectory = SystemProperties.getInstance()
|
||||||
.getApplicationFolder( "event_logs" );
|
.getApplicationFolder( "event_logs" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Module> getLoggers( EventLogConfiguration config, String prefix )
|
||||||
|
{
|
||||||
|
List<Module> loggers = new ArrayList<Module>();
|
||||||
|
|
||||||
|
for( EventLogType type: config.getLoggers() )
|
||||||
|
{
|
||||||
|
loggers.add( getLogger( type, prefix ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
return loggers;
|
||||||
|
}
|
||||||
|
|
||||||
public EventLogger getLogger( ProcessingChainOld chain, EventLogType eventLogType )
|
public EventLogger getLogger( EventLogType eventLogType, String prefix )
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
sb.append( chain.getChannel().getSystem() );
|
sb.append( prefix );
|
||||||
sb.append( "_" );
|
|
||||||
sb.append( chain.getChannel().getSite() );
|
|
||||||
sb.append( "_" );
|
|
||||||
sb.append( chain.getChannel().getName() );
|
|
||||||
sb.append( eventLogType.getFileSuffix() );
|
sb.append( eventLogType.getFileSuffix() );
|
||||||
sb.append( ".log" );
|
sb.append( ".log" );
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package eventlog;
|
package module.log;
|
||||||
|
|
||||||
|
|
||||||
public enum EventLogType
|
public enum EventLogType
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package eventlog;
|
package module.log;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
@@ -25,12 +25,14 @@ import java.io.OutputStreamWriter;
|
|||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
|
import module.Module;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import util.TimeStamp;
|
import util.TimeStamp;
|
||||||
|
|
||||||
public abstract class EventLogger
|
public abstract class EventLogger extends Module
|
||||||
{
|
{
|
||||||
private final static Logger mLog =
|
private final static Logger mLog =
|
||||||
LoggerFactory.getLogger( EventLogger.class );
|
LoggerFactory.getLogger( EventLogger.class );
|
||||||
@@ -67,27 +69,30 @@ public abstract class EventLogger
|
|||||||
|
|
||||||
public void start()
|
public void start()
|
||||||
{
|
{
|
||||||
try
|
if( mLogFile == null )
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
try
|
||||||
sb.append( mLogDirectory );
|
{
|
||||||
sb.append( File.separator );
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append( TimeStamp.getTimeStamp( "_" ) );
|
sb.append( mLogDirectory );
|
||||||
sb.append( "_" );
|
sb.append( File.separator );
|
||||||
sb.append( replaceIllegalCharacters( mFileNameSuffix ) );
|
sb.append( TimeStamp.getTimeStamp( "_" ) );
|
||||||
|
sb.append( "_" );
|
||||||
|
sb.append( replaceIllegalCharacters( mFileNameSuffix ) );
|
||||||
|
|
||||||
mLogFileName = sb.toString();
|
mLogFileName = sb.toString();
|
||||||
|
|
||||||
mLog.info( "Creating log file:" + mLogFileName );
|
mLog.info( "Creating log file:" + mLogFileName );
|
||||||
|
|
||||||
mLogFile = new OutputStreamWriter(new FileOutputStream( mLogFileName ) );
|
mLogFile = new OutputStreamWriter(new FileOutputStream( mLogFileName ) );
|
||||||
|
|
||||||
write( getHeader() );
|
write( getHeader() );
|
||||||
}
|
}
|
||||||
catch (FileNotFoundException e)
|
catch (FileNotFoundException e)
|
||||||
{
|
{
|
||||||
mLog.error("Couldn't create log file in directory:" + mLogDirectory );
|
mLog.error("Couldn't create log file in directory:" + mLogDirectory );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -111,6 +116,7 @@ public abstract class EventLogger
|
|||||||
{
|
{
|
||||||
mLogFile.flush();
|
mLogFile.flush();
|
||||||
mLogFile.close();
|
mLogFile.close();
|
||||||
|
mLogFile = null;
|
||||||
}
|
}
|
||||||
catch( Exception e )
|
catch( Exception e )
|
||||||
{
|
{
|
||||||
@@ -15,51 +15,75 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package eventlog;
|
package module.log;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
|
import message.IMessageListener;
|
||||||
import message.Message;
|
import message.Message;
|
||||||
import sample.Listener;
|
import sample.Listener;
|
||||||
import util.TimeStamp;
|
import util.TimeStamp;
|
||||||
|
|
||||||
public class MessageEventLogger extends EventLogger implements Listener<Message>
|
public class MessageEventLogger extends EventLogger implements
|
||||||
|
IMessageListener, Listener<Message>
|
||||||
{
|
{
|
||||||
public enum Type { BINARY, DECODED };
|
public enum Type
|
||||||
|
{
|
||||||
|
BINARY, DECODED
|
||||||
|
};
|
||||||
|
|
||||||
private Type mType;
|
private Type mType;
|
||||||
|
|
||||||
public MessageEventLogger( Path logDirectory, String fileNameSuffix, Type type )
|
public MessageEventLogger( Path logDirectory,
|
||||||
|
String fileNameSuffix,
|
||||||
|
Type type )
|
||||||
{
|
{
|
||||||
super( logDirectory, fileNameSuffix );
|
super( logDirectory, fileNameSuffix );
|
||||||
|
|
||||||
mType = type;
|
mType = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receive( Message message )
|
public Listener<Message> getMessageListener()
|
||||||
{
|
{
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dispose()
|
||||||
|
{
|
||||||
|
super.stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init()
|
||||||
|
{
|
||||||
|
super.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void receive( Message message )
|
||||||
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append( TimeStamp.getTimeStamp( " " ) );
|
sb.append( TimeStamp.getTimeStamp( " " ) );
|
||||||
sb.append( "," );
|
sb.append( "," );
|
||||||
sb.append( ( message.isValid() ? "PASSED" : "FAILED" ) );
|
sb.append( ( message.isValid() ? "PASSED" : "FAILED" ) );
|
||||||
sb.append( "," );
|
sb.append( "," );
|
||||||
|
|
||||||
if( mType == Type.BINARY )
|
if ( mType == Type.BINARY )
|
||||||
{
|
{
|
||||||
sb.append( message.getBinaryMessage() );
|
sb.append( message.getBinaryMessage() );
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
sb.append( message.getMessage() );
|
sb.append( message.getMessage() );
|
||||||
}
|
}
|
||||||
|
|
||||||
write( sb.toString() );
|
write( sb.toString() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getHeader()
|
public String getHeader()
|
||||||
{
|
{
|
||||||
return mType.toString() + " Message Logger\n";
|
return mType.toString() + " Message Logger\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,27 +15,28 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package eventlog.config;
|
package module.log.config;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlElement;
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import module.log.EventLogType;
|
||||||
import controller.config.Configuration;
|
import controller.config.Configuration;
|
||||||
import eventlog.EventLogType;
|
|
||||||
|
|
||||||
@XmlRootElement( name = "event_log_configuration" )
|
@XmlRootElement( name = "event_log_configuration" )
|
||||||
public class EventLogConfiguration extends Configuration
|
public class EventLogConfiguration extends Configuration
|
||||||
{
|
{
|
||||||
protected ArrayList<EventLogType> mLoggers = new ArrayList<EventLogType>();
|
protected List<EventLogType> mLoggers = new ArrayList<EventLogType>();
|
||||||
|
|
||||||
public EventLogConfiguration()
|
public EventLogConfiguration()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlElement( name = "logger" )
|
@XmlElement( name = "logger" )
|
||||||
public ArrayList<EventLogType> getLoggers()
|
public List<EventLogType> getLoggers()
|
||||||
{
|
{
|
||||||
return mLoggers;
|
return mLoggers;
|
||||||
}
|
}
|
||||||
@@ -39,8 +39,6 @@ import org.jdesktop.swingx.painter.Painter;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import source.tuner.hackrf.HackRFTunerController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A tile oriented map component that can easily be used with tile sources
|
* A tile oriented map component that can easily be used with tile sources
|
||||||
* on the web like Google and Yahoo maps, satellite data such as NASA imagery,
|
* on the web like Google and Yahoo maps, satellite data such as NASA imagery,
|
||||||
|
|||||||
@@ -17,8 +17,6 @@
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package org.jdesktop.swingx.mapviewer;
|
package org.jdesktop.swingx.mapviewer;
|
||||||
|
|
||||||
import gui.SDRTrunk;
|
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
|||||||
@@ -9,8 +9,6 @@
|
|||||||
|
|
||||||
package org.jdesktop.swingx.mapviewer;
|
package org.jdesktop.swingx.mapviewer;
|
||||||
|
|
||||||
import gui.SDRTrunk;
|
|
||||||
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.geom.Point2D;
|
import java.awt.geom.Point2D;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user