mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-05 08:15:11 -04:00
Beta scanner app
ADSB TX frame index bugfix (OOB)
This commit is contained in:
parent
5636764226
commit
3ddc6553ac
5 changed files with 213 additions and 28 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||
* Copyright (C) 2016 Furrtek
|
||||
* Copyright (C) 2018 Furrtek
|
||||
*
|
||||
* This file is part of PortaPack.
|
||||
*
|
||||
|
@ -22,16 +22,37 @@
|
|||
|
||||
#include "receiver_model.hpp"
|
||||
|
||||
#include "spectrum_color_lut.hpp"
|
||||
|
||||
#include "ui_receiver.hpp"
|
||||
#include "ui_font_fixed_8x16.hpp"
|
||||
|
||||
namespace ui {
|
||||
|
||||
class ScannerThread {
|
||||
public:
|
||||
ScannerThread(std::vector<rf::Frequency> frequency_list);
|
||||
~ScannerThread();
|
||||
|
||||
void set_scanning(const bool v);
|
||||
|
||||
ScannerThread(const ScannerThread&) = delete;
|
||||
ScannerThread(ScannerThread&&) = delete;
|
||||
ScannerThread& operator=(const ScannerThread&) = delete;
|
||||
ScannerThread& operator=(ScannerThread&&) = delete;
|
||||
|
||||
private:
|
||||
std::vector<rf::Frequency> frequency_list_ { };
|
||||
Thread* thread { nullptr };
|
||||
|
||||
bool _scanning { true };
|
||||
|
||||
static msg_t static_fn(void* arg);
|
||||
|
||||
void run();
|
||||
};
|
||||
|
||||
class ScannerView : public View {
|
||||
public:
|
||||
ScannerView(NavigationView& nav);
|
||||
ScannerView(NavigationView&);
|
||||
~ScannerView();
|
||||
|
||||
void focus() override;
|
||||
|
@ -39,13 +60,68 @@ public:
|
|||
std::string title() const override { return "Scanner"; };
|
||||
|
||||
private:
|
||||
void on_statistics_update(const ChannelStatistics& statistics);
|
||||
void on_headphone_volume_changed(int32_t v);
|
||||
void handle_retune(uint32_t i);
|
||||
|
||||
std::vector<rf::Frequency> frequency_list { };
|
||||
int32_t squelch { 0 };
|
||||
uint32_t timer { 0 };
|
||||
|
||||
Labels labels {
|
||||
{ { 1 * 8, 0 }, "Work in progress...", Color::light_grey() }
|
||||
{ { 0 * 8, 0 * 16 }, "LNA: VGA: AMP: VOL:", Color::light_grey() },
|
||||
{ { 0 * 8, 1 * 16 }, "SQUELCH: /99", Color::light_grey() },
|
||||
{ { 0 * 8, 3 * 16 }, "Work in progress...", Color::light_grey() }
|
||||
};
|
||||
|
||||
Button button {
|
||||
{ 60, 64, 120, 32 },
|
||||
"Exit"
|
||||
LNAGainField field_lna {
|
||||
{ 4 * 8, 0 * 16 }
|
||||
};
|
||||
|
||||
VGAGainField field_vga {
|
||||
{ 11 * 8, 0 * 16 }
|
||||
};
|
||||
|
||||
RFAmpField field_rf_amp {
|
||||
{ 18 * 8, 0 * 16 }
|
||||
};
|
||||
|
||||
NumberField field_volume {
|
||||
{ 24 * 8, 0 * 16 },
|
||||
2,
|
||||
{ 0, 99 },
|
||||
1,
|
||||
' ',
|
||||
};
|
||||
|
||||
NumberField field_squelch {
|
||||
{ 8 * 8, 1 * 16 },
|
||||
2,
|
||||
{ 0, 99 },
|
||||
1,
|
||||
' ',
|
||||
};
|
||||
|
||||
Text text_cycle {
|
||||
{ 0, 5 * 16, 240, 16 },
|
||||
"--/--"
|
||||
};
|
||||
|
||||
std::unique_ptr<ScannerThread> scan_thread { };
|
||||
|
||||
MessageHandlerRegistration message_handler_retune {
|
||||
Message::ID::Retune,
|
||||
[this](const Message* const p) {
|
||||
const auto message = *reinterpret_cast<const RetuneMessage*>(p);
|
||||
this->handle_retune(message.range);
|
||||
}
|
||||
};
|
||||
|
||||
MessageHandlerRegistration message_handler_stats {
|
||||
Message::ID::ChannelStatistics,
|
||||
[this](const Message* const p) {
|
||||
this->on_statistics_update(static_cast<const ChannelStatisticsMessage*>(p)->statistics);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue