Add Remote App & UI updates. (#1451)

* Alpha order sub-menus
* WIP Getting Remote types outlined
* WIP building UI
* WIP adding RemoteButton control
* WIP Fix build
* WIP Basic editing support
* Border on the active button
* Make TxView2 sane
* Add easier RGB color creation from uint32
* Center some button icons
* WIP Remote - main UI
* WIP main UI mostly working, can send
* Add 'join' utility
* WIP save/load
* Pre-alloc buttons to prevent focus dangling
* Alpha order settings/debug pages
* Add UI for picking capture and set frequency
* WIP Getting really close now
* Fix path for init name
* Some fit & finish
This commit is contained in:
Kyle Reed 2023-09-18 14:22:46 -07:00 committed by GitHub
parent 537cf2e79b
commit fca373d936
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 1205 additions and 312 deletions

View file

@ -26,9 +26,9 @@
#include "ui.hpp"
#include "ui_navigation.hpp"
#include "ui_painter.hpp"
#include "ui_receiver.hpp"
#include "ui_styles.hpp"
#include "ui_widget.hpp"
#include "ui_receiver.hpp"
#include "rf_path.hpp"
@ -37,10 +37,6 @@
#include <algorithm>
#include <functional>
#define POWER_THRESHOLD_HIGH 47
#define POWER_THRESHOLD_MED 38
#define POWER_THRESHOLD_LOW 17
namespace ui {
class TXGainField : public NumberField {
@ -74,11 +70,8 @@ class TransmitterView : public View {
private:
const Style& style_start = Styles::green;
const Style style_stop = Styles::red;
const Style style_locked = Styles::dark_grey;
const Style style_power_low = Styles::yellow;
const Style style_power_med = Styles::orange;
const Style style_power_high = Styles::red;
const Style& style_stop = Styles::red;
const Style& style_locked = Styles::dark_grey;
bool lock_{false};
bool transmitting_{false};
@ -134,60 +127,32 @@ class TransmitterView : public View {
void update_gainlevel_styles(void);
};
/* Simpler transmitter view that only renders TX Gain and Amp.
* When short_UI is set it abbreviates control labels. */
class TransmitterView2 : public View {
public:
TransmitterView2(const Coord x, const Coord y, bool short_UI);
~TransmitterView2();
void on_show() override;
void paint(Painter& painter) override;
TransmitterView2(Point pos, bool short_ui);
private:
const Style& style_power_low = Styles::yellow;
const Style& style_power_med = Styles::orange;
const Style& style_power_high = Styles::red;
Text text_gain_amp{
{0, 3 * 8, 5 * 8, 1 * 16},
"Gain: Amp:"};
Text text_labels{
{}, // Set in ctor.
{}};
NumberField field_gain{
{5 * 8, 3 * 8},
{}, // Set in ctor.
2,
{max2837::tx::gain_db_range.minimum, max2837::tx::gain_db_range.maximum},
max2837::tx::gain_db_step,
' '};
NumberField field_amp{
{12 * 8, 3 * 8},
{}, // Set in ctor.
2,
{0, 14},
14,
' '};
Text text_gain_amp_short_UI{
{0, (3 * 8), 5 * 8, 1 * 16},
"Gain A:"};
NumberField field_gain_short_UI{
{(4 * 8) + 2, 3 * 8},
2,
{max2837::tx::gain_db_range.minimum, max2837::tx::gain_db_range.maximum},
max2837::tx::gain_db_step,
' '};
NumberField field_amp_short_UI{
{(9 * 8) - 2, 3 * 8},
2,
{0, 14},
14,
' '};
void on_tx_gain_changed(int32_t tx_gain);
void on_tx_amp_changed(bool rf_amp);
void update_gainlevel_styles(void);
void update_gainlevel_styles();
};
} /* namespace ui */