mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-27 16:17:31 -04:00
Decode status widget (#1431)
* Initial cleanup of pocsag beta, using DSP filters * Better filter params * Better filter * Add signal diagnostics widgets * POCSAG procs sends stats messages * Only draw 32 bits * Add AudioNormalizer filter
This commit is contained in:
parent
2435ee780f
commit
4819a2f4e2
9 changed files with 305 additions and 230 deletions
|
@ -52,6 +52,50 @@ class POCSAGLogger {
|
|||
|
||||
namespace ui {
|
||||
|
||||
class BitsIndicator : public Widget {
|
||||
public:
|
||||
BitsIndicator(Point position)
|
||||
: Widget{{position, {2, height}}} {}
|
||||
|
||||
void paint(Painter& painter) override;
|
||||
void set_bits(uint32_t bits) {
|
||||
if (bits != bits_) {
|
||||
bits_ = bits;
|
||||
set_dirty();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
static constexpr uint8_t height = 16;
|
||||
uint32_t bits_ = 0;
|
||||
};
|
||||
|
||||
class FrameIndicator : public Widget {
|
||||
public:
|
||||
FrameIndicator(Point position)
|
||||
: Widget{{position, {4, height}}} {}
|
||||
|
||||
void paint(Painter& painter) override;
|
||||
void set_frames(uint8_t frame_count) {
|
||||
if (frame_count != frame_count_) {
|
||||
frame_count_ = frame_count;
|
||||
set_dirty();
|
||||
}
|
||||
}
|
||||
|
||||
void set_sync(bool has_sync) {
|
||||
if (has_sync != has_sync_) {
|
||||
has_sync_ = has_sync;
|
||||
set_dirty();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
static constexpr uint8_t height = 16;
|
||||
uint8_t frame_count_ = 0;
|
||||
bool has_sync_ = false;
|
||||
};
|
||||
|
||||
struct POCSAGSettings {
|
||||
bool enable_small_font = false;
|
||||
bool enable_logging = false;
|
||||
|
@ -187,7 +231,8 @@ class POCSAGAppView : public View {
|
|||
2,
|
||||
{0, 99},
|
||||
1,
|
||||
' '};
|
||||
' ',
|
||||
true /*wrap*/};
|
||||
AudioVolumeField field_volume{
|
||||
{28 * 8, 0 * 16}};
|
||||
|
||||
|
@ -201,6 +246,12 @@ class POCSAGAppView : public View {
|
|||
{3 * 8, 1 * 16 + 2, 5 * 8, 16},
|
||||
"0"};
|
||||
|
||||
BitsIndicator widget_bits{
|
||||
{9 * 7 + 6, 1 * 16 + 2}};
|
||||
|
||||
FrameIndicator widget_frames{
|
||||
{9 * 8, 1 * 16 + 2}};
|
||||
|
||||
Button button_ignore_last{
|
||||
{10 * 8, 1 * 16, 12 * 8, 20},
|
||||
"Ignore Last"};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue