mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Adds event logging, code cleanup and some decoder issue resolution.
This commit is contained in:
@@ -19,7 +19,6 @@ package controller;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Font;
|
||||
import java.awt.Image;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
package controller;
|
||||
|
||||
import map.MapService;
|
||||
import module.log.EventLogManager;
|
||||
import playlist.PlaylistManager;
|
||||
import record.RecorderManager;
|
||||
import settings.SettingsManager;
|
||||
@@ -26,7 +27,6 @@ import source.recording.RecordingSourceManager;
|
||||
import source.tuner.TunerManager;
|
||||
import audio.AudioManager;
|
||||
import controller.channel.ChannelManager;
|
||||
import eventlog.EventLogManager;
|
||||
|
||||
/**
|
||||
* Manager for system wide resources
|
||||
|
||||
@@ -19,14 +19,10 @@ package controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -40,6 +40,8 @@ import module.decode.config.DecodeConfiguration;
|
||||
import module.decode.event.CallEventModel;
|
||||
import module.decode.event.MessageActivityModel;
|
||||
import module.decode.state.ChannelState;
|
||||
import module.log.MessageEventLogger;
|
||||
import module.log.config.EventLogConfiguration;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -61,8 +63,6 @@ import controller.channel.ChannelEvent.Event;
|
||||
import controller.config.Configuration;
|
||||
import controller.site.Site;
|
||||
import controller.system.System;
|
||||
import eventlog.MessageEventLogger;
|
||||
import eventlog.config.EventLogConfiguration;
|
||||
import filter.FilterSet;
|
||||
|
||||
@XmlSeeAlso( { Configuration.class } )
|
||||
@@ -739,10 +739,34 @@ public class Channel extends Configuration
|
||||
|
||||
setupSource();
|
||||
|
||||
//TODO: Add logging
|
||||
setupLogging();
|
||||
//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()
|
||||
{
|
||||
if( mProcessingChain == null )
|
||||
@@ -764,7 +788,7 @@ public class Channel extends Configuration
|
||||
mProcessingChain.addModules( 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 */
|
||||
mMessageActivityModel = new MessageActivityModel( messageFilter );
|
||||
|
||||
@@ -37,6 +37,7 @@ import javax.swing.tree.TreePath;
|
||||
|
||||
import module.decode.AuxDecodeComponentEditor;
|
||||
import module.decode.DecodeComponentEditor;
|
||||
import module.log.EventLogComponentEditor;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
@@ -49,7 +50,6 @@ import alias.AliasList;
|
||||
import com.jidesoft.swing.JideTabbedPane;
|
||||
|
||||
import controller.Editor;
|
||||
import eventlog.EventLogComponentEditor;
|
||||
|
||||
public class ChannelEditor extends Editor implements ActionListener
|
||||
{
|
||||
|
||||
@@ -17,16 +17,15 @@
|
||||
******************************************************************************/
|
||||
package controller.channel;
|
||||
|
||||
import gui.SDRTrunk;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import message.Message;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import alias.action.AliasActionManager;
|
||||
import message.Message;
|
||||
import sample.Listener;
|
||||
import alias.action.AliasActionManager;
|
||||
import controller.ResourceManager;
|
||||
|
||||
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.DecodeConfiguration;
|
||||
import module.log.config.EventLogConfiguration;
|
||||
import record.config.RecordConfiguration;
|
||||
import source.config.SourceConfiguration;
|
||||
import eventlog.config.EventLogConfiguration;
|
||||
|
||||
@XmlSeeAlso( { AuxDecodeConfiguration.class,
|
||||
DecodeConfiguration.class,
|
||||
|
||||
@@ -30,7 +30,6 @@ import javax.swing.JSeparator;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
|
||||
import controller.ConfigurableNode;
|
||||
import controller.channel.ChannelNode;
|
||||
import controller.site.Site;
|
||||
import controller.site.SiteNode;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user