mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-13 06:17:42 +00:00
ADSB RX App cleanup (#1569)
* WIP refactoring/gardening * WIP cleanup, adding status dots * Rename ageStep * WIP Cleanup * Wrapping up ADSB refactor/cleanup. * Don't initialize strings to " " * Better map refresh * Fix colorization of recent entries * Fit and finish
This commit is contained in:
@@ -1089,13 +1089,9 @@ class APRSPacketMessage : public Message {
|
||||
|
||||
class ADSBConfigureMessage : public Message {
|
||||
public:
|
||||
constexpr ADSBConfigureMessage(
|
||||
const uint32_t test)
|
||||
: Message{ID::ADSBConfigure},
|
||||
test(test) {
|
||||
constexpr ADSBConfigureMessage()
|
||||
: Message{ID::ADSBConfigure} {
|
||||
}
|
||||
|
||||
const uint32_t test;
|
||||
};
|
||||
|
||||
class JammerConfigureMessage : public Message {
|
||||
|
@@ -587,6 +587,28 @@ void ProgressBar::paint(Painter& painter) {
|
||||
painter.draw_rectangle(sr, s.foreground);
|
||||
}
|
||||
|
||||
/* ActivityDot ***********************************************************/
|
||||
|
||||
ActivityDot::ActivityDot(
|
||||
Rect parent_rect,
|
||||
Color color)
|
||||
: Widget{parent_rect},
|
||||
_color{color} {}
|
||||
|
||||
void ActivityDot::paint(Painter& painter) {
|
||||
painter.fill_rectangle(screen_rect(), _on ? _color : Color::grey());
|
||||
}
|
||||
|
||||
void ActivityDot::toggle() {
|
||||
_on = !_on;
|
||||
set_dirty();
|
||||
}
|
||||
|
||||
void ActivityDot::reset() {
|
||||
_on = false;
|
||||
set_dirty();
|
||||
}
|
||||
|
||||
/* Console ***************************************************************/
|
||||
|
||||
Console::Console(
|
||||
|
@@ -317,6 +317,20 @@ class ProgressBar : public Widget {
|
||||
uint32_t _max = 100;
|
||||
};
|
||||
|
||||
/* A simple status indicator that can be used to indicate activity. */
|
||||
class ActivityDot : public Widget {
|
||||
public:
|
||||
ActivityDot(Rect parent_rect, Color color);
|
||||
|
||||
void paint(Painter& painter) override;
|
||||
void toggle();
|
||||
void reset();
|
||||
|
||||
private:
|
||||
bool _on{false};
|
||||
Color _color;
|
||||
};
|
||||
|
||||
class Console : public Widget {
|
||||
public:
|
||||
Console(Rect parent_rect);
|
||||
|
Reference in New Issue
Block a user