Testing external clock detection and auto-switch

Simplified audio spectrum computation and transfer
ACARS RX in debug mode
Disabled ABI warnings
Updated binary
This commit is contained in:
furrtek
2018-06-12 07:55:12 +01:00
parent dc5d6fef70
commit 609235b19f
30 changed files with 318 additions and 182 deletions

View File

@@ -32,11 +32,16 @@ using namespace acars;
#include "utility.hpp"
void ACARSLogger::log_raw_data(const acars::Packet& packet, const uint32_t frequency) {
std::string entry = "Raw: F:" + to_string_dec_uint(frequency) + "Hz ";
(void)frequency;
std::string entry { }; //= "Raw: F:" + to_string_dec_uint(frequency) + "Hz ";
entry.reserve(256);
// Raw hex dump of all the bytes
for (size_t c = 0; c < packet.length(); c += 8)
entry += to_string_hex(packet.read(c, 8), 8) + " ";
//for (size_t c = 0; c < packet.length(); c += 32)
// entry += to_string_hex(packet.read(c, 32), 8) + " ";
for (size_t c = 0; c < 256; c += 32)
entry += to_string_bin(packet.read(c, 32), 32);
log_file.write_entry(packet.received_at(), entry);
}
@@ -107,24 +112,25 @@ void ACARSAppView::focus() {
field_frequency.focus();
}
// Useless ?
void ACARSAppView::set_parent_rect(const Rect new_parent_rect) {
View::set_parent_rect(new_parent_rect);
}
void ACARSAppView::on_packet(const acars::Packet& packet) {
std::string alphanum_text = "";
std::string console_info;
if (!packet.is_valid())
console.writeln("\n\x1B\x0INVALID PACKET");
else {
std::string console_info;
/*if (!packet.is_valid()) {
console_info = to_string_datetime(packet.received_at(), HMS);
console_info += " INVALID";
console_info = "\n" + to_string_datetime(packet.received_at(), HM);
console_info += " REG:" + packet.registration_number();
console.writeln(console_info);
} else {
console_info = to_string_datetime(packet.received_at(), HMS);
console_info += ":" + to_string_bin(packet.read(0, 32), 32);
//console_info += " REG:" + packet.registration_number();
console.write(console_info);
}
console.writeln(console_info);
}*/
packet_counter++;
if (packet_counter % 10 == 0)
console.writeln("Block #" + to_string_dec_uint(packet_counter));
// Log raw data whatever it contains
if (logger && logging)

View File

@@ -51,13 +51,13 @@ public:
ACARSAppView(NavigationView& nav);
~ACARSAppView();
void set_parent_rect(const Rect new_parent_rect) override;
void focus() override;
std::string title() const override { return "ACARS RX"; };
std::string title() const override { return "ACARS (WIP)"; };
private:
bool logging { false };
uint32_t packet_counter { 0 };
RFAmpField field_rf_amp {
{ 13 * 8, 0 * 16 }
@@ -86,7 +86,7 @@ private:
};
Console console {
{ 0, 4 * 16, 240, 240 }
{ 0, 3 * 16, 240, 256 }
};
std::unique_ptr<ACARSLogger> logger { };

View File

@@ -86,8 +86,7 @@ NBFMOptionsView::NBFMOptionsView(
/* AnalogAudioView *******************************************************/
AnalogAudioView::AnalogAudioView(
NavigationView& nav,
bool eos
NavigationView& nav
) : nav_ (nav)
{
add_children({

View File

@@ -96,7 +96,7 @@ private:
class AnalogAudioView : public View {
public:
AnalogAudioView(NavigationView& nav, bool eos);
AnalogAudioView(NavigationView& nav);
~AnalogAudioView();
void on_hide() override;

View File

@@ -51,26 +51,26 @@ public:
private:
Labels labels {
{ { 8 * 8, 9 * 16 }, "/ / : :", Color::light_grey() },
{ { 4 * 8, 11 * 16 }, "YYYY/MM/DD HH:MM:SS", Color::light_grey() }
{ { 6 * 8, 7 * 16 }, "YYYY/MM/DD HH:MM:SS", Color::grey() },
{ { 10 * 8, 9 * 16 }, "/ / : :", Color::light_grey() }
};
NumberField field_year {
{ 4 * 8, 9 * 16 },
{ 6 * 8, 9 * 16 },
4,
{ 2015, 2099 },
1,
'0',
};
NumberField field_month {
{ 9 * 8, 9 * 16 },
{ 11 * 8, 9 * 16 },
2,
{ 1, 12 },
1,
'0',
};
NumberField field_day {
{ 12 * 8, 9 * 16 },
{ 14 * 8, 9 * 16 },
2,
{ 1, 31 },
1,
@@ -78,21 +78,21 @@ private:
};
NumberField field_hour {
{ 15 * 8, 9 * 16 },
{ 17 * 8, 9 * 16 },
2,
{ 0, 23 },
1,
'0',
};
NumberField field_minute {
{ 18 * 8, 9 * 16 },
{ 20 * 8, 9 * 16 },
2,
{ 0, 59 },
1,
'0',
};
NumberField field_second {
{ 21 * 8, 9 * 16 },
{ 23 * 8, 9 * 16 },
2,
{ 0, 59 },
1,
@@ -141,7 +141,7 @@ private:
1,
'0',
};
Checkbox check_bias {
{ 28, 12 * 16 },
5,
@@ -161,35 +161,6 @@ private:
SetFrequencyCorrectionModel form_collect();
};
class SetTouchCalibView : public View {
public:
SetTouchCalibView(NavigationView& nav);
void focus() override;
bool on_touch(const TouchEvent event) override;
private:
Text text_title {
{ 64, 32, 40, 16 },
"UL,UR,DL,DR !",
};
Text text_debugx {
{ 64, 64, 40, 16 },
"X",
};
Text text_debugy {
{ 64, 80, 40, 16 },
"Y",
};
Button button_ok {
{ 72, 192, 96, 24 },
"OK"
};
};
class SetUIView : public View {
public:
SetUIView(NavigationView& nav);
@@ -224,7 +195,7 @@ private:
};
Checkbox checkbox_showsplash {
{ 3 * 8, 8 * 16 },
{ 3 * 8, 9 * 16 },
11,
"Show splash"
};