diff --git a/firmware/application/apps/ui_adsb_rx.cpp b/firmware/application/apps/ui_adsb_rx.cpp index d50b3ed3..1be46deb 100644 --- a/firmware/application/apps/ui_adsb_rx.cpp +++ b/firmware/application/apps/ui_adsb_rx.cpp @@ -65,10 +65,12 @@ void RecentEntriesTable::draw( (entry.hits <= 999 ? to_string_dec_uint(entry.hits, 4) : "999+") + " " + entry.time_string; #else + // SBT entry_string += - (entry.callsign[0]!=' ' ? entry.callsign + " " : to_string_hex(entry.ICAO_address, 6) + " ") + - to_string_dec_int(entry.pos.altitude,5) + " " + - to_string_dec_int(entry.velo.speed,3) + " " + + (entry.callsign[0]!=' ' ? entry.callsign + " " : to_string_hex(entry.ICAO_address, 6) + " ") + + to_string_dec_uint((unsigned int)((entry.pos.altitude+50)/100),4) + + to_string_dec_uint((unsigned int)entry.velo.speed,4) + " " + + to_string_dec_uint((unsigned int)(entry.amp*100),3) + " " + (entry.hits <= 999 ? to_string_dec_uint(entry.hits, 3) + " " : "1k+ ") + to_string_dec_uint(entry.age, 3); #endif @@ -80,7 +82,7 @@ void RecentEntriesTable::draw( ); if (entry.pos.valid) - painter.draw_bitmap(target_rect.location() + Point(15 * 8, 0), bitmap_target, target_color, style.background); + painter.draw_bitmap(target_rect.location() + Point(8 * 8, 0), bitmap_target, target_color, style.background); } void ADSBLogger::log_str(std::string& logline) { @@ -253,6 +255,12 @@ void ADSBRxView::on_frame(const ADSBFrameMessage * message) { auto entry = find_or_create_entry(ICAO_address); frame.set_rx_timestamp(datetime.minute() * 60 + datetime.second()); entry.reset_age(); + if (entry.hits==0) + { + entry.amp = message->amp; + } else { + entry.amp = ((entry.amp*9.0f)+message->amp)/10.0f; + } str_timestamp = to_string_datetime(datetime, HMS); entry.set_time_string(str_timestamp); diff --git a/firmware/application/apps/ui_adsb_rx.hpp b/firmware/application/apps/ui_adsb_rx.hpp index 9a5a93eb..998d2bef 100644 --- a/firmware/application/apps/ui_adsb_rx.hpp +++ b/firmware/application/apps/ui_adsb_rx.hpp @@ -76,6 +76,7 @@ struct AircraftRecentEntry { uint16_t age_state { 1 }; uint32_t age { 0 }; + float amp {0.0f}; adsb_pos pos { false, 0, 0, 0 }; adsb_vel velo { false, 0, 999, 0 }; ADSBFrame frame_pos_even { }; @@ -269,10 +270,11 @@ private: { "Time", 8 } #else { "ICAO/Call", 9 }, - { "Alt", 6 }, - { "Spd", 4 }, - { "Hits", 4 }, - { "Age", 4 } + { "Lvl", 3 }, + { "Spd", 3 }, + { "Amp", 3 }, + { "Hit", 3 }, + { "Age", 3 } #endif } }; AircraftRecentEntries recent { }; diff --git a/firmware/baseband/proc_adsbrx.cpp b/firmware/baseband/proc_adsbrx.cpp index 33be8f02..a82cbc81 100644 --- a/firmware/baseband/proc_adsbrx.cpp +++ b/firmware/baseband/proc_adsbrx.cpp @@ -56,7 +56,7 @@ void ADSBRXProcessor::execute(const buffer_c8_t& buffer) { if (sample_count & 1) { if (bit_count >= msgLen) { - const ADSBFrameMessage message(frame); + const ADSBFrameMessage message(frame, amp); shared_memory.application_queue.push(message); decoding = false; bit = (prev_mag > mag) ? 1 : 0; diff --git a/firmware/common/message.hpp b/firmware/common/message.hpp index f9b965ee..685022c3 100644 --- a/firmware/common/message.hpp +++ b/firmware/common/message.hpp @@ -376,13 +376,16 @@ public: class ADSBFrameMessage : public Message { public: constexpr ADSBFrameMessage( - const adsb::ADSBFrame& frame + const adsb::ADSBFrame& frame, + const float amp ) : Message { ID::ADSBFrame }, - frame { frame } + frame { frame }, + amp(amp) { } adsb::ADSBFrame frame; + float amp; }; class AFSKDataMessage : public Message {