SHINSEI JP2408采用C語言進行編程,可以實現現場條碼數據采集、手動數據錄入,然后即時打印標簽的功能,下面是采用C語言編寫的JP2408應用程序。
#include <stdio.h>
#include "share.h"
#define ROOT_LABELCOPY_FILE "c:\labelcopy\"
#define PATH_LABELCOPY_FILE "c:\labelcopy"
#define LABEL_PARA_FILE "LabelPara.bin"
#define LABEL_TEST "JOB NM=cmdprint,ID=1234
PAPER PG=%d,PW=%d,PH=%d
ENV MK=%d,TR=2,DR=1,SP=4,PS=%d,PO=0,TO=%d,CO=0,XO=0,YO=0,MD=1
START
BCD TP=%d,X=%d,Y=%d,DR=1,NW=%d,RA=%d,CD=%d,HT=%d,HR=1
%s
QTY P=%d
END
JOBE "
#define LABEL_FEED "JOB NM=cmdprint,ID=1234
PAPER PG=%d,PW=%d,PH=%d
ENV MK=%d,TR=2,DR=1,SP=4,PS=%d,PO=0,TO=%d,CO=0,XO=0,YO=0,MD=1
START
QTY P=1
END
JOBE "
#define MAX_BARCODE_LEN_IN_SCANNER 20
#define _TEST_DEBUG_ 0
int iBarcodeType;
int iLocX;
int iLocY;
int iNW;
int iRatio;
int iCD;
int iBarcodeHeight;
int iLabelType;
int iPositionStop;
int iPositionTrim;
int iPageHeight;
int iPageWidth;
int iPageGap;
int iLabelPages;
void LabelCopy(void);
void SetPrintPages(void);
BOOL SetLabelParameter(void);
void SetLabelDefaultParameter(void);
void UserInitProject(void)
{
uint uiKeyRet;
char sFile[MAX_PATH_LEN],sParaTemp[100];
uchar sPageGap[2 + 1],sPageHeight[4 + 1],sPageWidth[3 + 1],sLabelType[2 + 1],sPS[4 + 1],sTO[3 + 1];
char *pRecord;
FILE *fp;
ST_DIR *pDir;
unsigned long ulWriteLength;
memset(sFile,0,sizeof(sFile));
memset(sParaTemp,0,sizeof(sParaTemp));
//程序名稱及版本信息
Lcd_Show_String((uchar *)"****************",0 * 16,0 * 8);
Lcd_Show_String((uchar *)" JP2408 App ",1 * 16,0 * 8);
Lcd_Show_String((uchar *)" V1.20 ",2 * 16,0 * 8);
Lcd_Show_String((uchar *)"****************",3 * 16,0 * 8);
DelayMSByTimer2(300);
strcpy(sFile,LABEL_PARA_FILE);
CopyPathToFilename(sFile,ROOT_LABELCOPY_FILE);
if (NULL == (pDir = opendir(PATH_LABELCOPY_FILE)))
{// 創建該目錄
if (mkdir(PATH_LABELCOPY_FILE))
{
while (1)
{
MessageBox("系統目錄創建失敗,請重啟!",MSG_TYPE_ERROR,NULL);
}
}
}
else closedir(pDir);
if ((fp = fopen(sFile,"r")) == NULL)
{//保存參數設置的文件丟失
fclose(fp);
SetLabelDefaultParameter();
fp = fopen(sFile,"w+");
sprintf(sParaTemp,"%d,%d,%d,%d,%d,%d ",iPageGap,iPageWidth,iPageHeight,iLabelType,iPositionStop,iPositionTrim);
fwrite(sParaTemp,1,strlen(sParaTemp),fp);
}
memset(sParaTemp,0,sizeof(sParaTemp));
fseek(fp,0,SEEK_SET);
pRecord = fgets(sParaTemp,100,fp);
fclose(fp);
pRecord = GetSectionOfCSVRecord((char *)sPageGap,pRecord,2);
iPageGap = atoi(sPageGap);
pRecord = GetSectionOfCSVRecord((char *)sPageWidth,pRecord,3);
iPageWidth = atoi(sPageWidth);
pRecord = GetSectionOfCSVRecord((char *)sPageHeight,pRecord,4);
iPageHeight = atoi(sPageHeight);
pRecord = GetSectionOfCSVRecord((char *)sLabelType,pRecord,2);
iLabelType = atoi(sLabelType);
pRecord = GetSectionOfCSVRecord((char *)sPS,pRecord,4);
iPositionStop = atoi(sPS);
pRecord = GetSectionOfCSVRecord((char *)sTO,pRecord,3);
iPositionTrim = atoi(sTO);
iBarcodeType = 8;
iLocX = 10;
iLocY = 10;
iNW = 2;
iRatio = 2;
iCD = 0;
iBarcodeHeight = 80;
iLabelPages = 1;
BuzzerOK();
}
void SetLabelDefaultParameter(void)
{
iBarcodeType = 8;
iLocX = 10;
iLocY = 10;
iNW = 2;
iRatio = 2;
iCD = 0;
iBarcodeHeight = 80;
iLabelType = 1;
iPositionTrim = 0;
iPositionStop = 0;
iPageHeight = 344;
iPageWidth = 440;
iPageGap = 0;
iLabelPages = 1;
}
/******************************************************
應用程序入口
*******************************************************/
void App_Main(void)
{
InitApplication();
while (1)
{
LabelCopy();
}
}
void LabelCopy(void)
{
char sScannerString[MAX_BARCODE_LEN_IN_SCANNER + 1],sCodeVal[MAX_BARCODE_LEN + 1];
INPUT_PARA tInputPara;
BARCODE tBarcodeInfo;
uint uiWidth;
uint uiMsgRet;
char sPrintCmdBuf[CMD_BUF + 1],sConstString[16 + 1];
uchar bKeyChar;
const char *pMsgSelect[] = {"確定 ","取消 ",NULL};
ClearLCDLines(1,4);
memset(sScannerString,0,sizeof(sScannerString));
memset(&tInputPara,0,sizeof(INPUT_PARA));
memset(&tBarcodeInfo,0,sizeof(BARCODE));
tInputPara.bDefaultIM = IM_NUMBER;
tInputPara.bIMChangeDisable = 1;
tInputPara.iInputMode = TYPEMODE_KEYPAD_AND_SCANER;
tInputPara.iLCDDisplayArea = 16;
tInputPara.iMaxInputLen = MAX_BARCODE_LEN_IN_SCANNER;
tInputPara.pBuf = (uchar *)sScannerString;
tInputPara.uiEnableKeys = KEY_P|KEY_E;
tInputPara.x = 2;
tInputPara.y = 0;
tBarcodeInfo.iCD = iCD;
tBarcodeInfo.iHeight = iBarcodeHeight;
tBarcodeInfo.iHRIPosition = HRI_POS_BOTTOM ;
tBarcodeInfo.iRotate = ROTATE_0 ;
tBarcodeInfo.iModuleWidth = iNW;
tBarcodeInfo.iRatio = iRatio;
while (1)
{
LcdShowString(1,1," 掃描打印 ");
LcdShowString(2,1,"[F1]打印張數 ");
LcdShowString(3,1,"[F4]參數設置 ");
LcdShowString(4,1,"[E]進入掃描 ");
if (kbhit())
{
bKeyChar = kbgetchar();
BuzzerOK();
if ('E' == bKeyChar) break;
else if ('P' == bKeyChar) return;
else if ('S' == bKeyChar)
{//隱藏菜單
DelayMSByTimer2(500);
if ('S' == kbgetchar())
{
UsbDisk();
continue;
}
}
else
{
switch(bKeyChar)
{
case 11://key_F1
SetPrintPages();
break;
case 14://key_F4
if (!SetLabelParameter()) return;
break;
case 'F'://走紙
memset(sPrintCmdBuf,0,sizeof(sPrintCmdBuf));
sprintf(sPrintCmdBuf,LABEL_FEED,iPageGap,iPageWidth,iPageHeight,iLabelType,iPositionStop,iPositionTrim);
SendPrintCmd(sPrintCmdBuf);
break;
default:
BuzzerError();
break;
}
}
}
}
while (1)
{
LcdShowString(2,1,"掃描條碼...... ");
LcdShowString(3,1," ");
LcdShowString(4,1," ");
tBarcodeInfo.iType = iBarcodeType = InputFromScanner(&tInputPara);
if (0 == iBarcodeType )
{
MessageBox("不支持的條碼!!",MSG_TYPE_INFORMATION,NULL);
break;
}
else if (-1 == iBarcodeType)
{
uiMsgRet = MessageBox("確定退出? ",MSG_TYPE_QUESTION,pMsgSelect);
if (1 == uiMsgRet) break;
else continue;
}
memset(sCodeVal,0,sizeof(sCodeVal));
strcpy(sCodeVal,(char *)tInputPara.pBuf);
if (iBarcodeType == BARCODE_CODE128)
{
tBarcodeInfo.iCD = iCD = 1;//add for 05T1-001
Code128AutoSelectCodeSet(sCodeVal);
}
if (iBarcodeType == BARCODE_NW7)//增加起始終止符A,本體只支持ABCD類型
{
memmove(sCodeVal + 1,sCodeVal,strlen(sCodeVal));
sCodeVal[0] = 'A';//起始符
strcat(sCodeVal,"A");
}
for (iNW = 3;iNW > 0;iNW--)
{
tBarcodeInfo.iModuleWidth = iNW;
if ((iBarcodeType == BARCODE_ITF||(iBarcodeType == BARCODE_NW7)||(iBarcodeType == BARCODE_CODE39)))
{
for (iRatio = 6;iRatio > 0;iRatio--)
{
tBarcodeInfo.iRatio = iRatio;
uiWidth = GetBarcodePrintWidth(&tBarcodeInfo,sCodeVal);
if (0 == uiWidth)
{
MessageBox("錯誤的條碼!!",MSG_TYPE_INFORMATION,NULL);
return;
}
if (uiWidth > (iPageWidth - 6*8)) continue;//預留左右邊距3MM
else goto SetLocation;//找到最大可用條碼寬度
}
continue;
}
tBarcodeInfo.iRatio = iRatio = 2;
uiWidth = GetBarcodePrintWidth(&tBarcodeInfo,sCodeVal);
if (0 == uiWidth)
{
MessageBox("錯誤的條碼!!",MSG_TYPE_INFORMATION,NULL);
return;
}
if (uiWidth > (iPageWidth - 6*8)) continue;//預留左右邊距3MM
else goto SetLocation;
}
MessageBox("條碼寬度超出打印范圍!! ",MSG_TYPE_INFORMATION,NULL); break;
SetLocation:
iBarcodeHeight = iPageHeight - 2*5*8;//預留上下邊距5MM
if (HRI_POS_BOTTOM == tBarcodeInfo.iHRIPosition)//HRI在條碼下面時的打印位置調整
{
if (BARCODE_UPCE == iBarcodeType||BARCODE_UPCA == iBarcodeType||BARCODE_EAN13 == iBarcodeType)
{
iLocX = (iPageWidth - uiWidth)/2 - (16 + 4);//200點打印默認采用16點黑體,間隔4點
}
else iLocX = (iPageWidth - uiWidth)/2;
}
else iLocX = (iPageWidth - uiWidth)/2;
//校正打印條碼實際高度,增加HRI高度調整值16 + 4
iLocY = (iPageHeight - iBarcodeHeight - (16 + 4))/2;
memset(sPrintCmdBuf,0,sizeof(sPrintCmdBuf));
sprintf(sPrintCmdBuf,LABEL_TEST,iPageGap,iPageWidth,iPageHeight,iLabelType,iPositionStop,iPositionTrim
,iBarcodeType,iLocX,iLocY,iNW,iRatio,iCD,iBarcodeHeight,sCodeVal,iLabelPages);
#if _TEST_DEBUG_
jp_printf("cmdbuf= %s ",sPrintCmdBuf);
#endif
if (!SendPrintCmd(sPrintCmdBuf)) return;
}
}
void SetPrintPages(void)
{
ClearLCDLines(1,4);
InputPage(&iLabelPages,KEY_E|KEY_P);
}
static BOOL SubMenuSetLabelSize(void)
{
uint uiKeyRet,uiMsgRet;
char sFile[MAX_PATH_LEN],sParaTemp[100];
uchar sPageGap[2 + 1],sPageHeight[2 + 1],sPageWidth[2 + 1];
FILE *fp;
unsigned long ulWriteLength;
INPUT_PARA tInputPara;
const char *pMsgSelect[] = {"確定 ","取消 ",NULL};
memset(sFile,0,sizeof(sFile));
memset(sParaTemp,0,sizeof(sParaTemp));
memset(&tInputPara,0,sizeof(INPUT_PARA));
memset(sPageGap,0,sizeof(sPageGap));
fs_itoa(iPageGap/8,(char *)sPageGap,10);
memset(sPageHeight,0,sizeof(sPageHeight));
fs_itoa(iPageHeight/8,(char *)sPageHeight,10);
memset(sPageWidth,0,sizeof(sPageWidth));
fs_itoa(iPageWidth/8,(char *)sPageWidth,10);
strcpy(sFile,LABEL_PARA_FILE);
CopyPathToFilename(sFile,ROOT_LABELCOPY_FILE);
ClearLCDLines(1,4);
LcdShowString(1,1,"標簽大小設置 ");
LcdShowString(2,1,"間隔:[ ]mm ");
LcdShowString(3,1,"寬度:[ ]mm ");
LcdShowString(4,1,"高度:[ ]mm ");
LcdShowString(2,7,(char *)sPageGap);
LcdShowString(3,7,(char *)sPageWidth);
LcdShowString(4,7,(char *)sPageHeight);
while (1)
{
tInputPara.bDefaultIM = IM_NUMBER;
tInputPara.bIMChangeDisable = 1;
tInputPara.iInputMode = TYPEMODE_KEYPAD;
tInputPara.iLCDDisplayArea = 2;
tInputPara.iMaxInputLen = 2;
tInputPara.pBuf = sPageGap;
tInputPara.uiEnableKeys = KEY_E|KEY_P|KEY_DOWN;
tInputPara.x = 1;
tInputPara.y = 6;
uiKeyRet = InputNumber(&tInputPara);
if (0 == strlen(sPageGap)) LcdShowString(2,7,"0");
iPageGap = atoi(sPageGap) * 8;//單位換算mm - dot
if (iPageGap < 0||iPageGap > 80)
{
MessageBox("標簽間隔只能在0--10之間 ",MSG_TYPE_INFORMATION,NULL);
continue;
}
if (KEY_P == uiKeyRet)
{
uiMsgRet = MessageBox("確定退出? ",MSG_TYPE_QUESTION,pMsgSelect);
if (1 == uiMsgRet) goto exit;
else continue;
}
while (1)
{
tInputPara.pBuf = sPageWidth;
tInputPara.uiEnableKeys = KEY_E|KEY_P|KEY_DOWN|KEY_UP;
tInputPara.x = 2;
tInputPara.y = 6;
uiKeyRet = InputNumber(&tInputPara);
iPageWidth = atoi(sPageWidth) * 8;
if (iPageWidth < 192||iPageWidth > 448)
{
MessageBox("標簽寬度只能在24--56之間 ",MSG_TYPE_INFORMATION,NULL);
continue;
}
if (KEY_P == uiKeyRet)
{
uiMsgRet = MessageBox("確定退出? ",MSG_TYPE_QUESTION,pMsgSelect);
if (1 == uiMsgRet) goto exit;
else continue;
}
else if (KEY_UP == uiKeyRet) break;
while (1)
{
tInputPara.pBuf = sPageHeight;
tInputPara.uiEnableKeys = KEY_E|KEY_P|KEY_UP;
tInputPara.x = 3;
tInputPara.y = 6;
uiKeyRet = InputNumber(&tInputPara);
iPageHeight = atoi(sPageHeight) * 8;
if (iPageHeight < 80||iPageHeight > 792)
{
MessageBox("標簽高度只能在10--99之間 ",MSG_TYPE_INFORMATION,NULL);
continue;
}
if (KEY_P == uiKeyRet)
{
uiMsgRet = MessageBox("確定退出? ",MSG_TYPE_QUESTION,pMsgSelect);
if (1 == uiMsgRet) goto exit;
else continue;
}
else if (KEY_UP == uiKeyRet) break;
else if (KEY_E == uiKeyRet) goto exit;
}
}
}
exit:
fp = fopen(sFile,"r+");
sprintf(sParaTemp,"%d,%d,%d,%d,%d,%d ",iPageGap,iPageWidth,iPageHeight,iLabelType,iPositionStop,iPositionTrim);
ulWriteLength = fwrite(sParaTemp,1,strlen(sParaTemp),fp);
if (ulWriteLength < strlen(sParaTemp))
{
MessageBox("標簽格式保存失敗!!",MSG_TYPE_INFORMATION,NULL);
fclose(fp);
return FALSE;
}
fclose(fp);
return TRUE;
}
static BOOL SubMemuSetLabelType(void)
{
char sFile[MAX_PATH_LEN],sParaTemp[100];
uchar bGetChar;
unsigned long ulWriteLength;
FILE *fp;
ClearLCDLines(1,4);
memset(sFile,0,sizeof(sFile));
strcpy(sFile,LABEL_PARA_FILE);
CopyPathToFilename(sFile,ROOT_LABELCOPY_FILE);
LcdShowString(1,1,"選擇標簽類型 ");
LcdShowString(2,1," 黑標連續 ");
LcdDefImgBox(16,8 * 4);
if (1 == iLabelType) LcdRvsImgBox(1 * 16,2 * 8);//反顯黒標紙
else LcdRvsImgBox(1 * 16,7 * 8);//否則,連續紙
while (1)
{
if (kbhit())
{
bGetChar = kbgetchar();
BuzzerOK();
if ('E' == bGetChar) break;
else if (20 == bGetChar||21 == bGetChar)//左右方向鍵
{
if (1 == iLabelType)
{
iLabelType = 3;
LcdRvsImgBox(1 * 16,2 * 8);
LcdRvsImgBox(1 * 16,7 * 8);
}
else
{
iLabelType = 1;
LcdRvsImgBox(1 * 16,7 * 8);
LcdRvsImgBox(1 * 16,2 * 8);
}
}
else BuzzerError();
}
}
fp = fopen(sFile,"r+");
sprintf(sParaTemp,"%d,%d,%d,%d,%d,%d ",iPageGap,iPageWidth,iPageHeight,iLabelType,iPositionStop,iPositionTrim);
ulWriteLength = fwrite(sParaTemp,1,strlen(sParaTemp),fp);
if (ulWriteLength < strlen(sParaTemp))
{
MessageBox("標簽格式保存失敗!!",MSG_TYPE_INFORMATION,NULL);
fclose(fp);
return FALSE;
}
fclose(fp);
return TRUE;
}
static BOOL SubMenuSetPS(void)
{
uint uiKeyRet,uiMsgRet;
char sFile[MAX_PATH_LEN],sParaTemp[100];
uchar sPositionStop[4 + 1];
FILE *fp;
unsigned long ulWriteLength;
INPUT_PARA tInputPara;
const char *pMsgSelect[] = {"確定 ","取消 ",NULL};
memset(sFile,0,sizeof(sFile));
memset(sParaTemp,0,sizeof(sParaTemp));
memset(&tInputPara,0,sizeof(INPUT_PARA));
memset(sPositionStop,0,sizeof(sPositionStop));
fs_itoa(iPositionStop,(char *)sPositionStop,10);
strcpy(sFile,LABEL_PARA_FILE);
CopyPathToFilename(sFile,ROOT_LABELCOPY_FILE);
ClearLCDLines(1,4);
LcdShowString(1,1,"停止位置設置 ");
LcdShowString(2,1,"設定值:[ ] ");
LcdShowString(3,1,"單位:dot ");
LcdShowString(2,9,(char *)sPositionStop);
while (1)
{
tInputPara.bDefaultIM = IM_NUMBER;
tInputPara.bIMChangeDisable = 1;
tInputPara.iInputMode = TYPEMODE_KEYPAD;
tInputPara.iLCDDisplayArea = 4;
tInputPara.iMaxInputLen = 4;
tInputPara.pBuf = sPositionStop;
tInputPara.uiEnableKeys = KEY_E|KEY_P;
tInputPara.x = 1;
tInputPara.y = 8;
uiKeyRet = InputNumber(&tInputPara);
if (0 == strlen(sPositionStop)) LcdShowString(2,9,"0");
iPositionStop = atoi(sPositionStop);
if (iPositionStop < 0||iPositionStop > 3200)
{
MessageBox("停止位置只能在0--3200之間 ",MSG_TYPE_INFORMATION,NULL);
continue;
}
if (KEY_P == uiKeyRet)
{
uiMsgRet = MessageBox("確定退出? ",MSG_TYPE_QUESTION,pMsgSelect);
if (1 == uiMsgRet) break;
else continue;
}
else if (KEY_E == uiKeyRet) break;
}
fp = fopen(sFile,"r+");
sprintf(sParaTemp,"%d,%d,%d,%d,%d,%d ",iPageGap,iPageWidth,iPageHeight,iLabelType,iPositionStop,iPositionTrim);
ulWriteLength = fwrite(sParaTemp,1,strlen(sParaTemp),fp);
if (ulWriteLength < strlen(sParaTemp))
{
MessageBox("標簽格式保存失敗!!",MSG_TYPE_INFORMATION,NULL);
fclose(fp);
return FALSE;
}
fclose(fp);
return TRUE;
}
static BOOL SubMenuSetTO(void)
{
uint uiKeyRet,uiMsgRet;
char sFile[MAX_PATH_LEN],sParaTemp[100];
uchar sPositionTrim[4 + 1];
FILE *fp;
unsigned long ulWriteLength;
INPUT_PARA tInputPara;
const char *pMsgSelect[] = {"確定 ","取消 ",NULL};
memset(sFile,0,sizeof(sFile));
memset(sParaTemp,0,sizeof(sParaTemp));
memset(&tInputPara,0,sizeof(INPUT_PARA));
memset(sPositionTrim,0,sizeof(sPositionTrim));
fs_itoa(iPositionTrim,(char *)sPositionTrim,10);
strcpy(sFile,LABEL_PARA_FILE);
CopyPathToFilename(sFile,ROOT_LABELCOPY_FILE);
ClearLCDLines(1,4);
LcdShowString(1,1,"送紙量設置 ");
LcdShowString(2,1,"設定值:[ ] ");
LcdShowString(3,1,"單位:dot ");
LcdShowString(2,9,(char *)sPositionTrim);
while (1)
{
tInputPara.bDefaultIM = IM_NUMBER;
tInputPara.bIMChangeDisable = 1;
tInputPara.iInputMode = TYPEMODE_KEYPAD;
tInputPara.iLCDDisplayArea = 3;
tInputPara.iMaxInputLen = 3;
tInputPara.pBuf = sPositionTrim;
tInputPara.uiEnableKeys = KEY_E|KEY_P;
tInputPara.x = 1;
tInputPara.y = 8;
uiKeyRet = InputNumber(&tInputPara);
if (0 == strlen(sPositionTrim)) LcdShowString(2,9,"0");
iPositionTrim = atoi(sPositionTrim);
if (iPositionTrim < 0||iPositionTrim > 100)
{
MessageBox("送紙量只能在0--100之間 ",MSG_TYPE_INFORMATION,NULL);
continue;
}
if (KEY_P == uiKeyRet)
{
uiMsgRet = MessageBox("確定退出? ",MSG_TYPE_QUESTION,pMsgSelect);
if (1 == uiMsgRet) break;
else continue;
}
if (KEY_E == uiKeyRet) break;
}
fp = fopen(sFile,"r+");
sprintf(sParaTemp,"%d,%d,%d,%d,%d,%d ",iPageGap,iPageWidth,iPageHeight,iLabelType,iPositionStop,iPositionTrim);
ulWriteLength = fwrite(sParaTemp,1,strlen(sParaTemp),fp);
if (ulWriteLength < strlen(sParaTemp))
{
MessageBox("標簽格式保存失敗!!",MSG_TYPE_INFORMATION,NULL);
fclose(fp);
return FALSE;
}
fclose(fp);
return TRUE;
}
BOOL SetLabelParameter(void)
{
uint uiRetKey;
MENU_PARA tMenuPara;
const char *pString[] = {
"標簽尺寸 ",
"標簽類型 ",
"停止位置 ",
"送紙量 ",
NULL
};
memset(&tMenuPara,0,sizeof(MENU_PARA));
tMenuPara.iCurrentItem = 0;
tMenuPara.pMenuStr = pString;
tMenuPara.pTitle = NULL;
tMenuPara.uiEnableKeys = KEY_P;
while (1)
{
uiRetKey = ShowMenu(&tMenuPara);
if (KEY_P == uiRetKey) break;
switch(tMenuPara.iCurrentItem)
{
case 0:
if (!SubMenuSetLabelSize()) return FALSE;
break;
case 1:
if (!SubMemuSetLabelType()) return FALSE;
break;
case 2:
if (!SubMenuSetPS()) return FALSE;
break;
case 3:
if (!SubMenuSetTO()) return FALSE;
break;
default:
break;
}
}
return TRUE;
}