更新:输入&输出记录与查询
This commit is contained in:
parent
e7aeb8269b
commit
fa601e36d8
|
@ -328,9 +328,9 @@ void ads1220_operation(uint8_t channel, float32 *data_pv)
|
|||
setup_ads1220(
|
||||
ADS1220_MUX_AIN0_AIN1, // 输入多路复用器配置
|
||||
ADS1220_OP_MODE_NORMAL, // 工作模式选择
|
||||
ADS1220_CONVERSION_CONTINUOUS, // 转换模式*
|
||||
ADS1220_DATA_RATE_20SPS, // 数据速率*
|
||||
ADS1220_GAIN_32, // 增益配置*
|
||||
ADS1220_CONVERSION_SINGLE_SHOT, // 转换模式*
|
||||
ADS1220_DATA_RATE_45SPS, // 数据速率*
|
||||
ADS1220_GAIN_1, // 增益配置*
|
||||
ADS1220_PGA_BYPASS, // 禁止/启用可编程增益放大器
|
||||
ADS1220_IDAC1_DISABLED, // 选择IDAC1将路由到的通道
|
||||
ADS1220_IDAC2_DISABLED, // 选择IDAC2将路由到的通道
|
||||
|
|
|
@ -194,6 +194,12 @@ void scr_setting_run(void);
|
|||
//此处用于更改标题和选项卡的语言,内容的语言切换在 set_XXX_text & set_XXX_value内
|
||||
void setting_laguage_switch(uint8_t lan);
|
||||
|
||||
//执行保存功能
|
||||
void deal_data_save(void);
|
||||
|
||||
//执行复位功能
|
||||
void deal_data_reset(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -121,8 +121,6 @@ typedef struct
|
|||
uint8_t twk_flip; //0-1变量,用于控制显示内容翻转(显示/不显示)
|
||||
uint8_t twk_cnt; //闪烁计数,计数达到上限后闪烁停止
|
||||
#endif
|
||||
uint8_t overflow_flag_up; //向上溢出标志
|
||||
uint8_t overflow_flag_low; //向下溢出标志
|
||||
uint8_t sign_flag_in; //输入信号符号位标志,0->不显示,1->显示负号
|
||||
uint8_t sign_flag_out; //输出信号符号位标志,0->不显示,1->显示负号
|
||||
|
||||
|
@ -196,16 +194,17 @@ typedef struct
|
|||
int16_t item0_page2_RTDlow;
|
||||
|
||||
//ITEMS_1
|
||||
uint16_t item1_page0_sample_interval; //采样间隔ms
|
||||
uint16_t item1_page0_sample_interval; //采样间隔ms
|
||||
uint8_t item1_page0_plot_num; //曲线上显示的点数
|
||||
int8_t item1_page0_color_input; //输出曲线及其图例的颜色
|
||||
int8_t item1_page0_color_output; //输出曲线及其图例的颜色
|
||||
int8_t item1_page0_color_input; //输出曲线及其图例的颜色
|
||||
int8_t item1_page0_color_output; //输出曲线及其图例的颜色
|
||||
|
||||
//ITEMS_2
|
||||
uint8_t item2_page0_saveflag; //[0, 1,2 ] -> [未保存,保存中,已保存]
|
||||
float32 input_log_temp; //无纸化记录,中转,存入eeprom
|
||||
float32 output_log_temp; //无纸化记录,中转,存入eeprom
|
||||
uint8_t item2_page0_resetflag; //[0, 1,2 ] -> [未复位,复位中,已复位]
|
||||
uint8_t item2_page0_saveflag; //[0, 1,2 ] -> [未保存,保存中,已保存]
|
||||
char log_time[60][16]; //输入&输出记录,时间戳
|
||||
float32 input_log_value[60]; //输入记录,实际值
|
||||
float32 output_log_value[60]; //输出记录,实际值
|
||||
uint8_t item2_page0_resetflag; //[0, 1,2 ] -> [未复位,复位中,已复位]
|
||||
|
||||
//ITEMS_3
|
||||
uint8_t item3_page0_lightflag; //照明状态标志,0熄灭,1开启
|
||||
|
|
|
@ -19,6 +19,9 @@ void set_item2_value(uint8_t con, int8_t step);
|
|||
//修改选项卡3的值
|
||||
void set_item3_value(uint8_t con, int8_t step);
|
||||
|
||||
//查看输入输出记录,io -> 输入/输出,page -> 指定页码
|
||||
void show_IO_log(uint8_t io, uint8_t page);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -41,23 +41,21 @@ void main_data_init(void)
|
|||
m5data.twk_flip = 0; //0显示,1不显示
|
||||
m5data.twk_cnt = 0; //闪烁计数
|
||||
#endif
|
||||
m5data.overflow_flag_low = 0; //向上溢出
|
||||
m5data.overflow_flag_up = 0; //向下溢出
|
||||
m5data.sign_flag_in = 0; //默认不显示符号
|
||||
m5data.sign_flag_out = 0; //默认不显示符号
|
||||
|
||||
m5data.io_on2off = IO_OFF; //初始为关闭状态
|
||||
m5data.io_mode = IO_OUTPUT; //默认工作模式,0:输入IN,1:输出OUT
|
||||
for(uint8_t i = 0; i < 7; i++) //用于数值显示的数组,初值为0
|
||||
{
|
||||
m5data.i_numbers[i] = 0; //输入值/测量值
|
||||
m5data.o_numbers[i] = 0; //输出值/设定值
|
||||
}
|
||||
|
||||
m5data.input_mode = CUR.tag; //输入功能初始为电流模式
|
||||
m5data.input_mode_type = CUR.typ; //电流单位为mA
|
||||
m5data.output_mode = CUR.tag; //输出功能初始为电流模式
|
||||
m5data.output_mode_type = CUR.typ; //电压单位初始为mA
|
||||
m5data.io_on2off = IO_OFF; //初始为关闭状态
|
||||
m5data.io_mode = IO_OUTPUT; //默认工作模式,0:输入IN,1:输出OUT
|
||||
m5data.input_mode = CUR.tag; //输入功能初始为电流模式
|
||||
m5data.input_mode_type = CUR.typ; //电流单位为mA
|
||||
m5data.output_mode = CUR.tag; //输出功能初始为电流模式
|
||||
m5data.output_mode_type = CUR.typ; //电压单位初始为mA
|
||||
sig_channel_select(m5data.io_mode, m5data.output_mode_type); //默认通道
|
||||
|
||||
//绘图数据初始化
|
||||
|
@ -223,9 +221,6 @@ void key_functions_main(void)
|
|||
{
|
||||
if( m5data.tick_prv == -1 )
|
||||
{
|
||||
//恢复默认工作模式:关闭、电压V输出
|
||||
set_working_mode(SIG_CURRENT, CURRENT_MA);
|
||||
|
||||
//加载菜单界面
|
||||
lv_scr_load(guider_ui.screen_setting);
|
||||
scr_setting_recover();
|
||||
|
@ -783,6 +778,7 @@ void eep_status_monitor(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
uint8_t log_pos = 0;
|
||||
void runtime_show(void)
|
||||
{
|
||||
if(heart_1000ms_flag)
|
||||
|
@ -811,6 +807,12 @@ void runtime_show(void)
|
|||
sprintf(m5data.runtime_show, "%02d:%02d:%02d",m5data.runtime_hours, m5data.runtime_minutes, m5data.runtime_seconds);
|
||||
lv_span_set_text(guider_ui.screen_main_spangroup_time_span, m5data.runtime_show);
|
||||
|
||||
//记录输出值及其对应时间戳
|
||||
memcpy(tabdata.log_time[log_pos], m5data.runtime_show, sizeof(m5data.runtime_show));
|
||||
tabdata.input_log_value[log_pos]= mux2real(mux_signal.data_pv);
|
||||
tabdata.output_log_value[log_pos]= mux_signal.data_sv;
|
||||
log_pos = (log_pos >= 59)?(0):(log_pos + 1);
|
||||
|
||||
#if EEPROM_MONITOR_ENABLE
|
||||
eep_status_monitor();
|
||||
#endif
|
||||
|
@ -1380,30 +1382,14 @@ void io_on2off_status(void)
|
|||
void scr_main_recover(void)
|
||||
{
|
||||
// 运行时间 和 电池电量 在主界面的函数中已存在,无需额外恢复
|
||||
// 曲线需要在 setup_scr_screen_main.c 中修改
|
||||
|
||||
io_on2off_status(); //IN&OUT, ON&OFF
|
||||
|
||||
//输入&输出、工作模式&类型
|
||||
switch (m5data.io_mode) //输入、输出模式切换
|
||||
{
|
||||
case IO_OUTPUT:
|
||||
{
|
||||
set_working_mode(m5data.output_mode, m5data.output_mode_type);
|
||||
}
|
||||
break;
|
||||
|
||||
case IO_INPUT:
|
||||
{
|
||||
set_working_mode(m5data.input_mode, m5data.input_mode_type);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
//恢复默认工作模式
|
||||
m5data.io_mode = IO_OUTPUT;
|
||||
m5data.output_mode = SIG_CURRENT;
|
||||
m5data.output_mode_type = CURRENT_MA;
|
||||
set_working_mode(m5data.output_mode, m5data.output_mode_type);
|
||||
|
||||
//曲线设置项同步
|
||||
//曲线描点个数
|
||||
lv_chart_set_point_count(guider_ui.screen_main_chart_1, tabdata.item1_page0_plot_num);
|
||||
for(uint8_t i = 0; i < tabdata.item1_page0_plot_num; i++)
|
||||
{
|
||||
|
@ -1414,9 +1400,10 @@ void scr_main_recover(void)
|
|||
//输入/输出曲线、图例、上下限颜色更新
|
||||
scr_main_color_update();
|
||||
|
||||
//熄灭设置界面的选项卡缓存(隐藏式切换界面)
|
||||
setting_items_check(99, tabdata.item_cursor);
|
||||
tabdata.item_cursor_prv = 99;
|
||||
tabdata.item_cursor = 0;
|
||||
tabdata.item_cursor_prv = 99;
|
||||
}
|
||||
|
||||
//颜色更新
|
||||
|
@ -1489,7 +1476,7 @@ void plot_drawing(void)
|
|||
//输出曲线
|
||||
//{
|
||||
//将独立数字转换成实际值
|
||||
pltdata.yreal_pri_value = get_output_value();
|
||||
pltdata.yreal_pri_value = mux_signal.data_sv;
|
||||
|
||||
//改变之前先记录前一时刻的绘图值
|
||||
pltdata.y_pri_value_prv = pltdata.y_pri_value;
|
||||
|
|
|
@ -38,10 +38,11 @@ void tab_data_init(void)
|
|||
// tabdata.item1_page0_color_output = COLOR_BLUE; //输出曲线颜色
|
||||
|
||||
//ITEMS_2(注释项位于EERPOM读取)
|
||||
tabdata.item2_page0_saveflag = 0; //[0, 1, 2 ] -> [未保存,保存中,已保存]
|
||||
tabdata.input_log_temp = 0; //无纸化记录,中转,存入eeprom
|
||||
tabdata.output_log_temp = 0; //无纸化记录,中转,存入eeprom
|
||||
tabdata.item2_page0_resetflag = 0; //[0, 1, 2 ] -> [未复位,复位中,已复位]
|
||||
tabdata.item2_page0_saveflag = 0;
|
||||
memset(tabdata.log_time, 0, sizeof(tabdata.log_time));
|
||||
memset(tabdata.input_log_value, 0, sizeof(tabdata.input_log_value));
|
||||
memset(tabdata.output_log_value, 0, sizeof(tabdata.output_log_value));
|
||||
tabdata.item2_page0_resetflag = 0;
|
||||
|
||||
//ITEMS_3(注释项位于EERPOM读取)
|
||||
tabdata.item3_page0_lightflag = 0; //照明状态标志,0熄灭,1开启
|
||||
|
@ -223,6 +224,12 @@ void key_functions_setting(void)
|
|||
|
||||
case ITEMS_2:
|
||||
{
|
||||
if( (inner_cursor == INPUT_LOG)||(inner_cursor == OUTPUT_LOG) )
|
||||
{
|
||||
setting_items_page(ITEMS_2, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
set_item2_text(inner_cursor);
|
||||
}
|
||||
break;
|
||||
|
@ -385,14 +392,14 @@ void key_functions_setting(void)
|
|||
|
||||
if(tabdata.content_cursor == 99)
|
||||
{
|
||||
//进入某个选项卡,点亮第一个内容
|
||||
//选中某个选项卡后,点亮该选项卡内的第一个内容
|
||||
tabdata.content_cursor = 0;
|
||||
tabdata.content_cursor_prv = 99;
|
||||
setting_contents_check(tabdata.content_cursor, tabdata.content_cursor_prv);
|
||||
}
|
||||
else
|
||||
{
|
||||
//进入某个选项卡后,焦点当前选中内容
|
||||
//选中选项卡内的某个内容后,焦点当前选中内容
|
||||
tabdata.content_focus = 1;
|
||||
setting_contents_check(tabdata.content_cursor, tabdata.content_cursor_prv);
|
||||
|
||||
|
@ -631,20 +638,6 @@ void setting_items_check(uint8_t cursor, uint8_t cursor_prv)
|
|||
//当前选项卡内容翻页:隐藏当前页,显示目标页page
|
||||
void setting_items_page(uint8_t ite, uint8_t page)
|
||||
{
|
||||
//启用所需组件
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_00, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_00, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_01, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_01, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_10, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_10, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_11, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_11, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_20, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_20, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_21, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_21, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_30, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_30, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_31, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_31, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_40, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_40, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_41, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_41, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_50, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_50, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_51, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_51, LV_OBJ_FLAG_HIDDEN); };
|
||||
|
||||
//特殊处理,避免其他选项卡也被染上颜色
|
||||
if(ite != ITEMS_1)
|
||||
{
|
||||
|
@ -656,6 +649,20 @@ void setting_items_page(uint8_t ite, uint8_t page)
|
|||
{
|
||||
case ITEMS_0:
|
||||
{
|
||||
//启用所需组件
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_00, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_00, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_01, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_01, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_10, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_10, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_11, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_11, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_20, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_20, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_21, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_21, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_30, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_30, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_31, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_31, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_40, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_40, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_41, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_41, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_50, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_50, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_51, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_51, LV_OBJ_FLAG_HIDDEN); };
|
||||
|
||||
//显示目标页
|
||||
switch (page)
|
||||
{
|
||||
|
@ -785,6 +792,16 @@ void setting_items_page(uint8_t ite, uint8_t page)
|
|||
|
||||
case ITEMS_1:
|
||||
{
|
||||
//启用所需组件
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_00, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_00, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_01, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_01, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_10, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_10, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_11, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_11, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_20, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_20, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_21, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_21, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_30, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_30, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_31, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_31, LV_OBJ_FLAG_HIDDEN); };
|
||||
|
||||
//显示目标页
|
||||
switch (page)
|
||||
{
|
||||
|
@ -839,6 +856,16 @@ void setting_items_page(uint8_t ite, uint8_t page)
|
|||
|
||||
case ITEMS_2:
|
||||
{
|
||||
//启用所需组件
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_00, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_00, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_01, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_01, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_10, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_10, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_11, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_11, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_20, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_20, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_21, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_21, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_30, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_30, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_31, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_31, LV_OBJ_FLAG_HIDDEN); };
|
||||
|
||||
//显示目标页
|
||||
switch (page)
|
||||
{
|
||||
|
@ -884,11 +911,20 @@ void setting_items_page(uint8_t ite, uint8_t page)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
//更新页码
|
||||
set_item2_text(PAGE_PV);
|
||||
}
|
||||
break;
|
||||
|
||||
case ITEMS_3:
|
||||
{
|
||||
//启用所需组件
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_00, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_00, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_01, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_01, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_10, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_10, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_11, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_11, LV_OBJ_FLAG_HIDDEN); };
|
||||
|
||||
//显示目标页
|
||||
switch (page)
|
||||
{
|
||||
|
@ -932,6 +968,9 @@ void setting_items_page(uint8_t ite, uint8_t page)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
//更新页码
|
||||
set_item3_text(PAGE_PV);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -964,6 +1003,7 @@ void setting_contents_check(uint8_t cursor, uint8_t cursor_prv)
|
|||
}
|
||||
|
||||
//设置界面选项卡内部内容选中之后,修改内容,修改第ite个选项卡的第con个内容
|
||||
uint8_t log_page = 1;
|
||||
void setting_contents_modify(uint8_t ite, uint8_t con, int8_t step)
|
||||
{
|
||||
//选中某一选项卡后,对选项卡内部的内容进行选择
|
||||
|
@ -991,6 +1031,28 @@ void setting_contents_modify(uint8_t ite, uint8_t con, int8_t step)
|
|||
|
||||
case ITEMS_2:
|
||||
{
|
||||
if( con == INPUT_LOG )
|
||||
{
|
||||
log_page += step;
|
||||
if(log_page > 10) log_page = 1;
|
||||
if(log_page < 1) log_page = 10;
|
||||
|
||||
show_IO_log(IO_INPUT, log_page);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (con == OUTPUT_LOG)
|
||||
{
|
||||
log_page += step;
|
||||
if(log_page > 10) log_page = 1;
|
||||
if(log_page < 1) log_page = 10;
|
||||
|
||||
show_IO_log(IO_OUTPUT, log_page);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
set_item2_value(con, step);
|
||||
set_item2_text(con);
|
||||
}
|
||||
|
@ -1057,22 +1119,32 @@ void set_contents_color(uint8_t cursor, uint32_t color)
|
|||
|
||||
void scr_setting_recover(void)
|
||||
{
|
||||
tabdata.item_page = 1;
|
||||
//在这里恢复选项卡0第1页的显示内容
|
||||
//ITEMS_0
|
||||
tabdata.item_cursor = 0;
|
||||
tabdata.item_cursor_prv = 99;
|
||||
setting_items_check(tabdata.item_cursor, tabdata.item_cursor_prv);
|
||||
|
||||
setting_laguage_switch(tabdata.item3_page0_language);
|
||||
|
||||
tabdata.item_page = 1;
|
||||
setting_items_page(ITEMS_0 ,tabdata.item_page);
|
||||
|
||||
}
|
||||
|
||||
// uint8_t eep_test_flag = 0;
|
||||
// uint8_t tx = 0, rx = 0;
|
||||
// uint8_t addr_test[3] = {0};
|
||||
uint8_t reset_step = 0, save_step = 0;
|
||||
void scr_setting_run(void) //详细设置界面
|
||||
{
|
||||
if(tabdata.item2_page0_saveflag == 1)
|
||||
//处理保存事件
|
||||
deal_data_save();
|
||||
|
||||
//处理复位事件
|
||||
deal_data_reset();
|
||||
}
|
||||
|
||||
//执行保存功能
|
||||
void deal_data_save(void)
|
||||
{
|
||||
if(tabdata.item2_page0_saveflag == 1)
|
||||
{
|
||||
if(save_step == 0)
|
||||
{
|
||||
|
@ -1109,8 +1181,12 @@ void scr_setting_run(void) //详细设置界面
|
|||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(tabdata.item2_page0_resetflag == 1)
|
||||
//执行复位功能
|
||||
void deal_data_reset(void)
|
||||
{
|
||||
if(tabdata.item2_page0_resetflag == 1)
|
||||
{
|
||||
if(reset_step == 0)
|
||||
{
|
||||
|
@ -1132,7 +1208,6 @@ void scr_setting_run(void) //详细设置界面
|
|||
tabdata.item2_page0_resetflag = 2;
|
||||
|
||||
//更新本页文本
|
||||
|
||||
//保存状态更改为“已保存”
|
||||
tabdata.item2_page0_saveflag = 0;
|
||||
set_item2_text(DATA_SAVE);
|
||||
|
@ -1175,18 +1250,6 @@ void scr_setting_run(void) //详细设置界面
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if(eep_test_flag == 1)
|
||||
// {
|
||||
// eep_test_flag = 0;
|
||||
|
||||
// int addr_test_long = 0;
|
||||
// addr_test_long += addr_test[0]<<16;
|
||||
// addr_test_long += addr_test[1]<<8;
|
||||
// addr_test_long += addr_test[2];
|
||||
|
||||
// rx = eeprom_readdata(addr_test_long);
|
||||
// }
|
||||
}
|
||||
|
||||
//设置界面语言切换(主界面的语言切换在set_working_mode内)
|
||||
|
|
|
@ -984,6 +984,11 @@ uint8_t eeprom_device_check(void)
|
|||
tabdata.item0_page1_TClow[7] = TC[7].low; //TCT下限
|
||||
tabdata.item0_page2_RTDup = RTD.up; //RTD上限
|
||||
tabdata.item0_page2_RTDlow = RTD.low; //RTD下限
|
||||
tabdata.item1_page0_sample_interval = 1500;
|
||||
tabdata.item1_page0_plot_num = 5;
|
||||
tabdata.item1_page0_color_input = COLOR_YELLOW;
|
||||
tabdata.item1_page0_color_output = COLOR_BLUE;
|
||||
tabdata.item3_page0_language = MENU_SIMPLYFY_CHINESE;
|
||||
|
||||
//eeprom_datasave();
|
||||
eeprom_datasave_changed();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "scr_setting_item_text.h"
|
||||
|
||||
//该部分代码用于修改选项卡内部,右侧一列的文本
|
||||
|
||||
//修改选项卡0的文本
|
||||
void set_item0_text(uint8_t con)
|
||||
|
@ -365,7 +365,7 @@ void set_item0_text(uint8_t con)
|
|||
|
||||
case PAGE_PV:
|
||||
{
|
||||
sprintf(str_temp,"< %d / %d >",tabdata.item_page, I0_PAGE_MAX);
|
||||
sprintf(str_temp,"< %d/%d >",tabdata.item_page, I0_PAGE_MAX);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_page, str_temp);
|
||||
}
|
||||
break;
|
||||
|
@ -446,7 +446,7 @@ void set_item1_text(uint8_t con)
|
|||
|
||||
case PAGE_PV:
|
||||
{
|
||||
sprintf(str_temp,"< %d / %d >",tabdata.item_page, I1_PAGE_MAX);
|
||||
sprintf(str_temp,"< %d/%d >",tabdata.item_page, I1_PAGE_MAX);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_page, str_temp);
|
||||
}
|
||||
break;
|
||||
|
@ -720,18 +720,30 @@ void set_item2_text(uint8_t con)
|
|||
case INPUT_LOG:
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_11, ">");
|
||||
|
||||
if(tabdata.content_focus == 1)
|
||||
{
|
||||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_11, lv_color_hex(COLOR_ITEMS_UNCHECKED), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||||
show_IO_log(IO_INPUT, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case OUTPUT_LOG:
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_21, ">");
|
||||
|
||||
if(tabdata.content_focus == 1)
|
||||
{
|
||||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_21, lv_color_hex(COLOR_ITEMS_UNCHECKED), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||||
show_IO_log(IO_OUTPUT, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case PAGE_PV:
|
||||
{
|
||||
sprintf(str_temp,"< %d / %d >",tabdata.item_page, I2_PAGE_MAX);
|
||||
sprintf(str_temp,"< %d/%d >",tabdata.item_page, I2_PAGE_MAX);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_page, str_temp);
|
||||
}
|
||||
break;
|
||||
|
@ -889,7 +901,7 @@ void set_item3_text(uint8_t con)
|
|||
|
||||
case PAGE_PV:
|
||||
{
|
||||
sprintf(str_temp,"< %d / %d >",tabdata.item_page, I3_PAGE_MAX);
|
||||
sprintf(str_temp,"< %d/%d >",tabdata.item_page, I3_PAGE_MAX);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_page, str_temp);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "scr_setting_item_value.h"
|
||||
|
||||
//该部分代码用于修改选项卡内部,右侧一列的值
|
||||
|
||||
//修改选项卡0的值
|
||||
void set_item0_value(uint8_t con, int8_t step)
|
||||
|
@ -349,3 +349,141 @@ void set_item3_value(uint8_t con, int8_t step)
|
|||
}
|
||||
}
|
||||
|
||||
//查看输入输出记录,io -> 输入/输出,page -> 指定页码
|
||||
void show_IO_log(uint8_t io, uint8_t page)
|
||||
{
|
||||
if( (page > 10) || (page < 1) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//启用所需组件
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_00, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_00, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_01, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_01, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_10, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_10, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_11, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_11, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_20, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_20, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_21, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_21, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_30, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_30, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_31, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_31, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_40, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_40, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_41, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_41, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_50, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_50, LV_OBJ_FLAG_HIDDEN); };
|
||||
if( lv_obj_has_flag(guider_ui.screen_setting_label_51, LV_OBJ_FLAG_HIDDEN) ) { lv_obj_clear_flag(guider_ui.screen_setting_label_51, LV_OBJ_FLAG_HIDDEN); };
|
||||
|
||||
uint8_t cur = 0;
|
||||
cur = (page - 1)*6;
|
||||
char str[16];
|
||||
|
||||
if(tabdata.log_time[cur][2] == 0)
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_00, "---");
|
||||
}
|
||||
else
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_00, tabdata.log_time[cur]);
|
||||
}
|
||||
|
||||
if(tabdata.log_time[cur + 1][2] == 0)
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_10, "---");
|
||||
}
|
||||
else
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_10, tabdata.log_time[cur + 1]);
|
||||
}
|
||||
|
||||
if(tabdata.log_time[cur + 2][2] == 0)
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_20, "---");
|
||||
}
|
||||
else
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_20, tabdata.log_time[cur + 2]);
|
||||
}
|
||||
|
||||
if(tabdata.log_time[cur + 3][2] == 0)
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_30, "---");
|
||||
}
|
||||
else
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_30, tabdata.log_time[cur + 3]);
|
||||
}
|
||||
|
||||
if(tabdata.log_time[cur + 4][2] == 0)
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_40, "---");
|
||||
}
|
||||
else
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_40, tabdata.log_time[cur + 4]);
|
||||
}
|
||||
|
||||
if(tabdata.log_time[cur + 5][2] == 0)
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_50, "---");
|
||||
}
|
||||
else
|
||||
{
|
||||
lv_label_set_text(guider_ui.screen_setting_label_50, tabdata.log_time[cur + 5]);
|
||||
}
|
||||
|
||||
switch (io)
|
||||
{
|
||||
case IO_INPUT:
|
||||
{
|
||||
sprintf(str, "%.3f", tabdata.input_log_value[cur]);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_01, str);
|
||||
|
||||
sprintf(str, "%.3f", tabdata.input_log_value[cur + 1]);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_11, str);
|
||||
|
||||
sprintf(str, "%.3f", tabdata.input_log_value[cur + 2]);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_21, str);
|
||||
|
||||
sprintf(str, "%.3f", tabdata.input_log_value[cur + 3]);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_31, str);
|
||||
|
||||
sprintf(str, "%.3f", tabdata.input_log_value[cur + 4]);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_41, str);
|
||||
|
||||
sprintf(str, "%.3f", tabdata.input_log_value[cur + 5]);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_51, str);
|
||||
|
||||
sprintf(str,"< %d/%d >", page, 10);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_page, str);
|
||||
}
|
||||
break;
|
||||
|
||||
case IO_OUTPUT:
|
||||
{
|
||||
sprintf(str, "%.3f", tabdata.output_log_value[cur]);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_01, str);
|
||||
|
||||
sprintf(str, "%.3f", tabdata.output_log_value[cur + 1]);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_11, str);
|
||||
|
||||
sprintf(str, "%.3f", tabdata.output_log_value[cur + 2]);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_21, str);
|
||||
|
||||
sprintf(str, "%.3f", tabdata.output_log_value[cur + 3]);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_31, str);
|
||||
|
||||
sprintf(str, "%.3f", tabdata.output_log_value[cur + 4]);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_41, str);
|
||||
|
||||
sprintf(str, "%.3f", tabdata.output_log_value[cur + 5]);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_51, str);
|
||||
|
||||
sprintf(str,"< %d/%d >", page, 10);
|
||||
lv_label_set_text(guider_ui.screen_setting_label_page, str);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -318,10 +318,10 @@ void setup_scr_screen_setting(lv_ui *ui)
|
|||
|
||||
//Write codes screen_setting_label_page
|
||||
ui->screen_setting_label_page = lv_label_create(ui->screen_setting);
|
||||
lv_label_set_text(ui->screen_setting_label_page, "< 1 / 3 >");
|
||||
lv_label_set_text(ui->screen_setting_label_page, "< 1/3 >");
|
||||
lv_label_set_long_mode(ui->screen_setting_label_page, LV_LABEL_LONG_WRAP);
|
||||
lv_obj_set_pos(ui->screen_setting_label_page, 165, 221);
|
||||
lv_obj_set_size(ui->screen_setting_label_page, 70, 15);
|
||||
lv_obj_set_pos(ui->screen_setting_label_page, 160, 221);
|
||||
lv_obj_set_size(ui->screen_setting_label_page, 80, 15);
|
||||
|
||||
//Write style for screen_setting_label_page, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
|
||||
lv_obj_set_style_border_width(ui->screen_setting_label_page, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue