📄 protest.c
字号:
waiter[j].TipInCount = 0;
waiter[j].TipInAmount = 0;
waiter[j].TipOutCount = 0;
waiter[j].TipOutAmount = 0;
}
// memcpy(waiter[j].desc, Str_Waiter_Desc, MAX_DESC_LEN);
desc_len = desc_cpy(waiter[j].desc, Str_Waiter_Desc,2);
waiter[j].desc[desc_len] = ((j+1)/10)+'0';
waiter[j].desc[desc_len+1] = ((j+1)%10)+'0';
}
#endif /* End VER_RSNT */
// #ifdef ELEC_JRNL /* Support the electronic journal function */
// /*----------------------------------------*/
// sale_jrnl_first = sale_jrnl_last = 0;
// sale_jrnl_len = 0;
//
// /*----------------------------------------*/
// dc_jrnl_first = dc_jrnl_last = 0;
// dc_jrnl_len = 0;
//
// /*----------------------------------------*/
// rm_jrnl_first = rm_jrnl_last = 0;
// rm_jrnl_len = 0;
// #endif /* End ELEC_JRNL */
}
/* Copy the description to the dst.
For the descriptive length must be 12, so must fill with SP.
res_len: The reserve length, for the main routine used.
Return the src's length.
*/
byte desc_cpy(char *dst, const char *src, byte res_len)
{
word tmp;
byte desc_len;
tmp = strlen(src);
if(tmp > MAX_DESC_LEN)
tmp = MAX_DESC_LEN;
desc_len = (byte)tmp;
if(desc_len >= MAX_DESC_LEN - res_len)
desc_len = MAX_DESC_LEN - res_len;
memcpy(dst, src, desc_len);
memset(dst+desc_len, ' ', MAX_DESC_LEN-desc_len); /* Fill the free cell with SP */
return (desc_len);
}
/* Evaluate the original programmable string */
void eva_ori_str(char *dst, byte Idx)
{
byte len;
len = Get_Max_Len(Idx);
if(Idx == 0)
{
Prn_InitDesc(dst, len, Str_VOID, NM_FONT_PRN, NM_FONT_PRN);
// dst[len*2] = 0;
}
else if(Idx == 1)
{
Prn_InitDesc(dst, len, Str_RM, NM_FONT_PRN, NM_FONT_PRN);
// dst[len*2] = 0;
}
else if(Idx == 2)
{
Prn_InitDesc(dst, len, Str_Item, NM_FONT_PRN, NM_FONT_PRN);
// dst[len*2] = 0;
}
else if(Idx == 3)
{
Prn_InitDesc(dst, len, Str_SubTtl, NM_FONT_PRN, NM_FONT_PRN);
// dst[len*2] = 0;
}
else if(Idx == 4)
{
Prn_InitDesc(dst, len, Str_Auto_Per, NM_FONT_PRN, NM_FONT_PRN);
// dst[len*2] = 0;
}
else if(Idx == 5)
{
Prn_InitDesc(dst, len, Str_EC, NM_FONT_PRN, NM_FONT_PRN);
// dst[len*2] = 0;
}
else if(Idx == 6)
{
Prn_InitDesc(dst, len, Str_Subttl, NM_FONT_PRN, DB_WIDTH_PRN);
// dst[len*2] = 0;
}
else if(Idx == 7)
{
Prn_InitDesc(dst, len, Str_Misc, NM_FONT_PRN, DB_WIDTH_PRN);
// dst[len*2] = 0;
}
else if(Idx == 8)
{
Prn_InitDesc(dst, len, Str_Cash, NM_FONT_PRN, DB_WIDTH_PRN);
// dst[len*2] = 0;
}
else if(Idx == 9)
{
Prn_InitDesc(dst, len, Str_TotQty, NM_FONT_PRN, NM_FONT_PRN);
// dst[len*2] = 0;
}
else if(Idx == 10)
{
Prn_InitDesc(dst, len, Str_Change, NM_FONT_PRN, DB_WIDTH_PRN);
// dst[len*2] = 0;
}
else if(Idx == 11)
{
Prn_InitDesc(dst, len, Str_RA, NM_FONT_PRN, NM_FONT_PRN);
// dst[len*2] = 0;
}
else if(Idx == 12)
{
Prn_InitDesc(dst, len, Str_PO, NM_FONT_PRN, NM_FONT_PRN);
// dst[len*2] = 0;
}
else if(Idx == 13)
{
Prn_InitDesc(dst, len, Str_LstSpndAmt, NM_FONT_PRN, NM_FONT_PRN);
// dst[len*2] = 0;
}
else if(Idx == 14)
{
Prn_InitDesc(dst, len, Str_SpndAmt, NM_FONT_PRN, NM_FONT_PRN);
// dst[len*2] = 0;
}
else if(Idx == 15)
{
Prn_InitDesc(dst, len, Str_Trng_Head, DB_WIDTH_PRN, DB_WIDTH_PRN);
// dst[len*2] = 0;
}
else if(Idx == 16)
{
Prn_InitDesc(dst, len, Str_NS, NM_FONT_PRN, NM_FONT_PRN);
// dst[len*2] = 0;
}
else if(Idx == 17)
{
Prn_InitDesc(dst, len, Str_TSVD, NM_FONT_PRN, NM_FONT_PRN);
// dst[len*2] = 0;
}
else if(Idx == 18)
{
Prn_InitDesc(dst, len, Str_Tnsfer, NM_FONT_PRN, NM_FONT_PRN);
// dst[len*2] = 0;
}
dst[len*2] = 0;
}
/* Print the programmable string original string */
void prn_ori_str(byte Idx, byte len)
{
byte tmp[MAX_PRN_LEN*2+1];
eva_ori_str(tmp, Idx);
Prn_InsFmtStr(tmp, 1, len, NULL);
}
/* Initial the all programmable string */
void init_ori_str(void)
{
eva_ori_str(Var_Str_VOID, 0);
eva_ori_str(Var_Str_RM, 1);
eva_ori_str(Var_Str_Item, 2);
eva_ori_str(Var_Str_SubTtl, 3);
eva_ori_str(Var_Str_Auto_Per, 4);
eva_ori_str(Var_Str_EC, 5);
eva_ori_str(Var_Str_Subttl, 6);
eva_ori_str(Var_Str_Misc, 7);
eva_ori_str(Var_Str_Cash, 8);
eva_ori_str(Var_Str_TotQty, 9);
eva_ori_str(Var_Str_Change, 10);
eva_ori_str(Var_Str_RA, 11);
eva_ori_str(Var_Str_PO, 12);
eva_ori_str(Var_Str_LstSpndAmt, 13);
eva_ori_str(Var_Str_SpndAmt, 14);
eva_ori_str(Var_Str_Trng_Head, 15);
eva_ori_str(Var_Str_NS, 16);
eva_ori_str(Var_Str_TSVD, 17);
eva_ori_str(Var_Str_Tnsfer, 18);
}
/* Set the default print format */
void SetDftPrn(void)
{
#if SW_VER == SW_NE2
SetAsterPrn();
SetSplitPrn();
#else
#if COUNTRY == KOREA
SetSplitPrn();
#else
ClrSplitPrn();
#endif
ClrAsterPrn();
#endif
}
/* Set the serial port to the default */
void Rst_Ser_Port(void)
{
byte i;
for (i = 0; i < PORT_MAX; i++)
ser_port[i].handshake = SW_SHAKE;
Uart_Port_SettoDft(); /*设置串口的所有参数为默认值*/
#if 0
ser_port[PORT0].device = DEV_TYPE_RP;
Uart_Port_SettoDft(PORT0);
ser_port[PORT1].device = DEV_TYPE_PC;
Uart_Port_SettoDft(PORT1);
ser_port[PORT2].device = DEV_TYPE_SC;
Uart_Port_SettoDft(PORT2);
ser_port[PORT3].device = DEV_TYPE_PC;
Uart_Port_SettoDft(PORT3);
ser_port[PORT4].device = DEV_TYPE_PC;
Uart_Port_SettoDft(PORT4);
COMM_PORT = PORT1; /*Only for TSR2000*/
#endif
DEBUG_PRN(
port_use_print = PRN_PORT;
handshake_method = SW_SHAKE;
port_sel1 = DEV_TYPE_RP; /* 连接票据打印机,这样在任何时候都能够打印出来。 */
port_sel2 = DEV_TYPE_TS;
)
#if 0
/*
last_port_sel1 = PORT_NULL;
last_port_sel2 = PORT_NULL;
Uart_SetBaudRate(PORT0, BRG_576);
Uart_SetBaudRate(PORT1, BRG_96);
port0_parity = port1_parity = UART_SET_PARITY_NO;
port0_datalen = port1_datalen = UART_SET_DATA_8;
port0_stopbit = port1_stopbit = UART_SET_STOP_1;
Uart_PortSet(PORT0, port0_parity, port0_datalen, port0_stopbit);
Uart_PortSet(PORT1, port1_parity, port1_datalen, port1_stopbit);
out_print_kind = PRN_NONE;
port_use_print = PORT0;
do_port_mean_convert(); // 转换两种串口变量的含义
out_print_type = KP_TM_88_III;
handshake_method = SW_SHAKE;
*/
#endif
KP_LineFeedCnt = 5;
cut_paper_flag = 1; /* The default is cut the paper */
kp_font = NM_FONT_PRN;
}
/* Initialize the touch screen key */
void Rst_Ts_Key(void)
{
Ts_Key.key = KD_NULL;
Ts_Key.curr_logi = KD_NULL_LOGI;
Ts_Key.last_logi = KD_NULL_LOGI;
}
void Rst_Text_Lcd(void) //analy
{
Text_Lcd.FirstLine = 0;
Text_Lcd.CurrLine = 0;
Text_Lcd.StartLine = 0;
Text_Lcd.EndLine = 0;
}
// Initialize the LCD text
void Rst_Lcd_Text(void)
{
Lcd_Text.max_line = 0;
Lcd_Text.cur_line = 0;
Lcd_Text.dsp_line_st = 0;
Lcd_Text.dsp_line_end = 0;
Lcd_Text.dsp_line_new = 0;
Rst_Text_Lcd();
}
// Initialize the pop text
void Rst_Pop_Text(void)
{
Pop_Text.max_line = 0;
Pop_Text.cur_line = 0;
Pop_Text.dsp_line_st = 0;
Pop_Text.dsp_line_end = 0;
Pop_Text.dsp_line_new = 0;
}
void Rst_Tl_Titl(void)
{
Tl_Title.align = DFT_ALIGN_TL_STAT;
Tl_Title.posi_max = 0;
Tl_Title.text_color = STAT_TEXT_COLOR;
memset(Tl_Title.posi, 0, MAX_LINE_POSI);
memset(Tl_Title.len, 0, MAX_LINE_POSI);
memset(Tl_Title.text, ' ', MAX_TEXT);
}
// Initialize the system status
void Rst_Tl_Stat(void)
{
Tl_Stat.align = DFT_ALIGN_TL_STAT;
Tl_Stat.posi_max = 0;
Tl_Stat.text_color = STAT_TEXT_COLOR;
memset(Tl_Stat.posi, 0, MAX_LINE_POSI);
memset(Tl_Stat.len, 0, MAX_LINE_POSI);
memset(Tl_Stat.text, ' ', MAX_TEXT);
}
// Initialize the input display data
void Rst_Tl_Input(void)
{
Tl_Input.align = DFT_ALIGN_TL_INPUT;
Tl_Input.posi_max = 0;
Tl_Input.text_color = INPUT_TEXT_COLOR;
memset(Tl_Input.posi, 0, MAX_LINE_POSI);
memset(Tl_Input.len, 0, MAX_LINE_POSI);
memset(Tl_Input.text, ' ', MAX_TEXT);
}
// Initialize the subtotal data
void Rst_Tl_Sub(void)
{
Tl_Sub.align = DFT_ALIGN_TL_SUB;
Tl_Sub.posi_max = 0;
Tl_Sub.text_color = SUB_TEXT_COLOR;
memset(Tl_Sub.posi, 0, MAX_LINE_POSI);
memset(Tl_Sub.len, 0, MAX_LINE_POSI);
memset(Tl_Sub.text, ' ', MAX_TEXT);
}
/*
Initialize the touch screen and LCD variables
*/
void Rst_Ts_Lcd(void)
{
word i;
#if 0
// Initialize the touch screen keyboard.
Rst_Ts_Key();
#endif
// Initialize the LCD text
Rst_Lcd_Text(); //MODE text
// Initialize the Pop text
Rst_Pop_Text();
Rst_Tl_Titl();
// Initialize the system status
Rst_Tl_Stat();
// Initialize the input display data
Rst_Tl_Input();
// Initialize the subtotal data
Rst_Tl_Sub();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -