⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 domessage.c.svn-base

📁 keilC底层软件,能够结合硬件产生加解密密文,具有安全保护功能.
💻 SVN-BASE
📖 第 1 页 / 共 5 页
字号:
#include "reg51.h" 
#include "../include/global.h"
#include "../include/c51.h"
#include "../include/DoMessage.h" 
/*Page1:title,*/
void page1init()
{
	TimerType = TimerKeyOff;
	ShowMainTime();
	SetControlDataS(2,14,&datatime[0],20);
	datatime[0] = 20;
	SetControlDataS(2,13,&datatime[0],1);
	if (ReadOneXByte(0,(ucharx *)shyklsxsz) == 0) {
		SetControlOneData(1,31,0x00);
	}
	if (ReadOneXByte(0,(ucharx *)sqyklsxsz) == 0) {
		SetControlOneData(1,48,0x00);
	}
} 
 
void page1end(unsigned char value)
{
unsigned char k;
ucharx *p_datatime;
ucharx *ptemp;
ucharx tempdata[5];
if((value==KEYESC)&&(NowControl!=1)&&(NowControl!=8))
{
  BackToMain(1);
  NowControl=1;
  return;
}

if((value==KEYENTER)&&(NowControl==8))
{
  RestorePowerOffData();
  return;
}

if((value==KEYESC)&&(NowControl==8))
{
  NowControl=1;
  CursorEnable=0;
  PersonKind=3;
  NowPerson=0;
  NowPage=19;
  NowFocuse=1;
  InitTurnIndex();
  InputKey=KEYREFRSH;
  WaitForKey=0;
  return;
}

if(((value==MsgShowTimer)&&(NowControl==1))||(value==KEYREFRSHOVER))
{
  TimerType=TimerKeyOff;
  ShowMainTime();
  p_datatime=GetControlPoint(2,14);
  for(k=0;k<20;k++)
  {
    if(*(p_datatime+k)!=datatime[k])
    {
      SetControlDataS(2,14,&datatime[0],20);
      datatime[0]=20;
      SetControlDataS(2,13,&datatime[0],1);
      NowControl=2;
      InputKey=KEYSINGLEREFRSH;
      ExplainKey();
      InputKey=NOKEY;
      NowControl=1;
      return;
    }
  }
  return;
}

if((value==KEYFOCUSLIGHTOVER)&&(NowControl==1))
{
  YJHClearWindow(0,108,127,127,0x04);
  NowControl=4;
  InputKey=KEYSINGLEREFRSH;
  WaitForKey=0;
  return;
}

if((value==KEYSINGLEREFRSH)&&(NowControl==1))
{
  InputKey=KEYFOCUSLIGHT;
  WaitForKey=0;
  return;
}


if((value==KEYSINGLEREFRSH)&&(NowControl==4))
{
  NowControl=5;
  InputKey=NewKEYREFRSH1;
  ExplainKey();
  InputKey=KEYFOCUSECURSOR;
  WaitForKey=0;
  return;
}

if((value==KEYSINGLEREFRSH)&&(NowControl==2))
{
  NowControl=1;
  NowFocuse=4;
  InputKey=KEYFOCUSBLACK;
  WaitForKey=0;
  CursorEnable=0;
  return;
}

if((value==KEYUP||value==KEYESC)&&(NowControl==5))
{
  YJHClearWindow(0,108,127,127,0x04);
  ShowMainTime();
  TimerType=TimerKeyOff;
  NowControl=2;
  NowFocuse=4;
  InputKey=KEYSINGLEREFRSH;
  WaitForKey=0;
  return;
}


if(value==4)
{
  k=IsPersonLock(3,0);
  if(k==PasswordLock)
  {
    NowControl=3;
    CursorEnable=0;
    InputKey=KEYSINGLEREFRSH;
    WaitForKey=0;
    return;
  }
}

if(value==KEYENTER)
{
  if(NowControl==5||NowControl==9)
  {
    ptemp=GetControlPoint(5,53);
    //////    k=ExamPass(NowPoint+53,3,0);
    k=ExamPass(ptemp,3,0);
    if(k==0)
    {
      if(IfPassEqualDefault(ptemp)==1&&NowControl==5)
      {
        NowControl = 9;                      //提示建议修改口令
        InputKey = KEYSINGLEREFRSH;
        ExplainKey();
        return;
      }
      //added for field restore
      NowPerson = SetPerson;
      PersonKind=3;
      if(IsNeedRestoreData() == 1)     //如果系统设置了恢复关机功能
      {
        NowControl = 8;                      //提示是否恢复关机前状态
        CursorEnable = 0;
        InputKey = KEYSINGLEREFRSH;
        WaitForKey = 0;
        return;
      }
      else
      {
        NowControl=1;
        CursorEnable=0;
        PersonKind=3;
        NowPerson=0;
        NowPage=19;
        NowFocuse=1;
        InitTurnIndex();
        InputKey=KEYREFRSH;
        WaitForKey=0;
      }
      //added for field restore finished
    }
    else if(k!=PasswordLock)           //密码错误次数未超出
    {
      NowControl=6;
      CursorEnable=0;
      InputKey=KEYSINGLEREFRSH;
      WaitForKey=0;
    }
    else
    {
      NowControl=3;
      CursorEnable=0;
      InputKey=KEYSINGLEREFRSH;
      WaitForKey=0;
    }
    return;
  }
  else if(NowControl==6)
  {
    NowControl=5;
    CursorEnable=1;
    InputKey=NewKEYREFRSH1;
    WaitForKey=0;
    return;
  }
  else if((NowControl==7)||(NowControl==3))
  {
    NowControl=1;
    return;
  }
}

if(NowControl==1)
{
  switch(value)
  {
  case  1:
    if(GetOpenNum(0)==0)
    {
      for(k=0;k<4;k++)tempdata[k]=qfy[k];
      SetControlDataS(7,34,&tempdata[0],4);
      NowControl=7;
      InputKey=KEYSINGLEREFRSH;
      WaitForKey=0;
      return; 
    }
    TurnDownOnePage();
    NowPage=2;
    PersonKind=0;
    NowFocuse=1;
    InputKey=KEYREFRSH;
    WaitForKey=0;
    break;
  case 2:
    if(GetOpenNum(1)==0)
    {
      
      for(k=0;k<4;k++)tempdata[k]=shy[k];
      SetControlDataS(7,34,&tempdata[0],4);
      NowControl=7;
      InputKey=KEYSINGLEREFRSH;
      WaitForKey=0;
      return; 
    }
    TurnDownOnePage();
    NowPage=3;
    NowControl=0;
    PersonKind=1;
    NowFocuse=1;
    CursorEnable=0;
    InputKey=KEYREFRSH;
    WaitForKey=0;
    break;
  case  3:
    if(GetOpenNum(2)==0)
    {
      for(k=0;k<4;k++)tempdata[k]=sqy[k];
      SetControlDataS(7,34,&tempdata[0],4);
      NowControl=7;
      InputKey=KEYSINGLEREFRSH;
      WaitForKey=0;
      return; 
    }
    TurnDownOnePage();
    NowPage=4;
    NowControl=1;
    PersonKind=2;
    NowFocuse=1;
    CursorEnable=0;
    IsDoInit=1;
    InputKey=KEYREFRSH;
    WaitForKey=0;
    break;
  case  4:
    NowFocuse=4;
    InputKey=KEYSINGLEREFRSH;
    WaitForKey=0;
    TimerType=Timer_Disable;
    break;
  }
}

} 
 
void page2init()
{

} 
 
void page2end(unsigned char value)
{
unsigned char k;
ucharx *ptemp;
if((value==KEYESC)&&(NowControl!=6))
{
  BackToMain(1);
  return;
}

if((value==KEYUP)&&(NowControl==3))
{
  InputKey=NewKEYREFRSH1;
  ExplainKey();
  NowControl=1;
  InputKey=KEYFOCUSBLACK;
  CursorEnable=0;
  WaitForKey=0;
  return;
}

if((value==KEYENTER)&&(NowControl==6))
{
  RestorePowerOffData();
  return;
}

if((value==KEYESC)&&(NowControl==6))
{
  NowControl=1;
  CursorEnable=0;
  NowPage=5;
  InitTurnIndex();
  InputKey=KEYREFRSH;
  WaitForKey=0;
  IsDoInit=1;
  return;
}


if(value==KEYENTER)
{
  if( NowControl==1)
  {
    SetPerson=*(NowPoint+19);
    k=IsPersonLock(PersonKind,SetPerson);
    if(k==PasswordLock)
    {
      NowControl=5;
      InputKey=KEYSINGLEREFRSH;
      WaitForKey=0;
      return;
    }
    InputKey=KEYFOCUSLIGHT;
    ExplainKey();
    NowControl=3;
    CursorEnable=1;
    InputKey=NewKEYREFRSH1;
    ExplainKey();
    InputKey=KEYFOCUSECURSOR;
    WaitForKey=0;
    return;
  }
  else if(NowControl==4)
  {
    NowControl=3;
    CursorEnable=1;
    InputKey=NewKEYREFRSH1;
    ExplainKey();
    WaitForKey=0;
    return;
  }
  else if(NowControl==5)
  {
    NowControl=1;
    CursorEnable=0;
    InputKey=KEYSINGLEREFRSH;
    ExplainKey();
    WaitForKey=0;
    return;
  }
  else if(NowControl==3||NowControl==7)
  {
    ptemp=GetControlPoint(3,53);
//////    k=ExamPass(NowPoint+53,PersonKind,SetPerson);
    k=ExamPass(ptemp,PersonKind,SetPerson);
    if(k==0)         //密码正确
    {
          if(IfPassEqualDefault(ptemp)==1&&NowControl==3)
          {
                NowControl = 7;                      //提示建议修改口令
                InputKey = KEYSINGLEREFRSH;
                ExplainKey();
                return;
           }
      NowPerson=SetPerson;
      if(IsNeedRestoreData()==1)     //如果系统设置了恢复关机功能
      {
        NowControl=6;                      //提示是否恢复关机前状态
        CursorEnable=0;
        InputKey=KEYSINGLEREFRSH;
        WaitForKey=0;
        return;
      }
      else
      {
        NowControl=1;
        CursorEnable=0;
        NowPage=5;
        InitTurnIndex();
        InputKey=KEYREFRSH;
        WaitForKey=0;
        IsDoInit=1;
      }
    }
    else if(k!=PasswordLock)           //密码错误次数未超出
    {
      NowControl=4;
      CursorEnable=0;
      InputKey=KEYSINGLEREFRSH;
      WaitForKey=0;
    }
    else
    {
      NowControl=5;
      CursorEnable=0;
      InputKey=KEYSINGLEREFRSH;
      WaitForKey=0;
    }
    return;
  }
}

} 
 
void page3init()
{
if(IsQuickQF==1)
{
SetControlOneData(0,5,NowMM.AccountNum);
}

} 
 
void page3end(unsigned char value)
{
//审核人登录
unsigned char k;
ucharx  *ptemp;

if(value == KEYESC && NowControl != 6) {                    //for avoid NowCtrl is message
    IsQuickQF = 0;
    BackToMain(2);
    return;
}

if(value == KEYESC && NowControl == 6) {
    NowControl = 1;
    CursorEnable = 0;
    IsDoInit = 1;
    NowFocuse = 1;
    NowPage = 15;
    if(IsSettingPLQF() == 0)
        NowFocuse = 2;
    InitTurnIndex();
    InputKey = KEYREFRSH;
    WaitForKey = 0;
    return;
}

if((value==KEYUP)&&(NowControl==2))
{
  InputKey=NewKEYREFRSH1;
  ExplainKey();
  NowControl=0;
  InputKey=KEYFOCUSBLACK;
  CursorEnable=0;
  WaitForKey=0;
  return;
}

if((value==KEYENTER)&&(NowControl==6))
{
  RestorePowerOffData();
  return;
}

if(value==KEYENTER)
{
  if( NowControl==0)
  {
    SetPerson=*(NowPoint+19);
    k=IsPersonLock(PersonKind,SetPerson);
    if(k==PasswordLock)
    {
      NowControl=5;
      InputKey=KEYSINGLEREFRSH;
      WaitForKey=0;
      return;
    }
    InputKey=KEYFOCUSLIGHT;
    ExplainKey();
    NowControl=2;
    CursorEnable=1;
    InputKey=NewKEYREFRSH1;
    ExplainKey();
    InputKey=KEYFOCUSECURSOR;
    WaitForKey=0;
    return;
  }
  
  else if( NowControl==4)
  {
    NowControl=2;
    CursorEnable=1;
    InputKey=NewKEYREFRSH1;
    ExplainKey();
    WaitForKey=0;
    return;
  }
  else if(NowControl==5)
  {
    NowControl=0;
    CursorEnable=0;
    InputKey=KEYSINGLEREFRSH;
    ExplainKey();
    WaitForKey=0;
    return;
  }
  
  else if( NowControl==2||NowControl==7)
  {
    ptemp=GetControlPoint(2,53);
//////    k=ExamPass(NowPoint+53,PersonKind,SetPerson);
    k=ExamPass(ptemp,PersonKind,SetPerson);
    if(k==0)            //密码正确
    {
          if(IfPassEqualDefault(ptemp)==1&&NowControl==2)
          {
                NowControl = 7;                      //提示建议修改口令
                InputKey = KEYSINGLEREFRSH;
                ExplainKey();
                return;
           }
      NowPerson=SetPerson;
      if(IsQuickQF==1)
      {
        NowControl=1;
        CursorEnable=0;
        IsDoInit=1;
        NowPage=35;
        MMIsGet=0;
      }
      else
      {
        if(IsNeedRestoreData()==1)     //如果系统设置了恢复关机功能
        {
          NowControl=6;                      //提示是否恢复关机前状态
          CursorEnable=0;
          InputKey=KEYSINGLEREFRSH;
          WaitForKey=0;
          return;
        }
        else
        {
          NowControl=1;
          CursorEnable=0;
          IsDoInit=1;
          NowFocuse=1;
          NowPage=15;
          if(IsSettingPLQF()==0)NowFocuse=2;
        }
      }
      InitTurnIndex();
      InputKey=KEYREFRSH;
      WaitForKey=0;
    }
    
    else if(k!=PasswordLock)           //密码错误次数未超出
    {
      NowControl=4;
      CursorEnable=0;
      InputKey=KEYSINGLEREFRSH;
      WaitForKey=0;
    }
    else
    {
      NowControl=5;
      CursorEnable=0;
      InputKey=KEYSINGLEREFRSH;
      WaitForKey=0;
    }
    return;
  }
}

} 
 
void page4init()
{
if(IsQuickQF==1)
{
SetControlOneData(1,4,2);
SetControlOneData(1,5,NowMM.AccountNum);
SetControlDataS(1,23,(ucharx *)&NowMM.BcdMoney[0],8);
}
else
{
SetControlOneData(1,4,4);
}

//InitPermitLogin();

} 
 
void page4end(unsigned char value)
{
//授权人登录
unsigned char k;
unsigned char m;
ucharx *ptemp;

if((value==KEYESC)&&(NowControl!=8)&&(NowControl!=6))
{
  IsQuickQF=0;
  BackToMain(3);
  return;
}

if((value==KEYENTER)&&(NowControl==6))
{
  RestorePowerOffData();
  return;
}

if((value==KEYESC)&&(NowControl==6))
{
          NowControl=1;
          CursorEnable=0;
          IsDoInit=1; 
          NowFocuse=1;
          NowPage=17;
          if(IsSettingPLQF()==0)NowFocuse=2;
          NowPerson=SetPerson;
          InitTurnIndex();
          InputKey=KEYREFRSH;
          WaitForKey=0;
          return;
}

if((value==KEYREFRSHOVER)||(((value==KEYDOWN)||(value==KEYUP)||(value==KEYPAGEDOWN)||(value==KEYPAGEUP))&&(NowControl==1)))
{
  m=ReadOneXByte(0,(ucharx *)sfsyshksz);
  if(m==1)
  {
    k=GetControlData(1,19);
    k=IsSettingCard(k);//人员
    if(k!=1)
    {
      YJHClearWindow(3,95,127,108,0x00);	
      IsPersonUseCard=0;
    }
    else
    {
      if(IsQuickQF==1)IsPersonUseCard=1;
      else  IsPersonUseCard=2;
      NowControl=7;
      InputKey=KEYSINGLEREFRSH;
      ExplainKey();
      InputKey=NOKEY;
      NowControl=1;
    }
  }
  else IsPersonUseCard=0;
  return;
}

if((value==KEYUP)&&(NowControl==3))
{
  InputKey=NewKEYREFRSH1;
  ExplainKey();
  NowControl=1;
  InputKey=KEYFOCUSBLACK;
  CursorEnable=0;
  WaitForKey=0;
  return;
}

if(NowControl==8)
{
  if(value==KEYENTER)
  {
    if(IsQuickQF==1)
    {
      NowControl=1;
      CursorEnable=0;
      IsDoInit=1;
      NowPage=35;
      MMIsGet=0;
    }
    else
    {
        NowControl=1;
        NowPage=71;
        CursorEnable=0;
    }
    NowPerson=SetPerson;
    NowMM.sqman=NowPerson;
    InitTurnIndex();
    InputKey=KEYREFRSH;
    WaitForKey=0;
    return;
  }
  else if(value==KEYESC)
  {
    IsPersonUseCard=0;
    NowControl=1;
    InputKey=KEYFOCUSLIGHT;
    ExplainKey();
    NowControl=3;
    CursorEnable=1;
    InputKey=NewKEYREFRSH1;
    ExplainKey();
    InputKey=KEYFOCUSECURSOR;
    WaitForKey=0;
    NowPerson=SetPerson;
    NowMM.sqman=NowPerson;
    return;
  }
}


if(value==KEYENTER)
{
  if( NowControl==1)
  {
    SetPerson=*(NowPoint+19);
    k=IsPersonLock(PersonKind,SetPerson);
    if(k==PasswordLock)
    {
      NowControl=5;
      InputKey=KEYSINGLEREFRSH;
      WaitForKey=0;
      return;
    }
    
    if(IsPersonUseCard)
    {
      if(IsQuickQF==1)
      {
        NowControl=8;
        InputKey=KEYSINGLEREFRSH;
        ExplainKey();
        InputKey=NOKEY;
        return;
      }
      else if(IsExistSQYBill(SetPerson)!=0)
      {
      NowControl=8;
      InputKey=KEYSINGLEREFRSH;
      ExplainKey();
      InputKey=NOKEY;
      return;
      }
    }
    
    InputKey=KEYFOCUSLIGHT;
    ExplainKey();
    NowControl=3;
    CursorEnable=1;
    InputKey=NewKEYREFRSH1;
    ExplainKey();
    InputKey=KEYFOCUSECURSOR;
    WaitForKey=0;
    return;
  }
  else if(NowControl==4)
  {
    NowControl=3;
    CursorEnable=1;
    InputKey=NewKEYREFRSH1;
    ExplainKey();
    WaitForKey=0;
    return;
  }
  else if(NowControl==5)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -