mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-07 14:12:31 -04:00
Formatted code (#1007)
* Updated style * Updated files * fixed new line * Updated spacing * File fix WIP * Updated to clang 13 * updated comment style * Removed old comment code
This commit is contained in:
parent
7aca7ce74d
commit
033c4e9a5b
599 changed files with 70746 additions and 66896 deletions
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||
* Copyright (C) 2017 Furrtek
|
||||
*
|
||||
*
|
||||
* This file is part of PortaPack.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
@ -35,82 +35,74 @@
|
|||
namespace ui {
|
||||
|
||||
class APRSTXView : public View {
|
||||
public:
|
||||
APRSTXView(NavigationView& nav);
|
||||
~APRSTXView();
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "APRS TX"; };
|
||||
public:
|
||||
APRSTXView(NavigationView& nav);
|
||||
~APRSTXView();
|
||||
|
||||
private:
|
||||
|
||||
// app save settings
|
||||
std::app_settings settings { };
|
||||
std::app_settings::AppSettings app_settings { };
|
||||
void focus() override;
|
||||
|
||||
std::string payload { "" };
|
||||
|
||||
void start_tx();
|
||||
void generate_frame();
|
||||
void generate_frame_pos();
|
||||
void on_tx_progress(const uint32_t progress, const bool done);
|
||||
|
||||
Labels labels {
|
||||
{ { 0 * 8, 1 * 16 }, "Source: SSID:", Color::light_grey() }, // 6 alphanum + SSID
|
||||
{ { 0 * 8, 2 * 16 }, " Dest.: SSID:", Color::light_grey() },
|
||||
{ { 0 * 8, 4 * 16 }, "Info field:", Color::light_grey() },
|
||||
};
|
||||
|
||||
SymField sym_source {
|
||||
{ 7 * 8, 1 * 16 },
|
||||
6,
|
||||
SymField::SYMFIELD_ALPHANUM
|
||||
};
|
||||
NumberField num_ssid_source {
|
||||
{ 19 * 8, 1 * 16 },
|
||||
2,
|
||||
{ 0, 15 },
|
||||
1,
|
||||
' '
|
||||
};
|
||||
|
||||
SymField sym_dest {
|
||||
{ 7 * 8, 2 * 16 },
|
||||
6,
|
||||
SymField::SYMFIELD_ALPHANUM
|
||||
};
|
||||
|
||||
NumberField num_ssid_dest {
|
||||
{ 19 * 8, 2 * 16 },
|
||||
2,
|
||||
{ 0, 15 },
|
||||
1,
|
||||
' '
|
||||
};
|
||||
|
||||
Text text_payload {
|
||||
{ 0 * 8, 5 * 16, 30 * 8, 16 },
|
||||
"-"
|
||||
};
|
||||
Button button_set {
|
||||
{ 0 * 8, 6 * 16, 80, 32 },
|
||||
"Set"
|
||||
};
|
||||
|
||||
TransmitterView tx_view {
|
||||
16 * 16,
|
||||
5000,
|
||||
0 // disable setting bandwith, since APRS used fixed 10k bandwidth
|
||||
};
|
||||
|
||||
MessageHandlerRegistration message_handler_tx_progress {
|
||||
Message::ID::TXProgress,
|
||||
[this](const Message* const p) {
|
||||
const auto message = *reinterpret_cast<const TXProgressMessage*>(p);
|
||||
this->on_tx_progress(message.progress, message.done);
|
||||
}
|
||||
};
|
||||
std::string title() const override { return "APRS TX"; };
|
||||
|
||||
private:
|
||||
// app save settings
|
||||
std::app_settings settings{};
|
||||
std::app_settings::AppSettings app_settings{};
|
||||
|
||||
std::string payload{""};
|
||||
|
||||
void start_tx();
|
||||
void generate_frame();
|
||||
void generate_frame_pos();
|
||||
void on_tx_progress(const uint32_t progress, const bool done);
|
||||
|
||||
Labels labels{
|
||||
{{0 * 8, 1 * 16}, "Source: SSID:", Color::light_grey()}, // 6 alphanum + SSID
|
||||
{{0 * 8, 2 * 16}, " Dest.: SSID:", Color::light_grey()},
|
||||
{{0 * 8, 4 * 16}, "Info field:", Color::light_grey()},
|
||||
};
|
||||
|
||||
SymField sym_source{
|
||||
{7 * 8, 1 * 16},
|
||||
6,
|
||||
SymField::SYMFIELD_ALPHANUM};
|
||||
NumberField num_ssid_source{
|
||||
{19 * 8, 1 * 16},
|
||||
2,
|
||||
{0, 15},
|
||||
1,
|
||||
' '};
|
||||
|
||||
SymField sym_dest{
|
||||
{7 * 8, 2 * 16},
|
||||
6,
|
||||
SymField::SYMFIELD_ALPHANUM};
|
||||
|
||||
NumberField num_ssid_dest{
|
||||
{19 * 8, 2 * 16},
|
||||
2,
|
||||
{0, 15},
|
||||
1,
|
||||
' '};
|
||||
|
||||
Text text_payload{
|
||||
{0 * 8, 5 * 16, 30 * 8, 16},
|
||||
"-"};
|
||||
Button button_set{
|
||||
{0 * 8, 6 * 16, 80, 32},
|
||||
"Set"};
|
||||
|
||||
TransmitterView tx_view{
|
||||
16 * 16,
|
||||
5000,
|
||||
0 // disable setting bandwith, since APRS used fixed 10k bandwidth
|
||||
};
|
||||
|
||||
MessageHandlerRegistration message_handler_tx_progress{
|
||||
Message::ID::TXProgress,
|
||||
[this](const Message* const p) {
|
||||
const auto message = *reinterpret_cast<const TXProgressMessage*>(p);
|
||||
this->on_tx_progress(message.progress, message.done);
|
||||
}};
|
||||
};
|
||||
|
||||
} /* namespace ui */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue