Delphi_GPS_Comp

所属分类:Pascal/Delphi编程
开发工具:Delphi
文件大小:497KB
下载次数:51
上传日期:2009-06-09 10:50:05
上 传 者sys00007
说明:  Here is a GPS component for your GPS navigation hobby project.The component was developed using Delphi 5 professional running with Windows XP Pro, Service pack 2. Review my comments in the source code for insight into how it works. The embedded COM port came from the public domain release of AsyncPro that was originally produced by TurboPower Software. Although it s much more complex than required, the default creation properties support NMEA communications. So, I provided only the ability to specify ComNumber, ComBaud and ComOpen. All Files required to build the COM port are included in the distribution. I changed the look of the port select dialog, the geekish wording of a few message strings and the baud rate property editor to make it compatible with the component.

文件列表:
AdDispLog.inc (21338, 2003-01-07)
AdExcept.inc (52065, 2006-09-03)
AdExcept.pas (33921, 2003-01-08)
AdPEditBR.dfm (728, 2006-09-05)
AdPEditBR.pas (3019, 2006-09-06)
AdPort.pas (98050, 2006-07-07)
AdSelCom.dfm (592, 2006-06-13)
AdSelCom.pas (5110, 2006-06-13)
AdSocket.pas (20470, 2003-01-07)
AdStrMap.pas (81726, 2003-01-07)
Adwutil.pas (36134, 2003-01-07)
Aviation Formulary V1.43.htm (67312, 2006-10-03)
AwDefine.inc (5567, 2003-01-14)
AwWin32.pas (16725, 2003-01-08)
GPS.ICO (2238, 2006-09-06)
GPS.dcr (792, 2006-09-03)
GPS.inc (7541, 2006-09-21)
GPS.pas (15120, 2006-10-04)
GPS.res (1536, 2006-07-14)
Geo84.pas (7465, 2006-09-16)
NMEA.pas (4318, 2006-09-06)
NavUtils.pas (2801, 2006-05-16)
OoMisc.pas (152482, 2003-01-14)
TestGPS.dpr (228, 2006-09-21)
TestGPS.res (3040, 2006-09-21)
Unit1.dfm (3649, 2006-10-04)
Unit1.pas (3964, 2006-10-04)
WMM.COF (4650, 2004-12-10)
WMM.pas (6676, 2006-10-01)
awuser.pas (159245, 2003-01-08)
dsgnintf.pas (138287, 2000-01-24)
hhAvComp.dcr (472, 2000-11-10)
hhAvComp.pas (21043, 2006-09-16)
nmea.htm (66822, 2006-09-04)
TestGPS.exe (544768, 2008-10-23)

Here is a GPS component for your GPS navigation hobby project. This is my first component writing project. There are several professional GPS interface packages available so you should use one of those for safety critical software because my software is not fault tolerant. The component was developed using Delphi 5 professional running with Windows XP Pro, Service pack 2. Review my comments in the source code for insight into how it works. The embedded COM port came from the public domain release of AsyncPro that was originally produced by TurboPower Software. Although it's much more complex than required, the default creation properties support NMEA communications. So, I provided only the ability to specify ComNumber, ComBaud and ComOpen. All Files required to build the COM port are included in the distribution. I changed the look of the port select dialog, the 'geekish' wording of a few message strings and the baud rate property editor to make it compatible with the component. I tested the component on hardware COM ports using several different Garmin receivers and also with a BU-353 USB receiver working through a virtual COM port. Everything appears to perform with stability so I have incorporated the component into all of my GPS projects. For a quick and easy test, unzip the distribution into a working directory and compile the TestGPS.dpr project. The components are created at runtime so you will not need to install them. You will need to determine how to install the component into your version of Delphi if you want to do that. I have also included a unit that computes magnetic variation using the World Magnetic Model. File WMM.cof, that contains the earth magnetic data, is required to be in the executable directory. It is revised every five years. Revisions should be available on the Web. Maybe I'll do a TMagVar component next. File GEO84 contains two functions for computing distance and direction on the WGS84 spheroid. It has received only basic functional testing. I recently installed an evaluation copy of the new Turbo Delphi but could not compile the baud rate property editor because several support files are not included in the evaluation release. Also, the evaluation edition will not allow third party components. The demo runs OK after I commented out the lines associated with the editor as a work around. If you want the editor, remove the comment markers and try it with your version of Delphi. You are free to make changes to the component so have fun experimenting with my software. Don't get lost! --- CHAS captchas@verizon.net October 2006 PS: Some associated code snipplets I use in my GPS applications: // Search for the first available port function ComPortSelect: Integer; var s: string; n: Integer; function DeviceAvail(const Dev: string): Boolean; var hDev: Cardinal; IsModem: Boolean; ComDevProp: TCommProp; begin hDev := CreateFile(PChar(Dev), GENERIC_READ, 0, nil, OPEN_EXISTING, 0, 0); GetCommProperties(hdev, ComDevProp); isModem := ComDevProp.dwProvSubType = PST_MODEM; CloseHandle(hDev); Result := (hDev <> INVALID_HANDLE_VALUE) and not IsModem; end; begin s := ParamStr(1); // ie COM9 if DeviceAvail(s) then // User forcing Com selection begin Delete(s, 1, 3); n := StrToInt(s); end else for n := 10 downto 1 do // Virtual devices are popular begin s := 'COM' + IntToStr(n); if DeviceAvail(s) then Break; end; Result := n; // Zero if no port is detected end; // Working with DateTime available after Valid Fix event is sent // Time & Date strings formatted by Locale Settings Windows control panel function DayName(const DateTime: TDateTime): string; begin Result := LongDayNames(DayOfWeek(DateTime)) end; function MonthName(const DateTime: TDateTime): string; var Y, M, D: Word; begin DecodeDate(DateTime, Y, M, D); Result := MonthName(M); end;

近期下载者

相关文件


收藏者