/***********************************************************/
/* */
/* PROGRAM : (仓库盘点软件) */
/* SYSTEM : DT-930 VER1.00 */
/* FILENAME : APSMP.C */
/* VERSION : 2.00 */
/* AUTHOR : */
/* DATE OF GET : 2000/07/10 */
/* DATE OF UPDATE : */
/* FUNCTION : */
/* HISTORY : */
/* */
/***********************************************************/
#include "stdio.h "
#include "string.h "
#include "stdlib.h "
#include "itron.h "
#include "casio.h "
#include "cmndef.h "
#include "bios1mac.h"
#include "math.h"
void main_menu(void);
void pd_start(void);
static long zs;
/************************************/
/* TASK MAIN PART */
/************************************/
void ap_start ( void )
{
zs=0;
SysInit(0);
main_menu();
}
void main_menu(void)
{
int kind;
static const UB *menu[]={
" 盘 点 系 统",
" ------------------ ",
" 1. 开始盘点",
" 2. 数据传输",
" 3. 删除文件",
};
while(1)
{
cls();
Dsp_str(menu[0],1,0);
Dsp_str(menu[1],3,0);
Dsp_str(menu[2],5,0);
Dsp_str(menu[3],7,0);
Dsp_str(menu[4],9,0);
kind=getkey();
switch(kind)
{ case '1':{
pd_start();
break;
}
case '2':{
sendfile("pd4.txt");
break;
}
case '3':{
cls();
Dsp_str("您确实要删除文件码?",2,0);
Dsp_str(" 7-删除 其它-不删除 ",5,0);
kind=getkey();
if(kind=='7')
{
Dsp_str("再次确认是否删除文件",5,0);
Dsp_str(" 3-删除 其它-不删除 ",8,0);
kind=getkey();
if(kind=='3') del_file("pd4.txt");
}
break;
}
}
}/*end while*/
}/*main_menu*/
void pd_start(void)
{
ER kind,fs,ret,ercd;
UB buff[19],barcode[19],bh[7],sl[9],temp[21],temp1[21];
UB zsp[11],fsp[11];
int i,j,k,flag;
W ffff,fjlh,fjfj,eeee,nnnn;
if(Is_file("pd4.txt")==1)
{
zs=0;
creat_file("pd4.txt");
}
while(1)
{
cls();
Dsp_str("请您输入:",1,0);
retu1: Dsp_str(" 编号:[04 ]",3,0);
Dsp_str(" 数量:[ ]",5,0);
memset(bh,0x00,sizeof(bh));
memset(sl,0x00,sizeof(sl));
lcd_csr_put(3,12);
lcd_csr_set((H)LCD_CSR_UNDER);
key_clear();
ret=read_str(3,12,2,bh,6);
if(ret==E_KEY_CLR) return;
space_str(bh,6);
bh[6]=0x00;
lcd_csr_put(5,10);
lcd_csr_set((H)LCD_CSR_UNDER);
key_clear();
ret=read_str(5,10,2,sl,8);
if(ret==E_KEY_CLR) return;
if(strlen(sl)==0) goto retu1;
space_str(sl,8);
sl[8]=0x00;
Dsp_str("确认输入正确吗?",7,0);
Dsp_str(" 0-错误 ENT-正确?",9,0);
kind=getkey();
if(kind!=ENT)
{
cls();
Dsp_str("请重新输入:",1,0);
goto retu1;
}
memset(temp,0x00,sizeof(temp));
strcat(temp,"@");
strcat(temp,"0");
strcat(temp,"4");
strcat(temp,bh);
strcat(temp,"#");
strcat(temp,sl);
strcat(temp,"xdxa");
temp[20]=0x00;
dat_F_Write("pd4.txt",1,0,temp,20);
fs=0;
while(1)
{
if (fs!=0 && fmod(fs,10)==0)
{
cls();
Dsp_str(" 整箱扫描完毕 ",1,0);
Dsp_str("如出错请重扫描前一箱",3,0);
Dsp_str("应扫数量:",5,0);
Dsp_str("本批数量:",7,0);
Dsp_str("总 数 量:",9,0);
sprintf(zsp,"%-10d",zs);
sprintf(fsp,"%-10d",fs);
Dsp_str(sl,5,10);
Dsp_str(fsp,7,10);
Dsp_str(zsp,9,10);
WAIT
}
if((atoi(sl)-fs)<=0)
{
cls();
Dsp_str("****本批扫描完毕****",2,0);
Dsp_str("应扫数量:",5,0);
Dsp_str("本批数量:",7,0);
Dsp_str("总 数 量:",9,0);
sprintf(zsp,"%-10d",zs);
sprintf(fsp,"%-10d",fs);
Dsp_str(sl,5,10);
Dsp_str(fsp,7,10);
Dsp_str(zsp,9,10);
WAIT
break;
}
memset(buff,0x00,sizeof(buff));
memset(barcode,0x00,sizeof(barcode));
cls();
Dsp_str("请扫描条码",1,0);
Dsp_str("[ ]",3,0);
Dsp_str("应扫数量:",5,0);
Dsp_str("本批数量:",7,0);
Dsp_str("总 数 量:",9,0);
sprintf(zsp,"%-10d",zs);
sprintf(fsp,"%-10d",fs);
Dsp_str(sl,5,10);
Dsp_str(fsp,7,10);
Dsp_str(zsp,9,10);
lcd_csr_put(3,1);
lcd_csr_set((H)LCD_CSR_UNDER);
memset(buff,0x00,sizeof(buff));
/****** 读入条码 **************/
key_clear();
ret=read_str(3,1,0,buff,18);
lcd_csr_set((H)LCD_CSR_OFF);
if(ret==E_KEY_CLR) return; /*按CLS 返回*/
Dsp_str(buff,3,1);
space_str(buff,18);
buff[18]=0x00;
memset(barcode,0x00,sizeof(barcode));
memcpy(barcode,buff,18);
if(strcmp(buff," ")==0) continue;
memset(temp1,0x00,sizeof(temp1));
ercd=search("pd4.txt",0,20,0,18,barcode,temp1,&fjlh);
if(ercd!=E_OK)
{
memset(temp,0x00,sizeof(temp));
strcat(temp,barcode);
strcat(temp,"xdxa");
temp[20]=0x00;
dat_F_Write("pd4.txt",1,0,temp,20);
zs=zs+1;
fs=fs+1;
}
}/*end while2*/
}/*end while1*/
}/* end pd_start*/
=============================
关键字:casio dt930 程序开发 编译环境 开发资料 开发工具 编译器