sggt/App/APP_WU/Src/apps_gather.c

166 lines
4.0 KiB
C

/*
* @Author: wujunchao wujunchao@wuxismart.com
* @Date: 2024-12-27 11:50:56
* @LastEditors: wujunchao wujunchao@wuxismart.com
* @LastEditTime: 2024-12-28 16:46:49
* @FilePath: \signal_generator\App\APP_WU\Src\apps_gather.c
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
#include "apps_gather.h" //用于头文件打包汇总
uint8_t scr_init_bar1 = 0, scr_init_cnt = 0, scr_init_flag = 0;
int tick_prv = -1, tick_cur = -1;
void menu_test3(void)
{
if(scr_init_flag == 0)
{
scr_init_run();
}else
{
scr_main_run();
}
}
void scr_init_run(void)
{
if( scr_init_cnt <= 5 )
{
if( tick_prv == -1 )
{
tick_prv = xTaskGetTickCount();
}else
{
tick_cur = xTaskGetTickCount();
if(tick_cur - tick_prv >= 1000)
{
tick_prv = -1;
tick_cur = -1;
scr_init_bar1 = scr_init_cnt*20;
lv_bar_set_value(guider_ui.screen_init_bar_1, scr_init_bar1, LV_ANIM_OFF);
scr_init_cnt ++;
}
}
}else
{
if( tick_prv == -1 )
{
tick_prv = xTaskGetTickCount();
}else
{
tick_cur = xTaskGetTickCount();
if(tick_cur - tick_prv >= 250)
{
scr_init_flag = 1;
tick_prv = -1;
tick_cur = -1;
// lv_scr_load_anim(guider_ui.screen_main, LV_SCR_LOAD_ANIM_FADE_OUT, 1000, 250, 1);
init_scr_del_flag(&guider_ui);
setup_scr_screen_main(&guider_ui);
lv_scr_load(guider_ui.screen_main);
}
}
}
}
uint8_t led_bri = 0;
void scr_main_run(void)
{
//LED_LCD
if( tick_prv == -1 )
{
tick_prv = xTaskGetTickCount();
}else
{
tick_cur = xTaskGetTickCount();
if(tick_cur - tick_prv >= 1000)
{
tick_prv = -1;
tick_cur = -1;
led_bri = (led_bri == 0)?(255):(0);
lv_led_set_brightness(guider_ui.screen_main_led_1, led_bri);
}
}
//Menu_LCD
switch(key)
{
case 71:
{
key = 0;
lv_event_send(guider_ui.screen_main_menu_1_cont_1, LV_EVENT_CLICKED, NULL);
lv_meter_set_indicator_value(guider_ui.screen_main_meter_1,guider_ui.screen_main_meter_1_scale_0_ndline_0, 25);
}
break;
case 79:
{
key = 0;
lv_event_send(guider_ui.screen_main_menu_1_cont_2, LV_EVENT_CLICKED, NULL);
lv_meter_set_indicator_value(guider_ui.screen_main_meter_1, guider_ui.screen_main_meter_1_scale_0_ndline_0, 50);
}
break;
case 87:
{
key = 0;
lv_event_send(guider_ui.screen_main_menu_1_cont_3, LV_EVENT_CLICKED, NULL);
lv_meter_set_indicator_value(guider_ui.screen_main_meter_1, guider_ui.screen_main_meter_1_scale_0_ndline_0, 75);
}
break;
default:
{
}
break;
}
}
// int bar1_v = 0, bar2_v = 0, bar3_v = 0;
// void menu_test2(void)
// {
// switch(key)
// {
// case 68:
// {
// key = 0;
// bar1_v = ( bar1_v > 90 )?( 0 ):( bar1_v + 10 );
// lv_bar_set_value(guider_ui.screen_bar_1, bar1_v, LV_ANIM_OFF);
// }
// break;
// case 69:
// {
// key = 0;
// bar2_v = ( bar2_v > 90 )?( 0 ):( bar2_v + 10 );
// lv_bar_set_value(guider_ui.screen_bar_2, bar2_v, LV_ANIM_OFF);
// }
// break;
// case 70:
// {
// key = 0;
// bar3_v = ( bar3_v > 90 )?( 0 ):( bar3_v + 10 );
// lv_bar_set_value(guider_ui.screen_bar_3, bar3_v, LV_ANIM_OFF);
// }
// break;
// default:
// {
// }
// break;
// }
// }