mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-10-16 06:32:38 +00:00
Just minor changes
This commit is contained in:
@@ -30,85 +30,69 @@
|
||||
#include "string_format.hpp"
|
||||
#include <vector>
|
||||
|
||||
namespace ui {
|
||||
namespace ui
|
||||
{
|
||||
class WhipCalcView : public View
|
||||
{
|
||||
public:
|
||||
WhipCalcView(NavigationView &nav);
|
||||
void focus() override;
|
||||
std::string title() const override { return "Antenna length"; };
|
||||
|
||||
class WhipCalcView : public View {
|
||||
public:
|
||||
WhipCalcView(NavigationView& nav);
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "Antenna length"; };
|
||||
private:
|
||||
const double speed_of_light_mps = 299792458.0; // m/s
|
||||
const double speed_of_light_fps = 983571087.90472; // feet/s
|
||||
const std::string frac_str[4] = {"", " 1/4", " 1/2", " 3/4"};
|
||||
|
||||
private:
|
||||
const double speed_of_light_mps = 299792458.0; // m/s
|
||||
const double speed_of_light_fps = 983571087.90472; // feet/s
|
||||
|
||||
const std::string frac_str[4] = { "", " 1/4", " 1/2", " 3/4" };
|
||||
|
||||
struct antenna_entry {
|
||||
std::string label { };
|
||||
std::vector <uint16_t> elements { };
|
||||
};
|
||||
|
||||
std::vector<antenna_entry> antenna_db { };
|
||||
|
||||
double get_decimals(double num, int16_t mult, bool round = false);
|
||||
void update_result();
|
||||
|
||||
uint16_t string_to_number(std::string);
|
||||
void txtline_process(std::string&);
|
||||
void antenna_Default();
|
||||
|
||||
Labels labels {
|
||||
//{ { 5 * 8, 1 * 16 }, "Loaded:", Color::light_grey() },
|
||||
{ { 2 * 8, 1 * 16 }, "Frequency:", Color::light_grey() },
|
||||
{ { 7 * 8, 2 * 16 }, "Wave:", Color::light_grey() },
|
||||
{ { 5 * 8, 3 * 16 }, "Metric:", Color::light_grey() },
|
||||
{ { 3 * 8, 4 * 16 }, "Imperial:", Color::light_grey() }
|
||||
};
|
||||
|
||||
/*Text antennas_on_memory {
|
||||
{ 13 * 8, 1 * 16, 2 * 16, 16 },
|
||||
};*/
|
||||
|
||||
FrequencyField field_frequency {
|
||||
{ 13 * 8, 1 * 16 },
|
||||
};
|
||||
|
||||
OptionsField options_type {
|
||||
{ 13 * 8, 2 * 16 },
|
||||
7,
|
||||
struct antenna_entry
|
||||
{
|
||||
{ "Full", 8 },
|
||||
{ "Half", 4 },
|
||||
{ "Quarter", 2 },
|
||||
{ "3/4", 6 },
|
||||
{ "1/8", 1 },
|
||||
{ "3/8", 3 },
|
||||
{ "5/8", 5 },
|
||||
{ "7/8", 7 }
|
||||
}
|
||||
std::string label{};
|
||||
std::vector<uint16_t> elements{};
|
||||
};
|
||||
|
||||
std::vector<antenna_entry> antenna_db{};
|
||||
double get_decimals(double num, int16_t mult, bool round = false);
|
||||
void update_result();
|
||||
uint16_t string_to_number(std::string);
|
||||
void txtline_process(std::string &);
|
||||
void add_default_antenna();
|
||||
|
||||
Labels labels{
|
||||
{{2 * 8, 1 * 16}, "Frequency:", Color::light_grey()},
|
||||
{{7 * 8, 2 * 16}, "Wave:", Color::light_grey()},
|
||||
{{5 * 8, 3 * 16}, "Metric:", Color::light_grey()},
|
||||
{{3 * 8, 4 * 16}, "Imperial:", Color::light_grey()}};
|
||||
|
||||
FrequencyField field_frequency{
|
||||
{13 * 8, 1 * 16},
|
||||
};
|
||||
|
||||
OptionsField options_type{
|
||||
{13 * 8, 2 * 16},
|
||||
7,
|
||||
{{"Full", 8},
|
||||
{"Half", 4},
|
||||
{"Quarter", 2},
|
||||
{"3/4", 6},
|
||||
{"1/8", 1},
|
||||
{"3/8", 3},
|
||||
{"5/8", 5},
|
||||
{"7/8", 7}}};
|
||||
|
||||
Text text_result_metric{
|
||||
{13 * 8, 3 * 16, 10 * 16, 16},
|
||||
"-"};
|
||||
Text text_result_imperial{
|
||||
{13 * 8, 4 * 16, 10 * 16, 16},
|
||||
"-"};
|
||||
Console console{
|
||||
{0, 6 * 16, 240, 160}};
|
||||
|
||||
Button button_exit{
|
||||
{72, 17 * 16, 96, 32},
|
||||
"Back"};
|
||||
};
|
||||
|
||||
Text text_result_metric {
|
||||
{ 13 * 8, 3 * 16, 10 * 16, 16 },
|
||||
"-"
|
||||
};
|
||||
Text text_result_imperial {
|
||||
{ 13 * 8, 4 * 16, 10 * 16, 16 },
|
||||
"-"
|
||||
};
|
||||
Console console {
|
||||
{ 0, 6 * 16, 240, 160 }
|
||||
};
|
||||
|
||||
Button button_exit {
|
||||
{ 72, 17 * 16, 96, 32 },
|
||||
"Back"
|
||||
};
|
||||
};
|
||||
|
||||
} /* namespace ui */
|
||||
|
||||
#endif/*__UI_WHIPCALC__*/
|
||||
#endif /*__UI_WHIPCALC__*/
|
||||
|
Reference in New Issue
Block a user