update gui layout

This commit is contained in:
Shuanglei Tao
2025-10-13 08:30:37 +08:00
parent c1d81ed0ae
commit b53fa53389
7 changed files with 329 additions and 66 deletions

View File

@@ -359,6 +359,71 @@ void GFX_drawLine(Adafruit_GFX *gfx, int16_t x0, int16_t y0, int16_t x1, int16_t
}
}
}
/**************************************************************************/
/*!
@brief Draw a dotted line. Bresenham's algorithm - thx wikpedia
@param x0 Start point x coordinate
@param y0 Start point y coordinate
@param x1 End point x coordinate
@param y1 End point y coordinate
@param color 16-bit 5-6-5 Color to draw with
*/
/**************************************************************************/
void GFX_drawDottedLine(Adafruit_GFX *gfx, int16_t x0, int16_t y0, int16_t x1, int16_t y1,
uint16_t color, uint8_t dot_len, uint8_t space_len) {
int16_t steep = ABS(y1 - y0) > ABS(x1 - x0);
if (steep) {
SWAP(x0, y0, int16_t);
SWAP(x1, y1, int16_t);
}
if (x0 > x1) {
SWAP(x0, x1, int16_t);
SWAP(y0, y1, int16_t);
}
int16_t dx, dy;
dx = x1 - x0;
dy = ABS(y1 - y0);
int16_t err = dx / 2;
int16_t ystep;
if (y0 < y1) {
ystep = 1;
} else {
ystep = -1;
}
uint8_t draw = 1;
uint8_t len = 0;
for (; x0 <= x1; x0++) {
if (draw) {
if (steep) {
GFX_drawPixel(gfx, y0, x0, color);
} else {
GFX_drawPixel(gfx, x0, y0, color);
}
len++;
if (len >= dot_len) {
len = 0;
draw = 0;
}
} else {
len++;
if (len >= space_len) {
len = 0;
draw = 1;
}
}
err -= dy;
if (err < 0) {
y0 += ystep;
err += dx;
}
}
}
/**************************************************************************/
/*!
@@ -860,6 +925,10 @@ int8_t GFX_getFontDescent(Adafruit_GFX *gfx) {
return gfx->u8g2.font_info.descent_g;
}
int8_t GFX_getFontHeight(Adafruit_GFX *gfx) {
return gfx->u8g2.font_info.ascent_A - gfx->u8g2.font_info.descent_g;
}
int16_t GFX_drawGlyph(Adafruit_GFX *gfx, int16_t x, int16_t y, uint16_t e) {
return u8g2_DrawGlyph(&gfx->u8g2, x, y, e);
}
@@ -992,6 +1061,35 @@ int16_t GFX_getUTF8Width(Adafruit_GFX *gfx, const char *str)
return w;
}
int16_t GFX_getUTF8Widthf(Adafruit_GFX *gfx, const char* format, ...)
{
char buf[64] = {0};
char *str = buf;
size_t len;
va_list va;
va_start(va, format);
len = vsnprintf(buf, sizeof(buf), format, va);
va_end(va);
if (len > sizeof(buf) - 1)
{
str = malloc(len + 1);
if (str == NULL)
return 0;
va_start(va, format);
vsnprintf(str, len + 1, format, va);
va_end(va);
}
int16_t w = GFX_getUTF8Width(gfx, str);
if (str != buf)
free(str);
return w;
}
size_t GFX_print(Adafruit_GFX *gfx, const char c) {
int16_t delta;
uint16_t e = utf8_next(gfx, (uint8_t)c);

View File

@@ -57,6 +57,8 @@ void GFX_end(Adafruit_GFX *gfx);
// DRAW API
void GFX_drawPixel(Adafruit_GFX *gfx, int16_t x, int16_t y, uint16_t color);
void GFX_drawLine(Adafruit_GFX *gfx, int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
void GFX_drawDottedLine(Adafruit_GFX *gfx, int16_t x0, int16_t y0, int16_t x1, int16_t y1,
uint16_t color, uint8_t dot_len, uint8_t space_len);
void GFX_drawFastVLine(Adafruit_GFX *gfx, int16_t x, int16_t y, int16_t h, uint16_t color);
void GFX_drawFastHLine(Adafruit_GFX *gfx, int16_t x, int16_t y, int16_t w, uint16_t color);
void GFX_fillRect(Adafruit_GFX *gfx, int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
@@ -87,10 +89,12 @@ void GFX_setFontDirection(Adafruit_GFX *gfx, GFX_Rotate d);
void GFX_setTextColor(Adafruit_GFX *gfx, uint16_t fg, uint16_t bg);
int8_t GFX_getFontAscent(Adafruit_GFX *gfx);
int8_t GFX_getFontDescent(Adafruit_GFX *gfx);
int8_t GFX_getFontHeight(Adafruit_GFX *gfx);
int16_t GFX_drawGlyph(Adafruit_GFX *gfx, int16_t x, int16_t y, uint16_t e);
int16_t GFX_drawStr(Adafruit_GFX *gfx, int16_t x, int16_t y, const char *s);
int16_t GFX_drawUTF8(Adafruit_GFX *gfx, int16_t x, int16_t y, const char *str);
int16_t GFX_getUTF8Width(Adafruit_GFX *gfx, const char *str);
int16_t GFX_getUTF8Widthf(Adafruit_GFX *gfx, const char* format, ...);
size_t GFX_print(Adafruit_GFX *gfx, const char c);
size_t GFX_write(Adafruit_GFX *gfx, const char *buffer, size_t size);
size_t GFX_printf(Adafruit_GFX *gfx, const char* format, ...);

116
GUI/GUI.c
View File

@@ -144,10 +144,10 @@ static void DrawTimeSyncTip(Adafruit_GFX *gfx, gui_data_t *data)
GFX_fillRect(gfx, box_x, box_y, box_w, box_h, GFX_WHITE);
GFX_drawRoundRect(gfx, box_x, box_y, box_w, box_h, 5, GFX_BLACK);
GFX_setTextColor(gfx, GFX_RED, GFX_WHITE);
GFX_setCursor(gfx, box_x + (box_w - GFX_getUTF8Width(gfx, title)) / 2, 145);
GFX_setCursor(gfx, box_x + (box_w - GFX_getUTF8Width(gfx, title)) / 2, box_y + 20);
GFX_printf(gfx, title);
GFX_setTextColor(gfx, GFX_BLACK, GFX_WHITE);
GFX_setCursor(gfx, box_x + 10, 164);
GFX_setCursor(gfx, box_x + 10, box_y + 35);
GFX_printf(gfx, url);
}
@@ -204,23 +204,25 @@ static void DrawDateHeader(Adafruit_GFX *gfx, int16_t x, int16_t y, tm_t *tm, st
GFX_printf(gfx, " [%s]", Lunar_ZodiacString[LUNAR_GetZodiac(Lunar)]);
GFX_setTextColor(gfx, GFX_BLACK, GFX_WHITE);
DrawBattery(gfx, data->width - 10 - 2, 6, 20, data->voltage);
DrawBattery(gfx, data->width - 10 - 2, data->height > 300 ? 16 : 6, 20, data->voltage);
GFX_setCursor(gfx, data->width - GFX_getUTF8Width(gfx, data->ssid) - 10, y);
GFX_printf(gfx, "%s", data->ssid);
}
static void DrawWeekHeader(Adafruit_GFX *gfx, int16_t x, int16_t y, gui_data_t *data)
{
GFX_setFont(gfx, u8g2_font_wqy9_t_lunar);
GFX_setFont(gfx, data->height > 300 ? u8g2_font_wqy12_t_lunar : u8g2_font_wqy9_t_lunar);
uint8_t w = (data->width - 2 * x) / 7;
uint8_t h = data->height > 300 ? 32 : 24;
uint8_t r = (data->width - 2 * x) % 7;
uint8_t fh = (h - GFX_getFontHeight(gfx)) / 2 + GFX_getFontAscent(gfx) + 1;
int16_t cw = GFX_getUTF8Width(gfx, Lunar_DayString[0]);
for (int i = 0; i < 7; i++) {
uint8_t day = (data->week_start + i) % 7;
uint16_t bg = (day == 0 || day == 6) ? GFX_RED : GFX_BLACK;
GFX_fillRect(gfx, x + i * w, y, i == 6 ? (w + r) : w, 24, bg);
GFX_fillRect(gfx, x + i * w, y, i == 6 ? (w + r) : w, h, bg);
GFX_setTextColor(gfx, GFX_WHITE, bg);
GFX_setCursor(gfx, x + (w - cw) / 2 + i * w, y + 16);
GFX_setCursor(gfx, x + (w - cw) / 2 + i * w, y + fh);
GFX_printf(gfx, "%s", Lunar_DayString[day]);
}
}
@@ -234,6 +236,14 @@ static void DrawMonthDays(Adafruit_GFX *gfx, int16_t x, int16_t y, tm_t *tm, str
int16_t bw = (data->width - x - 10) / 7;
int16_t bh = (data->height - y - 10) / monthDayRows;
bool large = data->height > 300;
if (large) {
for (uint8_t i = 1; i < monthDayRows; i++)
GFX_drawDottedLine(gfx, x, y + i * bh, x + 7 * bw - 1, y + i * bh, GFX_BLACK, 1, 5);
for (uint8_t i = 1; i < 7; i++)
GFX_drawDottedLine(gfx, x + i * bw, y, x + i * bw, y + monthDayRows * bh - 1, GFX_BLACK, 1, 5);
}
for (uint8_t i = 0; i < monthMaxDays; i++) {
uint16_t year = tm->tm_year + YEAR0;
@@ -244,45 +254,49 @@ static void DrawMonthDays(Adafruit_GFX *gfx, int16_t x, int16_t y, tm_t *tm, str
int16_t displayWeek = (adjustedFirstDay + i) % 7;
bool weekend = (actualWeek == 0) || (actualWeek == 6);
int16_t bx = x + 16 + displayWeek * bw;
int16_t by = y + 20 + (i + adjustedFirstDay) / 7 * (monthDayRows > 5 ? bh - 1 : bh);
LUNAR_SolarToLunar(Lunar, year, month, day);
int16_t cr = large ? 13 : 10;
int16_t bx = x + (bw - 2 * cr) / 2 + displayWeek * bw;
int16_t by = y + (bh - 2 * cr) / 2 + (i + adjustedFirstDay) / 7 * bh + 3;
if (day == tm->tm_mday) {
GFX_fillCircle(gfx, bx + 11, by + 11, 22, GFX_RED);
GFX_fillCircle(gfx, bx + cr, by + cr - 3, 2 * cr, GFX_RED);
GFX_setTextColor(gfx, GFX_WHITE, GFX_RED);
} else {
GFX_setTextColor(gfx, weekend ? GFX_RED : GFX_BLACK, GFX_WHITE);
}
GFX_setFont(gfx, u8g2_font_helvB14_tn);
GFX_setCursor(gfx, bx + (day < 10 ? 6 : 2), by + 10);
GFX_setFont(gfx, large ? u8g2_font_helvB18_tn : u8g2_font_helvB14_tn);
GFX_setCursor(gfx, bx + (2 * cr - GFX_getUTF8Widthf(gfx, "%d", day)) / 2, by - (cr - GFX_getFontHeight(gfx)));
GFX_printf(gfx, "%d", day);
GFX_setFont(gfx, u8g2_font_wqy9_t_lunar);
LUNAR_SolarToLunar(Lunar, year, month, day);
char festival[10] = {0};
GFX_setFont(gfx, large ? u8g2_font_wqy12_t_lunar : u8g2_font_wqy9_t_lunar);
GFX_setFontMode(gfx, 1); // transparent
if (GetFestival(year, month, day, actualWeek, Lunar, festival)) {
if (day != tm->tm_mday) GFX_setTextColor(gfx, GFX_RED, GFX_WHITE);
GFX_setCursor(gfx, strlen(festival) > 6 ? bx - 6 : bx, by + 24);
GFX_printf(gfx, "%s", festival);
} else {
if (Lunar->Date == 1) {
GFX_setCursor(gfx, bx - 5, by + 24);
GFX_printf(gfx, "%s%s", Lunar_MonthLeapString[Lunar->IsLeap], Lunar_MonthString[Lunar->Month]);
} else {
GFX_setCursor(gfx, bx, by + 24);
GFX_printf(gfx, "%s", Lunar_DateString[Lunar->Date]);
}
if (Lunar->Date == 1)
snprintf(festival, sizeof(festival), "%s%s", Lunar_MonthLeapString[Lunar->IsLeap], Lunar_MonthString[Lunar->Month]);
else
snprintf(festival, sizeof(festival), "%s", Lunar_DateString[Lunar->Date]);
}
GFX_setCursor(gfx, bx + (2 * cr - GFX_getUTF8Width(gfx, festival)) / 2, gfx->ty + GFX_getFontHeight(gfx) + 3);
GFX_printf(gfx, "%s", festival);
bool work = false;
if (year == HOLIDAY_YEAR && GetHoliday(month, day, &work)) {
if (day == tm->tm_mday) {
GFX_fillCircle(gfx, bx + 30, by + 1, 8, GFX_WHITE);
GFX_drawCircle(gfx, bx + 30, by + 1, 8, GFX_RED);
uint16_t rx = bx + (large ? 36 : 27);
uint16_t ry = by - 2;
uint8_t cr = large ? 10 : 8;
GFX_fillCircle(gfx, rx, ry, cr, GFX_WHITE);
GFX_drawCircle(gfx, rx, ry, cr, GFX_RED);
}
GFX_setFont(gfx, u8g2_font_wqy9_t_lunar);
GFX_setTextColor(gfx, work ? GFX_BLACK : GFX_RED, GFX_WHITE);
GFX_setCursor(gfx, bx + 25, by + 6);
GFX_setCursor(gfx, bx + (large ? 31 : 22), by + 3);
GFX_printf(gfx, "%s", work ? "" : "");
}
}
@@ -290,9 +304,10 @@ static void DrawMonthDays(Adafruit_GFX *gfx, int16_t x, int16_t y, tm_t *tm, str
static void DrawCalendar(Adafruit_GFX *gfx, tm_t *tm, struct Lunar_Date *Lunar, gui_data_t *data)
{
DrawDateHeader(gfx, 10, 28, tm, Lunar, data);
DrawWeekHeader(gfx, 10, 32, data);
DrawMonthDays(gfx, 10, 50, tm, Lunar, data);
bool large = data->height > 300;
DrawDateHeader(gfx, 10, large ? 38 : 28, tm, Lunar, data);
DrawWeekHeader(gfx, 10, large ? 44 : 32, data);
DrawMonthDays(gfx, 10, large ? 84 : 64, tm, Lunar, data);
}
/* Routine to Draw Large 7-Segment formated number
@@ -337,7 +352,8 @@ static void DrawTime(Adafruit_GFX *gfx, tm_t *tm, int16_t x, int16_t y, uint16_t
static void DrawClock(Adafruit_GFX *gfx, tm_t *tm, struct Lunar_Date *Lunar, gui_data_t *data)
{
GFX_setCursor(gfx, 40, 36);
uint8_t padding = data->height > 300 ? 100 : 40;
GFX_setCursor(gfx, padding, 36);
GFX_printf_styled(gfx, GFX_RED, GFX_WHITE, u8g2_font_helvB18_tn, "%d", tm->tm_year + YEAR0);
GFX_printf_styled(gfx, GFX_BLACK, GFX_WHITE, u8g2_font_wqy12_t_lunar, "");
GFX_printf_styled(gfx, GFX_RED, GFX_WHITE, u8g2_font_helvB18_tn, "%02d", tm->tm_mon + 1);
@@ -345,52 +361,61 @@ static void DrawClock(Adafruit_GFX *gfx, tm_t *tm, struct Lunar_Date *Lunar, gui
GFX_printf_styled(gfx, GFX_RED, GFX_WHITE, u8g2_font_helvB18_tn, "%02d", tm->tm_mday);
GFX_printf_styled(gfx, GFX_BLACK, GFX_WHITE, u8g2_font_wqy12_t_lunar, "");
GFX_setCursor(gfx, 40, 58);
GFX_setCursor(gfx, padding, 58);
GFX_setFont(gfx, u8g2_font_wqy9_t_lunar);
GFX_printf(gfx, "星期%s", Lunar_DayString[tm->tm_wday]);
GFX_setCursor(gfx, 138, 58);
GFX_printf(gfx, "%s%s%s", Lunar_MonthLeapString[Lunar->IsLeap], Lunar_MonthString[Lunar->Month],
Lunar_DateString[Lunar->Date]);
DrawBattery(gfx, 30 + 330 - 10, 25, 20, data->voltage);
DrawBattery(gfx, data->width - padding, 25, 20, data->voltage);
char ssid[5] = {0};
int16_t ssid_len = strlen(data->ssid);
int16_t sw = GFX_getUTF8Width(gfx, "25℃[1234]");
memcpy(ssid, &data->ssid[ssid_len - 4], 4);
GFX_setCursor(gfx, 290, 58);
GFX_setCursor(gfx, data->width - padding - sw - 2, 58);
GFX_setFont(gfx, u8g2_font_wqy9_t_lunar);
GFX_printf(gfx, "%d℃[%s]", data->temperature, ssid);
GFX_drawFastHLine(gfx, 30, 68, 330, GFX_BLACK);
DrawTime(gfx, tm, 70, 98, 5, 2);
GFX_drawFastHLine(gfx, 30, 232, 330, GFX_BLACK);
GFX_drawFastHLine(gfx, padding - 10, 68, data->width - 2 * (padding - 10), GFX_BLACK);
uint16_t cS = data->height / 45;
uint16_t nD = 2;
uint16_t time_width = 2 * (nD * (11 * cS + 2) - 2 * cS) + 4 * cS;
uint16_t time_height = 20 * cS + 4;
int16_t time_x = (data->width - time_width) / 2;
int16_t time_y = (68 + (data->height - 68)) / 2 - time_height / 2;
DrawTime(gfx, tm, time_x, time_y, cS, nD);
GFX_drawFastHLine(gfx, padding - 10, data->height - 68, data->width - 2 * (padding - 10), GFX_BLACK);
GFX_setCursor(gfx, 40, 265);
GFX_setFont(gfx, u8g2_font_wqy9_t_lunar);
GFX_setCursor(gfx, padding, data->height - 68 + 30);
GFX_setFont(gfx, u8g2_font_wqy12_t_lunar);
GFX_printf(gfx, "%s%s", Lunar_StemStrig[LUNAR_GetStem(Lunar)], Lunar_BranchStrig[LUNAR_GetBranch(Lunar)]);
GFX_setTextColor(gfx, GFX_RED, GFX_WHITE);
GFX_printf(gfx, "%s", Lunar_ZodiacString[LUNAR_GetZodiac(Lunar)]);
GFX_setTextColor(gfx, GFX_BLACK, GFX_WHITE);
GFX_printf(gfx, "");
GFX_setCursor(gfx, 40, 285);
GFX_setCursor(gfx, padding, data->height - 68 + 30 + 20);
GFX_printf(gfx, " %d周", GetWeekOfYear(tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday));
uint8_t day = 0;
uint8_t JQday = GetJieQiStr(tm->tm_year + YEAR0, tm->tm_mon + 1, tm->tm_mday, &day);
if (day == 0) {
GFX_setCursor(gfx, data->width - GFX_getUTF8Width(gfx, "小暑") - 50, 275);
GFX_setCursor(gfx, data->width - GFX_getUTF8Width(gfx, "小暑") - padding, data->height - 68 + 30);
GFX_setTextColor(gfx, GFX_RED, GFX_WHITE);
GFX_printf(gfx, "%s", JieQiStr[JQday % 24]);
} else {
GFX_setCursor(gfx, data->width - GFX_getUTF8Width(gfx, "离小暑") - 50, 265);
GFX_setCursor(gfx, data->width - GFX_getUTF8Width(gfx, "离小暑") - padding, data->height - 68 + 30);
GFX_printf(gfx, "离%");
GFX_setTextColor(gfx, GFX_RED, GFX_WHITE);
GFX_printf(gfx, "%s", JieQiStr[JQday % 24]);
GFX_setTextColor(gfx, GFX_BLACK, GFX_WHITE);
char buf[15] = {0};
snprintf(buf, sizeof(buf), "还有%d天", day);
GFX_setCursor(gfx, data->width - GFX_getUTF8Width(gfx, buf) - 50, 285);
GFX_setCursor(gfx, data->width - GFX_getUTF8Width(gfx, buf) - padding, data->height - 68 + 30 + 20);
GFX_printf(gfx, buf);
}
}
@@ -405,13 +430,14 @@ void DrawGUI(gui_data_t *data, buffer_callback draw, display_mode_t mode)
transformTime(data->timestamp, &tm);
Adafruit_GFX gfx;
int16_t ph = (__HEAP_SIZE - 512) / (data->width / 8);
if (data->color == 2)
GFX_begin_3c(&gfx, data->width, data->height, PAGE_HEIGHT);
GFX_begin_3c(&gfx, data->width, data->height, ph);
else if (data->color == 3)
GFX_begin_4c(&gfx, data->width, data->height, PAGE_HEIGHT);
GFX_begin_4c(&gfx, data->width, data->height, ph);
else
GFX_begin(&gfx, data->width, data->height, PAGE_HEIGHT);
GFX_begin(&gfx, data->width, data->height, ph);
GFX_firstPage(&gfx);
do {

View File

@@ -3,10 +3,6 @@
#include "Adafruit_GFX.h"
#ifndef PAGE_HEIGHT
#define PAGE_HEIGHT ((__HEAP_SIZE / 50) - 8)
#endif
typedef enum {
MODE_PICTURE = 0,
MODE_CALENDAR = 1,

View File

@@ -150,19 +150,163 @@ const uint8_t u8g2_font_wqy9_t_lunar[4430] U8G2_FONT_SECTION("u8g2_font_wqy9_t_l
/*
Fontname: -wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-P-80-iso10646-1
Copyright: (null)
Glyphs: 13/41295
Glyphs: 142/41295
BBX Build Mode: 0
*/
const uint8_t u8g2_font_wqy12_t_lunar[271] U8G2_FONT_SECTION("u8g2_font_wqy12_t_lunar") =
"\15\0\4\2\4\5\3\2\6\17\20\0\376\13\375\14\374\0\0\0\0\0\241\60\16\267**\233\212\224_"
"%\62\231\11\0\61\12\265.*\221Q\177\62\20\62\16\267**\233\212T,\325g\203A\0\63\21\267"
"*\32\203H(\27Keve\242\310 \2\64\23\270jZ\61U\42\24\311t\22\212\14\6\252\134\11"
"\0\65\20\267*\12\7\262\262\201\256,&\212\14\42\0\66\22\267**\203H*V\61\321$RV\211"
"Lf\2\67\16\267*\12\7\261T\254*V\25\253\1\70\23\267**\233\212\224*\221\311l*R\252"
"D&\63\1\71\22\267**\233\212\224U\42#Y\304\252\42\203\10\0\0\0\0\4\377\377^t\35\17"
"\11<\361\370\340@\223\12\246r\261\344\340 \25J\206\222\241\330\340\303xg\0e\345\21\371\16\14\17"
"r\336\15\16t\276\33\34\350\2g\10#\14\15<\203\233\134&\227\311er\231\301M.\223\313\344\62"
"\203\233\134&\27\11F\202\211\134B\231\0\0";
const uint8_t u8g2_font_wqy12_t_lunar[4891] U8G2_FONT_SECTION("u8g2_font_wqy12_t_lunar") =
"\216\0\4\2\5\5\3\4\6\20\20\0\376\13\375\14\374\0\0\0\0\0\246\60\16g\25Q\331T\244\374"
"*\221\311L\0\61\13e\35Q\211\214\372\223\201\0\62\16g\25Q\331T\244b\251>\33\14\2\63\22"
"g\25\321\30DB\271X*\263+\23E\6\21\0\64\23h\25\323\212\251\22\241H\246\223Pd\60P"
"\345J\0\65\20g\25Q\70\220\225\15te\61Qd\20\1\66\23g\25Q\31DR\261\212\211&\221"
"\262Jd\62\23\0\67\17g\25Q\70\210\245bU\261\252X\15\0\70\24g\25Q\331T\244T\211L"
"fS\221R%\62\231\11\0\71\22g\25Q\331T\244\254\22\31\311\42V\25\31D\0\0\0\0\4\377"
"\377!\3\26\255\65\341\220F\62\213\222\32\211$U\334\353XQp\20\1N\0\10/\320a\370\1N"
"\1\17\355\325`\370 \26\356\177\232\310\346\0N\3\24\356\361`K\367f\220\32\210\6\212tg\275\33"
"\14\2N\7\35\317\321`\370U\274|\60\10\246\202\251\134,\27\253\213\345R\301P,\21\12\246\0N"
"\11\21\217\21\341\30<\310s\63\70\320\363d\360\1N\21!\317\361`\31\34$C\311P\62\224\14%"
"C\251\301A\60\25L\5S\301T\60\25Le\6\37N\31%\357\321`\370]\274p\360 \222*I"
"\225\204\22\241H(\222\211dB\221V\221\332H\66\222LD\242\21\0N-\31\13\332\340\212\266\32<"
"\12\211B\242\220($\12\15\36\204\252\242\255\0NY\23\315\365`x\240\355\217\263\321D\64\21\215\14"
"\16\4N] \17\322\340\212\67\35\34$C\311P\62\24L\5S\301T.\226)\313Dr\231Dr"
" \7N\214\15O\61a\31\34\350\371\223\301\7N\224\34\317\361\340\30<\310\305\233\16\16\202\251`*"
"\230\12\246r\261\134,\27\313\14>N\245\37\15\326\340J\347A\203\7\251lU\253\301 \223\313\304\64"
")QH\225\10jR\262\304\62N\262\42\17\322`\313\3\222\203\3=,\225\314\244\6\337\305\203\203\7"
"\301l\244.S\25\252\251H\345\202\0N\272\31\17\322\340\213\367:\21Nd\63\321L\62\25L\345\252"
"\222\231l\42\35O\21)\17\322`\252\14%C\301T\60\61\70\210\250r\242U\42\64\212d\22e\231"
"DY\244U\42S$\252I\5S\301T\12Q\77$\17\322`\252\14%C\311P\62\224\14%C\311"
"P\62\224\14%C\301T(\223\12Eb\241Dp\60\7QC \357\321`\31\34\350\231\14\276\312D"
"\63\321L\64\223\14%C\65\251P$\26J\4\7s\0QT$\17\322`\212\307\7\203\134\254\331\340"
"I\42\324\37\15\16D\231D&\27I\4\63\221X(\322*\265\33\14QZ$\17\322\340\213f\352\42"
"\231\134\244j\360@\21\26\207\6g\271X.\66\70\314D\63\311P\211*\64\34\10Qk \356\325`"
"Lf\222\231d&\231If\222\241\134*\227\312\305R\271T\60\223\314D\23\341\0Qm\34\357\361`"
"\313\3\362\200x\36\66\370\236*\23\15\5c\271\252`(\32\311&\0Q\233\36\357\321\340\30<P\204"
"U\261\134tp\240KG\242\231\344\340@\31\317\15\276\213\327\1Q\254 \17\322\340\212\247\7\3Y."
"\225H\325\324N\65\62\235D\253\332\3\364\200\340\36\240\7\244\0R\6$\17\322\340\214f\242\241`*"
"W\225\314d\23\221\301@\223\12%C\311P\60\25L\345bE\211X\31\0R\35)\16\322`\211\347"
"!\203\7\231\242\232\252LU&\242\310T$D\31I\42\323\42\323\250&TS\225\211d\22\241D*"
"\2R\250/\16\322\340L\247\6\232tv\60Hf\6\3I&\22\313Db\231H*\224\210dB\211"
"L$\64\30$R\211L\42\25\313$b\251\10\0R\263%\17\322`J\5S\241\301G\251<j\360"
"@\21\312\251b\231\301A\62\224\14\5S\301T.V\224\210U\1SA\16\17\322\340\213\367n\360]"
"\274\277\3SH\26\17\322`\212W\17\16R\231d(\230\212\327\15\276\213\367\16So-\15\326\340\21"
"\216\6\203L$\244\211\204\64\221\220&\22\322DB\232HH\23\11I$\241A\42\222\250\212Te\202"
"\231\134(\226J\1Th*\355\321`\31\34HB%\241\222\304`\220\210\204JB%\203\3I\62\22"
"\31H\332D\332DJ\6\222D\64\21LH\23\0V\333\35\255\365`\370@S\243\251\321\324hj\64"
"\65\222PF\222\32(\222S\355\340\333\0V\375!\355\325`\370@k\61\270P\245T)\311`\20Q"
"\245T\211\214*\22Q\14.\264\332\301\267\1W#\36\317\361`\31\34\344R\311L\66\221\16+\204*"
"\315(\264\213\16N\343\205\203\7\11\0X\354\24\357\361\340\315\16D\203yw\203\357\342\275\34\34H\0"
"Y\4-\17\322\340I\5S\301Tp\20\11F\42\262L$\221\312Dj\22\221\232D$\221)Jd"
"\222\241d(\230\310\344\62\302\330` \7Y\17!\17\322\340\30<\310e\7g\271\330\340,\27\33\234"
"\345b\203\273\364\340*\221\252\251]n.\7Y\25\32\14\326\340\312\66\35\14D\261L.\222\213T%"
"B\231`\42\332R\267\4Y\34-\17\322`\313\3r\203\217\62\321L\62\64PeB!M\42\222I"
"D\62\211HEM,S\26J\344R\301P\42\227\311\250\22\62\1Y'\32\17\322\340\213w\67\370."
"\236N\204\23\331L\64\223L\345\252\222\21\255\0Y)\33\357\321`\31\34(\343\355\6\337\245\23\341D"
"\66\23\315$S\271\252dD+Y\64\37\17\322`\214G\63\331H\60R\31J\206\342\261\301w\361D"
"\66\223L\345\212\224\11m\2Ys\35\17\322`\213\267N\16\276\12\5S\301T.\25\24E\25i\255"
"D'\13)#\0Y\207'\356\361\340I\327\14\6\231\344`\220\213\324E\352\42\25\203A\244.\21\11"
"F\22\301L\62\222\10&\62\211\301@\34[P\23\357\321\340\30\274n\254\316\15\276\213\367\70\221\16\2"
"[\211!\17\322`\313\3\222\203\67\321H(\25\214\7\7_\205\202\251\234(*\11\213#BUh\30"
"\1[\265$\17\322`\313\3\202\203\7\212\260$S\221\212\324F\7g\271\330\340,\27\33\234\345b\271"
"X*\21+\2[\305$\17\322`\313\3\202\203\7\212\260dp\21\214\16\316\62e\231\262\301Y\246,"
"S\66\70\314$S\271\32\0[\322(\17\322`\313\3\202\203\7\212L\221dp\21\313\344\6\7\272L"
"j\360Q*\27\321\244j\42\272\214J\17\320\3R\0\134\17\36\17\322\340\213w\232)\313\204R\231T"
"&\224\312\204b\211TLV\27\17'\322A\0]\362\26\314\371`x\220m\22\214\4#\203\203H\266"
"\251ibp ]\363\32\314\371`x\20\11F\202\221`$\30\11F\6\7\221lS\323\304\340@^"
"\10-\16\326\340I'\6\7\221T(\222\12ER\241Hd\60HD\272\210t\21\351\42\322E\244\243"
"HD\221)I\204b\251\134(\30\2^s\30\357\321\340\30<\10\306\243\231\272H&\27\251\315\15\276"
"\213\367\35\0^t\35\17\322\340\211\307\7\7\232T\60\225\213%\7\7\251P\62\224\14\305\6\37\306;"
"\3^\206'\17\322\340\313\3\202\203\7\221x*\230\12\246\202\211\301A&\25\14%r\241D.S\25"
"\312\244\62\251L]*)^\232+\17\322\340\313\3\202\203\7\221x*\230\30\34\245\62\241T&\64x"
"\20IeB\251L(\61\270I%b\241L(\243\22)\5^\372/\17\322\340\214\247\6\212\301 \26"
"\212\244\22\203\203L*\22\312\14\6\231A(\231\30\14b\241X$\224S\14\216R\271\204&\26\32\34"
"\304\1^\377$\17\322`\212\345b\271X.\226\213e\6\37\305r\261\134,\27\313\305r\261\134,\27"
"\313\15\6\272X\6`i)\317\361`\31\34\210\372\305`\220\10u\223\310\204\42\231H(\221J\204\6"
"\7\312l&\24\251\211TDb\21\321`\220\1`\305\60\20\322\340\211\5c\301\310\340(V\221\31\14"
"\62\11U,\221\30<I\244\63\203A*\223\252\31\14R\231T\315`\220\312\244j*R\231\220\4`"
"\312\60\17\322\340I\5c\271\310\340&\256MT\14\6\221D&\25IdR\211Hf\60\10\305r\231"
"H\42\225\211\24E\62-B\231\242D.\225\2a\32+\17\322\340\31\234e\312\6g\231\262\301ir"
"p \352E$\224\30\14\22\241H(\21\12F\203\221L(R\26\21\15\6\221\0a\37\62\17\322`"
"M\204#\231\301\203H.\226\30(\42\231\134$\223\30(\212\22\231\210(\221\211TD\6\212\356\62\273"
"T.\30\311\204\42e\21\321`\20\11b\12*\17\322`\214d\63\321\340\340A$\25L\5S\241L"
",S\26\11\305\42\241\234*\227\211\304\22\221D,\223(Rm\204\1b\14(\17\322\340L\204#\331"
"\334\340A$\226\213\345b\231\262Lf \311\324%B\271D(\30\251\223$r\221DYhVb\254"
"\61\17\322\340\211\345b\271T\60\224\211\14\26\251Pdp\23\315$\302\222\301 \243I%\24\231T("
"\223\12eR\241L*\222\310\14\6\231P*\1eY\66\17\322`J\5S\251\301\242\60\22\31\210\22"
"\221Lb\60PdR\241Ld\260(\311DB\211L$\225\210d\6\231\320 \226K%b\241H("
"\221\11\325\304\2e\345\21\351\335`x\220\363np\240\363\335\340@\27e\346\35\317\361\340\31\234\345b"
"\271X.\226\213\15\316r\261\134,\27\313\305\6\367\64\203\17f\16+\355\325\340\33\34HB\232HH"
"\23\11i\42\203\3IH\23\11i\42!Mdp \11i\42\241X*\226*J\204b\11\0f\37"
"\36\315\365`\31\34\345B\203\243\134hpX\23\34\34DB\261Tpp\30\216\15\36\4f%(\17"
"\322\340\213\7\7\17\202\311\301\201\60\70\370(\225\253J\14\6\211\210$\25\21\245\202\203A\60\25L\5"
"\7\203\20\0f\221'\17\322\340\31\234\345b\203\263\134lp\231\35\14\22\311Lh\360\231v\60P\315"
"\62\222\301@\27\313\15\6\272X\6g\10$\14\332\340\31\334\344\62\271L.\223\313\14nr\231\134&"
"\227\31\334\344\62\271H\60\22L\344\22\312\4\0g\11%\17\322`\213\7\7_\305\323\203\201.\26\223"
"\245\22\203\201(\22\313\224\345\6\3],\27\313\205\22\271T\10g\37:\16\322`\311$\63\221\201b"
"\60Hd\42\231H&\222\211d\42\3\311@\222\211d\42\231H&\62\220d\42\231\310@\222\211d\6"
"\27\231T$\24\311$B\211T&\241\252\0g*\35\17\322\340\213W\16\16\224\361\272\301g\333De"
"\244.S\25*Q\245t\361\34\0h\21\64\17\322`\211f\242\231\310 \224I\205\22\3Mb i"
"\224\251\10E&\211\222\210\42\222I\64\312$\332$B\231\212P&R\224I\4\63\301D&\31\1i"
"\15\64\17\322\340\211\345b\271\310\340&\26\32\214r\231\301 \243Ie&\203A$\321*\222\250\30\14"
"\22\221L*\224\31\14B\231T(\223\12%\6\7\231,\0kc\34\317\361\340\30<\10\306\233f\242"
"\231\301*\23\315D\63\321L\64\23\315\344\6\37k\315#\357\321\340\31\234\345b\221P,S\226\251\31"
"|\22LeB\251P&\25\312\244\6\217\343\331D:\5l\64$\17\322\340\213\67J\206\62\3\205$"
"\230P\4#\211d$\21\314Dr\231\252PM*\65\13'\322A\0n\5.\17\322`\211\5S\301"
"\304\340\64\225\32\14\62\271Xdp JG\6\203T$U\62\30D\66\251Pf\60\10eR\241L"
"E\60\224\1n\341.\17\322\340\13u\225\30\34d\212\42y@fp\220\210Eb\241H,\61\70\210"
"t\62\210\364EBQ\22\221d$\205\221\262D*\227\0r\66 \17\322\340\312$S\271\252d&\30"
"I\25\246\222\231h&\233HWd\63\311TL'\321\12r[\30\17\322\340\213f\242\231h&:\70"
"\10\25\246\342u\203\357\342\275\3r\327.\16\322`\214e\42\271D$\231\31\14\42\211\262DD\247\211"
"\14\42\241H\33I\27\221\26\221\310 \242\211\64\12\206\202\211\262D&\30\1s*\65\17\322\340Le"
"B\231H\42\62Xdb\221L\42\225\310D\22\203\203L*\30\12j\6\233DD\24\251(Je\6"
"\253L(\225\11E\22\241\301&\25\212\0s\64;\17\322\340\253\211$\6\231D&T\223\312$\42\211"
"\301@\222\220\4\25\221`$\62\320H\22\221P\42\22\312D*\6\203L$\24\213d\22\251H&\21"
"Id\42\231H(\221\12s\355\62\17\322`\214\307\6\232\304@\222IdB\231D&\224IdB\231"
"D&\62PT\14$\231D&\24\251\11\245\62\241I(\62\252\11e\6\252t\24u\62\32\353\331`"
"\370($\12\211B\203\7\241\220($\12\15\36\204\252\242]\1u\63\34\13\332\340\212V\15\36\205D"
"!Qh\360 \24\22\205D\241\301\203PU\264\12vx(\17\322`\214\204\6\213\322H&\222)\11"
"%R\262\134*\31\221\14\6\21]<\70x\20L'\244\241\234,\244\214\0v}\23\13\332\340J\326"
"\15^\272\34<Hz\71x\220\14y\273+\17\322`\313\3r\203\357\61\211L\42\26\231\304\22\231D"
"lp\32\34<\210\204b\221L\223\310`\20\251\11E*\23\221h\4y\313\61\17\322`*\334\244\6"
"\251`*\230Id\22\203EM(\223\210\204$\25\251Q,Q\222H%J\22\241H(\22\313\224e"
"B\251H,\224\10\6y\315#\16\322`J\305F\231A\254\233\301\203D\244\246\244D\23)\231\264h"
"\61\30$:\211Hb\375\33\0z\313\34\357\361`\313\3\342y\340\340A\36\34\313U\5S\311L\64"
"\23\215\344a\203\17z\345\42\17\322`\313\3\222\203\3Y*\231I\15\276\307\14\316\62e\203\263L\331"
"\340\64\71\70P\346\6\37z\357\62\17\322`\311\325D\212\62\221\212\301\42R\70\30\244\242\231\304\340 "
"\223*\11\305\42\221\301 \222\310$\232$\62\211F\213.F\211&\251D\303\220\2\177\212\32\17\322`"
"J%C\311Ll\360 \30\257\34\34(\343u\203\357\342\355\0\201J\63\17\322`\314d\6\231&\231"
"&\211\301E$S\63\310\64\31\34(\42\331Hd\60\210\14\42\251H\253H\311`\20i\25i\25)"
"\31\14\22\21I*\1\201\363\31\317\361\340\30<\310\245\253rU\203\3y\62\236\34\34(\343u\203\17"
"\202\202 \17\322`J\5S\241\301G\251`*\217\32<L\5S\301T\60\25\214$\222\231h\274\20"
"\202\222\32\357\361`J\5S\241\301G\251`*\232\7\344\6\37\305{>\70H\0\206N(\16\322\340"
"K\17\206\301\301\223P*\22J\250\22\3MQMj\240Ig\6\252LU\246(\23\212$\42\251\210"
"$\67\206\307\60\357\361\340\211\345\312r\241\201b\60Pt\226\250\220E\22%\271DI&\63\220\24%"
"B\211\134H\230\210\244\62\203Dj\220I\244\22\271\301\0\206\360,\16\322\340\11\5C\251\201b\260\12"
"ER\22Id\20\212$\62\25=II*R\231\301U\246*S\65\270\14E\6\17\42\321\0\210c"
"%\17\322`\313\3\342\271\301g\361t\42\234\10\305\62\221\230&\21K\204b\221T(\23\313%R\61"
"\235(\12\213\336\60\17\322`\316$\67\211Ab\25\312$C\301L\42\263\30$\22\233P\242*\21I"
"T%\42\211\252H\242U\242d\240\221(#\245\241\301&\13\214\67$\17\322`J\5c\65\241V\221"
"P\42\233I\246b:\211V\63\70\313\305r\261\134,\27\33\234\345\62\0\217\233\32\17\322`\313\3\222"
"\203\3=,\225\314\244\6\337\305\13\7\17\202\361\356\0\217\260%\357\321`\31\274\211W\14\216\342\361\301"
"\233Ha\244&\24\311$R\221P*\223\12e\22\241HH\246J\2\217\330&\317\361`\311\14\6\242"
"X.\226\216\247\6!E,\223\210\244\42\65\241D\246(\25L\5S\271D\66\63\70\10\221I(\357"
"\321`\370U&\232\211\15\36D\62M\62M\212\62\221Dl\20\221F\262\221\301\203H\66\222\215\14\36"
"D\262\11\0\221\315\37\357\361\340\315\16D\203yn\360]tp\226)\33\234e\312\6\247\311\301\201\62"
"\67\370\0\225\360$\15\326\340HG\6\3IRk\61\270P\245T)\311`\20Q\245T)UJ\61"
"\270\320*\23\322\4\0\226\63*\355\325`\30\10\63\211\301@R%\251RdR\222*I\225&\61\30"
"h\22)M\42\265\210\244\24\231\224*\245\32\14T\5\226M\60\16\326\340\213\15$\261Ld\260\210\24"
"E*J\62\211\224(\22\61\211l\42\233PMb\60HdB!EM(\21\31\34\4C\301P\60"
"\4\226d\62\356\325`\30\204R\221P*\21J\204\22\231\32M*\222\250\30(&\241T$\224\212$"
"\6\3\205\42\224Jd\22\65\241H\233\26\251D&\21\213\1\226\350&\357\321`\370]\274p\360 \222"
"*I\225\264\310D\62\211H\253\222\26\231H&\21iU\222\312$\42\321\10\0\226\352#\17\322`\31"
"\34(\203\203\7\212TL\262H,\202\321Eb\217\32\34\310\253\6\7\361\242\301\201<\2\227\34\60\17"
"\322`\31\34(\203\203\7\212TL\262H,\202\321Eb\217\313\14&\203E(\244\31l\22\222P\244"
"\42\61Xd\212R\231\301*\23J\0\227\62/\17\322`\31\34(\203\203\7\212TL\262H,\202\321"
"Eb\34\33H\6\232\212\222\314@$\313L\26\211i\42\64\320$&\231\310j \1\227R\42\17\322"
"\340\213\7\7\17\202\311\301\201\62\67\370\36\63\70\313\305\6g\271\330\340,\27K%bE\0\232l\27"
"\356\321\340\30\34\244\313\372lp\240\256\36<I\227&\302\21\0\236!,\17\322`M\247\7\213\301$"
"\24\213$\42\261H(R\23Id\22\231\252P\62\64\30D\22\311Ha\42\223\30,\324\331D:\2"
"\237 /\15\332\340I\216\6\221dd\220\31D\222\221ddp\240\7$\42\211H\213H\42\22*I"
"D\22\221\26\221DBT\241\210$\62\203\214*\237\231*\17\322\340\12%S\301T\60\71\370*\222\215"
"dr\221L.R\227I\4\63\302P*\223QE\62\211T\42\223\31\14\342\0\0";
/*
Fontname: -Adobe-Helvetica-Bold-R-Normal--20-140-100-100-P-105-ISO10646-1

View File

@@ -24,11 +24,6 @@
休班
*/
extern const uint8_t u8g2_font_wqy9_t_lunar[] U8G2_FONT_SECTION("u8g2_font_wqy9_t_lunar");
/**
* 文字列表:
0-9 (48-57)
年月日
*/
extern const uint8_t u8g2_font_wqy12_t_lunar[] U8G2_FONT_SECTION("u8g2_font_wqy12_t_lunar");
// 以下字库来自 u8g2用于显示数字

View File

@@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -Wall -IGUI -DPAGE_HEIGHT=600
CFLAGS = -Wall -IGUI -D__HEAP_SIZE=32768
LDFLAGS = -lgdi32 -mwindows
SRCS = GUI/Adafruit_GFX.c GUI/u8g2_font.c GUI/fonts.c GUI/GUI.c GUI/Lunar.c emulator.c