📄 ecrsys.h
字号:
#define STORE_LOG_POSI (1-1) /* The position of store the journal */
#define LOG_ATV_POSI (2-1) /* The journal is active or not position */
#define REAR_PTR_POSI (3-1) /* The rear of journal pointer position */
#define REAR_PTR2_POSI (4-1) /* The head of journal pointer position */
#define JRNL_ERS_POSI (5-1) /* Has ever erase the journal flag */
#define WASTE_SP_POSI (6-1) /* The waste space flag position */
#define WASTE_ADDR_POSI (7-1) /* The waste address position */
#define LOG_START_POSI 16 /* The log start position */
#define FLS_LCD_LOGO_ADDR 0x280000 //for the Lcd protest logo store.
#define FLS_LCD_LOGO_POSI (8-1)
//#define LCD_LOGO_FILELEN //for the file lenth of the bmp logo
#define LCD_LOGO_SDRAM_ADDR 0xc400000//the address of the SDRAM to store the logo
#define LCD_LOGO_STORE_SDRAM 3
#define LCD_LOGO_STORE_CFCARD 2
#define LCD_LOGO_STORE_FLASH 1
#define LCD_LOGO_SIZE 0x6e50/* 320*85 */ // 0x4B410
/*******************************************************************
The DEPT step define
*******************************************************************/
enum DEPT_STEP{
DEPT_START_STEP = 0,
DEPT_DESC_STEP = 0,
DEPT_HDLO_STEP,
DEPT_PRICE_STEP,
DEPT_VTAX_STEP,
DEPT_GROUP_STEP,
DEPT_MODE_STEP,
DEPT_TYPE_STEP,
DEPT_SALE_STEP, /* Allow sale or not step */
DEPT_AGE_STEP,
DEPT_KP_STEP,
#ifdef AUTO_PER
DEPT_PER_STEP,
#endif // AUTO_PER
DEPT_DEFAULT_STEP,
DEPT_NEXT_ITEM,
MAX_DEPT_STEP,
};
/*******************************************************************
The PLU step define
*******************************************************************/
enum PLU_STEP{
PLU_START_STEP = 0,
#ifdef SCANNER
PLU_SCAN_STEP = 0,
PLU_DESC_STEP,
#else
PLU_DESC_STEP = 0,
#endif // SCANNER
PLU_PRICE_STEP,
PLU_PRICE_STEP2,
PLU_PRICE_STEP3,
PLU_PLINK_STEP,
#ifdef PLU_GROUP_FUNC
PLU_GROUP_STEP,
#endif
#ifdef REST_PLU_FUNC
PLU_KIND_STEP,
PLU_STATE_STEP,
#endif
#ifdef STOCK
PLU_STOCK_STEP,
PLU_SAFT_STOCK,
#endif // STOCK
PLU_DEFAULT_STEP,
PLU_NEXT_ITEM,
MAX_PLU_STEP, /* The maximum PLU step */
PLU_STEP_NO = MAX_PLU_STEP,
};
enum FCE_STEP{
FCE_START_STEP = 0,
FCE_DESC_STEP = 0,
FCE_RATE_STEP,
FCE_ROUND_STEP,
FCE_DOTS_STEP,
FCE_RATE_OP_STEP,
FCE_END_STEP = FCE_RATE_OP_STEP,
MAX_FCE_STEP
};
#if 0
#ifdef REST_PLU_FUNC
#define START_STEP 0 /* The PLUs start step */
#ifdef SCANNER /* Support the scanner function */
#define PLU_SCAN_STEP 0 /* The PLUs bar code step */
#define PLU_PLINK_STEP 1 /* The PLUs linked department step */
#define PLU_ATTR_STEP 2
#define PLU_PRICE_STEP 3 /* The PLUs price step */
#ifdef STOCK /* Support the stock function */
#define PLU_DESC_STEP 4 /* The PLUS description step */
#define PLU_STOCK_STEP 5 /* The PLUS stock step */
#define MAX_PLU_STEP 6 /* The PLUS step number */
#else /* Else STOCK */
#define PLU_DESC_STEP 4 /* The PLUS description step */
#define MAX_PLU_STEP 5 /* The PLUS step number */
#endif /* End STOCK */
#else /* Else SCANNER */
#define PLU_PLINK_STEP 0 /* The PLUs bar code step */
#define PLU_ATTR_STEP 1
#define PLU_PRICE_STEP 2 /* The PLUs price step */
#ifdef STOCK /* Support the stock function */
#define PLU_DESC_STEP 3 /* The PLUS description step */
#define PLU_STOCK_STEP 4 /* The PLUS stock step */
#define MAX_PLU_STEP 5 /* The PLUS step number */
#else /* Else STOCK */
#define PLU_DESC_STEP 3 /* The PLUS description step */
#define MAX_PLU_STEP 4 /* The PLUS step number */
#endif /* End STOCK */
#endif /* End SCANNER */
#define END_STEP MAX_PLU_STEP-1 /* The PLUS max step digit */
#else
#define START_STEP 0 /* The PLUs start step */
#ifdef SCANNER /* Support the scanner function */
#define PLU_SCAN_STEP 0 /* The PLUs bar code step */
#define PLU_PLINK_STEP 1 /* The PLUs linked department step */
#define PLU_PRICE_STEP 2 /* The PLUs price step */
#ifdef STOCK /* Support the stock function */
#define PLU_DESC_STEP 3 /* The PLUS description step */
#define PLU_STOCK_STEP 4 /* The PLUS stock step */
#define MAX_PLU_STEP 5 /* The PLUS step number */
#else /* Else STOCK */
#define PLU_DESC_STEP 3 /* The PLUS description step */
#define MAX_PLU_STEP 4 /* The PLUS step number */
#endif /* End STOCK */
#else /* Else SCANNER */
#define PLU_PLINK_STEP 0 /* The PLUs bar code step */
#define PLU_PRICE_STEP 1 /* The PLUs price step */
#ifdef STOCK /* Support the stock function */
#define PLU_DESC_STEP 2 /* The PLUS description step */
#define PLU_STOCK_STEP 3 /* The PLUS stock step */
#define MAX_PLU_STEP 4 /* The PLUS step number */
#else /* Else STOCK */
#define PLU_DESC_STEP 2 /* The PLUS description step */
#define MAX_PLU_STEP 3 /* The PLUS step number */
#endif /* End STOCK */
#endif /* End SCANNER */
#define END_STEP MAX_PLU_STEP-1 /* The PLUS max step digit */
#endif
#endif
/*******************************************************************
The CLERK step define
*******************************************************************/
enum CLERK_STEP{
CLERK_START_STEP = 0, // 0
CLERK_DESC_STEP = 0, // 0
CLERK_PAWD_STEP, // 1
MAX_CLERK_STEP // 2
};
/*******************************************************************
The Percentage step define
*******************************************************************/
enum PERCENT_STEP{
PERCENT_START_STEP = 0, // 0
PERCENT_DESC_STEP = 0, // 0
PERCENT_ATTR_STEP, // 1
PERCENT_RATE_STEP, // 2
MAX_PERCENT_STEP // 3
};
/*******************************************************************
The REFUND step define
*******************************************************************/
enum REFUND_STEP{
REFUND_START_STEP = 0, // 0
REFUND_DESC_STEP = 0, // 0
REFUND_AMT_STEP, // 1
REFUND_ATTR_STEP, // 2
MAX_REFUND_STEP // 3
};
/*******************************************************************/
/************************************************************************
Transaction buffer status define
************************************************************************/
#define TS_NULL 0 /*NO ID operation */
#define TS_DEPT 1 /* Department normal operation */
#define TS_PLU 2 /* PLU normal operation */
#define TS_VD_DEPT 3 /* Department VOID operation */
#define TS_VD_PLU 4 /* PLU VOID operation */
#define TS_RM_DEPT 5 /* Department RETURN operation */
#define TS_RM_PLU 6 /* PLU RETURN operation */
#define TS_RF_ITEM_DEPT 7 /* Department Refund after item operation */
#define TS_RF_ITEM_PLU 8 /* PLU Refund after item operation */
#define TS_RF_SUBT 9 /* Refund after sub total operation */
#define TS_PER_ITEM_DEPT 10 /* Department Percent after item operation */
#define TS_PER_ITEM_PLU 11 /* PLU Percent after item operation */
#define TS_PER_SUBT 12 /* Percent after sub total operation */
#define TS_EC 13 /* Error correct operation */
//#ifdef AUTO_PER /* Support the department auto percent function */
#define TS_AUTO_PER_DEPT 14 /* Department Auto Percent function */
#define TS_AUTO_PER_PLU 15 /* PLU Auto Percent function */
//#endif /* End AUTO_PER */
#ifdef ELEC_JRNL /* Support the electronic journal function */
#define TS_SALE_JRNL 16 /* Sale journal */
#define TS_DC_JRNL 17 /* Discount journal */
#define TS_RM_JRNL 18 /* Return merchandise journal */
#define TS_ELEC_JRNL_TVAT 19 /* The electronic journal VAT/Tax information */
#define TS_ELEC_JRNL_TVAT2 20 /* The electronic journal VAT informaion, the max VAT no. is 4 */
#endif /* End ELEC_JRNL */
#ifdef REST_PLU_FUNC
#define TS_PLU_DESC 21 /* Descriptive PLU Normal, VOID, RM operation */
#define TS_PLU_GIFT 22 /* Gift PLU operation */
#define TS_RM_PLU_GIFT 23 /* Gift PLU Return Merchandise operation */
#define TS_MENU_HEAD 24 /* The menu operation, the head ID */
#define TS_MENU_REAR 25 /* The menu operation, the rear ID */
#endif
#define TS_COOK_MSG 26 /* Cooking message */
/*************************************************************************
The kitchen printers type
*************************************************************************/
#define KP_NONE 0 /* No kitchen printer */
#define PBM_POS58_80I 1 /* PBM's POS58/80 - I (thermal 58/80 mm) */
#define PBM_POS58_80II 2 /* PBM's POS58/80 - II (dot-matrix 58 mm) */
#define EPSON_TM_88II 3 /* EPSON TM-88II (fast thermal 80mm) */
#define EPSON_TM_U2110 4 /* EPSON TM-U2110 (dot-matrix 80 mm) */
#define CITIZEN_IDP3110 5 /* Citizen iDP3110 (cheaper dot-matrix 58 mm) */
#define BEIYANG_TCP2001 6 /* Bei Yang TCP2001 (thermal 58 mm) */
#define MAX_KP_TYPE 6 /* Max kitchen printer type */
/*************************************************************************
The control character
*************************************************************************/
#define ETX 0x03 /* End of TeXt */
#define ACK 0x06 /* ACKnowledge */
#define CR 0x0D /* Carriage Return */
#define LF 0x0A /* Line Feed */
/** Some useful MACRO **/
/************************************************************************
Data structure define
************************************************************************/
typedef unsigned char byte;
typedef unsigned int word;
typedef unsigned long dword;
typedef unsigned char CHR;
typedef unsigned int WORD;
typedef unsigned long DWORD;
typedef unsigned char BOOL;
typedef struct{ /* 5 serial ports */
byte device; /* The port connect device type */
byte baud_idx; /* The baud rate index, 0: 9600, 1: 19200, ... */
byte parity; /* Parity */
byte data_len; /* Data len */
byte stop_bit; /* Stop bit */
byte handshake; /* The hankshake, DTR/DSR or XON/XOFF */
byte type; /* The type, when the choice is KP, then choice the type POS01, POS02, etc... */
byte reserved2;
}PORTDEF; /* 8 bytes */
typedef struct{
byte size; //按键大小, 高4位为按键纵向扩展倍数; 低4位为横向扩展倍数.
byte posi; //基本位置, 如果size 的高4位为0, 则基本键位置一定在当前按键位置的上方
//如果size 的低4位为0, 则基本键的位置一定在当前按键位置的左方.
byte fill_color;//背景色
byte font_color;//字体色
char desc[MAX_BTN_DESC_LEN+1];//18个字符长度, 最后一个为控制字
} BUTTON_DEF;
enum VIRTUAL_KEY{
VIR_KEY_PLU, // 虚拟的PLU
VIR_KEY_CM, // 虚拟的Cooking Message
VIR_KEY_MAX, // 最大的虚拟的ID数量
};
#define MAX_VIR_KEY 150
typedef struct{
byte id;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -