mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
UI to turn on antenna bias voltage.
This commit is contained in:
parent
25fac90d4f
commit
60b8b38652
@ -25,6 +25,9 @@
|
|||||||
#include "lpc43xx_cpp.hpp"
|
#include "lpc43xx_cpp.hpp"
|
||||||
using namespace lpc43xx;
|
using namespace lpc43xx;
|
||||||
|
|
||||||
|
#include "portapack.hpp"
|
||||||
|
using portapack::receiver_model;
|
||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
|
|
||||||
SetDateTimeView::SetDateTimeView(
|
SetDateTimeView::SetDateTimeView(
|
||||||
@ -141,6 +144,29 @@ SetFrequencyCorrectionModel SetFrequencyCorrectionView::form_collect() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AntennaBiasSetupView::AntennaBiasSetupView(NavigationView& nav) {
|
||||||
|
add_children({ {
|
||||||
|
&text_title,
|
||||||
|
&text_description_1,
|
||||||
|
&text_description_2,
|
||||||
|
&text_description_3,
|
||||||
|
&text_description_4,
|
||||||
|
&options_bias,
|
||||||
|
&button_done,
|
||||||
|
} });
|
||||||
|
|
||||||
|
options_bias.set_by_value(receiver_model.antenna_bias() ? 1 : 0);
|
||||||
|
options_bias.on_change = [this](size_t, OptionsField::value_t v) {
|
||||||
|
receiver_model.set_antenna_bias(v);
|
||||||
|
};
|
||||||
|
|
||||||
|
button_done.on_select = [&nav](Button&){ nav.pop(); };
|
||||||
|
}
|
||||||
|
|
||||||
|
void AntennaBiasSetupView::focus() {
|
||||||
|
button_done.focus();
|
||||||
|
}
|
||||||
|
|
||||||
AboutView::AboutView(NavigationView& nav) {
|
AboutView::AboutView(NavigationView& nav) {
|
||||||
add_children({ {
|
add_children({ {
|
||||||
&text_title,
|
&text_title,
|
||||||
@ -158,9 +184,10 @@ void AboutView::focus() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetupMenuView::SetupMenuView(NavigationView& nav) {
|
SetupMenuView::SetupMenuView(NavigationView& nav) {
|
||||||
add_items<3>({ {
|
add_items<4>({ {
|
||||||
{ "Date/Time", [&nav](){ nav.push<SetDateTimeView>(); } },
|
{ "Date/Time", [&nav](){ nav.push<SetDateTimeView>(); } },
|
||||||
{ "Frequency Correction", [&nav](){ nav.push<SetFrequencyCorrectionView>(); } },
|
{ "Frequency Correction", [&nav](){ nav.push<SetFrequencyCorrectionView>(); } },
|
||||||
|
{ "Antenna Bias Voltage", [&nav](){ nav.push<AntennaBiasSetupView>(); } },
|
||||||
{ "Touch", [&nav](){ nav.push<NotImplementedView>(); } },
|
{ "Touch", [&nav](){ nav.push<NotImplementedView>(); } },
|
||||||
} });
|
} });
|
||||||
on_left = [&nav](){ nav.pop(); };
|
on_left = [&nav](){ nav.pop(); };
|
||||||
|
@ -176,6 +176,53 @@ private:
|
|||||||
SetFrequencyCorrectionModel form_collect();
|
SetFrequencyCorrectionModel form_collect();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class AntennaBiasSetupView : public View {
|
||||||
|
public:
|
||||||
|
AntennaBiasSetupView(NavigationView& nav);
|
||||||
|
|
||||||
|
void focus() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Text text_title {
|
||||||
|
{ 5 * 8, 3 * 16, 20 * 8, 16 },
|
||||||
|
"Antenna Bias Voltage"
|
||||||
|
};
|
||||||
|
|
||||||
|
Text text_description_1 {
|
||||||
|
{ 24, 6 * 16, 24 * 8, 16 },
|
||||||
|
"CAUTION: Ensure that all"
|
||||||
|
};
|
||||||
|
|
||||||
|
Text text_description_2 {
|
||||||
|
{ 28, 7 * 16, 23 * 8, 16 },
|
||||||
|
"devices attached to the"
|
||||||
|
};
|
||||||
|
|
||||||
|
Text text_description_3 {
|
||||||
|
{ 8, 8 * 16, 28 * 8, 16 },
|
||||||
|
"antenna connector can accept"
|
||||||
|
};
|
||||||
|
|
||||||
|
Text text_description_4 {
|
||||||
|
{ 68, 9 * 16, 13 * 8, 16 },
|
||||||
|
"a DC voltage!"
|
||||||
|
};
|
||||||
|
|
||||||
|
OptionsField options_bias {
|
||||||
|
{ 100, 12 * 16 },
|
||||||
|
5,
|
||||||
|
{
|
||||||
|
{ " Off ", 0 },
|
||||||
|
{ " On ", 1 },
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Button button_done {
|
||||||
|
{ 72, 15 * 16, 96, 24 },
|
||||||
|
"Done"
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
class AboutView : public View {
|
class AboutView : public View {
|
||||||
public:
|
public:
|
||||||
AboutView(NavigationView& nav);
|
AboutView(NavigationView& nav);
|
||||||
|
Loading…
Reference in New Issue
Block a user