Adds event logging, code cleanup and some decoder issue resolution.

This commit is contained in:
denny
2015-09-02 19:41:44 -04:00
parent f4d8ea281d
commit 0f85b7260a
124 changed files with 469 additions and 1416 deletions

View File

@@ -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 );

View File

@@ -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
{

View File

@@ -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

View File

@@ -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 );
}