/*---------------------------------------------------------------------------/ / Display function /---------------------------------------------------------------------------*/ void DisplayJobList(void) { JOB_NODE* node = gJobList.headJob; u16 nCount = gJobList.JobCount > PAGE_JOB_COUNT ? PAGE_JOB_COUNT : gJobList.JobCount; SetCharFont(&Font8x16); SetCharColor(BLACK, WHITE); for(u16 index=0; index < nCount; index++) { char strTemp[32] = {0, }; sprintf(strTemp, "%.2d", node->JobInfo.JobNo); DisplayString(PT_JOB_NO, PT_JOB_START_Y + (index * SZ_FONT_H) + (index * SZ_JOB_SEL_SPACE) + 4, (u8*)strTemp); sprintf(strTemp, "%.32s", node->JobInfo.JobName); DisplayString(PT_JOB_NAME, PT_JOB_START_Y + (index * SZ_FONT_H) + (index * SZ_JOB_SEL_SPACE) + 4, (u8*)strTemp); sprintf(strTemp, "%.2d", node->JobInfo.Steps); DisplayString(PT_JOB_STEPS, PT_JOB_START_Y + (index * SZ_FONT_H) + (index * SZ_JOB_SEL_SPACE) + 4, (u8*)strTemp); sprintf(strTemp, "%.2d", node->JobInfo.Screws); DisplayString(PT_JOB_SCREWS, PT_JOB_START_Y + (index * SZ_FONT_H) + (index * SZ_JOB_SEL_SPACE) + 4, (u8*)strTemp); if(node->JobInfo.JobNo < 1 || node->JobInfo.JobNo > 255 || node->JobInfo.Steps > 255) { SetCharColor(RED, WHITE); sprintf(strTemp, "No. %.3d : job struct error!!", index + 1); DisplayString(0, 16 * index, (u8*)strTemp); } node = node->nextJob; } }
void DisplayKeyboard(KEYBOARD_TYPE type) { if(type != KEY_NONE) { // Font 설정 SetCharFont(&Font8x16); SetCharColor(BLACK, WHITE); // 키보드 출력 if(type == KEY_NUM) DrawImage(PT_BG_KEY_X, PT_BG_KEY_Y, NM_BG_KEY_NUM); else if(type == KEY_LOWER) DrawImage(PT_BG_KEY_X, PT_BG_KEY_Y, NM_BG_KEY_LOW); else if(type == KEY_UPPER) DrawImage(PT_BG_KEY_X, PT_BG_KEY_Y, NM_BG_KEY_UP); gKeyboardType = type; } }
void DisplayDelayPage(const TOUCH_INFO *TS) { if(gDelayPageInit == DISABLE) { DrawImage(PT_ZERO, PT_ZERO, NM_BG_DELAY); if(gxIsDEditableStep != ENABLE) { // Delay Step 초기화 gxDelayInfo.StepType = STEP_DELAY; memset(gxDelayInfo.StepName, 0x00, 20); strncpy(gxDelayInfo.StepName, "New Delay Step", strlen("New Delay Step")); gxDelayInfo.DelayTime = 1000; } { // value display SetCharFont(&Font8x16); SetCharColor(BLACK, WHITE); u16 textWidth = 8 * strlen(gxDelayInfo.StepName) / 2; u16 textHeight = 16 / 2; DisplayString( CalcTextOrigin(PT_STEP_JOB_NAME_X, SZ_STEP_NAME_W) - textWidth, CalcTextOrigin(PT_STEP_JOB_NAME_Y, SZ_STEP_NAME_H) - textHeight, (u8*)gxDelayInfo.StepName); // DelayTime char strTemp[8] = {0, }; sprintf(strTemp, "%.d", gxDelayInfo.DelayTime); textWidth = 8 * CalcOutputValueStrlen(gxDelayInfo.DelayTime) / 2; u16 xStart = PT_DELAY_TIME_X + (SZ_DELAY_TIME_W / 2); u16 yStart = PT_DELAY_TIME_Y + (SZ_DELAY_TIME_H / 2); DrawImage(PT_DELAY_TIME_X, PT_DELAY_TIME_Y, NM_BG_DELAY_TIME); DisplayString(xStart - textWidth, yStart - (16 / 2), (u8*)strTemp); gDelayPageInit = ENABLE; } } if(TS->Touched != FALSE) { gDelayMenu = AnalyzeDelayTouchArea(TS); // SAVE if(gDelayMenu == DLY_SAVE) DrawImage(PT_SAVE_X, PT_TITLE_BUTTONS_Y, NM_BT_STEP_SAVE_S); else DrawImage(PT_SAVE_X, PT_TITLE_BUTTONS_Y, NM_BT_STEP_SAVE); // CANCE if(gDelayMenu == DLY_CANCEL) DrawImage(PT_CANCEL_X, PT_TITLE_BUTTONS_Y, NM_BT_STEP_CANCEL_S); else DrawImage(PT_CANCEL_X, PT_TITLE_BUTTONS_Y, NM_BT_STEP_CANCEL); } else { if(gDelayMenu != DLY_NONE) { // Beep sound play PlayBeep(); { // Image if(gDelayMenu == DLY_SAVE) DrawImage(PT_SAVE_X, PT_TITLE_BUTTONS_Y, NM_BT_STEP_SAVE); else if(gDelayMenu == DLY_CANCEL) DrawImage(PT_CANCEL_X, PT_TITLE_BUTTONS_Y, NM_BT_STEP_CANCEL); } { // Touched...page change process and control process if(gDelayMenu == DLY_STEP_NAME) { SetKeyboardValue(gxDelayInfo.StepName, strlen(gxDelayInfo.StepName)); gxIsModify = TRUE; gxPrePreDisplay = gxPreDisplay; gxPreDisplay = gxCurDisplay; gxCurDisplay = PAGE_KEYBOARD; } else if(gDelayMenu == DLY_SAVE || gDelayMenu == DLY_CANCEL) { if(gDelayMenu == DLY_CANCEL && gxIsModify != TRUE) { gDelayPageInit = DISABLE; gxIsDelayStep = ENABLE; gxIsDSaveStep = DISABLE; gxCurDisplay = PAGE_STEP_MGR; } else { // Save or Cancel SetRequestMessage(""); /* SetRequestMessage( gDelayMenu == DLY_SAVE ? "Do you want to save this step?" : "Do you want to cancel this step?" ); */ gPreDelayMenu = gDelayMenu; gxPrePreDisplay = gxPreDisplay; gxPreDisplay = gxCurDisplay; gxCurDisplay = PAGE_DIALOG; } } else if(gDelayMenu == DLY_TIME) { DP_POINT pt = { PT_DELAY_TIME_X, PT_DELAY_TIME_Y }; s16 setValue = gxDelayInfo.DelayTime; // Setting SetNumPadPosition(&pt, 0, 9999, setValue); // Display gxIsModify = TRUE; gxPrePreDisplay = gxPreDisplay; gxPreDisplay = gxCurDisplay; gxCurDisplay = PAGE_NUMPAD; } } gDelayMenu = DLY_NONE; } { // Touched...After process if(gxKbStrIsFlag == ENABLE) { gxPreDisplay = gxPrePreDisplay; gxKbStrIsFlag = DISABLE; if(gxKbIsEnter != DISABLE && gxKbBufIndex != 0) { memset(gxDelayInfo.StepName, 0x00, 20); strncpy(gxDelayInfo.StepName, (char*)gxKbBuf, gxKbBufIndex > 20 ? 20 : gxKbBufIndex); // 배경 출력 DrawImage(PT_STEP_JOB_NAME_X, PT_STEP_JOB_NAME_Y, NM_BG_STEP_NAME); // 값 출력 SetCharFont(&Font8x16); SetCharColor(BLACK, WHITE); u16 textWidth = 8 * strlen(gxDelayInfo.StepName) / 2; u16 textHeight = 16 / 2; DisplayString( CalcTextOrigin(PT_STEP_JOB_NAME_X, SZ_STEP_NAME_W) - textWidth, CalcTextOrigin(PT_STEP_JOB_NAME_Y, SZ_STEP_NAME_H) - textHeight, (u8*)gxDelayInfo.StepName); gxKbIsEnter = DISABLE; } } else if(gxNpKbStrIsFlag == ENABLE) { if(gxNpKbBufIndex != 0) { // 값 변경 gxDelayInfo.DelayTime = atoi((char*)gxNpKbBuf); // FONT 변경 SetCharFont(&Font8x16); SetCharColor(BLACK, WHITE); // 위치 구하고 디스플레이 u16 textWidth = 8 * gxNpKbBufIndex / 2; u16 xStart = PT_DELAY_TIME_X + (SZ_DELAY_TIME_W / 2); u16 yStart = PT_DELAY_TIME_Y + (SZ_DELAY_TIME_H / 2); DrawImage(PT_DELAY_TIME_X, PT_DELAY_TIME_Y, NM_BG_DELAY_TIME); DisplayString(xStart - textWidth, yStart - (16 / 2), (u8*)gxNpKbBuf); } gxPreDisplay = gxPrePreDisplay; gxNpKbStrIsFlag = DISABLE; } } { // Reset or Delete position & SAVE, CANCEL if(gxIsRequest == ENABLE) { if(gxIsResult == ENABLE) { if(gPreDelayMenu == DLY_SAVE || gPreDelayMenu == DLY_CANCEL) { gDelayPageInit = DISABLE; gxIsDelayStep = ENABLE; gxIsDSaveStep = gPreDelayMenu == DLY_SAVE ? ENABLE : DISABLE; gxCurDisplay = PAGE_STEP_MGR; } } } } } }
static int SetCharBackground( DaoStream *stream, int color ) { return SetCharColor( stream, color, CSI_BCOLOR ); }
static int SetCharForeground( DaoStream *stream, int color ) { return SetCharColor( stream, color, CSI_FCOLOR ); }
static int SetCharBackground( DaoStream *stream, int color ) { int RGB[3] = { BACKGROUND_RED, BACKGROUND_GREEN, BACKGROUND_BLUE }; return SetCharColor( stream, color, RGB ); }
static int SetCharForeground( DaoStream *stream, int color ) { int RGB[3] = { FOREGROUND_RED, FOREGROUND_GREEN, FOREGROUND_BLUE }; return SetCharColor( stream, color, RGB ); }