Slow down redraw

Combine improvements and slow down refresh.
This commit is contained in:
heurist1 2021-11-01 20:37:27 +00:00
parent 1a21e06bbe
commit 8a4564f6f5
2 changed files with 14 additions and 25 deletions

View file

@ -304,8 +304,8 @@ void ADSBRxView::on_frame(const ADSBFrameMessage * message) {
} }
} }
replace_entry(entry); replace_entry(entry);
recent_entries_view.set_dirty();
logger = std::make_unique<ADSBLogger>(); logger = std::make_unique<ADSBLogger>();
if (logger) { if (logger) {

View file

@ -59,20 +59,12 @@ void ADSBRXProcessor::execute(const buffer_c8_t& buffer) {
const ADSBFrameMessage message(frame); const ADSBFrameMessage message(frame);
shared_memory.application_queue.push(message); shared_memory.application_queue.push(message);
decoding = false; decoding = false;
bit = (prev_mag > mag) ? 1 : 0;
if (prev_mag > mag)
bit = 1;
else
bit = 0;
} }
else else
{ {
//confidence = true; //confidence = true;
if (prev_mag > mag) bit = (prev_mag > mag) ? 1 : 0;
bit = 1;
else
bit = 0;
} }
byte = bit | (byte << 1); byte = bit | (byte << 1);
@ -88,11 +80,18 @@ void ADSBRXProcessor::execute(const buffer_c8_t& buffer) {
if ( (bit_count == 8) && !(byte & (0x10<<3)) ) { if ( (bit_count == 8) && !(byte & (0x10<<3)) ) {
msgLen = 56; // DFs 16 or greater are long 112. DFs 15 or less are short 56. msgLen = 56; // DFs 16 or greater are long 112. DFs 15 or less are short 56.
} }
// Abondon all frames that arent DF17
if ( (bit_count == 8) && ((byte>>3) != 17) ) {
decoding = false;
bit = (prev_mag > mag) ? 1 : 0;
frame.clear();
}
} // last bit of a byte } // last bit of a byte
} // Second sample of each bit } // Second sample of each bit
sample_count++; sample_count++;
} }
//else
// Continue looking for preamble even if in a packet // Continue looking for preamble even if in a packet
// switch is new preamble id higher magnitude // switch is new preamble id higher magnitude
{ {
@ -124,7 +123,7 @@ void ADSBRXProcessor::execute(const buffer_c8_t& buffer) {
// the high levels as signals can be out of phase so part of the // the high levels as signals can be out of phase so part of the
// energy can be in the near samples // energy can be in the near samples
float thisAmp = (shifter[0] + shifter[2] + shifter[7] + shifter[9]); float thisAmp = (shifter[0] + shifter[2] + shifter[7] + shifter[9]);
float high = thisAmp / 6.0f; float high = thisAmp / 7.0f;
if (shifter[4] < high && if (shifter[4] < high &&
shifter[5] < high) shifter[5] < high)
{ {
@ -137,18 +136,8 @@ void ADSBRXProcessor::execute(const buffer_c8_t& buffer) {
shifter[13] < high && shifter[13] < high &&
shifter[14] < high) shifter[14] < high)
{ {
bool newPacket = false; if ( (decoding == false) || // New preamble
if (decoding == false) ((decoding == true)&& (thisAmp > amp)) ) // Higher power than existing packet
{
newPacket = true;
}
else if (decoding == true)
{
if(thisAmp > amp)
newPacket = true;
}
//if (c == ADSB_PREAMBLE_LENGTH) {
if (newPacket == true)
{ {
decoding = true; decoding = true;
msgLen = 112; msgLen = 112;