61 Rotating Control Channel Support - P25 Decoder (#475)

* Initial work on add support for rotating control channels.

* Creates multiple frequency editor control.

* Updates channel source editor to allow user to select multi-frequency
configuration and add multiple frequencies.

* Adds full support for rotating control channels to the P25 channelizer.
Users define multiple frequencies in the channel source configuration.
The decoder monitors the state of the channel for a CONTROL state.  If
the state does not stay in the CONTROL state for a user-specified delay
value, then the decoder rotates to the next frequency in the list.  This
behavior continues until the decoder state once again changes to CONTROL.

This is NOT a 'scanner' feature.
This commit is contained in:
Denny Sheirer
2019-01-06 06:59:04 -05:00
committed by GitHub
parent 3a39ae76ba
commit 5481fb7d4d
44 changed files with 2502 additions and 634 deletions

View File

@@ -1,6 +1,7 @@
/*******************************************************************************
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2017 Dennis Sheirer
* Copyright (C) 2014-2019 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
@@ -14,8 +15,8 @@
*
* 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 io.github.dsheirer.source;
import java.util.EnumSet;
@@ -31,6 +32,8 @@ public class SourceEvent
NOTIFICATION_FREQUENCY_AND_SAMPLE_RATE_UNLOCKED,
NOTIFICATION_FREQUENCY_CHANGE,
NOTIFICATION_FREQUENCY_CORRECTION_CHANGE,
NOTIFICATION_FREQUENCY_ROTATION_SUCCESS,
NOTIFICATION_FREQUENCY_ROTATION_FAILURE,
NOTIFICATION_MEASURED_FREQUENCY_ERROR,
NOTIFICATION_MEASURED_FREQUENCY_ERROR_SYNC_LOCKED,
NOTIFICATION_SAMPLE_RATE_CHANGE,
@@ -38,6 +41,7 @@ public class SourceEvent
REQUEST_CHANNEL_FREQUENCY_CORRECTION_CHANGE,
REQUEST_FREQUENCY_CHANGE,
REQUEST_FREQUENCY_ROTATION,
REQUEST_SOURCE_DISPOSE,
REQUEST_START_SAMPLE_STREAM,
REQUEST_STOP_SAMPLE_STREAM;
@@ -64,6 +68,14 @@ public class SourceEvent
mEventDescription = eventDescription;
}
/**
* Private constructor. Use the static constructor methods to create an event.
*/
private SourceEvent(Event event)
{
this(event, null, null, null);
}
/**
* Private constructor. Use the static constructor methods to create an event.
*/
@@ -175,9 +187,9 @@ public class SourceEvent
*
* @param frequency in hertz
*/
public static SourceEvent frequencyChange(long frequency)
public static SourceEvent frequencyChange(Source source, long frequency)
{
return new SourceEvent(Event.NOTIFICATION_FREQUENCY_CHANGE, frequency);
return new SourceEvent(Event.NOTIFICATION_FREQUENCY_CHANGE, source, frequency);
}
/**
@@ -186,9 +198,9 @@ public class SourceEvent
* @param frequency in hertz
* @param eventDescription to add a tag to the event
*/
public static SourceEvent frequencyChange(long frequency, String eventDescription)
public static SourceEvent frequencyChange(Source source, long frequency, String eventDescription)
{
return new SourceEvent(Event.NOTIFICATION_FREQUENCY_CHANGE, frequency, eventDescription);
return new SourceEvent(Event.NOTIFICATION_FREQUENCY_CHANGE, source, frequency, eventDescription);
}
/**
@@ -338,6 +350,33 @@ public class SourceEvent
return new SourceEvent(Event.REQUEST_SOURCE_DISPOSE, source);
}
/**
* Creates a request to cycle to the next source frequency. This is normally used for decoders to request the
* next frequency in a list when a multiple-frequency source configuration is defined.
*/
public static SourceEvent frequencyRotationRequest()
{
return new SourceEvent(Event.REQUEST_FREQUENCY_ROTATION);
}
/**
* Creates a notification that the request to rotate the source frequency to the next frequency in the list
* was successful.
*/
public static SourceEvent frequencyRotationSuccessNotification(Source source, long frequency)
{
return new SourceEvent(Event.NOTIFICATION_FREQUENCY_ROTATION_SUCCESS, source, frequency);
}
/**
* Creates a notification that the request to rotate the source frequency to the next frequency in the list
* was unsuccessful.
*/
public static SourceEvent frequencyRotationFailureNotification(Source source, long frequency)
{
return new SourceEvent(Event.NOTIFICATION_FREQUENCY_ROTATION_FAILURE, source, frequency);
}
@Override
public String toString()
{