全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:2171
推到 Plurk!
推到 Facebook!

BCB 中擷取 Com Port 的GPS資料

尚未結案
zonghan0626
一般會員


發表:12
回覆:4
積分:3
註冊:2003-10-27

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-11-26 11:07:56 IP:140.134.xxx.xxx 未訂閱
請問一下...我找了很久只看到給Delphi使用的元件...而且好像都不提供原始碼或是可以直加入我程式的元件....我市想要在BCB中接收由ComPort傳進來的GPS訊號...並且可以自動將不同的格式解讀...不知道BCB中是否有這樣的元件...例如TGPS (V1.04 D3 D4 D5 D6) http://delphi.ktop.com.tw/link.asp?topic_id=14079似乎只能給D使用...
taishyang
站務副站長


發表:377
回覆:5490
積分:4563
註冊:2002-10-08

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-11-26 14:28:44 IP:140.135.xxx.xxx 未訂閱
zonghan0626您好: 雖然我不知道有沒有這樣的元件 但是您可以試試下面聯結的方式讓Delphi的VCL給BCB用 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=23797 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=26857 順心
mieng
中階會員


發表:12
回覆:97
積分:81
註冊:2003-10-31

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-11-29 04:44:32 IP:61.221.xxx.xxx 未訂閱
嗯~~可以使用TStringList來將GPS的資料分開讀出,不用特意去找元件使用 再看一下NMEA的文件就可以快速的解讀了,下面是GPGGA和GPRMC的格式說明,因為之前我只需要定位資料所以只使用這兩種格式  
先引用一下dllee 版主 的範例
使用 TStringList 的 CommaText 就可以輕鬆分開 , 的資料,例如:    TStringList *txt=new TStringList;
txt->CommaText="改成所接收到的GPS訊號"
for(int i=0;iCount;i  )
{
  ShowMessage(txt->Strings[i]); // 第 i 個 , 分段的字串
}    /*
***************************************************************************
*                                                                         *
* OutputRMC                                                               *
*                                                                         *
* Input:                                                                  *
*                                                                         *
* Output:                                                                 *
*                                                                         *
* Description:                                                            *
*                RMC-Recommended minimum specific GPS/Transit data             *
*     and fix related data for a GPS receiver.                            *
*     The format is as following:                                         *
*                                                                         *
*     $GPRMC,HHMMSS.sss,a,DDMM.mmm,d,DDMM.mmm,d,z.z,y.y,ddmmyy,d.d,v      *
*     *hh                                                         *
*                                                                         *
*     $            Beginning of NMEA sentence                             *
*     GPRMC        Message Header                                         *
*                                                                         *
*     HHMMSS.sss   UTC of position fix                                    *
*                  HH    : hours    (00.24)                               *
*                  MM    : minutes  (00..59)                              *
*                  SS.sss: seconds  (00.000 .. 59.999)                    *
*                                                                         *
*     a            a     : status (A=valid, V=invalid)                    *
*                          invalid if over current DOP mask               *
*                                                                         *
*     DDMM.mmm,d   Latitude - N( )/S(-)                                   *
*                  DD    : degrees  (00..90)                              *
*                  MM.mmm: minutes  (00.000 .. 59.999)                    *
*                  d     : direction, N - north, S-south                  *
*                                                                         *
*     DDDMM.mmm,d  Longitude - E(-)/W( )                                  *
*                  DDD   : degrees  (00..180)                             *
*                  MM.mmm: minutes  (00.000 .. 59.999)                    *
*                  d     : direction, E - east, W-west                    *
*                                                                         *
*     z.z          speed over ground(knots)                               *
*                  0 if over current DOP mask                             *
*                                                                         *
*     y.y          track made good(reference to true north)               *
*                  0 if over current DOP mask                             *
*                                                                         *
*     ddmmyy       UTC date of position fix                               *
*                  dd    : day   (1...31)                                 *
*                  mm    : month (01..12)                                 *
*                  yy    : year  (00..99)                                 *
*                                                                         *
*     d.d          Magnetic variation(degrees) (0.0 .. 180.0)             *
*                                                                         *
*     v            Variation sense (E=east,W=west)                        *
*                                                                         *
*     *hh         Check Sum and sentence termination delimiter         *
*                                                                         *
****************************************************************************/    /***************************************************************************
 *
 *        OutputGGA
 *
 *        Input:        none
 *
 *        Output:  SUCCESS/FAILURE
 *
 *        The GGA-Global Positioning System Fix Data describes Time, position
 *        and fix related data for a GPS receiver.
 *
 *        The format is as following:
 *
 *         $GPGGA,HHMMSS.sss,DDMM.mmm,d,DDDMM.mmm,d,q,ss,h.h,a.a,z,,,,*CC
 *
 *                $            Beginning of NMEA sentence
 *                GPGGA        Message Header
 *
 *                HHMMSS.sss   UTC of position fix
 *                  HH    : hours    (00.24)
 *                  MM    : minutes  (00..59)
 *                  SS.sss: seconds  (00.000 .. 59.999)
 *
 *                DDMM.mmmm,d  Latitude - N( )/S(-)
 *                  DD    : degrees  (00..90)
 *                  MM.mmm: minutes  (00.000 .. 59.999)
 *                  d     : direction, N - north, S-south
 *
 *                DDDMM.mmmm,d Longitude - E(-)/W( )
 *                  DDD   : degrees  (00..180)
 *                  MM.mmm: minutes  (00.000 .. 59.999)
 *                  d     : direction, E - east, W-west
 *
 *                q            GPS Quality indicator
 *                  q     : 0 - Fix not available, or invalid
 *                          1 - GPS SPS Mode, fix valid
 *                          2 - Differential, GPS SPS Mode, fix valid
 *                          3 - GPS PPS Mode, fix valid
 *
 *                ss           Number of satellites in use (in tracking)
 *                  ss    : 0 .. 12
 *
 *                h.h          Horizontal dilution of precision
 *                  h.h   : HDOP
 *
 *                a.a          Antenna altitude re: mean-sea-level (geoid)
 *                M            Units of antenna altitude, meters
 *                NULL         Geoidal separation (Not supported)
 *                NULL         Units of geoidal separation (Not yet supported)
 *                x.x          Age of Differential GPS data
 *                xxxx                          Differential reference station ID
 *
 *                *CC        Check Sum and sentence termination delimiter
 *
 ***************************************************************************/
 
學習中請大家多多指導呦~~ ☆星霧☆(Mineg Chien WU)
zonghan0626
一般會員


發表:12
回覆:4
積分:3
註冊:2003-10-27

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-12-03 17:57:03 IP:140.134.xxx.xxx 未訂閱
...... >
系統時間:2024-05-19 20:42:06
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!