增加交流量和直流量显示页面框架

This commit is contained in:
2026-04-02 21:18:01 +08:00
parent df94630210
commit d19ce588b3
27 changed files with 1139 additions and 156 deletions

45
src/Drv/pages/YC/view.c Normal file
View File

@@ -0,0 +1,45 @@
#include "Drv/pages/YC/view.h"
#include <stdio.h>
static const PageRenderPort *s_port = NULL;
static void YCView_ShowInfoPage(uint16_t wPageNum, uint16_t wPageMax)
{
s_port->show_info_page(wPageNum, wPageMax);
}
static void YCView_ShowTerminalInfo(void)
{
uint8_t *context[] = {
"终端类型 F30",
"终端型号 F30",
"软件版本 SV0.010",
"硬件版本 HW0.010",
"软件校验 4454",
"程序日期 2024.08.27"
};
s_port->show_str(32, 26, "馈线自动化终端");
for(uint8_t index = 0; index < 6; index++ )
{
s_port->show_str(6, 26 + (index + 1) * (s_port->get_ascii_height() + s_port->get_row_space()), context[index]);
}
}
static void YCView_ShowTopName(const uint8_t *name)
{
uint16_t wLen = s_port->get_utf8_len(name) * s_port->get_ascii_width();
s_port->fill_rect(0, 0, s_port->get_size_x() - 1, s_port->get_size_y() - 1, s_port->get_color_back());
/* 显示顶部名称,居中显示 */
s_port->show_str((s_port->get_size_x() - wLen) / 2, 3, name);
s_port->draw_meitou(18, 2);
}
void View_Init(view_t *view)
{
s_port = PageRenderer_Lcd();
view->show_top_name = YCView_ShowTopName;
view->show_info_page = YCView_ShowInfoPage;
}