mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-08 06:32:35 -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
|
@ -34,105 +34,93 @@
|
|||
namespace ui {
|
||||
|
||||
class SigGenView : public View {
|
||||
public:
|
||||
SigGenView(NavigationView& nav);
|
||||
~SigGenView();
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "Signal gen"; };
|
||||
public:
|
||||
SigGenView(NavigationView& nav);
|
||||
~SigGenView();
|
||||
|
||||
private:
|
||||
void start_tx();
|
||||
void update_config();
|
||||
void update_tone();
|
||||
void on_tx_progress(const uint32_t progress, const bool done);
|
||||
|
||||
const std::string shape_strings[7] = {
|
||||
"CW-just carrier",
|
||||
"Sine signal ",
|
||||
"Triangle signal",
|
||||
"Saw up signal ",
|
||||
"Saw down signal",
|
||||
"Square signal ",
|
||||
"Noise signal " // using 16 bits LFSR register, 16 order polynomial feedback.
|
||||
};
|
||||
|
||||
bool auto_update { false };
|
||||
|
||||
Labels labels {
|
||||
{ { 3 * 8, 4 + 10 }, "Shape:", Color::light_grey() },
|
||||
{ { 6 * 8, 7 * 8 }, "Tone: Hz", Color::light_grey() },
|
||||
{ { 22 * 8, 15 * 8 + 4 }, "s.", Color::light_grey() },
|
||||
{ { 8 * 8, 20 * 8 }, "Modulation: FM", Color::light_grey() }
|
||||
};
|
||||
|
||||
ImageOptionsField options_shape {
|
||||
{ 10 * 8, 4, 32, 32 },
|
||||
Color::white(),
|
||||
Color::black(),
|
||||
{
|
||||
{ &bitmap_sig_cw, 0 },
|
||||
{ &bitmap_sig_sine, 1 },
|
||||
{ &bitmap_sig_tri, 2 },
|
||||
{ &bitmap_sig_saw_up, 3 },
|
||||
{ &bitmap_sig_saw_down, 4 },
|
||||
{ &bitmap_sig_square, 5 },
|
||||
{ &bitmap_sig_noise, 6 }
|
||||
}
|
||||
};
|
||||
|
||||
Text text_shape {
|
||||
{ 15 * 8, 4 + 10, 8 * 8, 16 },
|
||||
""
|
||||
};
|
||||
|
||||
SymField symfield_tone {
|
||||
{ 13 * 8, 7 * 8 },
|
||||
5,
|
||||
SymField::SYMFIELD_DEC
|
||||
};
|
||||
|
||||
Button button_update {
|
||||
{ 5 * 8, 10 * 8, 8 * 8, 3 * 8 },
|
||||
"Update"
|
||||
};
|
||||
|
||||
Checkbox checkbox_auto {
|
||||
{ 15 * 8, 10 * 8 },
|
||||
4,
|
||||
"Auto"
|
||||
};
|
||||
|
||||
Checkbox checkbox_stop {
|
||||
{ 5 * 8, 15 * 8 },
|
||||
10,
|
||||
"Stop after"
|
||||
};
|
||||
|
||||
NumberField field_stop {
|
||||
{ 20 * 8, 15 * 8 + 4 },
|
||||
2,
|
||||
{ 1, 99 },
|
||||
1,
|
||||
' '
|
||||
};
|
||||
|
||||
TransmitterView tx_view {
|
||||
16 * 16,
|
||||
10000,
|
||||
12
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
};
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "Signal gen"; };
|
||||
|
||||
private:
|
||||
void start_tx();
|
||||
void update_config();
|
||||
void update_tone();
|
||||
void on_tx_progress(const uint32_t progress, const bool done);
|
||||
|
||||
const std::string shape_strings[7] = {
|
||||
"CW-just carrier",
|
||||
"Sine signal ",
|
||||
"Triangle signal",
|
||||
"Saw up signal ",
|
||||
"Saw down signal",
|
||||
"Square signal ",
|
||||
"Noise signal " // using 16 bits LFSR register, 16 order polynomial feedback.
|
||||
};
|
||||
|
||||
bool auto_update{false};
|
||||
|
||||
Labels labels{
|
||||
{{3 * 8, 4 + 10}, "Shape:", Color::light_grey()},
|
||||
{{6 * 8, 7 * 8}, "Tone: Hz", Color::light_grey()},
|
||||
{{22 * 8, 15 * 8 + 4}, "s.", Color::light_grey()},
|
||||
{{8 * 8, 20 * 8}, "Modulation: FM", Color::light_grey()}};
|
||||
|
||||
ImageOptionsField options_shape{
|
||||
{10 * 8, 4, 32, 32},
|
||||
Color::white(),
|
||||
Color::black(),
|
||||
{{&bitmap_sig_cw, 0},
|
||||
{&bitmap_sig_sine, 1},
|
||||
{&bitmap_sig_tri, 2},
|
||||
{&bitmap_sig_saw_up, 3},
|
||||
{&bitmap_sig_saw_down, 4},
|
||||
{&bitmap_sig_square, 5},
|
||||
{&bitmap_sig_noise, 6}}};
|
||||
|
||||
Text text_shape{
|
||||
{15 * 8, 4 + 10, 8 * 8, 16},
|
||||
""};
|
||||
|
||||
SymField symfield_tone{
|
||||
{13 * 8, 7 * 8},
|
||||
5,
|
||||
SymField::SYMFIELD_DEC};
|
||||
|
||||
Button button_update{
|
||||
{5 * 8, 10 * 8, 8 * 8, 3 * 8},
|
||||
"Update"};
|
||||
|
||||
Checkbox checkbox_auto{
|
||||
{15 * 8, 10 * 8},
|
||||
4,
|
||||
"Auto"};
|
||||
|
||||
Checkbox checkbox_stop{
|
||||
{5 * 8, 15 * 8},
|
||||
10,
|
||||
"Stop after"};
|
||||
|
||||
NumberField field_stop{
|
||||
{20 * 8, 15 * 8 + 4},
|
||||
2,
|
||||
{1, 99},
|
||||
1,
|
||||
' '};
|
||||
|
||||
TransmitterView tx_view{
|
||||
16 * 16,
|
||||
10000,
|
||||
12};
|
||||
|
||||
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/*__SIGGEN_H__*/
|
||||
#endif /*__SIGGEN_H__*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue