diff --git a/.gitignore b/.gitignore index 03fa991..0c1bf1e 100644 --- a/.gitignore +++ b/.gitignore @@ -128,3 +128,4 @@ dmypy.json # Pyre type checker .pyre/ +/.idea/ diff --git a/code/README.md b/code/README.md index 28b0ee1..0397eab 100644 --- a/code/README.md +++ b/code/README.md @@ -29,9 +29,14 @@ ui:UI主题库 (用户可以自定义UI主题并在这里添加,通过主函数按键切换,添加过多主题可能导致内存不足。) - +点阵文字制作: +http://www.jiqie.com/5/m1.htm ## 版本说明 +2022-12-5 v1.9 +1、增加一个疫情新增数据滚动屏幕。 +2、增加最新疫情新增到时间主题。 +3、修复天气爬虫爆内存的问题 2022-11-1 v1.8 1、修复实时温度显示重影问题; diff --git a/code/data/Fonts/fonts.py b/code/data/Fonts/fonts.py index b16cf78..9005733 100644 --- a/code/data/Fonts/fonts.py +++ b/code/data/Fonts/fonts.py @@ -8,337 +8,347 @@ 宋体、阴码,逐行式,顺向(高位在前) ''' hanzi_24x24_dict = { + "期": ( + 0x1e, 0x38, 0x0, 0x1e, 0x3b, 0xff, 0x1c, 0x3b, 0xff, 0x7f, 0xfd, 0xff, 0x7f, 0xfd, 0x87, 0x7f, 0xfd, 0x87, 0xc, + 0x39, 0x87, 0xf, 0xf9, 0xff, 0xf, 0xf9, 0xff, 0xc, 0x39, 0xff, 0xc, 0x39, 0x87, 0xf, 0xf9, 0x87, 0xf, 0xfb, + 0x87, + 0xc, 0x3b, 0xff, 0xc, 0x3b, 0xff, 0x7f, 0xff, 0xff, 0x7f, 0xff, 0x87, 0x4c, 0x67, 0x87, 0xe, 0xf7, 0x7, 0x1e, + 0x7f, + 0x7, 0x3c, 0x3e, 0xf, 0x78, 0x1e, 0x3f, 0x30, 0x1c, 0x3e, 0x0, 0x4, 0x1c,), + # 空气质量 + "优": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, 0x00, 0x07, 0x06, 0x60, 0x06, 0x04, 0x30, 0x06, + 0x04, 0x30, 0x0C, 0x04, 0x00, 0x0C, 0x04, 0x00, 0x1D, 0xFF, 0xFC, 0x1D, 0xFF, 0xFC, 0x34, 0x0C, + 0x80, 0x74, 0x0C, 0x80, 0x64, 0x0C, 0x80, 0x04, 0x0C, 0x80, 0x04, 0x0C, 0x80, 0x04, 0x1C, 0x80, + 0x04, 0x18, 0x80, 0x04, 0x18, 0x80, 0x04, 0x30, 0x84, 0x04, 0x70, 0x86, 0x04, 0x60, 0xC6, 0x05, + 0xC0, 0xFC, 0x04, 0xC0, 0x38, 0x00, 0x00, 0x00), - '零' : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x07,0xFF,0xE0,0x00,0x18,0x00,0x1F, - 0xFF,0xFC,0x10,0x18,0x0C,0x37,0x9B,0xE8,0x30,0x18,0x10,0x00,0x10,0x00,0x07,0x9B, - 0xE0,0x00,0x38,0x00,0x00,0xC4,0x00,0x01,0x83,0x00,0x06,0x18,0xFE,0x38,0x08,0x1C, - 0x07,0xFF,0x80,0x00,0x01,0x80,0x00,0x06,0x00,0x00,0xE8,0x00,0x00,0x1C,0x00,0x00, - 0x06,0x00,0x00,0x03,0x00,0x00,0x00,0x00,), - - '一' : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x08,0x7F,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,), - - '科' : (0x00,0x00,0x00,0x00,0x00,0x20,0x00,0xE0,0x30,0x1F,0x00,0x20,0x03,0x00,0x20,0x03, - 0x06,0x20,0x03,0x03,0x20,0x03,0x00,0x20,0x7F,0xE0,0x20,0x03,0x00,0x20,0x03,0x04, - 0x20,0x07,0x06,0x20,0x07,0xC2,0x20,0x0F,0x62,0x24,0x0B,0x22,0x2E,0x13,0x01,0xF0, - 0x13,0x1E,0x20,0x23,0x20,0x20,0x43,0x00,0x20,0x03,0x00,0x20,0x03,0x00,0x20,0x03, - 0x00,0x20,0x03,0x00,0x20,0x02,0x00,0x20,), - - '技' : (0x00,0x00,0x00,0x04,0x01,0x00,0x06,0x01,0x80,0x06,0x01,0x00,0x06,0x01,0x00,0x06, - 0x01,0x00,0x7F,0xFF,0xFC,0x06,0x01,0x00,0x06,0x01,0x00,0x06,0x01,0x00,0x06,0x41, - 0x00,0x07,0xBF,0xF8,0x0E,0x08,0x10,0x76,0x08,0x30,0x26,0x04,0x20,0x06,0x04,0x60, - 0x06,0x02,0x40,0x06,0x02,0xC0,0x06,0x01,0x80,0x06,0x02,0xC0,0x26,0x0C,0x70,0x1E, - 0x30,0x3E,0x04,0xC0,0x08,0x00,0x00,0x00,), - - "深" : (0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x0C,0x7F,0xFC,0x04,0x40,0x08,0x05, - 0xC0,0x10,0x01,0x0C,0x40,0x42,0x10,0x30,0x22,0x20,0x18,0x32,0x43,0x18,0x12,0x83, - 0x00,0x14,0x03,0x00,0x04,0xFF,0xFC,0x04,0x07,0x80,0x08,0x0F,0x80,0x08,0x0B,0x40, - 0x78,0x13,0x60,0x18,0x33,0x30,0x18,0x63,0x18,0x18,0x83,0x1E,0x19,0x03,0x08,0x18, - 0x03,0x00,0x00,0x02,0x00,0x00,0x00,0x00), - - "圳" : (0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x08,0x06,0x18,0x0C,0x04,0x10,0x8C,0x04, - 0x10,0x8C,0x04,0x10,0x8C,0x04,0x10,0x8C,0x7F,0xD0,0x8C,0x04,0x10,0x8C,0x04,0x10, - 0x8C,0x04,0x10,0x8C,0x04,0x10,0x8C,0x04,0x10,0x8C,0x04,0x10,0x8C,0x04,0x50,0x8C, - 0x07,0xB0,0x8C,0x1C,0x20,0x8C,0x70,0x20,0x8C,0x20,0x40,0x8C,0x00,0x81,0x8C,0x01, - 0x00,0x0C,0x02,0x00,0x08,0x00,0x00,0x00), - - #空气质量 - "优" : (0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x06,0x00,0x07,0x06,0x60,0x06,0x04,0x30,0x06, - 0x04,0x30,0x0C,0x04,0x00,0x0C,0x04,0x00,0x1D,0xFF,0xFC,0x1D,0xFF,0xFC,0x34,0x0C, - 0x80,0x74,0x0C,0x80,0x64,0x0C,0x80,0x04,0x0C,0x80,0x04,0x0C,0x80,0x04,0x1C,0x80, - 0x04,0x18,0x80,0x04,0x18,0x80,0x04,0x30,0x84,0x04,0x70,0x86,0x04,0x60,0xC6,0x05, - 0xC0,0xFC,0x04,0xC0,0x38,0x00,0x00,0x00), - - "良" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x10,0x00,0x07, - 0xFF,0xE0,0x06,0x00,0x60,0x06,0x00,0x60,0x07,0xFF,0xE0,0x07,0xFF,0xE0,0x06,0x00, - 0x60,0x06,0x00,0x60,0x07,0xFF,0xE0,0x07,0xFF,0xE0,0x06,0x18,0x20,0x06,0x18,0x70, - 0x06,0x0C,0xE0,0x06,0x0F,0xC0,0x06,0x07,0x00,0x06,0xE3,0x80,0x07,0xC1,0xF0,0x0F, - 0x00,0x7E,0x0C,0x00,0x1C,0x00,0x00,0x00), - - "轻" : (0x00,0x00,0x00,0x04,0x00,0x00,0x06,0x00,0x00,0x06,0x1F,0xF0,0x06,0x1F,0xF0,0x7F, - 0xE0,0x60,0x0C,0x00,0xE0,0x0C,0x00,0xC0,0x0D,0x81,0xF0,0x19,0x83,0x38,0x19,0x0E, - 0x1C,0x31,0x1C,0x04,0x3F,0xE8,0x00,0x21,0x00,0x00,0x01,0x0F,0xFC,0x01,0x00,0xC0, - 0x01,0xE0,0xC0,0x7F,0xC0,0xC0,0x39,0x00,0xC0,0x01,0x00,0xC0,0x01,0x00,0xC0,0x01, - 0x1F,0xFE,0x01,0x00,0x00,0x01,0x80,0x00), - - "度" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x00,0x0C,0x00,0x1F,0xFF,0xF8,0x1F, - 0xFF,0xF8,0x18,0x60,0xC0,0x18,0x60,0xC0,0x18,0x60,0xC0,0x1B,0xFF,0xF8,0x18,0x60, - 0xC0,0x18,0x60,0xC0,0x18,0x7F,0xC0,0x18,0x7F,0xC0,0x18,0x00,0x00,0x19,0xFF,0xE0, - 0x18,0x60,0xC0,0x18,0x30,0xC0,0x10,0x19,0x80,0x30,0x1F,0x00,0x30,0x0F,0x00,0x60, - 0xFB,0xF8,0x27,0xE0,0x7C,0x00,0x00,0x00), - - "中" : (0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00, - 0x18,0x00,0x1F,0xFF,0xF8,0x1F,0xFF,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0xFF,0xF8,0x1F,0xFF,0xF8,0x18,0x18,0x18, - 0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00, - 0x18,0x00,0x00,0x18,0x00,0x00,0x00,0x00), - - "重" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x1F,0xFF,0xF0,0x0F,0xF8,0x00,0x00, - 0x18,0x00,0x7F,0xFF,0xFE,0x7F,0xFF,0xFE,0x00,0x18,0x00,0x00,0x18,0x00,0x07,0xFF, - 0xE0,0x06,0x18,0x60,0x07,0xFF,0xE0,0x07,0xFF,0xE0,0x06,0x18,0x60,0x07,0xFF,0xE0, - 0x07,0xFF,0xE0,0x00,0x18,0x00,0x0F,0xFF,0xF8,0x0F,0xFF,0xF8,0x00,0x18,0x00,0x3F, - 0xFF,0xFC,0x3F,0xFF,0xFC,0x00,0x00,0x00), - - "严" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFC,0x00,0x63,0x00,0x00, - 0x63,0x00,0x0C,0x63,0x30,0x06,0x63,0x30,0x06,0x63,0x60,0x04,0x63,0x20,0x00,0x63, - 0x04,0x0F,0xFF,0xFC,0x08,0x00,0x00,0x08,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00, - 0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x30,0x00,0x00,0x30,0x00,0x00,0x70, - 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00), - - "温" : (0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x38,0xFF,0xF0,0x0C,0x40,0x30,0x04, - 0x40,0x30,0x00,0x7F,0xF0,0x00,0x7F,0xF0,0x70,0x40,0x30,0x38,0x40,0x30,0x08,0xFF, - 0xF0,0x00,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x0D,0xFF,0xF8,0x09,0x89,0x98, - 0x19,0x89,0x98,0x19,0x89,0x98,0x11,0x89,0x98,0x31,0x89,0x98,0x31,0x89,0x98,0x67, - 0xFF,0xFE,0x07,0xFF,0xFE,0x00,0x00,0x00), - - "至" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xF8,0x1F,0xFF,0xF8,0x00, - 0x20,0x00,0x00,0x70,0x00,0x00,0xE1,0x00,0x00,0xC1,0x80,0x01,0x80,0xC0,0x07,0x00, - 0x60,0x0F,0xFF,0xF0,0x04,0x18,0x10,0x00,0x18,0x00,0x00,0x18,0x00,0x08,0x18,0x10, - 0x0F,0xFF,0xF0,0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x3F, - 0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00), - - "最" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xE0,0x06,0x00,0x60,0x07, - 0xFF,0xE0,0x06,0x00,0x60,0x06,0x00,0x60,0x07,0xFF,0xE0,0x00,0x00,0x00,0x3F,0xFF, - 0xFC,0x3F,0xFF,0xFC,0x0C,0x20,0x00,0x0F,0xEF,0xF0,0x0F,0xEF,0xF0,0x0C,0x26,0x30, - 0x0F,0xE2,0x20,0x0F,0xE3,0x60,0x0C,0x39,0x40,0x0F,0xF9,0xC0,0x3F,0x21,0xF0,0x20, - 0x27,0x3C,0x00,0x3C,0x08,0x00,0x00,0x00), - - "高" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x3F,0xFF,0xFC,0x00, - 0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xC0,0x06,0x00,0x40,0x06,0x00,0x40,0x07,0xFF, - 0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFC,0x30,0x00,0x0C,0x30,0x00,0x0C, - 0x31,0xFF,0x8C,0x31,0x81,0x8C,0x31,0x81,0x8C,0x31,0xFF,0x8C,0x30,0x00,0x0C,0x30, - 0x00,0x3C,0x30,0x00,0x38,0x00,0x00,0x00), - - "低" : (0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x10,0x06,0x01,0xF8,0x06,0x7F,0xE0,0x0C, - 0x41,0x00,0x0C,0x41,0x00,0x1C,0x41,0x00,0x1C,0x41,0x00,0x3C,0x41,0x00,0x3C,0x7F, - 0xFC,0x6C,0x7F,0xFC,0x2C,0x41,0x80,0x0C,0x41,0x80,0x0C,0x41,0x80,0x0C,0x40,0x80, - 0x0C,0x44,0xC0,0x0C,0x4C,0xC0,0x0C,0x5C,0xC4,0x0C,0x78,0x66,0x0C,0xEC,0x36,0x0C, - 0x46,0x3C,0x0C,0x02,0x1C,0x00,0x00,0x00), - - " " : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00), - - #风力 - "东" : (0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x30,0x00,0x00,0x30,0x00,0x00,0x60,0x00,0x00, - 0x60,0x00,0x1F,0xFF,0xF8,0x01,0xC0,0x00,0x01,0x80,0x00,0x03,0x0C,0x00,0x07,0x0C, - 0x00,0x0E,0x0C,0x00,0x1F,0xFF,0xF8,0x0F,0xFF,0xF8,0x00,0x0C,0x00,0x00,0x0C,0x00, - 0x03,0x0C,0x40,0x03,0x0C,0xE0,0x06,0x0C,0x70,0x0C,0x0C,0x38,0x18,0x0C,0x1C,0x30, - 0x7C,0x08,0x00,0x78,0x00,0x00,0x00,0x00), - - "南" : (0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x3F,0xFF,0xFE,0x30, - 0x18,0x02,0x00,0x10,0x00,0x00,0x30,0x00,0x3F,0xFF,0xFC,0x30,0x00,0x0C,0x30,0x82, - 0x08,0x30,0xC3,0x08,0x30,0x46,0x08,0x32,0x06,0x08,0x33,0xFF,0xC8,0x30,0x18,0x08, - 0x30,0x18,0x08,0x37,0xFF,0xE8,0x30,0x18,0x08,0x30,0x18,0x08,0x30,0x18,0x08,0x30, - 0x18,0x78,0x30,0x00,0x38,0x00,0x00,0x00), - - "西" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFC,0x3F,0xFF,0xFC,0x00, - 0x66,0x00,0x00,0x66,0x00,0x00,0x66,0x00,0x0F,0xFF,0xF0,0x0F,0xFF,0xF0,0x08,0x46, - 0x10,0x08,0x46,0x10,0x08,0x46,0x10,0x08,0xC6,0x10,0x08,0xC6,0x10,0x09,0x83,0xD0, - 0x0B,0x83,0xD0,0x09,0x00,0x10,0x08,0x00,0x10,0x08,0x00,0x10,0x0F,0xFF,0xF0,0x08, - 0x00,0x10,0x08,0x00,0x10,0x00,0x00,0x00), - - "北" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0x00,0x00,0xC6,0x00,0x00,0xC6,0x00,0x00, - 0xC6,0x00,0x00,0xC6,0x00,0x00,0xC6,0x0C,0x00,0xC6,0x1C,0x3F,0xC6,0x78,0x3F,0xC7, - 0xE0,0x00,0xC7,0x80,0x00,0xC6,0x00,0x00,0xC6,0x00,0x00,0xC6,0x00,0x00,0xC6,0x00, - 0x00,0xC6,0x00,0x00,0xC6,0x00,0x0F,0xC6,0x04,0x7E,0xC6,0x06,0x30,0xC3,0x0E,0x00, - 0xC3,0xFC,0x00,0xC0,0x00,0x00,0x00,0x00), - - "风" : (0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xE0,0x0F,0xFF,0xE0,0x0C,0x00,0x60,0x0C, - 0x00,0x60,0x0C,0x00,0x60,0x0C,0x83,0x60,0x0D,0xC6,0x60,0x0C,0xC6,0x60,0x0C,0x64, - 0x60,0x0C,0x3C,0x60,0x08,0x38,0x60,0x08,0x18,0x60,0x08,0x3C,0x60,0x08,0x7C,0x60, - 0x18,0x66,0x20,0x18,0xC3,0x30,0x1B,0x83,0x34,0x31,0x00,0x36,0x30,0x00,0x3E,0x70, - 0x00,0x1E,0x60,0x00,0x0C,0x00,0x00,0x00), - - "级" : (0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x06,0x7F,0xF0,0x0C,0x7F,0xF0,0x0C, - 0x08,0x20,0x18,0xC8,0x60,0x31,0x88,0x60,0x31,0x88,0x60,0x7F,0x08,0x40,0x22,0x08, - 0xFC,0x06,0x0C,0x08,0x0C,0x0C,0x18,0x18,0x1E,0x18,0x3F,0x9A,0x10,0x3F,0x9B,0x30, - 0x20,0x11,0xB0,0x00,0xB1,0xE0,0x0F,0xA0,0xE0,0x3E,0x61,0xE0,0x20,0xC3,0xB0,0x01, - 0x8F,0x1C,0x00,0x1C,0x0C,0x00,0x00,0x00), - - "月" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xF0,0x06,0x00,0x30,0x06, - 0x00,0x30,0x06,0x00,0x30,0x06,0x00,0x30,0x07,0xFF,0xF0,0x07,0xFF,0xF0,0x06,0x00, - 0x30,0x06,0x00,0x30,0x06,0x00,0x30,0x07,0xFF,0xF0,0x07,0xFF,0xF0,0x06,0x00,0x30, - 0x06,0x00,0x30,0x04,0x00,0x30,0x0C,0x00,0x30,0x0C,0x00,0x30,0x18,0x00,0x60,0x38, - 0x03,0xE0,0x30,0x01,0xC0,0x00,0x00,0x00), - - "日" : (0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xF0,0x07,0xFF,0xF0,0x06,0x00,0x30,0x06, - 0x00,0x30,0x06,0x00,0x30,0x06,0x00,0x30,0x06,0x00,0x30,0x06,0x00,0x30,0x07,0xFF, - 0xF0,0x07,0xFF,0xF0,0x06,0x00,0x30,0x06,0x00,0x30,0x06,0x00,0x30,0x06,0x00,0x30, - 0x06,0x00,0x30,0x06,0x00,0x30,0x06,0x00,0x30,0x07,0xFF,0xF0,0x06,0x00,0x30,0x06, - 0x00,0x30,0x06,0x00,0x30,0x00,0x00,0x00), - - "二" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F, - 0xFF,0xF0,0x0F,0xFF,0xF0,0x0F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x7F,0xFF,0xFE,0x7F,0xFF,0xFE,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00), - - "三" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xF8,0x1F, - 0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x07,0xFF,0xE0,0x07,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFE,0x7F, - 0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00), - - "四" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFC,0x3F,0xFF,0xFC,0x30, - 0x66,0x08,0x30,0x66,0x08,0x30,0x66,0x08,0x30,0x46,0x08,0x30,0x46,0x08,0x30,0xC6, - 0x08,0x30,0xC6,0x08,0x31,0x86,0x08,0x31,0x86,0x08,0x33,0x07,0xC8,0x36,0x00,0x08, - 0x30,0x00,0x08,0x30,0x00,0x08,0x30,0x00,0x08,0x3F,0xFF,0xF8,0x3F,0xFF,0xFC,0x30, - 0x00,0x0C,0x30,0x00,0x0C,0x00,0x00,0x00), - - "五" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xF8,0x00, - 0x30,0x00,0x00,0x30,0x00,0x00,0x30,0x00,0x00,0x20,0x00,0x00,0x20,0x00,0x0F,0xFF, - 0xE0,0x0F,0xFF,0xC0,0x00,0x60,0x40,0x00,0x60,0x40,0x00,0x60,0xC0,0x00,0x60,0xC0, - 0x00,0x40,0xC0,0x00,0xC0,0xC0,0x00,0xC0,0xC0,0x00,0xC0,0xC0,0x3F,0xFF,0xFE,0x3F, - 0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00), - - "六" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x70,0x00,0x00,0x38,0x00,0x00, - 0x18,0x00,0x00,0x1C,0x00,0x00,0x10,0x00,0x3F,0xFF,0xFC,0x3F,0xFF,0xFC,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0xC3,0x80,0x01,0xC1,0x80,0x01,0x81,0xC0, - 0x03,0x80,0xE0,0x07,0x00,0x70,0x0E,0x00,0x30,0x1C,0x00,0x38,0x1C,0x00,0x1C,0x38, - 0x00,0x08,0x10,0x00,0x00,0x00,0x00,0x00), - - "周" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xF8,0x0C,0x00,0x18,0x0C, - 0x18,0x18,0x0C,0x18,0x18,0x0D,0xFF,0x98,0x0C,0x18,0x18,0x0C,0x18,0x18,0x0F,0xFF, - 0xD8,0x0F,0xFF,0xD8,0x0C,0x00,0x18,0x08,0x00,0x18,0x08,0xFF,0x18,0x18,0xC1,0x18, - 0x18,0xC1,0x18,0x18,0xC1,0x18,0x18,0xFF,0x18,0x30,0xFF,0x18,0x30,0x00,0x18,0x70, - 0x00,0xF8,0x20,0x00,0xF0,0x00,0x00,0x00), - - "实" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x1F, - 0xFF,0xFC,0x18,0x00,0x1C,0x18,0x04,0x1C,0x19,0x86,0x1C,0x01,0xC6,0x00,0x00,0x76, - 0x00,0x0C,0x26,0x00,0x0F,0x06,0x00,0x03,0x86,0x00,0x01,0x06,0x00,0x3F,0xFF,0xFC, - 0x3F,0xFF,0xFC,0x00,0x0C,0x00,0x00,0x19,0x00,0x00,0x73,0xC0,0x01,0xE0,0xF0,0x0F, - 0x80,0x3C,0x1E,0x00,0x1C,0x10,0x00,0x00), - - "时" : (0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x30,0x00,0x00,0x30,0x3F,0x80,0x30,0x31, - 0x80,0x30,0x31,0x80,0x30,0x31,0xBF,0xFE,0x31,0x80,0x30,0x31,0x80,0x30,0x3F,0x80, - 0x30,0x31,0x8C,0x30,0x31,0x8C,0x30,0x31,0x86,0x30,0x31,0x86,0x30,0x31,0x80,0x30, - 0x3F,0x80,0x30,0x3F,0x80,0x30,0x31,0x80,0x30,0x31,0x80,0x30,0x30,0x00,0x30,0x00, - 0x00,0xF0,0x00,0x00,0xE0,0x00,0x00,0x00), - - "今" : (0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x18,0x00,0x00,0x38,0x00,0x00,0x3C,0x00,0x00, - 0x66,0x00,0x00,0xC3,0x00,0x01,0x81,0x80,0x03,0x01,0xC0,0x06,0x30,0xE0,0x0C,0x38, - 0x78,0x38,0x1C,0x1E,0x30,0x08,0x0C,0x00,0x00,0x00,0x07,0xFF,0xF0,0x07,0xFF,0xF0, - 0x00,0x00,0xE0,0x00,0x01,0xC0,0x00,0x01,0x80,0x00,0x03,0x00,0x00,0x06,0x00,0x00, - 0x0E,0x00,0x00,0x0C,0x00,0x00,0x04,0x00), - - "天" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xF0,0x00,0x18,0x00,0x00, - 0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x3F,0xFF,0xFC,0x3F,0xFF, - 0xFC,0x00,0x18,0x00,0x00,0x3C,0x00,0x00,0x3C,0x00,0x00,0x36,0x00,0x00,0x66,0x00, - 0x00,0xE3,0x00,0x01,0xC1,0x80,0x03,0x81,0xC0,0x07,0x00,0xF0,0x1E,0x00,0x3C,0x7C, - 0x00,0x1C,0x30,0x00,0x04,0x00,0x00,0x00), - - "气" : (0x00,0x00,0x00,0x02,0x00,0x00,0x03,0x00,0x00,0x03,0x00,0x00,0x07,0xFF,0xF8,0x0E, - 0x00,0x08,0x0C,0x00,0x00,0x18,0x00,0x00,0x3B,0xFF,0xE0,0x30,0x00,0x00,0x00,0x00, - 0x00,0x1F,0xFF,0xE0,0x1F,0xFF,0xE0,0x00,0x00,0x60,0x00,0x00,0x60,0x00,0x00,0x60, - 0x00,0x00,0x60,0x00,0x00,0x60,0x00,0x00,0x64,0x00,0x00,0x66,0x00,0x00,0x7E,0x00, - 0x00,0x3C,0x00,0x00,0x18,0x00,0x00,0x00), - - "转" : (0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x01,0x80,0x0C,0x01,0x80,0x0C,0x01,0x00,0x7F, - 0xDF,0xFC,0x7F,0xDF,0xFC,0x18,0x03,0x00,0x1B,0x03,0x00,0x13,0x22,0x02,0x33,0x3F, - 0xFE,0x63,0x06,0x00,0x7F,0xC6,0x00,0x23,0x04,0x00,0x03,0x0F,0xF8,0x03,0x00,0x38, - 0x03,0xC0,0x30,0x7F,0x80,0x60,0x63,0x0C,0xC0,0x03,0x07,0x80,0x03,0x03,0xC0,0x03, - 0x00,0xE0,0x03,0x00,0x60,0x00,0x00,0x00), - - "到" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x3F,0xFC,0x0C,0x01,0x80,0x0C,0x01, - 0x80,0x8C,0x02,0x00,0x8C,0x04,0x30,0x8C,0x08,0x18,0x8C,0x1F,0xFC,0x8C,0x19,0x8C, - 0x8C,0x01,0x84,0x8C,0x01,0x80,0x8C,0x01,0x88,0x8C,0x3F,0xFC,0x8C,0x01,0x80,0x8C, - 0x01,0x80,0x8C,0x01,0x80,0x8C,0x01,0x84,0x0C,0x01,0xF8,0x0C,0x1F,0x00,0x0C,0x38, - 0x00,0x78,0x00,0x00,0x18,0x00,0x00,0x00), - - "晴" : (0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x01,0x80,0x00,0x3F,0xFC,0x3F,0x3F,0xFC,0x23, - 0x01,0x80,0x23,0x3F,0xFC,0x23,0x3F,0xFC,0x23,0x01,0x80,0x23,0x7F,0xFE,0x3F,0x7F, - 0xFE,0x3F,0x00,0x00,0x23,0x1F,0xF8,0x23,0x10,0x08,0x23,0x10,0x08,0x23,0x1F,0xF8, - 0x23,0x10,0x08,0x3F,0x10,0x08,0x23,0x1F,0xF8,0x23,0x1F,0xF8,0x20,0x10,0x08,0x00, - 0x10,0x18,0x00,0x10,0x38,0x00,0x00,0x00), - - "阴" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xCF,0xFC,0x30,0xCC,0x08,0x30, - 0x8C,0x08,0x31,0x8C,0x08,0x31,0x8C,0x08,0x31,0x0F,0xF8,0x33,0x0F,0xF8,0x33,0x0C, - 0x08,0x33,0x0C,0x08,0x31,0x8C,0x08,0x31,0x8F,0xF8,0x30,0xCF,0xF8,0x30,0xCC,0x08, - 0x30,0xC8,0x08,0x37,0x98,0x08,0x33,0x18,0x08,0x30,0x30,0x08,0x30,0x70,0x08,0x30, - 0x60,0x78,0x30,0xC0,0x78,0x00,0x00,0x00), - - "雨" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFE,0x00,0x18,0x00,0x00, - 0x18,0x00,0x00,0x18,0x00,0x1F,0xFF,0xFC,0x1F,0xFF,0xFC,0x18,0x18,0x0C,0x19,0x19, - 0x0C,0x19,0x99,0x8C,0x18,0xD8,0xCC,0x18,0x18,0x4C,0x18,0x18,0x0C,0x19,0x18,0x0C, - 0x1B,0x99,0x8C,0x19,0xD9,0xCC,0x18,0x98,0x0C,0x18,0x18,0x0C,0x18,0x18,0x0C,0x18, - 0x18,0x3C,0x18,0x00,0x38,0x00,0x00,0x00), - - "雷" : (0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xF8,0x18,0x18,0x18,0x00,0x18,0x00,0x7F, - 0xFF,0xFE,0x7F,0xFF,0xFE,0x60,0x18,0x06,0x67,0x9B,0xE6,0x00,0x18,0x00,0x07,0x99, - 0xE0,0x07,0x99,0xE0,0x00,0x18,0x00,0x0F,0xFF,0xF0,0x0F,0xFF,0xF0,0x0C,0x18,0x30, - 0x0C,0x18,0x30,0x0F,0xFF,0xF0,0x0C,0x18,0x30,0x0C,0x18,0x30,0x0C,0x18,0x30,0x0F, - 0xFF,0xF0,0x0C,0x00,0x30,0x00,0x00,0x00), - - "阵" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x3F,0x07,0x00,0x33,0x06,0x00,0x33, - 0x7F,0xFC,0x32,0x7F,0xFC,0x36,0x0C,0x00,0x36,0x08,0x00,0x34,0x19,0x80,0x36,0x31, - 0x80,0x32,0x31,0x80,0x33,0x7F,0xFC,0x31,0x31,0x80,0x31,0x81,0x80,0x31,0x81,0x80, - 0x3F,0x01,0x80,0x36,0x7F,0xFE,0x30,0x7F,0xFE,0x30,0x01,0x80,0x30,0x01,0x80,0x30, - 0x01,0x80,0x30,0x01,0x80,0x00,0x00,0x00), - - "多" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0xC0,0x00,0x01,0xFF,0xE0,0x03, - 0x00,0xC0,0x0E,0x00,0xC0,0x1C,0xC3,0x80,0x00,0x67,0x00,0x00,0x3C,0x00,0x00,0x3A, - 0x00,0x01,0xE7,0x00,0x3F,0x8F,0xFC,0x18,0x1F,0xFC,0x00,0x70,0x18,0x01,0xF0,0x18, - 0x07,0x98,0x30,0x06,0x0C,0x60,0x00,0x07,0xC0,0x00,0x07,0x80,0x00,0x1E,0x00,0x07, - 0xF8,0x00,0x1F,0xC0,0x00,0x00,0x00,0x00), - - "云" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xF0,0x07,0xFF,0xF0,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF, - 0xFC,0x00,0x40,0x00,0x00,0x70,0x00,0x00,0x60,0x00,0x00,0xC0,0x00,0x01,0xC1,0x80, - 0x01,0x81,0x80,0x03,0x00,0xC0,0x06,0x00,0x60,0x0E,0x00,0xF0,0x1F,0xFF,0xF8,0x0F, - 0xC0,0x18,0x00,0x00,0x00,0x00,0x00,0x00), - - "小" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00, - 0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x07,0x18,0xC0,0x06,0x18,0xE0,0x06,0x18, - 0x60,0x0E,0x18,0x70,0x0C,0x18,0x30,0x0C,0x18,0x38,0x18,0x18,0x18,0x18,0x18,0x1C, - 0x38,0x18,0x0C,0x10,0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00, - 0xF8,0x00,0x00,0x70,0x00,0x00,0x00,0x00), - - "大" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x00, - 0x18,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0x3F,0xFF,0xFC,0x3F,0xFF,0xFC,0x00,0x18, - 0x00,0x00,0x38,0x00,0x00,0x3C,0x00,0x00,0x3C,0x00,0x00,0x66,0x00,0x00,0x67,0x00, - 0x00,0xC3,0x00,0x01,0xC1,0x80,0x03,0x80,0xC0,0x0F,0x00,0xF0,0x1E,0x00,0x38,0x78, - 0x00,0x1C,0x30,0x00,0x08,0x00,0x00,0x00), - - "暴" : (0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xE0,0x04,0x00,0x20,0x04,0x00,0x20,0x07, - 0xFF,0xE0,0x04,0x00,0x20,0x07,0xFF,0xE0,0x00,0xC3,0x00,0x00,0xC3,0x00,0x1F,0xFF, - 0xF8,0x00,0xC3,0x00,0x00,0xC3,0x00,0x3F,0xFF,0xFC,0x01,0x81,0x80,0x07,0x18,0xE0, - 0x3D,0x18,0xBC,0x33,0x9D,0xCC,0x00,0xFF,0x00,0x03,0xDB,0xC0,0x1F,0x18,0xF0,0x08, - 0x78,0x30,0x00,0x30,0x10,0x00,0x00,0x00), - - "雾" : (0x00,0x00,0x00,0x00,0x00,0x40,0x07,0xFF,0xE0,0x00,0x18,0x00,0x0F,0xFF,0xF8,0x10, - 0x18,0x08,0x13,0xDB,0xD0,0x00,0x18,0x00,0x03,0xDB,0xC0,0x00,0x80,0x00,0x01,0xFF, - 0x80,0x02,0x81,0x80,0x0C,0x62,0x00,0x10,0x1C,0x00,0x00,0xE7,0xFE,0x1F,0x20,0x78, - 0x20,0x10,0x00,0x07,0xFF,0xE0,0x00,0x20,0x40,0x00,0x60,0x40,0x00,0xC0,0x80,0x03, - 0x07,0x80,0x1C,0x03,0x00,0x00,0x00,0x00), - - "雪" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x0F,0xFF,0xF0,0x00,0x10,0x00,0x10, - 0x10,0x00,0x1F,0xFF,0xFC,0x10,0x10,0x08,0x37,0xD3,0xF0,0x20,0x10,0x00,0x00,0x10, - 0x00,0x07,0xD3,0xE0,0x00,0x10,0x20,0x0F,0xFF,0xF0,0x00,0x00,0x20,0x00,0x00,0x20, - 0x00,0x00,0x20,0x07,0xFF,0xE0,0x00,0x00,0x20,0x00,0x00,0x20,0x1F,0xFF,0xE0,0x00, - 0x00,0x20,0x00,0x00,0x20,0x00,0x00,0x00), - - "夹" : (0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x18,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x1F, - 0xFF,0xF0,0x00,0x10,0x00,0x00,0x10,0x00,0x04,0x10,0xC0,0x02,0x10,0x80,0x03,0x11, - 0x80,0x01,0x11,0x00,0x01,0x32,0x08,0x7F,0xFF,0xFC,0x00,0x24,0x00,0x00,0x24,0x00, - 0x00,0x62,0x00,0x00,0x42,0x00,0x00,0x81,0x80,0x01,0x00,0xC0,0x06,0x00,0x70,0x18, - 0x00,0x1E,0x60,0x00,0x08,0x00,0x00,0x00), - - "℃" : (0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x24,0x00,0x00,0x24,0x03,0x00,0x24, - 0x1F,0xE0,0x18,0x38,0x70,0x00,0x60,0x18,0x00,0xC0,0x1C,0x00,0xC0,0x00,0x00,0xC0, - 0x00,0x00,0x80,0x00,0x01,0x80,0x00,0x01,0x80,0x00,0x01,0x80,0x00,0x00,0xC0,0x00, - 0x00,0xC0,0x0C,0x00,0xC0,0x18,0x00,0x60,0x38,0x00,0x38,0xF0,0x00,0x1F,0xE0,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00), - - "%" : (0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x0F, - 0x80,0x18,0x18,0xC0,0x30,0x18,0xC0,0x60,0x18,0x40,0xC0,0x18,0xC3,0x80,0x18,0xC7, - 0x00,0x0D,0x8E,0x00,0x07,0x1C,0x00,0x00,0x39,0xF0,0x00,0x73,0x10,0x00,0xE3,0x18, - 0x01,0xC2,0x18,0x03,0x02,0x18,0x06,0x03,0x18,0x0C,0x03,0x10,0x08,0x01,0xF0,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00), - -} \ No newline at end of file + "良": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x10, 0x00, 0x07, + 0xFF, 0xE0, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x07, 0xFF, 0xE0, 0x07, 0xFF, 0xE0, 0x06, 0x00, + 0x60, 0x06, 0x00, 0x60, 0x07, 0xFF, 0xE0, 0x07, 0xFF, 0xE0, 0x06, 0x18, 0x20, 0x06, 0x18, 0x70, + 0x06, 0x0C, 0xE0, 0x06, 0x0F, 0xC0, 0x06, 0x07, 0x00, 0x06, 0xE3, 0x80, 0x07, 0xC1, 0xF0, 0x0F, + 0x00, 0x7E, 0x0C, 0x00, 0x1C, 0x00, 0x00, 0x00), + + "轻": (0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x1F, 0xF0, 0x06, 0x1F, 0xF0, 0x7F, + 0xE0, 0x60, 0x0C, 0x00, 0xE0, 0x0C, 0x00, 0xC0, 0x0D, 0x81, 0xF0, 0x19, 0x83, 0x38, 0x19, 0x0E, + 0x1C, 0x31, 0x1C, 0x04, 0x3F, 0xE8, 0x00, 0x21, 0x00, 0x00, 0x01, 0x0F, 0xFC, 0x01, 0x00, 0xC0, + 0x01, 0xE0, 0xC0, 0x7F, 0xC0, 0xC0, 0x39, 0x00, 0xC0, 0x01, 0x00, 0xC0, 0x01, 0x00, 0xC0, 0x01, + 0x1F, 0xFE, 0x01, 0x00, 0x00, 0x01, 0x80, 0x00), + + "度": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x0C, 0x00, 0x1F, 0xFF, 0xF8, 0x1F, + 0xFF, 0xF8, 0x18, 0x60, 0xC0, 0x18, 0x60, 0xC0, 0x18, 0x60, 0xC0, 0x1B, 0xFF, 0xF8, 0x18, 0x60, + 0xC0, 0x18, 0x60, 0xC0, 0x18, 0x7F, 0xC0, 0x18, 0x7F, 0xC0, 0x18, 0x00, 0x00, 0x19, 0xFF, 0xE0, + 0x18, 0x60, 0xC0, 0x18, 0x30, 0xC0, 0x10, 0x19, 0x80, 0x30, 0x1F, 0x00, 0x30, 0x0F, 0x00, 0x60, + 0xFB, 0xF8, 0x27, 0xE0, 0x7C, 0x00, 0x00, 0x00), + + "中": (0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, + 0x18, 0x00, 0x1F, 0xFF, 0xF8, 0x1F, 0xFF, 0xF8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1F, 0xFF, 0xF8, 0x1F, 0xFF, 0xF8, 0x18, 0x18, 0x18, + 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, + 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00), + + "重": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x1F, 0xFF, 0xF0, 0x0F, 0xF8, 0x00, 0x00, + 0x18, 0x00, 0x7F, 0xFF, 0xFE, 0x7F, 0xFF, 0xFE, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x07, 0xFF, + 0xE0, 0x06, 0x18, 0x60, 0x07, 0xFF, 0xE0, 0x07, 0xFF, 0xE0, 0x06, 0x18, 0x60, 0x07, 0xFF, 0xE0, + 0x07, 0xFF, 0xE0, 0x00, 0x18, 0x00, 0x0F, 0xFF, 0xF8, 0x0F, 0xFF, 0xF8, 0x00, 0x18, 0x00, 0x3F, + 0xFF, 0xFC, 0x3F, 0xFF, 0xFC, 0x00, 0x00, 0x00), + + "严": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFC, 0x00, 0x63, 0x00, 0x00, + 0x63, 0x00, 0x0C, 0x63, 0x30, 0x06, 0x63, 0x30, 0x06, 0x63, 0x60, 0x04, 0x63, 0x20, 0x00, 0x63, + 0x04, 0x0F, 0xFF, 0xFC, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, + 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00), + + "温": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x38, 0xFF, 0xF0, 0x0C, 0x40, 0x30, 0x04, + 0x40, 0x30, 0x00, 0x7F, 0xF0, 0x00, 0x7F, 0xF0, 0x70, 0x40, 0x30, 0x38, 0x40, 0x30, 0x08, 0xFF, + 0xF0, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0xFF, 0xF8, 0x09, 0x89, 0x98, + 0x19, 0x89, 0x98, 0x19, 0x89, 0x98, 0x11, 0x89, 0x98, 0x31, 0x89, 0x98, 0x31, 0x89, 0x98, 0x67, + 0xFF, 0xFE, 0x07, 0xFF, 0xFE, 0x00, 0x00, 0x00), + + "至": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xF8, 0x1F, 0xFF, 0xF8, 0x00, + 0x20, 0x00, 0x00, 0x70, 0x00, 0x00, 0xE1, 0x00, 0x00, 0xC1, 0x80, 0x01, 0x80, 0xC0, 0x07, 0x00, + 0x60, 0x0F, 0xFF, 0xF0, 0x04, 0x18, 0x10, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x08, 0x18, 0x10, + 0x0F, 0xFF, 0xF0, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x3F, + 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00), + + "最": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xE0, 0x06, 0x00, 0x60, 0x07, + 0xFF, 0xE0, 0x06, 0x00, 0x60, 0x06, 0x00, 0x60, 0x07, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x3F, 0xFF, + 0xFC, 0x3F, 0xFF, 0xFC, 0x0C, 0x20, 0x00, 0x0F, 0xEF, 0xF0, 0x0F, 0xEF, 0xF0, 0x0C, 0x26, 0x30, + 0x0F, 0xE2, 0x20, 0x0F, 0xE3, 0x60, 0x0C, 0x39, 0x40, 0x0F, 0xF9, 0xC0, 0x3F, 0x21, 0xF0, 0x20, + 0x27, 0x3C, 0x00, 0x3C, 0x08, 0x00, 0x00, 0x00), + + "高": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x3F, 0xFF, 0xFC, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xC0, 0x06, 0x00, 0x40, 0x06, 0x00, 0x40, 0x07, 0xFF, + 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFC, 0x30, 0x00, 0x0C, 0x30, 0x00, 0x0C, + 0x31, 0xFF, 0x8C, 0x31, 0x81, 0x8C, 0x31, 0x81, 0x8C, 0x31, 0xFF, 0x8C, 0x30, 0x00, 0x0C, 0x30, + 0x00, 0x3C, 0x30, 0x00, 0x38, 0x00, 0x00, 0x00), + + "低": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x06, 0x01, 0xF8, 0x06, 0x7F, 0xE0, 0x0C, + 0x41, 0x00, 0x0C, 0x41, 0x00, 0x1C, 0x41, 0x00, 0x1C, 0x41, 0x00, 0x3C, 0x41, 0x00, 0x3C, 0x7F, + 0xFC, 0x6C, 0x7F, 0xFC, 0x2C, 0x41, 0x80, 0x0C, 0x41, 0x80, 0x0C, 0x41, 0x80, 0x0C, 0x40, 0x80, + 0x0C, 0x44, 0xC0, 0x0C, 0x4C, 0xC0, 0x0C, 0x5C, 0xC4, 0x0C, 0x78, 0x66, 0x0C, 0xEC, 0x36, 0x0C, + 0x46, 0x3C, 0x0C, 0x02, 0x1C, 0x00, 0x00, 0x00), + + " ": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00), + + # 风力 + "东": (0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x60, 0x00, 0x00, + 0x60, 0x00, 0x1F, 0xFF, 0xF8, 0x01, 0xC0, 0x00, 0x01, 0x80, 0x00, 0x03, 0x0C, 0x00, 0x07, 0x0C, + 0x00, 0x0E, 0x0C, 0x00, 0x1F, 0xFF, 0xF8, 0x0F, 0xFF, 0xF8, 0x00, 0x0C, 0x00, 0x00, 0x0C, 0x00, + 0x03, 0x0C, 0x40, 0x03, 0x0C, 0xE0, 0x06, 0x0C, 0x70, 0x0C, 0x0C, 0x38, 0x18, 0x0C, 0x1C, 0x30, + 0x7C, 0x08, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00), + + "南": (0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x3F, 0xFF, 0xFE, 0x30, + 0x18, 0x02, 0x00, 0x10, 0x00, 0x00, 0x30, 0x00, 0x3F, 0xFF, 0xFC, 0x30, 0x00, 0x0C, 0x30, 0x82, + 0x08, 0x30, 0xC3, 0x08, 0x30, 0x46, 0x08, 0x32, 0x06, 0x08, 0x33, 0xFF, 0xC8, 0x30, 0x18, 0x08, + 0x30, 0x18, 0x08, 0x37, 0xFF, 0xE8, 0x30, 0x18, 0x08, 0x30, 0x18, 0x08, 0x30, 0x18, 0x08, 0x30, + 0x18, 0x78, 0x30, 0x00, 0x38, 0x00, 0x00, 0x00), + + "西": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFC, 0x3F, 0xFF, 0xFC, 0x00, + 0x66, 0x00, 0x00, 0x66, 0x00, 0x00, 0x66, 0x00, 0x0F, 0xFF, 0xF0, 0x0F, 0xFF, 0xF0, 0x08, 0x46, + 0x10, 0x08, 0x46, 0x10, 0x08, 0x46, 0x10, 0x08, 0xC6, 0x10, 0x08, 0xC6, 0x10, 0x09, 0x83, 0xD0, + 0x0B, 0x83, 0xD0, 0x09, 0x00, 0x10, 0x08, 0x00, 0x10, 0x08, 0x00, 0x10, 0x0F, 0xFF, 0xF0, 0x08, + 0x00, 0x10, 0x08, 0x00, 0x10, 0x00, 0x00, 0x00), + + "北": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x00, 0x00, 0xC6, 0x00, 0x00, 0xC6, 0x00, 0x00, + 0xC6, 0x00, 0x00, 0xC6, 0x00, 0x00, 0xC6, 0x0C, 0x00, 0xC6, 0x1C, 0x3F, 0xC6, 0x78, 0x3F, 0xC7, + 0xE0, 0x00, 0xC7, 0x80, 0x00, 0xC6, 0x00, 0x00, 0xC6, 0x00, 0x00, 0xC6, 0x00, 0x00, 0xC6, 0x00, + 0x00, 0xC6, 0x00, 0x00, 0xC6, 0x00, 0x0F, 0xC6, 0x04, 0x7E, 0xC6, 0x06, 0x30, 0xC3, 0x0E, 0x00, + 0xC3, 0xFC, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00), + + "风": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xE0, 0x0F, 0xFF, 0xE0, 0x0C, 0x00, 0x60, 0x0C, + 0x00, 0x60, 0x0C, 0x00, 0x60, 0x0C, 0x83, 0x60, 0x0D, 0xC6, 0x60, 0x0C, 0xC6, 0x60, 0x0C, 0x64, + 0x60, 0x0C, 0x3C, 0x60, 0x08, 0x38, 0x60, 0x08, 0x18, 0x60, 0x08, 0x3C, 0x60, 0x08, 0x7C, 0x60, + 0x18, 0x66, 0x20, 0x18, 0xC3, 0x30, 0x1B, 0x83, 0x34, 0x31, 0x00, 0x36, 0x30, 0x00, 0x3E, 0x70, + 0x00, 0x1E, 0x60, 0x00, 0x0C, 0x00, 0x00, 0x00), + + "级": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x06, 0x7F, 0xF0, 0x0C, 0x7F, 0xF0, 0x0C, + 0x08, 0x20, 0x18, 0xC8, 0x60, 0x31, 0x88, 0x60, 0x31, 0x88, 0x60, 0x7F, 0x08, 0x40, 0x22, 0x08, + 0xFC, 0x06, 0x0C, 0x08, 0x0C, 0x0C, 0x18, 0x18, 0x1E, 0x18, 0x3F, 0x9A, 0x10, 0x3F, 0x9B, 0x30, + 0x20, 0x11, 0xB0, 0x00, 0xB1, 0xE0, 0x0F, 0xA0, 0xE0, 0x3E, 0x61, 0xE0, 0x20, 0xC3, 0xB0, 0x01, + 0x8F, 0x1C, 0x00, 0x1C, 0x0C, 0x00, 0x00, 0x00), + + "月": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xF0, 0x06, 0x00, 0x30, 0x06, + 0x00, 0x30, 0x06, 0x00, 0x30, 0x06, 0x00, 0x30, 0x07, 0xFF, 0xF0, 0x07, 0xFF, 0xF0, 0x06, 0x00, + 0x30, 0x06, 0x00, 0x30, 0x06, 0x00, 0x30, 0x07, 0xFF, 0xF0, 0x07, 0xFF, 0xF0, 0x06, 0x00, 0x30, + 0x06, 0x00, 0x30, 0x04, 0x00, 0x30, 0x0C, 0x00, 0x30, 0x0C, 0x00, 0x30, 0x18, 0x00, 0x60, 0x38, + 0x03, 0xE0, 0x30, 0x01, 0xC0, 0x00, 0x00, 0x00), + + "日": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xF0, 0x07, 0xFF, 0xF0, 0x06, 0x00, 0x30, 0x06, + 0x00, 0x30, 0x06, 0x00, 0x30, 0x06, 0x00, 0x30, 0x06, 0x00, 0x30, 0x06, 0x00, 0x30, 0x07, 0xFF, + 0xF0, 0x07, 0xFF, 0xF0, 0x06, 0x00, 0x30, 0x06, 0x00, 0x30, 0x06, 0x00, 0x30, 0x06, 0x00, 0x30, + 0x06, 0x00, 0x30, 0x06, 0x00, 0x30, 0x06, 0x00, 0x30, 0x07, 0xFF, 0xF0, 0x06, 0x00, 0x30, 0x06, + 0x00, 0x30, 0x06, 0x00, 0x30, 0x00, 0x00, 0x00), + '一': (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x7F, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,), + "二": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, + 0xFF, 0xF0, 0x0F, 0xFF, 0xF0, 0x0F, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x7F, 0xFF, 0xFE, 0x7F, 0xFF, 0xFE, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00), + + "三": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xF8, 0x1F, + 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x07, 0xFF, 0xE0, 0x07, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFE, 0x7F, + 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00), + + "四": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFC, 0x3F, 0xFF, 0xFC, 0x30, + 0x66, 0x08, 0x30, 0x66, 0x08, 0x30, 0x66, 0x08, 0x30, 0x46, 0x08, 0x30, 0x46, 0x08, 0x30, 0xC6, + 0x08, 0x30, 0xC6, 0x08, 0x31, 0x86, 0x08, 0x31, 0x86, 0x08, 0x33, 0x07, 0xC8, 0x36, 0x00, 0x08, + 0x30, 0x00, 0x08, 0x30, 0x00, 0x08, 0x30, 0x00, 0x08, 0x3F, 0xFF, 0xF8, 0x3F, 0xFF, 0xFC, 0x30, + 0x00, 0x0C, 0x30, 0x00, 0x0C, 0x00, 0x00, 0x00), + + "五": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xF8, 0x00, + 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x20, 0x00, 0x00, 0x20, 0x00, 0x0F, 0xFF, + 0xE0, 0x0F, 0xFF, 0xC0, 0x00, 0x60, 0x40, 0x00, 0x60, 0x40, 0x00, 0x60, 0xC0, 0x00, 0x60, 0xC0, + 0x00, 0x40, 0xC0, 0x00, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, 0x3F, 0xFF, 0xFE, 0x3F, + 0xFF, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00), + + "六": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x70, 0x00, 0x00, 0x38, 0x00, 0x00, + 0x18, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x10, 0x00, 0x3F, 0xFF, 0xFC, 0x3F, 0xFF, 0xFC, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xC3, 0x80, 0x01, 0xC1, 0x80, 0x01, 0x81, 0xC0, + 0x03, 0x80, 0xE0, 0x07, 0x00, 0x70, 0x0E, 0x00, 0x30, 0x1C, 0x00, 0x38, 0x1C, 0x00, 0x1C, 0x38, + 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00), + + "周": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xF8, 0x0C, 0x00, 0x18, 0x0C, + 0x18, 0x18, 0x0C, 0x18, 0x18, 0x0D, 0xFF, 0x98, 0x0C, 0x18, 0x18, 0x0C, 0x18, 0x18, 0x0F, 0xFF, + 0xD8, 0x0F, 0xFF, 0xD8, 0x0C, 0x00, 0x18, 0x08, 0x00, 0x18, 0x08, 0xFF, 0x18, 0x18, 0xC1, 0x18, + 0x18, 0xC1, 0x18, 0x18, 0xC1, 0x18, 0x18, 0xFF, 0x18, 0x30, 0xFF, 0x18, 0x30, 0x00, 0x18, 0x70, + 0x00, 0xF8, 0x20, 0x00, 0xF0, 0x00, 0x00, 0x00), + + "实": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x1F, + 0xFF, 0xFC, 0x18, 0x00, 0x1C, 0x18, 0x04, 0x1C, 0x19, 0x86, 0x1C, 0x01, 0xC6, 0x00, 0x00, 0x76, + 0x00, 0x0C, 0x26, 0x00, 0x0F, 0x06, 0x00, 0x03, 0x86, 0x00, 0x01, 0x06, 0x00, 0x3F, 0xFF, 0xFC, + 0x3F, 0xFF, 0xFC, 0x00, 0x0C, 0x00, 0x00, 0x19, 0x00, 0x00, 0x73, 0xC0, 0x01, 0xE0, 0xF0, 0x0F, + 0x80, 0x3C, 0x1E, 0x00, 0x1C, 0x10, 0x00, 0x00), + + "时": (0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x3F, 0x80, 0x30, 0x31, + 0x80, 0x30, 0x31, 0x80, 0x30, 0x31, 0xBF, 0xFE, 0x31, 0x80, 0x30, 0x31, 0x80, 0x30, 0x3F, 0x80, + 0x30, 0x31, 0x8C, 0x30, 0x31, 0x8C, 0x30, 0x31, 0x86, 0x30, 0x31, 0x86, 0x30, 0x31, 0x80, 0x30, + 0x3F, 0x80, 0x30, 0x3F, 0x80, 0x30, 0x31, 0x80, 0x30, 0x31, 0x80, 0x30, 0x30, 0x00, 0x30, 0x00, + 0x00, 0xF0, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00), + + "今": (0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x18, 0x00, 0x00, 0x38, 0x00, 0x00, 0x3C, 0x00, 0x00, + 0x66, 0x00, 0x00, 0xC3, 0x00, 0x01, 0x81, 0x80, 0x03, 0x01, 0xC0, 0x06, 0x30, 0xE0, 0x0C, 0x38, + 0x78, 0x38, 0x1C, 0x1E, 0x30, 0x08, 0x0C, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xF0, 0x07, 0xFF, 0xF0, + 0x00, 0x00, 0xE0, 0x00, 0x01, 0xC0, 0x00, 0x01, 0x80, 0x00, 0x03, 0x00, 0x00, 0x06, 0x00, 0x00, + 0x0E, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x04, 0x00), + + "天": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xF0, 0x00, 0x18, 0x00, 0x00, + 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x3F, 0xFF, 0xFC, 0x3F, 0xFF, + 0xFC, 0x00, 0x18, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x36, 0x00, 0x00, 0x66, 0x00, + 0x00, 0xE3, 0x00, 0x01, 0xC1, 0x80, 0x03, 0x81, 0xC0, 0x07, 0x00, 0xF0, 0x1E, 0x00, 0x3C, 0x7C, + 0x00, 0x1C, 0x30, 0x00, 0x04, 0x00, 0x00, 0x00), + + "气": (0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0xFF, 0xF8, 0x0E, + 0x00, 0x08, 0x0C, 0x00, 0x00, 0x18, 0x00, 0x00, 0x3B, 0xFF, 0xE0, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x1F, 0xFF, 0xE0, 0x1F, 0xFF, 0xE0, 0x00, 0x00, 0x60, 0x00, 0x00, 0x60, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x60, 0x00, 0x00, 0x60, 0x00, 0x00, 0x64, 0x00, 0x00, 0x66, 0x00, 0x00, 0x7E, 0x00, + 0x00, 0x3C, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00), + + "转": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x01, 0x80, 0x0C, 0x01, 0x80, 0x0C, 0x01, 0x00, 0x7F, + 0xDF, 0xFC, 0x7F, 0xDF, 0xFC, 0x18, 0x03, 0x00, 0x1B, 0x03, 0x00, 0x13, 0x22, 0x02, 0x33, 0x3F, + 0xFE, 0x63, 0x06, 0x00, 0x7F, 0xC6, 0x00, 0x23, 0x04, 0x00, 0x03, 0x0F, 0xF8, 0x03, 0x00, 0x38, + 0x03, 0xC0, 0x30, 0x7F, 0x80, 0x60, 0x63, 0x0C, 0xC0, 0x03, 0x07, 0x80, 0x03, 0x03, 0xC0, 0x03, + 0x00, 0xE0, 0x03, 0x00, 0x60, 0x00, 0x00, 0x00), + + "到": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x3F, 0xFC, 0x0C, 0x01, 0x80, 0x0C, 0x01, + 0x80, 0x8C, 0x02, 0x00, 0x8C, 0x04, 0x30, 0x8C, 0x08, 0x18, 0x8C, 0x1F, 0xFC, 0x8C, 0x19, 0x8C, + 0x8C, 0x01, 0x84, 0x8C, 0x01, 0x80, 0x8C, 0x01, 0x88, 0x8C, 0x3F, 0xFC, 0x8C, 0x01, 0x80, 0x8C, + 0x01, 0x80, 0x8C, 0x01, 0x80, 0x8C, 0x01, 0x84, 0x0C, 0x01, 0xF8, 0x0C, 0x1F, 0x00, 0x0C, 0x38, + 0x00, 0x78, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00), + + "晴": (0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x01, 0x80, 0x00, 0x3F, 0xFC, 0x3F, 0x3F, 0xFC, 0x23, + 0x01, 0x80, 0x23, 0x3F, 0xFC, 0x23, 0x3F, 0xFC, 0x23, 0x01, 0x80, 0x23, 0x7F, 0xFE, 0x3F, 0x7F, + 0xFE, 0x3F, 0x00, 0x00, 0x23, 0x1F, 0xF8, 0x23, 0x10, 0x08, 0x23, 0x10, 0x08, 0x23, 0x1F, 0xF8, + 0x23, 0x10, 0x08, 0x3F, 0x10, 0x08, 0x23, 0x1F, 0xF8, 0x23, 0x1F, 0xF8, 0x20, 0x10, 0x08, 0x00, + 0x10, 0x18, 0x00, 0x10, 0x38, 0x00, 0x00, 0x00), + + "阴": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xCF, 0xFC, 0x30, 0xCC, 0x08, 0x30, + 0x8C, 0x08, 0x31, 0x8C, 0x08, 0x31, 0x8C, 0x08, 0x31, 0x0F, 0xF8, 0x33, 0x0F, 0xF8, 0x33, 0x0C, + 0x08, 0x33, 0x0C, 0x08, 0x31, 0x8C, 0x08, 0x31, 0x8F, 0xF8, 0x30, 0xCF, 0xF8, 0x30, 0xCC, 0x08, + 0x30, 0xC8, 0x08, 0x37, 0x98, 0x08, 0x33, 0x18, 0x08, 0x30, 0x30, 0x08, 0x30, 0x70, 0x08, 0x30, + 0x60, 0x78, 0x30, 0xC0, 0x78, 0x00, 0x00, 0x00), + + "雨": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFE, 0x00, 0x18, 0x00, 0x00, + 0x18, 0x00, 0x00, 0x18, 0x00, 0x1F, 0xFF, 0xFC, 0x1F, 0xFF, 0xFC, 0x18, 0x18, 0x0C, 0x19, 0x19, + 0x0C, 0x19, 0x99, 0x8C, 0x18, 0xD8, 0xCC, 0x18, 0x18, 0x4C, 0x18, 0x18, 0x0C, 0x19, 0x18, 0x0C, + 0x1B, 0x99, 0x8C, 0x19, 0xD9, 0xCC, 0x18, 0x98, 0x0C, 0x18, 0x18, 0x0C, 0x18, 0x18, 0x0C, 0x18, + 0x18, 0x3C, 0x18, 0x00, 0x38, 0x00, 0x00, 0x00), + + "雷": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xF8, 0x18, 0x18, 0x18, 0x00, 0x18, 0x00, 0x7F, + 0xFF, 0xFE, 0x7F, 0xFF, 0xFE, 0x60, 0x18, 0x06, 0x67, 0x9B, 0xE6, 0x00, 0x18, 0x00, 0x07, 0x99, + 0xE0, 0x07, 0x99, 0xE0, 0x00, 0x18, 0x00, 0x0F, 0xFF, 0xF0, 0x0F, 0xFF, 0xF0, 0x0C, 0x18, 0x30, + 0x0C, 0x18, 0x30, 0x0F, 0xFF, 0xF0, 0x0C, 0x18, 0x30, 0x0C, 0x18, 0x30, 0x0C, 0x18, 0x30, 0x0F, + 0xFF, 0xF0, 0x0C, 0x00, 0x30, 0x00, 0x00, 0x00), + + "阵": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x3F, 0x07, 0x00, 0x33, 0x06, 0x00, 0x33, + 0x7F, 0xFC, 0x32, 0x7F, 0xFC, 0x36, 0x0C, 0x00, 0x36, 0x08, 0x00, 0x34, 0x19, 0x80, 0x36, 0x31, + 0x80, 0x32, 0x31, 0x80, 0x33, 0x7F, 0xFC, 0x31, 0x31, 0x80, 0x31, 0x81, 0x80, 0x31, 0x81, 0x80, + 0x3F, 0x01, 0x80, 0x36, 0x7F, 0xFE, 0x30, 0x7F, 0xFE, 0x30, 0x01, 0x80, 0x30, 0x01, 0x80, 0x30, + 0x01, 0x80, 0x30, 0x01, 0x80, 0x00, 0x00, 0x00), + + "多": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xC0, 0x00, 0x01, 0xFF, 0xE0, 0x03, + 0x00, 0xC0, 0x0E, 0x00, 0xC0, 0x1C, 0xC3, 0x80, 0x00, 0x67, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3A, + 0x00, 0x01, 0xE7, 0x00, 0x3F, 0x8F, 0xFC, 0x18, 0x1F, 0xFC, 0x00, 0x70, 0x18, 0x01, 0xF0, 0x18, + 0x07, 0x98, 0x30, 0x06, 0x0C, 0x60, 0x00, 0x07, 0xC0, 0x00, 0x07, 0x80, 0x00, 0x1E, 0x00, 0x07, + 0xF8, 0x00, 0x1F, 0xC0, 0x00, 0x00, 0x00, 0x00), + + "云": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xF0, 0x07, 0xFF, 0xF0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, + 0xFC, 0x00, 0x40, 0x00, 0x00, 0x70, 0x00, 0x00, 0x60, 0x00, 0x00, 0xC0, 0x00, 0x01, 0xC1, 0x80, + 0x01, 0x81, 0x80, 0x03, 0x00, 0xC0, 0x06, 0x00, 0x60, 0x0E, 0x00, 0xF0, 0x1F, 0xFF, 0xF8, 0x0F, + 0xC0, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00), + + "小": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, + 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x07, 0x18, 0xC0, 0x06, 0x18, 0xE0, 0x06, 0x18, + 0x60, 0x0E, 0x18, 0x70, 0x0C, 0x18, 0x30, 0x0C, 0x18, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1C, + 0x38, 0x18, 0x0C, 0x10, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, + 0xF8, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00), + + "大": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, + 0x18, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, 0x3F, 0xFF, 0xFC, 0x3F, 0xFF, 0xFC, 0x00, 0x18, + 0x00, 0x00, 0x38, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x66, 0x00, 0x00, 0x67, 0x00, + 0x00, 0xC3, 0x00, 0x01, 0xC1, 0x80, 0x03, 0x80, 0xC0, 0x0F, 0x00, 0xF0, 0x1E, 0x00, 0x38, 0x78, + 0x00, 0x1C, 0x30, 0x00, 0x08, 0x00, 0x00, 0x00), + + "暴": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xE0, 0x04, 0x00, 0x20, 0x04, 0x00, 0x20, 0x07, + 0xFF, 0xE0, 0x04, 0x00, 0x20, 0x07, 0xFF, 0xE0, 0x00, 0xC3, 0x00, 0x00, 0xC3, 0x00, 0x1F, 0xFF, + 0xF8, 0x00, 0xC3, 0x00, 0x00, 0xC3, 0x00, 0x3F, 0xFF, 0xFC, 0x01, 0x81, 0x80, 0x07, 0x18, 0xE0, + 0x3D, 0x18, 0xBC, 0x33, 0x9D, 0xCC, 0x00, 0xFF, 0x00, 0x03, 0xDB, 0xC0, 0x1F, 0x18, 0xF0, 0x08, + 0x78, 0x30, 0x00, 0x30, 0x10, 0x00, 0x00, 0x00), + + "雾": (0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x07, 0xFF, 0xE0, 0x00, 0x18, 0x00, 0x0F, 0xFF, 0xF8, 0x10, + 0x18, 0x08, 0x13, 0xDB, 0xD0, 0x00, 0x18, 0x00, 0x03, 0xDB, 0xC0, 0x00, 0x80, 0x00, 0x01, 0xFF, + 0x80, 0x02, 0x81, 0x80, 0x0C, 0x62, 0x00, 0x10, 0x1C, 0x00, 0x00, 0xE7, 0xFE, 0x1F, 0x20, 0x78, + 0x20, 0x10, 0x00, 0x07, 0xFF, 0xE0, 0x00, 0x20, 0x40, 0x00, 0x60, 0x40, 0x00, 0xC0, 0x80, 0x03, + 0x07, 0x80, 0x1C, 0x03, 0x00, 0x00, 0x00, 0x00), + + "雪": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0F, 0xFF, 0xF0, 0x00, 0x10, 0x00, 0x10, + 0x10, 0x00, 0x1F, 0xFF, 0xFC, 0x10, 0x10, 0x08, 0x37, 0xD3, 0xF0, 0x20, 0x10, 0x00, 0x00, 0x10, + 0x00, 0x07, 0xD3, 0xE0, 0x00, 0x10, 0x20, 0x0F, 0xFF, 0xF0, 0x00, 0x00, 0x20, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x20, 0x07, 0xFF, 0xE0, 0x00, 0x00, 0x20, 0x00, 0x00, 0x20, 0x1F, 0xFF, 0xE0, 0x00, + 0x00, 0x20, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00), + + "夹": (0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x18, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x1F, + 0xFF, 0xF0, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x04, 0x10, 0xC0, 0x02, 0x10, 0x80, 0x03, 0x11, + 0x80, 0x01, 0x11, 0x00, 0x01, 0x32, 0x08, 0x7F, 0xFF, 0xFC, 0x00, 0x24, 0x00, 0x00, 0x24, 0x00, + 0x00, 0x62, 0x00, 0x00, 0x42, 0x00, 0x00, 0x81, 0x80, 0x01, 0x00, 0xC0, 0x06, 0x00, 0x70, 0x18, + 0x00, 0x1E, 0x60, 0x00, 0x08, 0x00, 0x00, 0x00), + + "℃": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x24, 0x00, 0x00, 0x24, 0x03, 0x00, 0x24, + 0x1F, 0xE0, 0x18, 0x38, 0x70, 0x00, 0x60, 0x18, 0x00, 0xC0, 0x1C, 0x00, 0xC0, 0x00, 0x00, 0xC0, + 0x00, 0x00, 0x80, 0x00, 0x01, 0x80, 0x00, 0x01, 0x80, 0x00, 0x01, 0x80, 0x00, 0x00, 0xC0, 0x00, + 0x00, 0xC0, 0x0C, 0x00, 0xC0, 0x18, 0x00, 0x60, 0x38, 0x00, 0x38, 0xF0, 0x00, 0x1F, 0xE0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00), + + "%": (0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0F, + 0x80, 0x18, 0x18, 0xC0, 0x30, 0x18, 0xC0, 0x60, 0x18, 0x40, 0xC0, 0x18, 0xC3, 0x80, 0x18, 0xC7, + 0x00, 0x0D, 0x8E, 0x00, 0x07, 0x1C, 0x00, 0x00, 0x39, 0xF0, 0x00, 0x73, 0x10, 0x00, 0xE3, 0x18, + 0x01, 0xC2, 0x18, 0x03, 0x02, 0x18, 0x06, 0x03, 0x18, 0x0C, 0x03, 0x10, 0x08, 0x01, 0xF0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00), + +} + +hanzi_16x16_dict = { + "确": ( + 0x0, 0x70, 0x7f, 0x7f, 0x7f, 0xfe, 0x19, 0xce, 0x1b, 0xff, 0x3e, 0xff, 0x3e, 0xd9, 0x76, 0xff, 0xf6, 0xff, 0xf6, + 0xd9, 0x76, 0xff, 0x3e, 0xff, 0x3f, 0xd9, 0x37, 0x9f, 0x37, 0x9f, 0x3, 0x1f,), + "诊": ( + 0x0, 0x70, 0x30, 0x70, 0x38, 0xf0, 0x38, 0xd8, 0x19, 0xdc, 0xf3, 0xaf, 0xff, 0x77, 0xf6, 0xe9, 0x33, 0xdc, 0x33, + 0xb8, 0x31, 0x76, 0x35, 0xef, 0x3f, 0xdc, 0x3c, 0x78, 0x3b, 0xf0, 0x3, 0xc0,), + "新": ( + 0xe, 0x0, 0xe, 0x3f, 0x7f, 0xff, 0x7f, 0xb0, 0x3b, 0xb0, 0x5b, 0x3f, 0x7f, 0xff, 0x6c, 0xbf, 0x7f, 0xf6, 0x7f, + 0xf6, 0x3f, 0x66, 0x3f, 0xe6, 0x7d, 0xe6, 0xfd, 0xe6, 0x1d, 0xc6, 0x18, 0xc6,), + "增": ( + 0x38, 0xe6, 0x38, 0x6e, 0x3b, 0xff, 0x3b, 0xff, 0xff, 0xdf, 0xff, 0xff, 0x3b, 0xfd, 0x3b, 0xff, 0x3b, 0xff, + 0x39, 0xff, 0x3f, 0xff, 0x7f, 0xff, 0xfd, 0xff, 0x61, 0xff, 0x1, 0xff, 0x1, 0x83,), + "无": ( + 0x1f, 0xfe, 0x1f, 0xfe, 0x11, 0xc2, 0x1, 0x80, 0x1, 0x80, 0x7f, 0xff, 0x7f, 0xff, 0x1, 0xe0, 0x3, 0xe0, 0x3, + 0x60, 0x7, 0x60, 0xe, 0x63, 0x1c, 0x63, 0x78, 0x7f, 0x70, 0x3f, 0x0, 0x0,), + "症": ( + 0x0, 0x60, 0x1f, 0xff, 0x1f, 0xff, 0x7c, 0x0, 0x7c, 0x0, 0x7f, 0xff, 0x7f, 0xff, 0x1c, 0x38, 0x7f, 0xbf, 0x7d, + 0xbf, 0x59, 0xb9, 0x19, 0xb8, 0x39, 0xb8, 0x37, 0xff, 0x77, 0xff, 0x20, 0x0,), + "状": ( + 0xc, 0x30, 0xc, 0x34, 0xc, 0x3e, 0x6c, 0x37, 0x7c, 0x36, 0x3f, 0xff, 0x3f, 0xff, 0xc, 0x70, 0x1c, 0x70, 0x3c, + 0x78, 0xfc, 0x78, 0x6c, 0xfc, 0x4c, 0xce, 0xd, 0xcf, 0xf, 0x87, 0xd, 0x2,), + " ": ( + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,), + "期": ( + 0x39, 0xbf, 0x7f, 0xff, 0x7f, 0xf3, 0x7f, 0xf3, 0x3f, 0xbf, 0x3f, 0xbf, 0x39, 0xb3, 0x3f, 0xb3, 0x3f, 0xbf, + 0x39, + 0xbf, 0xff, 0xff, 0xff, 0xf3, 0x3b, 0xe3, 0x73, 0xe3, 0x61, 0xcf, 0x0, 0xc7,), + "日": ( + 0x3f, 0xfe, 0x30, 0xe, 0x30, 0xe, 0x30, 0xe, 0x30, 0xe, 0x3f, 0xfe, 0x3f, 0xfe, 0x3f, 0xfe, 0x30, 0xe, 0x30, + 0xe, + 0x30, 0xe, 0x30, 0xe, 0x3f, 0xfe, 0x3f, 0xfe, 0x30, 0xe, 0x30, 0xc,) +} diff --git a/code/data/IdCard.txt b/code/data/IdCard.txt new file mode 100644 index 0000000..54a221a --- /dev/null +++ b/code/data/IdCard.txt @@ -0,0 +1,794 @@ +{ +"北京市":"110000", +"天津市":"120000", +"河北省":"130000", +"石家庄市":"130100", +"辛集市":"130181", +"晋州市":"130183", +"新乐市":"130184", +"唐山市":"130200", +"遵化市":"130281", +"迁安市":"130283", +"滦州市":"130284", +"秦皇岛市":"130300", +"邯郸市":"130400", +"武安市":"130481", +"邢台市":"130500", +"南宫市":"130581", +"沙河市":"130582", +"保定市":"130600", +"涿州市":"130681", +"定州市":"130682", +"安国市":"130683", +"高碑店市":"130684", +"张家口市":"130700", +"承德市":"130800", +"平泉市":"130881", +"沧州市":"130900", +"泊头市":"130981", +"任丘市":"130982", +"黄骅市":"130983", +"河间市":"130984", +"廊坊市":"131000", +"霸州市":"131081", +"三河市":"131082", +"衡水市":"131100", +"深州市":"131182", +"山西省":"140000", +"太原市":"140100", +"古交市":"140181", +"大同市":"140200", +"阳泉市":"140300", +"长治市":"140400", +"晋城市":"140500", +"高平市":"140581", +"朔州市":"140600", +"怀仁市":"140681", +"晋中市":"140700", +"介休市":"140781", +"运城市":"140800", +"永济市":"140881", +"河津市":"140882", +"忻州市":"140900", +"原平市":"140981", +"临汾市":"141000", +"侯马市":"141081", +"霍州市":"141082", +"吕梁市":"141100", +"孝义市":"141181", +"汾阳市":"141182", +"呼和浩特市":"150100", +"土默特左旗":"150121", +"包头市":"150200", +"土默特右旗":"150221", +"达尔罕茂明安联合旗":"150223", +"乌海市":"150300", +"赤峰市":"150400", +"阿鲁科尔沁旗":"150421", +"巴林左旗":"150422", +"巴林右旗":"150423", +"克什克腾旗":"150425", +"翁牛特旗":"150426", +"喀喇沁旗":"150428", +"敖汉旗":"150430", +"通辽市":"150500", +"科尔沁左翼中旗":"150521", +"科尔沁左翼后旗":"150522", +"库伦旗":"150524", +"奈曼旗":"150525", +"扎鲁特旗":"150526", +"霍林郭勒市":"150581", +"鄂尔多斯市":"150600", +"达拉特旗":"150621", +"准格尔旗":"150622", +"鄂托克前旗":"150623", +"鄂托克旗":"150624", +"杭锦旗":"150625", +"乌审旗":"150626", +"伊金霍洛旗":"150627", +"呼伦贝尔市":"150700", +"阿荣旗":"150721", +"莫力达瓦达斡尔族自治旗":"150722", +"鄂伦春自治旗":"150723", +"鄂温克族自治旗":"150724", +"陈巴尔虎旗":"150725", +"新巴尔虎左旗":"150726", +"新巴尔虎右旗":"150727", +"满洲里市":"150781", +"牙克石市":"150782", +"扎兰屯市":"150783", +"额尔古纳市":"150784", +"根河市":"150785", +"巴彦淖尔市":"150800", +"乌拉特前旗":"150823", +"乌拉特中旗":"150824", +"乌拉特后旗":"150825", +"杭锦后旗":"150826", +"乌兰察布市":"150900", +"察哈尔右翼前旗":"150926", +"察哈尔右翼中旗":"150927", +"察哈尔右翼后旗":"150928", +"四子王旗":"150929", +"丰镇市":"150981", +"兴安盟":"152200", +"乌兰浩特市":"152201", +"阿尔山市":"152202", +"科尔沁右翼前旗":"152221", +"科尔沁右翼中旗":"152222", +"扎赉特旗":"152223", +"锡林郭勒盟":"152500", +"二连浩特市":"152501", +"锡林浩特市":"152502", +"阿巴嘎旗":"152522", +"苏尼特左旗":"152523", +"苏尼特右旗":"152524", +"东乌珠穆沁旗":"152525", +"西乌珠穆沁旗":"152526", +"太仆寺旗":"152527", +"镶黄旗":"152528", +"正镶白旗":"152529", +"正蓝旗":"152530", +"阿拉善盟":"152900", +"阿拉善左旗":"152921", +"阿拉善右旗":"152922", +"额济纳旗":"152923", +"辽宁省":"210000", +"沈阳市":"210100", +"新民市":"210181", +"大连市":"210200", +"瓦房店市":"210281", +"庄河市":"210283", +"鞍山市":"210300", +"海城市":"210381", +"抚顺市":"210400", +"本溪市":"210500", +"丹东市":"210600", +"东港市":"210681", +"凤城市":"210682", +"锦州市":"210700", +"凌海市":"210781", +"北镇市":"210782", +"营口市":"210800", +"盖州市":"210881", +"大石桥市":"210882", +"阜新市":"210900", +"辽阳市":"211000", +"灯塔市":"211081", +"盘锦市":"211100", +"铁岭市":"211200", +"调兵山市":"211281", +"开原市":"211282", +"朝阳市":"211300", +"北票市":"211381", +"凌源市":"211382", +"葫芦岛市":"211400", +"兴城市":"211481", +"吉林省":"220000", +"长春市":"220100", +"榆树市":"220182", +"德惠市":"220183", +"吉林市":"220200", +"蛟河市":"220281", +"桦甸市":"220282", +"舒兰市":"220283", +"磐石市":"220284", +"四平市":"220300", +"公主岭市":"220381", +"双辽市":"220382", +"辽源市":"220400", +"通化市":"220500", +"梅河口市":"220581", +"集安市":"220582", +"白山市":"220600", +"临江市":"220681", +"松原市":"220700", +"扶余市":"220781", +"白城市":"220800", +"洮南市":"220881", +"大安市":"220882", +"延边朝鲜族自治州":"222400", +"延吉市":"222401", +"图们市":"222402", +"敦化市":"222403", +"珲春市":"222404", +"龙井市":"222405", +"和龙市":"222406", +"黑龙江省":"230000", +"哈尔滨市":"230100", +"尚志市":"230183", +"五常市":"230184", +"齐齐哈尔市":"230200", +"讷河市":"230281", +"鸡西市":"230300", +"虎林市":"230381", +"密山市":"230382", +"鹤岗市":"230400", +"双鸭山市":"230500", +"大庆市":"230600", +"伊春市":"230700", +"铁力市":"230781", +"佳木斯市":"230800", +"同江市":"230881", +"富锦市":"230882", +"抚远市":"230883", +"七台河市":"230900", +"牡丹江市":"231000", +"绥芬河市":"231081", +"海林市":"231083", +"宁安市":"231084", +"穆棱市":"231085", +"东宁市":"231086", +"黑河市":"231100", +"北安市":"231181", +"五大连池市":"231182", +"嫩江市":"231183", +"绥化市":"231200", +"安达市":"231281", +"肇东市":"231282", +"海伦市":"231283", +"漠河市":"232701", +"上海市":"310000", +"江苏省":"320000", +"南京市":"320100", +"无锡市":"320200", +"江阴市":"320281", +"宜兴市":"320282", +"徐州市":"320300", +"新沂市":"320381", +"邳州市":"320382", +"常州市":"320400", +"溧阳市":"320481", +"苏州市":"320500", +"常熟市":"320581", +"张家港市":"320582", +"昆山市":"320583", +"太仓市":"320585", +"南通市":"320600", +"启东市":"320681", +"如皋市":"320682", +"海门市":"320684", +"海安市":"320685", +"连云港市":"320700", +"淮安市":"320800", +"盐城市":"320900", +"东台市":"320981", +"扬州市":"321000", +"仪征市":"321081", +"高邮市":"321084", +"镇江市":"321100", +"丹阳市":"321181", +"扬中市":"321182", +"句容市":"321183", +"泰州市":"321200", +"兴化市":"321281", +"靖江市":"321282", +"泰兴市":"321283", +"宿迁市":"321300", +"浙江省":"330000", +"杭州市":"330100", +"建德市":"330182", +"宁波市":"330200", +"余姚市":"330281", +"慈溪市":"330282", +"温州市":"330300", +"瑞安市":"330381", +"乐清市":"330382", +"龙港市":"330383", +"嘉兴市":"330400", +"海宁市":"330481", +"平湖市":"330482", +"桐乡市":"330483", +"湖州市":"330500", +"绍兴市":"330600", +"诸暨市":"330681", +"嵊州市":"330683", +"金华市":"330700", +"兰溪市":"330781", +"义乌市":"330782", +"东阳市":"330783", +"永康市":"330784", +"衢州市":"330800", +"江山市":"330881", +"舟山市":"330900", +"台州市":"331000", +"温岭市":"331081", +"临海市":"331082", +"玉环市":"331083", +"丽水市":"331100", +"龙泉市":"331181", +"安徽省":"340000", +"合肥市":"340100", +"巢湖市":"340181", +"芜湖市":"340200", +"无为市":"340281", +"蚌埠市":"340300", +"淮南市":"340400", +"马鞍山市":"340500", +"淮北市":"340600", +"铜陵市":"340700", +"安庆市":"340800", +"桐城市":"340881", +"潜山市":"340882", +"黄山市":"341000", +"滁州市":"341100", +"天长市":"341181", +"明光市":"341182", +"阜阳市":"341200", +"界首市":"341282", +"宿州市":"341300", +"六安市":"341500", +"亳州市":"341600", +"池州市":"341700", +"宣城市":"341800", +"宁国市":"341881", +"广德市":"341882", +"福建省":"350000", +"福州市":"350100", +"福清市":"350181", +"厦门市":"350200", +"莆田市":"350300", +"三明市":"350400", +"永安市":"350481", +"泉州市":"350500", +"石狮市":"350581", +"晋江市":"350582", +"南安市":"350583", +"漳州市":"350600", +"龙海市":"350681", +"南平市":"350700", +"邵武市":"350781", +"武夷山市":"350782", +"建瓯市":"350783", +"龙岩市":"350800", +"漳平市":"350881", +"宁德市":"350900", +"福安市":"350981", +"福鼎市":"350982", +"江西省":"360000", +"南昌市":"360100", +"景德镇市":"360200", +"乐平市":"360281", +"萍乡市":"360300", +"九江市":"360400", +"瑞昌市":"360481", +"共青城市":"360482", +"庐山市":"360483", +"新余市":"360500", +"鹰潭市":"360600", +"贵溪市":"360681", +"赣州市":"360700", +"瑞金市":"360781", +"吉安市":"360800", +"井冈山市":"360881", +"宜春市":"360900", +"丰城市":"360981", +"樟树市":"360982", +"高安市":"360983", +"抚州市":"361000", +"上饶市":"361100", +"德兴市":"361181", +"山东省":"370000", +"济南市":"370100", +"青岛市":"370200", +"胶州市":"370281", +"平度市":"370283", +"莱西市":"370285", +"淄博市":"370300", +"枣庄市":"370400", +"滕州市":"370481", +"东营市":"370500", +"烟台市":"370600", +"龙口市":"370681", +"莱阳市":"370682", +"莱州市":"370683", +"蓬莱市":"370684", +"招远市":"370685", +"栖霞市":"370686", +"海阳市":"370687", +"潍坊市":"370700", +"青州市":"370781", +"诸城市":"370782", +"寿光市":"370783", +"安丘市":"370784", +"高密市":"370785", +"昌邑市":"370786", +"济宁市":"370800", +"曲阜市":"370881", +"邹城市":"370883", +"泰安市":"370900", +"新泰市":"370982", +"肥城市":"370983", +"威海市":"371000", +"荣成市":"371082", +"乳山市":"371083", +"日照市":"371100", +"临沂市":"371300", +"德州市":"371400", +"乐陵市":"371481", +"禹城市":"371482", +"聊城市":"371500", +"临清市":"371581", +"滨州市":"371600", +"邹平市":"371681", +"菏泽市":"371700", +"河南省":"410000", +"郑州市":"410100", +"巩义市":"410181", +"荥阳市":"410182", +"新密市":"410183", +"新郑市":"410184", +"登封市":"410185", +"开封市":"410200", +"洛阳市":"410300", +"偃师市":"410381", +"平顶山市":"410400", +"舞钢市":"410481", +"汝州市":"410482", +"安阳市":"410500", +"林州市":"410581", +"鹤壁市":"410600", +"新乡市":"410700", +"卫辉市":"410781", +"辉县市":"410782", +"长垣市":"410783", +"焦作市":"410800", +"沁阳市":"410882", +"孟州市":"410883", +"濮阳市":"410900", +"许昌市":"411000", +"禹州市":"411081", +"长葛市":"411082", +"漯河市":"411100", +"三门峡市":"411200", +"义马市":"411281", +"灵宝市":"411282", +"南阳市":"411300", +"邓州市":"411381", +"商丘市":"411400", +"永城市":"411481", +"信阳市":"411500", +"周口市":"411600", +"项城市":"411681", +"驻马店市":"411700", +"济源市":"419001", +"湖北省":"420000", +"武汉市":"420100", +"黄石市":"420200", +"大冶市":"420281", +"十堰市":"420300", +"丹江口市":"420381", +"宜昌市":"420500", +"宜都市":"420581", +"当阳市":"420582", +"枝江市":"420583", +"襄阳市":"420600", +"老河口市":"420682", +"枣阳市":"420683", +"宜城市":"420684", +"鄂州市":"420700", +"荆门市":"420800", +"钟祥市":"420881", +"京山市":"420882", +"孝感市":"420900", +"应城市":"420981", +"安陆市":"420982", +"汉川市":"420984", +"荆州市":"421000", +"石首市":"421081", +"洪湖市":"421083", +"松滋市":"421087", +"黄冈市":"421100", +"麻城市":"421181", +"武穴市":"421182", +"咸宁市":"421200", +"赤壁市":"421281", +"随州市":"421300", +"广水市":"421381", +"恩施土家族苗族自治州":"422800", +"恩施市":"422801", +"利川市":"422802", +"仙桃市":"429004", +"潜江市":"429005", +"天门市":"429006", +"湖南省":"430000", +"长沙市":"430100", +"浏阳市":"430181", +"宁乡市":"430182", +"株洲市":"430200", +"醴陵市":"430281", +"湘潭市":"430300", +"湘乡市":"430381", +"韶山市":"430382", +"衡阳市":"430400", +"耒阳市":"430481", +"常宁市":"430482", +"邵阳市":"430500", +"武冈市":"430581", +"邵东市":"430582", +"岳阳市":"430600", +"汨罗市":"430681", +"临湘市":"430682", +"常德市":"430700", +"津市市":"430781", +"张家界市":"430800", +"益阳市":"430900", +"沅江市":"430981", +"郴州市":"431000", +"资兴市":"431081", +"永州市":"431100", +"怀化市":"431200", +"洪江市":"431281", +"娄底市":"431300", +"冷水江市":"431381", +"涟源市":"431382", +"湘西土家族苗族自治州":"433100", +"吉首市":"433101", +"广东省":"440000", +"广州市":"440100", +"韶关市":"440200", +"乐昌市":"440281", +"南雄市":"440282", +"深圳市":"440300", +"珠海市":"440400", +"汕头市":"440500", +"佛山市":"440600", +"江门市":"440700", +"台山市":"440781", +"开平市":"440783", +"鹤山市":"440784", +"恩平市":"440785", +"湛江市":"440800", +"廉江市":"440881", +"雷州市":"440882", +"吴川市":"440883", +"茂名市":"440900", +"高州市":"440981", +"化州市":"440982", +"信宜市":"440983", +"肇庆市":"441200", +"四会市":"441284", +"惠州市":"441300", +"梅州市":"441400", +"兴宁市":"441481", +"汕尾市":"441500", +"陆丰市":"441581", +"河源市":"441600", +"阳江市":"441700", +"阳春市":"441781", +"清远市":"441800", +"英德市":"441881", +"连州市":"441882", +"东莞市":"441900", +"中山市":"442000", +"潮州市":"445100", +"揭阳市":"445200", +"普宁市":"445281", +"云浮市":"445300", +"罗定市":"445381", +"南宁市":"450100", +"柳州市":"450200", +"桂林市":"450300", +"荔浦市":"450381", +"梧州市":"450400", +"岑溪市":"450481", +"北海市":"450500", +"防城港市":"450600", +"东兴市":"450681", +"钦州市":"450700", +"贵港市":"450800", +"桂平市":"450881", +"玉林市":"450900", +"北流市":"450981", +"百色市":"451000", +"靖西市":"451081", +"平果市":"451082", +"贺州市":"451100", +"河池市":"451200", +"来宾市":"451300", +"合山市":"451381", +"崇左市":"451400", +"凭祥市":"451481", +"海南省":"460000", +"海口市":"460100", +"三亚市":"460200", +"三沙市":"460300", +"儋州市":"460400", +"五指山市":"469001", +"琼海市":"469002", +"文昌市":"469005", +"万宁市":"469006", +"东方市":"469007", +"重庆市":"500000", +"四川省":"510000", +"成都市":"510100", +"都江堰市":"510181", +"彭州市":"510182", +"邛崃市":"510183", +"崇州市":"510184", +"简阳市":"510185", +"自贡市":"510300", +"攀枝花市":"510400", +"泸州市":"510500", +"德阳市":"510600", +"广汉市":"510681", +"什邡市":"510682", +"绵竹市":"510683", +"绵阳市":"510700", +"江油市":"510781", +"广元市":"510800", +"遂宁市":"510900", +"射洪市":"510981", +"内江市":"511000", +"隆昌市":"511083", +"乐山市":"511100", +"峨眉山市":"511181", +"南充市":"511300", +"阆中市":"511381", +"眉山市":"511400", +"宜宾市":"511500", +"广安市":"511600", +"华蓥市":"511681", +"达州市":"511700", +"万源市":"511781", +"雅安市":"511800", +"巴中市":"511900", +"资阳市":"512000", +"阿坝藏族羌族自治州":"513200", +"马尔康市":"513201", +"甘孜藏族自治州":"513300", +"康定市":"513301", +"凉山彝族自治州":"513400", +"西昌市":"513401", +"贵州省":"520000", +"贵阳市":"520100", +"清镇市":"520181", +"六盘水市":"520200", +"盘州市":"520281", +"遵义市":"520300", +"赤水市":"520381", +"仁怀市":"520382", +"安顺市":"520400", +"毕节市":"520500", +"铜仁市":"520600", +"黔西南布依族苗族自治州":"522300", +"兴义市":"522301", +"兴仁市":"522302", +"黔东南苗族侗族自治州":"522600", +"凯里市":"522601", +"黔南布依族苗族自治州":"522700", +"都匀市":"522701", +"福泉市":"522702", +"云南省":"530000", +"昆明市":"530100", +"安宁市":"530181", +"曲靖市":"530300", +"宣威市":"530381", +"玉溪市":"530400", +"澄江市":"530481", +"保山市":"530500", +"腾冲市":"530581", +"昭通市":"530600", +"水富市":"530681", +"丽江市":"530700", +"普洱市":"530800", +"临沧市":"530900", +"楚雄彝族自治州":"532300", +"楚雄市":"532301", +"红河哈尼族彝族自治州":"532500", +"个旧市":"532501", +"开远市":"532502", +"蒙自市":"532503", +"弥勒市":"532504", +"文山壮族苗族自治州":"532600", +"文山市":"532601", +"西双版纳傣族自治州":"532800", +"景洪市":"532801", +"大理白族自治州":"532900", +"大理市":"532901", +"德宏傣族景颇族自治州":"533100", +"瑞丽市":"533102", +"芒市":"533103", +"怒江傈僳族自治州":"533300", +"泸水市":"533301", +"迪庆藏族自治州":"533400", +"香格里拉市":"533401", +"拉萨市":"540100", +"日喀则市":"540200", +"昌都市":"540300", +"林芝市":"540400", +"山南市":"540500", +"那曲市":"540600", +"陕西省":"610000", +"西安市":"610100", +"铜川市":"610200", +"宝鸡市":"610300", +"咸阳市":"610400", +"兴平市":"610481", +"彬州市":"610482", +"渭南市":"610500", +"韩城市":"610581", +"华阴市":"610582", +"延安市":"610600", +"子长市":"610681", +"汉中市":"610700", +"榆林市":"610800", +"神木市":"610881", +"安康市":"610900", +"商洛市":"611000", +"甘肃省":"620000", +"兰州市":"620100", +"嘉峪关市":"620200", +"金昌市":"620300", +"白银市":"620400", +"天水市":"620500", +"武威市":"620600", +"张掖市":"620700", +"平凉市":"620800", +"华亭市":"620881", +"酒泉市":"620900", +"玉门市":"620981", +"敦煌市":"620982", +"庆阳市":"621000", +"定西市":"621100", +"陇南市":"621200", +"临夏回族自治州":"622900", +"临夏市":"622901", +"甘南藏族自治州":"623000", +"合作市":"623001", +"青海省":"630000", +"西宁市":"630100", +"海东市":"630200", +"海北藏族自治州":"632200", +"黄南藏族自治州":"632300", +"海南藏族自治州":"632500", +"果洛藏族自治州":"632600", +"玉树藏族自治州":"632700", +"玉树市":"632701", +"海西蒙古族藏族自治州":"632800", +"格尔木市":"632801", +"德令哈市":"632802", +"茫崖市":"632803", +"银川市":"640100", +"灵武市":"640181", +"石嘴山市":"640200", +"吴忠市":"640300", +"青铜峡市":"640381", +"固原市":"640400", +"中卫市":"640500", +"乌鲁木齐市":"650100", +"克拉玛依市":"650200", +"吐鲁番市":"650400", +"哈密市":"650500", +"昌吉回族自治州":"652300", +"昌吉市":"652301", +"阜康市":"652302", +"博尔塔拉蒙古自治州":"652700", +"博乐市":"652701", +"阿拉山口市":"652702", +"巴音郭楞蒙古自治州":"652800", +"库尔勒市":"652801", +"阿克苏市":"652901", +"库车市":"652902", +"克孜勒苏柯尔克孜自治州":"653000", +"阿图什市":"653001", +"喀什市":"653101", +"和田市":"653201", +"伊犁哈萨克自治州":"654000", +"伊宁市":"654002", +"奎屯市":"654003", +"霍尔果斯市":"654004", +"塔城市":"654201", +"乌苏市":"654202", +"阿勒泰市":"654301", +"石河子市":"659001", +"阿拉尔市":"659002", +"图木舒克市":"659003", +"五家渠市":"659004", +"北屯市":"659005", +"铁门关市":"659006", +"双河市":"659007", +"可克达拉市":"659008", +"昆玉市":"659009", +"胡杨河市":"659010", +"台湾省":"710000", +} \ No newline at end of file diff --git a/code/data/picture/default/1.jpg b/code/data/picture/default/1.jpg deleted file mode 100644 index e21550a..0000000 Binary files a/code/data/picture/default/1.jpg and /dev/null differ diff --git a/code/data/picture/default/2.jpg b/code/data/picture/default/2.jpg deleted file mode 100644 index 205f0a1..0000000 Binary files a/code/data/picture/default/2.jpg and /dev/null differ diff --git a/code/data/picture/default/3.jpg b/code/data/picture/default/3.jpg deleted file mode 100644 index 4597489..0000000 Binary files a/code/data/picture/default/3.jpg and /dev/null differ diff --git a/code/data/picture/default/4.jpg b/code/data/picture/default/4.jpg deleted file mode 100644 index 0b124d8..0000000 Binary files a/code/data/picture/default/4.jpg and /dev/null differ diff --git a/code/libs/color.py b/code/libs/color.py new file mode 100644 index 0000000..e278076 --- /dev/null +++ b/code/libs/color.py @@ -0,0 +1,25 @@ +import random + +# 定义常用颜色 +RED = (255, 0, 0) +ORANGE = (255, 255, 0) +YELLOW = (0, 255, 255) +GREEN = (0, 255, 0) +CYAN = (0, 255, 255) +BLUE = (0, 0, 255) +PURPLE = (255, 0, 200) +BLACK = (0, 0, 0) +WHITE = (255, 255, 255) +RGB_COLOR = [RED, ORANGE, YELLOW, GREEN, CYAN, BLUE, PURPLE] +DEEPGREEN = (1, 179, 105) + +def getRandomColor(): + global RGB_COLOR + randint = random.randint(0, len(RGB_COLOR) - 1) + return RGB_COLOR[randint] + + +if __name__ == '__main__': + for i in range(20): + color = getRandomColor() + print(color) diff --git a/code/libs/tool.py b/code/libs/tool.py new file mode 100644 index 0000000..a235dcd --- /dev/null +++ b/code/libs/tool.py @@ -0,0 +1,54 @@ +from libs import global_var +from data.Fonts import fonts +d = global_var.LCD +# 中文显示 +def printChinese(text, x, y, color=(0, 0, 0), backcolor=(255, 255, 255), size=1): + font_size = [0, 16, 24, 32, 40, 48] # 分别对应size=1,2,3,4,5的字体尺寸,0无效。 + + chinese_dict = {} + + # 获取对应的字模 + if size == 1: + chinese_dict = fonts.hanzi_16x16_dict + + elif size == 2: + chinese_dict = fonts.hanzi_24x24_dict + + elif size == 3: + chinese_dict = fonts.hanzi_32x32_dict + + elif size == 4: + chinese_dict = fonts.hanzi_40x40_dict + + elif size == 5: + chinese_dict = fonts.hanzi_48x48_dict + + xs = x + ys = y + + # 定义字体颜色,RGB888转RGB565 + fc = ((color[0] >> 3) << 11) + ((color[1] >> 2) << 5) + (color[2] >> 3) # 字体 + bc = ((backcolor[0] >> 3) << 11) + ((backcolor[1] >> 2) << 5) + (backcolor[2] >> 3) # 字体背景颜色 + + for i in range(0, len(text)): + + ch_buf = chinese_dict[text[i]] # 汉子对应码表 + + rgb_buf = [] + + t1 = font_size[size] // 8 + t2 = font_size[size] % 8 + + for i in range(0, len(ch_buf)): + + for j in range(0, 8): + if (ch_buf[i] << j) & 0x80 == 0x00: + rgb_buf.append(bc & 0xff) + rgb_buf.append(bc >> 8) + else: + rgb_buf.append(fc & 0xff) + rgb_buf.append(fc >> 8) + + d.write_buf(bytearray(rgb_buf), xs, y, font_size[size], font_size[size]) + + xs += font_size[size] diff --git a/code/main.py b/code/main.py index 68b2098..ee711f6 100644 --- a/code/main.py +++ b/code/main.py @@ -5,437 +5,454 @@ 作者:01Studio ''' -#导入相关模块 -import network,time,re,json,os,machine -from machine import Pin,RTC,WDT +import gc +# 导入相关模块 +import json +import os +import re +import time + +import machine +import network +import ntptime +from machine import Pin, RTC, WDT + +from libs import global_var, ap, color from libs.urllib import urequest -from libs import global_var,ap -import gc,tftlcd,ntptime +from ui import daily_epidemic # 30天疫情主题 +# 导入主题 +from ui import default # 默认经典主题 +from ui import dial # 极简表盘主题 +from ui import photo_album # 相册主题 -#导入主题 -from ui import default #默认经典主题 -from ui import dial #极简表盘主题 -from ui import photo_album #相册主题 - -ui_qty = 3 #UI总数量 -ui_choice = 0 #初始UI标志位 +ui_qty = 4 # UI总数量 +ui_choice = 0 # 初始UI标志位 ######################## # 构建1.5寸LCD对象并初始化 ######################## d = global_var.LCD -#定义常用颜色 -RED = (255,0,0) -GREEN = (0,255,0) -BLUE = (0,0,255) -BLACK = (0,0,0) -WHITE = (255,255,255) -YELLOW = (255,255,0) -DEEPGREEN = (1,179,105) - ''' 城市信息: -[0]城市,[1]编码 +[0]城市,[1]天气编码,[2]身份证编码 ''' -city=['',''] +city = ['', '', ''] ''' 天气信息: -[0]当日天气,[1]当日最高温,[2]当日最低温,[3]实时天气,[4]实时空气质量,[5]实时风向,[6]实时风力级数,[7]实时温度,[8]实时湿度, +[0]当日天气,[1]当日最高温,[2]当日最低温,[3]实时天气,[4]实时空气质量,[5]实时风向,[6]实时风力级数,[7]实时温度,[8]实时湿度,[9]昨日确诊新增,[10]昨日无症状新增 ''' -weather = ['']*9 #定义一个长度为9的字符列表 +weather = [''] * 11 # 定义一个长度为9的字符列表 -#构建RTC时钟对象 +# 构建RTC时钟对象 rtc = RTC() -#初始化WIFI指示灯 -WIFI_LED=Pin(2, Pin.OUT) +# 初始化WIFI指示灯 +WIFI_LED = Pin(2, Pin.OUT) + +# 启动看门狗,超时30秒。 +wdt = WDT(timeout=30000) +# wdt = None -#WIFI连接函数 -def WIFI_Connect(): - wlan = network.WLAN(network.STA_IF) #STA模式 - wlan.active(True) #激活接口 - start_time=time.time() #记录时间做超时判断 +# WIFI连接函数 +def WIFI_Connect(): + wlan = network.WLAN(network.STA_IF) # STA模式 + wlan.active(True) # 激活接口 + start_time = time.time() # 记录时间做超时判断 if not wlan.isconnected(): - + print('Connecting to network...') - f = open('wifi.txt', 'r') #获取账号密码 - info = json.loads(f.read()) - f.close() - - print(info) - d.fill(BLACK) - d.printStr('Connecting...', 10, 50, RED, size=2) - d.printStr(info['SSID'], 10, 110, WHITE, size=2) - d.printStr('Press KEY 5s RESET!', 5, 180, BLUE, size=2) - wlan.connect(info['SSID'], info['PASSWORD']) #输入WIFI账号密码 - - while not wlan.isconnected(): - - #LED闪烁提示 - WIFI_LED.value(1) - time.sleep_ms(300) - WIFI_LED.value(0) - time.sleep_ms(300) - - #超时判断,15秒没连接成功判定为超时 - if time.time()-start_time > 15 : - - wlan.active(False) - - #点亮LED表示没连接上WiFi + with open('wifi.txt', 'r') as f: # 获取账号密码 + info = json.loads(f.read()) + print(info) + d.fill(color.BLACK) + d.printStr('Connecting...', 10, 50, color.RED, size=2) + d.printStr(info['SSID'], 10, 110, color.WHITE, size=2) + d.printStr('Press KEY 5s RESET!', 5, 180, color.BLUE, size=2) + wlan.connect(info['SSID'], info['PASSWORD']) # 输入WIFI账号密码 + + while not wlan.isconnected(): + + # LED闪烁提示 WIFI_LED.value(1) - - print('WIFI Connected Timeout!') - - return False - - #连接成功,熄灭LED + time.sleep_ms(300) + WIFI_LED.value(0) + time.sleep_ms(300) + + # 超时判断,15秒没连接成功判定为超时 + if time.time() - start_time > 15: + wlan.active(False) + # 点亮LED表示没连接上WiFi + WIFI_LED.value(1) + print('WIFI Connected Timeout!') + return False + + # 连接成功,熄灭LED WIFI_LED.value(0) - #串口打印信息 + # 串口打印信息 print('network information:', wlan.ifconfig()) - + return True - -#设置NTP时间偏移量,就是我们所谓的时区,中国在UTC +8 的时区计算方式: 3155673600 - 8*3600 = 3155644800 -#3155673600 是默认的UTC,以秒计算偏移量。 + +# 设置NTP时间偏移量,就是我们所谓的时区,中国在UTC +8 的时区计算方式: 3155673600 - 8*3600 = 3155644800 +# 3155673600 是默认的UTC,以秒计算偏移量。 ntptime.NTP_DELTA = 3155644800 ntptime.host = 'ntp1.aliyun.com' -#获取网络时间 + +# 获取网络时间 def ntp_get(): - - for i in range(10): #最多尝试获取10次 - - try: - ntptime.settime() #获取网络时间 - print("ntp time(BeiJing): ",rtc.datetime()) + for i in range(10): # 最多尝试获取10次 + + try: + ntptime.settime() # 获取网络时间 + print("ntp time(BeiJing): ", rtc.datetime()) return True except: print("Can not get time!") - + time.sleep_ms(500) -#记录天气爬虫次数,用于调试 -total = 0 -lost = 0 -#网页获取天气数据 -def weather_get(datetime): - - global weather,lost,total,city - - for i in range(5):#失败会重试,最多5次 - - try: - - myURL = urequest.urlopen("http://www.weather.com.cn/weather1d/"+city[1]+".shtml") - text = myURL.read(39000+100*i).decode('utf-8') #抓取约前4W个字符,节省内存。 - - #获取当日天气、高低温 - text1=re.search('id="hidden_title" value="' + '(.*?)' + '°C',text).group(1) - weather[0] = text1.split()[2] #当日天气 - weather[1] = str(min(list(map(int,text1.split()[3].split('/'))))) #当天最低温 - weather[2] = str(max(list(map(int,text1.split()[3].split('/'))))) #当天最高温 - - #获取实时天气 - text2 = json.loads(re.search('var hour3data=' + '(.*?)' + '',text).group(1)) - - for i in range(len(text2['1d'])): - - if int(text2['1d'][i].split(',')[0].split('日')[0]) == datetime[2]:#日期相同 - - if datetime[4] <= int(text2['1d'][i].split(',')[0].split('日')[1].split('时')[0]): #小时 - - if i == 0 or datetime[4] == int(text2['1d'][i].split(',')[0].split('日')[1].split('时')[0]): - - weather[3] = text2['1d'][i].split(',')[2] #实时天气 - else: - - weather[3] = text2['1d'][i-1].split(',')[2] #实时天气 - break - - #获取实时空气质量、风向风力、温湿度 - text3 = json.loads(re.search('var observe24h_data = ' + '(.*?)' + ';',text).group(1)) - - for i in range(len(text3['od']['od2'])): - weather[4] = text3['od']['od2'][i]['od28'] #空气质量 - if weather[4] != '': - break - - for i in range(len(text3['od']['od2'])): - weather[5] = text3['od']['od2'][i]['od24'] #实时风向 - if weather[5] != '': - break +# 记录天气爬虫次数,用于调试 +total = 0 +lost = 0 - for i in range(len(text3['od']['od2'])): - weather[6] = text3['od']['od2'][i]['od25'] #实时风力级数 - if weather[6] != '': - break - for i in range(len(text3['od']['od2'])): - weather[8] = text3['od']['od2'][i]['od27'] #相对湿度 - if weather[8] != '': - break +# 网页获取天气数据 +def weather_get(datetime): + global weather, lost, total, city + for tryCount in range(5): # 失败会重试,最多5 + a = False + b = False + c = False + myURL = urequest.urlopen("http://www.weather.com.cn/weather1d/" + city[1] + ".shtml") + gc.collect() # 内存回收 + for i in range(30): # 假设有30段数据 + try: + text = myURL.read(7500).decode('utf-8') # 抓取约前4W个字符,节省内存。 + + # 获取当日天气、高低温 + info1 = re.search('id="hidden_title" value="(.*?)°C', text) + if info1 != None: + print("获取当日天气、高低温" + info1.group(0)) + text1 = info1.group(1) + if weather[0] == '': + weather[0] = text1.split()[2] # 当日天气 + if weather[1] == '': + weather[1] = str(min(list(map(int, text1.split()[3].split('/'))))) # 当天最低温 + if weather[2] == '': + weather[2] = str(max(list(map(int, text1.split()[3].split('/'))))) # 当天最高温 + a = True + # 获取实时天气 + info2 = re.search('var hour3data=(.*?)\n', text) + if info2 != None: + gc.collect() # 内存回收 + print("获取实时天气" + info2.group(0)) + text2 = json.loads(info2.group(1)) + for i in range(len(text2['1d'])): + if int(text2['1d'][i].split(',')[0].split('日')[0]) == datetime[2]: # 日期相同 + if datetime[4] <= int(text2['1d'][i].split(',')[0].split('日')[1].split('时')[0]): # 小时 + if i == 0 or datetime[4] == int( + text2['1d'][i].split(',')[0].split('日')[1].split('时')[0]): + weather[3] = text2['1d'][i].split(',')[2] # 实时天气 + else: + weather[3] = text2['1d'][i - 1].split(',')[2] # 实时天气 + break + b = True + + # 获取实时空气质量、风向风力、温湿度 + info3 = re.search('var observe24h_data = (.*?);', text) + if info3 != None: + gc.collect() # 内存回收 + print("获取实时空气质量、风向风力、温湿度" + info3.group(0)) + text3 = json.loads(info3.group(1)) + od_data = text3['od']['od2'] + for i in range(len(od_data)): + weather[4] = od_data[i]['od28'] # 空气质量 + weather[5] = od_data[i]['od24'] # 实时风向 + weather[6] = od_data[i]['od25'] # 实时风力级数 + weather[8] = od_data[i]['od27'] # 相对湿度 + weather[7] = od_data[i]['od22'] # 温度 + c = True + + total = total + 1 + if a and b and c: + return None + else: + continue + + except Exception as e: + print(type(e), ":", e) + print("Can not get weather!", i) + lost = lost + 1 + gc.collect() # 内存回收 - for i in range(len(text3['od']['od2'])): - weather[7] = text3['od']['od2'][i]['od22'] #温度 - if weather[7] != '': - break - - total = total+1 - - return None - - except: - - print("Can not get weather!",i) - lost = lost + 1 - gc.collect() #内存回收 - time.sleep_ms(1000) -#信息打印 + +# 信息打印 def info_print(): - - global city,weather + global city, weather print(rtc.datetime()) - - print('城市:',city[0],city[1]) - - print('当日天气:',weather[0]) - print('当日最低温:',weather[1]) - print('当日最高温:',weather[2]) - print('实时天气:',weather[3]) - print('实时空气质量:',weather[4]) - print('实时风向:',weather[5]) - print('实时风力级数:',weather[6]) - print('实时温度:',weather[7]) - print('实时湿度:',weather[8]) - - print('total:',total) - print('lost:',lost) - -#获取城市信息 + + print('城市:', city[0], city[1]) + + print('当日天气:', weather[0]) + print('当日最低温:', weather[1]) + print('当日最高温:', weather[2]) + print('实时天气:', weather[3]) + print('实时空气质量:', weather[4]) + print('实时风向:', weather[5]) + print('实时风力级数:', weather[6]) + print('实时温度:', weather[7]) + print('实时湿度:', weather[8]) + print('昨日确诊新增:', weather[9]) + print('昨日无症状新增:', weather[10]) + print('total:', total) + print('lost:', lost) + + +# 获取城市信息 def city_get(): - global city - - #获取城市编码 - f = open('wifi.txt', 'r') #获取账号密码 - info = json.loads(f.read()) - f.close() - - city[0] = info['CITY'] - - #获取城市名称 + + # 获取城市编码 + with open('wifi.txt', 'r') as f: + info = json.loads(f.read()) + f.close() + + city[0] = info['CITY'] + city[2] = getIdCardCode(city[0]) + + # 获取城市名称 f = open('/data/CityCode.txt', 'r') num = 0 while True: - text = f.readline() - if city[0] in text: - - if city[0] == re.match(r'"(.+?)"',text).group(1): #城市名称完全一样 - - city[1] = re.match(r'"(.+?)"',text.split(': ')[1]).group(1) #"获取城市编码" - + if city[0] == re.match(r'"(.+?)"', text).group(1): # 城市名称完全一样 + city[1] = re.match(r'"(.+?)"', text.split(': ')[1]).group(1) # "获取城市编码" break - - elif '}' in text: #结束,没这个城市。 + elif '}' in text: # 结束,没这个城市。 print('No City Name!') break - + num = num + 1 - + if num == 300: - - gc.collect() #内存回收 + gc.collect() # 内存回收 num = 0 - + f.close() - city_node = 0 - - #city.txt文件存在,判断文件是否已经有当前城市字库 - if 'city.txt' in os.listdir('/data/'): - + + # city.txt文件存在,判断文件是否已经有当前城市字库 + if 'city.txt' in os.listdir('/data/'): f = open('/data/city.txt', 'r') - city_text = f.read() - for i in range(len(city[0])): - + if city[0][i] in city_text: - - if i == len(city[0])-1: #全部字体都有 - - city_node = 1 #标记字符信息正常 - f.close() - - #城市字库正常,无需制作 + + if i == len(city[0]) - 1: # 全部字体都有 + + city_node = 1 # 标记字符信息正常 + f.close() + + # 城市字库正常,无需制作 if city_node == 1: - pass - - else: #获取字库文件并保存 - - #生成城市字模文件 - city_font= {} - + + else: # 获取字库文件并保存 + # 生成城市字模文件 + city_font = {} for i in range(len(city[0])): - - f = open('/data/Fonts/fonts_city.py', 'r') - + f = open('/data/Fonts/fonts_city.py', 'r') while True: - text = f.readline() - if city[0][i] in text: - while True: - text = text + f.readline() - if ')' in text: - a = re.search('[(]' + '(.*?)' + '[)]',text).group(1).replace('\r\n','').replace(' ','').split(',') + a = re.search('[(]' + '(.*?)' + '[)]', text).group(1) \ + .replace('\r\n', '') \ + .replace(' ', '').split(',') for j in range(len(a)): a[j] = int(a[j]) - + city_font[city[0][i]] = a break break - - if not text: #读完 + + if not text: # 读完 print("No City Fonts.") break - + f.close() - - - f = open('/data/city.txt', 'w') #以写的方式打开一个文件,没有该文件就自动新建 - f.write((json.dumps(city_font))) #写入数据 - f.close() #每次操作完记得关闭文件 - - gc.collect() #内存回收 - -#按键 -KEY=Pin(9,Pin.IN,Pin.PULL_UP) #构建KEY对象 - -#按键中断触发 + + f = open('/data/city.txt', 'w') # 以写的方式打开一个文件,没有该文件就自动新建 + f.write((json.dumps(city_font))) # 写入数据 + f.close() # 每次操作完记得关闭文件 + + gc.collect() # 内存回收 + + +# 按键 +KEY = Pin(9, Pin.IN, Pin.PULL_UP) # 构建KEY对象 + + +# 按键中断触发 def key(KEY): - - global ui_choice,ui_qty - time.sleep_ms(10) #消除抖动 - if KEY.value() == 0: #确认按键被按下 - - #短按切换UI + global ui_choice, ui_qty + time.sleep_ms(10) # 消除抖动 + if KEY.value() == 0: # 确认按键被按下 + + # 短按切换UI global_var.UI_Change = 1 ui_choice = ui_choice + 1 - if ui_choice == ui_qty : #UI数量 - ui_choice =0 - - #出厂模式 + if ui_choice == ui_qty: # UI数量 + ui_choice = 0 + + # 出厂模式 start = time.ticks_ms() while KEY.value() == 0: - - if time.ticks_ms() - start >5000: #长按按键5秒 - - WIFI_LED.value(1) #指示灯亮 + + if time.ticks_ms() - start > 5000: # 长按按键5秒 + + WIFI_LED.value(1) # 指示灯亮 print("Factory Mode!") try: os.remove('wifi.txt') print('Remove wifi.txt') except: print('no wifi.txt') - - machine.reset() #重启开发板。 - -KEY.irq(key,Pin.IRQ_FALLING) #定义中断,下降沿触发 + machine.reset() # 重启开发板。 + + +KEY.irq(key, Pin.IRQ_FALLING) # 定义中断,下降沿触发 + + +def getIdCardCode(cityName: str): + city = None + with open('/data/IdCard.txt', 'r') as f: + while True: + text = f.readline() + if cityName in text: + city = re.match(r'"(.+?)"', text.split(':')[1]).group(1) # "获取城市编码" + break + elif '}' in text: # 结束,没这个城市。 + print('No City Name!') + break + return city + + +def getDailyEpidemicData(adCode: str = '440100'): + gc.collect() # 内存回收 + r = urequest.urlopen( + r"https://api.inews.qq.com/newsqa/v1/query/pubished/daily/list?limit=1&adCode=" + adCode) # 发get请求 + text = r.read(444).decode('utf-8') # 抓取约前4W个字符,节省内存。 + print(text) + info = json.loads(text) + if info['ret'] == 0: + return info['data'][0] + else: + return None + + +def epidemic_situation_get(): + global weather, city + data = getDailyEpidemicData(city[2]) + weather[9] = str(data['yes_confirm_add']) + weather[10] = str(data['yes_wzz_add']) + + +def feedDog(): + global wdt + if wdt is not None: + wdt.feed() # 喂狗 + ################ # 主程序 # ################ +if __name__ == '__main__': + # 没有WiFi配置文件,出厂模式 + while 'wifi.txt' not in os.listdir(): + ap.startAP() # 启动AP配网模式 -#没有WiFi配置文件,出厂模式 -while 'wifi.txt' not in os.listdir(): - - ap.startAP() #启动AP配网模式 - -#启动看门狗,超时30秒。 -wdt = WDT(timeout=30000) + # 连接WiFi + while not WIFI_Connect(): # 等待wifi连接 + pass -#连接WiFi -while not WIFI_Connect(): #等待wifi连接 - - pass - -wdt.feed() #喂狗 - -#获取城市名称和编码 -d.fill(BLACK) -d.printStr('Getting...', 10, 60, RED, size=3) -d.printStr('City Data', 10, 120, WHITE, size=3) -city_get() - -#同步网络时钟 -d.fill(BLACK) -d.printStr('Getting...', 10, 60, RED, size=3) -d.printStr('Date & Time', 10, 120, WHITE, size=3) -ntp_get() - -#同步天气信息 -d.fill(BLACK) -d.printStr('Getting...', 10, 60, RED, size=3) -d.printStr('Weather Data', 10, 120, WHITE, size=3) -weather_get(rtc.datetime()) - -#信息打印 -info_print() - -tick = 61 #每秒刷新标志位 - -while True: - - #获取时间 - datetime = rtc.datetime() - - #30分钟在线获取一次天气信息,顺便检测wifi是否掉线 - if datetime[5]%30 == 0 and datetime[6] == 0: - - WIFI_Connect() #检查WiFi,掉线的话自动重连 - - weather_get(datetime) #获取天气信息 - - info_print() #打印相关信息 - - #每秒刷新一次UI - if tick != datetime[6]: - - tick = datetime[6] - - wdt.feed() #喂狗 - - if ui_choice == 0 : - default.UI_Display(city,weather,datetime) #默认UI - - elif ui_choice == 1 : - dial.UI_Display(datetime) #极简表盘 - - elif ui_choice == 2 : - photo_album.UI_Display(datetime) #相册主图 - -# print('gc2:',gc.mem_free()) #内存监测 - - time.sleep_ms(200) \ No newline at end of file + feedDog() # 喂狗 + + # 获取城市名称和编码 + d.fill(color.BLACK) + d.printStr('Getting...', 10, 60, color.RED, size=3) + d.printStr('City Data', 10, 120, color.WHITE, size=3) + city_get() + feedDog() # 喂狗 + # 同步网络时钟 + d.fill(color.BLACK) + d.printStr('Getting...', 10, 60, color.RED, size=3) + d.printStr('Date & Time', 10, 120, color.WHITE, size=3) + ntp_get() + feedDog() # 喂狗 + + # 同步天气信息 + d.fill(color.BLACK) + d.printStr('Getting...', 10, 60, color.RED, size=3) + d.printStr('Weather Data', 10, 120, color.WHITE, size=3) + weather_get(rtc.datetime()) + feedDog() # 喂狗 + + # 获取疫情新增人数信息 + d.fill(color.BLACK) + d.printStr('Getting...', 10, 60, color.RED, size=3) + d.printStr('Epidemic Situation', 10, 120, color.WHITE, size=3) + d.printStr('Data', 10, 180, color.WHITE, size=3) + epidemic_situation_get() + feedDog() # 喂狗 + + # 信息打印 + info_print() + + tick = 61 # 每秒刷新标志位 + while True: + # 获取时间 + datetime = rtc.datetime() + + # 30分钟在线获取一次天气信息,顺便检测wifi是否掉线 + if datetime[5] % 30 == 0 and datetime[6] == 0: + WIFI_Connect() # 检查WiFi,掉线的话自动重连 + weather_get(datetime) # 获取天气信息 + epidemic_situation_get() # 获取疫情信息 + info_print() # 打印相关信息 + + # 每秒刷新一次UI + if tick != datetime[6]: + tick = datetime[6] + feedDog() # 喂狗 + if ui_choice == 0: + daily_epidemic.UI_Display(city, weather, datetime) # 30天疫情 + elif ui_choice == 1: + default.UI_Display(city, weather, datetime) # 默认UI + elif ui_choice == 2: + dial.UI_Display(datetime) # 极简表盘 + elif ui_choice == 3: + photo_album.UI_Display(datetime) # 相册主图 + + # print('gc2:',gc.mem_free()) #内存监测 + + time.sleep_ms(200) diff --git a/code/t1/GenerateFont.py b/code/t1/GenerateFont.py new file mode 100644 index 0000000..4de79ab --- /dev/null +++ b/code/t1/GenerateFont.py @@ -0,0 +1,24 @@ +font = [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, + 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, + 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, + 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, ] +if __name__ == '__main__': + for i in range(int(len(font) / 8)): + b = 8 - 8 + for j in range(8 - 8, 8): + bit = font[i * 8 + j] + move = 7 - j + b = b + (bit << move) + print('%#x' % b, end=",") diff --git a/code/t1/main3.py b/code/t1/main3.py new file mode 100644 index 0000000..328a2b2 --- /dev/null +++ b/code/t1/main3.py @@ -0,0 +1,63 @@ +''' +实验名称:1.5寸LCD液晶显示屏(240x240) +版本:v1.0 +日期:2022.4 +作者:01Studio +实验平台:pyController +说明:通过编程实现LCD的各种显示功能,包括填充、画点、线、矩形、圆形、显示英文、显示图片等。 +''' +import gc +import json + +from libs import global_var +from libs.tool import printChinese +from libs.urllib import urequest + +# 导入相关模块 + +######################## +# 构建1.5寸LCD对象并初始化 +######################## +d = global_var.LCD + +# 定义常用颜色 +RED = (255, 0, 0) +GREEN = (0, 255, 0) +BLUE = (0, 0, 255) +BLACK = (0, 0, 0) +WHITE = (255, 255, 255) + +rollCount = 0 +data = None + + +def getDailyEpidemicData(adCode: str = '440100'): + r = urequest.urlopen( + r"https://api.inews.qq.com/newsqa/v1/query/pubished/daily/list?limit=30&adCode=" + adCode) # 发get请求 + text = r.read(39000).decode('utf-8') # 抓取约前4W个字符,节省内存。 + info = json.loads(text) + if info['ret'] == 0: + return info['data'] + else: + return None + + +# 用于显示动画 +second2 = 61 + + +def message_display(second): + global data + d.fill(BLACK) # 清屏 + printChinese('日 ', 0, 0, color=WHITE, backcolor=BLACK, size=2) + printChinese('确诊 ', 72, 0, color=WHITE, backcolor=BLACK, size=2) + printChinese('无症状', 144, 0, color=WHITE, backcolor=BLACK, size=2) + for i in range(len(data)): + d.printStr(data[i]['date'], 0, 24 + 16 * i + second, WHITE, size=1) + d.printStr(data[i]['yes_confirm_add'], 72, 24 + 16 * i + second, RED, size=1) + d.printStr(data[i]['yes_wzz_add'], 144, 24 + 16 * i + second, RED, size=1) + +if __name__=='__main__': + global data + data=getDailyEpidemicData() + message_display(0) \ No newline at end of file diff --git a/code/t1/t2.py b/code/t1/t2.py new file mode 100644 index 0000000..19a2930 --- /dev/null +++ b/code/t1/t2.py @@ -0,0 +1,18 @@ +import re + +def getIdCardCode(cityName: str): + city = None + with open('D:\python\pyClock\code\data\IdCard.txt', 'r') as f: + while True: + text = f.readline() + if cityName in text: + city = re.match(r'"(.+?)"', text.split(':')[1]).group(1) # "获取城市编码" + break + elif '}' in text: # 结束,没这个城市。 + print('No City Name!') + break + return city + + +if __name__ == '__main__': + print(getIdCardCode("广州")) diff --git a/code/t1/t3.py b/code/t1/t3.py new file mode 100644 index 0000000..80d735a --- /dev/null +++ b/code/t1/t3.py @@ -0,0 +1,41 @@ +import json + +import requests + + +# adcode: "440100" +# city: "广州" +# 全省确诊 confirm: 19392 +# 全省确诊新增 confirm_add: "1129" +# date: "11.27" +# 死亡 dead: 0 +# 治愈 heal: 0 +# is_show_wzz_add: 1 +# suspect: 0 +# 本日新增 today_confirm_add: 0 +# 本日无症状新增 today_wzz_add: 0 +# y: "2022" +# 昨日确诊新增 yes_confirm_add: 1129 +# 昨日无症状新增 yes_wzz_add: 7166 +def getDailyEpidemicData(adCode: str = '440100', limit: int = 30): + url = "https://api.inews.qq.com/newsqa/v1/query/pubished/daily/list" + data = {'adCode': adCode, 'limit': limit} + r = requests.get(url, params=data) # 发get请求 + print(len(r.text)) + info = json.loads(r.text) + if info['ret'] == 0: + return info['data'] + else: + return None + + +if __name__ == '__main__': + data = getDailyEpidemicData(limit=40) + # data = None + # 昨日确诊新增 yes_confirm_add: 1129 + # 昨日无症状新增 yes_wzz_add: 7166 + if data != None: + for i in range(len(data)): + print('日期', data[i]['date'], end=":") + print('昨日确诊新增', data[i]['yes_confirm_add'], end=" ") + print('昨日无症状新增', data[i]['yes_wzz_add']) diff --git a/code/t1/t4.py b/code/t1/t4.py new file mode 100644 index 0000000..dc128a5 --- /dev/null +++ b/code/t1/t4.py @@ -0,0 +1,93 @@ +import json +import math + +import requests + + +# adcode: "440100" +# city: "广州" +# 全省确诊 confirm: 19392 +# 全省确诊新增 confirm_add: "1129" +# date: "11.27" +# 死亡 dead: 0 +# 治愈 heal: 0 +# is_show_wzz_add: 1 +# suspect: 0 +# 本日新增 today_confirm_add: 0 +# 本日无症状新增 today_wzz_add: 0 +# y: "2022" +# 昨日确诊新增 yes_confirm_add: 1129 +# 昨日无症状新增 yes_wzz_add: 7166 + + +def getDailyEpidemicData(adCode: str = '440100'): + url = "https://api.inews.qq.com/newsqa/v1/query/pubished/daily/list" + data = {'adCode': adCode, 'limit': '30'} + r = requests.get(url, params=data) # 发get请求 + print(len(r.text)) + print(r.json()) # 将返回的json串转为字典 + info = json.loads(r.text) + if info['ret'] == 0: + return info['data'] + else: + return None + + +class HeightCalculator(): + def __init__(self): + # 屏幕高度 + self.screenHeight = 240 + # 标题高度 + self.titleHeight = 24 + # 每行数据高度 + self.rowHeight = 16 + # 一屏幕能显示数据的行数 + self.rowCount = math.floor((self.screenHeight - self.titleHeight) / self.rowHeight) + # 多少秒触发一次数据移动 + self.triggerSecond = 5 + # 一分钟内数据能移动的次数 + self.numberOfMoves = math.floor(60 / self.triggerSecond) + # 数据条数 + self.numberOfData = 30 + # 移动距离 + self.movingDistance = math.ceil((self.numberOfData - self.rowCount) / self.numberOfMoves) + # 移动速度 + self.movingSpeed = self.movingDistance / self.triggerSecond + + def getRowOffset(self, second: int): + offset = math.floor(second * self.movingSpeed) + if offset - 1 < 0: + offset = 0 + if offset > self.numberOfData: + offset = self.numberOfData - 1 + row_offset_start = offset + row_offset_end = None if row_offset_start + self.rowCount > self.numberOfData else row_offset_start + self.rowCount + return row_offset_start, row_offset_end + + def getHeight(self, row: int = 0): + fixedHeight = self.titleHeight + self.rowHeight * row + return fixedHeight + + +if __name__ == '__main__': + heightCalculator = HeightCalculator() + # data2 = [i for i in range(heightCalculator.numberOfData)] + # for i in range(60): + # row_offset_start, row_offset_end = heightCalculator.getRowOffset(i) + # if data2 != None: + # print("*" * 60, "起点=", str(row_offset_start), "终点=", str(row_offset_end)) + # print(data2[row_offset_start:row_offset_end]) + # for item in data2[row_offset_start:row_offset_end]: + # print(item) + + data = getDailyEpidemicData() + for i in range(60): + second = i + row_offset_start, row_offset_end = heightCalculator.getRowOffset(i) + print("*" * 60) + if data != None: + for i, item in enumerate(data[row_offset_start:row_offset_end]): + # print(i, heightCalculator.getHeight(row=i)) + print('日期', item['date'], end=":") + print('昨日确诊新增', item['yes_confirm_add'], end=" ") + print('昨日无症状新增', item['yes_wzz_add']) diff --git a/code/t1/t5.py b/code/t1/t5.py new file mode 100644 index 0000000..f5129ac --- /dev/null +++ b/code/t1/t5.py @@ -0,0 +1,136 @@ +import json +import re +import traceback + +import requests + + +# adcode: "440100" +# city: "广州" +# 全省确诊 confirm: 19392 +# 全省确诊新增 confirm_add: "1129" +# date: "11.27" +# 死亡 dead: 0 +# 治愈 heal: 0 +# is_show_wzz_add: 1 +# suspect: 0 +# 本日新增 today_confirm_add: 0 +# 本日无症状新增 today_wzz_add: 0 +# y: "2022" +# 昨日确诊新增 yes_confirm_add: 1129 +# 昨日无症状新增 yes_wzz_add: 7166 + + +def getDailyEpidemicData(adCode: str = '440100'): + url = "https://api.inews.qq.com/newsqa/v1/query/pubished/daily/list" + data = {'adCode': adCode, 'limit': '30'} + r = requests.get(url, params=data) # 发get请求 + print(len(r.text)) + print(r.json()) # 将返回的json串转为字典 + info = json.loads(r.text) + if info['ret'] == 0: + return info['data'] + else: + return None + + +''' +天气信息: +[0]当日天气,[1]当日最高温,[2]当日最低温,[3]实时天气,[4]实时空气质量,[5]实时风向,[6]实时风力级数,[7]实时温度,[8]实时湿度,[9]昨日确诊新增,[10]昨日无症状新增 +''' +weather = [''] * 11 +# 记录天气爬虫次数,用于调试 +total = 0 +lost = 0 +''' +城市信息: +[0]城市,[1]天气编码,[2]身份证编码 +''' +city = ['广州', '101280101', '440100'] + + +def weather_get(datetime): + global weather, lost, total, city + + for i in range(5): # 失败会重试,最多5次 + + try: + + myURL = requests.get("http://www.weather.com.cn/weather1d/" + city[1] + ".shtml") + myURL.encoding = 'utf-8' + text = myURL.text # 抓取约前4W个字符,节省内存。 + # 获取当日天气、高低温 + text1 = re.search('id="hidden_title" value="' + '(.*?)' + '°C', text).group(1) + weather[0] = text1.split()[2] # 当日天气 + weather[1] = str(min(list(map(int, text1.split()[3].split('/'))))) # 当天最低温 + weather[2] = str(max(list(map(int, text1.split()[3].split('/'))))) # 当天最高温 + + # 获取实时天气 + text2 = json.loads(re.search('var hour3data=(.+)\n', text).group(1)) + for i in range(len(text2['1d'])): + if int(text2['1d'][i].split(',')[0].split('日')[0]) == datetime[2]: # 日期相同 + if datetime[4] <= int(text2['1d'][i].split(',')[0].split('日')[1].split('时')[0]): # 小时 + if i == 0 or datetime[4] == int(text2['1d'][i].split(',')[0].split('日')[1].split('时')[0]): + weather[3] = text2['1d'][i].split(',')[2] # 实时天气 + else: + weather[3] = text2['1d'][i - 1].split(',')[2] # 实时天气 + break + + # 获取实时空气质量、风向风力、温湿度 + text3 = json.loads(re.search('var\sobserve24h_data\s=\s' + '(.*?)' + ';', text).group(1)) + for i in range(len(text3['od']['od2'])): + weather[4] = text3['od']['od2'][i]['od28'] # 空气质量 + if weather[4] != '': + break + + for i in range(len(text3['od']['od2'])): + weather[5] = text3['od']['od2'][i]['od24'] # 实时风向 + if weather[5] != '': + break + + for i in range(len(text3['od']['od2'])): + weather[6] = text3['od']['od2'][i]['od25'] # 实时风力级数 + if weather[6] != '': + break + + for i in range(len(text3['od']['od2'])): + weather[8] = text3['od']['od2'][i]['od27'] # 相对湿度 + if weather[8] != '': + break + + for i in range(len(text3['od']['od2'])): + weather[7] = text3['od']['od2'][i]['od22'] # 温度 + if weather[7] != '': + break + + total = total + 1 + return None + except: + traceback.print_exc() + print("Can not get weather!", i) + lost = lost + 1 + + +def info_print(): + global city, weather + + print('城市:', city[0], city[1]) + + print('当日天气:', weather[0]) + print('当日最低温:', weather[1]) + print('当日最高温:', weather[2]) + print('实时天气:', weather[3]) + print('实时空气质量:', weather[4]) + print('实时风向:', weather[5]) + print('实时风力级数:', weather[6]) + print('实时温度:', weather[7]) + print('实时湿度:', weather[8]) + print('昨日确诊新增:', weather[9]) + print('昨日无症状新增:', weather[10]) + print('total:', total) + print('lost:', lost) + + +if __name__ == '__main__': + data = weather_get((2022, 12, 5, 0, 10, 40, 9, 239427)) + info_print() diff --git a/code/ui/daily_epidemic.py b/code/ui/daily_epidemic.py new file mode 100644 index 0000000..a5680a2 --- /dev/null +++ b/code/ui/daily_epidemic.py @@ -0,0 +1,127 @@ +''' +实验名称:疫情30天滚动信息 +版本:v1.0 +日期:2022.12 +作者:Kyle Luo +说明:查询近30天疫情数据,轮播 +''' +import gc +import json +import math + +from libs import global_var +from libs.color import RED, BLACK, WHITE, getRandomColor +from libs.tool import printChinese +from libs.urllib import urequest + +# 导入相关模块 + +######################## +# 构建1.5寸LCD对象并初始化 +######################## +d = global_var.LCD + +# 数据限制 +limit = 15 + +class HeightCalculator(): + def __init__(self): + global limit + # 屏幕高度 + self.screenHeight = 240 + # 标题高度 + self.titleHeight = 16 + # 每行数据高度 + self.rowHeight = 16 + # 一屏幕能显示数据的行数 + self.rowCount = math.floor((self.screenHeight - self.titleHeight) / self.rowHeight) + # 多少秒触发一次数据移动 + self.triggerSecond = 5 + # 一分钟内数据能移动的次数 + self.numberOfMoves = math.floor(60 / self.triggerSecond) + # 数据条数 + self.numberOfData = limit + # 移动距离 + self.movingDistance = math.ceil((self.numberOfData - self.rowCount) / self.numberOfMoves) + # 移动速度 + self.movingSpeed = self.movingDistance / self.triggerSecond + + def getRowOffset(self, second: int): + offset = math.floor(second * self.movingSpeed) + if offset - 1 < 0: + offset = 0 + if offset > self.numberOfData: + offset = self.numberOfData - 1 + row_offset_start = offset + row_offset_end = None if row_offset_start + self.rowCount > self.numberOfData else row_offset_start + self.rowCount + return row_offset_start, row_offset_end + + def getHeight(self, row: int = 0): + fixedHeight = self.titleHeight + self.rowHeight * row + return fixedHeight + + +data = [] + + +def getDailyEpidemicData(adCode: str = '440100', limit: int = 30): + gc.collect() + r = urequest.urlopen( + r"https://api.inews.qq.com/newsqa/v1/query/pubished/daily/list?limit=" + str( + limit) + "&adCode=" + adCode) # 发get请求 + text = r.read(7000).decode('utf-8') # 抓取约前4W个字符,节省内存。 + info = json.loads(text) + if info['ret'] == 0: + gc.collect() + return info['data'] + else: + return None + + +# 用于显示动画 +second2 = 61 +heightCalculator = HeightCalculator() + + +def message_display(second): + global data, heightCalculator + if data != None: + d.fill(BLACK) # 清屏 + printTitle() + row_offset_start, row_offset_end = heightCalculator.getRowOffset(second) + for i, item in enumerate(data[row_offset_start:row_offset_end]): + height = heightCalculator.getHeight(row=i) + d.printStr(item['date'], 0, height, WHITE, size=1) + d.printStr(str(item['yes_confirm_add']), 72, height, RED, size=1) + d.printStr(str(item['yes_wzz_add']), 144, height, RED, size=1) + + +def printTitle(): + printChinese('日期', 0, 0, color=getRandomColor(), backcolor=BLACK, size=1) + printChinese('确诊', 72, 0, color=getRandomColor(), backcolor=BLACK, size=1) + printChinese('无症状', 144, 0, color=getRandomColor(), backcolor=BLACK, size=1) + + +def UI_Display(city, weather, datetime): + global second2, data, limit + if global_var.UI_Change: # 首次画表盘 + global_var.UI_Change = 0 + data = getDailyEpidemicData(city[2], limit) + message_display(datetime[6]) + + # 定期回收内存 + if second2 != datetime[6]: + if gc.mem_free() < 15000: # 内存不足 + gc.collect() # 回收内存 + second2 = datetime[6] + + if datetime[6] % 5 == 0: + message_display(datetime[6]) + + # 疫情刷新时间30分钟 + if datetime[5] % 30 == 0 and datetime[6] == 0: + data = getDailyEpidemicData(city[2], limit) + # 更新最新的疫情信息 + if data is not None and data[-1] is not None: + weather[9] = str(data[-1]['yes_confirm_add']) + weather[10] = str(data[-1]['yes_wzz_add']) diff --git a/code/ui/default.py b/code/ui/default.py index 1d500c6..96c2e4b 100644 --- a/code/ui/default.py +++ b/code/ui/default.py @@ -6,12 +6,16 @@ 说明:天气时钟信息 ''' -#导入相关模块 -import time,gc,json +# 导入相关模块 +import gc +import json +import time + from libs import global_var -from data.Fonts import fonts -#动态信息显示 +from libs.tool import printChinese + +# 动态信息显示 message_num = 0 ######################## @@ -20,109 +24,55 @@ d = global_var.LCD # d = tftlcd.LCD15(portrait=1) -#定义常用颜色 -RED = (255,0,0) -GREEN = (0,255,0) -BLUE = (0,0,255) -BLACK = (0,0,0) -WHITE = (255,255,255) -YELLOW = (255,255,0) -DEEPGREEN = (1,179,105) - -#空气质量颜色 -YOU = (156,202,127) #优 -LIANG = (249,218,101) #良 -QINGDU = (242,159,57) #轻度 -ZHONGDU = (219,85,94) #中度 -ZDU = (186,55,121) #重度 -YANZHONG = (136,11,32) #严重 - -week_list=['一','二','三','四','五','六','日'] - -air_quality=['优','良','轻度','中度','重度','严重'] - - - -#中文显示 -def printChinese(text,x,y,color=(0,0,0),backcolor=(255,255,255),size=1): - - font_size = [0,16,24,32,40,48] #分别对应size=1,2,3,4,5的字体尺寸,0无效。 - - chinese_dict = {} - - #获取对应的字模 - if size==1: - chinese_dict = fonts.hanzi_16x16_dict - - elif size==2: - chinese_dict = fonts.hanzi_24x24_dict - - elif size==3: - chinese_dict = fonts.hanzi_32x32_dict - - elif size==4: - chinese_dict = fonts.hanzi_40x40_dict - - elif size==5: - chinese_dict = fonts.hanzi_48x48_dict - - xs = x - ys = y - - #定义字体颜色,RGB888转RGB565 - fc = ((color[0]>>3)<<11) + ((color[1]>>2)<<5) + (color[2]>>3) # 字体 - bc = ((backcolor[0]>>3)<<11) + ((backcolor[1]>>2)<<5) + (backcolor[2]>>3) # 字体背景颜色 - - for i in range(0, len(text)): - - ch_buf =chinese_dict[text[i]] #汉子对应码表 - - rgb_buf = [] - - t1 = font_size[size] // 8 - t2 = font_size[size] % 8 +# 定义常用颜色 +RED = (255, 0, 0) +GREEN = (0, 255, 0) +BLUE = (0, 0, 255) +BLACK = (0, 0, 0) +WHITE = (255, 255, 255) +YELLOW = (255, 255, 0) +DEEPGREEN = (1, 179, 105) - for i in range(0, len(ch_buf)): - - for j in range(0, 8): - if (ch_buf[i] << j) & 0x80 == 0x00: - rgb_buf.append(bc & 0xff) - rgb_buf.append(bc >> 8) - else: - rgb_buf.append(fc & 0xff) - rgb_buf.append(fc >> 8) +# 空气质量颜色 +YOU = (156, 202, 127) # 优 +LIANG = (249, 218, 101) # 良 +QINGDU = (242, 159, 57) # 轻度 +ZHONGDU = (219, 85, 94) # 中度 +ZDU = (186, 55, 121) # 重度 +YANZHONG = (136, 11, 32) # 严重 - d.write_buf(bytearray(rgb_buf),xs,y,font_size[size],font_size[size]) - - xs += font_size[size] +week_list = ['一', '二', '三', '四', '五', '六', '日'] + +air_quality = ['优', '良', '轻度', '中度', '重度', '严重'] -#城市显示 -def printCity(text,x,y,color=(0,0,0),backcolor=(255,255,255),size=2): - - font_size = [0,16,24,32,40,48] #分别对应size=1,2,3,4,5的字体尺寸,0无效。 - - f = open('/data/city.txt', 'r') + + +# 城市显示 +def printCity(text, x, y, color=(0, 0, 0), backcolor=(255, 255, 255), size=2): + font_size = [0, 16, 24, 32, 40, 48] # 分别对应size=1,2,3,4,5的字体尺寸,0无效。 + + f = open('/data/city.txt', 'r') chinese_dict = json.loads(f.read()) - f.close() - + f.close() + xs = x ys = y - - #定义字体颜色,RGB888转RGB565 - fc = ((color[0]>>3)<<11) + ((color[1]>>2)<<5) + (color[2]>>3) # 字体 - bc = ((backcolor[0]>>3)<<11) + ((backcolor[1]>>2)<<5) + (backcolor[2]>>3) # 字体背景颜色 - + + # 定义字体颜色,RGB888转RGB565 + fc = ((color[0] >> 3) << 11) + ((color[1] >> 2) << 5) + (color[2] >> 3) # 字体 + bc = ((backcolor[0] >> 3) << 11) + ((backcolor[1] >> 2) << 5) + (backcolor[2] >> 3) # 字体背景颜色 + for i in range(0, len(text)): - - ch_buf =chinese_dict[text[i]] #汉子对应码表 - + + ch_buf = chinese_dict[text[i]] # 汉子对应码表 + rgb_buf = [] - + t1 = font_size[size] // 8 t2 = font_size[size] % 8 for i in range(0, len(ch_buf)): - + for j in range(0, 8): if (ch_buf[i] << j) & 0x80 == 0x00: rgb_buf.append(bc & 0xff) @@ -131,262 +81,253 @@ def printCity(text,x,y,color=(0,0,0),backcolor=(255,255,255),size=2): rgb_buf.append(fc & 0xff) rgb_buf.append(fc >> 8) - d.write_buf(bytearray(rgb_buf),xs,y,font_size[size],font_size[size]) - + d.write_buf(bytearray(rgb_buf), xs, y, font_size[size], font_size[size]) + xs += font_size[size] + ''' weather[9]: [0]当日天气,[1]当日最高温,[2]当日最低温,[3]实时天气,[4]实时空气质量,[5]实时风向,[6]实时风力级数,[7]实时温度,[8]实时湿度, -''' -def weather_display(city,weather): - +''' + + +def weather_display(city, weather): try: - - #城市信息,名称超出4个只显示前4个 - if len(city[0])<5: - #printChinese(city[0],25-(len(city[0])-2)*10,5,color=WHITE,backcolor=BLACK,size=2) - printCity(city[0],25-(len(city[0])-2)*10,5,color=WHITE,backcolor=BLACK,size=2) - - else: - #printChinese(city[0][:4],5,5,color=WHITE,backcolor=BLACK,size=2) - printCity(city[0][:4],5,5,color=WHITE,backcolor=BLACK,size=2) - + # 城市信息,名称超出4个只显示前4个 + if len(city[0]) < 5: + # printChinese(city[0],25-(len(city[0])-2)*10,5,color=WHITE,backcolor=BLACK,size=2) + printCity(city[0], 25 - (len(city[0]) - 2) * 10, 5, color=WHITE, backcolor=BLACK, size=2) + else: + # printChinese(city[0][:4],5,5,color=WHITE,backcolor=BLACK,size=2) + printCity(city[0][:4], 5, 5, color=WHITE, backcolor=BLACK, size=2) except: - - #如果城市中文无法显示,那么就显示城市编码。 - d.printStr(city[1],5, 5, WHITE, size=2) - - #空气质量 - #优[0-50],良[50-100],轻度[100-150],中度[150-200],重度[200-300],严重[300-500] + # 如果城市中文无法显示,那么就显示城市编码。 + d.printStr(city[1], 5, 5, WHITE, size=2) + + # 空气质量 + # 优[0-50],良[50-100],轻度[100-150],中度[150-200],重度[200-300],严重[300-500] try: - if 0 <= int(weather[4]) < 50: #优 - d.drawRect(115, 5, 50, 24, GREEN, border=1,fillcolor=GREEN) - printChinese('优',129,5,color=BLACK,backcolor=GREEN,size=2) - - elif 50 <= int(weather[4]) < 100:#良 - d.drawRect(115, 5, 50, 24, LIANG, border=1,fillcolor=LIANG) - printChinese('良',129,5,color=BLACK,backcolor=LIANG,size=2) - - elif 100 <= int(weather[4]) < 150:#轻度 - d.drawRect(115, 5, 50, 24, QINGDU, border=1,fillcolor=QINGDU) - printChinese('轻度',117,5,color=BLACK,backcolor=QINGDU,size=2) - - elif 150 <= int(weather[4]) < 200:#中度 - d.drawRect(115, 5, 50, 24, ZHONGDU, border=1,fillcolor=ZHONGDU) - printChinese('中度',117,5,color=BLACK,backcolor=ZHONGDU,size=2) - - elif 200 <= int(weather[4]) < 300:#重度 - d.drawRect(115, 5, 50, 24, ZHONGDU, border=1,fillcolor=ZHONGDU) - printChinese('重度',117,5,color=BLACK,backcolor=ZHONGDU,size=2) - - elif 300 <= int(weather[4]) < 500:#严重 - d.drawRect(115, 5, 50, 24, YANZHONG, border=1,fillcolor=YANZHONG) - printChinese('严重',117,5,color=BLACK,backcolor=YANZHONG,size=2) + if 0 <= int(weather[4]) < 50: # 优 + d.drawRect(115, 5, 50, 24, GREEN, border=1, fillcolor=GREEN) + printChinese('优', 129, 5, color=BLACK, backcolor=GREEN, size=2) + + elif 50 <= int(weather[4]) < 100: # 良 + d.drawRect(115, 5, 50, 24, LIANG, border=1, fillcolor=LIANG) + printChinese('良', 129, 5, color=BLACK, backcolor=LIANG, size=2) + + elif 100 <= int(weather[4]) < 150: # 轻度 + d.drawRect(115, 5, 50, 24, QINGDU, border=1, fillcolor=QINGDU) + printChinese('轻度', 117, 5, color=BLACK, backcolor=QINGDU, size=2) + + elif 150 <= int(weather[4]) < 200: # 中度 + d.drawRect(115, 5, 50, 24, ZHONGDU, border=1, fillcolor=ZHONGDU) + printChinese('中度', 117, 5, color=BLACK, backcolor=ZHONGDU, size=2) + + elif 200 <= int(weather[4]) < 300: # 重度 + d.drawRect(115, 5, 50, 24, ZHONGDU, border=1, fillcolor=ZHONGDU) + printChinese('重度', 117, 5, color=BLACK, backcolor=ZHONGDU, size=2) + + elif 300 <= int(weather[4]) < 500: # 严重 + d.drawRect(115, 5, 50, 24, YANZHONG, border=1, fillcolor=YANZHONG) + printChinese('严重', 117, 5, color=BLACK, backcolor=YANZHONG, size=2) except: print("No air quality data!") - - - #实时温度 - d.Picture(10,175,"/data/picture/default/temp.jpg") - d.drawRect(44, 185, 48, 10, WHITE, border=2,fillcolor=BLACK) - d.drawRect(46, 187, 25, 6, RED, border=2,fillcolor=RED) - d.printStr(' ', 100, 177, BLACK, size=2) #消除重影 - d.printStr(weather[7], 115-len(weather[7]*5), 177, RED, size=2) - printChinese('℃',135,177,color=WHITE,backcolor=BLACK,size=2) - - #实时湿度 - d.Picture(10,205,"/data/picture/default/humi.jpg") - d.drawRect(44, 215, 48, 10, WHITE, border=2,fillcolor=BLACK) - d.drawRect(46, 217, 30, 6, DEEPGREEN, border=2,fillcolor=DEEPGREEN) + + # 实时温度 + d.Picture(10, 175, "/data/picture/default/temp.jpg") + d.drawRect(44, 185, 48, 10, WHITE, border=2, fillcolor=BLACK) + d.drawRect(46, 187, 25, 6, RED, border=2, fillcolor=RED) + d.printStr(' ', 100, 177, BLACK, size=2) # 消除重影 + d.printStr(weather[7], 115 - len(weather[7] * 5), 177, RED, size=2) + printChinese('℃', 135, 177, color=WHITE, backcolor=BLACK, size=2) + + # 实时湿度 + d.Picture(10, 205, "/data/picture/default/humi.jpg") + d.drawRect(44, 215, 48, 10, WHITE, border=2, fillcolor=BLACK) + d.drawRect(46, 217, 30, 6, DEEPGREEN, border=2, fillcolor=DEEPGREEN) + d.printStr('100', 100, 207, DEEPGREEN, size=2) + time.sleep(1) if weather[8] == '100': d.printStr(weather[8], 100, 207, DEEPGREEN, size=2) else: - d.printStr(' ', 100, 207, BLACK, size=2) #消除100%的重影 + d.printStr(' ', 100, 207, BLACK, size=2) # 消除100%的重影 d.printStr(weather[8], 105, 207, DEEPGREEN, size=2) - printChinese('%',135,207,color=WHITE,backcolor=BLACK,size=2) + printChinese('%', 135, 207, color=WHITE, backcolor=BLACK, size=2) + + # 新冠疫情感染人数新增 + printChinese('确诊新增', 160, 176, color=WHITE, backcolor=BLACK, size=1) + d.printStr(" " * len(weather[9]), 160, 192, BLACK, size=1) # 消除残影 + d.printStr(weather[9], 160, 192, WHITE, size=1) + printChinese('无症状新增', 160, 208, color=WHITE, backcolor=BLACK, size=1) + d.printStr(" " * len(weather[9]), 160, 224, BLACK, size=1) # 消除残影 + d.printStr(weather[10], 160, 224, WHITE, size=1) -def message_display(weather,datetime): - + +def message_display(weather, datetime): global message_num - - #实时天气 + + # 今天天气 if message_num == 0: - printChinese(' ',5,40,color=WHITE,backcolor=BLACK,size=2) #清除显示残留 - if len(weather[3])<3:#2个文字以内 - printChinese('实时天气 '+weather[3],5,40,color=WHITE,backcolor=BLACK,size=2) - else: - printChinese('实时 '+weather[3],5,40,color=WHITE,backcolor=BLACK,size=2) - + printChinese(' ', 5, 40, color=WHITE, backcolor=BLACK, size=2) # 清除显示残留 + if len(weather[3]) < 3: # 2个文字以内 + printChinese('实时天气 ' + weather[3], 5, 40, color=WHITE, backcolor=BLACK, size=2) + else: + printChinese('实时 ' + weather[3], 5, 40, color=WHITE, backcolor=BLACK, size=2) + if weather[3] == '晴': - if 7 <= datetime[4] < 19: #白天7点~19点 - d.Picture(175,5,"/data/picture/default/weather/qing.jpg") + if 7 <= datetime[4] < 19: # 白天7点~19点 + d.Picture(175, 5, "/data/picture/default/weather/qing.jpg") else: - d.Picture(175,5,"/data/picture/default/weather/qing_night.jpg") - + d.Picture(175, 5, "/data/picture/default/weather/qing_night.jpg") elif weather[3] == '阴': - if 7 <= datetime[4] < 19: #白天7点~19点 - d.Picture(175,5,"/data/picture/default/weather/yin.jpg") + if 7 <= datetime[4] < 19: # 白天7点~19点 + d.Picture(175, 5, "/data/picture/default/weather/yin.jpg") else: - d.Picture(175,5,"/data/picture/default/weather/yin_night.jpg") - + d.Picture(175, 5, "/data/picture/default/weather/yin_night.jpg") elif weather[3] == '多云': - d.Picture(175,5,"/data/picture/default/weather/duoyun.jpg") - + d.Picture(175, 5, "/data/picture/default/weather/duoyun.jpg") elif weather[3] == '小雨': - d.Picture(175,5,"/data/picture/default/weather/xiaoyu.jpg") - + d.Picture(175, 5, "/data/picture/default/weather/xiaoyu.jpg") elif weather[3] == '中雨': - d.Picture(175,5,"/data/picture/default/weather/zhongyu.jpg") - + d.Picture(175, 5, "/data/picture/default/weather/zhongyu.jpg") elif weather[3] == '大雨': - d.Picture(175,5,"/data/picture/default/weather/dayu.jpg") - + d.Picture(175, 5, "/data/picture/default/weather/dayu.jpg") elif weather[3] == '暴雨': - d.Picture(175,5,"/data/picture/default/weather/dayu.jpg") - + d.Picture(175, 5, "/data/picture/default/weather/dayu.jpg") elif weather[3] == '雷阵雨': - d.Picture(175,5,"/data/picture/default/weather/dayu.jpg") - + d.Picture(175, 5, "/data/picture/default/weather/dayu.jpg") elif weather[3] == '阵雨': - d.Picture(175,5,"/data/picture/default/weather/zhongyu.jpg") - + d.Picture(175, 5, "/data/picture/default/weather/zhongyu.jpg") elif weather[3] == '雾': - d.Picture(175,5,"/data/picture/default/weather/wu.jpg") - + d.Picture(175, 5, "/data/picture/default/weather/wu.jpg") elif weather[3] == '雨夹雪': - d.Picture(175,5,"/data/picture/default/weather/yujiaxue.jpg") - + d.Picture(175, 5, "/data/picture/default/weather/yujiaxue.jpg") elif weather[3] == '小雪': - d.Picture(175,5,"/data/picture/default/weather/xiaoxue.jpg") - + d.Picture(175, 5, "/data/picture/default/weather/xiaoxue.jpg") elif weather[3] == '中雪': - d.Picture(175,5,"/data/picture/default/weather/daxue.jpg") - + d.Picture(175, 5, "/data/picture/default/weather/daxue.jpg") elif weather[3] == '大雪': - d.Picture(175,5,"/data/picture/default/weather/daxue.jpg") - + d.Picture(175, 5, "/data/picture/default/weather/daxue.jpg") else: - d.Picture(175,5,"/data/picture/default/weather/no.jpg") + d.Picture(175, 5, "/data/picture/default/weather/no.jpg") - #今天天气 + # 今天天气 elif message_num == 1: - printChinese(' ',5,40,color=WHITE,backcolor=BLACK,size=2) #清除显示残留 - if len(weather[0])<3: #2个字以内 - printChinese('今天天气 '+ weather[0],5,40,color=WHITE,backcolor=BLACK,size=2) - elif len(weather[0])<5: #4个字以内 - printChinese('今天 '+ weather[0],5,40,color=WHITE,backcolor=BLACK,size=2) - elif len(weather[0])<8: #7个字以内 - printChinese(weather[0],41-(len(weather[0])-4)*12,40,color=WHITE,backcolor=BLACK,size=2) - else:#8个字以上,显示前7个 - printChinese(weather[0][:7],5,40,color=WHITE,backcolor=BLACK,size=2) - #风向 + printChinese(' ', 5, 40, color=WHITE, backcolor=BLACK, size=2) # 清除显示残留 + if len(weather[0]) < 3: # 2个字以内 + printChinese('今天天气 ' + weather[0], 5, 40, color=WHITE, backcolor=BLACK, size=2) + elif len(weather[0]) < 5: # 4个字以内 + printChinese('今天 ' + weather[0], 5, 40, color=WHITE, backcolor=BLACK, size=2) + elif len(weather[0]) < 8: # 7个字以内 + printChinese(weather[0], 41 - (len(weather[0]) - 4) * 12, 40, color=WHITE, backcolor=BLACK, size=2) + else: # 8个字以上,显示前7个 + printChinese(weather[0][:7], 5, 40, color=WHITE, backcolor=BLACK, size=2) + # 风向 elif message_num == 2: - printChinese(' ',5,40,color=WHITE,backcolor=BLACK,size=2) #清除显示残留 - printChinese(weather[5],30,40,color=WHITE,backcolor=BLACK,size=2) - d.printStr(weather[6],110, 40, WHITE, size=2) - printChinese('级',125,40,color=WHITE,backcolor=BLACK,size=2) - - #最高温度 + printChinese(' ', 5, 40, color=WHITE, backcolor=BLACK, size=2) # 清除显示残留 + printChinese(weather[5], 30, 40, color=WHITE, backcolor=BLACK, size=2) + d.printStr(weather[6], 110, 40, WHITE, size=2) + printChinese('级', 125, 40, color=WHITE, backcolor=BLACK, size=2) + + # 最高温度 elif message_num == 3: - printChinese(' ',5,40,color=WHITE,backcolor=BLACK,size=2) #清除显示残留 - printChinese('最低温度 ',5,40,color=WHITE,backcolor=BLACK,size=2) - d.printStr(weather[1], 140-len(weather[1])*10, 40, WHITE, size=2) - printChinese('℃',148,40,color=WHITE,backcolor=BLACK,size=2) - - #最低温度 + printChinese(' ', 5, 40, color=WHITE, backcolor=BLACK, size=2) # 清除显示残留 + printChinese('最低温度 ', 5, 40, color=WHITE, backcolor=BLACK, size=2) + d.printStr(weather[1], 140 - len(weather[1]) * 10, 40, WHITE, size=2) + printChinese('℃', 148, 40, color=WHITE, backcolor=BLACK, size=2) + + # 最低温度 elif message_num == 4: - printChinese(' ',5,40,color=WHITE,backcolor=BLACK,size=2) #清除显示残留 - printChinese('最高温度 ',5,40,color=WHITE,backcolor=BLACK,size=2) - d.printStr(weather[2], 140-len(weather[2])*10, 40, WHITE, size=2) - printChinese('℃',148,40,color=WHITE,backcolor=BLACK,size=2) - - #动态信息显示选择 + printChinese(' ', 5, 40, color=WHITE, backcolor=BLACK, size=2) # 清除显示残留 + printChinese('最高温度 ', 5, 40, color=WHITE, backcolor=BLACK, size=2) + d.printStr(weather[2], 140 - len(weather[2]) * 10, 40, WHITE, size=2) + printChinese('℃', 148, 40, color=WHITE, backcolor=BLACK, size=2) + + # 动态信息显示选择 message_num = message_num + 1 if message_num == 5: message_num = 0 - + + def datetime_display(datetime): - #日期显示 + # 日期显示 year = datetime[0] month = datetime[1] day = datetime[2] week = datetime[3] - + if month > 9: d.printStr(str(month), 5, 140, WHITE, size=2) else: d.printStr(str(month), 13, 140, WHITE, size=2) - - printChinese('月',30,140,color=WHITE,backcolor=BLACK,size=2) - + + printChinese('月', 30, 140, color=WHITE, backcolor=BLACK, size=2) + if day > 9: d.printStr(str(day), 55, 140, WHITE, size=2) else: d.printStr(str(day), 63, 140, WHITE, size=2) - printChinese('日',80,140,color=WHITE,backcolor=BLACK,size=2) + printChinese('日', 80, 140, color=WHITE, backcolor=BLACK, size=2) - printChinese('周'+week_list[week],115,140,color=WHITE,backcolor=BLACK,size=2) - - - #时间显示 + printChinese('周' + week_list[week], 115, 140, color=WHITE, backcolor=BLACK, size=2) + + # 时间显示 second = datetime[6] minute = datetime[5] hour = datetime[4] - if hour > 9: d.printStr(str(hour), 20, 80, WHITE, size=4) else: - d.printStr('0'+str(hour), 20, 80, WHITE, size=4) - + d.printStr('0' + str(hour), 20, 80, WHITE, size=4) + d.printStr(':', 68, 80, WHITE, size=4) - + if minute > 9: d.printStr(str(minute), 92, 80, YELLOW, size=4) else: - d.printStr('0'+str(minute), 92, 80, YELLOW, size=4) - + d.printStr('0' + str(minute), 92, 80, YELLOW, size=4) + d.printStr(':', 140, 80, WHITE, size=4) - + if second > 9: d.printStr(str(second), 164, 80, WHITE, size=4) else: - d.printStr('0'+str(second), 164, 80, WHITE, size=4) + d.printStr('0' + str(second), 164, 80, WHITE, size=4) + -#用于显示动画 +# 用于显示动画 second2 = 61 -#显示图片 -def UI_Display(city,weather,datetime): - - global second2,message_num - - if global_var.UI_Change: #首次显示 - + +# 显示图片 +def UI_Display(city, weather, datetime): + global second2, message_num + + if global_var.UI_Change: # 首次显示 + global_var.UI_Change = 0 message_num = 0 - - d.fill(BLACK) #清屏 - weather_display(city,weather) - message_display(weather,datetime) + + d.fill(BLACK) # 清屏 + weather_display(city, weather) + message_display(weather, datetime) datetime_display(datetime) - #logo动态显示 + # logo动态显示 if second2 != datetime[6]: - if gc.mem_free() < 15000: #内存不足 - gc.collect() #回收内存 - d.Picture(165,165,"/data/picture/default/"+str(datetime[6]%4+1)+".jpg") + if gc.mem_free() < 15000: # 内存不足 + gc.collect() # 回收内存 + # d.Picture(165,165,"/data/picture/default/"+str(datetime[6]%4+1)+".jpg") second2 = datetime[6] - - #动态信息显示刷新时间5秒 - if datetime[6]%5 == 0: - - message_display(weather,datetime) - - #天气信息显示刷新时间10分钟 - if datetime[5]%10 == 0 and datetime[6]==0: - - weather_display(city,weather) + + # 动态信息显示刷新时间5秒 + if datetime[6] % 5 == 0: + message_display(weather, datetime) + + # 天气信息显示刷新时间10分钟 + if datetime[5] % 10 == 0 and datetime[6] == 0: + weather_display(city, weather)