Issue #28: Change GUI of profile executer

This commit is contained in:
Mario Hüttel 2021-04-06 19:46:31 +02:00
parent 7c9d296e34
commit 08eee66d30

View File

@ -430,22 +430,31 @@ static void gui_menu_temp_profile_execute(struct lcd_menu *menu, enum menu_entry
if (systick_ticks_have_passed(last_tick, 250)) {
state = temp_profile_executer_status();
if (state->status == TPE_RUNNING)
menu_lcd_outputf(menu, 0, "Profile running");
else if (state->status == TPE_OFF) {
menu_lcd_outputf(menu, 0, "Profile finished");
} else {
menu_lcd_outputf(menu, 0, "Profile aborted!");
}
if (state->status == TPE_RUNNING) {
menu_lcd_outputf(menu, 0, "Executing...");
menu_lcd_outputf(menu, 1, "Step %u/%u", state->step, state->profile_steps);
(void)adc_pt1000_get_current_resistance(&resistance);
res = temp_converter_convert_resistance_to_temp(resistance, &temperature);
menu_lcd_outputf(menu, 2, "Temp: %s%.1f", (res < 0 ? "<" : (res > 0 ? ">" : "")), temperature);
menu_lcd_outputf(menu, 2, "Temp: %s%.1f " LCD_DEGREE_SYMBOL_STRING "C",
(res < 0 ? "<" : (res > 0 ? ">" : "")), temperature);
if (oven_pid_get_status() == OVEN_PID_RUNNING) {
menu_lcd_outputf(menu, 3, "Target: %.0f", state->setpoint);
menu_lcd_outputf(menu, 3, "Target: %.0f " LCD_DEGREE_SYMBOL_STRING "C", state->setpoint);
} else {
menu_lcd_outputf(menu, 3, "Temp Off");
}
} else if (state->status == TPE_OFF) {
menu_lcd_outputf(menu, 0, "Finished!");
menu_lcd_outputf(menu, 1, "Press button");
menu_lcd_outputf(menu, 2, "to return.");
(void)adc_pt1000_get_current_resistance(&resistance);
res = temp_converter_convert_resistance_to_temp(resistance, &temperature);
menu_lcd_outputf(menu, 3, "Temp: %.1f ", LCD_DEGREE_SYMBOL_STRING "C");
} else {
menu_lcd_outputf(menu, 0, "Profile aborted!");
menu_lcd_outputf(menu, 1, "Check flags!");
menu_lcd_outputf(menu, 2, "");
menu_lcd_outputf(menu, 3, "Press button");
}
last_tick = systick_get_global_tick();
}
@ -630,6 +639,7 @@ static void gui_menu_root_entry(struct lcd_menu *menu, enum menu_entry_func_entr
push_button = menu_get_button_state(menu);
rot_delta = menu_get_rotary_delta(menu);
if (menu_get_button_ready_state(menu)) {
if (menu_get_button_ready_state(menu) && push_button == BUTTON_SHORT_RELEASED) {
/* Enter currently selected menu_entry */
menu_list_enter_selected_entry(&list, menu);
@ -644,6 +654,7 @@ static void gui_menu_root_entry(struct lcd_menu *menu, enum menu_entry_func_entr
menu_ack_rotary_delta(menu);
menu_changed = true;
}
}
if (menu_changed)
menu_list_display(&list, 1, 3);