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:
jLynx 2023-05-19 08:16:05 +12:00 committed by GitHub
parent 7aca7ce74d
commit 033c4e9a5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
599 changed files with 70746 additions and 66896 deletions

View file

@ -39,122 +39,107 @@ using namespace pocsag;
namespace ui {
class POCSAGTXView : public View {
public:
POCSAGTXView(NavigationView& nav);
~POCSAGTXView();
POCSAGTXView(const POCSAGTXView&) = delete;
POCSAGTXView(POCSAGTXView&&) = delete;
POCSAGTXView& operator=(const POCSAGTXView&) = delete;
POCSAGTXView& operator=(POCSAGTXView&&) = delete;
void focus() override;
void paint(Painter&) override;
std::string title() const override { return "POCSAG TX"; };
public:
POCSAGTXView(NavigationView& nav);
~POCSAGTXView();
private:
std::string buffer { "PORTAPACK" };
std::string message { };
NavigationView& nav_;
POCSAGTXView(const POCSAGTXView&) = delete;
POCSAGTXView(POCSAGTXView&&) = delete;
POCSAGTXView& operator=(const POCSAGTXView&) = delete;
POCSAGTXView& operator=(POCSAGTXView&&) = delete;
BCHCode BCH_code {
{ 1, 0, 1, 0, 0, 1 },
5, 31, 21, 2
};
// app save settings
std::app_settings settings { };
std::app_settings::AppSettings app_settings { };
void focus() override;
void paint(Painter&) override;
void on_set_text(NavigationView& nav);
void on_tx_progress(const uint32_t progress, const bool done);
bool start_tx();
Labels labels {
{ { 3 * 8, 4 * 8 }, "Bitrate:", Color::light_grey() },
{ { 3 * 8, 6 * 8 }, "Address:", Color::light_grey() },
{ { 6 * 8, 8 * 8 }, "Type:", Color::light_grey() },
{ { 2 * 8, 10 * 8 }, "Function:", Color::light_grey() },
{ { 5 * 8, 12 * 8 }, "Phase:", Color::light_grey() },
{ { 0 * 8, 14 * 8 }, "Message:", Color::light_grey() }
};
OptionsField options_bitrate {
{ 11 * 8, 4 * 8 },
8,
{
{ "512 bps ", 0 },
{ "1200 bps", 1 },
{ "2400 bps", 2 }
}
};
std::string title() const override { return "POCSAG TX"; };
SymField field_address {
{ 11 * 8, 6 * 8 },
7,
SymField::SYMFIELD_DEC
};
OptionsField options_type {
{ 11 * 8, 8 * 8 },
12,
{
{ "Address only", MessageType::ADDRESS_ONLY },
{ "Numeric only", MessageType::NUMERIC_ONLY },
{ "Alphanumeric", MessageType::ALPHANUMERIC }
}
};
OptionsField options_function {
{ 11 * 8, 10 * 8 },
1,
{
{ "A", 0 },
{ "B", 1 },
{ "C", 2 },
{ "D", 3 }
}
};
private:
std::string buffer{"PORTAPACK"};
std::string message{};
NavigationView& nav_;
OptionsField options_phase {
{ 11 * 8, 12 * 8 },
1,
{
{ "P", 0 },
{ "N", 1 },
}
};
Text text_message {
{ 0 * 8, 16 * 8, 16 * 8, 16 },
""
};
Button button_message {
{ 0 * 8, 18 * 8, 14 * 8, 32 },
"Set message"
};
ProgressBar progressbar {
{ 16, 200, 208, 16 }
};
TransmitterView tx_view {
16 * 16,
10000,
9
};
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);
}
};
BCHCode BCH_code{
{1, 0, 1, 0, 0, 1},
5,
31,
21,
2};
// app save settings
std::app_settings settings{};
std::app_settings::AppSettings app_settings{};
void on_set_text(NavigationView& nav);
void on_tx_progress(const uint32_t progress, const bool done);
bool start_tx();
Labels labels{
{{3 * 8, 4 * 8}, "Bitrate:", Color::light_grey()},
{{3 * 8, 6 * 8}, "Address:", Color::light_grey()},
{{6 * 8, 8 * 8}, "Type:", Color::light_grey()},
{{2 * 8, 10 * 8}, "Function:", Color::light_grey()},
{{5 * 8, 12 * 8}, "Phase:", Color::light_grey()},
{{0 * 8, 14 * 8}, "Message:", Color::light_grey()}};
OptionsField options_bitrate{
{11 * 8, 4 * 8},
8,
{{"512 bps ", 0},
{"1200 bps", 1},
{"2400 bps", 2}}};
SymField field_address{
{11 * 8, 6 * 8},
7,
SymField::SYMFIELD_DEC};
OptionsField options_type{
{11 * 8, 8 * 8},
12,
{{"Address only", MessageType::ADDRESS_ONLY},
{"Numeric only", MessageType::NUMERIC_ONLY},
{"Alphanumeric", MessageType::ALPHANUMERIC}}};
OptionsField options_function{
{11 * 8, 10 * 8},
1,
{{"A", 0},
{"B", 1},
{"C", 2},
{"D", 3}}};
OptionsField options_phase{
{11 * 8, 12 * 8},
1,
{
{"P", 0},
{"N", 1},
}};
Text text_message{
{0 * 8, 16 * 8, 16 * 8, 16},
""};
Button button_message{
{0 * 8, 18 * 8, 14 * 8, 32},
"Set message"};
ProgressBar progressbar{
{16, 200, 208, 16}};
TransmitterView tx_view{
16 * 16,
10000,
9};
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 */
#endif/*__POCSAG_TX_H__*/
#endif /*__POCSAG_TX_H__*/