123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335 |
- /********************************************************************************
- * File Name: UI.c
- * Function Describe:user interface module
- * Relate Module:
- * Explain: 用户界面,注意,为避免操作系统中多任务调用而导致资源访问冲突,只允许在同一个任务中调用。目前设定在MainTask任务中调用!
- * Writer: ShiLiangWen
- * Date: 2016.1.28
- *******************************************************************************/
- #include "includes.h"
- #include "LCD.h"
-
- SUT_UI_STATUS sutUIstatus;
- void UISetNextStatus(unsigned char status);
- void ShowStatusBar(int Update);//显示状态栏
- void ShowButton(u16 x,u16 y,const char *str);//显示一个按钮
- void ShowMessageBox(char *msg);
- int siCt1=-1;
- SUT_LIST_BOX sutListBox;//ListBox控件,因为内部用到了features[]数据比较大,为节省内存控件,建议整个项目共用一个list
- /******************************************************
- 在同一个位置交替显示本机用户名和本机当前群组名
- 参数:x,y 显示位置左上角的坐标
- update ==0 时根据内部静态群组名比较决定是否刷屏显示
- update !=0 时强制刷屏显示
- ******************************************************/
- void ShowGroupAndUserName(u16 x,u16 y,int update)
- {
- #if POC_USER_NAME_LEN>POC_GROUP_NAME_LEN
- static char scName[POC_USER_NAME_LEN];
- char name[POC_USER_NAME_LEN];
- #else
- static char scName[POC_GROUP_NAME_LEN];
- char name[POC_GROUP_NAME_LEN];
- #endif
- static char scCt=0;//0~2--显示群组名 3~5--显示用户名
- u16 len;
- unsigned char danHuanBuffer[9]={0xB5,0xA5,0xBA,0xF4,0xC4,0xA3,0xCA,0xBD,0};
- char GroupShowUpdate=0;
- if(++scCt>=6 || update!=0)scCt=0;
- if(scCt<3){
- if(sutPocStatus.danHunStatus==0){
- if(0!=strcmp(sutPocStatus.LocalGroup.name,scName) || update!=0){
- memcpy(scName,sutPocStatus.LocalGroup.name,sizeof(scName));
- GroupShowUpdate=1;
- }
- }else{
- if(0!=strcmp((char *)danHuanBuffer,scName) || update!=0){
- memcpy(scName, danHuanBuffer,sizeof(danHuanBuffer));
- GroupShowUpdate=1;
- }
- }
-
- if(GroupShowUpdate){
- GuiClearRect(x,y,159,y+16);
- StrIntercept(name,scName,sizeof(name));
- GuiShowStr(x,y,name,0x01);
- sutPocStatus.statusChaned=1;
- }
- }else{
- if(0!=strcmp(sutPocStatus.LocalUser.name,scName) || update!=0){
- memcpy(scName,sutPocStatus.LocalUser.name,sizeof(scName));
- GuiClearRect(x,y,159,y+16);
- StrIntercept(name,scName,sizeof(name));;
- GuiShowStr(x,y,name,0x01);
- sutPocStatus.statusChaned=1;
- }
- }
-
- }
- #if 1
- 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 suCt=0;
-
- if(suCt%50)
- {
- if(strncmp(scName, sutPocStatus.Callname,sizeof(scName)) != 0 ||
- strncmp(scName, sutPocStatus.Callname,sizeof(sutPocStatus.Callname))!=0 ||
- sutPocStatus.statusChaned)
- {//当名字变更后,刷新
- GuiClearRect(0,18,159,18+16);
- memcpy(scName,sutPocStatus.Callname,sizeof(sutPocStatus.Callname));
- sutPocStatus.statusChaned=0;
- }
- StrIntercept(name,scName,sizeof(name));
- GuiShowStr(x+48,y,sutPocStatus.Callname,0x01);
- }
- if(++suCt>=50)
- suCt=0;
- }
- #else
- u8 statusChaned;//用来修复当低优先级用户一直在讲话,不释放,然后被抢麦,
- //只要抢麦者释放话语权后,低优先级用户显示出群组名字,再
- //被抢麦,都会显示有问题。第二次以后都会。
- void ShowCallUserName(u16 x,u16 y)
- {
- static char scName[POC_USER_NAME_LEN];
- char name[POC_USER_NAME_LEN];
- unsigned char thisName;
-
- static int siCt=0;
- static u8 lastFlag;
- if(siCt==0||siCt==50||siCt==100 || siCt==150|| siCt==200){
- if(strncmp(scName, sutPocStatus.Callname,sizeof(scName)) != 0 ||
- strncmp(scName, sutPocStatus.Callname,sizeof(sutPocStatus.Callname))!=0 ||
- statusChaned)
- {//当名字变更后,刷新
- GuiClearRect(0,18,159,18+16);
- memcpy(scName,sutPocStatus.Callname,sizeof(sutPocStatus.Callname));
- statusChaned=0;
- }
- StrIntercept(name,scName,sizeof(name));
- GuiShowStr(x+48,y,sutPocStatus.Callname,0x01);
- }
- if(++siCt>=200)siCt=0;
- }
- #endif
- /**********************************************************
- 显示主界面
- ************************************************************/
- void UIShowMainInterface(int StatusUpdate)
- {
- int Flag;//主界面状态:0--未登录 1--无人说话 2--本机说话 3--对方说话
- static int siLastFlag=-1;//上一个Flag状态值
- static int siCt=0;
- char info[20];
- static unsigned char lastLoginResult=0xff;
- if(StatusUpdate){
- GuiClearAll();
- ShowButton(1,107,"菜单");
- ShowButton(121,107,"消息");
- siLastFlag=-1;
- siCt=0;
- ShowStatusBar(StatusUpdate);
- return;
- }
- //======以下持续调用,以便动态更新信息==========
- //----顶部显示状态栏-----------
- ShowStatusBar(StatusUpdate);
-
- //-----登陆状态标志更新--------
- if(0==sutPocStatus.Logined){//未登录时,显示LOGO
- Flag=0;
- }else if(sutPocStatus.Speaker==0 && sutPocStatus.PPTpress==0){//对方未说话,本机未说话
- Flag=1;
- siCt1=0;
- }else if(sutPocStatus.Speaker==0 && sutPocStatus.PPTpress>0 ){//对方未说话,本机说话
- Flag=2;
- }else if(sutPocStatus.Speaker>0){//对方说话了
- Flag=3;
- if(siCt1==0){
- siCt1=1;
- GuiClearRect(0,18,159,18+16);
- }
- }
- //-------中间图片显示-------
- switch(Flag){
- case 0://未登录
- if(Flag!=siLastFlag){
- GuiClearRect(0,38,159,38+59);
- GuiShowBmp(30,38,"logo.bmp");
- }
- break;
- case 1://已登录,但无人说话
- if(Flag!=siLastFlag){
- GuiClearRect(0,38,159,38+59);
- GuiShowBmp(30,38,"logo.bmp");
- sutPocStatus.statusChaned = 1;
- }
- break;
- case 2://已登录,本机说话
- if(Flag!=siLastFlag)GuiClearRect(0,38,159,38+59);
- if(0==siCt)GuiShowBmp(40+12,40,"Pickup.bmp");
- else if(100==siCt)GuiShowBmp(40+12,40,"Pickup1.bmp");
- else if(200==siCt)GuiShowBmp(40+12,40,"Pickup2.bmp");
-
- break;
- case 3://已登录,对方说话
- if(Flag!=siLastFlag)GuiClearRect(0,38,159,38+59);
- if(0==siCt)GuiShowBmp(30+24,38,"speaker.bmp");
- else if(100==siCt)GuiShowBmp(30+24,38,"speaker1.bmp");
- else if(200==siCt)GuiShowBmp(30+24,38,"speaker2.bmp");
- //显示对方名字
- ShowCallUserName(0,18);
- break;
- }
- //------群组、用户显示--------
- if(Flag>0){//已登陆
- if(siCt==0 || siCt==100 || siCt==200){//每秒刷一次,以便及时更新。刷太快也影响
- if(Flag!=3)
- {
- if(Flag!=siLastFlag)
- {
- ShowGroupAndUserName(0,18,1);//当前群组和用户名显示
- }else
- {
- ShowGroupAndUserName(0,18,0);//当前群组和用户名显示
- }
- }
- }
- }else{//未登陆
- memset(info, ' ',sizeof(info));
- memcpy(info, "正在登陆.", 9);
- if(0==siCt)
- {
- GuiShowStr(0,18,info,1);
- }
- else if(100==siCt)
- {
- info[9]='.';
- GuiShowStr(0,18,info,1);
- }
- else if(200==siCt)
- {
- info[9]='.';info[10]='.';
- GuiShowStr(0,18,info,1);
- }
-
- if(lastLoginResult != sutPocStatus.loginResult || siLastFlag==-1)
- {
- lastLoginResult=sutPocStatus.loginResult;
- if(lastLoginResult==1) snprintf(info, sizeof(info), "账号信息错误");
- else if(lastLoginResult==2) snprintf(info, sizeof(info), "无网络连接 ");
- else if(lastLoginResult==4) snprintf(info, sizeof(info), "请插卡 ");
- else if(lastLoginResult==5) snprintf(info, sizeof(info), "无法连接");
- else if(lastLoginResult==6) snprintf(info, sizeof(info), "没有服务");
- else goto NEXT_STEP;
- GuiShowStr(0,38,info,1);
- }
- }
-
- NEXT_STEP:
- //-------
- if(++siCt>=300)siCt=0;
-
- if(Flag!=siLastFlag){//状态变化 才更新 分页
- siLastFlag=Flag;
- siCt=0;
- }
- }
-
- void UI_Init(void)
- {
- memset(&sutUIstatus,0,sizeof(SUT_UI_STATUS));
- UISetNextStatus(UIS_STANDBY);
- }
- /******************************************************
- UIShowMenuMain
- 显示主菜单
- *******************************************************/
- SUT_MENU sutMenuMain;
- void UIShowMenuMain(int update)
- {
- static const char *apcMenuMain[]={
- "群组选择",
- "成员选择",
- "文本消息",//"短信查阅",
- // "电话管理",
- "系统设置",
- "终端信息",
- ""
- };
- if(update){
- GuiClearAll();
- ShowCaption("主菜单",1); //0的话有点靠顶
- GuiDrawHLine(0,159,20,1);
- MenuInit(&sutMenuMain,apcMenuMain);
- return;
- }
- //如果有需要持续调用,则在以下添加代码
-
- }
- /******************************************************
- UIShowMenuSysSetup
- 系统设置菜单
- *******************************************************/
- //SUT_MENU sutMenuSysSetup;
- void UIShowMenuSysSetup(int update)
- {
- static const char *apcMenuSysSetup[]={
- "APN设置",
- "北斗设置",
- "LCD设置",
- //"软件版本升级",//"应用版本升级",//4G模块中,POC的TCP指令中,没有UDP指令
- "网络设置",
- //"服务器设置",
- "提示音设置",
- //"对讲版本升级",
- "场景模式",
- "快捷群组设置",
- ""
- };
- if(update){
- GuiClearAll();
- ShowCaption("系统设置",1); //0
- GuiDrawHLine(0,159,20,1);
- MenuInit(&sutMenuSysSetup,apcMenuSysSetup);
- return;
- }
- }
- /******************************************************
- UIShowGroupSel
- 群组选择
- *******************************************************/
- void UIShowGroupSel(int update)
- {
- char buf[30];
- unsigned short timeout;
- int i;
- static unsigned short susCt=0;
- static const char *accIconFileName[]={
- "Group1.bmp",
- "Group2.bmp",
- ""
- };
- static char NullGroup=0;
- static char *GroupsName[POC_ALL_GROUPS_NUM+1];//多一个成员,是为了当成员达到最大数目时,最后一个要设为0,ListBoxInit里面统计ITEM是以0为结尾的。
- static char GroupsFeatures[POC_ALL_GROUPS_NUM+1];//100
-
- if(sutPocStatus.Logined == 0)//not login
- {
- ShowMessageBox(" 请先登录... ");
- i=50;
- while(i--)
- OsDelayTime(1);
- UISetNextStatus(UIS_STANDBY);
- return;
- }
- if(update){
- ////////////////////////////////////////
- sutPocStatus.GroupNum_Update=0;
- ShowMessageBox("正在获取,请稍候...");
- susCt=0;
- GuiClearAll();
- ShowCaption("群组选择",1); //0
- GuiDrawHLine(0,159,20,1);
- //----------------------------
- for(i=0;i<=POC_ALL_GROUPS_NUM;i++){
- GroupsName[i]=&NullGroup;
- GroupsFeatures[i]=0;
- }
- snprintf(buf, sizeof(buf),"Gnum=%d\r\n", sutPocStatus.GroupsNum);
- SlwTrace(INF, buf, 0);
- #if 1
- for(i=0;i<sutPocStatus.GroupsNum && i<POC_ALL_GROUPS_NUM;i++)
- {//set local user to 0 index
- //设置Features 将决定选择图标
- if(sutPocStatus.AllGroups[i].ID==sutPocStatus.LocalGroup.ID)
- {
- if(i!=0)
- {
- //#error "有时显示不出当前群组"
- snprintf(buf, sizeof(buf), "i:%d****", i);
- SlwTrace(INF, buf, 1);
- sutPocStatus.AllGroups[i].ID = sutPocStatus.AllGroups[0].ID;
- memcpy(sutPocStatus.AllGroups[i].name,sutPocStatus.AllGroups[0].name,sizeof(sutPocStatus.AllGroups[0].name));
- sutPocStatus.AllGroups[i].usernum=sutPocStatus.AllGroups[0].usernum;
- sutPocStatus.AllGroups[0].ID=sutPocStatus.LocalGroup.ID;
- memcpy(sutPocStatus.AllGroups[0].name,sutPocStatus.LocalGroup.name,sizeof(sutPocStatus.LocalGroup.name));
- sutPocStatus.AllGroups[0].usernum=sutPocStatus.LocalGroup.usernum;
- }
- i=sutPocStatus.GroupsNum;
- }
- }
- for(i=0;i<sutPocStatus.GroupsNum && i<POC_ALL_GROUPS_NUM;i++)
- {//select icon
- //设置Features 将决定选择图标
- if(sutPocStatus.AllGroups[i].ID==sutPocStatus.LocalGroup.ID)GroupsFeatures[i]=1;
- //添加名字列表指针
- GroupsName[i]=sutPocStatus.AllGroups[i].name;
- }
- #else
- for(i=0;i<sutPocStatus.GroupsNum && i<POC_ALL_GROUPS_NUM;i++){
- //设置Features 将决定选择图标
- if(sutPocStatus.AllGroups[i].ID==sutPocStatus.LocalGroup.ID)GroupsFeatures[i]=1;
- //添加名字列表指针
- GroupsName[i]=sutPocStatus.AllGroups[i].name;
- }
- #endif
- //初始化ListBox控件
- ListBoxInit(&sutListBox,GroupsName,0,accIconFileName,GroupsFeatures);
- //----------------------------
- GuiDrawHLine(0,159,104,1);
- return;
- }
- //按键提示
- if(susCt==0){
- GuiShowStr(0,110,"[上]选择 [下]选择 ",0x01);
- }else if(susCt==200){
- GuiShowStr(0,110,"[M]确定 [EXIT]退出",0x01);
- }
- if(++susCt>=400)susCt=0;
- }
- void ReFlashItem(void)
- {
- //char buf[100];
- static unsigned short susCt=0;
- static const char *accIconFileName[]={
- "people2.bmp",
- "people2.bmp",
- "people1.bmp",
- ""
- };
- int i;
- unsigned short timeout;
- static char NullUser=0;
- static char *UsersName[POC_ALL_USERS_NUM+1]; //5
- static char UserFeatures[POC_ALL_USERS_NUM+1];//5
- //----------------------------
- for(i=0;i<=POC_ALL_USERS_NUM;i++){
- UsersName[i]=&NullUser;
- UserFeatures[i]=0;
- }
- for(i=0;i<sutPocStatus.FillUserIndex;i++)
- {
- UserFeatures[i]=sutPocStatus.AllUsers[i].status-1;
- UsersName[i]=sutPocStatus.AllUsers[i].name;
- }
- if(sutPocStatus.UserOnLineNum==0)
- {
- UsersName[0]="空";
- UserFeatures[i]=0;
- }
- //初始化ListBox控件
- ListBoxInit(&sutListBox,UsersName,0,accIconFileName,UserFeatures);
- }
- /******************************************************
- UIShowUserSel
- 用户选择
- *******************************************************/
- void UIShowUserSel(int update)
- {
- static unsigned short susCt=0;
- unsigned short timeout;
-
- if(update){
- if(sutPocStatus.Logined == 0)//not login
- {
- ShowMessageBox(" 请先登录... ");
- timeout=50;
- while(timeout--)
- OsDelayTime(1);
- UISetNextStatus(UIS_STANDBY);
- return;
- }
- SimpleUserInfoScan(1, 1);
- susCt=0;
- GuiClearAll();
- ShowCaption("用户选择",1); //0
- GuiDrawHLine(0,159,20,1);
- ReFlashItem();
- GuiDrawHLine(0,159,104,1);
- return;
- }
-
- //按键提示
- if(susCt==0){
- GuiShowStr(0,110,"[上]选择 [下]选择",0x01);
- }else if(susCt==200){
- GuiShowStr(0,110,"[M]单呼 [EXIT]退出",0x01);
- }
- if(++susCt>=400)susCt=0;
- }
- /******************************************************
- UIShowInformation
- 用户选择
- *******************************************************/
- void UIShowInformation(int update)
- {
- u16 x,y;
- char temp[11];
- char buf[50];
- static unsigned char flag=0;
- if(update)
- {
- flag=0;
- GuiClearAll();
- ShowCaption("终端信息",1); //0
- GuiDrawHLine(0,159,20,1);
- }
- x=2,y=22;
- if(KEY_PANEL_UP==g_ulKeyValue ||
- KEY_PANEL_DOWN==g_ulKeyValue ||
- update)
- {
- g_ulKeyValue = 0;
- if(flag==0 || flag==2)
- {//显示PSN
- GuiClearRect(0,y,LCD_WIDTH-1,LCD_HEIGHT-1);
- //终端型号
- snprintf(buf, sizeof(buf),"终端型号:%s",sutProductPara.ProductName);
- GuiShowStr(x,y,buf,0x01);
- y+=20;
- //终端编码
- snprintf(buf, sizeof(buf),"终端编码:%lu",sutProductPara.PSN);
- GuiShowStr(x,y,buf,0x01);
- y+=20;
- //应用版本号
- snprintf(buf, sizeof(buf),"应用版本:V%d",sutProductPara.ProductVersion);
- GuiShowStr(x,y,buf,0x01);
- y+=20;
- //模块版本号
- snprintf(buf, sizeof(buf),"模块版本:L%d",g_iModemVer);
- GuiShowStr(x,y,buf,0x01);
- y+=20;
- //对讲版本号
- snprintf(buf, sizeof(buf),"对讲版本:V%d",g_iPocVer);
- GuiShowStr(x,y,buf,0x01);
- flag=1;
- }else if(flag==1)
- {
- GuiClearRect(0,y,LCD_WIDTH-1,LCD_HEIGHT-1);
- //校验码
- temp[0]=0;
- GetCheckCodeByPsnMEID(temp,sutProductPara.PSN,sutProductPara.HARDID);
- snprintf(buf, sizeof(buf),"校验码:%s",temp);
- GuiShowStr(x,y,buf,0x01);
- y+=20;
- //
- memset(buf,sizeof(buf),0);
- if(support_type==Un_Known) snprintf(buf,sizeof(buf),"模块类型:未知");
- else if(support_type==ONLY_Telecom) snprintf(buf,sizeof(buf),"模块类型:单电信版");
- else if(support_type==Mobile_unicom) snprintf(buf,sizeof(buf),"模块类型:移动联通版");
- else if(support_type==All_Netcom) snprintf(buf,sizeof(buf),"模块类型:全网通版");
- //snprintf(buf, sizeof(buf),"模块类型:%s",buf);
- GuiShowStr(x,y,buf,0x01);
- flag=2;
- }
- }else if(KEY_OK_DOWN_GPS == g_ulKeyValue)
- {
- g_ulKeyValue=0;
- if(flag==1 || flag==2)
- {
- //显示IP
- GuiClearRect(0,y,LCD_WIDTH-1,LCD_HEIGHT-1);
- //交换IP
- GuiShowStr(x,y,"交换服务器:",0x01);
- y+= 20;
- snprintf(buf, sizeof(buf),"%s",sutProductPara.PIP);
- GuiShowStr(x,y,buf,0x01);
- y+=20;
- //GPS IP
- GuiShowStr(x,y,"北斗服务器:",0x01);
- y+= 20;
- snprintf(buf, sizeof(buf),"%s",sutProductPara.GIP);
- GuiShowStr(x,y,buf,0x01);
- y+=20;
- snprintf(buf, sizeof(buf),"PORT:%d",sutProductPara.GpsPort);
- GuiShowStr(x,y,buf,1);
- flag=0;
- }
- }
- }
- /******************************************************
- UI_Loop
- UI循环调用,需要在MainTask的主循环中持续调用,及时处理状态发生变化时的UI显示
- 此处按下OK键显示里面内容
- *******************************************************/
- void UI_Loop(void)
- {
-
- int StatusUpdate;
- if(fota_update.NewPocFlag==1)
- {
- //显示正在升级;
- UISetNextStatus(UIS_UPDATA_SHOW);
- }
-
- if(sutUIstatus.Status!=sutUIstatus.NextStatus){//状态发生变更
- sutUIstatus.LastStatus=sutUIstatus.Status;
- sutUIstatus.Status=sutUIstatus.NextStatus;
- StatusUpdate=1;
- }else{//状态没有发生变更
- StatusUpdate=0;
- }
- switch(sutUIstatus.Status){
- case UIS_STANDBY:
- 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_CALL_PHONE:
- CallPhoneShow(StatusUpdate);
- break;
- case UIS_CALL_PHONE_OPTION:
- CallPhoneOptionShow(StatusUpdate);
- break;
- case UIS_CALL_PHONE_INPUT:
- CallPhoneInputNumShow(StatusUpdate);
- break;
- case UIS_CALL_PHONE_MODIFY:
- CallPhoneInputNewNumShow(StatusUpdate);
- break;
- case UIS_CALL_PHONE_DELETE:
- CallPhoneDeleteNumShow(StatusUpdate);
- //CallPhoneInputNewNumShow(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_NET:
- SetNetShow(StatusUpdate);
- break;
- ///////////////////////////
- case UIS_UP_APPRICATION_VER:
- SetUpAppricationVerShow(StatusUpdate);
- break;
- case UIS_UP_APP_PENDING:
- SetUpAppricationVerPending();
- break;
- case UIS_UP_INTERCOM_VER:
- SetUpIntercomVerShow(StatusUpdate);
- break;
- case UIS_UPDATA_SHOW:
- Fota_Update_Show(StatusUpdate);
- break;
- // case UIS_SERVER_SHOW:
- //
- // SetServerShow(StatusUpdate);
- // break;
- case UIS_SET_KEYSound:
- SetKeySoundShow(StatusUpdate);
- break;
-
- case UIS_SET_SOUNDMODE:
- SetSoundModeShow(StatusUpdate);
- break;
- case UIS_SET_QUICK_GROUP:
- SetQuickGroupShow(StatusUpdate);
- break;
-
-
- }
- }
- /******************************************************
- UI_Key
- 按键处理
- *******************************************************/
- void UI_Key(void)
- {
- char buf[100];
- unsigned long key;
- int i,temp;
- static unsigned char lastOption=0;//向下
- switch(sutUIstatus.Status){
- case UIS_STANDBY://----待机界面---
- switch(g_ulKeyValue){
- case KEY_PANEL_MENU:
- if(m_GroupSwitch==0)
- UISetNextStatus(UIS_MENU_MAIN);
- break;
- case KEY_PANEL_EXIT:
- UISetNextStatus(UIS_MAIL_BOX);
- break;
- // case KEY_PANEL_P1:
- // UISetNextStatus(UIS_MENU_GROUP_SEL);
- // break;
- // case KEY_PANEL_P2:
- // UISetNextStatus(UIS_MENU_USER_SEL);
- // break;
- // case KEY_PANEL_P3:
- // UISetNextStatus(UIS_CALL_PHONE);//UIS_CALL_PHONE_INPUT
- // break;
-
- }
- break;
- case UIS_MENU_MAIN://----主菜单----
- key=MenuResponse(&sutMenuMain);
- if(KEY_PANEL_MENU==key){
- switch(sutMenuMain.handle){
- case 0://群组选择
- UISetNextStatus(UIS_MENU_GROUP_SEL);
- break;
- case 1://成员选择
- UISetNextStatus(UIS_MENU_USER_SEL);
- break;
- case 2://信箱查阅
- UISetNextStatus(UIS_MAIL_BOX);
- break;
- #if 0
- case 3://电话管理
- UISetNextStatus(UIS_CALL_PHONE);//UIS_CALL_PHONE_INPUT UIS_CALL_PHONE
- break;
- case 4://系统设置
- UISetNextStatus(UIS_MENU_SYS_SET);
- break;
- case 5://终端信息
- UISetNextStatus(UIS_MENU_INFO);
- break;
- #else
- case 3://系统设置
- UISetNextStatus(UIS_MENU_SYS_SET);
- break;
- case 4://终端信息
- UISetNextStatus(UIS_MENU_INFO);
- break;
- #endif
- }
- }
- // else if(KEY_PANEL_MENU==key){
- // UISetNextStatus(UIS_STANDBY);
- // }
- else if(KEY_PANEL_EXIT==key){
- UISetNextStatus(UIS_STANDBY);
- }
- break;
- case UIS_MENU_GROUP_SEL://-----群组选择-----
- key=ListBoxResponse(&sutListBox);
-
- if(!QuickGroupSelect){
- if(KEY_PANEL_EXIT==key)UISetNextStatus(sutUIstatus.LastStatus);
-
- //else if(KEY_PANEL_MENU==key)UISetNextStatus(UIS_MENU_MAIN);
- else if(KEY_PANEL_MENU==key){
- //进入群组AT+POC=09000000000001
- snprintf(buf, sizeof(buf),"AT+POC=090000%08x\r\n",sutPocStatus.AllGroups[sutListBox.handle].ID);
- g_ucEnterGroupFlag=1;
- //保存name
- for(i=0;i <sizeof(sutPocStatus.AllGroups[sutListBox.handle].name);i++) //strlen你就悲剧了
- g_cGroupName[i] = sutPocStatus.AllGroups[sutListBox.handle].name[i];
- g_ulGroupID=sutPocStatus.AllGroups[sutListBox.handle].ID;
- ModemSendAT((u8 *)buf);
-
- UISetNextStatus(UIS_STANDBY);
- ////////////////////////////
- //防止当优先级高的群组用户讲话,当前机子从同群组切到默认组时,出现一直显示播报却没有声音的问题
- //逻辑应该是切换了群组就得重新拉才有播报
- sutPocStatus.Speaker=0;
- SpeakerDisable();
- ////////////////////////////
- }
- }else {
-
- if(KEY_PANEL_EXIT==key)UISetNextStatus(UIS_SET_QUICK_GROUP);
- //else if(KEY_PANEL_MENU==key)UISetNextStatus(UIS_MENU_MAIN);
- else if(KEY_PANEL_MENU==key){
- sutProductPara.QuickGroupId[QuickGrouPIndex]=sutPocStatus.AllGroups[sutListBox.handle].ID;
- UISetNextStatus(UIS_SET_QUICK_GROUP);
- }
-
- }
- break;
- case UIS_MENU_USER_SEL://-----成员选择-----
- if(sutListBox.handle==0 && KEY_PANEL_UP==g_ulKeyValue)
- {
- if(sutPocStatus.handleIndex >=5) sutPocStatus.handleIndex -=5;
- else if(sutPocStatus.handleIndex==0) sutPocStatus.handleIndex=sutPocStatus.UserOnLineNum-1;
- SimpleUserInfoScan(0,0);
- ReFlashItem();//指针会被重置到0位置
- lastOption=1;
- //reload up
- break;
- }else if((sutListBox.handle+1) == sutListBox.itemnum && (KEY_PANEL_DOWN==g_ulKeyValue))
- {
- if(lastOption)
- {
- sutPocStatus.handleIndex += sutListBox.itemnum;
- }
- if(sutPocStatus.handleIndex+1>=sutPocStatus.UserOnLineNum) sutPocStatus.handleIndex=0;
- SimpleUserInfoScan(0,1);
- ReFlashItem();//指针会被重置到0位置
- lastOption=0;
- //reload down
- break;
- }
- key=ListBoxResponse(&sutListBox);
- if(KEY_PANEL_EXIT==g_ulKeyValue)
- {
- lastOption=0;
- UISetNextStatus(sutUIstatus.LastStatus);
- }
- // else if(KEY_PANEL_MENU==g_ulKeyValue)
- // {
- // lastOption=0;
- // UISetNextStatus(UIS_MENU_MAIN);
- // }
- else if(KEY_PANEL_MENU==key){
- //单呼成员 AT+POC=AT+POC=0A0000xxxxxxxx
- ///////////////////////////////////////
- if(0 == sutPocStatus.UserOnLineNum)
- {
- // sprintf(buf, "无法呼叫自己");
- // ShowMessageBox(buf);
- // OsDelayTime(200);
- // UISetNextStatus(sutUIstatus.LastStatus);
- break;
- }
- ///////////////////////////////////////
- snprintf(buf, sizeof(buf),"AT+POC=0A0000%08x\r\n",sutPocStatus.AllUsers[sutListBox.handle].ID);
- ModemSendAT(buf);
- snprintf(buf, sizeof(buf),"呼叫:%s",sutPocStatus.AllUsers[sutListBox.handle].name);
- ShowMessageBox(buf);
- OsDelayTime(200);
- UISetNextStatus(UIS_STANDBY);
- }
- break;
- case UIS_MAIL_BOX://-----短信查阅-----
- MessageResponse();
- break;
- case UIS_CALL_PHONE://-----电话管理----
- CallPhoneResponse();
- break;
- case UIS_MENU_SYS_SET://-----系统设置-----
- SetSYSResponse(); //名字没取好,实际上是系统
- break;
- case UIS_MENU_INFO://-----终端信息-----
- if(KEY_PANEL_EXIT==g_ulKeyValue){
- UISetNextStatus(sutUIstatus.LastStatus);//UIS_STANDBY
- }
- //else if(KEY_PANEL_MENU==g_ulKeyValue)UISetNextStatus(UIS_MENU_MAIN);
- break;
- case UIS_CALL_PHONE_OPTION:
- CallPhoneOptionResponse();
- break;
- case UIS_CALL_PHONE_INPUT: //-----电话设置----
- CallPhoneInputNumResponse();
- break;
- case UIS_CALL_PHONE_MODIFY:
- CallPhoneInputNewNumResponse();
- break;
- case UIS_CALL_PHONE_DELETE:
- CallPhoneInputDeleNumResponse();
- break;
- case UIS_MESSAGE_OPTION:
- MessageOptionResponse();
- break;
- case UIS_MESSAGE_READ:
- MessageReadResponse();
- break;
- case UIS_MESSAGE_FORMAT:
- MessageFormatResponse();
- break;
- case UIS_CALL_TO_PHONE:
- CallToPhoneNumResponse();
- 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_NET:
- SetNetResponse();
- break;
- //////////////////////////////////
- case UIS_UP_APPRICATION_VER:
- SetUpAppricationVerResponse();
- break;
- case UIS_UP_INTERCOM_VER:
- SetUpIntercomVerResponse();
- break;
- // case UIS_SERVER_SHOW:
- // SetServerSelResponse();
- // break;
- case UIS_SET_KEYSound:
- SetKeysoundResponse();
- break;
- case UIS_SET_SOUNDMODE:
- SetSoundModeResponse();
- break;
- case UIS_SET_QUICK_GROUP:
- SetQuickGroupResponse();
- break;
-
- default:
- break;
-
- }
- }
- /******************************************************
- UISetNextStatus
- 设置下一个UI状态
- *******************************************************/
- void UISetNextStatus(unsigned char status)
- {
- sutUIstatus.LastStatus=sutUIstatus.NextStatus;
- sutUIstatus.NextStatus=status;
- }
- /******************************************************
- 显示开机动画
- 完整图片 尺寸
- logo.bmp 100*59
- 子图片 与主图片坐标偏移
- logo-down 2,42
- logo-g 38,25
- logo-h 4,10
- logo-i 29,19
- logo-o 59,25
- logo-s 77,25
- logo-up 2,0
- *******************************************************/
- void ShowBootAnimation(void)
- {
- int i;
- int x,y;
- int w,h;
- x=30;y=34;//最终整张logo图片的位置
- w=100;h=59;//整张图片的尺寸
- LCD_BL_HIGH; //改正用户体验
- KEY_LED(1);
- #if 0
- GuiDrawBmpMoving(x+38,0,x+38,y+25,"logo-g.bmp",5);//从上往下移动
- GuiDrawBmpMoving(0,y+19,x+29,y+19,"logo-i.bmp",5);//从左往右
- GuiShowBmp(x+38,y+25,"logo-g.bmp");
- GuiDrawBmpMoving(159-19,y+25,x+59,y+25,"logo-o.bmp",5);//从右往左
- GuiDrawBmpMoving(0,y+10,x+4,y+10,"logo-h.bmp",5);//从左往右
- GuiShowBmp(x+29,y+19,"logo-i.bmp");
- GuiShowBmp(x+38,y+25,"logo-g.bmp");
- IWDG_ReloadCounter();//
- GuiDrawBmpMoving(159-19,y+25,x+77,y+25,"logo-s.bmp",5);//从右往左
- GuiDrawBmpMoving(0,0,x+2,y+0,"logo-up.bmp",5);//从上往下
- GuiDrawBmpMoving(159-98,127-17,x+2,y+42,"logo-down.bmp",5);//从下往上
- GuiShowBmp(x,y,"logo.bmp");
- #else
- GuiClearAll();
- GuiShowBmp(0,0,"welcome.bmp");
- for(i=0;i<400000;i++)
- {
- if(i%100==0) IWDG_ReloadCounter();
- }
- #endif
- ///////////////////////////////////
- // LCD_BL_HIGH;
- // sutLcdParam.OnTimeCt=0;
- }
- /***********************************
- 显示信号状态
- **********************************/
- void ShowSingle(int CSQ)
- {
- if(sutGpsStatus.PPPStatus == OPEN) GuiShowBmp(0,0+2,"SingleOK.bmp");
- else GuiShowBmp(0,0+2,"Single.bmp");
- if(CSQ<1 || CSQ==99){
- GuiClearRect(7,4,21,14);
- }else if(CSQ<8){
- GuiDrawVLine(12,14,7,2,COLOR_DEFAULT_BLUE);
- GuiClearRect(11,4,21,14);
- }else if(CSQ<16){
- GuiDrawVLine(12,14,7,2,COLOR_DEFAULT_BLUE);
- GuiDrawVLine(9,14,11,2,COLOR_DEFAULT_BLUE);
- GuiClearRect(15,4,21,14);
- }else if(CSQ<22){
- GuiDrawVLine(12,14,7,2,COLOR_DEFAULT_BLUE);
- GuiDrawVLine(9,14,11,2,COLOR_DEFAULT_BLUE);
- GuiDrawVLine(7,14,15,2,COLOR_DEFAULT_BLUE);
- GuiClearRect(19,4,21,14);
- }else{
- GuiDrawVLine(12,14,7,2,COLOR_DEFAULT_BLUE);
- GuiDrawVLine(9,14,11,2,COLOR_DEFAULT_BLUE);
- GuiDrawVLine(7,14,15,2,COLOR_DEFAULT_BLUE);
- GuiDrawVLine(4,14,19,2,COLOR_DEFAULT_BLUE);
- }
- //2G-4G 显示
- //GuiShowBmp(28,5,"2g.bmp");
-
-
-
- }
- /************************************************************************
- 显示电量
- *************************************************************************/
- void ShowBatttery(int bat)
- {
- static unsigned int flashCnt=0;
- static unsigned char flag=0;
- int x=46;
-
- if(bat<WARN_PWR_LEVEL){//请充电
- if(os_time_get()< flashCnt) return;
- flashCnt=os_time_get()+80;
- if(flag==0)
- {
- GuiShowBmp(x+41,3,"VBAT1.bmp");
- flag=1;
- }else{
- flag=0;
- GuiClearRect(x+41,3,x+41+27,3+12);
- }
- //GuiDrawVLine(5,12,64+x,2,COLOR_WARN_RED);
- }
- else if(bat<355){//340<x<=355 1格
- GuiShowBmp(x+41,3,"VBAT1.bmp");
- GuiDrawVLine(5,12,62+x,4,COLOR_DEFAULT_BLUE);
- }
- else if(bat<375){//355<x<=375 2格
- GuiShowBmp(x+41,3,"VBAT1.bmp");
- GuiDrawVLine(5,12,57+x,4,COLOR_DEFAULT_BLUE);
- GuiDrawVLine(5,12,62+x,4,COLOR_DEFAULT_BLUE);
- }
- else if(bat<400){//375<x<=400 3格
- GuiShowBmp(x+41,3,"VBAT1.bmp");
- GuiDrawVLine(5,12,52+x,4,COLOR_DEFAULT_BLUE);
- GuiDrawVLine(5,12,57+x,4,COLOR_DEFAULT_BLUE);
- GuiDrawVLine(5,12,62+x,4,COLOR_DEFAULT_BLUE);
- }
- else{//>=400 4格
- GuiShowBmp(x+41,3,"VBAT1.bmp");
- GuiDrawVLine(5,12,47+x,4,COLOR_DEFAULT_BLUE);
- GuiDrawVLine(5,12,52+x,4,COLOR_DEFAULT_BLUE);
- GuiDrawVLine(5,12,57+x,4,COLOR_DEFAULT_BLUE);
- GuiDrawVLine(5,12,62+x,4,COLOR_DEFAULT_BLUE);
- }
- }
- void ShowTime(void)
- {
- static unsigned char TimeReNewCount;
- static int lastS;
- int time,h,m,s;
-
- char buf[30];
- if(sutPocStatus.FirstLogined==0) return;
- time = RTC_GetCounter();
- h = time/3600%24;
- m = (time%3600)/60;
- s=0;
- if(TimeFlag)
- {
- s = (time%3600)%60;
- if(lastS!=s)
- {
- g_usModeSTime++;
- if(g_usModeSTime>=60)
- {
- g_usModeSTime=0;
- g_usModeMTime++;
- if(sutPocStatus.Logined)
- {
- if(++TimeReNewCount>=5)
- {//每5分钟获取最新时间
- TimeReNewCount=0;
- TimeFlag=0;
- }
- }
- }
- if(g_usModeMTime>=60)
- {
- g_usModeMTime=0;
- g_usModeHTime++;
- }
- if(g_usModeHTime>=24)
- g_usModeHTime=0;
- }
- }else
- {//CDMA没登陆时使用本地时间,一开机就能显示
- s = time%60;
- g_usModeHTime = h;
- g_usModeMTime = m;
- g_usModeSTime = s;
- }
- if(lastS!=s){
- lastS=s;
- snprintf(buf, sizeof(buf),"%02d:%02d",g_usModeHTime,g_usModeMTime);//-02d"g_usModeMTime,g_usModeSTime
- GuiShowStr(118,0,buf,0x01);
- }
- }
- #if 0
- void ShowGPSICon(void)
- {
- GuiClearRect(30,0,50,20);//30
- if(0== sutGpsInfo.isGpsWork) GuiClearRect(30,0,50,20);//未工作或未检测到
- else
- {//GPS已工作
- if(0 == sutGpsInfo.isGpsValid)
- {//未定位
- if(sutGpsInfo.isGpsAuthOk==0)//未鉴权
- {
- GuiShowBmp(36,0,"GPS1.bmp");
- }else//已鉴权
- {
- GuiShowBmp(36,0,"GPSA.bmp");//已鉴权
- }
- }else
- {//已定位
- if(sutGpsInfo.isGpsAuthOk==0)//未鉴权
- {
- GuiShowBmp(36,0,"GPS1.bmp");
- }else//已鉴权
- {
- GuiShowBmp(36,0,"GPSA.bmp");//已鉴权
- }
- GuiShowBmp(36+10-2,0+2,"GPS2.bmp");//定位辐射放最后
- }
- }
- }
- #else
- void ShowGPSICon(void)
- {
- GuiClearRect(45,0,50,20);//30
- if(0== sutGpsInfo.isGpsWork) GuiClearRect(45,0,75,20);//未工作或未检测到
- else
- {
- //GuiShowBmp(28,0,"3g.bmp");
-
- //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-2,0+2,"GPS2.bmp");//定位辐射放最后
- }
- }
- }
- #endif
- /************************************************************************
- ShowStatusBar
- 显示状态栏
- *************************************************************************/
- void ShowStatusBar(int Update)
- {
- 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 unsigned int s_netshowvalue;
- if(Update){
- GuiClearRect(0,0,159,15);
- siCSQ=g_iCSQ;
- ShowSingle(g_iCSQ);
- siVbat=g_iVbat;
- ShowGPSICon();
- ShowBatttery(g_iVbat);
- ShowMessageFlag(1);
- ShowTime();
- s_netshowvalue=netshowvalue;
- Show_Net(s_netshowvalue);
- return;
- }
- //2G-4G显示
- if(s_netshowvalue!=netshowvalue){
- s_netshowvalue=netshowvalue;
- Show_Net(s_netshowvalue);
- }
-
- //信号显示
- if(siCSQ!=g_iCSQ || lastPPPStatus != sutGpsStatus.PPPStatus){
- lastPPPStatus=sutGpsStatus.PPPStatus;
- siCSQ=g_iCSQ;
- ShowSingle(g_iCSQ);
- }
-
- if(batFirstShow < 100)
- {//开机大概前1秒显示50%电量,之后根据实际显示
- g_iVbat=360;
- batFirstShow++;
- }
- //电量显示
- if(siVbat!=g_iVbat || g_iVbat < WARN_PWR_LEVEL){
- siVbat=g_iVbat;
- 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();
- }
- void ShowMessageBox(char *msg)
- {
- char buf[10];
- u16 len,x,y;
-
- y=LCD_HEIGHT/2;
- GuiClearRect(0,y-20,159,y+20);
- GuiDrawRect(2,y-18,157,y+18,1);
- StrIntercept(buf,msg,18);
- len=GetStrXLen(buf);
- x=(LCD_WIDTH-len)/2;
- GuiShowStr(x,y-8,buf,0x01);
- }
- void ShowNumBox(unsigned short msg)
- {
- char buf[10];
- u16 len,x,y;
-
- y=LCD_HEIGHT/2; //中间
- GuiClearRect(0,y-20,159,y+20);
- //GuiDrawRect(2,y-6,157,y+16,1); //上面显示要修改的号码 下面显示文字
- GuiDrawRect(2,y-6,130,y+16,1);
- // StrIntercept(buf,(char *)msg,18);
- snprintf(buf, sizeof(buf),"%u",msg);
- len=GetStrXLen(buf);
- //x=(LCD_WIDTH-len)/2;
- GuiShowStr(4,y,buf,0x01);
- }
- /************************************************************************
- ShowButton
- 显示一个按钮
- *************************************************************************/
- void ShowButton(u16 x,u16 y,const char *str)
- {
- int len;
- len=GetStrXLen((char *)str);
- GuiClearRect(x,y,x+len+8,y+20);
- GuiShowStr(x+4,y+2,str,0x01);
- GuiReverseRect(x,y,(x+len+8),(y+16+4));
- }
- void Show_Net(unsigned int s_netshowvalue)
- {
-
- if(s_netshowvalue==2||s_netshowvalue==3){
- GuiShowBmp(24,2,"2g.bmp");
- }else if(s_netshowvalue==4||s_netshowvalue==5||s_netshowvalue==8){
-
- GuiShowBmp(24,2,"3g.bmp");
- }else if(s_netshowvalue==9){
- GuiShowBmp(24,2,"4g.bmp");
- }else {
-
- GuiClearRect(24,2,45,20);
- }
-
-
- }
|