You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.9 KiB
61 lines
1.9 KiB
2 years ago
|
#include <stdio.h>
|
||
|
#include <string.h>
|
||
|
#include "app_gui.h"
|
||
|
#include "gui_event.h"
|
||
|
#include "ds_rtc.h"
|
||
|
#include "app_io.h"
|
||
|
#include "lcd.h"
|
||
|
#include "app_config.h"
|
||
|
|
||
|
void screen_program_prehled(GuiEvent event)
|
||
|
{
|
||
|
char buf[100];
|
||
|
|
||
|
switch (event) {
|
||
|
case GUI_EVENT_SCREEN_INIT:
|
||
|
break;
|
||
|
|
||
|
case GUI_EVENT_PAINT:
|
||
|
LcdBuffer_Write(&lcd, 0, 0, "Zvolte slot ke změně");
|
||
|
|
||
|
if (settings_scratch.schedules[0].enable) {
|
||
|
snprintf(buf, 100, "1. %02d:%02d ", settings_scratch.schedules[0].h, settings_scratch.schedules[0].m);
|
||
|
} else {
|
||
|
snprintf(buf, 100, "1. --:-- ");
|
||
|
}
|
||
|
if (settings_scratch.schedules[2].enable) {
|
||
|
snprintf(buf+10, 90, "3. %02d:%02d ", settings_scratch.schedules[2].h, settings_scratch.schedules[2].m);
|
||
|
} else {
|
||
|
snprintf(buf+10, 90, "3. --:-- ");
|
||
|
}
|
||
|
LcdBuffer_Write(&lcd, 1, 0, buf);
|
||
|
|
||
|
if (settings_scratch.schedules[1].enable) {
|
||
|
snprintf(buf, 100, "2. %02d:%02d ", settings_scratch.schedules[1].h, settings_scratch.schedules[1].m);
|
||
|
} else {
|
||
|
snprintf(buf, 100, "2. --:-- ");
|
||
|
}
|
||
|
if (settings_scratch.schedules[3].enable) {
|
||
|
snprintf(buf+10, 90, "4. %02d:%02d ", settings_scratch.schedules[3].h, settings_scratch.schedules[3].m);
|
||
|
} else {
|
||
|
snprintf(buf+10, 90, "4. --:-- ");
|
||
|
}
|
||
|
LcdBuffer_Write(&lcd, 2, 0, buf);
|
||
|
|
||
|
LcdBuffer_Write(&lcd, 3, 0, "🅳Zpět");
|
||
|
break;
|
||
|
|
||
|
case GUI_EVENT_KEY_D: // CANCEL
|
||
|
switch_screen(screen_settings, false);
|
||
|
break;
|
||
|
|
||
|
case GUI_EVENT_KEY_1:
|
||
|
case GUI_EVENT_KEY_2:
|
||
|
case GUI_EVENT_KEY_3:
|
||
|
case GUI_EVENT_KEY_4:
|
||
|
pgm_edit_slot = event - '1'; // 0-3
|
||
|
switch_screen(screen_program_edit, true);
|
||
|
break;
|
||
|
}
|
||
|
}
|