do_search.c
上传用户:shyuanyi
上传日期:2008-05-24
资源大小:69k
文件大小:4k
- #include "My_head.h"
- #include "key.h"
- /*************************************************/
- void CounterAndfillBuf(BYTE buf[],BYTE lens,LWORD dat,bit fill0_flag)//1-前面补零,0-不补零
- {
- BYTE ii;
- LWORD LL; //mustn't LL=0L;
- for(LL=1,ii=1;ii<lens;ii++)LL *= 10;
- for(ii=0;ii<lens;ii++)
- {
- buf[ii] = ~D_DISPLAY[dat/LL];
- if((buf[ii]==(BYTE)~D_DISPLAY[0]) && !fill0_flag)buf[ii]=~D_DISPLAY[18];
- else fill0_flag=TRUE;
- dat %= LL;
- LL /= 10;
- }
- }
- void Dis_Equip_Code(void)
- {
- BYTE idata buf[8];
- CounterAndfillBuf(&buf[0],2,equip_addr.ntype,TRUE);
- buf[2]= ~D_DISPLAY[16];
- CounterAndfillBuf(&buf[3],5,equip_addr.number_addr,TRUE);
- Display_str(buf);
- }
-
- /*
- void Dis_Con_Records(void)
- {
- BYTE idata buf[8];
- CounterAndfillBuf(&buf[0],8,con_statusinfo.con_records,FALSE);
- if(con_statusinfo.con_records==0)buf[7]=~D_DISPLAY[0];
- Display_str(buf);
- }
- void Dis_Con_Allmoney(void)
- {
- BYTE idata buf[8];
- CounterAndfillBuf(&buf[0],8,con_statusinfo.con_allmoney,FALSE);
- if(con_statusinfo.con_allmoney<1000)
- {
- CounterAndfillBuf(&buf[5],3,con_statusinfo.con_allmoney,TRUE);
- }
- buf[5] |= 0X80;
- Display_str(buf);
- }
- void Dis_Con_DayRecords(void)
- {
- BYTE idata buf[8];
- CounterAndfillBuf(&buf[0],8,con_statusinfo.con_dayrecords,FALSE);
- if(con_statusinfo.con_dayrecords==0)buf[7]=~D_DISPLAY[0];
- Display_str(buf);
- }
- void Dis_Con_Daymoney(void)
- {
- BYTE idata buf[8];
- CounterAndfillBuf(&buf[0],8,con_statusinfo.con_daymoney,FALSE);
- if(con_statusinfo.con_daymoney<1000)
- {
- CounterAndfillBuf(&buf[5],3,con_statusinfo.con_daymoney,TRUE);
- }
- buf[5] |= 0X80;
- Display_str(buf);
- }
- void Dis_Con_BootRecords(void)
- {
- BYTE idata buf[8];
- CounterAndfillBuf(&buf[0],8,con_statusinfo.con_bootrecords,FALSE);
- if(con_statusinfo.con_bootrecords<1)buf[7]=~D_DISPLAY[0];
- Display_str(buf);
- }
- void Dis_Con_Bootmoney(void)
- {
- BYTE idata buf[8];
- CounterAndfillBuf(&buf[0],8,con_statusinfo.con_bootmoney,FALSE);
- if(con_statusinfo.con_bootmoney<1000)
- {
- CounterAndfillBuf(&buf[5],3,con_statusinfo.con_bootmoney,TRUE);
- }
- buf[5] |= 0X80;
- Display_str(buf);
- }
- void Dis_Equip_CurStatus(void)
- {
- Dis_Err(Equip_CurStatus);
- }
- */
- /*
- void Dis_Test_Data(void)
- {
- BYTE idata buf[8];
- CounterAndfillBuf(&buf[0],8,12345678,TRUE);//sizeof(Con_Record));
- Display_str(buf);
- }
- */
- /*
- #define MAX_TAB_S 9
- void (code *code SeachFunc_Tab[MAX_TAB_S])(void)=
- {
- DisplayDate, //0
- Dis_Equip_Code, //1
- Dis_Con_Records, //2
- Dis_Con_Allmoney, //3
- Dis_Con_BootRecords, //4
- Dis_Con_Bootmoney, //5
- Dis_Con_DayRecords, //6
- Dis_Con_Daymoney, //7
- Dis_Equip_CurStatus, //8
- //Dis_Test_Data, //
- };
- char idata dis_tab_s=0;
- BYTE Do_SearchKey_Even_10(BYTE Key)
- {
- //SendStr(&Key,1);//for test!
- //Do_Led(0x1<<(Key%8));//for test.
- switch(Key)
- {
- case KEY_F1 :dis_tab_s=0; //日期
- break;
- case KEY_F2 :dis_tab_s=1; //设备
- break;
- case KEY_F3 :dis_tab_s=2; //消费
- break;
- case KEY_F4 :dis_tab_s=3;
- break;
- case KEY_F5 :dis_tab_s=8;
- break;
- case KEY_UP: if(--dis_tab_s<0)dis_tab_s=MAX_TAB_S-1;
- break;
- case KEY_DOWN:if(++dis_tab_s>MAX_TAB_S-1)dis_tab_s=0;
- break;
- case KEY_CANCEL:Renew_To_AllInit();
- return(0);
- default:return(Key);
- }
- //Stop_Timer(DIS_CLOCKEVENT_Tevent);//must!
- (SeachFunc_Tab[dis_tab_s])();
- Stop_Timer(WAIT_PRESSKEY_Tevent);
- Set_TimerEvent(WAIT_PRESSKEY_Tevent,WAIT_PRESSKEY_TIME);
- //Stop_Timer(DISPLAY_DELAYEVENT_Tevent);//msut!!
- //Set_TimerEvent(DISPLAY_DELAYEVENT_Tevent,DISPLAY_DELAYEVENT_TIME);
- //Do_DisLed_Flash(0x00,0x00,200);
- //Set_TimerEvent(WAIT_CARD_Tevent,WAIT_CARDCONSUME_TIME);//(1)
- //SetCurState(IDEL_STATUS);//ActiveState(INIT_STATUS);
- //SendStr("d:",2);SendStr(&i,1);
- SetCurState(QUERY_STATUS);
- return(0);
- }
- */