mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
#2212 Introduce carrier offset measurement processor to monitor a 12.5 kHz channel and provide estimated carrier offset measurements that allow the tuner's frequency error monitor to correct for the average error reported from each channel. Uses a 15 dB threshold where the signal must be at least 15 dB above the noise floor before it will calculate and broadcast the estimate. Stores the updated PPM in the tuner configuration after each update to ensure the value persists across sessions. When selected in the tuner panel, updates the displayed PPM value after each PPM autocorrection. (#2218)
Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2024 Dennis Sheirer
|
||||
* Copyright (C) 2014-2025 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
|
||||
@@ -158,6 +158,49 @@ public class Dispatcher<E> implements Listener<E>
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops this buffer processor and flushes the queue to the listener
|
||||
*/
|
||||
public void flushAndStop()
|
||||
{
|
||||
if(mRunning.compareAndSet(true, false))
|
||||
{
|
||||
if(mScheduledFuture != null)
|
||||
{
|
||||
//Note: this has to be false because downstream implementations may have acquired locks and they must
|
||||
//be able to release those locks or we'll get a deadlock situation.
|
||||
mScheduledFuture.cancel(false);
|
||||
mScheduledFuture = null;
|
||||
}
|
||||
|
||||
if(mExecutorService != null)
|
||||
{
|
||||
mExecutorService.shutdown();
|
||||
mExecutorService = null;
|
||||
}
|
||||
|
||||
List<E> elements = new ArrayList<>();
|
||||
|
||||
mQueue.drainTo(elements);
|
||||
|
||||
for(E element: elements)
|
||||
{
|
||||
if(mListener != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
mListener.receive(element);
|
||||
}
|
||||
catch(Throwable t)
|
||||
{
|
||||
mLog.error("Error while flusing and dispatching element [" + element.getClass() + "] to listener [" +
|
||||
mListener.getClass() + "]", t);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if this processor is currently running
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user