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

@ -36,99 +36,90 @@
#include <string>
class TestLogger {
public:
Optional<File::Error> append(const std::string& filename) {
return log_file.append(filename);
}
void log_raw_data(const testapp::Packet& packet, const int32_t alt);
public:
Optional<File::Error> append(const std::string& filename) {
return log_file.append(filename);
}
private:
LogFile log_file { };
void log_raw_data(const testapp::Packet& packet, const int32_t alt);
private:
LogFile log_file{};
};
namespace ui {
class TestView : public View {
public:
static constexpr uint32_t sampling_rate = 2457600*2;
static constexpr uint32_t baseband_bandwidth = 1750000;
public:
static constexpr uint32_t sampling_rate = 2457600 * 2;
static constexpr uint32_t baseband_bandwidth = 1750000;
TestView(NavigationView& nav);
~TestView();
TestView(NavigationView& nav);
~TestView();
void focus() override;
void focus() override;
std::string title() const override { return "Test app"; };
std::string title() const override { return "Test app"; };
private:
uint32_t target_frequency_ { 439206000 };
Coord cur_x { 0 };
uint32_t packet_count { 0 };
uint32_t packets_lost { 0 };
uint32_t prev_v { 0 };
uint32_t raw_alt { 0 };
uint32_t cal_value { 0 };
bool logging { false };
Labels labels {
{ { 0 * 8, 1 * 16 }, "Data:", Color::light_grey() }
};
private:
uint32_t target_frequency_{439206000};
Coord cur_x{0};
uint32_t packet_count{0};
uint32_t packets_lost{0};
uint32_t prev_v{0};
uint32_t raw_alt{0};
uint32_t cal_value{0};
bool logging{false};
FrequencyField field_frequency {
{ 0 * 8, 0 * 8 },
};
RFAmpField field_rf_amp {
{ 13 * 8, 0 * 16 }
};
Labels labels{
{{0 * 8, 1 * 16}, "Data:", Color::light_grey()}};
LNAGainField field_lna {
{ 15 * 8, 0 * 16 }
};
FrequencyField field_frequency{
{0 * 8, 0 * 8},
};
RFAmpField field_rf_amp{
{13 * 8, 0 * 16}};
VGAGainField field_vga {
{ 18 * 8, 0 * 16 }
};
LNAGainField field_lna{
{15 * 8, 0 * 16}};
RSSI rssi {
{ 21 * 8, 0, 6 * 8, 4 },
};
Text text_debug_a {
{ 0 * 8, 4 * 16, 30 * 8, 16 },
"..."
};
Text text_debug_b {
{ 0 * 8, 5 * 16, 30 * 8, 16 },
"..."
};
Button button_cal {
{ 17 * 8, 2 * 16, 5 * 8, 2 * 16 },
"CAL"
};
Checkbox check_log {
{ 23 * 8, 2 * 16 },
3,
"LOG"
};
std::unique_ptr<TestLogger> logger { };
VGAGainField field_vga{
{18 * 8, 0 * 16}};
MessageHandlerRegistration message_handler_packet {
Message::ID::TestAppPacket,
[this](Message* const p) {
const auto message = static_cast<const TestAppPacketMessage*>(p);
const testapp::Packet packet { message->packet };
this->on_packet(packet);
}
};
RSSI rssi{
{21 * 8, 0, 6 * 8, 4},
};
void on_packet(const testapp::Packet& packet);
void set_target_frequency(const uint32_t new_value);
uint32_t tuning_frequency() const;
Text text_debug_a{
{0 * 8, 4 * 16, 30 * 8, 16},
"..."};
Text text_debug_b{
{0 * 8, 5 * 16, 30 * 8, 16},
"..."};
Button button_cal{
{17 * 8, 2 * 16, 5 * 8, 2 * 16},
"CAL"};
Checkbox check_log{
{23 * 8, 2 * 16},
3,
"LOG"};
std::unique_ptr<TestLogger> logger{};
MessageHandlerRegistration message_handler_packet{
Message::ID::TestAppPacket,
[this](Message* const p) {
const auto message = static_cast<const TestAppPacketMessage*>(p);
const testapp::Packet packet{message->packet};
this->on_packet(packet);
}};
void on_packet(const testapp::Packet& packet);
void set_target_frequency(const uint32_t new_value);
uint32_t tuning_frequency() const;
};
} /* namespace ui */
#endif/*__UI_TEST_H__*/
#endif /*__UI_TEST_H__*/