mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-02-02 09:35:20 -05:00
Missing image files
This commit is contained in:
parent
82cb56e9b2
commit
a35d9ee8a9
@ -60,10 +60,7 @@ void POCSAGAppView::update_freq(rf::Frequency f) {
|
|||||||
|
|
||||||
portapack::persistent_memory::set_tuned_frequency(f); // Maybe not ?
|
portapack::persistent_memory::set_tuned_frequency(f); // Maybe not ?
|
||||||
|
|
||||||
auto mhz = to_string_dec_int(f / 1000000, 4);
|
button_setfreq.set_text(to_string_short_freq(f));
|
||||||
auto hz100 = to_string_dec_int((f / 100) % 10000, 4, '0');
|
|
||||||
|
|
||||||
button_setfreq.set_text(mhz + "." + hz100);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
POCSAGAppView::POCSAGAppView(NavigationView& nav) {
|
POCSAGAppView::POCSAGAppView(NavigationView& nav) {
|
||||||
|
@ -41,7 +41,7 @@ void RecentEntriesHeader::paint(Painter& painter) {
|
|||||||
|
|
||||||
const Style style {
|
const Style style {
|
||||||
.font = parent_style.font,
|
.font = parent_style.font,
|
||||||
.background = Color::blue(),
|
.background = Color::dark_blue(),
|
||||||
.foreground = parent_style.foreground,
|
.foreground = parent_style.foreground,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -112,10 +112,8 @@ std::string to_string_dec_int(
|
|||||||
return q;
|
return q;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string to_string_short_freq(const uint64_t f, const int32_t l) {
|
std::string to_string_short_freq(const uint64_t f) {
|
||||||
auto final_str = to_string_dec_int(f / 1000000, 4) + ".";
|
auto final_str = to_string_dec_int(f / 1000000, 4) + "." + to_string_dec_int((f / 100) % 10000, 4, '0');
|
||||||
final_str += to_string_dec_int((f / 100) % 10000, l, '0');
|
|
||||||
|
|
||||||
return final_str;
|
return final_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ std::string to_string_dec_int(const int32_t n, const int32_t l = 0, const char f
|
|||||||
std::string to_string_hex(const uint64_t n, const int32_t l = 0);
|
std::string to_string_hex(const uint64_t n, const int32_t l = 0);
|
||||||
std::string to_string_hex_array(uint8_t * const array, const int32_t l = 0);
|
std::string to_string_hex_array(uint8_t * const array, const int32_t l = 0);
|
||||||
|
|
||||||
std::string to_string_short_freq(const uint64_t f, const int32_t l = 4);
|
std::string to_string_short_freq(const uint64_t f);
|
||||||
|
|
||||||
std::string to_string_datetime(const rtc::RTC& value);
|
std::string to_string_datetime(const rtc::RTC& value);
|
||||||
std::string to_string_time(const rtc::RTC& value);
|
std::string to_string_time(const rtc::RTC& value);
|
||||||
|
@ -56,10 +56,7 @@ void JammerView::update_range(const uint32_t n) {
|
|||||||
center = (range_ptr->min + range_ptr->max) / 2;
|
center = (range_ptr->min + range_ptr->max) / 2;
|
||||||
bw_khz = abs(range_ptr->max - range_ptr->min) / 1000;
|
bw_khz = abs(range_ptr->max - range_ptr->min) / 1000;
|
||||||
|
|
||||||
auto center_mhz = to_string_dec_int(center / 1000000, 4);
|
label = "C:" + to_string_short_freq(center) + "M W:";
|
||||||
auto center_hz100 = to_string_dec_int((center / 1000) % 1000, 3, '0');
|
|
||||||
|
|
||||||
label = "C:" + center_mhz + "." + center_hz100 + "M W:";
|
|
||||||
|
|
||||||
if (bw_khz < 1000) {
|
if (bw_khz < 1000) {
|
||||||
label += to_string_dec_int(bw_khz, 3) + "kHz";
|
label += to_string_dec_int(bw_khz, 3) + "kHz";
|
||||||
|
@ -73,7 +73,7 @@ void LCRView::paint(Painter& painter) {
|
|||||||
button_setrgsb.set_text(rgsb);
|
button_setrgsb.set_text(rgsb);
|
||||||
|
|
||||||
// Recap: frequency @ baudrate
|
// Recap: frequency @ baudrate
|
||||||
final_str = to_string_short_freq(persistent_memory::tuned_frequency(), 3);
|
final_str = to_string_short_freq(persistent_memory::tuned_frequency());
|
||||||
final_str += '@';
|
final_str += '@';
|
||||||
final_str += to_string_dec_int(persistent_memory::modem_baudrate(), 4);
|
final_str += to_string_dec_int(persistent_memory::modem_baudrate(), 4);
|
||||||
final_str += "bps ";
|
final_str += "bps ";
|
||||||
|
@ -44,7 +44,7 @@ void ModemSetupView::focus() {
|
|||||||
void ModemSetupView::update_freq(rf::Frequency f) {
|
void ModemSetupView::update_freq(rf::Frequency f) {
|
||||||
persistent_memory::set_tuned_frequency(f);
|
persistent_memory::set_tuned_frequency(f);
|
||||||
|
|
||||||
button_setfreq.set_text(to_string_short_freq(f, 4));
|
button_setfreq.set_text(to_string_short_freq(f));
|
||||||
}
|
}
|
||||||
|
|
||||||
ModemSetupView::ModemSetupView(
|
ModemSetupView::ModemSetupView(
|
||||||
|
@ -65,25 +65,14 @@ void FrequencyField::set_step(rf::Frequency new_value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FrequencyField::paint(Painter& painter) {
|
void FrequencyField::paint(Painter& painter) {
|
||||||
const auto mhz = to_string_dec_int(value_ / 1000000, 4);
|
const std::string str_value = to_string_short_freq(value_);
|
||||||
const auto hz100 = to_string_dec_int((value_ / 100) % 10000, 4, '0');
|
|
||||||
|
|
||||||
const auto paint_style = has_focus() ? style().invert() : style();
|
const auto paint_style = has_focus() ? style().invert() : style();
|
||||||
|
|
||||||
painter.draw_string(
|
painter.draw_string(
|
||||||
screen_pos(),
|
screen_pos(),
|
||||||
paint_style,
|
paint_style,
|
||||||
mhz
|
str_value
|
||||||
);
|
|
||||||
painter.draw_string(
|
|
||||||
screen_pos() + Point { 4 * 8, 0 },
|
|
||||||
paint_style,
|
|
||||||
"."
|
|
||||||
);
|
|
||||||
painter.draw_string(
|
|
||||||
screen_pos() + Point { 5 * 8, 0 },
|
|
||||||
paint_style,
|
|
||||||
hz100
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,9 @@
|
|||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// BUG: Mirroring in proc_wideband...
|
||||||
|
// BUG: Lock on frequency, if frequency jump, still locked on first one
|
||||||
|
|
||||||
#include "ui_scanner.hpp"
|
#include "ui_scanner.hpp"
|
||||||
|
|
||||||
#include "baseband_api.hpp"
|
#include "baseband_api.hpp"
|
||||||
@ -61,6 +64,7 @@ void ScannerView::do_detection() {
|
|||||||
uint8_t power_max = 0;
|
uint8_t power_max = 0;
|
||||||
int32_t bin_max = -1;
|
int32_t bin_max = -1;
|
||||||
uint32_t bin_max_pixel = 0;
|
uint32_t bin_max_pixel = 0;
|
||||||
|
uint32_t snap_value;
|
||||||
uint8_t power;
|
uint8_t power;
|
||||||
rtc::RTC datetime;
|
rtc::RTC datetime;
|
||||||
std::string str_approx, str_timestamp;
|
std::string str_approx, str_timestamp;
|
||||||
@ -91,7 +95,12 @@ void ScannerView::do_detection() {
|
|||||||
if ((bin_max != locked_bin) || (!locked)) {
|
if ((bin_max != locked_bin) || (!locked)) {
|
||||||
|
|
||||||
if (!locked) {
|
if (!locked) {
|
||||||
resolved_frequency = slices[slice_counter].center_frequency + (SCAN_BIN_WIDTH * (bin_max - 120)); // Init
|
resolved_frequency = slices[slice_counter].center_frequency + (SCAN_BIN_WIDTH * (bin_max - 120));
|
||||||
|
|
||||||
|
if (check_snap.value()) {
|
||||||
|
snap_value = options_snap.selected_index_value();
|
||||||
|
resolved_frequency = round(resolved_frequency / snap_value) * snap_value;
|
||||||
|
}
|
||||||
|
|
||||||
// Check range
|
// Check range
|
||||||
if ((resolved_frequency >= f_min) && (resolved_frequency <= f_max)) {
|
if ((resolved_frequency >= f_min) && (resolved_frequency <= f_max)) {
|
||||||
@ -110,11 +119,6 @@ void ScannerView::do_detection() {
|
|||||||
text_infos.set("Locked ! ");
|
text_infos.set("Locked ! ");
|
||||||
big_display.set_style(&style_locked);
|
big_display.set_style(&style_locked);
|
||||||
|
|
||||||
// Approximation/error display
|
|
||||||
str_approx = "." + to_string_dec_uint(((resolved_frequency - 4883) / 1000) % 10000);
|
|
||||||
str_approx += "~." + to_string_dec_uint(((resolved_frequency + 4883) / 1000) % 10000);
|
|
||||||
text_approx.set(str_approx);
|
|
||||||
|
|
||||||
locked = true;
|
locked = true;
|
||||||
locked_bin = bin_max;
|
locked_bin = bin_max;
|
||||||
|
|
||||||
@ -269,7 +273,7 @@ void ScannerView::on_range_changed() {
|
|||||||
receiver_model.set_tuning_frequency(slices[0].center_frequency);
|
receiver_model.set_tuning_frequency(slices[0].center_frequency);
|
||||||
|
|
||||||
slices_nb = 1;
|
slices_nb = 1;
|
||||||
text_slices.set("1");
|
text_slices.set(" 1");
|
||||||
}
|
}
|
||||||
|
|
||||||
slice_counter = 0;
|
slice_counter = 0;
|
||||||
@ -346,14 +350,18 @@ ScannerView::ScannerView(
|
|||||||
&text_infos,
|
&text_infos,
|
||||||
&vu_max,
|
&vu_max,
|
||||||
&progress_timers,
|
&progress_timers,
|
||||||
//&check_goto,
|
&check_snap,
|
||||||
//&options_goto,
|
&options_snap,
|
||||||
&big_display,
|
&big_display,
|
||||||
&recent_entries_view,
|
&recent_entries_view
|
||||||
&text_approx
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
baseband::set_spectrum(SCAN_SLICE_WIDTH, 32);
|
||||||
|
|
||||||
recent_entries_view.set_parent_rect({ 0, 28 * 8, 240, 12 * 8 });
|
recent_entries_view.set_parent_rect({ 0, 28 * 8, 240, 12 * 8 });
|
||||||
|
recent_entries_view.on_select = [this, &nav](const ScannerRecentEntry& entry) {
|
||||||
|
nav.push<FrequencyKeypadView>(entry.frequency);
|
||||||
|
};
|
||||||
|
|
||||||
text_mean.set_style(&style_grey);
|
text_mean.set_style(&style_grey);
|
||||||
text_slices.set_style(&style_grey);
|
text_slices.set_style(&style_grey);
|
||||||
@ -361,9 +369,8 @@ ScannerView::ScannerView(
|
|||||||
progress_timers.set_style(&style_grey);
|
progress_timers.set_style(&style_grey);
|
||||||
big_display.set_style(&style_grey);
|
big_display.set_style(&style_grey);
|
||||||
|
|
||||||
baseband::set_spectrum(SCAN_SLICE_WIDTH, 32);
|
check_snap.set_value(true);
|
||||||
|
options_snap.set_selected_index(1); // 12.5kHz
|
||||||
//options_goto.set_selected_index(0); // Nothing
|
|
||||||
|
|
||||||
field_threshold.set_value(80);
|
field_threshold.set_value(80);
|
||||||
field_threshold.on_change = [this](int32_t value) {
|
field_threshold.on_change = [this](int32_t value) {
|
||||||
|
@ -149,18 +149,10 @@ private:
|
|||||||
{ { 1 * 8, 4 * 8 }, "Trig: /255 Mean: /255", Color::light_grey() },
|
{ { 1 * 8, 4 * 8 }, "Trig: /255 Mean: /255", Color::light_grey() },
|
||||||
{ { 1 * 8, 6 * 8 }, "Slices: /32 Rate: Hz", Color::light_grey() },
|
{ { 1 * 8, 6 * 8 }, "Slices: /32 Rate: Hz", Color::light_grey() },
|
||||||
{ { 6 * 8, 10 * 8 }, "Timer Status", Color::light_grey() },
|
{ { 6 * 8, 10 * 8 }, "Timer Status", Color::light_grey() },
|
||||||
{ { 1 * 8, 25 * 8 }, "+/-4.9kHz:", Color::light_grey() },
|
{ { 1 * 8, 25 * 8 }, "Accuracy: +/-4.9kHz", Color::light_grey() },
|
||||||
{ { 26 * 8, 25 * 8 }, "MHz", Color::light_grey() }
|
{ { 26 * 8, 25 * 8 }, "MHz", Color::light_grey() }
|
||||||
};
|
};
|
||||||
|
|
||||||
NumberField field_threshold {
|
|
||||||
{ 6 * 8, 2 * 16 },
|
|
||||||
3,
|
|
||||||
{ 5, 255 },
|
|
||||||
5,
|
|
||||||
' '
|
|
||||||
};
|
|
||||||
|
|
||||||
FrequencyField field_frequency_min {
|
FrequencyField field_frequency_min {
|
||||||
{ 1 * 8, 1 * 16 },
|
{ 1 * 8, 1 * 16 },
|
||||||
};
|
};
|
||||||
@ -174,6 +166,13 @@ private:
|
|||||||
{ 26 * 8, 1 * 16 }
|
{ 26 * 8, 1 * 16 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
NumberField field_threshold {
|
||||||
|
{ 6 * 8, 2 * 16 },
|
||||||
|
3,
|
||||||
|
{ 5, 255 },
|
||||||
|
5,
|
||||||
|
' '
|
||||||
|
};
|
||||||
Text text_mean {
|
Text text_mean {
|
||||||
{ 22 * 8, 2 * 16, 3 * 8, 16 },
|
{ 22 * 8, 2 * 16, 3 * 8, 16 },
|
||||||
"---"
|
"---"
|
||||||
@ -192,6 +191,7 @@ private:
|
|||||||
16,
|
16,
|
||||||
false
|
false
|
||||||
};
|
};
|
||||||
|
|
||||||
ProgressBar progress_timers {
|
ProgressBar progress_timers {
|
||||||
{ 6 * 8, 12 * 8, 5 * 8, 16 }
|
{ 6 * 8, 12 * 8, 5 * 8, 16 }
|
||||||
};
|
};
|
||||||
@ -199,19 +199,20 @@ private:
|
|||||||
{ 13 * 8, 12 * 8, 15 * 8, 16 },
|
{ 13 * 8, 12 * 8, 15 * 8, 16 },
|
||||||
"Listening"
|
"Listening"
|
||||||
};
|
};
|
||||||
Checkbox check_goto {
|
|
||||||
|
Checkbox check_snap {
|
||||||
{ 6 * 8, 15 * 8 },
|
{ 6 * 8, 15 * 8 },
|
||||||
8,
|
7,
|
||||||
"On lock:",
|
"Adjust:",
|
||||||
true
|
true
|
||||||
};
|
};
|
||||||
OptionsField options_goto {
|
OptionsField options_snap {
|
||||||
{ 17 * 8, 15 * 8 },
|
{ 15 * 8, 15 * 8 },
|
||||||
7,
|
7,
|
||||||
{
|
{
|
||||||
{ "Nothing", 0 },
|
{ "25kHz ", 25000 },
|
||||||
{ "NFM RX ", 1 },
|
{ "12.5kHz", 12500 },
|
||||||
{ "POCSAG ", 2 }
|
{ "8.33kHz", 8333 }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -220,11 +221,6 @@ private:
|
|||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
Text text_approx {
|
|
||||||
{ 11 * 8, 25 * 8, 11 * 8, 16 },
|
|
||||||
"..."
|
|
||||||
};
|
|
||||||
|
|
||||||
MessageHandlerRegistration message_handler_spectrum_config {
|
MessageHandlerRegistration message_handler_spectrum_config {
|
||||||
Message::ID::ChannelSpectrumConfig,
|
Message::ID::ChannelSpectrumConfig,
|
||||||
[this](const Message* const p) {
|
[this](const Message* const p) {
|
||||||
|
@ -95,6 +95,9 @@ struct Color {
|
|||||||
static constexpr Color blue() {
|
static constexpr Color blue() {
|
||||||
return { 0, 0, 255 };
|
return { 0, 0, 255 };
|
||||||
}
|
}
|
||||||
|
static constexpr Color dark_blue() {
|
||||||
|
return { 0, 0, 127 };
|
||||||
|
}
|
||||||
|
|
||||||
static constexpr Color cyan() {
|
static constexpr Color cyan() {
|
||||||
return { 0, 255, 255 };
|
return { 0, 255, 255 };
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user