mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-14 17:47:32 -05:00
Merge pull request #239 from DSheirer/228-traffic-channel-allocation-for-do-not-monitor
Traffic channel manager now allocates traffic channels for do not monitor aliases
This commit is contained in:
@@ -63,13 +63,11 @@ public class TrafficChannelManager extends Module implements ICallEventProvider,
|
|||||||
private Listener<CallEvent> mCallEventListener;
|
private Listener<CallEvent> mCallEventListener;
|
||||||
|
|
||||||
private ChannelModel mChannelModel;
|
private ChannelModel mChannelModel;
|
||||||
private ChannelProcessingManager mChannelProcessingManager;
|
|
||||||
private DecodeConfiguration mDecodeConfiguration;
|
private DecodeConfiguration mDecodeConfiguration;
|
||||||
private RecordConfiguration mRecordConfiguration;
|
private RecordConfiguration mRecordConfiguration;
|
||||||
private String mSystem;
|
private String mSystem;
|
||||||
private String mSite;
|
private String mSite;
|
||||||
private String mAliasListName;
|
private String mAliasListName;
|
||||||
private CallEvent mPreviousDoNotMonitorCallEvent;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monitors call events and allocates traffic decoder channels in response
|
* Monitors call events and allocates traffic decoder channels in response
|
||||||
@@ -77,7 +75,6 @@ public class TrafficChannelManager extends Module implements ICallEventProvider,
|
|||||||
* traffic channel allocations.
|
* traffic channel allocations.
|
||||||
*
|
*
|
||||||
* @param channelModel containing channels currently in use
|
* @param channelModel containing channels currently in use
|
||||||
* @param channelProcessingManager
|
|
||||||
* @param decodeConfiguration - decoder configuration to use for each
|
* @param decodeConfiguration - decoder configuration to use for each
|
||||||
* traffic channel allocation.
|
* traffic channel allocation.
|
||||||
* @param recordConfiguration - recording options for each traffic channel
|
* @param recordConfiguration - recording options for each traffic channel
|
||||||
@@ -88,7 +85,6 @@ public class TrafficChannelManager extends Module implements ICallEventProvider,
|
|||||||
* in the pool
|
* in the pool
|
||||||
*/
|
*/
|
||||||
public TrafficChannelManager(ChannelModel channelModel,
|
public TrafficChannelManager(ChannelModel channelModel,
|
||||||
ChannelProcessingManager channelProcessingManager,
|
|
||||||
DecodeConfiguration decodeConfiguration,
|
DecodeConfiguration decodeConfiguration,
|
||||||
RecordConfiguration recordConfiguration,
|
RecordConfiguration recordConfiguration,
|
||||||
String system,
|
String system,
|
||||||
@@ -97,7 +93,6 @@ public class TrafficChannelManager extends Module implements ICallEventProvider,
|
|||||||
int trafficChannelPoolSize)
|
int trafficChannelPoolSize)
|
||||||
{
|
{
|
||||||
mChannelModel = channelModel;
|
mChannelModel = channelModel;
|
||||||
mChannelProcessingManager = channelProcessingManager;
|
|
||||||
mDecodeConfiguration = decodeConfiguration;
|
mDecodeConfiguration = decodeConfiguration;
|
||||||
mRecordConfiguration = recordConfiguration;
|
mRecordConfiguration = recordConfiguration;
|
||||||
mSystem = system;
|
mSystem = system;
|
||||||
@@ -120,7 +115,6 @@ public class TrafficChannelManager extends Module implements ICallEventProvider,
|
|||||||
|
|
||||||
mCallEventListener = null;
|
mCallEventListener = null;
|
||||||
mDecodeConfiguration = null;
|
mDecodeConfiguration = null;
|
||||||
mPreviousDoNotMonitorCallEvent = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -197,21 +191,7 @@ public class TrafficChannelManager extends Module implements ICallEventProvider,
|
|||||||
|
|
||||||
long frequency = callEvent.getFrequency();
|
long frequency = callEvent.getFrequency();
|
||||||
|
|
||||||
/* Check the from/to aliases for do not monitor priority */
|
if(frequency > 0)
|
||||||
if(isDoNotMonitor(callEvent))
|
|
||||||
{
|
|
||||||
callEvent.setCallEventType(CallEventType.CALL_DO_NOT_MONITOR);
|
|
||||||
|
|
||||||
if(isSameCallEvent(mPreviousDoNotMonitorCallEvent, callEvent))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mPreviousDoNotMonitorCallEvent = callEvent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(frequency > 0)
|
|
||||||
{
|
{
|
||||||
Channel channel = getChannel(callEvent.getChannel(), new TunerChannel(Type.TRAFFIC,
|
Channel channel = getChannel(callEvent.getChannel(), new TunerChannel(Type.TRAFFIC,
|
||||||
frequency, mDecodeConfiguration.getDecoderType().getChannelBandwidth()));
|
frequency, mDecodeConfiguration.getDecoderType().getChannelBandwidth()));
|
||||||
@@ -330,31 +310,6 @@ public class TrafficChannelManager extends Module implements ICallEventProvider,
|
|||||||
return false;
|
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.hasCallPriority() && to.getCallPriority() == Priority.DO_NOT_MONITOR)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Alias from = event.getFromIDAlias();
|
|
||||||
|
|
||||||
if(from != null && from.hasCallPriority() && from.getCallPriority() == Priority.DO_NOT_MONITOR)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Listener<DecoderStateEvent> getDecoderStateListener()
|
public Listener<DecoderStateEvent> getDecoderStateListener()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ public class DecoderFactory
|
|||||||
|
|
||||||
if(channelType == ChannelType.STANDARD)
|
if(channelType == ChannelType.STANDARD)
|
||||||
{
|
{
|
||||||
modules.add(new TrafficChannelManager(channelModel, channelProcessingManager, decodeConfig,
|
modules.add(new TrafficChannelManager(channelModel, decodeConfig,
|
||||||
channel.getRecordConfiguration(), channel.getSystem(), channel.getSite(),
|
channel.getRecordConfiguration(), channel.getSystem(), channel.getSite(),
|
||||||
(aliasList != null ? aliasList.getName() : null), mptConfig.getTrafficChannelPoolSize()));
|
(aliasList != null ? aliasList.getName() : null), mptConfig.getTrafficChannelPoolSize()));
|
||||||
}
|
}
|
||||||
@@ -263,7 +263,7 @@ public class DecoderFactory
|
|||||||
|
|
||||||
if(channelType == ChannelType.STANDARD)
|
if(channelType == ChannelType.STANDARD)
|
||||||
{
|
{
|
||||||
modules.add(new TrafficChannelManager(channelModel, channelProcessingManager, decodeConfig,
|
modules.add(new TrafficChannelManager(channelModel, decodeConfig,
|
||||||
channel.getRecordConfiguration(), channel.getSystem(), channel.getSite(),
|
channel.getRecordConfiguration(), channel.getSystem(), channel.getSite(),
|
||||||
(aliasList != null ? aliasList.getName() : null), p25Config.getTrafficChannelPoolSize()));
|
(aliasList != null ? aliasList.getName() : null), p25Config.getTrafficChannelPoolSize()));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user