void DSKY::NumberPressed(int n) { KeyClick(); if (!n) SendKeyCode(16); else SendKeyCode(n); }
/*************************************************************************************************** *FunctionName: activityDestroy *Description: 界面销毁 *Input: *Output: *Return: *Author: xsx *Date: 2016年12月21日09:02:15 ***************************************************************************************************/ static void activityDestroy(void) { //清除当前页面的告警弹出框 SendKeyCode(16); activityBufferFree(); }
void DSKY::NounPressed() { KeyClick(); NounFlashing = false; SendKeyCode(31); }
void DSKY::VerbPressed() { KeyClick(); VerbFlashing = false; SendKeyCode(17); }
/*************************************************************************************************** *FunctionName: activityInput *Description: 界面输入 *Input: *Output: *Return: *Author: xsx *Date: 2016年12月21日09:00:59 ***************************************************************************************************/ static void activityInput(unsigned char *pbuf , unsigned short len) { /*命令*/ page->lcdinput[0] = pbuf[4]; page->lcdinput[0] = (page->lcdinput[0]<<8) + pbuf[5]; /*返回*/ if(page->lcdinput[0] == 0x1B00) { backToFatherActivity(); } /*确认*/ else if(page->lcdinput[0] == 0x1B01) { if(TRUE == page->ismodify) { page->printInfo.crc = CalModbusCRC16Fun1(&page->printInfo, sizeof(PrintInfo)-2); copyGBSystemSetData(&page->systemSetData); memcpy(&page->systemSetData.printInfo, &page->printInfo, sizeof(PrintInfo)); if(My_Pass == SaveSystemSetData(&page->systemSetData)) { SendKeyCode(1); page->ismodify = FALSE; } else SendKeyCode(2); } } //打印数据头 else if(page->lcdinput[0] == 0x1B70) { page->tempShort = GetBufLen(&pbuf[7] , 2*pbuf[6]); if(page->tempShort > 30) page->tempShort = 30; memset(page->printInfo.header, 0, 30); memcpy(page->printInfo.header, &pbuf[7], page->tempShort); page->printInfo.crc = CalModbusCRC16Fun1(&page->printInfo, sizeof(PrintInfo)-2); page->ismodify = TRUE; } }
void DSKY::ResetPressed() { KeyClick(); SendKeyCode(18); // DS20061225 If the RESTART light is lit, this resets it externally to the AGC program. CSM 104 SYS HBK pg 399 if (RestartLit()) { ClearRestart(); } if(agc.Yaagc && agc.vagc.VoltageAlarm != 0){ agc.vagc.VoltageAlarm = 0; } }
void DSKY::MinusPressed() { KeyClick(); SendKeyCode(27); }
void DSKY::PlusPressed() { KeyClick(); SendKeyCode(26); }
/*************************************************************************************************** *FunctionName: activityFresh *Description: 界面刷新 *Input: *Output: *Return: *Author: xsx *Date: 2016年12月21日09:01:16 ***************************************************************************************************/ static void activityFresh(void) { unsigned char index = 0; if(S_PaiDuiPageBuffer) { S_PaiDuiPageBuffer->count2++; //界面忙 S_PaiDuiPageBuffer->pageisbusy = TRUE; //检测一次排队模块是否正常 if(Connect_Error == getPaiduiModuleStatus()) { if(TimeOut == timer_expired(&(S_PaiDuiPageBuffer->timer1))) { timer_set(&(S_PaiDuiPageBuffer->timer1), 5); SendKeyCode(6); AddNumOfSongToList(57, 2); } } //500ms刷新一次界面 if(S_PaiDuiPageBuffer->count2 % 5 == 0) { //如果当前功能处于禁止状态,且电机位置处于最大行程,且卡槽无卡,且最近的卡大于 则启用插卡自动创建功能 if((S_PaiDuiPageBuffer->timer0.interval == 65535) && (MaxLocation == GetGB_MotorLocation()) && (!CardPinIn)) { timer_set(&(S_PaiDuiPageBuffer->timer0), 1); } //如果当前空闲,且扫描时间到,则检测是否插卡了 if(TimeOut == timer_expired(&(S_PaiDuiPageBuffer->timer0))) { //如果当前空闲,且已经插卡 if((CardPinIn) && (NULL == GetCurrentTestItem())) { S_PaiDuiPageBuffer->error = CreateANewTest(PaiDuiTestType); //创建成功 if(Error_OK == S_PaiDuiPageBuffer->error) { vTaskDelay(1000 / portTICK_RATE_MS); //创建成功,则使电机远离,防止用户拔卡 MotorMoveTo(1, 2, 1000, FALSE); startActivity(createSampleActivity, NULL); return; } //排队位置满,不允许 else if(Error_PaiduiFull == S_PaiDuiPageBuffer->error) { SendKeyCode(2); AddNumOfSongToList(19, 2); timer_set(&(S_PaiDuiPageBuffer->timer0), 65535); } //创建失败 else if(Error_Mem == S_PaiDuiPageBuffer->error) { SendKeyCode(1); AddNumOfSongToList(7, 0); timer_set(&(S_PaiDuiPageBuffer->timer0), 65535); } //有卡即将测试 else if(Error_PaiDuiBusy == S_PaiDuiPageBuffer->error) { SendKeyCode(3); AddNumOfSongToList(20, 0); timer_set(&(S_PaiDuiPageBuffer->timer0), 65535); } //测试中禁止添加 else if(Error_PaiduiTesting == S_PaiDuiPageBuffer->error) { SendKeyCode(4); AddNumOfSongToList(21, 0); timer_set(&(S_PaiDuiPageBuffer->timer0), 65535); } //排队模块失联 else if(Error_PaiduiDisconnect == S_PaiDuiPageBuffer->error) { SendKeyCode(5); AddNumOfSongToList(58, 0); } } } //更新倒计时数据 for(index=0; index<PaiDuiWeiNum; index++) { S_PaiDuiPageBuffer->tempd2 = GetTestItemByIndex(index); if(S_PaiDuiPageBuffer->tempd2) { DspNum(0x1506+index, S_PaiDuiPageBuffer->tempd2->statues, 2); //超时 if(isInTimeOutStatus(S_PaiDuiPageBuffer->tempd2)) { S_PaiDuiPageBuffer->tempvalue1 = timer_Count(&(S_PaiDuiPageBuffer->tempd2->timer2)); if(S_PaiDuiPageBuffer->tempvalue1 > 60) sprintf(S_PaiDuiPageBuffer->buf, "%02dM", S_PaiDuiPageBuffer->tempvalue1/60); else sprintf(S_PaiDuiPageBuffer->buf, "%02dS", S_PaiDuiPageBuffer->tempvalue1); WriteVarIcoNum(0x1510+index*16, 50); } else { S_PaiDuiPageBuffer->tempvalue1 = timer_surplus(&(S_PaiDuiPageBuffer->tempd2->timer)); if(S_PaiDuiPageBuffer->tempvalue1 > 60) sprintf(S_PaiDuiPageBuffer->buf, "%02dM", S_PaiDuiPageBuffer->tempvalue1/60); else sprintf(S_PaiDuiPageBuffer->buf, "%02dS", S_PaiDuiPageBuffer->tempvalue1); S_PaiDuiPageBuffer->tempvalue = S_PaiDuiPageBuffer->tempd2->testdata.temperweima.CardWaitTime*60 - S_PaiDuiPageBuffer->tempvalue1; S_PaiDuiPageBuffer->tempvalue /= S_PaiDuiPageBuffer->tempd2->testdata.temperweima.CardWaitTime*60; S_PaiDuiPageBuffer->tempvalue *= 50; WriteVarIcoNum(0x1510+index*16, (unsigned short)(S_PaiDuiPageBuffer->tempvalue)); } DisText(0x1610+index*0x08, S_PaiDuiPageBuffer->buf, 10); if((S_PaiDuiPageBuffer->tempd2->statues == status_timedown) || (S_PaiDuiPageBuffer->tempd2->statues == status_timeup)){ BasicPic(0x1590+index*0x10, 1, 138, 10+85*S_PaiDuiPageBuffer->tempd2->testdata.temperweima.itemConstData.icoIndex, 10, 10+85*S_PaiDuiPageBuffer->tempd2->testdata.temperweima.itemConstData.icoIndex+75, 10+285, 91+index*110, 190); } else { //检测卡图标闪烁 if((S_PaiDuiPageBuffer->count % 2) == 0) BasicPic(0x1590+index*0x10, 1, 138, 10+85*S_PaiDuiPageBuffer->tempd2->testdata.temperweima.itemConstData.icoIndex, 10, 10+85*S_PaiDuiPageBuffer->tempd2->testdata.temperweima.itemConstData.icoIndex+75, 10+285, 91+index*110, 190); else BasicPic(0x1590+index*0x10, 0, 138, 10+85*S_PaiDuiPageBuffer->tempd2->testdata.temperweima.itemConstData.icoIndex, 10, 10+85*S_PaiDuiPageBuffer->tempd2->testdata.temperweima.itemConstData.icoIndex+75, 10+285, 91+index*110, 190); } } else { //清除倒计时时间 ClearText(0x1610+index*0x08); ClearText(0x1650+index*0x08); //显示卡凹槽 S_PaiDuiPageBuffer->myico.ICO_ID = 37; S_PaiDuiPageBuffer->myico.X = 69+index*119; S_PaiDuiPageBuffer->myico.Y = 135; BasicUI(0x1590+index*0x10 ,0x1907 , 0, &(S_PaiDuiPageBuffer->myico) , sizeof(Basic_ICO)); //时间进度条显示0 WriteVarIcoNum(0x1510+index*16, 0); } } S_PaiDuiPageBuffer->count++; if(S_PaiDuiPageBuffer->count > 65535) S_PaiDuiPageBuffer->count = 0; } //界面空闲 S_PaiDuiPageBuffer->pageisbusy = FALSE; } }
static void SetGB_Time(char *buf, unsigned char len) { short temp = 0; if(S_OtherSetPageBuffer) { if(len < 14) { SendKeyCode(3); return; } memset(S_OtherSetPageBuffer->buf, 0, 50); memcpy(S_OtherSetPageBuffer->buf, buf, 4); temp = strtol(S_OtherSetPageBuffer->buf, NULL, 10); if((temp < 2016)||(temp > 2100)) { SendKeyCode(3); return; } S_OtherSetPageBuffer->temptime.year = temp - 2000; memset(S_OtherSetPageBuffer->buf, 0, 50); memcpy(S_OtherSetPageBuffer->buf, buf+4, 2); temp = strtol(S_OtherSetPageBuffer->buf, NULL, 10); if((temp < 1)||(temp > 12)) { SendKeyCode(3); return; } S_OtherSetPageBuffer->temptime.month = temp; memset(S_OtherSetPageBuffer->buf, 0, 50); memcpy(S_OtherSetPageBuffer->buf, buf+6, 2); temp = strtol(S_OtherSetPageBuffer->buf, NULL, 10); if((temp < 1)||(temp > 31)) { SendKeyCode(3); return; } S_OtherSetPageBuffer->temptime.day = temp; memset(S_OtherSetPageBuffer->buf, 0, 50); memcpy(S_OtherSetPageBuffer->buf, buf+8, 2); temp = strtol(S_OtherSetPageBuffer->buf, NULL, 10); if((temp < 0)||(temp > 23)) { SendKeyCode(3); return; } S_OtherSetPageBuffer->temptime.hour = temp; memset(S_OtherSetPageBuffer->buf, 0, 50); memcpy(S_OtherSetPageBuffer->buf, buf+10, 2); temp = strtol(S_OtherSetPageBuffer->buf, NULL, 10); if((temp < 0)||(temp > 59)) { SendKeyCode(3); return; } S_OtherSetPageBuffer->temptime.min = temp; memset(S_OtherSetPageBuffer->buf, 0, 50); memcpy(S_OtherSetPageBuffer->buf, buf+12, 2); temp = strtol(S_OtherSetPageBuffer->buf, NULL, 10); if((temp < 0)||(temp > 59)) { SendKeyCode(3); return; } S_OtherSetPageBuffer->temptime.sec = temp; if(My_Pass == RTC_SetTimeData(&(S_OtherSetPageBuffer->temptime))) /*修改成功*/ SendKeyCode(1); else /*修改失败*/ SendKeyCode(2); } }
void DSKY::KeyRel() { KeyClick(); SendKeyCode(25); }
/*************************************************************************************************** *FunctionName: activityInput *Description: 界面输入 *Input: *Output: *Return: *Author: xsx *Date: 2016年12月21日09:00:59 ***************************************************************************************************/ static void activityInput(unsigned char *pbuf , unsigned short len) { if(S_SysSetPageBuffer) { /*命令*/ S_SysSetPageBuffer->lcdinput[0] = pbuf[4]; S_SysSetPageBuffer->lcdinput[0] = (S_SysSetPageBuffer->lcdinput[0]<<8) + pbuf[5]; //基本信息 if(S_SysSetPageBuffer->lcdinput[0] == 0x1900) { startActivity(createDeviceInfoActivity, NULL); } //操作人管理 else if(S_SysSetPageBuffer->lcdinput[0] == 0x1901) { startActivity(createUserManagerActivity, NULL); } //网络设置 else if(S_SysSetPageBuffer->lcdinput[0] == 0x1902) { startActivity(createNetPreActivity, NULL); } //数据管理 else if(S_SysSetPageBuffer->lcdinput[0] == 0x1903) { startActivity(createRecordActivity, NULL); } //关于按键第一次按下 else if(S_SysSetPageBuffer->lcdinput[0] == 0x1909) { S_SysSetPageBuffer->pressCnt = 0; } //关于按键持续按下 else if(S_SysSetPageBuffer->lcdinput[0] == 0x190A) { S_SysSetPageBuffer->pressCnt++; } //关于按键松开 else if(S_SysSetPageBuffer->lcdinput[0] == 0x190B) { //如果是长按就输入密码进入隐藏功能 if(S_SysSetPageBuffer->pressCnt > 10) SendKeyCode(4); //短按则进入关于界面 else startActivity(createAboutUsActivity, NULL); } //隐藏密码的厂家功能 else if(S_SysSetPageBuffer->lcdinput[0] == 0x1910) { if(GetBufLen(&pbuf[7] , 2*pbuf[6]) == 6) { if(pdPASS == CheckStrIsSame(&pbuf[7], TestPassWord, 6)) { startActivity(createReTestActivity, NULL); } else if(pdPASS == CheckStrIsSame(&pbuf[7], CheckQRPassWord, 6)) { startActivity(createCheckQRActivity, NULL); } else if(pdPASS == CheckStrIsSame(&pbuf[7], AdjLedPassWord, 6)) { startActivity(createAdjustLedActivity, NULL); } else if(pdPASS == CheckStrIsSame(&pbuf[7], FactoryResetPassWord, 6)) { if(My_Pass == SystemReset()) SendKeyCode(2); else SendKeyCode(1); } else if(pdPASS == CheckStrIsSame(&pbuf[7], ChangeValueShowTypePassWord, 6)) { setIsShowRealValue(TRUE); SendKeyCode(2); } else if(pdPASS == CheckStrIsSame(&pbuf[7], UnlockLCDPassWord, 6)) { unLockLCDOneTime(); SendKeyCode(2); } /*else if(pdPASS == CheckStrIsSame(&pbuf[7], EnableUSBPassWord, 6)) { USBD_Init(&USB_OTG_dev,USB_OTG_FS_CORE_ID,&USR_desc,&USBD_MSC_cb,&USR_cb); }*/ else SendKeyCode(1); } else SendKeyCode(1); } //其他设置 else if(S_SysSetPageBuffer->lcdinput[0] == 0x1904) { startActivity(createOtherSetActivity, NULL); } //返回 else if(S_SysSetPageBuffer->lcdinput[0] == 0x1906) { backToFatherActivity(); } } }
/*************************************************************************************************** *FunctionName: activityHide *Description: 隐藏界面时要做的事 *Input: *Output: *Return: *Author: xsx *Date: 2016年12月21日09:01:40 ***************************************************************************************************/ static void activityHide(void) { //清除当前页面的告警弹出框 SendKeyCode(16); }
/*************************************************************************************************** *FunctionName: activityInput *Description: 界面输入 *Input: *Output: *Return: *Author: xsx *Date: 2016年12月21日09:00:59 ***************************************************************************************************/ static void activityInput(unsigned char *pbuf , unsigned short len) { S_UserPageBuffer->lcdinput[0] = pbuf[4]; S_UserPageBuffer->lcdinput[0] = (S_UserPageBuffer->lcdinput[0]<<8) + pbuf[5]; /*返回*/ if(S_UserPageBuffer->lcdinput[0] == 0x1200) { DeleteCurrentTest(); backToActivity(lunchActivityName); } /*上翻也*/ else if(S_UserPageBuffer->lcdinput[0] == 0x1203) { if(S_UserPageBuffer->pageindex > 1) { S_UserPageBuffer->pageindex--; S_UserPageBuffer->selectindex = 0; ShowList(); SelectUser(S_UserPageBuffer->selectindex); } } /*下翻页*/ else if(S_UserPageBuffer->lcdinput[0] == 0x1204) { if(S_UserPageBuffer->pageindex < (MaxUserNum / MaxPageShowNum)) { S_UserPageBuffer->tempUser = &S_UserPageBuffer->user[(S_UserPageBuffer->pageindex)*MaxPageShowNum]; if(S_UserPageBuffer->tempUser->crc == CalModbusCRC16Fun1(S_UserPageBuffer->tempUser, sizeof(User_Type)-2)) { S_UserPageBuffer->pageindex++; S_UserPageBuffer->selectindex = 0; ShowList(); SelectUser(S_UserPageBuffer->selectindex); } } } /*确定*/ else if(S_UserPageBuffer->lcdinput[0] == 0x1201) { if(S_UserPageBuffer->tempUser2 != NULL) { //如果是排队测试,则保存操作人到排队测试共用操作人 if(S_UserPageBuffer->currenttestdata->testlocation > 0) SetPaiduiUser(S_UserPageBuffer->tempUser2); /*以当前选择的操作人作为本次测试数据的操作人*/ memcpy(&(S_UserPageBuffer->currenttestdata->testdata.user), S_UserPageBuffer->tempUser2, sizeof(User_Type)); startActivity(createSampleActivity, NULL); } else { AddNumOfSongToList(9, 0); SendKeyCode(1); } } /*选择操作人*/ else if((S_UserPageBuffer->lcdinput[0] >= 0x1205)&&(S_UserPageBuffer->lcdinput[0] <= 0x1209)) { S_UserPageBuffer->selectindex = S_UserPageBuffer->lcdinput[0] - 0x1205+1; SelectUser(S_UserPageBuffer->selectindex); } //编辑操作人 if(S_UserPageBuffer->lcdinput[0] == 0x120a) { startActivity(createUserManagerActivity, NULL); } }
void DSKY::EnterPressed() { KeyClick(); SendKeyCode(28); }
/*************************************************************************************************** *FunctionName: activityInput *Description: 界面输入 *Input: *Output: *Return: *Author: xsx *Date: 2016年12月21日09:00:59 ***************************************************************************************************/ static void activityInput(unsigned char *pbuf , unsigned short len) { if(S_OtherSetPageBuffer) { /*命令*/ S_OtherSetPageBuffer->lcdinput[0] = pbuf[4]; S_OtherSetPageBuffer->lcdinput[0] = (S_OtherSetPageBuffer->lcdinput[0]<<8) + pbuf[5]; /*重启*/ if(S_OtherSetPageBuffer->lcdinput[0] == 0x2400) { while(1); } /*返回*/ else if(S_OtherSetPageBuffer->lcdinput[0] == 0x2401) { backToFatherActivity(); } /*设置时间*/ else if(S_OtherSetPageBuffer->lcdinput[0] == 0x2410) { SetGB_Time((char *)(&pbuf[7]), GetBufLen(&pbuf[7] , 2*pbuf[6])); } //自动打印设置 else if(S_OtherSetPageBuffer->lcdinput[0] == 0x2402) { //如果当前是自动打印,则禁止,否则打开 if(S_OtherSetPageBuffer->systemSetData.isAutoPrint) S_OtherSetPageBuffer->systemSetData.isAutoPrint = FALSE; else S_OtherSetPageBuffer->systemSetData.isAutoPrint = TRUE; if(My_Pass == SaveSystemSetData(&(S_OtherSetPageBuffer->systemSetData))) { SendKeyCode(1); //保存成功,更新内存中的数据 setSystemSetData(&(S_OtherSetPageBuffer->systemSetData)); } else { SendKeyCode(2); copyGBSystemSetData(&(S_OtherSetPageBuffer->systemSetData)); } showPrintfIco(); } //静音 else if(S_OtherSetPageBuffer->lcdinput[0] == 0x2403) { //如果当前是自动打印,则禁止,否则打开 if(S_OtherSetPageBuffer->systemSetData.isMute) S_OtherSetPageBuffer->systemSetData.isMute = FALSE; else S_OtherSetPageBuffer->systemSetData.isMute = TRUE; if(My_Pass == SaveSystemSetData(&(S_OtherSetPageBuffer->systemSetData))) { SendKeyCode(1); //保存成功,更新内存中的数据 setSystemSetData(&(S_OtherSetPageBuffer->systemSetData)); } else { SendKeyCode(2); copyGBSystemSetData(&(S_OtherSetPageBuffer->systemSetData)); } showMuteIco(); } //进入休眠时间 else if((S_OtherSetPageBuffer->lcdinput[0] >= 0x2407) && (S_OtherSetPageBuffer->lcdinput[0] <= 0x240a)) { S_OtherSetPageBuffer->tempvalue = S_OtherSetPageBuffer->lcdinput[0] - 0x2407; if(S_OtherSetPageBuffer->tempvalue == 0) S_OtherSetPageBuffer->systemSetData.ledSleepTime = 60; else if(S_OtherSetPageBuffer->tempvalue == 1) S_OtherSetPageBuffer->systemSetData.ledSleepTime = 180; else if(S_OtherSetPageBuffer->tempvalue == 2) S_OtherSetPageBuffer->systemSetData.ledSleepTime = 300; else S_OtherSetPageBuffer->systemSetData.ledSleepTime = 60000; if(My_Pass == SaveSystemSetData(&(S_OtherSetPageBuffer->systemSetData))) { SendKeyCode(1); //保存成功,更新内存中的数据 setSystemSetData(&(S_OtherSetPageBuffer->systemSetData)); } else { SendKeyCode(2); copyGBSystemSetData(&(S_OtherSetPageBuffer->systemSetData)); } showLcdSleepTime(); } //进入屏幕亮度 else if(S_OtherSetPageBuffer->lcdinput[0] == 0x240b) { S_OtherSetPageBuffer->systemSetData.ledLightIntensity = pbuf[8]; if(My_Pass == SaveSystemSetData(&(S_OtherSetPageBuffer->systemSetData))) { SetLEDLight(S_OtherSetPageBuffer->systemSetData.ledLightIntensity); //保存成功,更新内存中的数据 setSystemSetData(&(S_OtherSetPageBuffer->systemSetData)); } else { SendKeyCode(2); copyGBSystemSetData(&(S_OtherSetPageBuffer->systemSetData)); showLcdLightNum(); } } } }
void DSKY::ClearPressed() { KeyClick(); SendKeyCode(30); }
static void activityInput(unsigned char *pbuf , unsigned short len) { if(S_AdjustLedPageBuffer) { /*命令*/ S_AdjustLedPageBuffer->lcdinput[0] = pbuf[4]; S_AdjustLedPageBuffer->lcdinput[0] = (S_AdjustLedPageBuffer->lcdinput[0]<<8) + pbuf[5]; //开始校准 if(S_AdjustLedPageBuffer->lcdinput[0] == 0x2602) { if(S_AdjustLedPageBuffer->isTestting == FALSE) { //初始状态从200开始查找 S_AdjustLedPageBuffer->itemData.ledLight = 200; S_AdjustLedPageBuffer->isTestting = TRUE; S_AdjustLedPageBuffer->testCnt = 1; StartTest(&(S_AdjustLedPageBuffer->itemData)); dspTestStatus("Testting\0"); DspNum(0x2605, S_AdjustLedPageBuffer->testCnt, 2); DspNum(0x2604, S_AdjustLedPageBuffer->itemData.ledLight, 2); } } //读取目标值 else if(S_AdjustLedPageBuffer->lcdinput[0] == 0x2610) { memset(S_AdjustLedPageBuffer->buf, 0, 20); memcpy(S_AdjustLedPageBuffer->buf, &pbuf[7], GetBufLen(&pbuf[7] , 2*pbuf[6])); S_AdjustLedPageBuffer->targetValue = strtol(S_AdjustLedPageBuffer->buf , NULL, 10); } //读取误差值 else if(S_AdjustLedPageBuffer->lcdinput[0] == 0x2640) { memset(S_AdjustLedPageBuffer->buf, 0, 20); memcpy(S_AdjustLedPageBuffer->buf, &pbuf[7], GetBufLen(&pbuf[7] , 2*pbuf[6])); S_AdjustLedPageBuffer->targetRange = strtol(S_AdjustLedPageBuffer->buf , NULL, 10); } //保存校准值 else if(S_AdjustLedPageBuffer->lcdinput[0] == 0x2600) { if((S_AdjustLedPageBuffer->itemData.ledLight >= 100) && (S_AdjustLedPageBuffer->itemData.ledLight <= 300)) { //获取最新的系统参数 copyGBSystemSetData(&(S_AdjustLedPageBuffer->systemSetData)); //修改系统参数副本中值 setTestLedLightIntensity(&(S_AdjustLedPageBuffer->systemSetData), S_AdjustLedPageBuffer->itemData.ledLight); if(My_Pass == SaveSystemSetData(&(S_AdjustLedPageBuffer->systemSetData))) { SendKeyCode(1); //修改成功,更新内存中的值 setSystemSetData(&(S_AdjustLedPageBuffer->systemSetData)); } else SendKeyCode(2); } } //取消返回 else if(S_AdjustLedPageBuffer->lcdinput[0] == 0x2601) { if(S_AdjustLedPageBuffer->isTestting == FALSE) backToFatherActivity(); else SendKeyCode(3); } } }
/*************************************************************************************************** *FunctionName: activityInput *Description: 界面输入 *Input: *Output: *Return: *Author: xsx *Date: 2016年12月21日09:00:59 ***************************************************************************************************/ static void activityInput(unsigned char *pbuf , unsigned short len) { if(S_PaiDuiPageBuffer) { /*命令*/ S_PaiDuiPageBuffer->lcdinput[0] = pbuf[4]; S_PaiDuiPageBuffer->lcdinput[0] = (S_PaiDuiPageBuffer->lcdinput[0]<<8) + pbuf[5]; /*返回*/ if(S_PaiDuiPageBuffer->lcdinput[0] == 0x1500) { //测试中,不允许返回 if(NULL != GetCurrentTestItem()) { SendKeyCode(4); AddNumOfSongToList(21, 0); } //即将测试,不允许返回 else if(GetMinWaitTime() < 40) { SendKeyCode(3); AddNumOfSongToList(20, 0); } else if(isSomePaiduiInOutTimeStatus()) { SendKeyCode(3); AddNumOfSongToList(20, 0); } else { //页面正在刷新数据,忙 while(S_PaiDuiPageBuffer->pageisbusy) { vTaskDelay(100 / portTICK_RATE_MS); } backToActivity(lunchActivityName); } } //继续测试 else if(S_PaiDuiPageBuffer->lcdinput[0] == 0x1501) { S_PaiDuiPageBuffer->error = CreateANewTest(PaiDuiTestType); //创建成功 if(Error_OK == S_PaiDuiPageBuffer->error) { startActivity(createSampleActivity, NULL); } //排队位置满,不允许 else if(Error_PaiduiFull == S_PaiDuiPageBuffer->error) { SendKeyCode(2); AddNumOfSongToList(19, 0); } //创建失败 else if(Error_Mem == S_PaiDuiPageBuffer->error) { SendKeyCode(1); AddNumOfSongToList(7, 0); } //有卡即将测试 else if(Error_PaiDuiBusy == S_PaiDuiPageBuffer->error) { SendKeyCode(3); AddNumOfSongToList(20, 0); } //测试中禁止添加 else if(Error_PaiduiTesting == S_PaiDuiPageBuffer->error) { SendKeyCode(4); AddNumOfSongToList(21, 0); } //排队模块失联 else if(Error_PaiduiDisconnect == S_PaiDuiPageBuffer->error) { SendKeyCode(5); AddNumOfSongToList(58, 0); } } } }