T168_Debug222\appl\Display文件:Display.c

/******************************************************************************
 *                                                                            *
 *                         M O D U L E   D E F I N E                          *
 *                                                                            *
 ******************************************************************************/

#define DISPLAY_C

/******************************************************************************
 *                                                                            *
 *        C O M P I L E R   D E F I N E D   I N C L U D E   F I L E S         *
 *                                                                            *
 ******************************************************************************/

#include <string.h>

/******************************************************************************
 *                                                                            *
 *            U S E R   D E F I N E D   I N C L U D E   F I L E S             *
 *                                                                            *
 ******************************************************************************/

#include "Common.h"
#include "XCore.h"
#include "XLCD.h"
#include "XText.h"
#include "XVarBank.h"
#include "LCDData\LCDFont.c"
#include "Display.h"

/******************************************************************************
 *                                                                            *
 *                         L O C A L   D E F I N E S                          *
 *                                                                            *
 ******************************************************************************/

#define LCD_ENG_DECODE            'E'
#define LCD_TC_DECODE            'T'
#define LCD_SC_DECODE            'S'
#define LCD_JP_DECODE            'J'
#define LCD_JP_HALF_DECODE        'j'
#define LCD_KOREAN_DECODE        'K'
#define LCD_RUSSIAN_DECODE        'R'
#define LCD_WU_DECODE            'W'                // western europe
#define LCD_CU_DECODE            'C'                // center europe
#define LCD_BL_DECODE            'B'                // baltic

#define LCD_FONT_HEAD_LEN        sizeof(_LCDFontHead)

/******************************************************************************
 *                                                                            *
 *                        L O C A L   T Y P E D E F S                         *
 *                                                                            *
 ******************************************************************************/

/*----------------------------------------------------------------------------------
Lcd font head
locate 0:         L->Bitmap font
locate 1:         0->Fixed pitch 1->Variable Pitch
locate 2:         0->Singed Byte Decode 1->Double Byte Decode
locate 3:         decode by table
locate 4:         Reverse
locate 5:        font type 
locate 6-7:        font character total
locate 8-9:     font Height
locate 10-11:     font Width
locate 12-13:    font decode start
locate 14-15:    font decode end
locate 16-31:    Reverse
----------------------------------------------------------------------------------*/
typedef struct
{
    CHAR        FontID;
    BYTE        FontPitch;
    BYTE        CharSize;
    BYTE        DecodeTable;
    BYTE        Dummy1;
    BYTE        FontType;
    WORD        TotalChar;
    WORD        FontHeight;
    WORD        FontWidth;
    WORD        FontStart;
    WORD        FontEnd;
    CHAR        Dummy2[16];
}_LCDFontHead;

typedef struct
{
    BYTE         *FontAddr;
    BYTE        FontPitch;
    BYTE        CharSize;
    BYTE        DecodeTable;
    BYTE        FontType;
    WORD        TotalChar;
    WORD        FontHeight;
    WORD        FontWidth;
    WORD        FontStart;
    WORD        FontEnd;
}_LCDFontInfo;

/******************************************************************************
 *                                                                            *
 *             L O C A L   F U N C T I O N   P R O T O T Y P E S              *
 *                                                                            *
 ******************************************************************************/

/* None */

/******************************************************************************
 *                                                                            *
 *    L O C A L   I N I T I A L I Z E D   D A T A   D E F I N I T I O N S     *
 *                                                                            *
 ******************************************************************************/

#if defined(LCD_MODEL)

#if defined(MENU_TSPL_1)
STATIC _LCDFontInfo LCDFontInfo[] =
{
    {(BYTE *)LCDEngFont, 0,0,0,0,0,0,0,0,0},
    {(BYTE *)LCDTCFont,  0,0,0,0,0,0,0,0,0},
    {(BYTE *)LCDJPFont,  0,0,0,0,0,0,0,0,0},
    {(BYTE *)LCDSCFont,  0,0,0,0,0,0,0,0,0},
    {(BYTE *)_NULL},
};

#elif defined(MENU_TSPL_2)
STATIC _LCDFontInfo LCDFontInfo[] =
{
    {(BYTE *)LCDEngFont,    0,0,0,0,0,0,0,0,0},
    {(BYTE *)LCDTCFont,     0,0,0,0,0,0,0,0,0},
    {(BYTE *)LCDJPFont,     0,0,0,0,0,0,0,0,0},
    {(BYTE *)LCDSCFont,     0,0,0,0,0,0,0,0,0},
    {(BYTE *)LCDJPHalfFont, 0,0,0,0,0,0,0,0,0},
    {(BYTE *)_NULL},
};

#elif defined(MENU_TSPL_3)
STATIC _LCDFontInfo LCDFontInfo[] =
{
    {(BYTE *)LCDEngFont,       0,0,0,0,0,0,0,0,0},
    {(BYTE *)LCDTCFont,        0,0,0,0,0,0,0,0,0},
    {(BYTE *)LCDSCFont,        0,0,0,0,0,0,0,0,0},    /* NSimSun */
    {(BYTE *)LCDJPFont,        0,0,0,0,0,0,0,0,0},    /* MS Mincho */
    {(BYTE *)LCDJPHalfFont,    0,0,0,0,0,0,0,0,0},    /* MS Mincho */
    {(BYTE *)LCDKoreanFont,    0,0,0,0,0,0,0,0,0},    /* BatangChe */
    {(BYTE *)LCDRussianFont,   0,0,0,0,0,0,0,0,0},
    {(BYTE *)LCDWesEuropeFont, 0,0,0,0,0,0,0,0,0},
    {(BYTE *)LCDCenEuropeFont, 0,0,0,0,0,0,0,0,0},
    {(BYTE *)LCDBalticFont,    0,0,0,0,0,0,0,0,0},    
    {(BYTE *)_NULL},
};

#elif defined(MENU_TSPL_4)
STATIC _LCDFontInfo LCDFontInfo[] =
{
    {(BYTE *)LCDEngFont,       0,0,0,0,0,0,0,0,0},
    {(BYTE *)_NULL},
};

#endif

/******************************************************************************
 *                                                                            *
 *    L O C A L   U N I T I A L I Z E D   D A T A   D E F I N I T I O N S     *
 *                                                                            *
 ******************************************************************************/

STATIC BYTE *DspLang;


STATIC VOID DspInstallFont(VOID)
{
    _LCDFontHead LcdHead;
    INT Lang;

    Lang = 0;
    while (LCDFontInfo[Lang].FontAddr)
    {
        memcpy((CHAR *)&LcdHead, (CHAR *)LCDFontInfo[Lang].FontAddr, LCD_FONT_HEAD_LEN);

        LCDFontInfo[Lang].FontPitch   = LcdHead.FontPitch;
        LCDFontInfo[Lang].CharSize    = LcdHead.CharSize;
        LCDFontInfo[Lang].DecodeTable = LcdHead.DecodeTable;
        LCDFontInfo[Lang].FontType    = LcdHead.FontType;
        LCDFontInfo[Lang].TotalChar   = le16_to_cpu(LcdHead.TotalChar);
        LCDFontInfo[Lang].FontHeight  = le16_to_cpu(LcdHead.FontHeight);
        LCDFontInfo[Lang].FontWidth   = le16_to_cpu(LcdHead.FontWidth);
        LCDFontInfo[Lang].FontStart   = le16_to_cpu(LcdHead.FontStart);
        LCDFontInfo[Lang].FontEnd     = le16_to_cpu(LcdHead.FontEnd);
        Lang += 1;
    }
}

VOID DspInitialize(VOID)
{
    _PrintCfg *pDspCfg = GrabPrintConfig();
    INT *FacDC = (INT *)GetFactorySetting(FACTORY_DISPLAY_CONTRAST);
    INT Contrast = FacDC ? *FacDC : 13;        /*  Default value: 13 */

    LcdInitialize();
    DspInstallFont();

    LcdSetContrast(Contrast);

    DspLang = &pDspCfg->Language;
}

/******************************************************************************
 *
 * Function:
 *    DspClearDisplay
 *
 * Description: 
 *        This global function clears the display screen and memory.
 *
 * Input:
 *      None
 *
 * Output:
 *      None
 *
 ******************************************************************************/
VOID DspClearDisplay(VOID)
{
    LcdClrScreen();
}

/******************************************************************************
 *
 * Function:
 *    FindFont
 *
 * Description: 
 *        
 *
 * Input:
 *      
 *
 * Output:
 *      None
 *
 ******************************************************************************/
STATIC INT DspFindFont(BYTE decode)
{
    INT font = 0;

    while (LCDFontInfo[font].FontAddr)
    {
        if (LCDFontInfo[font].FontType == decode)
            break;
        font += 1;
    }
    return font;
}

STATIC INT DspDecode(BYTE *str)
{
    INT font = DspFindFont(LCD_ENG_DECODE);

#if defined(MENU_TSPL_1)
    switch (*DspLang)
    {
        case LCD_LANG_TC:
            if (*str >= 0x80)
                font = DspFindFont(LCD_TC_DECODE);
            break;
        case LCD_LANG_SC:
            if (*str >= 0x80)
                font = DspFindFont(LCD_SC_DECODE);
            break;
        case LCD_LANG_JP:
            if (*str >= 0x80)
                font = DspFindFont(LCD_JP_DECODE);
            break;
        case LCD_LANG_ITA:
        case LCD_LANG_ENG:
        default:
            break;
    }

#elif defined(MENU_TSPL_2)
    switch (*DspLang)
    {
        case LCD_LANG_TC:
            if (*str >= 0x80)
                font = DspFindFont(LCD_TC_DECODE);
            break;
        case LCD_LANG_SC:
            if (*str >= 0x80)
                font = DspFindFont(LCD_SC_DECODE);
            break;
        case LCD_LANG_JP:
            if (*str >= 0xA0 && *str <= 0xDF)
                font = DspFindFont(LCD_JP_HALF_DECODE);
            else if (*str >= 0x80)
                font = DspFindFont(LCD_JP_DECODE);
            break;
        case LCD_LANG_POLISH:
        case LCD_LANG_ENG:
        default:
            break;
    }

#elif defined(MENU_TSPL_3)
    switch (*DspLang)
    {
        case LCD_LANG_TC:
            if (*str >= 0x80)
                font = DspFindFont(LCD_TC_DECODE);
            break;
        case LCD_LANG_SC:
            if (*str >= 0x80)
                font = DspFindFont(LCD_SC_DECODE);
            break;
        case LCD_LANG_JP:
            if (*str >= 0xA0 && *str <= 0xDF)
                font = DspFindFont(LCD_JP_HALF_DECODE);
            else if (*str >= 0x80)
                font = DspFindFont(LCD_JP_DECODE);
            break;
        case LCD_LANG_KOREAN:
            if (*str >= 0x80)
                font = DspFindFont(LCD_KOREAN_DECODE);
            break;
        case LCD_LANG_ITA:
        case LCD_LANG_FRECH:
        case LCD_LANG_GERMAN:
        case LCD_LANG_SPANISH:
            if (*str >= 0x80)
                font = DspFindFont(LCD_WU_DECODE);
            break;
        case LCD_LANG_RUSSAIN:
            if (*str >= 0x80)
                font = DspFindFont(LCD_RUSSIAN_DECODE);
            break;
        case LCD_LANG_POLISH:
        case LCD_LANG_CZECH:
            if (*str >= 0x80)
                font = DspFindFont(LCD_CU_DECODE);
            break;
        case LCD_LANG_LITHUANIAN:
            if (*str >= 0x80)
                font = DspFindFont(LCD_BL_DECODE);
            break;
        case LCD_LANG_ENG:
        default:
            break;
    }

#elif defined(MENU_TSPL_4)
    switch (*DspLang)
    {
        case LCD_LANG_ENG:
        default:
            break;
    }

#endif

    return font;
}

STATIC INT DspFontOffset(USHORT charkey, UCHAR font)
{
    LONG Offset;
    BYTE *Addr;
    INT i;

    if (LCDFontInfo[font].DecodeTable)
    {
        Addr = LCDFontInfo[font].FontAddr + LCD_FONT_HEAD_LEN;
        for (i = 0; i < LCDFontInfo[font].TotalChar; i++)
        {
            if (*Addr == charkey / 256 && *(Addr + 1) == charkey % 256)
            {
                memcpy(&Offset, Addr + 2, 4);
                Offset = le32_to_cpu(Offset);
                return Offset;
            }
            Addr += 6;
        }
        Offset = 6 * LCDFontInfo[font].TotalChar + LCD_FONT_HEAD_LEN;
        return Offset; 
    }
    else if (charkey >= LCDFontInfo[font].FontStart && charkey <= LCDFontInfo[font].FontEnd)
    {
#if defined(TDP225_PCB) 
        Offset = (LCDFontInfo[font].FontWidth + 7) / 8 * LCDFontInfo[font].FontHeight;
#else
        Offset = (LCDFontInfo[font].FontHeight + 7) / 8 * LCDFontInfo[font].FontWidth;
#endif
        Offset *= (charkey - LCDFontInfo[font].FontStart);
        Offset += LCD_FONT_HEAD_LEN;
        return Offset;
    }
    return LCD_FONT_HEAD_LEN;
}

VOID DspClearLine(UCHAR row, UCHAR font)
{
    INT Y = row * LCDFontInfo[font].FontHeight;
    LcdClr(0, Y, LCD_WIDTH, LCDFontInfo[font].FontHeight);
}

VOID DspPutChar(UCHAR col, UCHAR row, USHORT charkey, UCHAR attr, UCHAR font)
{
    UCHAR *data = LCDFontInfo[font].FontAddr + DspFontOffset(charkey, font);
    INT X, Y;

    X = col * LCDFontInfo[font].FontWidth;
    Y = row * LCDFontInfo[font].FontHeight;
    if (LCDFontInfo[font].CharSize)
        X /= 2;
    LcdPut(X, Y, LCDFontInfo[font].FontWidth, LCDFontInfo[font].FontHeight, data, attr);
}

VOID DspOutText(UCHAR col, UCHAR row, CHAR *str, CHAR *font, UCHAR attr)
{
#if defined(TDP225_PCB)
    UCHAR dspmem[(LCD_WIDTH + 7) / 8 * LCD_HEIGHT];
    _TextAttr sTextAttr;
    _ImgBuf ImgBuf;
    INT ByteWidth, pmax, cmax, rmax;

    memset(dspmem, 0, sizeof(dspmem));

    ImgBuf.pBuffer    = dspmem;
    ImgBuf.iWidth     = LCD_WIDTH;
    ImgBuf.iHeight    = LCD_HEIGHT;
    ImgBuf.iByteWidth = ByteWidth = (ImgBuf.iWidth + 7) / 8;

    sTextAttr.psImageBuffer = &ImgBuf;

    sTextAttr.sCoord.iX  = ImgBuf.iWidth;
    sTextAttr.sCoord.iY  = 0;
    sTextAttr.iDirection = 0;
    sTextAttr.iRotation  = 0;
    sTextAttr.iHoriMulti = 1;
    sTextAttr.iVertMulti = 1;
    sTextAttr.ExpLength  = strlen(str);
    sTextAttr.pExp       = (BYTE *)str;
    sTextAttr.pFont      = (BYTE *)font;
    sTextAttr.eLanguage  = LANG_TSPL;
    sTextAttr.ePutWay    = PUT_OW;

    OutText(&sTextAttr);

    col *= sTextAttr.iRealWidth / strlen(str);
    row *= sTextAttr.iRealHeight;
    cmax = MIN(LCD_WIDTH,  sTextAttr.iRealWidth);
    rmax = MIN(LCD_HEIGHT, sTextAttr.iRealHeight);
    pmax = (rmax + 7) / 8;

    LcdPut(col, row, cmax, rmax, dspmem, attr);

#else
    UCHAR imgmem[(LCD_HEIGHT + 7) / 8 * LCD_WIDTH];
    UCHAR dspmem[(LCD_HEIGHT + 7) / 8 * LCD_WIDTH];
    _TextAttr sTextAttr;
    _ImgBuf ImgBuf;
    INT ByteWidth, pmax, cmax, rmax, p, c;

    memset(dspmem, 0, sizeof(dspmem));
    memset(imgmem, 0, sizeof(imgmem));

    ImgBuf.pBuffer    = imgmem;
    ImgBuf.iWidth     = LCD_HEIGHT;
    ImgBuf.iHeight    = LCD_WIDTH;
    ImgBuf.iByteWidth = ByteWidth = (ImgBuf.iWidth + 7) / 8;

    sTextAttr.psImageBuffer = &ImgBuf;

    sTextAttr.sCoord.iX  = ImgBuf.iWidth;
    sTextAttr.sCoord.iY  = 0;
    sTextAttr.iDirection = 90;
    sTextAttr.iRotation  = 90;
    sTextAttr.iHoriMulti = 1;
    sTextAttr.iVertMulti = 1;
    sTextAttr.ExpLength  = strlen(str);
    sTextAttr.pExp       = (BYTE *)str;
    sTextAttr.pFont      = (BYTE *)font;
    sTextAttr.eLanguage  = LANG_TSPL;
    sTextAttr.ePutWay    = PUT_OW;

    OutText(&sTextAttr);

    col *= sTextAttr.iRealWidth / strlen(str);
    row *= sTextAttr.iRealHeight;
    cmax = MIN(LCD_WIDTH,  sTextAttr.iRealWidth);
    rmax = MIN(LCD_HEIGHT, sTextAttr.iRealHeight);
    pmax = (rmax + 7) / 8;
    for (p = 0; p < pmax; p++)
        for (c = 0; c < cmax; c++)
            dspmem[p * cmax + c] = imgmem[c * ByteWidth + (ByteWidth - 1 - p)];

    LcdPut(col, row, cmax, rmax, dspmem, attr);

#endif
}

VOID ShowInputString(INT col, INT row, CHAR *str, UCHAR attr)
{
    USHORT charkey;
    INT font;

    while (*str)
    {
        font = DspFindFont(LCD_ENG_DECODE);
#if defined(MENU_TSPL_3)
        if ((BYTE)*str >= 0x80)
            font = DspFindFont(LCD_WU_DECODE);
#endif
        charkey = (BYTE)*str++;
        DspPutChar(col, row, charkey, attr, font);
        col += 1;
    }
}

VOID ShowPromptString(INT col, INT row, CHAR *str, UCHAR attr)
{
    _FileList List;
    BOOL find = FALSE;

    OpenList(&List, DRAM_DEVICE);
    while (!find && NextFile(&List, "PROMPT.LCD"))
        find = TRUE;
    OpenList(&List, FLASH_DEVICE);
    while (!find && NextFile(&List, "PROMPT.LCD"))
        find = TRUE;
    OpenList(&List, CARD_DEVICE);
    while (!find && NextFile(&List, "PROMPT.LCD"))
        find = TRUE;

    if (find)
        DspOutText(col, row, str, "PROMPT.LCD", attr);
    else
        ShowInputString(col, row, str, attr);
}

VOID ShowLCDString(INT col, INT row, CHAR *str, UCHAR attr)
{
    USHORT charkey;
    INT font;

    while (*str)
    {
        font = DspDecode((BYTE *)str);
        if (LCDFontInfo[font].CharSize)
        {
            charkey = ((BYTE)*str++) << 8;
            charkey += (BYTE)*str++;
            DspPutChar(col, row, charkey, attr, font);
            col += 2;
        }
        else
        {
            charkey = (BYTE)*str++;
            DspPutChar(col, row, charkey, attr, font);
            col += 1;
        }
    }
}

VOID ShowMessage(INT col, INT row, INT msg, UCHAR attr)
{
    BYTE *str = (BYTE *)LCDMessage[msg][*DspLang];
    ShowLCDString(col, row, (CHAR *)str, attr);
}

#endif

以下为.h文件:Display.h 、、、、、、、、、、、、、、、、、、、、、、、、、

#ifndef DISPLAY_H

/******************************************************************************
 *                                                                            *
 *                         M O D U L E   D E F I N E                          *
 *                                                                            *
 ******************************************************************************/

#define DISPLAY_H

/******************************************************************************
 *                                                                            *
 *        C O M P I L E R   D E F I N E D   I N C L U D E   F I L E S         *
 *                                                                            *
 ******************************************************************************/

/* None */

/******************************************************************************
 *                                                                            *
 *            U S E R   D E F I N E D   I N C L U D E   F I L E S             *
 *                                                                            *
 ******************************************************************************/

#include "XLCD.h"

#ifdef __cplusplus
extern "C" {            /* Assume C declarations for C++ */
#endif    /* __cplusplus */

#if defined(LCD_MODEL)

/******************************************************************************
 *                                                                            *
 *                        G L O B A L   D E F I N E S                         *
 *                                                                            *
 ******************************************************************************/

#if defined(MENU_TSPL_1) || defined(MENU_TSPL_2) || defined(MENU_TSPL_3)
#define DSP_FONT_WIDTH            8
#define DSP_FONT_HEIGHT            16
#elif defined(MENU_TSPL_4)
#define DSP_FONT_WIDTH            10
#define DSP_FONT_HEIGHT            20
#endif

#define DSP_LINE_CHARS            (LCD_WIDTH / DSP_FONT_WIDTH)
#define DSP_LINES                (LCD_HEIGHT / DSP_FONT_HEIGHT)

/* Display Status */
#define DIS_INITIAL                (1 <<  0)
#define DIS_UPDATE                (1 <<  1)
#define DIS_ERASING                (1 <<  2)
#define DIS_OUT_OF_MEMORY        (1 <<  3)
#define DIS_DOWNLOADING            (1 <<  4)
#define DIS_CUTTER_CLEAR        (1 <<  5)
#define DIS_OVER_HEAT            (1 <<  6)
#define DIS_CUTTER_ERROR        (1 <<  7)
#define DIS_CARRIAGE_RECOVER    (1 <<  8)
#define DIS_CARRIAGE_OPEN        (1 <<  9)
#define DIS_RIBBON_EMPTY        (1 << 10)
#define DIS_PAPER_EMPTY            (1 << 11)
#define DIS_PAPER_JAM            (1 << 12)
#define DIS_PAUSE                (1 << 13)
#define DIS_DUMP_MODE            (1 << 14)
#define DIS_SELFTEST            (1 << 15)
#define DIS_CALIBRATION            (1 << 16)
#define DIS_PRINTKEY            (1 << 17)
#define DIS_REPRINTKEY            (1 << 18)
#define DIS_TAKE_LABEL            (1 << 19)
#define DIS_PRINT_REMAIN        (1 << 20)
#define DIS_INPUT_FUNC            (1 << 21)
#define DIS_IMAGE                (1 << 22)
#define DIS_READY                (1 << 23)
#define DIS_ALL_STATE            0x00FFFFFF

/******************************************************************************
 *                                                                            *
 *                 S T R U C T U R E   D E F I N I T I O N S                  *
 *                                                                            *
 ******************************************************************************/

#if defined(MENU_TSPL_1)

typedef enum
{
    MSG_READY,
    MSG_PRINTING,
    MSG_UPDATE,
    MSG_SELFTEST,
    MSG_CALIBRATING,
    MSG_DUMPMODE,
    MSG_INITIAZING,
    MSG_DOWNLOADING,
    MSG_OUT_OF_MEMORY,
    MSG_ERASING,
    MSG_PAUSE,
    MSG_SYNTAX_ERR,
    MSG_FILE_ERR,
    MSG_CUTTER_ERR,
    MSG_PAPER_EMPTY,
    MSG_PAPER_JAM,
    MSG_RIBBON_EMPTY,
    MSG_OVER_HEAT,
    MSG_PRINTER_INFO,
    MSG_SPEED,
    MSG_DENSITY,
    MSG_COM1,
    MSG_CODEPAGE,
    MSG_COUNTRY,
    MSG_SIZE,
    MSG_GAP,
    MSG_BLINE,
    MSG_FILE_LIST,
    MSG_END_OF_FILE,
    MSG_PEEL_ON,
    MSG_PEEL_OFF,
    MSG_CUTTER_ON,
    MSG_CUTTER_OFF,
    MSG_RIBBON_ON,
    MSG_RIBBON_OFF,
    MSG_MEMORY_INFO,
    MSG_MEMORY_TOTAL,
    MSG_MEMORY_REMAIN,
    MSG_DATE_TIME,
    MSG_DATE,
    MSG_TIME,
    MSG_PRINTER_SETUP,
    MSG_BAUD_RATE,
    MSG_PARITY,
    MSG_DATA_BITS,
    MSG_STOP_BIT,
    MSG_LANG,
    MSG_CARRIAGE_OPEN,
    MSG_COVER_OPEN,
    MSG_TAKE_LABEL,
    MSG_ROTATE_CUTTER,
    MSG_MILAGE,
    MSG_REMAINING_LABEL,
    MSG_PRESS_FEED_KEY,
}_eLCDMsg;

typedef enum
{
    LCD_LANG_ENG,
    LCD_LANG_TC,
    LCD_LANG_JP,
    LCD_LANG_SC,
    LCD_LANG_ITA,
    LANGUAGE_TOTAL,
}_eLCDLang;

#elif defined(MENU_TSPL_2)

typedef enum
{
    MSG_NULL_STR,
    MSG_MAIN_MENU,
    MSG_PRINTER_SETUP,
    MSG_PRINTER,
    MSG_SPEED,
    MSG_DENSITY,
    MSG_DIRECTION,
    MSG_TEAR_MODE,
    MSG_PEEL_ON,
    MSG_CUTTER_ON,
    MSG_CUTTER_BATCH,
    MSG_TEAR_ON,
    MSG_TEAR_OFF,
    MSG_CUT_EVERY,
    MSG_OFFSET,
    MSG_REFERENCE_X,
    MSG_REFERENCE_Y,
    MSG_EXIT,
    MSG_SENSOR_CALIB,
    MSG_SENSOR,
    MSG_AUTO_GAP,
    MSG_MANUAL_GAP,
    MSG_AUTO_BLINE,
    MSG_MANUAL_BLINE,
    MSG_AUTO_RIBBON,
    MSG_MANUAL_RIBBON,
    MSG_NOT_THROUGH,
    MSG_THROUGH,
    MSG_REFLECTED,
    MSG_NOT_REFLECTE,
    MSG_ON_LABLE,
    MSG_ON_GAP,
    MSG_ON_BLINE,
    MSG_SYSTEM_SETUP,
    MSG_SYSTEM,
    MSG_LANG,
    MSG_CODEPAGE,
    MSG_COUNTRY,
    MSG_RS232_SETUP,
    MSG_PARITY_NONE,
    MSG_PARITY_EVEN,
    MSG_PARITY_ODD,
    MSG_DATA_BITS,
    MSG_STOP_BITS,
    MSG_BAUD_RATE,
    MSG_AUX_LED_ON,
    MSG_AUX_LED_OFF,
    MSG_AUX_BUZZER_OFF,
    MSG_AUX_BUZZER,
    MSG_RESTORE,
    MSG_LANG_DATA,
    MSG_FILE_MANAGE,
    MSG_FILE,
    MSG_FILE_LIST,
    MSG_DRAM_FILE_LIST,
    MSG_FLASH_FILE_LIST,
    MSG_NO_FILE,
    MSG_AVAIL_MEM,
    MSG_DRAM,
    MSG_FLASH,
    MSG_KB_FREE,
    MSG_DELETE_FILE,
    MSG_PAUSE_FLASH_ALL,
    MSG_FEED_EXIT,
    MSG_PAUSE_YES,
    MSG_FEED_NO,
    MSG_PRINTER_TEST,
    MSG_TEST,
    MSG_PRINTER_CFG,
    MSG_DUMP_MODE_OFF,
    MSG_DUMP_MODE_ON,
    MSG_ROTATE_CUTTER,
    MSG_ROTATE_MOTOR,
    MSG_CUTTER_POS_OK,
    MSG_CUTTER_POS_NG,
    MSG_MENU_FWD,
    MSG_PAUSE_REV,
    MSG_MILEAGE_INFO,
    MSG_MILEAGE,
    MSG_LABEL,
    MSG_DUMPMODE,
    MSG_READY,
    MSG_TAKE_LABEL,
    MSG_INITIAZING,
    MSG_DOWNLOADING,
    MSG_OUT_OF_MEMORY,
    MSG_ERASING,
    MSG_UPDATE,
    MSG_GAP_BLINE,
    MSG_CALIBRATING,
    MSG_IGNORE_AUTOBAS,
    MSG_PAUSE,
    MSG_PAPER_EMPTY,
    MSG_RIBBON_EMPTY,
    MSG_PAPER_JAM,
    MSG_CUTTER_ERR,
    MSG_RIBBON_SLIDE,
    MSG_CASE_OPEN,
    MSG_CARRIAGE_OPEN,
    MSG_OVER_HEAT,
    MSG_REMAINING_COUNT,
    MSG_PRESS_FEED_KEY,
    MSG_OUT_OF_FLASH,
    MSG_OUT_OF_DRAM,
    MSG_SYNTAX_ERR,
    MSG_PRINTING,
    MSG_SELFTEST,
    MSG_MEMORY_CARD,
}_eLCDMsg;

typedef enum
{
    LCD_LANG_ENG,
    LCD_LANG_TC,
    LCD_LANG_SC,
    LCD_LANG_JP,
    LCD_LANG_POLISH,
    LANGUAGE_TOTAL,
}_eLCDLang;

#elif defined(MENU_TSPL_3)

typedef enum
{
/* menu message */
    MSG_MAIN_MENU,
        MSG_SETUP,
            MSG_PRINT_SETUP,
                MSG_TSPL2,
                    MSG_SPEED,
                    MSG_DENSITY,
                    MSG_DIRECTION,
                    MSG_PRINT_MODE,
                        MSG_NONE,
                        MSG_BATCH_MODE,
                        MSG_PEELER_MODE,
                        MSG_CUTTER_MODE,
                        MSG_CUTTER_BATCH,
                    MSG_OFFSET,
                    MSG_SHIFT_X,
                    MSG_SHIFT_Y,
                    MSG_REFERENCE_X,
                    MSG_REFERENCE_Y,
                    MSG_CODEPAGE,
                    MSG_COUNTRY,
                MSG_ZPL2,
                    MSG_DARKNESS,
                    MSG_PRINT_SPEED,
                    MSG_ADJUST_POSITION,
                    // Print Mode
                        MSG_TEAR_OFF,
                        MSG_PEEL_OFF,
                        MSG_CUTTER,
                    MSG_PRINT_WIDTH,
                    MSG_MAXIMUM_LENGTH,
                    MSG_LIST_FONTS,
                    MSG_LIST_IMAGES,
                    MSG_LIST_FORMATS,
                    MSG_LIST_SETUP,
                    MSG_CONTROL_PREFIX,
                    MSG_FORMAT_PREFIX,
                    MSG_DELIMITER_CHAR,
                    MSG_MEDIA_POWER_UP,
                        MSG_FEED,
                        MSG_CALIBRATION,
                        MSG_LENGTH,
                        MSG_NO_MOTION,
                    MSG_HEAD_CLOSE,
                        // Feed
                        // Calibration
                        // Set Length
                        // No Media Feed
                    MSG_LABEL_TOP,
                    MSG_LEFT_POSITION,
                    MSG_REPRINT_MODE,
                        MSG_ENABLED,
                        MSG_DISABLED,
            MSG_SENSOR,
                MSG_STATUS,
                    MSG_PAPER_LEN,
                    MSG_GAP_SIZE,
                    MSG_BLINE_SIZE,
                    MSG_INTENSITY,
                    MSG_REF_LEVEL,
                // Calibration
                    MSG_GAP_MODE,
                        MSG_AUTOMATIC,
                        MSG_MANUAL,
                            MSG_SCAN_BACKING,
                            MSG_SCAN_PAPER,
                            // Intensity
                            // Ref. Level
                            MSG_COMPLETE,
                            MSG_CANT_CALIBRATE,
                        MSG_PRE_PRINTED,
                            // Paper Len.
                            // Gap Size
                    MSG_BLINE_MODE,
                        // Automatic
                        // Manual
                            MSG_SCAN_MARK,
                            // Scan Paper
                            // Intensity
                            // Ref. Level
                            // Complete
                            // Can't Calibrate
                        // Pre-Printed
                            // Paper Len.
                            // Bline Size
                    MSG_CONTINUOUS_MODE,
                        // Automatic
                        // Manual
                            MSG_REMOVE_LABEL,
                            // Scan Paper
                            // Intensity
                            // Ref. Level
                            // Complete
                            // Can't Calibrate
            MSG_SERIAL_COMM,
                MSG_BAUD_RATE,
                    MSG_1200BPS,
                    MSG_2400BPS,
                    MSG_4800BPS,
                    MSG_9600BPS,
                    MSG_19200BPS,
                    MSG_38400BPS,
                    MSG_57600BPS,
                    MSG_115200BPS,
                MSG_PARITY,
                    // None 
                    MSG_ODD,
                    MSG_EVEN,
                MSG_DATA_BITS,
                    MSG_7DATA_BITS,
                    MSG_8DATA_BITS,
                MSG_STOP_BITS,
                    MSG_ONE_STOP_BIT,
                    MSG_TWO_STOP_BITS,
            MSG_DATE_TIME,
                MSG_DATE,
                MSG_TIME,
            MSG_RIBBON_WOUND,
                MSG_INK_SIDE_IN,
                MSG_INK_SIDE_OUT,
            MSG_ETHERNET,
                // Status
                    MSG_IP_ADDRESS,
                        MSG_SUBNET_MASK,
                        MSG_GATEWAY,
                    MSG_MAC,
                        MSG_MAC_ADDRESS,
                    MSG_PROTOCOL,
                        MSG_TCPIP_PROTOCOL,
                MSG_CONFIGURE,
                    MSG_DHCP,
                    MSG_STATIC_IP,
                        // IP Address
                        // Subnet Mask
                        // Gateway
                MSG_RESET,
        MSG_FILE_MANAGER,
            MSG_FILE_LIST,
                MSG_DRAM,
                    MSG_DRAM_FILE_LIST,
                    MSG_NO_FILE,
                MSG_FLASH,
                    MSG_FLASH_FILE_LIST,
                    // No File
                MSG_CARD,
                    MSG_CARD_FILE_LIST,
                    // No File
            MSG_AVAIL_MEM,
                // DRAM
                // FLASH
                // CARD
            MSG_DEL_ALL_FILE,
                // DRAM
                // FLASH
                // CARD
        MSG_DIAGNOSTICS,
            MSG_PRINTER_CFG,
            MSG_DUMPMODE,
            MSG_ROTATE_CUTTER,
            MSG_PRINT_HEAD,
                MSG_TEMPERATURE,
                MSG_RESISTANCE,
                MSG_BAD_DOTS,
        MSG_LANGUAGE,
            MSG_ENGLISH,
            MSG_TC,
            MSG_SC,
            MSG_JP,
            MSG_KOREAN,
            MSG_GERMAN,
            MSG_ITALIC,
            MSG_FRENCH,
            MSG_RUSSAIN,
            MSG_POLISH,
            MSG_SPANISH,
            MSG_LITHUANIAN,
            MSG_CZECH,
        MSG_SERVICE,
            MSG_INITIALIZATION,
            MSG_MILEAGE_INFO,
                MSG_MILEAGE,
                MSG_LABEL,
            MSG_SERIAL_INFO,
                MSG_SERIAL,
        MSG_EXIT,
    MSG_JOB_MANAGER,
    MSG_WRITE_PROTECT,
    MSG_PASSWORD,
    MSG_DELETE,
    MSG_CANCEL,
    MSG_RUN,
    MSG_AUTO,
    MSG_YES,
    MSG_NO,
    MSG_FWD,
    MSG_REV,
/* system message */
    MSG_READY,
    MSG_TAKE_LABEL,
    MSG_INITIAZING,
    MSG_DOWNLOADING,
    MSG_OUT_OF_MEMORY,
    MSG_ERASING,
    MSG_UPDATE,
    MSG_CALIBRATING,
    MSG_PAUSE,
    MSG_PAPER_EMPTY,
    MSG_RIBBON_EMPTY,
    MSG_PAPER_JAM,
    MSG_CUTTER_ERR,
    MSG_CARRIAGE_OPEN,
    MSG_OVER_HEAT,
    MSG_PRESS_FEED_KEY,
    MSG_PRINTING,
    MSG_SELFTEST,
}_eLCDMsg;

typedef enum
{
    LCD_LANG_ENG,
    LCD_LANG_TC,
    LCD_LANG_SC,
    LCD_LANG_JP,
    LCD_LANG_KOREAN,
    LCD_LANG_GERMAN,
    LCD_LANG_ITA,
    LCD_LANG_FRECH,
    LCD_LANG_RUSSAIN,
    LCD_LANG_POLISH,
    LCD_LANG_SPANISH,
    LCD_LANG_LITHUANIAN,
    LCD_LANG_CZECH,
    LANGUAGE_TOTAL,
}_eLCDLang;

#elif defined(MENU_TSPL_4)

typedef enum
{
/* menu message */
    MSG_FILE_LIST,
    MSG_DRAM,
    MSG_FLASH,
    MSG_CARD,
    MSG_DRAM_FILE_LIST,
    MSG_FLASH_FILE_LIST,
    MSG_CARD_FILE_LIST,
    MSG_NO_FILE,
    MSG_EXIT,
/* system message */
    MSG_READY,
    MSG_TAKE_LABEL,
    MSG_INITIAZING,
    MSG_DOWNLOADING,
    MSG_OUT_OF_MEMORY,
    MSG_ERASING,
    MSG_UPDATE,
    MSG_CALIBRATING,
    MSG_PAUSE,
    MSG_PAPER_EMPTY,
    MSG_RIBBON_EMPTY,
    MSG_PAPER_JAM,
    MSG_CUTTER_ERR,
    MSG_CARRIAGE_OPEN,
    MSG_OVER_HEAT,
    MSG_PRESS_FEED_KEY,
    MSG_PRINTING,
    MSG_SELFTEST,
    MSG_DUMPMODE,
}_eLCDMsg;

typedef enum
{
    LCD_LANG_ENG,
    LANGUAGE_TOTAL,
}_eLCDLang;

#endif

/******************************************************************************
 *                                                                            *
 *    G L O B A L   V A R I A B L E S   -   N O   I N I T I A L I Z E R S     *
 *                                                                            *
 ******************************************************************************/

/* None */

/******************************************************************************
 *                                                                            *
 *       G L O B A L   V A R I A B L E S   -   I N I T I A L I Z E R S        *
 *                                                                            *
 ******************************************************************************/

extern CONST BYTE *LCDMessage[][LANGUAGE_TOTAL];

/******************************************************************************
 *                                                                            *
 *                   F U N C T I O N   P R O T O T Y P E S                    *
 *                                                                            *
 ******************************************************************************/

//--- Display ---//
VOID DspInitialize(VOID);
VOID DspClearDisplay(VOID);
VOID DspClearLine(UCHAR, UCHAR);
VOID ShowInputString(INT, INT, CHAR *, UCHAR);
VOID ShowPromptString(INT, INT, CHAR *, UCHAR);
VOID ShowLCDString(INT, INT, CHAR *, UCHAR);
VOID ShowMessage(INT, INT, INT, UCHAR);

//--- DspStatus ---//
VOID InitialDspStatus(VOID);
VOID SetDspRemainRate(FLOAT);
ULONG GetDisplayStatus(VOID);
VOID SetDisplayStatus(ULONG);
VOID ClrDisplayStatus(ULONG);
VOID SetDisplayOverTemp(INT);
VOID SetDisplayReprintKey(INT, INT);
VOID SetDisplayRemain(INT, INT);
VOID SetDisplayInputFunc(CHAR *, CHAR *, BOOL, INT, INT, BOOL);
VOID SetDisplayImage(UCHAR *);

#endif

#ifdef __cplusplus
}                       /* End of extern "C" { */
#endif    /* __cplusplus */

#endif    

  • 20
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值