Compare commits
7
Commits
e25d2122ea
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8587957fdb | ||
|
|
e0d328e16d | ||
|
|
ca4953af85 | ||
|
|
4e4dfbb640 | ||
|
|
e8966f0764 | ||
|
|
281662556f | ||
|
|
f687b4aac4 |
No files matched your search
@@ -260,15 +260,18 @@ static void tabview_event_cb(lv_event_t *e)
|
|||||||
// 根据 tab_id 执行不同操作
|
// 根据 tab_id 执行不同操作
|
||||||
switch (tab_id) {
|
switch (tab_id) {
|
||||||
case 0://工单页面
|
case 0://工单页面
|
||||||
|
io_ui_show=0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 1://工艺页面
|
case 1://工艺页面
|
||||||
|
io_ui_show=0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
io_ui_show=1;
|
||||||
break;
|
break;
|
||||||
case 3://程序页面
|
case 3://程序页面
|
||||||
|
io_ui_show=0;
|
||||||
lv_obj_add_state(guider_ui.screen_set_Edit,LV_STATE_DISABLED);
|
lv_obj_add_state(guider_ui.screen_set_Edit,LV_STATE_DISABLED);
|
||||||
lv_obj_add_state(guider_ui.screen_set_Insert,LV_STATE_DISABLED);
|
lv_obj_add_state(guider_ui.screen_set_Insert,LV_STATE_DISABLED);
|
||||||
lv_obj_add_state(guider_ui.screen_set_Delete,LV_STATE_DISABLED);
|
lv_obj_add_state(guider_ui.screen_set_Delete,LV_STATE_DISABLED);
|
||||||
@@ -276,18 +279,47 @@ static void tabview_event_cb(lv_event_t *e)
|
|||||||
UI_pname_row();
|
UI_pname_row();
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
|
io_ui_show=0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 机台页面事件回调函数
|
||||||
|
static void w_io_event_cb(lv_event_t *e)
|
||||||
|
{
|
||||||
|
lv_event_code_t code = lv_event_get_code(e);
|
||||||
|
lv_obj_t *tabview = lv_event_get_target(e);
|
||||||
|
|
||||||
|
if (code == LV_EVENT_VALUE_CHANGED) {
|
||||||
|
// 获取当前选中的 Tab 索引
|
||||||
|
uint16_t tab_id = lv_tabview_get_tab_act(tabview);
|
||||||
|
// 根据 tab_id 执行不同操作
|
||||||
|
switch (tab_id) {
|
||||||
|
case 0:
|
||||||
|
io_ui_size=0;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
io_ui_size=1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
io_ui_size=2;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
io_ui_size=3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void custom_init(lv_ui *ui)
|
void custom_init(lv_ui *ui)
|
||||||
{
|
{
|
||||||
lv_obj_clear_flag(lv_tabview_get_content(ui->screen_tabview), LV_OBJ_FLAG_SCROLLABLE);//禁止左右滑动
|
lv_obj_clear_flag(lv_tabview_get_content(ui->screen_tabview), LV_OBJ_FLAG_SCROLLABLE);//禁止左右滑动
|
||||||
lv_obj_clear_flag(lv_tabview_get_content(ui->screen_w_io), LV_OBJ_FLAG_SCROLLABLE);//禁止左右滑动
|
lv_obj_clear_flag(lv_tabview_get_content(ui->screen_w_io), LV_OBJ_FLAG_SCROLLABLE);//禁止左右滑动
|
||||||
|
|
||||||
|
//选项卡回调事件设置
|
||||||
lv_obj_add_event_cb(ui->screen_tabview, tabview_event_cb, LV_EVENT_VALUE_CHANGED, NULL);//
|
lv_obj_add_event_cb(ui->screen_tabview, tabview_event_cb, LV_EVENT_VALUE_CHANGED, NULL);//
|
||||||
|
lv_obj_add_event_cb(ui->screen_w_io, w_io_event_cb, LV_EVENT_VALUE_CHANGED, NULL);//
|
||||||
|
|
||||||
lv_obj_set_style_pad_all(ui->screen_tabview_tab_1, 0, LV_PART_MAIN);
|
lv_obj_set_style_pad_all(ui->screen_tabview_tab_1, 0, LV_PART_MAIN);
|
||||||
lv_obj_set_style_pad_all(ui->screen_tabview_tab_2, 0, LV_PART_MAIN);
|
lv_obj_set_style_pad_all(ui->screen_tabview_tab_2, 0, LV_PART_MAIN);
|
||||||
@@ -374,6 +406,24 @@ void custom_init(lv_ui *ui)
|
|||||||
lv_table_set_cell_value(guider_ui.screen_pname_step_row,0,0,"步");
|
lv_table_set_cell_value(guider_ui.screen_pname_step_row,0,0,"步");
|
||||||
lv_table_set_cell_value(guider_ui.screen_pname_step_row,0,1,"工艺");
|
lv_table_set_cell_value(guider_ui.screen_pname_step_row,0,1,"工艺");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
lv_obj_add_event_cb(ui->screen_machine_id_rt, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
|
lv_obj_add_event_cb(ui->screen_stepinf_p5, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
|
lv_obj_add_event_cb(ui->screen_stepinf_p4, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
|
lv_obj_add_event_cb(ui->screen_stepinf_p3, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
|
lv_obj_add_event_cb(ui->screen_stepinf_p2, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
|
lv_obj_add_event_cb(ui->screen_stepinf_p1, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
|
lv_obj_add_event_cb(ui->screen_stepinf_p5b1, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
|
lv_obj_add_event_cb(ui->screen_stepinf_p4b1, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
|
lv_obj_add_event_cb(ui->screen_stepinf_p3b1, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
|
lv_obj_add_event_cb(ui->screen_stepinf_p2b1, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
|
lv_obj_add_event_cb(ui->screen_stepinf_p1b1, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
|
lv_obj_add_event_cb(ui->screen_stepinf_p5b2, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
|
lv_obj_add_event_cb(ui->screen_stepinf_p4b2, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
|
lv_obj_add_event_cb(ui->screen_stepinf_p3b2, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
|
lv_obj_add_event_cb(ui->screen_stepinf_p2b2, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
|
lv_obj_add_event_cb(ui->screen_stepinf_p1b2, ta_event_cb_NUMBER, LV_EVENT_ALL, ui->g_kb_top_layer);
|
||||||
/* Add your codes here */
|
/* Add your codes here */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,6 +366,9 @@ static void screen_stepinf_s1_event_handler (lv_event_t *e)
|
|||||||
lv_obj_clear_flag(guider_ui.screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN);
|
lv_obj_clear_flag(guider_ui.screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN);
|
||||||
lv_obj_add_flag(guider_ui.screen_stepinf_s2b, LV_OBJ_FLAG_HIDDEN);
|
lv_obj_add_flag(guider_ui.screen_stepinf_s2b, LV_OBJ_FLAG_HIDDEN);
|
||||||
lv_obj_add_flag(guider_ui.screen_stepinf_s3b, LV_OBJ_FLAG_HIDDEN);
|
lv_obj_add_flag(guider_ui.screen_stepinf_s3b, LV_OBJ_FLAG_HIDDEN);
|
||||||
|
lv_obj_clear_flag(guider_ui.screen_stepinf_steps1, LV_OBJ_FLAG_HIDDEN);
|
||||||
|
lv_obj_add_flag(guider_ui.screen_stepinf_steps2, LV_OBJ_FLAG_HIDDEN);
|
||||||
|
lv_obj_add_flag(guider_ui.screen_stepinf_steps3, LV_OBJ_FLAG_HIDDEN);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -383,6 +386,9 @@ static void screen_stepinf_s2_event_handler (lv_event_t *e)
|
|||||||
lv_obj_add_flag(guider_ui.screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN);
|
lv_obj_add_flag(guider_ui.screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN);
|
||||||
lv_obj_clear_flag(guider_ui.screen_stepinf_s2b, LV_OBJ_FLAG_HIDDEN);
|
lv_obj_clear_flag(guider_ui.screen_stepinf_s2b, LV_OBJ_FLAG_HIDDEN);
|
||||||
lv_obj_add_flag(guider_ui.screen_stepinf_s3b, LV_OBJ_FLAG_HIDDEN);
|
lv_obj_add_flag(guider_ui.screen_stepinf_s3b, LV_OBJ_FLAG_HIDDEN);
|
||||||
|
lv_obj_add_flag(guider_ui.screen_stepinf_steps1, LV_OBJ_FLAG_HIDDEN);
|
||||||
|
lv_obj_clear_flag(guider_ui.screen_stepinf_steps2, LV_OBJ_FLAG_HIDDEN);
|
||||||
|
lv_obj_add_flag(guider_ui.screen_stepinf_steps3, LV_OBJ_FLAG_HIDDEN);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -399,7 +405,10 @@ static void screen_stepinf_s3_event_handler (lv_event_t *e)
|
|||||||
uint16_t id = lv_dropdown_get_selected(guider_ui.screen_stepinf_s3);
|
uint16_t id = lv_dropdown_get_selected(guider_ui.screen_stepinf_s3);
|
||||||
lv_obj_add_flag(guider_ui.screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN);
|
lv_obj_add_flag(guider_ui.screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN);
|
||||||
lv_obj_add_flag(guider_ui.screen_stepinf_s2b, LV_OBJ_FLAG_HIDDEN);
|
lv_obj_add_flag(guider_ui.screen_stepinf_s2b, LV_OBJ_FLAG_HIDDEN);
|
||||||
lv_obj_clear_flag(guider_ui.screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN);
|
lv_obj_clear_flag(guider_ui.screen_stepinf_s3b, LV_OBJ_FLAG_HIDDEN);
|
||||||
|
lv_obj_add_flag(guider_ui.screen_stepinf_steps1, LV_OBJ_FLAG_HIDDEN);
|
||||||
|
lv_obj_add_flag(guider_ui.screen_stepinf_steps2, LV_OBJ_FLAG_HIDDEN);
|
||||||
|
lv_obj_clear_flag(guider_ui.screen_stepinf_steps3, LV_OBJ_FLAG_HIDDEN);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -430,6 +439,7 @@ static void screen_btn_2_event_handler (lv_event_t *e)
|
|||||||
switch (code) {
|
switch (code) {
|
||||||
case LV_EVENT_CLICKED:
|
case LV_EVENT_CLICKED:
|
||||||
{
|
{
|
||||||
|
STEP_DATA_set_ui_w();
|
||||||
lv_obj_add_flag(guider_ui.screen_stepinf, LV_OBJ_FLAG_HIDDEN);
|
lv_obj_add_flag(guider_ui.screen_stepinf, LV_OBJ_FLAG_HIDDEN);
|
||||||
lv_obj_add_flag(guider_ui.screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN);
|
lv_obj_add_flag(guider_ui.screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN);
|
||||||
lv_obj_add_flag(guider_ui.screen_stepinf_s2b, LV_OBJ_FLAG_HIDDEN);
|
lv_obj_add_flag(guider_ui.screen_stepinf_s2b, LV_OBJ_FLAG_HIDDEN);
|
||||||
|
|||||||
@@ -456,21 +456,44 @@ typedef struct
|
|||||||
lv_obj_t *screen_stepinf_s1;
|
lv_obj_t *screen_stepinf_s1;
|
||||||
lv_obj_t *screen_stepinf_s2;
|
lv_obj_t *screen_stepinf_s2;
|
||||||
lv_obj_t *screen_stepinf_s3;
|
lv_obj_t *screen_stepinf_s3;
|
||||||
lv_obj_t *screen_stepinf_p1;
|
|
||||||
lv_obj_t *screen_stepinf_p2;
|
|
||||||
lv_obj_t *screen_stepinf_p3;
|
|
||||||
lv_obj_t *screen_stepinf_p4;
|
|
||||||
lv_obj_t *screen_stepinf_p5;
|
|
||||||
lv_obj_t *screen_btn_1;
|
lv_obj_t *screen_btn_1;
|
||||||
lv_obj_t *screen_btn_1_label;
|
lv_obj_t *screen_btn_1_label;
|
||||||
lv_obj_t *screen_btn_2;
|
lv_obj_t *screen_btn_2;
|
||||||
lv_obj_t *screen_btn_2_label;
|
lv_obj_t *screen_btn_2_label;
|
||||||
lv_obj_t *screen_label_42;
|
lv_obj_t *screen_label_42;
|
||||||
lv_obj_t *screen_stepinf_p1n;
|
lv_obj_t *screen_stepinf_steps1;
|
||||||
lv_obj_t *screen_stepinf_p2n;
|
lv_obj_t *screen_stepinf_p5;
|
||||||
lv_obj_t *screen_stepinf_p3n;
|
lv_obj_t *screen_stepinf_p4;
|
||||||
lv_obj_t *screen_stepinf_p4n;
|
lv_obj_t *screen_stepinf_p3;
|
||||||
|
lv_obj_t *screen_stepinf_p2;
|
||||||
|
lv_obj_t *screen_stepinf_p1;
|
||||||
lv_obj_t *screen_stepinf_p5n;
|
lv_obj_t *screen_stepinf_p5n;
|
||||||
|
lv_obj_t *screen_stepinf_p4n;
|
||||||
|
lv_obj_t *screen_stepinf_p3n;
|
||||||
|
lv_obj_t *screen_stepinf_p2n;
|
||||||
|
lv_obj_t *screen_stepinf_p1n;
|
||||||
|
lv_obj_t *screen_stepinf_steps2;
|
||||||
|
lv_obj_t *screen_stepinf_p5b1;
|
||||||
|
lv_obj_t *screen_stepinf_p4b1;
|
||||||
|
lv_obj_t *screen_stepinf_p3b1;
|
||||||
|
lv_obj_t *screen_stepinf_p2b1;
|
||||||
|
lv_obj_t *screen_stepinf_p1b1;
|
||||||
|
lv_obj_t *screen_stepinf_p5n1;
|
||||||
|
lv_obj_t *screen_stepinf_p4n1;
|
||||||
|
lv_obj_t *screen_stepinf_p3n1;
|
||||||
|
lv_obj_t *screen_stepinf_p2n1;
|
||||||
|
lv_obj_t *screen_stepinf_p1n1;
|
||||||
|
lv_obj_t *screen_stepinf_steps3;
|
||||||
|
lv_obj_t *screen_stepinf_p5b2;
|
||||||
|
lv_obj_t *screen_stepinf_p4b2;
|
||||||
|
lv_obj_t *screen_stepinf_p3b2;
|
||||||
|
lv_obj_t *screen_stepinf_p2b2;
|
||||||
|
lv_obj_t *screen_stepinf_p1b2;
|
||||||
|
lv_obj_t *screen_stepinf_p5n2;
|
||||||
|
lv_obj_t *screen_stepinf_p4n2;
|
||||||
|
lv_obj_t *screen_stepinf_p3n2;
|
||||||
|
lv_obj_t *screen_stepinf_p2n2;
|
||||||
|
lv_obj_t *screen_stepinf_p1n2;
|
||||||
lv_obj_t *screen_line_1;
|
lv_obj_t *screen_line_1;
|
||||||
lv_obj_t *screen_label_48;
|
lv_obj_t *screen_label_48;
|
||||||
lv_obj_t *screen_label_49;
|
lv_obj_t *screen_label_49;
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -42,6 +42,37 @@ __attribute__((unused)) void ta_event_cb (lv_event_t *e) {
|
|||||||
if (code == LV_EVENT_CANCEL || code == LV_EVENT_DEFOCUSED)
|
if (code == LV_EVENT_CANCEL || code == LV_EVENT_DEFOCUSED)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if LV_USE_ZH_KEYBOARD != 0
|
||||||
|
lv_zh_keyboard_set_textarea(kb, ta);
|
||||||
|
#endif
|
||||||
|
#if LV_USE_KEYBOARD != 0
|
||||||
|
lv_keyboard_set_textarea(kb, ta);
|
||||||
|
#endif
|
||||||
|
lv_obj_move_background(kb);
|
||||||
|
lv_obj_add_flag(kb, LV_OBJ_FLAG_HIDDEN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
__attribute__((unused)) void ta_event_cb_NUMBER (lv_event_t *e) {
|
||||||
|
lv_event_code_t code = lv_event_get_code(e);
|
||||||
|
#if LV_USE_KEYBOARD || LV_USE_ZH_KEYBOARD
|
||||||
|
lv_obj_t *ta = lv_event_get_target(e);
|
||||||
|
#endif
|
||||||
|
lv_obj_t *kb = lv_event_get_user_data(e);
|
||||||
|
if (code == LV_EVENT_FOCUSED || code == LV_EVENT_CLICKED)
|
||||||
|
{
|
||||||
|
#if LV_USE_ZH_KEYBOARD != 0
|
||||||
|
lv_zh_keyboard_set_textarea(kb, ta);
|
||||||
|
#endif
|
||||||
|
#if LV_USE_KEYBOARD != 0
|
||||||
|
lv_keyboard_set_textarea(kb, ta);
|
||||||
|
lv_keyboard_set_mode(kb, LV_KEYBOARD_MODE_NUMBER);
|
||||||
|
#endif
|
||||||
|
lv_obj_move_foreground(kb);
|
||||||
|
lv_obj_clear_flag(kb, LV_OBJ_FLAG_HIDDEN);
|
||||||
|
}
|
||||||
|
if (code == LV_EVENT_CANCEL || code == LV_EVENT_DEFOCUSED)
|
||||||
|
{
|
||||||
|
|
||||||
#if LV_USE_ZH_KEYBOARD != 0
|
#if LV_USE_ZH_KEYBOARD != 0
|
||||||
lv_zh_keyboard_set_textarea(kb, ta);
|
lv_zh_keyboard_set_textarea(kb, ta);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ extern "C" {
|
|||||||
|
|
||||||
__attribute__((unused)) void kb_event_cb(lv_event_t *e);
|
__attribute__((unused)) void kb_event_cb(lv_event_t *e);
|
||||||
__attribute__((unused)) void ta_event_cb(lv_event_t *e);
|
__attribute__((unused)) void ta_event_cb(lv_event_t *e);
|
||||||
|
__attribute__((unused)) void ta_event_cb_NUMBER (lv_event_t *e);
|
||||||
#if LV_USE_ANALOGCLOCK != 0
|
#if LV_USE_ANALOGCLOCK != 0
|
||||||
void clock_count(int *hour, int *min, int *sec);
|
void clock_count(int *hour, int *min, int *sec);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -94,10 +94,7 @@ void setup_s_screen(lv_ui *ui)
|
|||||||
lv_obj_add_flag(ui->screen_inf_lock, LV_OBJ_FLAG_HIDDEN);
|
lv_obj_add_flag(ui->screen_inf_lock, LV_OBJ_FLAG_HIDDEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
update_led_i();
|
update_io_ui();
|
||||||
update_led_o();
|
|
||||||
|
|
||||||
update_io_labels();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void time_update_timer_cb(lv_timer_t * timer)
|
static void time_update_timer_cb(lv_timer_t * timer)
|
||||||
|
|||||||
@@ -368,25 +368,25 @@ IO_STEP_DATA step_csv_to_table(const char *csv_data) {
|
|||||||
}
|
}
|
||||||
//数据组信息
|
//数据组信息
|
||||||
temp.RUN = 0;
|
temp.RUN = 0;
|
||||||
rt_snprintf(temp.Dyelot ,1,csv_get_cell(user, 1, 0));
|
rt_snprintf(temp.Dyelot ,sizeof(temp.Dyelot),csv_get_cell(user, 1, 0));
|
||||||
rt_snprintf(temp.StepID ,3,csv_get_cell(user, 1, 1));
|
rt_snprintf(temp.StepID ,sizeof(temp.StepID),csv_get_cell(user, 1, 1));
|
||||||
rt_snprintf(temp.StepID_S1 ,3,csv_get_cell(user, 1, 2));
|
rt_snprintf(temp.StepID_S1 ,sizeof(temp.StepID_S1),csv_get_cell(user, 1, 2));
|
||||||
rt_snprintf(temp.StepID_S2 ,3,csv_get_cell(user, 1, 3));
|
rt_snprintf(temp.StepID_S2 ,sizeof(temp.StepID_S2),csv_get_cell(user, 1, 3));
|
||||||
temp.Parameter1 = atof(csv_get_cell(user, 1, 4));
|
temp.Parameter1 = atoi(csv_get_cell(user, 1, 4));
|
||||||
temp.Parameter2 = atof(csv_get_cell(user, 1, 5));
|
temp.Parameter2 = atoi(csv_get_cell(user, 1, 5));
|
||||||
temp.Parameter3 = atof(csv_get_cell(user, 1, 6));
|
temp.Parameter3 = atoi(csv_get_cell(user, 1, 6));
|
||||||
temp.Parameter4 = atof(csv_get_cell(user, 1, 7));
|
temp.Parameter4 = atoi(csv_get_cell(user, 1, 7));
|
||||||
temp.Parameter5 = atof(csv_get_cell(user, 1, 8));
|
temp.Parameter5 = atoi(csv_get_cell(user, 1, 8));
|
||||||
temp.Parameter1_S1 = atof(csv_get_cell(user, 1, 9));
|
temp.Parameter1_S1 = atoi(csv_get_cell(user, 1, 9));
|
||||||
temp.Parameter2_S1 = atof(csv_get_cell(user, 1, 10));
|
temp.Parameter2_S1 = atoi(csv_get_cell(user, 1, 10));
|
||||||
temp.Parameter3_S1 = atof(csv_get_cell(user, 1, 11));
|
temp.Parameter3_S1 = atoi(csv_get_cell(user, 1, 11));
|
||||||
temp.Parameter4_S1 = atof(csv_get_cell(user, 1, 12));
|
temp.Parameter4_S1 = atoi(csv_get_cell(user, 1, 12));
|
||||||
temp.Parameter5_S1 = atof(csv_get_cell(user, 1, 13));
|
temp.Parameter5_S1 = atoi(csv_get_cell(user, 1, 13));
|
||||||
temp.Parameter1_S2 = atof(csv_get_cell(user, 1, 14));
|
temp.Parameter1_S2 = atoi(csv_get_cell(user, 1, 14));
|
||||||
temp.Parameter2_S2 = atof(csv_get_cell(user, 1, 15));
|
temp.Parameter2_S2 = atoi(csv_get_cell(user, 1, 15));
|
||||||
temp.Parameter3_S2 = atof(csv_get_cell(user, 1, 16));
|
temp.Parameter3_S2 = atoi(csv_get_cell(user, 1, 16));
|
||||||
temp.Parameter4_S2 = atof(csv_get_cell(user, 1, 17));
|
temp.Parameter4_S2 = atoi(csv_get_cell(user, 1, 17));
|
||||||
temp.Parameter5_S2 = atof(csv_get_cell(user, 1, 18));
|
temp.Parameter5_S2 = atoi(csv_get_cell(user, 1, 18));
|
||||||
|
|
||||||
// 释放内存
|
// 释放内存
|
||||||
rt_memheap_free(user);
|
rt_memheap_free(user);
|
||||||
|
|||||||
@@ -23,8 +23,9 @@
|
|||||||
#include <ui_data_labels.h>
|
#include <ui_data_labels.h>
|
||||||
#include "libcsv.h"
|
#include "libcsv.h"
|
||||||
|
|
||||||
|
|
||||||
// 全局或静态数组
|
// 全局或静态数组
|
||||||
|
char io_ui_size =0;
|
||||||
|
char io_ui_show=0;
|
||||||
char buf[8];
|
char buf[8];
|
||||||
lv_obj_t *di_led_array[64];
|
lv_obj_t *di_led_array[64];
|
||||||
lv_obj_t *do_led_array[64];
|
lv_obj_t *do_led_array[64];
|
||||||
@@ -263,6 +264,28 @@ void update_led_o(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void update_io_ui(void)
|
||||||
|
{
|
||||||
|
if(io_ui_show==1)
|
||||||
|
{
|
||||||
|
switch (io_ui_size)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
update_led_i();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
update_led_o();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
update_io_labels();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前时间字符串,格式:2025/01/25 13:55:11
|
* 获取当前时间字符串,格式:2025/01/25 13:55:11
|
||||||
* @param buf 输出缓冲区
|
* @param buf 输出缓冲区
|
||||||
|
|||||||
@@ -91,15 +91,15 @@ extern WorkOrder_DATA_tab * WorkDATA_tab;
|
|||||||
extern Program_DATA_tab * ProgramDATA_tab;
|
extern Program_DATA_tab * ProgramDATA_tab;
|
||||||
extern STEP_DATA_tab * StepDATA_tab;
|
extern STEP_DATA_tab * StepDATA_tab;
|
||||||
|
|
||||||
|
extern char io_ui_size;
|
||||||
|
extern char io_ui_show;
|
||||||
extern lv_obj_t *di_led_array[64];
|
extern lv_obj_t *di_led_array[64];
|
||||||
extern lv_obj_t *do_led_array[64];
|
extern lv_obj_t *do_led_array[64];
|
||||||
extern lv_obj_t *di_labels[24]; // DI: AIO4001 ~ AIO4024 (24个)
|
extern lv_obj_t *di_labels[24]; // DI: AIO4001 ~ AIO4024 (24个)
|
||||||
extern lv_obj_t *do_labels[16]; // DO: AIO5001 ~ AIO5016 (16个)
|
extern lv_obj_t *do_labels[16]; // DO: AIO5001 ~ AIO5016 (16个)
|
||||||
|
|
||||||
void ui_init_io(lv_ui *ui);
|
void ui_init_io(lv_ui *ui);
|
||||||
void update_io_labels(void);
|
void update_io_ui(void);
|
||||||
void update_led_i(void);
|
|
||||||
void update_led_o(void);
|
|
||||||
|
|
||||||
char* get_time_str(char *buf, size_t size);
|
char* get_time_str(char *buf, size_t size);
|
||||||
|
|
||||||
@@ -123,5 +123,6 @@ void UI_pname_new();
|
|||||||
#include <data/SC828_DATA_table.h>
|
#include <data/SC828_DATA_table.h>
|
||||||
|
|
||||||
void STEP_DATA_set_ui(IO_STEP_DATA* STEPDATA_inf);
|
void STEP_DATA_set_ui(IO_STEP_DATA* STEPDATA_inf);
|
||||||
|
void STEP_DATA_set_ui_w();
|
||||||
|
|
||||||
#endif /* APPLICATIONS_LVGL_UI_DATA_LABELS_H_ */
|
#endif /* APPLICATIONS_LVGL_UI_DATA_LABELS_H_ */
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
#include <applications/data/Variable.h>
|
#include <applications/data/Variable.h>
|
||||||
#include <board.h>
|
#include <board.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <guider/custom/custom.h>
|
#include <guider/custom/custom.h>
|
||||||
@@ -22,9 +23,18 @@
|
|||||||
#include <ui_data_labels.h>
|
#include <ui_data_labels.h>
|
||||||
#include "libcsv.h"
|
#include "libcsv.h"
|
||||||
|
|
||||||
// 全局或静态数组
|
typedef struct {
|
||||||
|
char STEPNAME[16];
|
||||||
|
char STEPID[4];
|
||||||
|
} step_DATA_tab;
|
||||||
|
|
||||||
extern struct rt_memheap sram_SRAM1,sdram_heap;
|
//
|
||||||
|
int STEP_SET_MODE=-1;//页面功能状态
|
||||||
|
char ProgramID[32];
|
||||||
|
char stepsql[512] = {0}; // 初始化为 0
|
||||||
|
step_DATA_tab STEP_NAME_S1;
|
||||||
|
step_DATA_tab STEP_NAME_S2;
|
||||||
|
step_DATA_tab STEP_NAME_S3;
|
||||||
|
|
||||||
static const int get_step_name(char * step_id)
|
static const int get_step_name(char * step_id)
|
||||||
{
|
{
|
||||||
@@ -77,20 +87,319 @@ static const int get_step_namer(char * step_id)
|
|||||||
default: return 9;
|
default: return 9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void get_step_sql(int id_num)
|
||||||
|
{
|
||||||
|
switch(id_num) {
|
||||||
|
// --- 基础控制 ---
|
||||||
|
case 0:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"温度控制");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"001");
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"水位进水");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"007");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"流量进水");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"008");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"水位水洗");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"013");
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"溢流水洗");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"015");
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"排水");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"020");
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"主泵排水");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"022");
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"运转");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"031");
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"入布");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"035");
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"出布");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"036");
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"呼叫操作员");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"039");
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"取样");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"040");
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"程序结束");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"041");
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"等待");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"049");
|
||||||
|
break;
|
||||||
|
case 14:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"加压");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"050");
|
||||||
|
break;
|
||||||
|
case 15:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"减压");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"051");
|
||||||
|
break;
|
||||||
|
case 16:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"泵风机速度");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"054");
|
||||||
|
break;
|
||||||
|
case 17:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"泵启动");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"055");
|
||||||
|
break;
|
||||||
|
case 18:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"泵停止");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"056");
|
||||||
|
break;
|
||||||
|
case 19:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"备药");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"064");
|
||||||
|
break;
|
||||||
|
case 20:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"加药");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"065");
|
||||||
|
break;
|
||||||
|
case 21:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"呼叫输送");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"066");
|
||||||
|
break;
|
||||||
|
case 22:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"呼叫准备");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"067");
|
||||||
|
break;
|
||||||
|
case 23:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"快速加酸");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"090");
|
||||||
|
break;
|
||||||
|
case 24:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"ph检测");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"093");
|
||||||
|
break;
|
||||||
|
case 25:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"ph控制");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"094");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPNAME, sizeof(STEP_NAME_S1.STEPNAME),"");
|
||||||
|
rt_snprintf(STEP_NAME_S1.STEPID, sizeof(STEP_NAME_S1.STEPID),"000");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static void get_step_sqlr2(int id_num)
|
||||||
|
{
|
||||||
|
switch(id_num) {
|
||||||
|
// --- 基础控制 ---
|
||||||
|
case 0:
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"降温水洗");
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"017");
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"加压");
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"050");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"减压");
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"051");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"备药");
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"064");
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"呼叫输送");
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"066");
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"快速加酸");
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"090");
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"温控加酸");
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"091");
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"ph检测");
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"093");
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"ph控制");
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"094");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPNAME, sizeof(STEP_NAME_S2.STEPNAME),"");
|
||||||
|
rt_snprintf(STEP_NAME_S2.STEPID, sizeof(STEP_NAME_S2.STEPID),"000");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static void get_step_sqlr3(int id_num)
|
||||||
|
{
|
||||||
|
switch(id_num) {
|
||||||
|
// --- 基础控制 ---
|
||||||
|
case 0:
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"降温水洗");
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"017");
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"加压");
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"050");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"减压");
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"051");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"备药");
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"064");
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"呼叫输送");
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"066");
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"快速加酸");
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"090");
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"温控加酸");
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"091");
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"ph检测");
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"093");
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"ph控制");
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"094");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPNAME, sizeof(STEP_NAME_S3.STEPNAME),"");
|
||||||
|
rt_snprintf(STEP_NAME_S3.STEPID, sizeof(STEP_NAME_S3.STEPID),"000");
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 数据信息显示
|
* 数据信息显示
|
||||||
**/
|
**/
|
||||||
#include "sql/DB_SQLite.h"
|
#include "sql/DB_SQLite.h"
|
||||||
#include"ui_data_csv.h"
|
#include"ui_data_csv.h"
|
||||||
|
|
||||||
|
//数字格式化
|
||||||
|
void str_step_ui(char *buffer,double scaled_val)
|
||||||
|
{
|
||||||
|
int integer_part = (int) scaled_val;
|
||||||
|
int fractional_part = (int)((scaled_val * 10)-(integer_part*10));
|
||||||
|
|
||||||
|
if (fractional_part == 0) {
|
||||||
|
lv_snprintf(buffer, sizeof(buffer), "%d", integer_part);
|
||||||
|
} else {
|
||||||
|
lv_snprintf(buffer, sizeof(buffer), "%d.%d", integer_part, fractional_part);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void STEP_DATA_set_ui(IO_STEP_DATA* STEPDATA_inf)
|
void STEP_DATA_set_ui(IO_STEP_DATA* STEPDATA_inf)
|
||||||
{
|
{
|
||||||
|
//步骤信息页面填入
|
||||||
char str_str[4];
|
char str_str[4];
|
||||||
|
char str_step[5];
|
||||||
|
|
||||||
lv_snprintf(str_str, sizeof(str_str), "%03d", STEPDATA_inf->Step);
|
lv_snprintf(str_str, sizeof(str_str), "%03d", STEPDATA_inf->Step);
|
||||||
lv_label_set_text(guider_ui.screen_stepinf_step,(const char *)str_str);
|
lv_label_set_text(guider_ui.screen_stepinf_step,(const char *)str_str);
|
||||||
|
lv_snprintf(ProgramID, sizeof(ProgramID), STEPDATA_inf->Dyelot);
|
||||||
lv_label_set_text(guider_ui.screen_stepinf_name,(const char *)STEPDATA_inf->Program);
|
lv_label_set_text(guider_ui.screen_stepinf_name,(const char *)STEPDATA_inf->Program);
|
||||||
lv_dropdown_set_selected(guider_ui.screen_stepinf_s1,get_step_name(STEPDATA_inf->StepID));
|
lv_dropdown_set_selected(guider_ui.screen_stepinf_s1,get_step_name(STEPDATA_inf->StepID));
|
||||||
lv_dropdown_set_selected(guider_ui.screen_stepinf_s2,get_step_namer(STEPDATA_inf->StepID_S1));
|
lv_dropdown_set_selected(guider_ui.screen_stepinf_s2,get_step_namer(STEPDATA_inf->StepID_S1));
|
||||||
lv_dropdown_set_selected(guider_ui.screen_stepinf_s3,get_step_namer(STEPDATA_inf->StepID_S2));
|
lv_dropdown_set_selected(guider_ui.screen_stepinf_s3,get_step_namer(STEPDATA_inf->StepID_S2));
|
||||||
|
str_step_ui(str_step, STEPDATA_inf->Parameter1);
|
||||||
|
lv_textarea_set_text(guider_ui.screen_stepinf_p1,(const char *)str_step);
|
||||||
|
str_step_ui(str_step, STEPDATA_inf->Parameter2);
|
||||||
|
lv_textarea_set_text(guider_ui.screen_stepinf_p2,(const char *)str_step);
|
||||||
|
str_step_ui(str_step, STEPDATA_inf->Parameter3);
|
||||||
|
lv_textarea_set_text(guider_ui.screen_stepinf_p3,(const char *)str_step);
|
||||||
|
str_step_ui(str_step, STEPDATA_inf->Parameter4);
|
||||||
|
lv_textarea_set_text(guider_ui.screen_stepinf_p4,(const char *)str_step);
|
||||||
|
str_step_ui(str_step, STEPDATA_inf->Parameter5);
|
||||||
|
lv_textarea_set_text(guider_ui.screen_stepinf_p5,(const char *)str_step);
|
||||||
|
str_step_ui(str_step, STEPDATA_inf->Parameter1_S1);
|
||||||
|
lv_textarea_set_text(guider_ui.screen_stepinf_p1b1,(const char *)str_step);
|
||||||
|
str_step_ui(str_step, STEPDATA_inf->Parameter2_S1);
|
||||||
|
lv_textarea_set_text(guider_ui.screen_stepinf_p2b1,(const char *)str_step);
|
||||||
|
str_step_ui(str_step, STEPDATA_inf->Parameter3_S1);
|
||||||
|
lv_textarea_set_text(guider_ui.screen_stepinf_p3b1,(const char *)str_step);
|
||||||
|
str_step_ui(str_step, STEPDATA_inf->Parameter4_S1);
|
||||||
|
lv_textarea_set_text(guider_ui.screen_stepinf_p4b1,(const char *)str_step);
|
||||||
|
str_step_ui(str_step, STEPDATA_inf->Parameter5_S1);
|
||||||
|
lv_textarea_set_text(guider_ui.screen_stepinf_p5b1,(const char *)str_step);
|
||||||
|
str_step_ui(str_step, STEPDATA_inf->Parameter1_S2);
|
||||||
|
lv_textarea_set_text(guider_ui.screen_stepinf_p1b2,(const char *)str_step);
|
||||||
|
str_step_ui(str_step, STEPDATA_inf->Parameter2_S2);
|
||||||
|
lv_textarea_set_text(guider_ui.screen_stepinf_p2b2,(const char *)str_step);
|
||||||
|
str_step_ui(str_step, STEPDATA_inf->Parameter3_S2);
|
||||||
|
lv_textarea_set_text(guider_ui.screen_stepinf_p3b2,(const char *)str_step);
|
||||||
|
str_step_ui(str_step, STEPDATA_inf->Parameter4_S2);
|
||||||
|
lv_textarea_set_text(guider_ui.screen_stepinf_p4b2,(const char *)str_step);
|
||||||
|
str_step_ui(str_step, STEPDATA_inf->Parameter5_S2);
|
||||||
|
lv_textarea_set_text(guider_ui.screen_stepinf_p5b2,(const char *)str_step);
|
||||||
|
|
||||||
|
lv_obj_clear_flag(guider_ui.screen_stepinf_s1b, LV_OBJ_FLAG_HIDDEN);
|
||||||
|
|
||||||
|
STEP_SET_MODE=0;//程序页面步骤修改
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void STEP_DATA_set_ui_w()
|
||||||
|
{
|
||||||
|
get_step_sql(lv_dropdown_get_selected (guider_ui.screen_stepinf_s1));
|
||||||
|
get_step_sqlr2(lv_dropdown_get_selected (guider_ui.screen_stepinf_s2));
|
||||||
|
get_step_sqlr3(lv_dropdown_get_selected (guider_ui.screen_stepinf_s3));
|
||||||
|
switch(STEP_SET_MODE){
|
||||||
|
case 0:
|
||||||
|
rt_snprintf(stepsql, sizeof(stepsql),"UPDATE ProgramSteps "
|
||||||
|
"SET StepID='%s',StepName='%s',StepID_S1='%s',StepID_S2='%s',"
|
||||||
|
"StepName_S1='%s',StepName_S1='%s',"
|
||||||
|
"P1=%s,P2=%s,P3=%s,P4=%s,P5=%s,"
|
||||||
|
"P1_S1=%s,P2_S1=%s,P3_S1=%s,P4_S1=%s,P5_S1=%s,"
|
||||||
|
"P1_S2=%s,P2_S2=%s,P3_S2=%s,P4_S2=%s,P5_S2=%s "
|
||||||
|
"WHERE Program='%s' and Step=%d;",
|
||||||
|
STEP_NAME_S1.STEPID,STEP_NAME_S1.STEPNAME,
|
||||||
|
STEP_NAME_S2.STEPID,STEP_NAME_S3.STEPID,
|
||||||
|
STEP_NAME_S2.STEPNAME,STEP_NAME_S3.STEPNAME,
|
||||||
|
lv_textarea_get_text(guider_ui.screen_stepinf_p1),
|
||||||
|
lv_textarea_get_text(guider_ui.screen_stepinf_p2),
|
||||||
|
lv_textarea_get_text(guider_ui.screen_stepinf_p3),
|
||||||
|
lv_textarea_get_text(guider_ui.screen_stepinf_p4),
|
||||||
|
lv_textarea_get_text(guider_ui.screen_stepinf_p5),
|
||||||
|
lv_textarea_get_text(guider_ui.screen_stepinf_p1b1),
|
||||||
|
lv_textarea_get_text(guider_ui.screen_stepinf_p2b1),
|
||||||
|
lv_textarea_get_text(guider_ui.screen_stepinf_p3b1),
|
||||||
|
lv_textarea_get_text(guider_ui.screen_stepinf_p4b1),
|
||||||
|
lv_textarea_get_text(guider_ui.screen_stepinf_p5b1),
|
||||||
|
lv_textarea_get_text(guider_ui.screen_stepinf_p1b2),
|
||||||
|
lv_textarea_get_text(guider_ui.screen_stepinf_p2b2),
|
||||||
|
lv_textarea_get_text(guider_ui.screen_stepinf_p3b2),
|
||||||
|
lv_textarea_get_text(guider_ui.screen_stepinf_p4b2),
|
||||||
|
lv_textarea_get_text(guider_ui.screen_stepinf_p5b2),
|
||||||
|
lv_label_get_text(guider_ui.screen_stepinf_name),
|
||||||
|
atoi(lv_label_get_text(guider_ui.screen_stepinf_step)));
|
||||||
|
if( db_send_command(DB_CMD_EXEC, stepsql, 500)==RT_EOK) //
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default: ;
|
||||||
|
}
|
||||||
|
STEP_SET_MODE=-1;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user