#include "includes.h" char showPIP[40]; char showGIP[40]; signed char netshowvalue=-1; signed char tempnetshowvalue=-1; //unsigned char Nonloop=0; //第一次按菜单不压栈 SUT_UI_STATUS sutUIstatus; UI_STACK UI_Stack; SUT_LIST_BOX sutListBox; SUT_PALACE sutPalace; static void UserAssistAdd(void); static void UI_Loop(void); PT_THREAD (ptUITask(struct pt *pt)){ static timer_t ptTimer; PT_BEGIN(pt); while(1){ if(uTimerExpired(&bootMapCnt))UI_Loop(); UI_Key(); PTTimerStart(&pt_timerPool, &ptTimer, 1);//1 PT_WAIT_UNTIL(pt, PTTimerIsExpired(&ptTimer)); } PT_END(pt); } /****************************************************** UISetNextStatus 设置下一个UI状态 *******************************************************/ void UISetNextStatus(unsigned char status) { sutUIstatus.LastStatus=sutUIstatus.NextStatus; sutUIstatus.NextStatus=status; } void UI_Init(void) { memset(&sutUIstatus,0,sizeof(SUT_UI_STATUS)); UISetNextStatus(UIS_STANDBY); } void ShowSingle(int CSQ); static void ShowGPSICon(void); static void ShowBatttery(int bat); static void ShowTime(char update); static void Show_Net(unsigned int s_netshowvalue); /************************************************************************ ShowStatusBar 显示状态栏 *************************************************************************/ void ShowStatusBar(char Update,char change) { static char batFirstShow=0; static uint8_t siHNS; static int siCSQ; static int siVbat; unsigned short usGps; static unsigned short susGps; static STATUE lastPPPStatus; static signed char s_netshowvalue=-1; //static signed char danhu=-1; static signed char ItemShow=-1; static signed char LastSimSelect=-1; static signed char LastthisYunYingShang=-1; static signed char lastcharge=1; if(ItemShow==-1){ GuiFillRect(0,0,159,STATUS_BAR_HEIGH-1,COLOR_DEFAULT_BLUE); GuiFillRect(0,STATUS_BAR_HEIGH,159,STATUS_ITEM_HEIGH-1,COLOR_WARN_RED); ItemShow=1; } if(LastthisYunYingShang!=thisYunYingShang && sutUIstatus.Status==UIS_STANDBY){ GuiFillRect(0,STATUS_BAR_HEIGH,159,STATUS_ITEM_HEIGH-1,COLOR_WARN_RED); switch(thisYunYingShang){ case CHINA_TELECOM: ShowCaption("中国电信",STATUS_BAR_HEIGH); break; case CHINA_MOBILE: ShowCaption("中国移动",STATUS_BAR_HEIGH); break; case CHINA_UNICOM: ShowCaption("中国联通",STATUS_BAR_HEIGH); break; case CHINA_NONE: ShowCaption("公网集群对讲系统",STATUS_BAR_HEIGH); break; } LastthisYunYingShang=thisYunYingShang; } //2G-4G显示 if(s_netshowvalue!=netshowvalue){ s_netshowvalue=netshowvalue; Show_Net(s_netshowvalue); } //卡在位 if(sutPocStatus.CardStatus&&SIMSelect!=LastSimSelect){ if(SIMSelect==0)GuiShowBmp(20,3,"SIM1.bmp"); else GuiShowBmp(20,3,"SIM2.bmp"); LastSimSelect=SIMSelect; } //信号显示 if(siCSQ!=g_iCSQ || lastPPPStatus != netPPP){ lastPPPStatus=netPPP; siCSQ=g_iCSQ; ShowSingle(g_iCSQ); } if(batFirstShow < 100) {//开机大概前1秒显示50%电量,之后根据实际显示 g_iVbat=360; batFirstShow++; } //电量显示 //if(lastcharge==1)return; if(siVbat!=g_iVbat || g_iVbat < WARN_PWR_LEVEL||lastcharge!=Chargeing){ siVbat=g_iVbat; lastcharge=Chargeing; if(lastcharge==0) GuiShowBmp(106,1,"CHARGEBAT.bmp");//GuiShowBmp(106,1,"CHARGEBAT.bmp"); else ShowBatttery(g_iVbat); } //消息显示 //ShowMessageFlag(0); //GPS显示 // usGps=((unsigned short)sutGpsInfo.isGpsWork<<8) | ((unsigned short)sutGpsInfo.isGpsValid) | ((unsigned short)sutGpsInfo.isGpsAuthOk<<2); // // if(susGps!=usGps ){ // susGps =usGps; // ShowGPSICon(); // } // //时间显示 ShowTime(Update); if(g_uslockflag==1){ GuiShowBmp(92,0,"lock.bmp"); } } static void ShowCallUserName(u16 x,u16 y); static void ShowGroupAndUserName(u16 x,u16 y,int update); static void UIShowGroupSel(int update); static void UIShowUserSel(int update); static void ReFlashItem(void); static void UIShowMenuMain(int update); SUT_MENU sutMenuMain; int siCt1=-1; void UIShowMainInterface(char StatusUpdate) { int Flag;//主界面状态:0--未登录 1--无人说话 2--本机说话 3--对方说话 static int siLastFlag=-1;//上一个Flag状态值 static int siCt=0; char info[20]; static unsigned char lastLoginResult=0xff; static signed char danhu=-1; char Ylseek=4;//Y轴偏移 8 if(StatusUpdate){ GuiClearAll(); switch(thisYunYingShang){ case CHINA_TELECOM: ShowCaption("中国电信",STATUS_BAR_HEIGH); break; case CHINA_MOBILE: ShowCaption("中国移动",STATUS_BAR_HEIGH); break; case CHINA_UNICOM: ShowCaption("中国联通",STATUS_BAR_HEIGH); break; case CHINA_NONE: ShowCaption("公网集群对讲系统",STATUS_BAR_HEIGH); break; } danhu=sutPocStatus.danHunStatus; if(danhu==0) GuiClearArea(100,110,30,14);//GuiClearRect(120,110,160,14);//136 else GuiShowStr(100,110,"挂断",0x01,0); siLastFlag=-1; siCt=0; return; } if(danhu!=sutPocStatus.danHunStatus) { danhu=sutPocStatus.danHunStatus; if(danhu==0) GuiClearArea(100,110,30,14);//GuiClearRect(120,110,160,14);//136 else GuiShowStr(100,110,"挂断",0x01,0); } if(Ui_LockFlag==1){ ShowMessageBox("请先解锁!"); uTimerHardDly(50); } //======以下持续调用,以便动态更新信息========== //----顶部显示状态栏----------- //-----登陆状态标志更新-------- if(0==sutPocStatus.Logined){//未登录时,显示LOGO Flag=0; }else if(sutPocStatus.Speaker==0 && sutPocStatus.Mic==0){//对方未说话,本机未说话 Flag=1; siCt1=0; }else if(sutPocStatus.Mic>0 ){//对方未说话,本机说话 Flag=2; }else if(sutPocStatus.Speaker>0){//对方说话了 Flag=3; } //-------中间图片显示------- switch(Flag){ case 0://未登录 if(Flag!=siLastFlag||Ui_LockFlag){ GuiClearRect(0,STATUS_ITEM_HEIGH,LCD_WIDTH,44+64); GuiShowBmp(0,44,"logo.bmp"); } break; case 1://已登录,但无人说话 if(Flag!=siLastFlag||Ui_LockFlag){ GuiClearRect(0,STATUS_ITEM_HEIGH,LCD_WIDTH-1,STATUS_ITEM_HEIGH+7); GuiClearRect(0,STATUS_ITEM_HEIGH+20+20+8,127,STATUS_ITEM_HEIGH+20+20+20+12); GuiShowBmp(0,STATUS_ITEM_HEIGH+20+20+8+8,"Phone.bmp"); GuiShowStr(16,STATUS_ITEM_HEIGH+20+20+8+8,"空闲",0x10,0); sutPocStatus.statusChaned = 1; } break; case 2://已登录,本机说话 if(Flag!=siLastFlag||Ui_LockFlag){ GuiClearRect(0,STATUS_ITEM_HEIGH+20+20+8,LCD_WIDTH-1,STATUS_ITEM_HEIGH+20+20+8+20); } GuiShowBmp(0,STATUS_ITEM_HEIGH+20+20+8+8,"Csend.bmp"); GuiShowStr(16,STATUS_ITEM_HEIGH+20+20+8+8,"本机在讲话",0x10,0); break; case 3://已登录,对方说话 if(Flag!=siLastFlag||Ui_LockFlag) { GuiShowBmp(0,STATUS_ITEM_HEIGH+20+20+8+8,"Creceive.bmp"); GuiClearRect(16,STATUS_ITEM_HEIGH+20+20+8+8,127,STATUS_ITEM_HEIGH+20+20+20+8+8); } //显示对方名字 ShowCallUserName(16,STATUS_ITEM_HEIGH+20+20+8+8); break; } //------群组、用户显示-------- if(Flag>0){//已登陆 if((Flag!=siLastFlag&&(siLastFlag==0||siLastFlag==-1))||Ui_LockFlag) { ShowGroupAndUserName(0,STATUS_ITEM_HEIGH+8,1);//当前群组和用户名显示 18 }else { ShowGroupAndUserName(0,STATUS_ITEM_HEIGH+8,0);//当前群组和用户名显示 18 } }else{//未登陆 memset(info, ' ',sizeof(info)); memcpy(info, "正在登陆.", 9); if(0==siCt) { GuiShowStr(0,STATUS_ITEM_HEIGH,info,1,0); } else if(100==siCt) { info[9]='.'; GuiShowStr(0,STATUS_ITEM_HEIGH,info,1,0); } else if(200==siCt) { info[9]='.';info[10]='.'; GuiShowStr(0,STATUS_ITEM_HEIGH,info,1,0); } if(lastLoginResult != sutPocStatus.loginResult || siLastFlag==-1) { if(sutPocStatus.loginResult==1) snprintf(info, sizeof(info), "账号信息错误"); else if(sutPocStatus.loginResult==2) snprintf(info, sizeof(info), "无网络连接 "); else if(sutPocStatus.loginResult==4) snprintf(info, sizeof(info), "请插卡 "); else if(sutPocStatus.loginResult==5&&lastLoginResult!=1) snprintf(info, sizeof(info), "无法连接"); else if(sutPocStatus.loginResult==6) snprintf(info, sizeof(info), "没有服务"); else { lastLoginResult=sutPocStatus.loginResult; goto NEXT_STEP; } lastLoginResult=sutPocStatus.loginResult; GuiShowStr(0,STATUS_ITEM_HEIGH+16,info,1,0); } } Ui_LockFlag=0; NEXT_STEP: //------- if(++siCt>=300)siCt=0; if(Flag!=siLastFlag){//状态变化 才更新 分页 siLastFlag=Flag; siCt=0; } } /****************************************************** UIShowMenuSysSetup 系统设置菜单 *******************************************************/ //SUT_MENU sutMenuSysSetup; void UIShowMenuSysSetup(int update) { static const char *apcMenuSysSetup[]={ "1.LCD时长设置", "2.亮度调节", // "3.网络设置", // "4.提示音设置", "3.SIM选择", // "6.麦克风增益", "4.串口功能切换", "5.功耗模式设置", "6.服务器设置", "7.对讲版本升级",//此项放最后 "" ////"6.场景模式", //"6.编码器设置", }; static char *staticMenum[11]; char i; char numb=0; while(*apcMenuSysSetup[numb++]); numb--; if(update){ GuiClearAll(); ShowCaption("系统设置",STATUS_BAR_HEIGH); //1 if(hgs_poc_type != POC_OWN){ for(i=0;i<4;i++) staticMenum[i]=(char *)apcMenuSysSetup[i]; staticMenum[i]=(char *)apcMenuSysSetup[numb]; MenuInit(&sutMenuSysSetup,staticMenum); }else MenuInit(&sutMenuSysSetup,apcMenuSysSetup); GuiShowStr(0,SUBSCRIPT_LOCATION,"<退出 确定 下翻>",0x01,0); GuiDrawHLine(0,127,110,1); return; } } /****************************************************** UI_Loop UI循环调用,需要在MainTask的主循环中持续调用,及时处理状态发生变化时的UI显示 此处按下OK键显示里面内容 *******************************************************/ void UI_Loop(void) { char StatusUpdate=0; if(sutUIstatus.Status!=sutUIstatus.NextStatus||sutUIstatus.ItemRefresh){//状态发生变更 sutUIstatus.LastStatus=sutUIstatus.Status; sutUIstatus.Status=sutUIstatus.NextStatus; StatusUpdate=1; } ShowStatusBar(1,StatusUpdate);//顶部状态栏 switch(sutUIstatus.Status){ case UIS_STANDBY: // Nonloop=1; Init_stack(&UI_Stack);//UI 返回栈 UIShowMainInterface(StatusUpdate); break; case UIS_MENU_MAIN: UIShowMenuMain(StatusUpdate); break; case UIS_MENU_USER_SEL: UIShowUserSel(StatusUpdate); break; case UIS_MENU_GROUP_SEL: UIShowGroupSel(StatusUpdate); break; case UIS_MAIL_BOX: UIShowMailBox(StatusUpdate); break; case UIS_MENU_SYS_SET: UIShowMenuSysSetup(StatusUpdate); break; case UIS_MENU_INFO: UIShowInformation(StatusUpdate); break; case UIS_MESSAGE_OPTION: MessageOptionShow(StatusUpdate); break; case UIS_MESSAGE_READ: MessageReadShow(StatusUpdate); break; case UIS_CALL_TO_PHONE: CallToPhoneNum(StatusUpdate); break; case UIS_MESSAGE_DELE: MessageDeletShow(StatusUpdate); break; case UIS_MESSAGE_FORMAT: MessageFormatShow(StatusUpdate); break; case UIS_SET_APN: SetAPNShow(StatusUpdate); break; case UIS_APN_DETAIL: SetApnDetailShow(StatusUpdate); break; case UIS_SET_GPS: SetGPSShow(StatusUpdate); break; case UIS_SET_LCD: SetLCDShow(StatusUpdate); break; case UIS_SET_LCDBRIGHT: SetLcdBrightShow(StatusUpdate); break; //////////////////////////// case UIS_SET_NET: SetNetShow(StatusUpdate); break; /////////////////////////// case UIS_SET_SERVER_PASS: UIShowPOCSerPass(StatusUpdate); break; case UIS_SET_SERVER: UIShowPOCSer(StatusUpdate); break; case UIS_SET_CODETYPE: SetCodeTypeShow(StatusUpdate); break; case UIS_SET_KEYSound: SetKeySoundShow(StatusUpdate); break; case UIS_SET_SOUNDMODE: SetSoundModeShow(StatusUpdate); break; case UIS_SET_PWRMODE: SetPowerModeShow(StatusUpdate); break; case UIS_SET_POC_FOTA: SetUpIntercomVerShow(StatusUpdate); break; case UIS_SET_USBTTL: SetUSBorTTLShow(StatusUpdate); break; case UIS_SET_SIMCARD: SetCardShow(StatusUpdate); break; case UIS_SET_MICLV: SetMicLvSelectShow(StatusUpdate); break; case UIS_POWEROFF_WAIT: PoweroffWaitShow(StatusUpdate); break; } } SUT_MENU sutMenuMain; static void UserSelResponse(); static void GroupSelResponse(); void UI_Key() { int key; char buf[30]; if(!isKeyPress()) return; if(g_ucTMMode!=0) return; switch(sutUIstatus.Status){ case UIS_STANDBY://----待机界面--- switch(g_ulKeyValue){ case KEY_PANEL_MENU: if(g_uslockflag==1) return; UISetNextStatus(UIS_MENU_MAIN); break; case KEY_PANEL_DOWN: if(g_uslockflag==1)return; if(sutPocStatus.danHunStatus==1) { if(hgs_poc_type==POC_OWN)ModemSendAt("AT+POC=500000\r\n"); else { snprintf(buf, sizeof(buf),"AT+POC=entergroup,%d\r\n",sutPocStatus.LocalGroup.ID); ModemSendAt(buf); } } break; } break; case UIS_MENU_MAIN://----主菜单---- //sutMenuSysSetup key=RollMenuResponse(&sutMenuSysSetup); if(KEY_PANEL_MENU==g_ulKeyValue){ switch(sutMenuSysSetup.handle){ case 0://群组选择 UISetNextStatus(UIS_MENU_GROUP_SEL); break; case 1://成员选择 UISetNextStatus(UIS_MENU_USER_SEL); break; case 2: UISetNextStatus(UIS_SET_NET); break; case 3: UISetNextStatus(UIS_SET_KEYSound); break; case 4: //系统设置 UISetNextStatus(UIS_MENU_SYS_SET); break; case 5://终端信息 UISetNextStatus(UIS_MENU_INFO); break; } PushUiStack(&UI_Stack,sutMenuSysSetup.handle);// } else if(KEY_PANEL_OK==g_ulKeyValue){ UISetNextStatus(UIS_STANDBY); } break; case UIS_MENU_GROUP_SEL://-----群组选择----- GroupSelResponse(); break; case UIS_MENU_USER_SEL://-----成员选择----- UserSelResponse(); break; case UIS_MAIL_BOX://-----短信查阅----- MessageResponse(); break; case UIS_MENU_SYS_SET://-----系统设置----- SetSYSResponse(); //名字没取好,实际上是系统 break; case UIS_MENU_INFO://-----终端信息----- if(KEY_PANEL_OK==g_ulKeyValue){ UISetNextStatus(sutUIstatus.LastStatus);//UIS_STANDBY } //else if(KEY_PANEL_MENU==g_ulKeyValue)UISetNextStatus(UIS_MENU_MAIN); break; case UIS_MESSAGE_OPTION: MessageOptionResponse(); break; case UIS_MESSAGE_READ: MessageReadResponse(); break; case UIS_MESSAGE_FORMAT: MessageFormatResponse(); break; case UIS_MESSAGE_DELE: MessageDeletResponse(); break; case UIS_SET_APN: //-----系统设置------- SetAPNResponse(); break; case UIS_APN_DETAIL: SetApnDetailResponse(); break; case UIS_SET_GPS: SetGPSResponse(); break; case UIS_SET_LCD: SetLCDResponse(); break; case UIS_SET_LCDBRIGHT: SetLcdBrightResponse(); break; //////////////////////////////////// case UIS_SET_NET: SetNetResponse(); break; ////////////////////////////////// case UIS_SET_SERVER_PASS: POCSetSerPassResponse(); break; case UIS_SET_SERVER: POCSetSerResponse(); break; case UIS_SET_CODETYPE: SetCodeTypeResponse(); break; case UIS_SET_KEYSound: SetKeysoundResponse(); break; case UIS_SET_SOUNDMODE: SetSoundModeResponse(); break; case UIS_SET_PWRMODE: SetPowerModeResponse(); break; case UIS_SET_POC_FOTA: SetUpIntercomVerResponse(); //SetPocFotaResponse(); break; case UIS_SET_USBTTL: SetUSBorTTLResponse(); break; case UIS_SET_SIMCARD: SetCardResponse(); break; case UIS_SET_MICLV: SetMicLvSelectResponse(); break; case UIS_POWEROFF_WAIT: PoweroffWaitResponse(); break; default: break; } } /*********************************** 显示信号状态 **********************************/ void ShowSingle(int CSQ) { if(netPPP == OPEN) GuiShowBmp(0,0+2,"SingleOK.bmp"); else GuiShowBmp(0,0+2,"Single.bmp"); //11 3格 if(CSQ<1 || CSQ==99){ GuiClearRect(7,3,18,11); }else if(CSQ<8){ GuiDrawVLine(9,10,7,2,COLOR_WHITE_BACK); GuiClearRect(9,3,18,11); }else if(CSQ<16){ GuiDrawVLine(9,10,7,2,COLOR_WHITE_BACK); GuiDrawVLine(7,10,10,2,COLOR_WHITE_BACK); GuiClearRect(13,3,18,11); }else if(CSQ<22){ GuiDrawVLine(9,10,7,2,COLOR_WHITE_BACK); GuiDrawVLine(7,10,10,2,COLOR_WHITE_BACK); GuiDrawVLine(5,10,13,2,COLOR_WHITE_BACK); GuiClearRect(16,3,18,11); }else{ GuiDrawVLine(9,10,7,2,COLOR_WHITE_BACK); GuiDrawVLine(7,10,10,2,COLOR_WHITE_BACK); GuiDrawVLine(5,10,13,2,COLOR_WHITE_BACK); GuiDrawVLine(3,10,16,2,COLOR_WHITE_BACK);//COLOR_DEFAULT_BLUE } //2G-4G 显示 //GuiShowBmp(28,5,"2g.bmp"); } static void ShowGPSICon(void) { GuiClearRect(45,0,75,11);//30 if(0== sutGpsInfo.isGpsWork) GuiClearRect(45,0,75,11);//未工作或未检测到 else { //GPS已工作 if(0 == sutGpsInfo.isGpsValid) {//未定位 if(sutGpsInfo.isGpsAuthOk==0)//未鉴权 { GuiShowBmp(45,0,"GPS1.bmp"); }else//已鉴权 { GuiShowBmp(45,0,"GPSA.bmp");//已鉴权 } }else {//已定位 if(sutGpsInfo.isGpsAuthOk==0)//未鉴权 { GuiShowBmp(45,0,"GPS1.bmp"); }else//已鉴权 { GuiShowBmp(45,0,"GPSA.bmp");//已鉴权 } GuiShowBmp(45+10,0,"GPS2.bmp");//定位辐射放最后//2 } } } static void ShowBatttery(int bat) { static unsigned int flashCnt=0; static unsigned char flag=0; int x=106; if(bat=400 4格 GuiShowBmp(x,1,"VBAT1.bmp"); GuiDrawVLine(3,8,x+4,3,COLOR_WHITE_BACK); GuiDrawVLine(3,8,x+8,3,COLOR_WHITE_BACK); GuiDrawVLine(3,8,x+12,3,COLOR_WHITE_BACK); GuiDrawVLine(3,8,x+16,3,COLOR_WHITE_BACK);//5.12 } } static void ShowTime(char update) { static unsigned char lastS=0xff; USER_RTC_DEF tempTime; char buf[30]; if(sutPocStatus.FirstLogined==0) return; RTC_UserGetTime(&tempTime); if(lastS != tempTime.second || update){ lastS=tempTime.second; if(lastS % 2) snprintf(buf, sizeof(buf),"%02d:%02d",tempTime.hour,tempTime.min); else snprintf(buf, sizeof(buf),"%02d %02d",tempTime.hour,tempTime.min); GuiShowStr(48,0,buf,0x01,0); } } static void Show_Net(unsigned int s_netshowvalue) { if(sutPocStatus.loginResult==4)return; //未插卡不显示2G if(s_netshowvalue==2||s_netshowvalue==0){ GuiShowStr(30,0,"2G",0x01,0); }else if(s_netshowvalue==7){ GuiShowStr(30,0,"4G",0x01,0); }else { GuiClearRect(30,0,46,10); } } void ShowCallUserName(u16 x,u16 y) { static char scName[POC_USER_NAME_LEN]; char name[POC_USER_NAME_LEN]; uint8_t thisName; static uint8_t siCt=0; if(siCt==0||siCt==20||siCt==40 || siCt==60||siCt==80||siCt==100) { if(strncmp(scName, sutPocStatus.Callname,sizeof(scName)) != 0 || strncmp(scName, sutPocStatus.Callname,sizeof(sutPocStatus.Callname))!=0 || sutPocStatus.statusChaned) {//当名字变更后,刷新 //GuiClearRect(x+30,y,159,y+18); GuiClearArea(x+32,y,124,18); memcpy(scName,sutPocStatus.Callname,sizeof(sutPocStatus.Callname)); sutPocStatus.statusChaned=0; // SlwTrace(INF,"------------------\r\n",1); // printf("-------------suct=%d\r\n",siCt); } StrIntercept(name,scName,sizeof(name)); //GuiShowStrM20(x+30,y,sutPocStatus.Callname,0x11,BlueColorId,COLOR_WHITE); GuiShowStr(x,y,sutPocStatus.Callname,0x10,0); } if(++siCt>100) siCt=0; } /****************************************************** 在同一个位置交替显示本机用户名和本机当前群组名 参数:x,y 显示位置左上角的坐标 update ==0 时根据内部静态群组名比较决定是否刷屏显示 update !=0 时强制刷屏显示 ******************************************************/ static void ShowGroupAndUserName(u16 x,u16 y,int update) { static char scNameUser[POC_GROUP_NAME_LEN]; static char scNameGroup[POC_GROUP_NAME_LEN]; char name[POC_GROUP_NAME_LEN]; u16 len; unsigned char danHuanBuffer[9]={0xB5,0xA5,0xBA,0xF4,0xC4,0xA3,0xCA,0xBD,0}; char GroupShowUpdate=0; if(sutPocStatus.danHunStatus==0){ if(0!=strcmp(sutPocStatus.LocalGroup.name,scNameGroup) || update!=0){ memcpy(scNameGroup,sutPocStatus.LocalGroup.name,sizeof(scNameGroup)); GroupShowUpdate=1; } }else{ if(0!=strcmp((char *)danHuanBuffer,scNameGroup) || update!=0){ memcpy(scNameGroup, danHuanBuffer,sizeof(danHuanBuffer)); GroupShowUpdate=1; } } if(0!=strcmp(sutPocStatus.LocalUser.name,scNameUser) || update!=0){ memcpy(scNameUser,sutPocStatus.LocalUser.name,sizeof(scNameUser)); GroupShowUpdate=1; } if(GroupShowUpdate){ GuiClearRect(x,y,LCD_WIDTH-1,y+20);//18 GuiClearRect(x,y+20,LCD_WIDTH-1,y+20+20);//18 // if(sutPocStatus.danHunStatus==0){ // GuiShowStr(x,y+3,"群组:",0x01,0); // // }else GuiShowStr(x,y+3,"单呼:",0x01,0); // // GuiShowStr(x,y+20+3,"成员:",0x01,0); // GuiShowStr(x,y+20+20+3,"话权:",0x01,0); GuiShowBmp(x,y,"Group2.bmp"); GuiShowBmp(x,y+16+8,"people2.bmp"); StrIntercept(name,scNameGroup,sizeof(name)); GuiShowStr(x+16,y,name,0x10,0); StrIntercept(name,scNameUser,sizeof(name)); GuiShowStr(x+16,y+24,name,0x10,0); sutPocStatus.statusChaned=1; GroupShowUpdate=0; } } void ReFlashItem2(void) { static unsigned short susCt=0; static const char *accIconFileName[]={ "Group1.bmp", "Group2.bmp", "" }; int i; unsigned short timeout; static char NullGroup=0; static char *GroupsName[POC_ALL_GROUPS_NUM+1]; //5 static char GroupFeatures[POC_ALL_GROUPS_NUM+1];//5 unsigned char buf[10]; //---------------------------- for(i=0;i<=POC_ALL_GROUPS_NUM;i++){ GroupsName[i]=&NullGroup; GroupFeatures[i]=0; } // printf("name111====%d\r\n",sutPocStatus.ListFillIndex); for(i=0;i",0x01,0); } break; } if(machine != 3) return; //按键提示 if(susCt==0){ // GuiShowStr(0,SUBSCRIPT_LOCATION,"[上]选择 [下]选择",0x01,0); GuiShowStr(0,SUBSCRIPT_LOCATION,"<退出 确定 下翻>",0x01,0); }else if(susCt==200){ //GuiShowStr(0,SUBSCRIPT_LOCATION,"退出[M]确定",0x01,0); } if(++susCt>=400)susCt=0; UserAssistAdd(); } static void ReFlashItem(void) { //char buf[100]; static const char *accIconFileName[]={ "people1.bmp", "people2.bmp", "" }; int i; static char NullUser=0; static char *UsersName[POC_ALL_USERS_NUM+1]; //5 static char UserFeatures[POC_ALL_USERS_NUM+1];//5 unsigned char buf[10]; //---------------------------- for(i=0;i<=POC_ALL_USERS_NUM;i++){ UsersName[i]=&NullUser; UserFeatures[i]=0; } for(i=0;i",0x01,0); machine=3; } break; } if(machine != 3) return; //按键提示 if(susCt==0){ GuiShowStr(0,SUBSCRIPT_LOCATION,"<退出 单呼 下翻>",0x01,0); //GuiShowStr(0,SUBSCRIPT_LOCATION,"[上]选择 [下]选择",0x01,0); }else if(susCt==200){ //GuiShowStr(0,SUBSCRIPT_LOCATION,"[EXIT]退出[M]单呼",0x01,0); } if(++susCt>=400)susCt=0; UserAssistAdd(); } /****************************************************** UIShowMenuMain 显示主菜单 *******************************************************/ SUT_MENU sutMenuMain; void UIShowMenuMain(int update) { static const char *apcMenuMain[]={ "群组选择", "成员选择", "网络设置",//"文本消息", "按键音设置",//"定位设置", "系统设置", "终端信息", "" }; if(update){ #ifdef ROLLMENU RollMenuInit(&sutMenuSysSetup,apcMenuMain); #else PalaceInit(&sutPalace,apcMenuMain,"Palace","主菜单"); #endif } } static char SelMachine=0; //上一次仍在处理标志 static void UserAssistAdd(void){ switch(SelMachine){ case 1: if(getAssistResult()){ if(sutUIstatus.Status==UIS_MENU_GROUP_SEL)ReFlashItem2();//指针会被重置到0位置 else ReFlashItem(); SelMachine=0; } break; case 2: if(getAssistResult()){ if(sutUIstatus.Status==UIS_MENU_GROUP_SEL)ReFlashItem2();//指针会被重置到0位置 else ReFlashItem(); SelMachine=0; } break; } } static void UserSelResponse(){ char buf[50]; unsigned long key; switch(SelMachine){ case 0: if(sutListBox.handle==0 && KEY_PANEL_UP==g_ulKeyValue){ UiassistStart(1); SelMachine=1; }else if((sutListBox.handle+1) == sutListBox.itemnum && (KEY_PANEL_DOWN==g_ulKeyValue)){ UiassistStart(2); SelMachine=2; } key=ListBoxResponse(&sutListBox); if(KEY_PANEL_OK==g_ulKeyValue){ uiAssist.status=0; if(UI_Stack.FastUiChange)UISetNextStatus(UIS_STANDBY); else UISetNextStatus(UIS_MENU_MAIN); }else if(KEY_PANEL_MENU==key){ //单呼成员 AT+POC=AT+POC=0A0000xxxxxxxx /////////////////////////////////////// if(0 == sutPocStatus.ListCurOnlineNum){ break; } /////////////////////////////////////// UiassistEnd(1); if(hgs_poc_type==POC_BND)ModemSendAt("AT+POC=autoleavetime,30\r\n");//单呼30秒无人通话自动解散 if(hgs_poc_type==POC_BND)snprintf(buf, sizeof(buf),"AT+POC=singlecall,%d\r\n",sutPocStatus.AllUsers[sutListBox.handle].ID); else snprintf(buf, sizeof(buf),"AT+POC=0A0000%08x\r\n",sutPocStatus.AllUsers[sutListBox.handle].ID); ModemSendAt(buf); SlwTrace(INF, buf,1); snprintf(buf, sizeof(buf),"呼叫:%s",sutPocStatus.AllUsers[sutListBox.handle].name); SlwTrace(INF, buf,1); //ShowMessageBox(buf); //OsDelayTime(200); UISetNextStatus(UIS_STANDBY); SelMachine=0; } break; } } static void GroupSelResponse(){ unsigned int key; char buf[50]; int i; switch(SelMachine){ case 0: if(sutListBox.handle==0 && KEY_PANEL_UP==g_ulKeyValue){ UiassistStart(1); SelMachine=1; }else if((sutListBox.handle+1) == sutListBox.itemnum && (KEY_PANEL_DOWN==g_ulKeyValue)){ UiassistStart(2); SelMachine=2; } key=ListBoxResponse(&sutListBox); if(KEY_PANEL_OK==g_ulKeyValue){ uiAssist.status=0; UI_Stack.OK_back=1; if(UI_Stack.FastUiChange)UISetNextStatus(UIS_STANDBY); else UISetNextStatus(UIS_MENU_MAIN); }else if(KEY_PANEL_MENU==key){ if(0 == sutPocStatus.ListCurOnlineNum){ break; } /////////////////////////////////////// UiassistEnd(1); if(hgs_poc_type==POC_BND)snprintf(buf, sizeof(buf),"AT+POC=entergroup,%d\r\n",sutPocStatus.AllGroups[sutListBox.handle].ID); else snprintf(buf, sizeof(buf),"AT+POC=090000%08x\r\n",sutPocStatus.AllGroups[sutListBox.handle].ID); ModemSendAt(buf); SlwTrace(INF, buf,1); snprintf(buf, sizeof(buf),"进入:%s",sutPocStatus.AllGroups[sutListBox.handle].name); g_ucEnterGroupFlag=1;//进入播报 SlwTrace(INF, buf,1); UISetNextStatus(UIS_STANDBY); SelMachine=0; } break; } } void speciallShow(char type) {//他们的FileSys.c中的中文编码设置不到正常的,其它C的正常,所以要显示只能通过这个方式实现了 if(type==0) ShowMessageBox("正在设置"); else ShowMessageBox("设置完成"); }