📄 menu.c
字号:
/**********************************************************/
/* */
/*文 件 名:Menu.c */
/*功 能:系统菜单文件 */
/* */
/*当前版本:V1.0 */
/*作 者:白广斌 */
/* */
/*授 权: */
/* */
/*开始日期:2006.11.4 */
/*完成日期:2006.11.17 */
/* */
/**********************************************************/
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <avr/eeprom.h>
#include <Menu.h>
#define uchar unsigned char
#define uint unsigned int
#define ulong unsigned long int
/*********************************************************************************************/
//函数名称:Master_Menu(uchar x)
//函数功能:系统主菜单函数
//调用关系:被()函数调用
//输入参数:菜单键值
//返 回 值:无
/*********************************************************************************************/
void Master_Menu(uchar x)
{
switch(x)
{
case 1: //设置系统日期
{
ClearScreen();
HZ_SET_Date(4,1,1,0);
break;
}
case 2: //设置系统时间
{
ClearScreen();
HZ_SET_Timer(4,1,1,0);
break;
}
case 3: //设置本机地址参数
{
ClearScreen();
HZ_SET_Addr_Parameter(4,1,1,0);
break;
}
case 4: //设置缸套直径
{
ClearScreen();
HZ_SET_GTZJ(4,1,1,0);
break;
}
case 5: //退出
{
ClearScreen();
HZ_SET_Exit(4,1,1,0);
break;
}
case 10: //设置日期显示界面
{
SET_DateMenu_Disp();
break;
}
case 11: //设置时间显示界面
{
SET_TimerMenu_Disp();
break;
}
case 12: //设置巡检参数显示函数
{
SET_Addr_Parameter_Disp();
break;
}
case 13: //设置巡检参数显示函数
{
Password_Menu_Disp(80,12,1,1,Select_Bit);//输入密码菜单项显示函数
break;
}
case 14: //设置缸套直径显示函数
{
SET_GTZJ_Parameter_Disp();
break;
}
default: //无效
{
JK_Pic_OK=0;
break;
}
}
}
/****************************************************************/
//函数名称:HZ_SET_Date(uchar Row,uchar Col,uchar Layer,uchar fs)
//函数功能:"设置日期"显示函数
//输出参数:无
//返 回 值:无
/****************************************************************/
void HZ_SET_Date(uchar Row,uchar Col,uchar Layer,uchar fs)
{
LCM_Screen_HZ(Row,Col,57,Layer,fs); //设置日期
LCM_Screen_HZ(Row,(Col+2),58,Layer,fs);
LCM_Screen_HZ(Row,(Col+4),21,Layer,fs);
LCM_Screen_HZ(Row,(Col+6),26,Layer,fs);
}
/****************************************************************/
//函数名称:HZ_SET_Timer(uchar Row,uchar Col,uchar Layer,uchar fs)
//函数功能:"设置时间"显示函数
//输出参数:无
//返 回 值:无
/****************************************************************/
void HZ_SET_Timer(uchar Row,uchar Col,uchar Layer,uchar fs)
{
LCM_Screen_HZ(Row,Col,57,Layer,fs); //设置时间
LCM_Screen_HZ(Row,(Col+2),58,Layer,fs);
LCM_Screen_HZ(Row,(Col+4),22,Layer,fs);
LCM_Screen_HZ(Row,(Col+6),53,Layer,fs);
}
/****************************************************************/
//函数名称:HZ_SET_Addr_Parameter(uchar Row,uchar Col,uchar Layer,uchar fs)
//函数功能:"设置本机地址参数"显示函数
//输出参数:无
//返 回 值:无
/****************************************************************/
void HZ_SET_Addr_Parameter(uchar Row,uchar Col,uchar Layer,uchar fs)
{
LCM_Screen_HZ(Row,Col,57,Layer,fs); //设置本机地址参数
LCM_Screen_HZ(Row,(Col+2),58,Layer,fs);
LCM_Screen_HZ(Row,(Col+4),62,Layer,fs);
LCM_Screen_HZ(Row,(Col+6),63,Layer,fs);
LCM_Screen_HZ(Row,(Col+8),64,Layer,fs);
LCM_Screen_HZ(Row,(Col+10),65,Layer,fs);
LCM_Screen_HZ(Row,(Col+12),32,Layer,fs);
LCM_Screen_HZ(Row,(Col+14),33,Layer,fs);
}
/****************************************************************/
//函数名称:HZ_SET_GTZJ(uchar Row,uchar Col,uchar Layer,uchar fs)
//函数功能:"设置缸套直径"显示函数
//输出参数:无
//返 回 值:无
/****************************************************************/
void HZ_SET_GTZJ(uchar Row,uchar Col,uchar Layer,uchar fs)
{
LCM_Screen_HZ(Row,Col,57,Layer,fs); //设置缸套直径
LCM_Screen_HZ(Row,(Col+2),58,Layer,fs);
LCM_Screen_HZ(Row,(Col+4),89,Layer,fs);
LCM_Screen_HZ(Row,(Col+6),90,Layer,fs);
LCM_Screen_HZ(Row,(Col+8),91,Layer,fs);
LCM_Screen_HZ(Row,(Col+10),92,Layer,fs);
}
/****************************************************************/
//函数名称:HZ_SET_Timer(uchar Row,uchar Col,uchar Layer,uchar fs)
//函数功能:"退出"显示函数
//输出参数:无
//返 回 值:无
/****************************************************************/
void HZ_SET_Exit(uchar Row,uchar Col,uchar Layer,uchar fs)
{
LCM_Screen_HZ(Row,Col,61,Layer,fs); //退出
LCM_Screen_HZ(Row,(Col+2),38,Layer,fs);
}
/*********************************************************************************************/
//函数名称:SET_Menu_Disp(void)
//函数功能:设置日期显示函数
//调用关系:被()函数调用
//输入参数:无
//返 回 值:无
/*********************************************************************************************/
void SET_DateMenu_Disp(void)
{
RowLine(0,0,40,0xff,1);
RowLine(239,0,40,0xff,1);
ColLine(1,0,0x80,238,1);
ColLine(1,39,0x01,238,1);
HZ_SET_Date(10,16,1,1);
switch(Select_Bit)
{
case 0:
{
LCM_NumberDisplay(40,10,1,((SET_Year_Variable/1000)%10),0);
LCM_NumberDisplay(40,11,1,((SET_Year_Variable/100)%10),0);
LCM_NumberDisplay(40,12,1,((SET_Year_Variable/10)%10),0);
LCM_NumberDisplay(40,13,1,(SET_Year_Variable%10),0);
LCM_Screen_HZ(40,14,19,1,1);
LCM_NumberDisplay(40,16,1,((SET_Month_Variable/10)%10),1);
LCM_NumberDisplay(40,17,1,(SET_Month_Variable%10),1);
LCM_Screen_HZ(40,18,20,1,1);
LCM_NumberDisplay(40,20,1,((SET_Date_Variable/10)%10),1);
LCM_NumberDisplay(40,21,1,(SET_Date_Variable%10),1);
LCM_Screen_HZ(40,22,21,1,1);
SYS_WeekDisplay(40,25);
break;
}
case 1:
{
LCM_NumberDisplay(40,10,1,((SET_Year_Variable/1000)%10),1);
LCM_NumberDisplay(40,11,1,((SET_Year_Variable/100)%10),1);
LCM_NumberDisplay(40,12,1,((SET_Year_Variable/10)%10),1);
LCM_NumberDisplay(40,13,1,(SET_Year_Variable%10),1);
LCM_Screen_HZ(40,14,19,1,1);
LCM_NumberDisplay(40,16,1,((SET_Month_Variable/10)%10),0);
LCM_NumberDisplay(40,17,1,(SET_Month_Variable%10),0);
LCM_Screen_HZ(40,18,20,1,1);
LCM_NumberDisplay(40,20,1,((SET_Date_Variable/10)%10),1);
LCM_NumberDisplay(40,21,1,(SET_Date_Variable%10),1);
LCM_Screen_HZ(40,22,21,1,1);
SYS_WeekDisplay(40,25);
break;
}
default:
{
LCM_NumberDisplay(40,10,1,((SET_Year_Variable/1000)%10),1);
LCM_NumberDisplay(40,11,1,((SET_Year_Variable/100)%10),1);
LCM_NumberDisplay(40,12,1,((SET_Year_Variable/10)%10),1);
LCM_NumberDisplay(40,13,1,(SET_Year_Variable%10),1);
LCM_Screen_HZ(40,14,19,1,1);
LCM_NumberDisplay(40,16,1,((SET_Month_Variable/10)%10),1);
LCM_NumberDisplay(40,17,1,(SET_Month_Variable%10),1);
LCM_Screen_HZ(40,18,20,1,1);
LCM_NumberDisplay(40,20,1,((SET_Date_Variable/10)%10),0);
LCM_NumberDisplay(40,21,1,(SET_Date_Variable%10),0);
LCM_Screen_HZ(40,22,21,1,1);
SYS_WeekDisplay(40,25);
break;
}
}
}
/*********************************************************************************************/
//函数名称:SET_TimerMenu_Disp(void)
//函数功能:设置时间显示函数
//调用关系:被()函数调用
//输入参数:无
//返 回 值:无
/*********************************************************************************************/
void SET_TimerMenu_Disp(void)
{
RowLine(0,0,40,0xff,1);
RowLine(239,0,40,0xff,1);
ColLine(1,0,0x80,238,1);
ColLine(1,39,0x01,238,1);
HZ_SET_Timer(10,16,1,1);
switch(Select_Bit)
{
case 0:
{
LCM_NumberDisplay(40,12,1,((SET_HH_Variable/10)%10),0);
LCM_NumberDisplay(40,13,1,(SET_HH_Variable%10),0);
LCM_Screen_HZ(40,14,22,1,1);
LCM_NumberDisplay(40,16,1,((SET_MM_Variable/10)%10),1);
LCM_NumberDisplay(40,17,1,(SET_MM_Variable%10),1);
LCM_Screen_HZ(40,18,23,1,1);
LCM_NumberDisplay(40,20,1,((SET_SS_Variable/10)%10),1);
LCM_NumberDisplay(40,21,1,(SET_SS_Variable%10),1);
LCM_Screen_HZ(40,22,24,1,1);
break;
}
case 1:
{
LCM_NumberDisplay(40,12,1,((SET_HH_Variable/10)%10),1);
LCM_NumberDisplay(40,13,1,(SET_HH_Variable%10),1);
LCM_Screen_HZ(40,14,22,1,1);
LCM_NumberDisplay(40,16,1,((SET_MM_Variable/10)%10),0);
LCM_NumberDisplay(40,17,1,(SET_MM_Variable%10),0);
LCM_Screen_HZ(40,18,23,1,1);
LCM_NumberDisplay(40,20,1,((SET_SS_Variable/10)%10),1);
LCM_NumberDisplay(40,21,1,(SET_SS_Variable%10),1);
LCM_Screen_HZ(40,22,24,1,1);
break;
}
default:
{
LCM_NumberDisplay(40,12,1,((SET_HH_Variable/10)%10),1);
LCM_NumberDisplay(40,13,1,(SET_HH_Variable%10),1);
LCM_Screen_HZ(40,14,22,1,1);
LCM_NumberDisplay(40,16,1,((SET_MM_Variable/10)%10),1);
LCM_NumberDisplay(40,17,1,(SET_MM_Variable%10),1);
LCM_Screen_HZ(40,18,23,1,1);
LCM_NumberDisplay(40,20,1,((SET_SS_Variable/10)%10),0);
LCM_NumberDisplay(40,21,1,(SET_SS_Variable%10),0);
LCM_Screen_HZ(40,22,24,1,1);
break;
}
}
}
/*********************************************************************************************/
//函数名称:SET_TimerMenu_Disp(void)
//函数功能:设置本机地址参数显示函数
//调用关系:被()函数调用
//输入参数:无
//返 回 值:无
/*********************************************************************************************/
void SET_Addr_Parameter_Disp(void)
{
RowLine(0,0,40,0xff,1);
RowLine(239,0,40,0xff,1);
ColLine(1,0,0x80,238,1);
ColLine(1,39,0x01,238,1);
HZ_SET_Addr_Parameter(10,12,1,1);
LCM_Screen_str(40,16,"Y:",1,1);
LCM_NumberDisplay(40,18,1,((SET_Addr_Variable/100)%10),0);
LCM_NumberDisplay(40,19,1,((SET_Addr_Variable/10)%10),0);
LCM_NumberDisplay(40,20,1,(SET_Addr_Variable%10),0);
}
/*********************************************************************************************/
//函数名称:LJLL_Clerr(void)
//函数功能:累计流量清零显示函数
//调用关系:被()函数调用
//输入参数:无
//返 回 值:无
/*********************************************************************************************/
void LJLL_Clerr_Display(void)
{
RowLine(0,0,40,0xff,1);
RowLine(239,0,40,0xff,1);
ColLine(1,0,0x80,238,1);
ColLine(1,39,0x01,238,1);
LCM_Screen_HZ(40,10,70,1,1); //您确认清累计流量吗?
LCM_Screen_HZ(40,12,71,1,1);
LCM_Screen_HZ(40,14,72,1,1);
LCM_Screen_HZ(40,16,73,1,1);
LCM_Screen_HZ(40,18,45,1,1);
LCM_Screen_HZ(40,20,46,1,1);
LCM_Screen_HZ(40,22,30,1,1);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -