mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Automatic Frequency Control enhancement. Provides default AFC and ability to disable in the Decoder tab of each channel. Spectral display includes visual indicators of frequency center (grey) and current AFC offset (yellow).
This commit is contained in:
@@ -43,6 +43,7 @@ public class MPT1327ChannelState extends ChannelState
|
||||
private ChannelMap mChannelMap;
|
||||
private MPT1327ActivitySummary mActivitySummary;
|
||||
|
||||
|
||||
public MPT1327ChannelState( ProcessingChain processingChain,
|
||||
AliasList aliasList,
|
||||
ChannelMap channelMap )
|
||||
@@ -156,72 +157,72 @@ public class MPT1327ChannelState extends ChannelState
|
||||
setState( State.CONTROL );
|
||||
break;
|
||||
case GTC:
|
||||
int channelNumber = mpt.getChannel();
|
||||
|
||||
if( !getProcessingChain().getChannel()
|
||||
.hasTrafficChannel( channelNumber ) )
|
||||
if( mpt.isValidCall() )
|
||||
{
|
||||
String aliasListName = mProcessingChain
|
||||
.getChannel().getAliasListName();
|
||||
int channelNumber = mpt.getChannel();
|
||||
|
||||
Channel traffic = getTrafficChannel( channelNumber,
|
||||
aliasListName );
|
||||
|
||||
/* Set the system and site to same as control channel */
|
||||
traffic.setSystem( getProcessingChain().getChannel()
|
||||
.getSystem(), false );
|
||||
traffic.setSite( getProcessingChain().getChannel()
|
||||
.getSite(), false );
|
||||
if( !getProcessingChain().getChannel()
|
||||
.hasTrafficChannel( channelNumber ) )
|
||||
{
|
||||
String aliasListName = mProcessingChain
|
||||
.getChannel().getAliasListName();
|
||||
|
||||
Channel traffic = getTrafficChannel( channelNumber,
|
||||
aliasListName );
|
||||
|
||||
/* Set the system and site to same as control channel */
|
||||
traffic.setSystem( getProcessingChain().getChannel()
|
||||
.getSystem(), false );
|
||||
traffic.setSite( getProcessingChain().getChannel()
|
||||
.getSite(), false );
|
||||
|
||||
/* Add the traffic channel to the parent control channel */
|
||||
getProcessingChain().getChannel()
|
||||
.addTrafficChannel( channelNumber, traffic );
|
||||
/* Add the traffic channel to the parent control channel */
|
||||
getProcessingChain().getChannel()
|
||||
.addTrafficChannel( channelNumber, traffic );
|
||||
|
||||
/* Start the traffic channel */
|
||||
traffic.setEnabled( true );
|
||||
|
||||
/* Set traffic channel state info */
|
||||
MPT1327ChannelState trafficState =
|
||||
(MPT1327ChannelState)traffic
|
||||
.getProcessingChain().getChannelState();
|
||||
|
||||
MPT1327ChannelState controlState =
|
||||
(MPT1327ChannelState)getProcessingChain()
|
||||
.getChannelState();
|
||||
|
||||
trafficState.setChannelMap( controlState.getChannelMap() );
|
||||
trafficState.setChannelNumber( channelNumber );
|
||||
trafficState.setFromTalkgroup( mpt.getFromID() );
|
||||
trafficState.setToTalkgroup( mpt.getToID() );
|
||||
/* Start the traffic channel */
|
||||
traffic.setEnabled( true );
|
||||
|
||||
/* Set traffic channel state info */
|
||||
MPT1327ChannelState trafficState =
|
||||
(MPT1327ChannelState)traffic
|
||||
.getProcessingChain().getChannelState();
|
||||
|
||||
MPT1327ChannelState controlState =
|
||||
(MPT1327ChannelState)getProcessingChain()
|
||||
.getChannelState();
|
||||
|
||||
trafficState.setChannelMap( controlState.getChannelMap() );
|
||||
trafficState.setChannelNumber( channelNumber );
|
||||
trafficState.setFromTalkgroup( mpt.getFromID() );
|
||||
trafficState.setToTalkgroup( mpt.getToID() );
|
||||
|
||||
/* Add this control channel as message listener on the
|
||||
* traffic channel so we can receive call tear-down
|
||||
* messages */
|
||||
traffic.addListener( (Listener<Message>)this );
|
||||
|
||||
CallEventType type = traffic.isProcessing() ?
|
||||
CallEventType.CALL_START :
|
||||
CallEventType.CALL_START_NO_TUNER;
|
||||
|
||||
/*
|
||||
* Set the traffic channel's call event model to
|
||||
* share the control channel's call event model
|
||||
*/
|
||||
traffic.getProcessingChain().getChannelState()
|
||||
.setCallEventModel( mCallEventModel );
|
||||
|
||||
mCallEventModel.add(
|
||||
new MPT1327CallEvent.Builder( type )
|
||||
.aliasList( traffic.getProcessingChain().getAliasList() )
|
||||
.channel( channelNumber )
|
||||
.frequency( mChannelMap.getFrequency( channelNumber ) )
|
||||
.from( mpt.getFromID() )
|
||||
.to( mpt.getToID() )
|
||||
.build() );
|
||||
/* Add this control channel as message listener on the
|
||||
* traffic channel so we can receive call tear-down
|
||||
* messages */
|
||||
traffic.addListener( (Listener<Message>)this );
|
||||
|
||||
CallEventType type = traffic.isProcessing() ?
|
||||
CallEventType.CALL_START :
|
||||
CallEventType.CALL_START_NO_TUNER;
|
||||
|
||||
/*
|
||||
* Set the traffic channel's call event model to
|
||||
* share the control channel's call event model
|
||||
*/
|
||||
traffic.getProcessingChain().getChannelState()
|
||||
.setCallEventModel( mCallEventModel );
|
||||
|
||||
mCallEventModel.add(
|
||||
new MPT1327CallEvent.Builder( type )
|
||||
.aliasList( traffic.getProcessingChain().getAliasList() )
|
||||
.channel( channelNumber )
|
||||
.frequency( mChannelMap.getFrequency( channelNumber ) )
|
||||
.from( mpt.getFromID() )
|
||||
.to( mpt.getToID() )
|
||||
.build() );
|
||||
}
|
||||
}
|
||||
|
||||
long frequency = mChannelMap.getFrequency( channelNumber );
|
||||
|
||||
break;
|
||||
case CLEAR:
|
||||
case MAINT:
|
||||
@@ -237,7 +238,7 @@ public class MPT1327ChannelState extends ChannelState
|
||||
mCallEventModel.add(
|
||||
new MPT1327CallEvent.Builder( CallEventType.SDM )
|
||||
.aliasList( mAliasList )
|
||||
.details( mpt.getMessageType().getDescription() )
|
||||
.details( mpt.getMessage() )
|
||||
.from( mpt.getFromID() )
|
||||
.to( mpt.getToID() )
|
||||
.build() );
|
||||
@@ -378,6 +379,7 @@ public class MPT1327ChannelState extends ChannelState
|
||||
traffic.setSourceConfiguration( source );
|
||||
|
||||
DecodeConfigMPT1327 decode = new DecodeConfigMPT1327();
|
||||
|
||||
traffic.setDecodeConfiguration( decode );
|
||||
|
||||
traffic.setAliasListName( aliasListName );
|
||||
|
||||
Reference in New Issue
Block a user