【正文】
(GpMainLayout)。 } void MainTab::timerEvent(QTimerEvent * event){ GPS_DATA mGPSData。 MainTab t。\039。} //================== csum[0]=sumamp。 if(csum[1]=10) csum[1]+=39。// 0 is error } int zh_gpsDriver::fifoctl(FifoType * priv ,int data ,const unsigned char flag) { int temp = 1。 } privbuffer[privw_idx] = data。 //保證是環(huán)狀的 FIFO。 =0。 PDF(1,gps driver construct!\n)。} else if(idata==39。pcmd_bufpos++。 // PDF(4,pos=%d ibufpos=%d a msg=%s\n,pos,ibufpos,pStrBuffer)。 int fz。 } int zh_gpsDriver::GPGSV_Analysis( GPS_GPGSV * pGPS_GPGSV) { switch(pGPS_GPGSVGSV_ID){ case 1:memcpy(amp。(pGPS_GPGSVSta3),sizeof(STA_INFO))。 memcpy(amp。(pGPS_GPGSVSta4),sizeof(STA_INFO))。 32 memcpy(amp。 } } int zh_gpsDriver::CMD_Analysis( CMD_BUF * pcmd_buf ){ char* pcmd。buf)。){ PDF(3,V invalid data\n)。mpGPS_GPRMClatitude,amp。 33 //請(qǐng)檢查 sscanf 的返回值,可能會(huì)失敗,如果小于要收得的數(shù)目。 mpGPS_GPRMClatitude=ddmm2dddd((mpGPS_GPRMClatitude/100))。pcmd[1])) { PDF(2,check sum error\n)。mpGPS_GPGSVStaNOB, amp。mpGPS_GPGSV, amp。mpGPS_GPGSV, mpGPS_GPGSVsumCheck)。 } void zh_gpsDriver::CMDBUF_Init( CMD_BUF * pcmd_buf ) { pcmd_bufpos=0。 } int zh_gpsDriver::GetData(GPS_STASNR amp。 35 if ( == 1) {printf(open device:%s error!\n,)。attr,B4800)。attr,B9600)。 } void zh_gpsDriver::WfifoFixString(char data) { static int flag=0。 else flag=1。j++) { readbytes = (int)read( fd, rdBuf, sizeof(rdBuf))。buf)。pcmd_buf[0],mapinfo:)。subWidth)。pcmd_buf[0],xxx)。 PDF(2,OfilePtr=%s\n, OfilePtr)。 //====================== } zhMap::zhMap(QWidget * parent ,const char * name):QWidget(parent,name) { /* A_lont=。 38 mapPath=()。 Qstr) { QStrmappath=Qstr。 } int zhMap::getMapABinfo(GPS_DATA amp。 pixmap) { int xcenter,ycenter。 A_lont)) { PDF(1,out of lont range!\n)。 //==計(jì)算出請(qǐng)求圖的四點(diǎn)像素坐標(biāo) Ax=xcenter(zhGpsWidth)/2。 //由四點(diǎn)像素坐標(biāo)計(jì)算要裝載的圖片號(hào)。 idj=Cy/subWidth。 picloadFlag=(fileStr)。 AyH=subWidthAy%subWidth。 AyH=zhGpsHeight) { (0,0,pixmapA,(Ax%。pixmap,this)。 picloadFlag=(fileStr)。 idB=idj*WidthNumber+idi。 Dx=Bx。 }//out of range!! //中心點(diǎn)轉(zhuǎn)換成像素點(diǎn) xcenter=(int)(()*pixPerLont)。 //判斷是否在范圍 if(!(B_lont amp。 } int zhMap::getCurrMap(const GPS_DATA amp。 pixPerLati=((double)Height)/(A_latiB_lati)。 //============= PDF(2,WidthNumber=%d HeightNumber=%d pixPerLont=%lf pixPerLati=%lf\n,WidthNumber,HeightNumber,pixPerLont,pixPerLati)。 subWidth=300。 } fclose(infile)。 FILE * infile。 return 0。Width,amp。 char msgid[20]。} //================ while(GPRS_GetTextLineFromFIFO(amp。 //================ for(j=0。039。return 1。attr,B9600)。return 1。 = open(, O_RDWR |O_NONBLOCK)。 =mpGPS_GPRMCgps_sw。buf)。mpGPS_GPGSV,amp。mpGPS_GPGSV,amp。mpGPS_GPGSVGSV_NOB,amp。pcmd_bufbuf[0],$GPGSV)。return 3。mpGPS_GPRMCmagneDeclinat,amp。 i= sscanf(pcmd,%[^,],%[^,],%c,%lf,%c,%lf,%c,%lf,%lf,%[^,],%lf,%c,%s, mpGPS_GPRMCGpsid, mpGPS_GPRMCutc_time,amp。 if(mpGPS_GPRMCgps_sw==39。pcmd[1])) { PDF(2,check sum error\n)。 break。([9]),amp。 memcpy(amp。([4]),amp。 memcpy(amp。 PDF(2,ddmm=%lf dddd:%lf\n ,ddmm,fi )。 return mpGPS_GPRMCgps_sw。 31 pcmd_bufbuf[pcmd_bufpos]=39。 break。fifo,idata,RD)。 mpGPS_GPGSV=amp。 =9600。} else { temp= privbuffer[privr_idx]。 PDF(2,buffer full\n)。 csum[0]==toupper(p[2]) )。 //======== csum[1]=(sumamp。p++。 最后的兩位是檢驗(yàn)碼的 hex(16 進(jìn)制 )轉(zhuǎn)成 ASCII 兩個(gè)符號(hào) (09, AF)。 //=============== PDF(3,TABMaster timer end\n)。 addTab(GpConfig,QString(CONFIG))。 GpGPS=new GPS。 通過(guò)這次畢業(yè)設(shè)計(jì),我在更加牢固 、靈活地掌握了所學(xué)的專(zhuān)業(yè)知識(shí)的同時(shí)。 功能實(shí)現(xiàn),測(cè)試通過(guò) 2) gps串口波特率設(shè)置。測(cè)試位置:四川省成都市。 mapinfo:,1500,1200,300。 開(kāi)始 檢測(cè)衛(wèi)星數(shù)量 N 衛(wèi)星數(shù)量 3? Y 結(jié)束 圖 strSNR 類(lèi)流程圖 strSNR class Flowchart debugPDF 類(lèi) debugPDF 類(lèi)負(fù)責(zé)提供調(diào)試信息,錯(cuò) 誤編號(hào)等內(nèi)容。最后根據(jù)讀取的 gps 信息,找到對(duì)應(yīng)的地圖,并顯示到 lcd 上。 G P S _D A T A G P S D a t a )C o n f igS e t M a p ( c on s t amp。 程序整體結(jié)構(gòu)框圖 G P S 類(lèi)+G P S D ri v e r * p G P S D ri v e rS t a S N R * p S t a S N RG P S I n f o* p G P S I n f oT im e rM a s t or+O p e ra t ion 1( )G P SD r iv e ri n t C O M f d 。 7 8 圖 主控芯片電路 Circuit of ultrasonic transmitting and receiving flash 芯片電路 . 1 nand flash 芯片電路 Nand flash 是操作系統(tǒng)的程序存儲(chǔ)區(qū),該芯片掉電不丟失數(shù)據(jù)、壽命長(zhǎng),可反復(fù)擦寫(xiě)。但容量較小,只有 128M,不適合存放大量地圖數(shù)據(jù),故不采用。為了便于調(diào)試和攜帶,采用 usb 接口 GPS 模塊。 1. 2. 2 操作系統(tǒng)選擇方案 Linux 操作系統(tǒng)廣泛應(yīng)用在嵌入式設(shè)備中,其源代碼開(kāi)放、免費(fèi);內(nèi)核性能高效、多任務(wù)、可制定;完善的圖形管理、文件管理機(jī)制; 良好的開(kāi)發(fā)環(huán)境 、強(qiáng)大的 工具集 。 方案二:采用 samsung 公司的 s3c2440。人們通過(guò)手持 GPS,能準(zhǔn)確知道自己所在的位置,從實(shí)現(xiàn)到導(dǎo)航、確定旅游路線、獲取地理信息等功能。 LINUX。通過(guò) GPS 模塊、 arm9 硬件環(huán)境、嵌入式 LINUX 操作系統(tǒng)、 TFT 觸摸屏等模塊來(lái)完成整個(gè)體系的運(yùn)作,使其實(shí)時(shí)采集 GPS 數(shù)據(jù),然后將 GPS 數(shù)據(jù)對(duì)應(yīng)的地圖顯示出來(lái),再利用串口將數(shù)據(jù)送入 PC 機(jī)數(shù)據(jù)庫(kù)中實(shí)現(xiàn)查詢等一系列功能。目 錄 0摘要 ? ?????????????????????????????????????? 1 1引言 ????????????????????????????????????? ??? 2 1系統(tǒng)方案選擇與論證 ????????????????????????????????? 3 ???????????????????????????????? 3 ?????????????????????????????? ? 4 主控芯片選擇方 案 ??????? ???????????????????? 4 操作系統(tǒng)及選擇方案 ? ?????? ??????????????????? 4 GPS模塊設(shè)計(jì)方案 ?????? ?? ??????????????????? ? 4 ?????????????? ????????????? 3 地圖文件存放方案 ? ????????????????????????? 錯(cuò)誤 !未定義書(shū)簽。 作者簽名: 日 期: 2 基于 ARMLINUX 的 GPS 導(dǎo)航系統(tǒng) 摘要 : 本系統(tǒng)由 GPS 數(shù)據(jù)采集并顯示、地圖顯示兩大部分組成,模擬 GPS 導(dǎo)航的過(guò)程。嵌入式操作系統(tǒng) The ARMLINUXbased GPS navigation system Zhu Heng (Institute: Institute of Physics and Electronic Information Professional: Applied Electronic Technology Education Year: 06 Instructor