uiBlock.c 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037
  1. #include "includes.h"
  2. /****************************状态栏显示部分开始***********************************/
  3. //#ifndef USE_HPOC_POC
  4. //
  5. //unsigned char AscToHex(unsigned char aHex)
  6. //{
  7. // if((aHex>=0)&&(aHex<=9))
  8. // aHex += 0x30;
  9. // else if((aHex>=10)&&(aHex<=15))//A-F
  10. // aHex += 0x37;
  11. // aHex += 0x57;
  12. // else aHex = 0xff;
  13. // return aHex;
  14. //}
  15. //
  16. //
  17. //void AscStrTurnHexStr(char *AscStr, char *HexStr)
  18. //{
  19. // char *pAscStr=AscStr;
  20. // unsigned char d,h,l;
  21. // while(0!=(d=(unsigned char)*pAscStr++)){
  22. // l=d&0x0f;
  23. // h=d>>4;
  24. // *HexStr++=AscToHex(h);
  25. // *HexStr++=AscToHex(l);
  26. // }
  27. // *HexStr=0;
  28. //}
  29. //#endif
  30. //显示信号强度
  31. static void ShowSingle(int CSQ){
  32. unsigned short x=SIGNAL_ICON_X;
  33. unsigned short y=2;
  34. if(sutApp.pocPpp == 0) guiShowBmp(x,y,"Single.bmp");
  35. else guiShowBmp(x,y,"SingleOK.bmp");
  36. //11 3格
  37. x += 7;
  38. if(CSQ<1 || CSQ==99){
  39. guiClearRect(x,y+1,x+10,y+9,COLOR_STATUS_BAR);
  40. }else if(CSQ<8){
  41. guiDrawVLine(x+2,y+8,x,y,guiGetBackColor());
  42. guiClearRect(x+2,y+1,x+10,y+9,COLOR_STATUS_BAR);
  43. }else if(CSQ<16){
  44. guiDrawVLine(x+2,y+8,x,y,guiGetBackColor());
  45. guiDrawVLine(x,y+8,x+3,y,guiGetBackColor());
  46. guiClearRect(x+6,y+1,x+10,y+9,COLOR_STATUS_BAR);
  47. }else if(CSQ<22){
  48. guiDrawVLine(x+2,y+8,x,y,guiGetBackColor());
  49. guiDrawVLine(x,y+8,x+3,y,guiGetBackColor());
  50. guiDrawVLine(x-2,y+8,x+6,y,guiGetBackColor());
  51. guiClearRect(x+9,y+1,x+10,y+9,COLOR_STATUS_BAR);
  52. }else{
  53. guiDrawVLine(x+2,y+8,x,y,guiGetBackColor());
  54. guiDrawVLine(x,y+8,x+3,y,guiGetBackColor());
  55. guiDrawVLine(x-2,y+8,x+6,y,guiGetBackColor());
  56. guiDrawVLine(x-4,y+8,x+9,y,guiGetBackColor());
  57. }
  58. #if 0
  59. if(CSQ<1 || CSQ==99){
  60. guiClearRect(7,3,21,11,COLOR_STATUS_BAR);
  61. }else if(CSQ<8){
  62. guiDrawVLine(9,10,7,2,guiGetBackColor());
  63. guiClearRect(9,3,21,11,COLOR_STATUS_BAR);
  64. }else if(CSQ<16){
  65. guiDrawVLine(9,10,7,2,guiGetBackColor());
  66. guiDrawVLine(7,10,10,2,guiGetBackColor());
  67. guiClearRect(13,3,21,11,COLOR_STATUS_BAR);
  68. }else if(CSQ<22){
  69. guiDrawVLine(9,10,7,2,guiGetBackColor());
  70. guiDrawVLine(7,10,10,2,guiGetBackColor());
  71. guiDrawVLine(5,10,13,2,guiGetBackColor());
  72. guiClearRect(16,3,21,11,COLOR_STATUS_BAR);
  73. }else{
  74. guiDrawVLine(9,10,7,2,guiGetBackColor());
  75. guiDrawVLine(7,10,10,2,guiGetBackColor());
  76. guiDrawVLine(5,10,13,2,guiGetBackColor());
  77. guiDrawVLine(3,10,16,2,guiGetBackColor());
  78. }
  79. #endif
  80. }
  81. unsigned char netshowvalue=0xff;
  82. unsigned char ctecCurrentSet=0;
  83. //显示网络制式
  84. static void Show_Net(unsigned char s_netshowvalue){
  85. unsigned short y=0;
  86. if(s_netshowvalue==0){
  87. guiShowStr(NET_ICON_X, y+1,"2G", FONT_MODE_12X12, REVERSED_NO,guiGetBackColor(),COLOR_STATUS_BAR);
  88. }else if(s_netshowvalue==4){
  89. if(sutApp.UserInfo.tnet==5)guiShowStr(NET_ICON_X, y+1,"5G", FONT_MODE_12X12, REVERSED_NO,guiGetBackColor(),COLOR_STATUS_BAR);
  90. else guiShowStr(NET_ICON_X, y+1,"4G", FONT_MODE_12X12, REVERSED_NO,guiGetBackColor(),COLOR_STATUS_BAR);
  91. }else guiClearRect(NET_ICON_X,y,NET_ICON_X+NET_ICON_WX,y+11,COLOR_STATUS_BAR);
  92. }
  93. static void gpsIconShow(char flash){
  94. typedef struct{
  95. unsigned char located:1;
  96. unsigned char gpsF:1;
  97. }TMP_GPS_DEF;
  98. static TMP_GPS_DEF tmpGps;
  99. unsigned short x=GPS_ICON_X,y=0;
  100. if(tmpGps.located==sutGpsInfo.isGpsValid && tmpGps.gpsF==sutGpsInfo.isGpsWork && flash==0) return;
  101. guiClearRect(x,y,x+GPS_ICON_WX,y+11,COLOR_STATUS_BAR);
  102. if(sutGpsInfo.isGpsWork==0){//GPS未打开时
  103. guiClearRect(x,y,x+GPS_ICON_WX,y+11,COLOR_STATUS_BAR);
  104. }else{//GPS已打开
  105. guiShowBmp(x,y,"GPSA.bmp");
  106. if(sutGpsInfo.isGpsValid==1) guiShowBmp(x+10,y,"GPS2.bmp");//已定位
  107. }
  108. tmpGps.located=sutGpsInfo.isGpsValid;
  109. tmpGps.gpsF=sutGpsInfo.isGpsWork;
  110. }
  111. static void ShowCardType(char card){
  112. unsigned short x= CARD_ICON_X;
  113. unsigned short y=3;
  114. if(card==0) guiShowBmp(x, y, "SIM1.bmp");
  115. else if(card==1) guiShowBmp(x, y, "SIM2.bmp");
  116. }
  117. //显示电量
  118. static void ShowBatttery(int bat,unsigned int exeInterval){
  119. static unsigned int flashCnt=0;
  120. static unsigned char flag=0;
  121. static unsigned short cnt=0;
  122. unsigned short x=BAT_ICON_X,y=2,h=y+2;
  123. if(bat<WARN_PWR_LEVEL){//请充电
  124. if(++cnt<(800/exeInterval)) return;
  125. cnt=0;
  126. if(sutApp.lowPwrWarn==0){
  127. sutApp.lowPwrWarn=1;
  128. sutApp.lowPwrCnt=WARN_TTS_INTERVAL;
  129. }
  130. if(flag==0){
  131. guiShowBmp(x,y,"VBAT1.bmp");
  132. flag=1;
  133. }else{
  134. flag=0;
  135. guiClearRect(x,y-2,x+21,y-2+1+12,COLOR_STATUS_BAR);
  136. }
  137. return;
  138. }else if(bat<355){//340<x<=355 1格
  139. guiShowBmp(x,y,"VBAT1.bmp");//3
  140. guiDrawVLine(h,h+5,x+16,y+1,guiGetBackColor());
  141. }
  142. else if(bat<375){//355<x<=375 2格
  143. guiShowBmp(x,y,"VBAT1.bmp");
  144. guiDrawVLine(h,h+5,x+12,y+1,guiGetBackColor());
  145. guiDrawVLine(h,h+5,x+16,y+1,guiGetBackColor());//5.12
  146. }
  147. else if(bat<400){//375<x<=400 3格
  148. guiShowBmp(x,y,"VBAT1.bmp");
  149. guiDrawVLine(h,h+5,x+8,y+1,guiGetBackColor());
  150. guiDrawVLine(h,h+5,x+12,y+1,guiGetBackColor());
  151. guiDrawVLine(h,h+5,x+16,y+1,guiGetBackColor());//5.12
  152. }
  153. else{//>=400 4格
  154. guiShowBmp(x,y,"VBAT1.bmp");
  155. guiDrawVLine(h,h+5,x+4,y+1,guiGetBackColor());
  156. guiDrawVLine(h,h+5,x+8,y+1,guiGetBackColor());
  157. guiDrawVLine(h,h+5,x+12,y+1,guiGetBackColor());
  158. guiDrawVLine(h,h+5,x+16,y+1,guiGetBackColor());//5.12
  159. }
  160. sutApp.lowPwrWarn=0;
  161. }
  162. //显示时间
  163. static void ShowTime(char flash,unsigned int exeInterval){
  164. static unsigned short nextExe=0;
  165. static unsigned char flag=0;
  166. MY_CLOCK myclock;
  167. char buf[30];
  168. //if(sutApp.bndPocDone==0)return;
  169. if(nextExe==0 || flash){
  170. ohpocGetClock(&myclock);
  171. if(flag){
  172. snprintf(buf, sizeof(buf), "%02d:%02d",myclock.hour, myclock. min);
  173. flag=0;
  174. }else{
  175. snprintf(buf, sizeof(buf), "%02d %02d",myclock.hour, myclock. min);
  176. flag=1;
  177. }
  178. guiShowStr(TIME_ICON_X, 1,buf, FONT_MODE_12X12, REVERSED_NO,guiGetBackColor(),COLOR_STATUS_BAR);
  179. }
  180. if(++nextExe>=(1000/exeInterval)) nextExe=0;
  181. }
  182. //显示耳机接入状态
  183. static void ShowEarStatus(char flash){
  184. static unsigned char lastStatus=0;
  185. if(lastStatus==sutApp.earLev && flash==0) return;
  186. if(sutApp.earLev!=0) guiShowBmp(EAR_ICON_X, 1, "ear.bmp");
  187. else guiClearRect(EAR_ICON_X, 1, EAR_ICON_X+14,1+12, COLOR_STATUS_BAR);
  188. lastStatus=sutApp.earLev;
  189. }
  190. //显示键盘锁状态
  191. static void ShowKeyLocStatus(char flash){
  192. static unsigned char lastStatus=0;
  193. if(lastStatus==sutApp.keyLock && flash==0) return;
  194. if(sutApp.keyLock!=0) guiShowBmp(LOCK_ICON_X, 1, "lock.bmp");
  195. else guiClearRect(LOCK_ICON_X, 1, LOCK_ICON_X+LOCK_ICON_WX,12, COLOR_STATUS_BAR);
  196. lastStatus=sutApp.keyLock;
  197. }
  198. //显示状态栏
  199. void uiShowStatusBar(char flash,unsigned int exeInterval){
  200. static unsigned char s_netshowvalue=0xff;
  201. static unsigned char lastPPPStatus;
  202. static int siCSQ;
  203. static int siVbat;
  204. static unsigned short batFirstShow=0;
  205. static char lastEnable=0;
  206. static char cardType=0;
  207. char tempFlash=flash;
  208. // static bnd_time_t tempDate={0};
  209. // char info[30];
  210. if(sutApp.enableKey==0) return;
  211. if(lastEnable==0){
  212. lastEnable=1;
  213. tempFlash=1;
  214. guiFillRect(0, 0, GLCD_WIDTH-1, UI_STATUS_BAR_HEIGH-1,COLOR_STATUS_BAR);//清除第一区
  215. }
  216. //显示信号
  217. if(tempFlash || siCSQ!=sutApp.g_iCSQ || lastPPPStatus != sutApp.pocPpp){
  218. lastPPPStatus=sutApp.pocPpp;
  219. siCSQ=sutApp.g_iCSQ;
  220. ShowSingle(sutApp.g_iCSQ);
  221. }
  222. //显示卡选项
  223. if(tempFlash || cardType != sutApp.simSel){
  224. cardType=sutApp.simSel;
  225. ShowCardType(cardType);
  226. }
  227. //显示2G/3G/4G
  228. if(tempFlash || s_netshowvalue!=netshowvalue){
  229. s_netshowvalue=netshowvalue;
  230. Show_Net(s_netshowvalue);
  231. }
  232. //显示GPS是否正常及鉴权情况
  233. gpsIconShow(tempFlash);
  234. //电量显示
  235. if(batFirstShow < (1000/exeInterval)) {//开机前1秒显示一半电量
  236. sutApp.g_iBAT=360;
  237. batFirstShow++;
  238. }else if(tempFlash || siVbat!=sutApp.g_iBAT || sutApp.g_iBAT < WARN_PWR_LEVEL){
  239. siVbat=sutApp.g_iBAT;
  240. ShowBatttery(sutApp.g_iBAT,exeInterval);
  241. //MSG_INFO(1, "----%d", sutApp.g_iBAT);
  242. }
  243. //文本消息显示
  244. //sutSms.haveUnRead=1;
  245. //ShowMessageFlag(0);
  246. //GPS显示
  247. //时间显示
  248. ShowTime(tempFlash,exeInterval);
  249. //显示耳机状态
  250. //ShowEarStatus(tempFlash);
  251. //显示键盘锁状态
  252. //ShowKeyLocStatus(tempFlash);
  253. }
  254. /****************************状态栏显示部分结束***********************************/
  255. /****************************待机界面显示部分开始***********************************/
  256. typedef enum{
  257. ME_NO_LOGIN,
  258. ME_NOBODY_SPEAK,
  259. ME_IAM_SPEAK,
  260. ME_SOMEBODY_SPEAK
  261. }ME_ENUM;
  262. static void uiShowGUName(int update);
  263. static void uiShowGuaDuan(unsigned char danhu);
  264. static void uiShowGroup(const char* info);
  265. static void uiShowUser(const char* info);
  266. static void uiShowHuaQuan(const char* info,char type);
  267. static void uiShowCallUserName(void);
  268. static void uiShowOffLineMessage(void);
  269. static void uiShowCopsInfo(void){
  270. char info[50];
  271. switch(sutApp.copstype){
  272. case 46000:
  273. case 46002:
  274. case 46007:
  275. snprintf(info, sizeof(info), "中国移动");
  276. break;
  277. case 46001:
  278. case 46006:
  279. snprintf(info, sizeof(info), "中国联通");
  280. break;
  281. case 46003:
  282. case 46005:
  283. case 46008:
  284. case 46009:
  285. case 46010:
  286. case 46011:
  287. snprintf(info, sizeof(info), "中国电信");
  288. break;
  289. default:snprintf(info, sizeof(info), "公网集群对讲系统");break;
  290. }
  291. guiFillRect(0, UI_STATUS_ITEM_Y, GLCD_WIDTH-1, UI_CONTENT_SHOW_Y-1, guiGetForeColor());//清除第二区
  292. guiShowCaption(0,info, UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  293. }
  294. #ifdef USE_LEFT_MOVING
  295. /*
  296. param[in] dlyInterval 间隔
  297. param[in] reset 重刷
  298. param[in] now 使能刷
  299. param[in] voice 话权
  300. */
  301. void movingShowNames(unsigned int dlyInterval,unsigned char reset, unsigned char now,unsigned char voice){
  302. const char *idleptr="空闲";
  303. const char *voiceptr="本机在讲话";
  304. const char *danhuptr="单呼模式";
  305. char *gname=danhuptr;
  306. char *voicePri=idleptr;
  307. char *uname=NULL;
  308. static unsigned int interval=0xffffff;
  309. if(sutPocStatus.logined==0) return;
  310. //if(sutPocStatus.statusChaned!=0){
  311. // sutPocStatus.statusChaned=0;
  312. // reset=1;
  313. //}
  314. if(++interval<500/dlyInterval && reset==0 && now==0) return;//0.5秒刷新一次
  315. interval=0;
  316. if(sutPocStatus.danHuStatus==0){
  317. if(sutPocStatus.LocalGroup.name[0]==0) gname=NULL;
  318. else gname=sutPocStatus.LocalGroup.name;
  319. }
  320. if(voice==0) voicePri=idleptr;
  321. else if(voice==1) voicePri=voiceptr;
  322. else voicePri=sutPocStatus.CallName;
  323. if(sutPocStatus.LocalUser.name[0]!=0) uname=sutPocStatus.LocalUser.name;
  324. mainScreenShowMoving(UI_GROUP_SHOW_Y, reset,gname,uname,voicePri,voice);
  325. }
  326. #endif
  327. void uiShowMainInterface(char status,unsigned int exeInterval){
  328. short Flag=ME_NO_LOGIN;//ME_ENUM
  329. static unsigned char danhu=0;
  330. static short lastFlag=-1;
  331. static unsigned short siCt=0;
  332. char info[20];
  333. static char firstRun=0;
  334. static unsigned short dly=0;
  335. char tmpStatus=status;
  336. static int copsStatus;
  337. unsigned char reset=0;
  338. unsigned char moveFlash=0;
  339. static unsigned char voice=0;
  340. static MY_CLOCK tempDate;
  341. /*逻辑处理开始*/
  342. if(tmpStatus){
  343. guiClearAll(guiGetBackColor());
  344. #ifdef AUTH_SKIP
  345. guiShowStr(1, UI_BOTTOM_SHOW_Y,"测试样机", FONT_MODE_12X12, REVERSED_NO,COLOR_STATUS_BAR, guiGetBackColor());
  346. #else
  347. //guiShowStr(1, UI_BOTTOM_SHOW_Y,"菜单", FONT_MODE_12X12, REVERSED_NO,COLOR_STATUS_BAR, guiGetBackColor());
  348. //now_time.
  349. #endif
  350. danhu=sutPocStatus.danHuStatus;
  351. uiShowGuaDuan(danhu);
  352. lastFlag=-1;
  353. siCt=0;
  354. //return;
  355. }
  356. if(copsStatus != sutApp.copstype || tmpStatus){
  357. copsStatus=sutApp.copstype;
  358. uiShowCopsInfo();
  359. }
  360. //更新单呼显示与否
  361. if(sutPocStatus.danHuStatus != danhu){
  362. danhu=sutPocStatus.danHuStatus;
  363. uiShowGuaDuan(danhu);
  364. }
  365. //提示解锁
  366. if(sutApp.lockShow!=0){
  367. backLightReset();
  368. guiShowMessageBox("请先解锁!");
  369. LSAPI_OSI_ThreadSleep(500);
  370. guiClearRect(0,GLCD_HEIGHT/2-20,GLCD_WIDTH-1,GLCD_HEIGHT/2+20,guiGetBackColor());
  371. lastFlag=-1;//让以下刷新一下
  372. sutApp.lockShow=0;
  373. }
  374. //以下持续调用,以便动态更新信息
  375. if(0==sutPocStatus.logined) Flag=ME_NO_LOGIN;//未登录
  376. else if(0==sutPocStatus.spk && 0==sutPocStatus.mic){//已登录,无人说话
  377. Flag=ME_NOBODY_SPEAK;
  378. }else if(0!=sutPocStatus.mic) Flag=ME_IAM_SPEAK;//已登录,本机说话
  379. else if(0!=sutPocStatus.spk) Flag=ME_SOMEBODY_SPEAK;//有人说话
  380. switch(Flag){
  381. case ME_NO_LOGIN://未登录
  382. if(Flag != lastFlag){
  383. guiFillRect(0, UI_CONTENT_SHOW_Y, GLCD_WIDTH-1, UI_BOTTOM_SHOW_Y-1,guiGetBackColor());
  384. // guiShowBmp(0,UI_CONTENT_SHOW_Y, "logo.bmp");
  385. }
  386. break;
  387. case ME_NOBODY_SPEAK://已登录,无人说话
  388. if(Flag != lastFlag){
  389. if(ME_NO_LOGIN==lastFlag) guiFillRect(0, UI_CONTENT_SHOW_Y, GLCD_WIDTH-1, UI_CONTENT_SHOW_Y+16,guiGetBackColor());//从未登录到登录,'正在登录'那行也刷掉
  390. guiFillRect(0, UI_VOICE_SHOW_Y, GLCD_WIDTH-1, UI_VOICE_SHOW_Y+16,guiGetBackColor());
  391. #ifdef USE_LEFT_MOVING
  392. voice=0;
  393. moveFlash=1;
  394. #else
  395. uiShowHuaQuan("空闲",0);
  396. #endif
  397. sutPocStatus.statusChaned = 1;
  398. }
  399. break;
  400. case ME_IAM_SPEAK://已登录,本机说话
  401. if(Flag != lastFlag){
  402. guiFillRect(0, UI_VOICE_SHOW_Y, GLCD_WIDTH-1, UI_VOICE_SHOW_Y+16,guiGetBackColor());
  403. #ifdef USE_LEFT_MOVING
  404. voice=1;
  405. moveFlash=1;
  406. #else
  407. uiShowHuaQuan("本机在讲话",1);
  408. #endif
  409. }
  410. break;
  411. case ME_SOMEBODY_SPEAK://已登录,有人说话
  412. if(Flag != lastFlag){
  413. guiFillRect(0, UI_VOICE_SHOW_Y, GLCD_WIDTH-1, UI_VOICE_SHOW_Y+16,guiGetBackColor());
  414. sutPocStatus.statusChaned=1;//保证要刷新名字
  415. #ifdef USE_LEFT_MOVING
  416. voice=2;
  417. moveFlash=1;
  418. #endif
  419. }
  420. #ifndef USE_LEFT_MOVING
  421. uiShowCallUserName();
  422. #endif
  423. break;
  424. }
  425. if(Flag>0){//已登录
  426. if(Flag != lastFlag && (lastFlag==-1 || ME_NO_LOGIN==lastFlag))
  427. {
  428. #ifdef USE_LEFT_MOVING
  429. reset=1;
  430. #else
  431. uiShowGUName(1);
  432. #endif
  433. }
  434. #ifndef USE_LEFT_MOVING
  435. else uiShowGUName(0);
  436. #endif
  437. }else{//未登录
  438. snprintf(info, sizeof(info),"正在登陆.");
  439. switch(siCt){//not finished yet
  440. case 0:
  441. strcat(info, " ");
  442. guiShowStr(1, UI_CONTENT_SHOW_Y,info, FONT_MODE_12X12, REVERSED_NO,COLOR_STATUS_BAR,guiGetBackColor());
  443. break;
  444. case (1000/APP_SUB_DIV_TIME):
  445. strcat(info, ". ");
  446. guiShowStr(1, UI_CONTENT_SHOW_Y,info, FONT_MODE_12X12, REVERSED_NO,COLOR_STATUS_BAR,guiGetBackColor());
  447. break;
  448. case (2000/APP_SUB_DIV_TIME):
  449. strcat(info, "..");
  450. guiShowStr(1, UI_CONTENT_SHOW_Y,info, FONT_MODE_12X12, REVERSED_NO,COLOR_STATUS_BAR,guiGetBackColor());
  451. break;
  452. }
  453. //显示登录状态
  454. uiShowOffLineMessage();
  455. }
  456. #ifdef USE_LEFT_MOVING
  457. movingShowNames(APP_SUB_DIV_TIME,reset,moveFlash,voice);
  458. #endif
  459. if(++siCt>=(3000/APP_SUB_DIV_TIME)) siCt=0;
  460. if(Flag != lastFlag) lastFlag=Flag;
  461. }
  462. static void uiShowGUName(int update){
  463. static char scNameUser[POC_GROUP_USER_NAME_LEN];
  464. static char scNameGroup[POC_GROUP_USER_NAME_LEN];
  465. char name[POC_GROUP_USER_NAME_LEN];
  466. unsigned short len;
  467. unsigned char danHuanBuffer[9]={0xB5,0xA5,0xBA,0xF4,0xC4,0xA3,0xCA,0xBD,0};
  468. char GroupShowUpdate=0;
  469. char UserShowUpdate=0;
  470. if(sutPocStatus.danHuStatus==0){
  471. if(0!=strcmp(sutPocStatus.LocalGroup.name,scNameGroup) || update!=0){
  472. memset(scNameGroup,0,sizeof(scNameGroup));
  473. memcpy(scNameGroup,sutPocStatus.LocalGroup.name,sizeof(scNameGroup));
  474. GroupShowUpdate=1;
  475. }
  476. }else{
  477. if(0!=strcmp((char *)danHuanBuffer,scNameGroup) || update!=0){
  478. memset(scNameGroup,0,sizeof(scNameGroup));
  479. memcpy(scNameGroup, danHuanBuffer,sizeof(danHuanBuffer));
  480. GroupShowUpdate=1;
  481. }
  482. }
  483. if(0!=strcmp(sutPocStatus.LocalUser.name,scNameUser) || update!=0){
  484. memset(scNameUser,0,sizeof(scNameUser));
  485. memcpy(scNameUser,sutPocStatus.LocalUser.name,sizeof(scNameUser));
  486. UserShowUpdate=1;
  487. }
  488. if(GroupShowUpdate){
  489. guiClearRect(0,UI_GROUP_SHOW_Y,GLCD_WIDTH-1,UI_GROUP_SHOW_Y+16+2,guiGetBackColor());//18
  490. //刷新群组栏
  491. if(sutPocStatus.danHuStatus==0) StrIntercept(name, scNameGroup, sizeof(name));
  492. else snprintf(name, sizeof(name), "单呼模式");
  493. uiShowGroup(name);
  494. sutPocStatus.statusChaned=1;
  495. }
  496. if(UserShowUpdate){
  497. guiClearRect(0,UI_USER_SHOW_Y,GLCD_WIDTH-1,UI_GROUP_SHOW_Y+16,guiGetBackColor());//18
  498. //刷新成员栏
  499. StrIntercept(name, scNameUser, sizeof(name));
  500. uiShowUser(name);
  501. }
  502. }
  503. static void uiShowGuaDuan(unsigned char danhu){
  504. if(danhu==0) guiClearArea(GLCD_WIDTH-32, UI_BOTTOM_SHOW_Y, 32, 14, guiGetBackColor());
  505. else guiShowStr(GLCD_WIDTH-32, UI_BOTTOM_SHOW_Y, "挂断", FONT_MODE_12X12, REVERSED_NO, COLOR_STATUS_BAR,guiGetBackColor());
  506. }
  507. static void uiShowGroup(const char* info){
  508. unsigned int color=COLOR_BLACK;
  509. if(sutPocStatus.danHuStatus==0) guiShowBmp(2, UI_GROUP_SHOW_Y, "Group2.bmp");
  510. else{
  511. guiShowBmp(2, UI_GROUP_SHOW_Y, "Onecall.bmp");
  512. color=COLOR_RED;
  513. }
  514. //guiShowStr(2, UI_GROUP_SHOW_Y+2,"群组:", FONT_MODE_12X12, REVERSED_NO,COLOR_BLACK,guiGetBackColor());
  515. guiClearRect(2+16+2, UI_GROUP_SHOW_Y, GLCD_WIDTH-1, UI_GROUP_SHOW_Y+16, guiGetBackColor());
  516. #ifdef USE_12X12_FONT_ONLY
  517. guiShowStr(2+16+2, UI_GROUP_SHOW_Y+2,info, FONT_MODE_12X12, REVERSED_NO,COLOR_BLACK,guiGetBackColor());
  518. #else
  519. guiShowStr(2+16+2, UI_GROUP_SHOW_Y,info, FONT_MODE_16X16, REVERSED_NO,COLOR_BLACK,guiGetBackColor());
  520. #endif
  521. }
  522. static void uiShowUser(const char* info){
  523. guiClearRect(1, UI_USER_SHOW_Y, GLCD_WIDTH-1, UI_USER_SHOW_Y+16, guiGetBackColor());//2+18
  524. guiShowBmp(2, UI_USER_SHOW_Y, "people2.bmp");
  525. //guiShowStr(2, UI_USER_SHOW_Y+2,"成员:", FONT_MODE_12X12, REVERSED_NO,COLOR_BLACK,guiGetBackColor());
  526. #ifdef USE_12X12_FONT_ONLY
  527. guiShowStr(2+18, UI_USER_SHOW_Y+2,info, FONT_MODE_12X12, REVERSED_NO,COLOR_BLACK,guiGetBackColor());
  528. #else
  529. guiShowStr(2+18, UI_USER_SHOW_Y,info, FONT_MODE_16X16, REVERSED_NO,COLOR_BLACK,guiGetBackColor());
  530. #endif
  531. }
  532. static void uiShowHuaQuan(const char* info,char type){
  533. unsigned int color=COLOR_BLACK;
  534. if(type==0) guiShowBmp(2, UI_VOICE_SHOW_Y, "Phone.bmp");
  535. else if(type==1){
  536. color=COLOR_RED;
  537. guiShowBmp(2, UI_VOICE_SHOW_Y, "Csend.bmp");
  538. }else if(type==2){
  539. guiShowBmp(2, UI_VOICE_SHOW_Y, "Creceive.bmp");
  540. color=COLOR_DEEP_GREEN;
  541. }
  542. //guiShowStr(2, UI_VOICE_SHOW_Y+2,"话权:", FONT_MODE_12X12, REVERSED_NO,COLOR_BLACK,guiGetBackColor());
  543. guiClearRect(2+18, UI_VOICE_SHOW_Y, GLCD_WIDTH-1, UI_VOICE_SHOW_Y+16, guiGetBackColor());
  544. #ifdef USE_12X12_FONT_ONLY
  545. guiShowStr(2+18, UI_VOICE_SHOW_Y+2,info, FONT_MODE_12X12, REVERSED_NO,COLOR_BLACK,guiGetBackColor());
  546. #else
  547. guiShowStr(2+18, UI_VOICE_SHOW_Y,info, FONT_MODE_16X16, REVERSED_NO,color,guiGetBackColor());
  548. #endif
  549. }
  550. static void uiShowCallUserName(void){
  551. static char scName[POC_GROUP_USER_NAME_LEN];
  552. char name[POC_GROUP_USER_NAME_LEN];
  553. if(0 != strncmp(scName, sutPocStatus.CallName, POC_GROUP_USER_NAME_LEN) ||
  554. sutPocStatus.statusChaned){
  555. //当名字变更或UI切换了,刷新显示
  556. sutPocStatus.statusChaned=0;
  557. memcpy(scName, sutPocStatus.CallName, POC_GROUP_USER_NAME_LEN);
  558. uiShowHuaQuan(scName,2);
  559. }
  560. }
  561. static void uiShowOffLineMessage(void){
  562. static unsigned char laReason;
  563. char info[50],update=0;
  564. unsigned short y;
  565. if(sutUIstatus.Status != UIS_STANDBY) return;
  566. if(sutPocStatus.PocLineOffReason==laReason && sutUIstatus.ItemRefresh==0) return;
  567. sutUIstatus.ItemRefresh=0;
  568. laReason=sutPocStatus.PocLineOffReason;
  569. if(sutApp.cardStatus==0){
  570. snprintf(info, sizeof(info), "请插卡");
  571. update=1;
  572. }else{
  573. switch(sutPocStatus.PocLineOffReason){
  574. case 1:snprintf(info, sizeof(info), "无网络连接");break;
  575. case 2:snprintf(info, sizeof(info), "无法连接");break;
  576. case 3:snprintf(info, sizeof(info), "没有服务");break;
  577. case 4:snprintf(info, sizeof(info), "账号信息错误");break;
  578. }
  579. if(sutPocStatus.PocLineOffReason!=0) update=1;
  580. }
  581. if(update!=0){
  582. //y=UI_CONTENT_SHOW_Y+2+12;//WJL
  583. y=UI_USER_SHOW_Y;
  584. guiClearRect(1,y, GLCD_WIDTH-1, y +12, guiGetBackColor());
  585. guiShowStr(1, y,info, FONT_MODE_12X12, REVERSED_NO,COLOR_STATUS_BAR,guiGetBackColor());
  586. }
  587. }
  588. /****************************待机界面显示部分结束***********************************/
  589. /****************************主菜单显示部分开始*************************************/
  590. #include "Palace.h"
  591. SUT_PALACE sutPalace;
  592. void uiShowMenuMain(char update){
  593. static const char *apcMenuMain[]={
  594. "群组选择",
  595. "成员选择",
  596. "文本信息",
  597. "系统设置",
  598. "定位设置",
  599. "终端信息",
  600. ""
  601. };
  602. if(update) PalaceInit(&sutPalace,apcMenuMain,"Palace","主菜单");
  603. }
  604. void MenuMainResponse(void){
  605. unsigned short key;
  606. key=PalaceResponse(&sutPalace);
  607. if(MKEY_VALUE_MENU==key){
  608. switch(sutPalace.Index){
  609. case 0:
  610. uISetNextStatus(UIS_MENU_GROUP_SEL);
  611. break;
  612. case 1:
  613. uISetNextStatus(UIS_MENU_USER_SEL);
  614. break;
  615. case 2:
  616. uISetNextStatus(UIS_MENU_MAIL_SEL);
  617. break;
  618. case 3:
  619. uISetNextStatus(UIS_MENU_SYS_SEL);
  620. break;
  621. case 4:
  622. uISetNextStatus(UIS_MENU_LOCATION_SEL);
  623. break;
  624. case 5:
  625. uISetNextStatus(UIS_MENU_INFO_SEL);
  626. break;
  627. }
  628. uiPushStack(sutPalace.Index);
  629. }
  630. else if(MKEY_VALUE_ESC==key){
  631. uISetNextStatus(UIS_STANDBY);
  632. sutApp.MenuToStandby=1;
  633. }
  634. }
  635. /****************************主菜单显示部分结束*************************************/
  636. /*****************************群组选择/成员选择部分开始*********************************/
  637. static char GUListBoxInited=0;
  638. static char SelMachine=0;
  639. static void ReFlashItemGU(char type);
  640. static void UserAssistAdd(void);
  641. void numGUFlash(int index, int total){
  642. char info[10];
  643. int x;
  644. snprintf(info, sizeof(info), "%d", total);
  645. x=GLCD_WIDTH-strlen(info)*12;
  646. guiClearRect(78, UI_STATUS_ITEM_Y, GLCD_WIDTH-1, UI_STATUS_ITEM_Y+12, guiGetForeColor());
  647. guiShowStr(x, UI_STATUS_ITEM_Y+1, info, FONT_MODE_12X12, REVERSED_NO, guiGetBackColor(), guiGetForeColor());
  648. }
  649. static unsigned int thisShowNum;
  650. bool setHandleToZero=true;
  651. void uiShowGUSel(char StatusUpdate,unsigned int exeInterval,char type){
  652. static unsigned int timer;
  653. char info[50];
  654. if(StatusUpdate){
  655. if(sutPocStatus.logined==0){
  656. guiShowMessageBox("请先登录");
  657. uTimerStart(&timer, 1000);
  658. SelMachine=0;
  659. }else SelMachine=1;
  660. }
  661. switch(SelMachine){
  662. case 0://延时后退出
  663. if(uTimerExpired(&timer)){
  664. uISetNextStatus(UIS_STANDBY);
  665. }
  666. break;
  667. case 1://显示
  668. guiClearAll(guiGetBackColor());
  669. guiShowMessageBox("请稍候");
  670. sutPocStatus.ListDetailValid=0;
  671. if(type==0){
  672. guiShowCaption(0,"群组选择",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12); //0
  673. uiMenuShowBottomIndacitor("确定", "返回");
  674. msgAtSend("AT+POC=0D0000\r\n");
  675. }else{
  676. guiShowCaption(0,"用户选择",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12); //0
  677. uiMenuShowBottomIndacitor("单呼", "返回");
  678. snprintf(info, sizeof(info),"AT+POC=0E0000%08x\r\n",sutPocStatus.LocalGroup.ID);
  679. msgAtSend(info);
  680. }
  681. thisShowNum=0;
  682. SelMachine=3;
  683. uTimerStart(&timer, 5000);
  684. uiMenuShowBottomLine();
  685. break;
  686. case 3:
  687. if(uTimerExpired(&timer)){
  688. guiShowMessageBox("成员获取失败");
  689. SelMachine=0;
  690. uTimerStart(&timer, 1000);
  691. }
  692. if(sutPocStatus.ListDetailValid!=0){
  693. SelMachine=2;
  694. thisShowNum=sutPocStatus.ListCurOnlineNum;
  695. guiClearRect(0,GLCD_HEIGHT/2-20,GLCD_WIDTH-1,GLCD_HEIGHT/2+20,guiGetBackColor());//刷掉"请稍候"的残留
  696. ReFlashItemGU(type);
  697. }
  698. break;
  699. }
  700. }
  701. void GroupSelResponse(){
  702. unsigned int key;
  703. char buf[50];
  704. switch(SelMachine){
  705. case 2:
  706. key=ListBoxResponse(&sutListBox);
  707. if(MKEY_VALUE_ESC==key){
  708. uISetNextStatus(UIS_MENU_MAIN);
  709. }else if(MKEY_VALUE_MENU==key){
  710. if(0 == sutPocStatus.ListCurOnlineNum) break;
  711. ///////////////////////////////////////
  712. //UiassistEnd(1);
  713. sutApp.groupTTSEnable=1;
  714. snprintf(buf, sizeof(buf),"AT+POC=090000%08x\r\n",sutPocStatus.AllGroups[sutListBox.handle].ID);
  715. msgAtSend(buf);
  716. MSG_INFO(1,buf);
  717. snprintf(buf, sizeof(buf),"进入:%s",sutPocStatus.AllGroups[sutListBox.handle].name);
  718. MSG_INFO(1,buf);
  719. uISetNextStatus(UIS_STANDBY);
  720. SelMachine=0;
  721. }
  722. break;
  723. }
  724. }
  725. void UserSelResponse(){
  726. char buf[50];
  727. unsigned int key;
  728. switch(SelMachine){
  729. case 2:
  730. key=ListBoxResponse(&sutListBox);
  731. if(MKEY_VALUE_ESC==key){
  732. uISetNextStatus(UIS_MENU_MAIN);
  733. }else if(MKEY_VALUE_MENU==key){
  734. if(0 == sutPocStatus.ListCurOnlineNum) break;
  735. snprintf(buf, sizeof(buf),"AT+POC=0A0000%08x\r\n",sutPocStatus.AllUsers[sutListBox.handle].ID);
  736. msgAtSend(buf);
  737. MSG_INFO(1, buf);
  738. snprintf(buf, sizeof(buf),"呼叫:%s",sutPocStatus.AllUsers[sutListBox.handle].name);
  739. MSG_INFO(1, buf);
  740. uISetNextStatus(UIS_STANDBY);
  741. SelMachine=0;
  742. }
  743. break;
  744. }
  745. }
  746. static void UserAssistAdd(void){
  747. switch(SelMachine){
  748. case 1:
  749. if(getAssistResult()){
  750. if(sutUIstatus.Status==UIS_MENU_GROUP_SEL)ReFlashItemGU(0);
  751. else ReFlashItemGU(1);
  752. SelMachine=0;
  753. }
  754. break;
  755. case 2:
  756. if(getAssistResult()){
  757. if(sutUIstatus.Status==UIS_MENU_GROUP_SEL)ReFlashItemGU(0);
  758. else ReFlashItemGU(1);
  759. SelMachine=0;
  760. }
  761. break;
  762. }
  763. }
  764. static void ReFlashItemGU(char type){
  765. static unsigned short susCt=0;
  766. static const char *accIconFileName[]={
  767. "Group1.bmp",
  768. "Group2.bmp",
  769. "people1.bmp",
  770. "people2.bmp",
  771. "people3.bmp",
  772. ""
  773. };
  774. static char *icons[4];
  775. int i;
  776. unsigned short timeout;
  777. static const char *NullGU="";
  778. static char *GUName[POC_ALL_GROUPS_NUM+1]; //5
  779. static char GUFeatures[POC_ALL_GROUPS_NUM+1];//5
  780. if(type==0){
  781. icons[0]=accIconFileName[0];
  782. icons[1]=accIconFileName[1];
  783. icons[2]=accIconFileName[5];
  784. }else{
  785. icons[0]=accIconFileName[2];
  786. icons[1]=accIconFileName[3];
  787. icons[2]=accIconFileName[4];
  788. }
  789. icons[3]=accIconFileName[5];
  790. for(i=0;i<=POC_ALL_GROUPS_NUM;i++){
  791. GUName[i]=NullGU;
  792. GUFeatures[i]=0;
  793. }
  794. for(i=0;i<thisShowNum;i++){
  795. GUFeatures[i]=1;
  796. if(type==0){
  797. if(sutPocStatus.AllGroups[i].ID==sutPocStatus.LocalGroup.ID) GUFeatures[i]=0;
  798. GUName[i]=sutPocStatus.AllGroups[i].name;
  799. }else{
  800. if(sutPocStatus.AllUsers[i].status==3) GUFeatures[i]=1;//不在此组
  801. else if(sutPocStatus.AllUsers[i].status==4) GUFeatures[i]=2;//调度员
  802. GUName[i]=sutPocStatus.AllUsers[i].name;
  803. }
  804. }
  805. if(thisShowNum==0){//没有成员总数
  806. GUName[0]="空";
  807. GUFeatures[i]=0;
  808. }
  809. //初始化ListBox控件
  810. ListBoxInit(&sutListBox,GUName,0,icons,GUFeatures,0);
  811. GUListBoxInited=1;
  812. }
  813. /*****************************群组选择/成员选择部分结束*********************************/
  814. /*****************************系统设置部分开始*********************************/
  815. void uiShowMenuSysSetup(char flash){
  816. static const char *apcPtr[]={
  817. "1.LCD设置",
  818. //"2.网络设置",
  819. "2.SIM选择",
  820. "3.按键音设置",
  821. "4.麦克风粗调",
  822. "5.麦克风微调",
  823. //"6.平台切换",
  824. //"4.版本升级",
  825. "6.功耗模式设置",
  826. "7.音质设置",
  827. //"5.服务器设置",
  828. //"7.提示音设置",
  829. ""
  830. };
  831. if(flash){
  832. msgAtSend("AT+RSIM\r\n");//进此菜单前查询一下卡用于后面显示
  833. voiceModeQuery();
  834. guiClearAll(guiGetBackColor());
  835. guiShowCaption(0,"系统设置",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  836. uiMenuShowBottomLine();
  837. uiMenuShowBottomIndacitor("确认", "返回");
  838. uiMenuInit(&sutMenuSysSetup,apcPtr,FONT_MODE_12X12);
  839. GUListBoxInited=1;
  840. }
  841. }
  842. void sysTemSetResponse(void){
  843. unsigned short key;
  844. key=uiMenuResponse(&sutMenuSysSetup);
  845. if(MKEY_VALUE_MENU==key){
  846. switch(sutMenuSysSetup.handle){
  847. case 0://LCD设置
  848. uISetNextStatus(UIS_MENU_SYS_LCD);
  849. break;
  850. case 1://SIM选择
  851. uISetNextStatus(UIS_MENU_SYS_SIM);
  852. break;
  853. case 2://提示音设置
  854. uISetNextStatus(UIS_MENU_SYS_NOTE);
  855. break;
  856. case 3://MICLv粗调
  857. uISetNextStatus(UIS_MENU_SYS_MICCU);
  858. break;
  859. case 4://MICLv粗调
  860. uISetNextStatus(UIS_MENU_SYS_MICXI);
  861. break;
  862. case 5://功耗模式设置
  863. uISetNextStatus(UIS_MENU_SYS_PWR);
  864. break;
  865. case 6:
  866. uISetNextStatus(UIS_MENU_SYS_VOICEQC);
  867. break;
  868. }
  869. if(sutMenuSysSetup.handle<=6) {
  870. uiPushStack(sutMenuSysSetup.handle);
  871. }
  872. }
  873. else if(MKEY_VALUE_ESC==key){
  874. uISetNextStatus(UIS_MENU_MAIN);
  875. }
  876. }
  877. /*****************************系统设置部分结束*********************************/
  878. /*****************************定位设置部分开始*********************************/
  879. unsigned char tempGpsIndex;
  880. static locationTimeFlash(char type);
  881. static locationXYFlash(char flash);
  882. void uiShowMenuLocationSel(char flash){
  883. static unsigned int timer;
  884. if(flash){
  885. //machine=0;
  886. guiClearAll(guiGetBackColor());
  887. guiShowCaption(0,"定位设置",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  888. uiMenuShowBottomLine();
  889. if(GPS_HADRENABLE==0){
  890. uiMenuShowBottomIndacitor(NULL, "返回");
  891. guiShowMessageBox("版本不支持");
  892. uTimerStart(&timer, 1000);
  893. return;
  894. }
  895. uiMenuShowBottomIndacitor("保存", "返回");
  896. locationTimeFlash(0);
  897. }
  898. //if(newPara.gpsEnable!=0)
  899. locationXYFlash(flash);
  900. }
  901. void loationSetResponse(void){
  902. unsigned short key;
  903. key=getKeyValue();
  904. if(MKEY_VALUE_UP==key) locationTimeFlash(1);
  905. else if(MKEY_VALUE_DOWN==key) locationTimeFlash(2);
  906. else if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_MAIN);
  907. else if(MKEY_VALUE_MENU==key){
  908. if(tempGpsIndex != newPara.gpsTimeIndex){
  909. MSG_INFO(1, "GPS timeIndex update:%d",getGPSTimeValue(tempGpsIndex));
  910. newPara.gpsTimeIndex=tempGpsIndex;
  911. sysIniSave();
  912. gpsCheckInfo();//检测一下
  913. GpsTimeUpdate();
  914. }
  915. uISetNextStatus(UIS_MENU_MAIN);
  916. }
  917. }
  918. static locationTimeFlash(char type){
  919. unsigned short gpsTimeValue;
  920. char buf[50];
  921. unsigned short y=70;
  922. if(type==0){
  923. tempGpsIndex=newPara.gpsTimeIndex;
  924. }else if(type==1){
  925. if(++tempGpsIndex>=GPS_TABLE_NUM) tempGpsIndex=0;
  926. }else if(type==2){
  927. if(tempGpsIndex>0) tempGpsIndex--;
  928. else tempGpsIndex=GPS_TABLE_NUM-1;
  929. }else return;
  930. gpsTimeValue=getGPSTimeValue(tempGpsIndex);
  931. if(gpsTimeValue==0) snprintf(buf, sizeof(buf), "定位采样设置:关闭");
  932. else snprintf(buf, sizeof(buf), "定位采样设置:%d秒",gpsTimeValue);
  933. guiClearRect(0,y,GLCD_WIDTH-1, y+12,guiGetBackColor());
  934. guiShowStr(1,y, buf,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
  935. }
  936. static locationXYFlash(char flash){
  937. char buf[50];
  938. unsigned short y=UI_CONTENT_SHOW_Y+2;
  939. if(gpsInfo.update==0 && flash==0) return;
  940. gpsInfo.update=0;
  941. guiClearRect(0, y,GLCD_WIDTH-1, y+12+5+12,guiGetBackColor());
  942. snprintf(buf, sizeof(buf), "纬度 %c:%d.%05d",sutGpsInfo.NSFlag,sutGpsInfo.latitue/1000000,sutGpsInfo.latitue%1000000);
  943. guiShowStr(1,y, buf,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
  944. y+=12+5;
  945. snprintf(buf, sizeof(buf), "经度 %c:%d.%06d",sutGpsInfo.EWFlag,sutGpsInfo.longitue/1000000,sutGpsInfo.longitue%1000000);
  946. guiShowStr(1,y, buf,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
  947. }
  948. /*****************************定位设置部分结束*********************************/
  949. /*******************************终端信息开始**********************************/
  950. unsigned char sysInfoType;
  951. static void sysInfoFlash(void){
  952. unsigned short x,y,ext;
  953. char buf[50];
  954. unsigned char LineSpace=12+4;
  955. int len;
  956. char yunyingshang=0;
  957. x=2,y=UI_CONTENT_SHOW_Y+5;
  958. guiClearRect(0,y,GLCD_WIDTH-1,GLCD_HEIGHT,guiGetBackColor());
  959. QR_OUT testma;
  960. if(sysInfoType==0){
  961. if(LSAPI_SIM_GetIMEI(buf)==0){
  962. //guiShowCaption(0,"IMEI二维码",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  963. EncodeData(buf,&testma);
  964. guiDrawQRimage(20,40,4,testma.data,testma.size);
  965. }else{
  966. guiShowMessageBox("获取失败");
  967. }
  968. }
  969. else if(sysInfoType==1){
  970. memset(buf,0,sizeof(buf));
  971. snprintf(buf, sizeof(buf),"ICCID:");
  972. guiShowStr(0,y,buf,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK,guiGetBackColor());
  973. y+=LineSpace;
  974. memset(buf,0,sizeof(buf));
  975. switch(sutApp.copstype){
  976. case 46000:
  977. case 46002:
  978. case 46007:
  979. yunyingshang=1;
  980. break;
  981. case 46001:
  982. case 46006:
  983. yunyingshang=2;
  984. break;
  985. case 46003:
  986. case 46005:
  987. case 46008:
  988. case 46009:
  989. case 46010:
  990. case 46011:
  991. yunyingshang=3;
  992. break;
  993. default:
  994. yunyingshang=0;
  995. break;
  996. }
  997. if(LSAPI_SIM_GetICCID(buf)==0&&yunyingshang!=0){
  998. strcpy(sutApp.ICCID, buf);
  999. if(yunyingshang!=1){
  1000. sutApp.ICCID[19]=0;
  1001. }
  1002. snprintf(buf, sizeof(buf),"%s",sutApp.ICCID);
  1003. guiShowStr(0,y,buf,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK,guiGetBackColor());
  1004. len=strlen(buf);
  1005. if(len>16){
  1006. y+=LineSpace;
  1007. guiShowStr(x,y,buf+16,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK,guiGetBackColor());
  1008. }
  1009. }else{
  1010. snprintf(buf, sizeof(buf),"未知");
  1011. guiShowStr(0,y,buf,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK,guiGetBackColor());
  1012. }
  1013. y+=LineSpace;
  1014. memset(buf,0,sizeof(buf));
  1015. snprintf(buf, sizeof(buf),"IMEI:");
  1016. guiShowStr(0,y,buf,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK,guiGetBackColor());
  1017. //IMEI
  1018. y+=LineSpace;
  1019. memset(buf,0,sizeof(buf));
  1020. if(LSAPI_SIM_GetIMEI(buf)==0){
  1021. guiShowStr(0,y,buf,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK,guiGetBackColor());
  1022. }else{
  1023. guiShowStr(0,y,"未知",FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK,guiGetBackColor());
  1024. }
  1025. }else if(sysInfoType==2){
  1026. //对讲平台
  1027. snprintf(buf, sizeof(buf),"对讲平台:%s", OHPOC_POC_PLATFORM);
  1028. guiShowStr(x,y,buf,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK,guiGetBackColor());
  1029. y+=LineSpace;
  1030. ext=0;
  1031. memset(buf,sizeof(buf),0);
  1032. snprintf(buf,sizeof(buf),"POC:%s", sutApp.pocVersion);
  1033. len=strlen(buf);
  1034. if(len>16){
  1035. y+=LineSpace;
  1036. guiShowStr(x+32,y,buf+15,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK,guiGetBackColor());
  1037. buf[20]=0;
  1038. y-=LineSpace;
  1039. ext=LineSpace;
  1040. }
  1041. guiShowStr(x,y,buf,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK,guiGetBackColor());
  1042. y+=LineSpace+ext;
  1043. //模块
  1044. memset(buf,sizeof(buf),0);
  1045. snprintf(buf,sizeof(buf),"模块:%s", sutApp.modemVer);
  1046. len=strlen(buf);
  1047. if(len>16){
  1048. y+=LineSpace;
  1049. guiShowStr(x+32,y,buf+15,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK,guiGetBackColor());
  1050. buf[20]=0;
  1051. y-=LineSpace;
  1052. }
  1053. guiShowStr(x,y,buf,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK,guiGetBackColor());
  1054. y+=LineSpace;
  1055. //应用版本
  1056. snprintf(buf, sizeof(buf),"应用版本:%s",OHPOC_VERSION);
  1057. guiShowStr(x,y,buf,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK,guiGetBackColor());
  1058. //终端编码
  1059. y+=LineSpace;
  1060. snprintf(buf, sizeof(buf),"PSN:%s",sutApp.UserInfo.OtherId);
  1061. guiShowStr(0,y,buf,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK,guiGetBackColor());
  1062. }
  1063. }
  1064. void uiShowInformation(char update){
  1065. if(update){
  1066. sysInfoType=0;
  1067. guiClearAll(guiGetBackColor());
  1068. guiShowCaption(0,"终端信息",UI_STATUS_BAR_HEIGH,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  1069. // uiMenuShowBottomLine();
  1070. // uiMenuShowBottomIndacitor(NULL, "返回");
  1071. sysInfoFlash();
  1072. }
  1073. }
  1074. void uiShowInformationResponse(void){
  1075. unsigned short key=getKeyValue();
  1076. if(MKEY_VALUE_ESC==key) uISetNextStatus(sutUIstatus.LastStatus);
  1077. else if(MKEY_VALUE_DOWN==key || MKEY_VALUE_UP==key){
  1078. if(sysInfoType==0) sysInfoType=1;
  1079. else if(sysInfoType==1) sysInfoType=2;
  1080. else sysInfoType=0;
  1081. sysInfoFlash();
  1082. }else if(MKEY_VALUE_CB_IP==key){
  1083. sysInfoType=2;
  1084. sysInfoFlash();
  1085. }
  1086. }
  1087. /*****************************终端信息结束**********************************/
  1088. static const char *commonIcon2[]={
  1089. "APN.bmp",
  1090. "APN1.bmp",
  1091. ""
  1092. };
  1093. /*****************************LCD设置开始**********************************/
  1094. unsigned char lcdTmpIndex;
  1095. static void lcdTimeFlash(char type){
  1096. char buf[50];
  1097. unsigned short x=4,y=56,value;
  1098. if(type==0) guiShowStr(x+25, y, "背光时间:", FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
  1099. else if(type==1){
  1100. if(++lcdTmpIndex>=5) lcdTmpIndex=0;
  1101. }else if(type==2){
  1102. if(lcdTmpIndex>0) lcdTmpIndex--;
  1103. else lcdTmpIndex=4;
  1104. }
  1105. value=newPara.lcdParaList[lcdTmpIndex];
  1106. if(value==0) snprintf(buf, sizeof(buf), " 常亮 ");
  1107. else snprintf(buf, sizeof(buf), "%3d 秒", value);
  1108. guiShowStr(x+80, y, buf, FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
  1109. }
  1110. void uiShowLcdSel(char StatusUpdate){
  1111. if(StatusUpdate){
  1112. guiClearAll(guiGetBackColor());
  1113. guiShowCaption(0,"LCD设置",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  1114. uiMenuShowBottomLine();
  1115. lcdTmpIndex=newPara.lcdParaDefaultIndex;
  1116. lcdTimeFlash(0);
  1117. uiMenuShowBottomIndacitor("保存", "返回");
  1118. }
  1119. }
  1120. void uiShowLcdSelResponse(void){
  1121. unsigned short key=getKeyValue();
  1122. if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_SYS_SEL);
  1123. else if(MKEY_VALUE_DOWN==key)lcdTimeFlash(1);
  1124. else if(MKEY_VALUE_UP==key) lcdTimeFlash(2);
  1125. else if(MKEY_VALUE_MENU==key){
  1126. getStackStruct()->ok_back=1;
  1127. if(lcdTmpIndex != newPara.lcdParaDefaultIndex){
  1128. newPara.lcdParaDefaultIndex=lcdTmpIndex;
  1129. MSG_INFO(1, "LCD TimeUpdate");
  1130. backLightReset();
  1131. sysIniSave();
  1132. }
  1133. uISetNextStatus(UIS_MENU_SYS_SEL);
  1134. }
  1135. }
  1136. /*****************************LCD设置结束**********************************/
  1137. /*****************************网络设置开始**********************************/
  1138. const unsigned char netModeSetTable[3]={1,2,4};//设置制式:AUTH,2G,4G
  1139. /*输入制式源始值,返回索引值对应值*/
  1140. unsigned char getNetModeIndex(unsigned char netModeValue){
  1141. unsigned char i;
  1142. for(i=0;i<sizeof(netModeSetTable);i++){
  1143. if(netModeValue==netModeSetTable[i]) return i;
  1144. }
  1145. return 0xff;//无对应值
  1146. }
  1147. /*输入制式索引值,返回制式源始值*/
  1148. unsigned char getNetModeValue(unsigned char netModeIndex){
  1149. if(netModeIndex>=sizeof(netModeSetTable)) return 0xff;
  1150. else return netModeSetTable[netModeIndex];
  1151. }
  1152. /*输入制式索引值,发送对应该命令给模块*/
  1153. void netModeSetCmd(unsigned char netMode){
  1154. char buf[30];
  1155. snprintf(buf, sizeof(buf), "AT+CTEC=%d,%d\r\n",ctecCurrentSet, netMode);
  1156. msgAtSend(buf);
  1157. }
  1158. #define NET_MODE_NUM 3
  1159. void uiShowNetSel(char StatusUpdate){
  1160. static const char *netMode[NET_MODE_NUM+1]={
  1161. "AUTO",
  1162. "2G",
  1163. "4G",
  1164. ""
  1165. };
  1166. char Features[NET_MODE_NUM];
  1167. unsigned char i;
  1168. if(StatusUpdate){
  1169. guiClearAll(guiGetBackColor());
  1170. guiShowCaption(0,"网络设置",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  1171. uiMenuShowBottomLine();
  1172. for(i=0;i<NET_MODE_NUM;i++){
  1173. if(i==newPara.netMode) Features[i]=1;
  1174. else Features[i]=0;
  1175. }
  1176. ListBoxInit(&sutListBox,netMode,0,commonIcon2,Features,0);
  1177. uiMenuShowBottomIndacitor("保存", "返回");
  1178. }
  1179. }
  1180. void uiShowNetSelResponse(void){
  1181. unsigned short key=ListBoxResponse(&sutListBox);
  1182. if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_SYS_SEL);
  1183. else if(MKEY_VALUE_MENU==key){
  1184. getStackStruct()->ok_back=1;
  1185. if(sutListBox.handle*2 != newPara.netMode){
  1186. newPara.netMode=sutListBox.handle*2;
  1187. MSG_INFO(1, "netMode update:%d", newPara.netMode);
  1188. sysIniSave();
  1189. netModeSetCmd(newPara.netMode);
  1190. }
  1191. uISetNextStatus(UIS_MENU_SYS_SEL);
  1192. }
  1193. }
  1194. /*****************************网络设置结束**********************************/
  1195. /*****************************卡选择设置开始**********************************/
  1196. #define SIM_MODE_NUM 2
  1197. void uiShowSimSel(char StatusUpdate){
  1198. static const char *simMode[SIM_MODE_NUM+1]={
  1199. "卡1",
  1200. "卡2",
  1201. ""
  1202. };
  1203. char Features[SIM_MODE_NUM];
  1204. unsigned char i;
  1205. if(StatusUpdate){
  1206. guiClearAll(guiGetBackColor());
  1207. guiShowCaption(0,"SIM设置",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  1208. uiMenuShowBottomLine();
  1209. for(i=0;i<SIM_MODE_NUM;i++){
  1210. if(i==sutApp.simSel) Features[i]=1;
  1211. else Features[i]=0;
  1212. }
  1213. ListBoxInit(&sutListBox,simMode,0,commonIcon2,Features,sutApp.simSel);
  1214. uiMenuShowBottomIndacitor("保存", "返回");
  1215. }
  1216. }
  1217. void uiShowSimSelResponse(void){
  1218. char buf[30];
  1219. char temp;
  1220. unsigned short key=ListBoxResponse(&sutListBox);
  1221. if(MKEY_VALUE_ESC==key){
  1222. if(getStackStruct()->FastUiChange)uISetNextStatus(UIS_STANDBY);
  1223. else uISetNextStatus(UIS_MENU_SYS_SEL);
  1224. }else if(MKEY_VALUE_MENU==key){
  1225. getStackStruct()->ok_back=1;
  1226. if((sutListBox.handle)!= sutApp.simSel){
  1227. if(sutListBox.handle)temp=0;
  1228. else temp=1;
  1229. snprintf(buf, sizeof(buf), "AT+SIMCROSS=%d\r\n",temp);
  1230. msgToModem(buf);
  1231. MSG_INFO(1, buf);
  1232. guiShowMessageBox("请重启设备");
  1233. msgToModem("AT+TRB\r\n");
  1234. LSAPI_OSI_ThreadSleep(1000);
  1235. for(;;){
  1236. MSG_INFO(1, "card changed, wait user reboot");
  1237. CTL_POWER_HOLD(0);
  1238. LSAPI_OSI_ThreadSleep(1000);
  1239. }
  1240. }
  1241. uISetNextStatus(UIS_MENU_SYS_SEL);
  1242. }
  1243. }
  1244. /*****************************卡选择设置结束**********************************/
  1245. /*****************************功耗设置开始**********************************/
  1246. typedef enum{
  1247. PMODE_HIGH,
  1248. PMODE_INTELLECTUAL,
  1249. PMODE_LOW_PWR
  1250. }PWR_ENUMDEF;
  1251. void pwrModeSetCmd(unsigned char pwrMode){
  1252. unsigned char seg1;
  1253. char buf[30];
  1254. if(pwrMode==PMODE_HIGH){
  1255. seg1=0;
  1256. }else if(pwrMode==PMODE_INTELLECTUAL){
  1257. seg1=1;
  1258. }else if(pwrMode==PMODE_LOW_PWR){
  1259. seg1=2;
  1260. }else return;
  1261. snprintf(buf, sizeof(buf), "AT+POC=7A0000%02X\r\n",seg1);
  1262. msgAtSend(buf);
  1263. }
  1264. void pwrModeAckHandler(unsigned char seg1, unsigned char seg2){
  1265. if(seg1==PMODE_HIGH && newPara.pwrMode != PMODE_HIGH){
  1266. newPara.pwrMode=seg1;
  1267. goto SAVE_PWR_MODE;
  1268. }else if(seg1==PMODE_INTELLECTUAL && newPara.pwrMode != PMODE_INTELLECTUAL){
  1269. newPara.pwrMode=seg1;
  1270. goto SAVE_PWR_MODE;
  1271. }else if(seg1==PMODE_LOW_PWR && newPara.pwrMode != PMODE_LOW_PWR){
  1272. newPara.pwrMode=seg1;
  1273. goto SAVE_PWR_MODE;
  1274. }
  1275. return;
  1276. SAVE_PWR_MODE:
  1277. sysIniSave();
  1278. pwrModeSetCmd(newPara.pwrMode);
  1279. }
  1280. #define PWR_MODE_NUM 3
  1281. void uiShowPwrSel(char StatusUpdate){
  1282. static const char *pwrMode[PWR_MODE_NUM+1]={
  1283. "高性能模式",
  1284. "智能模式",
  1285. "低功耗模式",
  1286. "",
  1287. };
  1288. char Features[PWR_MODE_NUM];
  1289. unsigned char i;
  1290. if(StatusUpdate){
  1291. guiClearAll(guiGetBackColor());
  1292. guiShowCaption(0,"功耗设置",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  1293. uiMenuShowBottomLine();
  1294. for(i=0;i<PWR_MODE_NUM;i++){
  1295. if(i==newPara.pwrMode) Features[i]=1;
  1296. else Features[i]=0;
  1297. }
  1298. ListBoxInit(&sutListBox,pwrMode,0,commonIcon2,Features,newPara.pwrMode);
  1299. uiMenuShowBottomIndacitor("保存", "返回");
  1300. }
  1301. }
  1302. void uiShowPwrSelResponse(void){
  1303. unsigned short key=ListBoxResponse(&sutListBox);
  1304. if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_SYS_SEL);
  1305. else if(MKEY_VALUE_MENU==key){
  1306. getStackStruct()->ok_back=1;
  1307. if(sutListBox.handle != newPara.pwrMode){
  1308. newPara.pwrMode=sutListBox.handle;
  1309. MSG_INFO(1, "pwrMode update:%d", newPara.pwrMode);
  1310. sysIniSave();
  1311. pwrModeSetCmd(newPara.pwrMode);
  1312. }
  1313. uISetNextStatus(UIS_MENU_SYS_SEL);
  1314. }
  1315. }
  1316. /*****************************功耗设置结束**********************************/
  1317. /*****************************服务器设置输入密码开始**********************************/
  1318. void uiShowServerPassSel(char StatusUpdate){
  1319. if(StatusUpdate){
  1320. guiClearAll(guiGetBackColor());
  1321. guiShowCaption(0,"密码验证",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  1322. uiMenuShowBottomLine();
  1323. NumEditInit(&sutNumEdit,(GLCD_WIDTH-6*8)/2,(GLCD_HEIGHT-16)/2,"000000");
  1324. NumEditShow(&sutNumEdit);
  1325. uiMenuShowBottomIndacitor("[上]加值", "[下]移动");
  1326. }
  1327. }
  1328. void uiShowServerSelPassResponse(void){
  1329. unsigned short key=getKeyValue();
  1330. NumEditResponse(&sutNumEdit);
  1331. if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_SYS_SEL);
  1332. else if(MKEY_VALUE_MENU==key){
  1333. if(memcmp(sutNumEdit.buffer, getMenuKey(), 6)==0) uISetNextStatus(UIS_MENU_SYS_SERVER);
  1334. else{
  1335. guiShowMessageBox("密码错误");
  1336. LSAPI_OSI_ThreadSleep(1000);
  1337. getStackStruct()->ok_back=1;
  1338. uISetNextStatus(UIS_MENU_SYS_SEL);
  1339. }
  1340. }
  1341. }
  1342. /*****************************服务器设置输入密码结束**********************************/
  1343. /*****************************服务器设置开始**********************************/
  1344. void uiShowServerSel(char StatusUpdate){
  1345. static const char *serIcons[]={
  1346. "Ser.bmp",
  1347. "Sersel.bmp",
  1348. ""
  1349. };
  1350. static const char *serName[]={
  1351. "杭州服务器",
  1352. "山东服务器",
  1353. "IP分发服务器",
  1354. "集群服务器",
  1355. "自定义服务器",
  1356. "",
  1357. };
  1358. char Features[5];
  1359. unsigned char tempSer,i;
  1360. if(StatusUpdate){
  1361. guiClearAll(guiGetBackColor());
  1362. guiShowCaption(0,"服务器列表",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  1363. uiMenuShowBottomLine();
  1364. uiMenuShowBottomIndacitor("确认", "返回");
  1365. tempSer=newPara.serList.defaultuse;
  1366. for(i=0;i<=SERVER_UR;i++){
  1367. if(i==tempSer) Features[i]=1;
  1368. else Features[i]=0;
  1369. }
  1370. ListBoxInit(&sutListBox,serName,0,serIcons,Features,0);
  1371. }
  1372. }
  1373. void uiShowServerSelResponse(void){
  1374. unsigned char tempSer;
  1375. char buf[50],buf1[100];
  1376. unsigned short key=ListBoxResponse(&sutListBox);
  1377. if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_SYS_SEL);
  1378. else if(MKEY_VALUE_MENU==key){
  1379. tempSer=sutListBox.handle;
  1380. if(tempSer != newPara.serList.defaultuse){
  1381. newPara.serList.defaultuse=tempSer;
  1382. sysIniSave();
  1383. getGIPAddr();
  1384. snprintf(buf, sizeof(buf), "ip=%s;domain=%s;",getPIPAddr(),getDOMAINAddr());
  1385. AscStrTurnHexStr(buf,buf1);
  1386. msgAtSend("AT+POC=010000");
  1387. msgAtSend(buf1);
  1388. msgAtSend("\r\n");
  1389. LSAPI_OSI_ThreadSleep(100);
  1390. msgAtSend("AT+POC=040000\r\n");
  1391. }
  1392. uISetNextStatus(UIS_STANDBY );
  1393. }
  1394. }
  1395. /*****************************服务器设置结束**********************************/
  1396. /*****************************版本设置开始**********************************/
  1397. unsigned char fotaStep;
  1398. unsigned int fotaTick;
  1399. void fotaStepSet(unsigned char newStep){
  1400. fotaStep=newStep;
  1401. }
  1402. void fotaMsgShow(char *msg){
  1403. #if 1
  1404. int len=guiGetStrXLen((char *)msg,FONT_MODE_12X12);
  1405. #else
  1406. int len=guiGetStrXLen((char *)msg,FONT_MODE_16X16);
  1407. #endif
  1408. guiClearRect(0, 60, GLCD_WIDTH-1, 60+16,guiGetBackColor());
  1409. #if 1
  1410. guiShowStr((GLCD_WIDTH-len)/2,60+2, msg,FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
  1411. #else
  1412. guiShowStr((GLCD_WIDTH-len)/2,60, msg,FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
  1413. #endif
  1414. }
  1415. char loadMsg=0;
  1416. void showLoading(void){
  1417. loadMsg=1;
  1418. }
  1419. void uiShowVersionSel(char StatusUpdate){
  1420. char buf[50];
  1421. if(StatusUpdate){
  1422. sutApp.fotaVersion[0]=0;
  1423. guiClearAll(guiGetBackColor());
  1424. guiShowCaption(0,"版本更新",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  1425. fotaStep=10;//0
  1426. loadMsg=0;
  1427. fotaMsgShow("正在检测版本");
  1428. uiMenuShowBottomLine();
  1429. uiMenuShowBottomIndacitor("确定", "返回");
  1430. uTimerStart(&fotaTick, 5000);
  1431. tupParaSet(&tupsendPara, AUTH_FOTA_PORT, authFotaRecv_cb,AUTH_UDP_THREAD_STACK);
  1432. if(1==netWork.netReady)tryConnectTup(domainInfo.address,TUP_UDP,&tupsendPara);
  1433. }
  1434. switch(fotaStep){
  1435. case 0:
  1436. if(uTimerExpired(&fotaTick)){
  1437. fotaMsgShow("检测超时");
  1438. // if(1==netWork.netReady){
  1439. // infoPacketAndSend(BND_PSN,ohpocGetIMEI(),OHPOC_VERSION,OHPOC_MODLE,UDP_HEART_TICK_NON_4G,UDP_HEART_TICK__4G);
  1440. // }
  1441. fotaStep=4;
  1442. }
  1443. break;
  1444. case 1://等待用户确定
  1445. break;
  1446. case 2://用户确定后等待结果
  1447. if(uTimerExpired(&fotaTick)){
  1448. fotaMsgShow("超时退出");
  1449. fotaStep=4;
  1450. }
  1451. if(loadMsg!=0){
  1452. fotaMsgShow("正在下载");
  1453. loadMsg=0;
  1454. }
  1455. break;
  1456. case 3://升级成功,等待重启
  1457. LSAPI_OSI_ThreadSleep(2000);
  1458. msgAtSend("AT+TRB\r\n");
  1459. MSG_INFO(1, "Reset system!!!");
  1460. while(1){LSAPI_OSI_ThreadSleep(1000);}
  1461. break;
  1462. case 4://延时显示2秒后退出
  1463. uTimerStart(&fotaTick, 2000);
  1464. fotaStep=5;
  1465. break;
  1466. case 5://退出升级流程
  1467. if(uTimerExpired(&fotaTick)) uISetNextStatus(UIS_MENU_SYS_SEL);
  1468. break;
  1469. case 6://无更新版本
  1470. fotaMsgShow("无更新版本");
  1471. fotaStep=4;
  1472. break;
  1473. case 7://升级失败
  1474. fotaMsgShow("升级失败");
  1475. fotaStep=4;
  1476. AppFotaInfo.fota_statue=DISENABLE;
  1477. break;
  1478. case 8://下载成功
  1479. fotaMsgShow("下载成功,重启更新");
  1480. fotaStep=3;
  1481. break;
  1482. case 9://
  1483. snprintf(buf, sizeof(buf), "是否更新到:%s",targetVersion);
  1484. fotaMsgShow(buf);
  1485. fotaStep=1;
  1486. break;
  1487. case 10:
  1488. if(uTimerExpired(&fotaTick)){
  1489. fotaStep=0;
  1490. if(1==netWork.netReady){
  1491. infoPacketAndSend(BND_PSN,ohpocGetIMEI(),OHPOC_VERSION,OHPOC_MODLE,UDP_HEART_TICK_NON_4G,UDP_HEART_TICK__4G);
  1492. }
  1493. uTimerStart(&fotaTick, 2000);
  1494. }
  1495. break;
  1496. }
  1497. }
  1498. void uiShowVersionSelResponse(void){
  1499. unsigned char key=getKeyValue();
  1500. if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_SYS_SEL);
  1501. else if(MKEY_VALUE_MENU==key){
  1502. if(fotaStep==1){
  1503. fotaMsgShow("请勿断电!");
  1504. fotaStep=2;
  1505. uTimerStart(&fotaTick, 10000);//1
  1506. AppFotaInfo.fota_statue=ENABLE;
  1507. }
  1508. }
  1509. }
  1510. /*****************************版本设置结束**********************************/
  1511. /*****************************提示音设置开始********************************/
  1512. unsigned char noteSetTmp;
  1513. static void switchFlash(void){
  1514. char info[30];
  1515. unsigned short x,y,len;
  1516. if(noteSetTmp==0) snprintf(info, sizeof(info), "关闭");
  1517. else snprintf(info, sizeof(info), "打开");
  1518. len=guiGetStrXLen((char *)info, FONT_MODE_12X12);
  1519. x=(GLCD_WIDTH-len)/2;
  1520. y=UI_CONTENT_SHOW_Y+(GLCD_HEIGHT-UI_CONTENT_SHOW_Y)/2-12;
  1521. guiShowStr(x,y,info, FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
  1522. }
  1523. void uiShowNoteSel(char StatusUpdate){
  1524. if(StatusUpdate){
  1525. guiClearAll(guiGetBackColor());
  1526. guiShowCaption(0,"提示音设置",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  1527. uiMenuShowBottomLine();
  1528. noteSetTmp=newPara.KeySound;
  1529. switchFlash();
  1530. uiMenuShowBottomIndacitor("保存", "返回");
  1531. }
  1532. }
  1533. void uiShowNoteSelResponse(void){
  1534. unsigned short key=getKeyValue();
  1535. if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_SYS_SEL);
  1536. else if(MKEY_VALUE_MENU==key){
  1537. getStackStruct()->ok_back=1;
  1538. if(newPara.KeySound != noteSetTmp){
  1539. newPara.KeySound=noteSetTmp;
  1540. #ifndef ENABLE_PWM_BEEP
  1541. if(noteSetTmp==0) msgAtSend("AT+TONES=0\r\n");
  1542. else msgAtSend("AT+TONES=1\r\n");
  1543. #endif
  1544. sysIniSave();
  1545. }
  1546. uISetNextStatus(UIS_MENU_SYS_SEL);
  1547. }else if(MKEY_VALUE_DOWN || MKEY_VALUE_UP){
  1548. if(noteSetTmp==0) noteSetTmp=1;
  1549. else noteSetTmp=0;
  1550. switchFlash();
  1551. }
  1552. }
  1553. /*****************************提示音设置结束********************************/
  1554. /*****************************MIC增益**********************************/
  1555. unsigned char MictempIndex;
  1556. static void MICcugainFlash(char type){
  1557. char buf[50];
  1558. unsigned short x=4,y=56,value;
  1559. if(sutUIstatus.Status==UIS_MENU_SYS_MICCU)value=7;
  1560. else if(sutUIstatus.Status==UIS_MENU_SYS_MICXI)value=16;
  1561. if(type==0) guiShowStr(x+25, y, "设置:", FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
  1562. else if(type==1){
  1563. if(++MictempIndex>value) MictempIndex=0;
  1564. }else if(type==2){
  1565. if(MictempIndex>0) MictempIndex--;
  1566. else MictempIndex=value;
  1567. }
  1568. snprintf(buf, sizeof(buf), "%02d", MictempIndex);
  1569. guiShowStr(x+80, y, buf, FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
  1570. }
  1571. void uiShowMiccugainUISel(char StatusUpdate){
  1572. if(StatusUpdate){
  1573. guiClearAll(guiGetBackColor());
  1574. if(sutUIstatus.Status==UIS_MENU_SYS_MICCU){
  1575. guiShowCaption(0,"MIC增益粗调",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  1576. MictempIndex =newPara.VolMicLvCu;
  1577. }
  1578. else{
  1579. guiShowCaption(0,"MIC增益微调",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  1580. MictempIndex=newPara.VolMicLvXi;
  1581. }
  1582. uiMenuShowBottomLine();
  1583. //MictempIndex=newPara.MicCulv;
  1584. MICcugainFlash(0);
  1585. uiMenuShowBottomIndacitor("保存", "返回");
  1586. }
  1587. }
  1588. void uiShowMicCuSelResponse(void){
  1589. char buf[30];
  1590. unsigned short key=getKeyValue();
  1591. if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_SYS_SEL);
  1592. else if(MKEY_VALUE_DOWN==key)MICcugainFlash(1);
  1593. else if(MKEY_VALUE_UP==key) MICcugainFlash(2);
  1594. else if(MKEY_VALUE_MENU==key){
  1595. getStackStruct()->ok_back=1;
  1596. if(sutUIstatus.Status==UIS_MENU_SYS_MICCU){
  1597. if(MictempIndex != newPara.VolMicLvCu){
  1598. newPara.VolMicLvCu=MictempIndex;
  1599. snprintf(buf, sizeof(buf),"AT+CACCP=0,0,0,\"%02x00%02x00\"\r\n",newPara.VolMicLvCu,newPara.VolMicLvXi);
  1600. msgAtSend(buf);
  1601. MSG_INFO(0,buf);
  1602. sysIniSave();
  1603. }
  1604. }else if(sutUIstatus.Status==UIS_MENU_SYS_MICXI){
  1605. if(MictempIndex != newPara.VolMicLvXi){
  1606. newPara.VolMicLvXi=MictempIndex;
  1607. snprintf(buf, sizeof(buf),"AT+CACCP=0,0,0,\"%02x00%02x00\"\r\n",newPara.VolMicLvCu,newPara.VolMicLvXi);
  1608. msgAtSend(buf);
  1609. MSG_INFO(0,buf);
  1610. sysIniSave();
  1611. }
  1612. }
  1613. uISetNextStatus(UIS_MENU_SYS_SEL);
  1614. }
  1615. }
  1616. /*****************************BND 新旧平台选择**********************************/
  1617. void uiShowPingTaiSel(char StatusUpdate){
  1618. static const char *PTMode[2+1]={
  1619. "博纳德",
  1620. "芯平台",
  1621. ""
  1622. };
  1623. char Features[2];
  1624. unsigned char i;
  1625. if(StatusUpdate){
  1626. guiClearAll(guiGetBackColor());
  1627. guiShowCaption(0,"平台选择",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  1628. uiMenuShowBottomLine();
  1629. for(i=0;i<2;i++){
  1630. if(i==newPara.newold_plam) Features[i]=1;
  1631. else Features[i]=0;
  1632. }
  1633. ListBoxInit(&sutListBox,PTMode,0,commonIcon2,Features,newPara.newold_plam);
  1634. uiMenuShowBottomIndacitor("保存", "返回");
  1635. }
  1636. }
  1637. void uiShowPingTaiSelResponse(void){
  1638. }
  1639. /*****************************BND 新旧平台选择结束**********************************/
  1640. /*****************************音质设置开始**********************************/
  1641. unsigned char voiceSetTmp;
  1642. static void switchVolceFlash(void){
  1643. char info[30];
  1644. unsigned short x,y,len;
  1645. if(voiceSetTmp==0) snprintf(info, sizeof(info), "标准");
  1646. else snprintf(info, sizeof(info), "高清");
  1647. len=guiGetStrXLen((char *)info, FONT_MODE_12X12);
  1648. x=(GLCD_WIDTH-len)/2;
  1649. y=UI_CONTENT_SHOW_Y+(GLCD_HEIGHT-UI_CONTENT_SHOW_Y)/2-12;
  1650. guiShowStr(x,y,info, FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
  1651. }
  1652. void uiShowVoiceSel(char StatusUpdate){
  1653. if(StatusUpdate){
  1654. guiClearAll(guiGetBackColor());
  1655. guiShowCaption(0,"音质设置",UI_STATUS_ITEM_Y+1,guiGetBackColor(),guiGetForeColor(),FONT_MODE_12X12);
  1656. uiMenuShowBottomLine();
  1657. voiceSetTmp=newPara.voiceSel;
  1658. switchVolceFlash();
  1659. uiMenuShowBottomIndacitor("保存", "返回");
  1660. }
  1661. }
  1662. void uiShowVoiceSelResponse(void){
  1663. unsigned short key=getKeyValue();
  1664. if(MKEY_VALUE_ESC==key) uISetNextStatus(UIS_MENU_SYS_SEL);
  1665. else if(MKEY_VALUE_MENU==key){
  1666. getStackStruct()->ok_back=1;
  1667. if(newPara.voiceSel != voiceSetTmp){
  1668. newPara.voiceSel=voiceSetTmp;
  1669. voiceModeSet(newPara.voiceSel);
  1670. sysIniSave();
  1671. }
  1672. uISetNextStatus(UIS_MENU_SYS_SEL);
  1673. }else if(MKEY_VALUE_DOWN || MKEY_VALUE_UP){
  1674. if(voiceSetTmp==0) voiceSetTmp=1;
  1675. else voiceSetTmp=0;
  1676. switchVolceFlash();
  1677. }
  1678. }
  1679. /*****************************音质设置结束**********************************/
  1680. #ifdef USE_LEFT_MOVING
  1681. /***************************主界面滚动显示**********************************/
  1682. #define MOVING_ITME_NUM 3 //显示三条项目
  1683. #define MAX_ROW_BYTE (20+1+2) //最多显示20个字节,10个中文
  1684. #define MAX_SHOW_BYTE 12 //最多一次性显示10个字节
  1685. void leftMoveStr(char *name, unsigned short len){
  1686. char temp[3];
  1687. unsigned char move=1;
  1688. unsigned short i;
  1689. if(name[0] > 0x80) move=2;
  1690. for(i=0;i<move;i++) temp[i]=name[i];
  1691. for(i=0;i<len-move;i++) name[i]=name[i+move];
  1692. for(i=0;i<move;i++) name[i+len-move]=temp[i];
  1693. }
  1694. void getRealShow(char *des, char *src,int maxsize)
  1695. {//??è?×??à12+1??×??ú??ê?
  1696. int i,j,cpsize=maxsize-1;
  1697. for(i=0;i<cpsize;i++){
  1698. if(src[i]>0x80){
  1699. if(i+2>cpsize){//装不下了,停止
  1700. break;
  1701. }
  1702. des[i]=src[i];
  1703. des[i+1]=src[i+1];
  1704. i++;
  1705. }else des[i]=src[i];
  1706. }
  1707. des[i]=0;
  1708. }
  1709. void showbufdata(char type, unsigned char *data, int len){
  1710. char info[100],buf[3];
  1711. int i;
  1712. sprintf(info, "D[%d]%c:",len,type);
  1713. for(i=0;i<len;i++){
  1714. sprintf(buf, "%02x",data[i]);
  1715. strcat(info, buf);
  1716. }
  1717. MSG_INFO(1, info);
  1718. }
  1719. //除去标识(群组:/成员:/话权:)外的字节数,多的1字节用于加空格
  1720. void mainScreenShowMoving(unsigned short y, unsigned char reset,char *gname,char *uname,char *voicePri,char voicetype){
  1721. unsigned char i;
  1722. int j,len;
  1723. unsigned short showX,showY;
  1724. //显示缓存,最多显示7个中文
  1725. static const char *indicators[]={
  1726. "Group2.bmp",
  1727. "people2.bmp",
  1728. "Phone.bmp",
  1729. "Csend.bmp",
  1730. "Creceive.bmp",
  1731. "Onecall.bmp",
  1732. ""
  1733. };
  1734. static char item[MOVING_ITME_NUM][MAX_ROW_BYTE];
  1735. static unsigned char ItemMd5[MOVING_ITME_NUM][16];
  1736. unsigned char tempMd5[16]={0};
  1737. unsigned char *ptempMd5;
  1738. char *ptr,*showPtr;
  1739. char showMax[MAX_ROW_BYTE]={0};//用于临时存储条目全内容,判定是否发生变化
  1740. char needMove;
  1741. MD5_CTX mdContext;
  1742. static char *Picon[MOVING_ITME_NUM];
  1743. for(i=0;i<MOVING_ITME_NUM;i++){
  1744. showX=1;
  1745. showY=y+i*(12+8);//12x12高度,行间距2
  1746. ptempMd5=&ItemMd5[i][0];
  1747. showPtr=&item[i][0];
  1748. switch(i){
  1749. case 0://群组:默认群组
  1750. snprintf(showMax, sizeof(showMax), "%s ",gname);
  1751. if(sutPocStatus.danHuStatus==0)Picon[i]=indicators[0];
  1752. else Picon[i]=indicators[5];
  1753. break;
  1754. case 1://成员:测试组1
  1755. Picon[i]=indicators[1];
  1756. snprintf(showMax, sizeof(showMax), "%s ",uname);
  1757. break;
  1758. case 2://话权:空闲
  1759. if(voicetype==0)Picon[i]=indicators[2];
  1760. else if(voicetype==1)Picon[i]=indicators[3];
  1761. else if(voicetype==2)Picon[i]=indicators[4];
  1762. snprintf(showMax, sizeof(showMax), "%s ",voicePri);
  1763. break;
  1764. }
  1765. ptr=showMax;
  1766. len=strlen(ptr);
  1767. //计算buff的md5
  1768. MD5Init(&mdContext);//初始化MD5
  1769. MD5Update(&mdContext,ptr,len);
  1770. MD5Final(&mdContext);
  1771. memcpy(tempMd5, mdContext.digest,16);
  1772. //检测是否需要移动处理
  1773. if(len>MAX_SHOW_BYTE) needMove=1;
  1774. else needMove=0;
  1775. if(memcmp(ptempMd5, tempMd5, 16)|| reset){//内容发生了变化
  1776. guiClearRect(0, showY, GLCD_WIDTH-1, showY+16,guiGetBackColor());
  1777. //guiShowStr(showX, showY+2, &indicators[i][0], FONT_MODE_12X12, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
  1778. guiShowBmp(2,showY+2 , Picon[i]);
  1779. // if(type==0) guiShowBmp(2, UI_VOICE_SHOW_Y, "Phone.bmp");
  1780. // else if(type==1){
  1781. // color=COLOR_RED;
  1782. // guiShowBmp(2, UI_VOICE_SHOW_Y, "Csend.bmp");
  1783. // }else if(type==2){
  1784. // guiShowBmp(2, UI_VOICE_SHOW_Y, "Creceive.bmp");
  1785. // color=COLOR_DEEP_GREEN;
  1786. // }
  1787. // if(sutPocStatus.danHuStatus==0) guiShowBmp(2, UI_GROUP_SHOW_Y, "Group2.bmp");
  1788. // else{
  1789. // guiShowBmp(2, UI_GROUP_SHOW_Y, "Onecall.bmp");
  1790. // color=COLOR_RED;
  1791. }
  1792. showX += 20;
  1793. if(needMove==0){
  1794. //if(*sum!=tsum|| reset){//内容发生了变化
  1795. if(memcmp(ptempMd5, tempMd5, 16)|| reset){//内容发生了变化
  1796. //只显示一次即可
  1797. snprintf(showPtr, MAX_ROW_BYTE, "%s", ptr);
  1798. guiClearRect(showX, showY, GLCD_WIDTH-1, showY+16,guiGetBackColor());
  1799. if(i==2){
  1800. if(voicetype==0)guiShowStr(showX,showY, showMax, FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
  1801. else if(voicetype==1)guiShowStr(showX,showY, showMax, FONT_MODE_16X16, REVERSED_NO, COLOR_RED, guiGetBackColor());
  1802. else if(voicetype==2)guiShowStr(showX,showY, showMax, FONT_MODE_16X16, REVERSED_NO, COLOR_BLUE, guiGetBackColor());
  1803. }else guiShowStr(showX,showY, showMax, FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
  1804. }
  1805. }else{//做移动处理
  1806. //if(*sum!=tsum) memcpy(showPtr, ptr, MAX_ROW_BYTE);
  1807. if(memcmp(ptempMd5, tempMd5, 16)) memcpy(showPtr, ptr, MAX_ROW_BYTE);
  1808. else leftMoveStr(showPtr, strlen(showPtr));
  1809. getRealShow(showMax, showPtr,MAX_SHOW_BYTE);
  1810. guiClearRect(showX, showY, GLCD_WIDTH-1, showY+16,guiGetBackColor());
  1811. if(i==2){
  1812. if(voicetype==0)guiShowStr(showX,showY, showMax, FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
  1813. else if(voicetype==1)guiShowStr(showX,showY, showMax, FONT_MODE_16X16, REVERSED_NO, COLOR_RED, guiGetBackColor());
  1814. else if(voicetype==2)guiShowStr(showX,showY, showMax, FONT_MODE_16X16, REVERSED_NO, COLOR_BLUE, guiGetBackColor());
  1815. }else guiShowStr(showX,showY, showMax, FONT_MODE_16X16, REVERSED_NO, COLOR_BLACK, guiGetBackColor());
  1816. }
  1817. memcpy( ptempMd5,tempMd5, 16);
  1818. }
  1819. }
  1820. #endif