"Labels" widget

This commit is contained in:
furrtek
2017-02-12 07:23:31 +00:00
parent 0102a34286
commit d12cd0d8af
11 changed files with 52 additions and 74 deletions

View File

@@ -28,9 +28,9 @@
//BUG: RDS doesn't stop baseband when stopping tx ?
//TEST: Imperial in whipcalc
//TEST: Numbers
//TODO: Use TransmitterView in ADSB, Morse, TEDI/LCR, Numbers, whistle, jammer...
//TODO: Use Labels widget wherever possible
//TODO: Use TransmitterView in Morse, TEDI/LCR, Numbers, whistle, jammer...
//TODO: FreqMan: Add and rename categories
//TODO: FreqMan: Sort by category in edit screen
//TODO: FreqMan: Cap entry count per category (only done for total entries right now)

View File

@@ -69,19 +69,13 @@ AFSKSetupView::AFSKSetupView(
size_t i;
add_children({
&text_setfreq,
&labels,
&button_setfreq,
&text_bps,
&options_bps,
&text_mark,
&field_mark,
&text_space,
&field_space,
&text_bw,
&field_bw,
&text_repeat,
&field_repeat,
&text_format,
&options_format,
&button_save
});

View File

@@ -39,19 +39,21 @@ public:
private:
void update_freq(rf::Frequency f);
Text text_setfreq {
{ 8, 32, 104, 16 },
"Frequency:"
Labels labels {
{ { 1 * 8, 4 * 8 }, "Frequency:", Color::light_grey() },
{ { 16 * 8, 5 * 8 }, "Speed:", Color::light_grey() },
{ { 2 * 8, 13 * 8 }, "Mark: Hz", Color::light_grey() },
{ { 2 * 8, 15 * 8 }, "Space: Hz", Color::light_grey() },
{ { 140, 13 * 8 }, "BW: kHz", Color::light_grey() },
{ { 140, 15 * 8 }, "Repeat:", Color::light_grey() },
{ { 2 * 8, 19 * 8 }, "Format:", Color::light_grey() }
};
Button button_setfreq {
{ 8, 48, 104, 32 },
"----.----"
};
Text text_bps {
{ 128, 40, 104, 16 },
"Speed:"
};
OptionsField options_bps {
{ 128, 60 },
7,
@@ -63,11 +65,7 @@ private:
{ "9600bps", 9600 }
}
};
Text text_mark {
{ 16, 104, 48, 16 },
"Mark: Hz"
};
NumberField field_mark {
{ 64, 104 },
5,
@@ -76,10 +74,6 @@ private:
' '
};
Text text_space {
{ 16, 120, 48, 16 },
"Space: Hz"
};
NumberField field_space {
{ 64, 120 },
5,
@@ -88,10 +82,6 @@ private:
' '
};
Text text_bw {
{ 140, 104, 80, 16 },
"BW: kHz"
};
NumberField field_bw {
{ 172, 104 },
2,
@@ -100,10 +90,6 @@ private:
' '
};
Text text_repeat {
{ 140, 120, 64, 16 },
"Repeat: "
};
NumberField field_repeat {
{ 204, 120 },
2,
@@ -112,10 +98,6 @@ private:
' '
};
Text text_format {
{ 16, 152, 7 * 8, 16 },
"Format:"
};
OptionsField options_format {
{ 80, 152 },
10,

View File

@@ -119,7 +119,7 @@ bool POCSAGTXView::start_tx() {
void POCSAGTXView::paint(Painter&) {
message = buffer;
text_message.set("Message:" + message);
text_message.set(message);
}
void POCSAGTXView::on_set_text(NavigationView& nav) {
@@ -134,11 +134,9 @@ POCSAGTXView::POCSAGTXView(
baseband::run_image(portapack::spi_flash::image_tag_fsktx);
add_children({
&text_bitrate,
&labels,
&options_bitrate,
&text_address,
&field_address,
&text_type,
&options_type,
&text_message,
&button_message,

View File

@@ -26,7 +26,6 @@
#include "ui.hpp"
#include "ui_widget.hpp"
#include "ui_navigation.hpp"
#include "ui_font_fixed_8x16.hpp"
#include "ui_receiver.hpp"
#include "ui_transmitter.hpp"
#include "ui_textentry.hpp"
@@ -68,10 +67,13 @@ private:
void on_tx_progress(const int progress, const bool done);
bool start_tx();
Text text_bitrate {
{ 3 * 8, 4 * 8, 8 * 8, 16 },
"Bitrate:"
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() },
{ { 3 * 8, 12 * 8 }, "Message:", Color::light_grey() }
};
OptionsField options_bitrate {
{ 11 * 8, 4 * 8 },
8,
@@ -81,21 +83,13 @@ private:
{ "2400 bps", 2 }
}
};
Text text_address {
{ 3 * 8, 6 * 8, 8 * 8, 16 },
"Address:"
};
SymField field_address {
{ 11 * 8, 6 * 8 },
7,
SymField::SYMFIELD_DEC
};
Text text_type {
{ 6 * 8, 8 * 8, 5 * 8, 16 },
"Type:"
};
OptionsField options_type {
{ 11 * 8, 8 * 8 },
12,
@@ -107,9 +101,10 @@ private:
};
Text text_message {
{ 3 * 8, 12 * 8, 16 * 8, 16 },
{ 11 * 8, 12 * 8, 16 * 8, 16 },
""
};
Button button_message {
{ 3 * 8, 14 * 8, 8 * 8, 28 },
"Set"