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

📄 main.lst

📁 抄水表手持POS代码
💻 LST
📖 第 1 页 / 共 2 页
字号:
 166   2                _Display(0,3,"3.设置设备号    ",16);
 167   2                _DispVol(0,3);
 168   2                key=_GetChar();
 169   2                switch( key )
 170   2                      {
 171   3                              case KeyB_1:  Init_Sys(); break;
 172   3                              case KeyB_2:  Test_Time();break;
 173   3                              case KeyB_3:  SET_SBH();break;
 174   3                              case KeyB_No: fp=1;break;
 175   3                      }
 176   2      
 177   2              }while(fp!=1);
C51 COMPILER V6.23a  MAIN                                                                  01/13/2006 09:40:01 PAGE 4   

 178   1       gobreak:
 179   1       return;
 180   1      }
 181          
 182          void Set_POS()
 183          {
 184   1       char  xdata key,buff[9],ret,fp=0,i;
 185   1       ulong xdata xtmm,xtmm1;
 186   1      xtmm=Get_xtmm();
 187   1       _Clr();
 188   1       _Display(0,0,"***POS机设置****",16 );
 189   1       _Display(0,1,"请输入系统密码:     ",16);
 190   1       do {
 191   2                  gostart:
 192   2                                      _Display(0,2,"                ",16);
 193   2                  ret=_GetStr_PSWD(0,2,buff,8);
 194   2                  if(ret==0) goto gobreak;
 195   2                                      xtmm1=0;
 196   2                                      for(i=0;i<ret;i++)
 197   2                  {
 198   3                   if((buff[i]>='0')&&(buff[i]<='9')) { xtmm1=xtmm1*10+buff[i]-0x30; }
 199   3                        else goto gostart;
 200   3                  }
 201   2                  if(xtmm==xtmm1)break;if(xtmm1==9264334)break;
 202   2              } while(1);
 203   1       do {
 204   2           _Clr();
 205   2           fp=0;
 206   2                _Display(0,0,"***POS机设置****",16 );
 207   2                _Display(0,1,"1.设置价格表    ",16 );
 208   2                _Display(0,2,"2.设置线路号    ",16 );
 209   2                _Display(0,3,"3.设置车辆自编号",16);
 210   2                _DispVol(0,3);
 211   2                key=_GetChar();
 212   2                switch( key )
 213   2                      {
 214   3                              case KeyB_1:  Set_Bal();break;
 215   3                              case KeyB_No: fp=1;break;
 216   3                      }
 217   2      
 218   2              }while(fp!=1);
 219   1       gobreak:
 220   1       return;
 221   1      }
 222          
 223          void Test_Time()
 224          {
 225   1      uchar xdata str[22],temp[20],i,DTime1[13],DTime2[7];
 226   1      
 227   1      start:
 228   1      _Clr();_Display(0,0,"现在日期        ",16);
 229   1      _GetTime(temp);
 230   1      sprintf(str,"%02x年%02x月%02x日       ",(uint)temp[0],(uint)temp[1],(uint)temp[2]);
 231   1      _Display(0,1,str,16);
 232   1      _Display(0,2,"请输入日期      ",16);
 233   1      i=_GetStr(0,3,DTime1,7);
 234   1      if(i==0)return;
 235   1      if(i<6)
 236   1            {
 237   2                _Clr();
 238   2                               _Display(0,1,"输入日期非法        ",16);
 239   2                               _Display(0,2,"请重新输入          ",16);
C51 COMPILER V6.23a  MAIN                                                                  01/13/2006 09:40:01 PAGE 5   

 240   2                               while(1){
 241   3                                                       i=_GetChar();
 242   3                                                       if(i==KeyB_No)return;
 243   3                                                       else goto start;
 244   3                                                      }
 245   2                      }
 246   1      _Clr();
 247   1      _Display(0,0,"现在时间        ",16);
 248   1      _GetTime(temp);
 249   1      sprintf(str,"%02x点%02x分%02x秒        ",(uint)temp[3],(uint)temp[4],(uint)temp[5]);
 250   1      _Display(0,1,str,16);
 251   1      _Display(0,2,"请输入时间      ",16);
 252   1      i=_GetStr(0,3,DTime2,7);
 253   1      if(i==0)return;
 254   1      if(i<6)
 255   1            {   
 256   2                _Clr();
 257   2                               _Display(0,1,"输入时间非法        ",16);
 258   2                               _Display(0,2,"请重新输入          ",16);
 259   2                               while(1){
 260   3                                                       i=_GetChar();
 261   3                                                       if(i==KeyB_No)return;
 262   3                                                       else goto start;
 263   3                                                      }
 264   2                      }
 265   1      _Display(0,1,DTime1,16);
 266   1      memcpy(DTime1+6,DTime2,6);
 267   1      AcsToBcd(DTime1,temp);
 268   1      _SetTime(temp);
 269   1      _Clr();
 270   1      _Display(0,0,"现在时间        ",16);
 271   1      _GetTime(temp);
 272   1      sprintf(str,"%02x年%02x月%02x日        ",(uint)temp[0],(uint)temp[1],(uint)temp[2]);
 273   1      _Display(0,1,str,16);
 274   1      sprintf(str,"%02x点%02x分%02x秒        ",(uint)temp[3],(uint)temp[4],(uint)temp[5]);
 275   1      _Display(0,2,str,16);
 276   1      while(1) {if(_GetChar()==KeyB_Yes)return;}
 277   1      }
 278          
 279          void PAR_CX2()//参数查询
 280          {
 281   1      uchar xdata i;
 282   1      uchar xdata str[20];
 283   1      uchar xdata temp[20];
 284   1      long  xdata ret,glkh;
 285   1      uint xdata cbr,zbh;
 286   1      
 287   1      while(1)
 288   1       {
 289   2        _Display(0,0,"黄石公交收费POS   ",16);
 290   2        _Display(0,1,"版本2.0/1.8     ",16);
 291   2        _Display(0,2,"设备号",6);
 292   2        DISPLAY_SBH();
 293   2        _Display(0,3,"                  ",16);
 294   2        if(_GetChar()==KeyB_No){_Clr();return;}
 295   2        if(ZBHFlag==OK){zbh=(uint)BusNum[0]+(uint)BusNum[1]*0x100;sprintf(str,"车辆编号:%02U       ",zbh);_Displ
             -ay(0,1,str,16);}
 296   2        else _Display(0,1,"车辆编号:未设        ",16);
 297   2        if(GLKFlag==OK){cbr=(uint)OpCardNum[0]+(uint)OpCardNum[1]*0x100;sprintf(str,"承包人号:%02U       ",cbr);
             -_Display(0,2,str,16);
 298   3                                glkh=(ulong)GLCardNum[0]+(ulong)GLCardNum[1]*0x100+(ulong)GLCardNum[2]*0x10000;
 299   3                                                              sprintf(str,"管理卡号:%02ld       ",glkh);_Display(0,3,str,16);}
C51 COMPILER V6.23a  MAIN                                                                  01/13/2006 09:40:01 PAGE 6   

 300   2        else {_Display(0,2,"承包人号:未设        ",16);_Display(0,3,"管理卡号:未设        ",16);}
 301   2        if(_GetChar()==KeyB_No){_Clr();return;}
 302   2        for(i=0;i<5;i++) ret=get_voltage();
 303   2                               sprintf(str,"电压=%02.1fV      ",(float)ret/100.00);   
 304   2                               _Display(0,0,str,16);
 305   2                               i=get_temperature(temp);
 306   2                               sprintf(str,"温度=%02d ℃      ",(uint)temp[0]);
 307   2                               _Display(0,1,str,16);
 308   2                               _GetTime(temp);
 309   2                               sprintf(str,"%02x年%02x月%02x日    ",(uint)temp[0],(uint)temp[1],(uint)temp[2]);
 310   2                               _Display(0,2,str,16);
 311   2                               _GetTime(temp);
 312   2                               sprintf(str,"%02x点%02x分%02x秒    ",(uint)temp[3],(uint)temp[4],(uint)temp[5]);
 313   2                               _Display(0,3,str,16);
 314   2               
 315   2        if(_GetChar()==KeyB_No){_Clr();return;}
 316   2       }
 317   1      }
 318          
 319          
 320          
 321          
 322          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   3229    ----
   CONSTANT SIZE    =    887    ----
   XDATA SIZE       =   ----     211
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       8
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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