50 void add(
const std::string& name,
const std::string& desc, std::function<
void()> fn);
53 void add(
const std::string& name,
const std::string& desc, std::function<
void()> fn,
54 const lv_img_dsc_t* banner);
69 std::vector<Auton> autons_;
70 int selected_idx_ = 0;
71 lv_obj_t* screen_ =
nullptr;
72 lv_obj_t* img_obj_ =
nullptr;
73 lv_obj_t* preview_cont_ =
nullptr;
74 lv_obj_t* pid_cont_ =
nullptr;
75 lv_obj_t* odom_cont_ =
nullptr;
76 lv_obj_t* odom_x_lbl_ =
nullptr;
77 lv_obj_t* odom_y_lbl_ =
nullptr;
78 lv_obj_t* odom_theta_lbl_ =
nullptr;
79 lv_timer_t* odom_timer_ =
nullptr;
82 char odom_x_last_[16] = {};
83 char odom_y_last_[16] = {};
84 char odom_th_last_[16] = {};
85 lv_obj_t* toggle_lbl_ =
nullptr;
86 int right_panel_mode_ = 0;
87 std::vector<lv_obj_t*> btn_objs_;
91 std::vector<lv_obj_t*> infinite_anim_targets_;
94 lv_obj_t* pid_tab_btns_[4] = {};
95 lv_obj_t* pid_val_labels_[4][4] = {};
96 int active_pid_tab_ = 0;
97 double pid_vals_[4][4] = {};
101 void build_right_preview(lv_obj_t* parent);
102 void build_right_pid(lv_obj_t* parent);
103 void build_right_odom(lv_obj_t* parent);
104 void switch_panel(
int mode);
105 void select_pid_tab(
int idx);
106 void refresh_pid_labels();
107 void init_pid_vals();
108 void apply_pid_vals();
109 void select(
int idx);
112 lv_obj_t* run_screen_ =
nullptr;
113 lv_obj_t* run_img_cont_ =
nullptr;
114 lv_obj_t* run_info_cont_ =
nullptr;
115 lv_obj_t* run_toggle_lbl_ =
nullptr;
116 lv_obj_t* run_back_lbl_ =
nullptr;
117 lv_obj_t* run_img_ =
nullptr;
118 bool run_show_img_ =
false;
121 std::atomic<bool> run_setup_done_{
false};
122 void build_run_screen();
123 void activate_run_screen();
124 void start_run_anim();
125 void switch_run_view(
bool show_img);
126 static void run_screen_load_async(
void* p);
127 static void run_toggle_cb(lv_event_t* e);
128 static void run_back_cb(lv_event_t* e);
130 static void btn_cb(lv_event_t* e);
131 static void toggle_cb(lv_event_t* e);
132 static void pid_tab_cb(lv_event_t* e);
133 static void pid_adj_cb(lv_event_t* e);
134 static void pid_apply_cb(lv_event_t* e);
135 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.