49 void add(
const std::string& name,
const std::string& desc, std::function<
void()> fn);
52 void add(
const std::string& name,
const std::string& desc, std::function<
void()> fn,
53 const lv_img_dsc_t* banner);
68 std::vector<Auton> autons_;
69 int selected_idx_ = 0;
70 lv_obj_t* screen_ =
nullptr;
71 lv_obj_t* img_obj_ =
nullptr;
72 lv_obj_t* preview_cont_ =
nullptr;
73 lv_obj_t* pid_cont_ =
nullptr;
74 lv_obj_t* odom_cont_ =
nullptr;
75 lv_obj_t* odom_x_lbl_ =
nullptr;
76 lv_obj_t* odom_y_lbl_ =
nullptr;
77 lv_obj_t* odom_theta_lbl_ =
nullptr;
78 lv_timer_t* odom_timer_ =
nullptr;
81 char odom_x_last_[16] = {};
82 char odom_y_last_[16] = {};
83 char odom_th_last_[16] = {};
84 lv_obj_t* toggle_lbl_ =
nullptr;
85 int right_panel_mode_ = 0;
86 std::vector<lv_obj_t*> btn_objs_;
89 lv_obj_t* pid_tab_btns_[4] = {};
90 lv_obj_t* pid_val_labels_[4][4] = {};
91 int active_pid_tab_ = 0;
92 double pid_vals_[4][4] = {};
96 void build_right_preview(lv_obj_t* parent);
97 void build_right_pid(lv_obj_t* parent);
98 void build_right_odom(lv_obj_t* parent);
99 void switch_panel(
int mode);
100 void select_pid_tab(
int idx);
101 void refresh_pid_labels();
102 void init_pid_vals();
103 void apply_pid_vals();
104 void select(
int idx);
107 lv_obj_t* run_screen_ =
nullptr;
108 lv_obj_t* run_img_cont_ =
nullptr;
109 lv_obj_t* run_info_cont_ =
nullptr;
110 lv_obj_t* run_toggle_lbl_ =
nullptr;
111 lv_obj_t* run_back_lbl_ =
nullptr;
112 lv_obj_t* run_img_ =
nullptr;
113 bool run_show_img_ =
false;
114 void build_run_screen();
115 void start_run_anim();
116 void switch_run_view(
bool show_img);
117 static void run_toggle_cb(lv_event_t* e);
118 static void run_back_cb(lv_event_t* e);
120 static void btn_cb(lv_event_t* e);
121 static void toggle_cb(lv_event_t* e);
122 static void pid_tab_cb(lv_event_t* e);
123 static void pid_adj_cb(lv_event_t* e);
124 static void pid_apply_cb(lv_event_t* e);
125 static void odom_timer_cb(lv_timer_t* timer);
void add(const std::string &name, const std::string &desc, std::function< void()> fn, const lv_img_dsc_t *banner)
add() variant with a scrolling banner image shown inside the button.
void add(const std::string &name, const std::string &desc, std::function< void()> fn)
Register an autonomous routine.