mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-17 11:07:35 -05:00
#1845 Updates polyphase tuner channel manager to avoid retuning for a new channel if all channels will continue to fit using the current center frequency (#1846)
Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
@@ -647,45 +647,6 @@ public abstract class TunerController implements Tunable, ISourceEventProcessor,
|
||||
broadcast(nativeBuffer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the current center frequency and bandwidth is correct to source the tuner channel
|
||||
*
|
||||
* @param tunerChannel to test
|
||||
* @return true if the current center frequency and bandwidth is correct for the channel
|
||||
*/
|
||||
public boolean isTunedFor(TunerChannel tunerChannel)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(tunerChannel.getMinFrequency() < getMinTunedFrequency())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(tunerChannel.getMaxFrequency() > getMaxTunedFrequency())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(hasMiddleUnusableBandwidth())
|
||||
{
|
||||
long minAvoid = getFrequency() - getMiddleUnusableHalfBandwidth();
|
||||
long maxAvoid = getFrequency() + getMiddleUnusableHalfBandwidth();
|
||||
|
||||
if(tunerChannel.overlaps(minAvoid, maxAvoid))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(SourceException se)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the current center frequency and bandwidth is correct to source the tuner channel set
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user