Adds call blacklisting (do not monitor) to aliases.

This commit is contained in:
denny
2015-09-12 10:59:31 -04:00
parent f354c73109
commit 82ce3c668a
22 changed files with 400 additions and 178 deletions

View File

@@ -260,8 +260,9 @@ public abstract class CallEvent implements Comparable<CallEvent>
ANNOUNCEMENT( "Announcement" ),
CALL( "Call" ),
CALL_ALERT( "Call Alert" ),
CALL_END( "Call End" ),
CALL_DETECT( "Call Detect" ),
CALL_DO_NOT_MONITOR( "Call-Do Not Monitor" ),
CALL_END( "Call End" ),
CALL_UNIQUE_ID( "UID Call" ),
CALL_NO_TUNER( "Call - No Tuner" ),
CALL_TIMEOUT( "Call Timeout" ),

View File

@@ -54,7 +54,7 @@ public class CallEventAliasCellRenderer extends DefaultTableCellRenderer
setText( alias.getName() );
ImageIcon icon = getIcon( alias, 12 );
ImageIcon icon = getIcon( alias, SettingsManager.DEFAULT_ICON_SIZE );
if( icon != null )
{

View File

@@ -104,7 +104,7 @@ public class LTRNetDecoderPanel extends DecoderPanel
mTalkgroupAlias.setText( tgAlias.getName() );
String iconNameString = tgAlias.getIconName();
mTalkgroupAlias.setIcon( mSettingsManager
.getImageIcon( iconNameString, 12 ) );
.getImageIcon( iconNameString, SettingsManager.DEFAULT_ICON_SIZE ) );
}
else
{

View File

@@ -104,7 +104,7 @@ public class LTRStandardDecoderPanel extends DecoderPanel
{
mTalkgroupAlias.setText( alias.getName() );
mTalkgroupAlias.setIcon( mSettingsManager
.getImageIcon( alias.getIconName(), 12 ) );
.getImageIcon( alias.getIconName(), SettingsManager.DEFAULT_ICON_SIZE ) );
}
else
{

View File

@@ -136,7 +136,8 @@ public class MPT1327DecoderPanel extends DecoderPanel
if( iconName != null )
{
label.setIcon( mSettingsManager.getImageIcon( iconName, 12 ) );
label.setIcon( mSettingsManager
.getImageIcon( iconName, SettingsManager.DEFAULT_ICON_SIZE ) );
}
else
{

View File

@@ -118,7 +118,7 @@ public class MPT1327TrafficPanel extends DecoderPanel
String icon = alias.getIconName();
mFromTalkgroupAliasLabel.setIcon( mSettingsManager
.getImageIcon( icon, 12 ) );
.getImageIcon( icon, SettingsManager.DEFAULT_ICON_SIZE ) );
}
break;
case TO_TALKGROUP:

View File

@@ -141,7 +141,7 @@ public class P25DecoderPanel extends DecoderPanel
{
mFromAlias.setText( from.getName() );
mFromAlias.setIcon( mSettingsManager
.getImageIcon( from.getIconName(), 12 ) );
.getImageIcon( from.getIconName(), SettingsManager.DEFAULT_ICON_SIZE ) );
}
else
{
@@ -159,7 +159,7 @@ public class P25DecoderPanel extends DecoderPanel
{
mToAlias.setText( to.getName() );
mToAlias.setIcon( mSettingsManager
.getImageIcon( to.getIconName(), 12 ) );
.getImageIcon( to.getIconName(), SettingsManager.DEFAULT_ICON_SIZE ) );
}
else
{

View File

@@ -118,7 +118,7 @@ public class PassportDecoderPanel extends DecoderPanel
mToTalkgroupAlias.setText( toAlias.getName() );
mToTalkgroupAlias.setIcon( mSettingsManager
.getImageIcon( toAlias.getIconName(), 12 ) );
.getImageIcon( toAlias.getIconName(), SettingsManager.DEFAULT_ICON_SIZE ) );
}
else
{
@@ -146,7 +146,7 @@ public class PassportDecoderPanel extends DecoderPanel
mFromTalkgroupAlias.setText( fromAlias.getName() );
mFromTalkgroupAlias.setIcon( mSettingsManager
.getImageIcon( fromAlias.getIconName(), 12 ) );
.getImageIcon( fromAlias.getIconName(), SettingsManager.DEFAULT_ICON_SIZE ) );
}
else
{

View File

@@ -48,8 +48,8 @@ public class ChannelStatePanel extends JPanel
private static final boolean DISABLED = false;
private static final boolean BROADCAST_CHANGE = true;
private Font mFontDetails = new Font( Font.MONOSPACED, Font.PLAIN, 10 );
private Font mFontDecoder = new Font( Font.MONOSPACED, Font.PLAIN, 10 );
private Font mFontDetails = new Font( Font.MONOSPACED, Font.PLAIN, 12 );
private Font mFontDecoder = new Font( Font.MONOSPACED, Font.PLAIN, 12 );
protected Color mColorChannelBackground;
protected Color mColorChannelSelected;
@@ -208,7 +208,10 @@ public class ChannelStatePanel extends JPanel
switch( changedAttribute )
{
case CHANNEL_STATE:
mStateLabel.setText( state.getState().getDisplayValue() );
if( state.getState() != null )
{
mStateLabel.setText( state.getState().getDisplayValue() );
}
break;
case SOURCE:
mSourceLabel.setText( mChannel.getSourceConfiguration()

View File

@@ -35,9 +35,10 @@ public abstract class DecoderPanel extends JPanel
{
private static final long serialVersionUID = 1L;
protected Font mFontDetails = new Font( Font.MONOSPACED, Font.PLAIN, 10 );
protected Font mFontDecoder = new Font( Font.MONOSPACED, Font.PLAIN, 10 );
protected Font mFontAuxDecoder = new Font( Font.MONOSPACED, Font.PLAIN, 10 );
protected Font mFontDetails = new Font( Font.MONOSPACED, Font.PLAIN, 12 );
protected Font mFontDecoder = new Font( Font.MONOSPACED, Font.PLAIN, 12 );
protected Font mFontAuxDecoder = new Font( Font.MONOSPACED, Font.PLAIN, 12 );
public static final int ICON_SIZE = 12;
protected Color mColorLabelDetails;
protected Color mColorLabelDecoder;

View File

@@ -10,6 +10,7 @@ import module.decode.config.DecodeConfiguration;
import module.decode.event.CallEvent;
import module.decode.event.CallEvent.CallEventType;
import module.decode.event.ICallEventProvider;
import module.decode.mpt1327.MPT1327CallEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -19,7 +20,8 @@ import sample.Listener;
import source.config.SourceConfigTuner;
import source.tuner.TunerChannel;
import source.tuner.TunerChannel.Type;
import alias.AliasList;
import alias.Alias;
import alias.priority.Priority;
import controller.ResourceManager;
import controller.channel.Channel;
import controller.channel.Channel.ChannelType;
@@ -46,6 +48,7 @@ public class TrafficChannelManager extends Module
private Site mSite;
private String mAliasListName;
private long mTrafficChannelTimeout;
private CallEvent mPreviousDoNotMonitorCallEvent;
/**
* Monitors call events and allocates traffic decoder channels in response
@@ -90,6 +93,7 @@ public class TrafficChannelManager extends Module
mCallEventListener = null;
mResourceManager = null;
mDecodeConfiguration = null;
mPreviousDoNotMonitorCallEvent = null;
}
private Channel getChannel( String channelNumber, TunerChannel tunerChannel )
@@ -168,7 +172,20 @@ public class TrafficChannelManager extends Module
long frequency = callEvent.getFrequency();
if( frequency > 0 )
/* Check the from/to aliases for do not monitor priority */
if( isDoNotMonitor( callEvent ) )
{
if( isSameCallEvent( mPreviousDoNotMonitorCallEvent, callEvent ) )
{
return;
}
else
{
mPreviousDoNotMonitorCallEvent = callEvent;
callEvent.setCallEventType( CallEventType.CALL_DO_NOT_MONITOR );
}
}
else if( frequency > 0 )
{
Channel channel = getChannel( callEvent.getChannel(),
new TunerChannel( Type.TRAFFIC, frequency,
@@ -209,6 +226,85 @@ public class TrafficChannelManager extends Module
}
}
/**
* Compares the call type, channel and to fields for equivalence and the
* from field for either both null, or equivalence.
*
* @param e1
* @param e2
* @return
*/
public static boolean isSameCallEvent( CallEvent e1, CallEvent e2 )
{
if( e1 == null ||
e2 == null ||
e1.getCallEventType() != e2.getCallEventType() )
{
return false;
}
if( e1.getChannel() == null ||
e2.getChannel() == null ||
!e1.getChannel().contentEquals( e2.getChannel() ) )
{
return false;
}
if( e1.getToID() == null ||
e2.getToID() == null ||
!e1.getToID().contentEquals( e2.getToID() ) )
{
return false;
}
if( e1.getFromID() == null || e2.getFromID() == null )
{
if( e1.getFromID() == null && e2.getFromID() == null )
{
return true;
}
else
{
return false;
}
}
else if( e1.getFromID().contentEquals( e2.getFromID() ) )
{
return true;
}
return false;
}
/**
* Checks for aliases that contain a do not follow/process priority.
*
* @param event
* @return - true if there is an alias that has a do not process alias id
*/
private boolean isDoNotMonitor( CallEvent event )
{
Alias to = event.getToIDAlias();
if( to != null &&
to.hasPriority() &&
to.getCallPriority() == Priority.DO_NOT_MONITOR )
{
return true;
}
Alias from = event.getFromIDAlias();
if( from != null &&
from.hasPriority() &&
from.getCallPriority() == Priority.DO_NOT_MONITOR )
{
return true;
}
return false;
}
@Override
public Listener<DecoderStateEvent> getDecoderStateListener()
{