#include "config.h"
#include <stdio.h>
VARYSTRUCT vary1,vary2,vary3,vary4,vary5,vary6,vary7,vary8,vary9,vary9_1,vary9_2,vary0,vary0_1,vary0_2,vary0_3,vary0_4,vary0_5,vary0_6;
VARYSTRUCT *pVary;
unsigned char String[LCD_LEN+1]; //for line1
unsigned char String_1[LCD_LEN+1]; //for Line2
unsigned char sTemp[15];
unsigned int sIndex;
unsigned int TextLen_ForDB;
unsigned char leandR[]={0x1B,0x1A}; //左右箭头
unsigned char waiting[]={0xCF,0xB5,0xCD,0xB3,0xB3,0xF5,0xCA,0xBC,0xBB,0xAF,0xA1,0xAD}; //系统初始化等待
unsigned char CheckCard_OK[]={0xCB,0xA2,0xBF,0xA8,0xB3,0xC9,0xB9,0xA6}; //刷卡成功
unsigned char CardIndex[]={0xBF,0xA8,0xBA,0xC5,0x3A}; //卡号
unsigned char CardNum[]={0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38}; //卡号数字
unsigned char Welcome[]={0xBB,0xB6,0xD3,0xAD,0xB9,0xE2,0xC1,0xD9}; //欢迎光临
unsigned char SettingError[]={0xC9,0xE8,0xD6,0xC3,0xB4,0xED,0xCE,0xF3}; //设置错误
uint8 ServerIP[4];
uint8 myServerIP[12];
uint8 TmpServerIP[12];
uint8 Updatetime[4];
uint8 TmpUpdatetime[4];
uint8 DeviceID[5];
uint8 TmpDeviceID[5];
uint8 OpenLightTime[3];
uint8 TmpOpenLightTime[3];
uint8 WarningTime[3];
uint8 TmpWarningTime[3];
uint8 RespondTime[3];
uint8 TmpRespondTime[3];
uint8 DeviceIP[4];
uint8 myDeviceIP[12];
uint8 TmpDeviceIP[12];
uint8 SubnetMask[4];
uint8 mySubnetMask[12];
uint8 TmpSubnetMask[12];
uint8 JobNumLen[2];
uint8 TmpJobNumLen[2];
uint8 CardNumLen[2];
uint8 TmpCardNumLen[2];
uint8 RegistTime[3];
uint8 TmpRegistTime[3];
uint8 OfflineTime[3];
uint8 TmpOfflineTime[3];
uint8 OnlineTime[3];
uint8 TmpOnlineTime[3];
uint8 ESDeffectiveTime[3];
uint8 TmpESDeffectiveTime[3];
uint8 OpendoorDetectTime[3];
uint8 TmpOpendoorDetectTime[3];
uint8 FocusIndex;
uint8 MaxIndex;
uint8 CardSignal; //判断有没有刷卡信号
uint8 Hour,Minute,Second;
uint8 Year,Month,Day;
uint8 tmpDisMod; //主菜单的显示还是修改的控制字
uint8 tmpDisMod9; //9的子菜单的显示还是修改的控制字
uint8 tmpDisMod0; //0的子菜单的显示还是修改的控制字
uint8 reverseflag;
uint8 SettingPic; //主菜单画面
uint8 AdvancedSettingPic; //高级设置菜单画面
char *ESDText;
char *TmpESDText;
unsigned char LCDText(unsigned char Line, unsigned char* Msg){
int i;
if(Line == 1) display_word(0x80,Msg,LCD_LEN);
else display_word(0x90,Msg,LCD_LEN);
return TRUE;
}
unsigned int InsertString(unsigned char* Text)
{
unsigned int TextLen;
unsigned int i;
if(sIndex == 0){
return 0;
}
TextLen = strlen(Text);
if((TextLen + sIndex) > LCD_LEN){
return 0;
}
for(i=0;i<TextLen;i++){
String[sIndex+i] = Text[i];
}
sIndex += TextLen;
return TextLen;
}
unsigned int AddString(unsigned char* Text){
unsigned int TextLen;
memset(String,0x20,LCD_LEN);
String[LCD_LEN] = 0;
memset(String_1,0x20,LCD_LEN);
String_1[LCD_LEN] = 0;
sIndex = 0;
TextLen = strlen(Text);
if(TextLen > LCD_LEN){
return 0;
}
memcpy(String,Text,TextLen);
return TextLen;
}
void LeftandRightFlag() //在line3显示左右箭头
{
display_word(0x8B,leandR,2);
}
void Waiting_menu() //等待系统初始化画面
{
display_word(0x91,waiting,12);
delay1(5000000);
lcd_clear();
}
void Data()
{
Year = 12,Month = 4,Day = 8;
}
void main_menu() //时钟显示主界面
{
if(CardSignal == 1){ //如果有刷卡信号,就显示卡号
lcd_clear();
display_word(0x92,CheckCard_OK,8);
display_word(0x88,CardIndex,6);
display_word(0x8B,CardNum,8);
delay1(5000000);
CardSignal = 0;
lcd_clear();
}
else{
display_word(0x82,Welcome,8);
sprintf(sTemp,"%02d:%02d:%02d",Hour,Minute,Second);
display_word(0x92,sTemp,8);
Data();
sprintf(sTemp,"%02d/%02d/%02d",Year,Month,Day);
display_word(0x8A,sTemp,8);
}
}
void iniNeePara() //选项数据赋初值
{
ServerIP[0]=192;
ServerIP[1]=168;
ServerIP[2]=100;
ServerIP[3]=111;
myServerIP[0]=ServerIP[0]/100;
myServerIP[1]=ServerIP[0]%100/10;
myServerIP[2]=ServerIP[0]%100%10;
myServerIP[3]=ServerIP[1]/100;
myServerIP[4]=ServerIP[1]%100/10;
myServerIP[5]=ServerIP[1]%100%10;
myServerIP[6]=ServerIP[2]/100;
myServerIP[7]=ServerIP[2]%100/10;
myServerIP[8]=ServerIP[2]%100%10;
myServerIP[9]=ServerIP[3]/100;
myServerIP[10]=ServerIP[3]%100/10;
myServerIP[11]=ServerIP[3]%100%10;
TmpServerIP[0]= myServerIP[0];
TmpServerIP[1]= myServerIP[1];
TmpServerIP[2]= myServerIP[2];
TmpServerIP[3]= myServerIP[3];
TmpServerIP[4]= myServerIP[4];
TmpServerIP[5]= myServerIP[5];
TmpServerIP[6]= myServerIP[6];
TmpServerIP[7]= myServerIP[7];
TmpServerIP[8]= myServerIP[8];
TmpServerIP[9]= myServerIP[9];
TmpServerIP[10]= myServerIP[10];
TmpServerIP[11]= myServerIP[11];
Updatetime[0]=0;
Updatetime[1]=0;
Updatetime[2]=0;
Updatetime[3]=0;
TmpUpdatetime[0]=Updatetime[0];
TmpUpdatetime[1]=Updatetime[1];
TmpUpdatetime[2]=Updatetime[2];
TmpUpdatetime[3]=Updatetime[3];
DeviceID[0]=9;
DeviceID[1]=8;
DeviceID[2]=7;
DeviceID[3]=6;
DeviceID[4]=5;
TmpDeviceID[0]=DeviceID[0];
TmpDeviceID[1]=DeviceID[1];
TmpDeviceID[2]=DeviceID[2];
TmpDeviceID[3]=DeviceID[3];
TmpDeviceID[4]=DeviceID[4];
OpenLightTime[0]=0;
OpenLightTime[1]=3;
OpenLightTime[2]=2;
TmpOpenLightTime[0]=OpenLightTime[0];
TmpOpenLightTime[1]=OpenLightTime[1];
TmpOpenLightTime[2]=OpenLightTime[2];
WarningTime[0]=0;
WarningTime[1]=0;
WarningTime[2]=3;
TmpWarningTime[0]=WarningTime[0];
TmpWarningTime[1]=WarningTime[1];
TmpWarningTime[2]=WarningTime[2];
RespondTime[0]=0;
RespondTime[1]=2;
RespondTime[2]=0;
TmpRespondTime[0]=RespondTime[0];
TmpRespondTime[1]=RespondTime[1];
TmpRespondTime[2]=RespondTime[2];
DeviceIP[0]=192;
DeviceIP[1]=168;
DeviceIP[2]=1;
DeviceIP[3]=68;
myDeviceIP[0]=DeviceIP[0]/100;
myDeviceIP[1]=DeviceIP[0]%100/10;
myDeviceIP[2]=DeviceIP[0]%100%10;
myDeviceIP[3]=DeviceIP[1]/100;
myDeviceIP[4]=DeviceIP[1]%100/10;
myDeviceIP[5]=DeviceIP[1]%100%10;
myDeviceIP[6]=DeviceIP[2]/100;
myDeviceIP[7]=DeviceIP[2]%100/10;
myDeviceIP[8]=DeviceIP[2]%100%10;
myDeviceIP[9]=DeviceIP[3]/100;
myDeviceIP[10]=DeviceIP[3]%100/10;
myDeviceIP[11]=DeviceIP[3]%100%10;
TmpDeviceIP[0]=myDeviceIP[0];
TmpDeviceIP[1]=myDeviceIP[1];
TmpDeviceIP[2]=myDeviceIP[2];
TmpDeviceIP[3]=myDeviceIP[3];
TmpDeviceIP[4]=myDeviceIP[4];
TmpDeviceIP[5]=myDeviceIP[5];
TmpDeviceIP[6]=myDeviceIP[6];
TmpDeviceIP[7]=myDeviceIP[7];
TmpDeviceIP[8]=myDeviceIP[8];
TmpDeviceIP[9]=myDeviceIP[9];
TmpDeviceIP[10]=myDeviceIP[10];
TmpDeviceIP[11]=myDeviceIP[11];
SubnetMask[0]=192;
SubnetMask[1]=168;
SubnetMask[2]=1;
SubnetMask[3]=1;
mySubnetMask[0]=SubnetMask[0]/100;
mySubnetMask[1]=SubnetMask[0]%100/10;
mySubnetMask[2]=SubnetMask[0]%100%10;
mySubnetMask[3]=SubnetMask[1]/100;
mySubnetMask[4]=SubnetMask[1]%100/10;
mySubnetMask[5]=SubnetMask[1]%100%10;
mySubnetMask[6]=SubnetMask[2]/100;
mySubnetMask[7]=SubnetMask[2]%100/10;
mySubnetMask[8]=SubnetMask[2]%100%10;
mySubnetMask[9]=SubnetMask[3]/100;
mySubnetMask[10]=SubnetMask[3]%100/10;
mySubnetMask[11]=SubnetMask[3]%100%10;
TmpSubnetMask[0]=mySubnetMask[0];
TmpSubnetMask[1]=mySubnetMask[1];
TmpSubnetMask[2]=mySubnetMask[2];
TmpSubnetMask[3]=mySubnetMask[3];
TmpSubnetMask[4]=mySubnetMask[4];
TmpSubnetMask[5]=mySubnetMask[5];
TmpSubnetMask[6]=mySubn
easyarm.rar_Easyarm
版权申诉
6 浏览量
2022-09-14
21:15:19
上传
评论
收藏 249KB RAR 举报
钱亚锋
- 粉丝: 88
- 资源: 1万+