casio dt-930 条码采集器 盘点软件源程序
/***********************************************************/
/*?*/
/*?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,"\xd\xa");
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,"\xd\xa");
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 程序開發 編譯環境 開發資料 開發工具 編譯器
轉載于:https://www.cnblogs.com/walpff/archive/2008/11/07/1329028.html
總結
以上是生活随笔為你收集整理的casio dt-930 条码采集器 盘点软件源程序的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 137701468
- 下一篇: 轻松实现SQL Server异地备份