@@ -251,57 +251,10 @@ static void __display_cfg_event_init(void)
251251 lv_obj_add_event_cb (ui_back1 , __display_cfg_apply_event_cb , LV_EVENT_PRESSED , NULL );
252252}
253253
254-
255- /********************** sensor chart **********************/
256-
257- static void ui_event_sensor_co2_chart ( lv_event_t * e ) {
258- lv_event_code_t event_code = lv_event_get_code (e );lv_obj_t * target = lv_event_get_target (e );
259- lv_obj_t * cur_screen = lv_scr_act ();
260- if ( event_code == LV_EVENT_CLICKED && cur_screen == ui_screen_sensor ) {
261- esp_event_post_to (view_event_handle , VIEW_EVENT_BASE , VIEW_EVENT_SENSOR_CO2_HISTORY , NULL , 0 , portMAX_DELAY );
262-
263- _ui_screen_change ( ui_screen_sensor_chart , LV_SCR_LOAD_ANIM_OVER_LEFT , 200 , 0 );
264- }
265- }
266-
267- static void ui_event_sensor_tvoc_chart ( lv_event_t * e ) {
268- lv_event_code_t event_code = lv_event_get_code (e );lv_obj_t * target = lv_event_get_target (e );
269- lv_obj_t * cur_screen = lv_scr_act ();
270- if ( event_code == LV_EVENT_CLICKED && cur_screen == ui_screen_sensor ) {
271- esp_event_post_to (view_event_handle , VIEW_EVENT_BASE , VIEW_EVENT_SENSOR_TVOC_HISTORY , NULL , 0 , portMAX_DELAY );
272- _ui_screen_change ( ui_screen_sensor_chart , LV_SCR_LOAD_ANIM_OVER_LEFT , 200 , 0 );
273- }
274- }
275- static void ui_event_sensor_temp_chart ( lv_event_t * e ) {
276- lv_event_code_t event_code = lv_event_get_code (e );lv_obj_t * target = lv_event_get_target (e );
277- lv_obj_t * cur_screen = lv_scr_act ();
278- if ( event_code == LV_EVENT_CLICKED && cur_screen == ui_screen_sensor ) {
279- esp_event_post_to (view_event_handle , VIEW_EVENT_BASE , VIEW_EVENT_SENSOR_TEMP_HISTORY , NULL , 0 , portMAX_DELAY );
280- _ui_screen_change ( ui_screen_sensor_chart , LV_SCR_LOAD_ANIM_OVER_LEFT , 200 , 0 );
281- }
282- }
283- static void ui_event_sensor_humidity_chart ( lv_event_t * e ) {
284- lv_event_code_t event_code = lv_event_get_code (e );lv_obj_t * target = lv_event_get_target (e );
285- lv_obj_t * cur_screen = lv_scr_act ();
286- if ( event_code == LV_EVENT_CLICKED && cur_screen == ui_screen_sensor ) {
287- esp_event_post_to (view_event_handle , VIEW_EVENT_BASE , VIEW_EVENT_SENSOR_HUMIDITY_HISTORY , NULL , 0 , portMAX_DELAY );
288- _ui_screen_change ( ui_screen_sensor_chart , LV_SCR_LOAD_ANIM_OVER_LEFT , 200 , 0 );
289- }
290- }
291-
292- static void __sensor_chart_event_init (void )
293- {
294- lv_obj_add_event_cb (ui_co2 , ui_event_sensor_co2_chart , LV_EVENT_ALL , NULL );
295- lv_obj_add_event_cb (ui_tvoc_2 , ui_event_sensor_tvoc_chart , LV_EVENT_ALL , NULL );
296- lv_obj_add_event_cb (ui_temp2 , ui_event_sensor_temp_chart , LV_EVENT_ALL , NULL );
297- lv_obj_add_event_cb (ui_humidity2 , ui_event_sensor_humidity_chart , LV_EVENT_ALL , NULL );
298- }
299-
300254int indicator_controller_init (void )
301255{
302256 __time_cfg_event_init ();
303257 __display_cfg_event_init ();
304- __sensor_chart_event_init ();
305258
306259 return 0 ;
307260}
0 commit comments