Go to the source code of this file.
Defines | |
#define | PI 3.14159265358979323846 |
#define | GPSUDBG_INFOS 128 |
#define | GPSUDBG_CALLS 32 |
#define | GPSUDBG_UNEXP 8 |
#define | BadCoordinate -1000. /* returned if error in coordinates conversion */ |
#define | OBJECTVERSION 2 /* object format version */ |
#define | NextObject(o) ( (char *)o + SizeOfObject(o) ) |
Typedefs | |
typedef void | LogProc (char *p) |
typedef LogProc * | LogProcPtr |
Functions | |
UInt16 | SizeOfObject (Object *p) UTIL_SECTION |
UInt16 | ObjectsInRec (MemHandle RecH) UTIL_SECTION |
Returns number of Object type objects in a record. | |
UInt16 | OffsetOfObjectInRec (MemHandle RecH, UInt16 n) UTIL_SECTION |
Computes offset of nth object in a record. | |
UInt16 | G100ToCustom (Raw_D100_Wpt_Type *p100, Custom_Wpt_Type *pcust) UTIL_SECTION |
Converts a D100 waypoint to GPilotS' internal format. | |
UInt16 | G102ToCustom (Raw_D102_Wpt_Type *p102, Custom_Wpt_Type *pcust) UTIL_SECTION |
Converts a D102 waypoint to GPilotS' internal format. | |
UInt16 | G103ToCustom (Raw_D103_Wpt_Type *p103, Custom_Wpt_Type *pcust) UTIL_SECTION |
Converts a D103 waypoint to GPilotS' internal format. | |
UInt16 | G104ToCustom (Raw_D104_Wpt_Type *p104, Custom_Wpt_Type *pcust) UTIL_SECTION |
Converts a D104 waypoint to GPilotS' internal format. | |
UInt16 | G105ToCustom (Raw_D105_Wpt_Type *p105, Custom_Wpt_Type *pcust) UTIL_SECTION |
Converts a D105 waypoint to GPilotS' internal format. | |
UInt16 | G107ToCustom (Raw_D107_Wpt_Type *p107, Custom_Wpt_Type *pcust) UTIL_SECTION |
Converts a D107 waypoint to GPilotS' internal format. | |
UInt16 | G108ToCustom (Raw_D108_Wpt_Type *p108, Custom_Wpt_Type *pcust) UTIL_SECTION |
Converts a D108 waypoint to GPilotS' internal format. | |
UInt16 | G109ToCustom (Raw_D109_Wpt_Type *p109, Custom_Wpt_Type *pcust) UTIL_SECTION |
Converts a D109 waypoint to GPilotS' internal format. | |
UInt16 | CustomToG100 (Custom_Wpt_Type *pcust, Raw_D100_Wpt_Type *p100) UTIL_SECTION |
Converts a GPilotS' internal format waypoint to a D100 one. | |
UInt16 | CustomToG102 (Custom_Wpt_Type *pcust, Raw_D102_Wpt_Type *p102) UTIL_SECTION |
Converts a GPilotS' internal format waypoint to a D102 one. | |
UInt16 | CustomToG103 (Custom_Wpt_Type *pcust, Raw_D103_Wpt_Type *p103) UTIL_SECTION |
Converts a GPilotS' internal format waypoint to a D103 one. | |
UInt16 | CustomToG104 (Custom_Wpt_Type *pcust, Raw_D104_Wpt_Type *p104) UTIL_SECTION |
Converts a GPilotS' internal format waypoint to a D104 one. | |
UInt16 | CustomToG105 (Custom_Wpt_Type *pcust, Raw_D105_Wpt_Type *p105) UTIL_SECTION |
Converts a GPilotS' internal format waypoint to a D105 one. | |
UInt16 | CustomToG107 (Custom_Wpt_Type *pcust, Raw_D107_Wpt_Type *p107) UTIL_SECTION |
Converts a GPilotS' internal format waypoint to a D107 one. | |
UInt16 | CustomToB108 (Custom_Wpt_Type *pcust, B108_Wpt_Type *p108, Boolean merge) UTIL_SECTION |
Converts, and optionaly merge, a Custom_Wpt_Type waypoint to a B108_Wpt_Type one B108_Wpt_Type has the necessary size to hold a "full" Raw_D108_Wpt_Type. | |
UInt16 | CustomToB109 (Custom_Wpt_Type *pcust, B109_Wpt_Type *p109, Boolean merge) UTIL_SECTION |
Converts, and optionaly merge, a Custom_Wpt_Type waypoint to a B109_Wpt_Type one B109_Wpt_Type has the necessary size to hold a "full" Raw_D109_Wpt_Type. | |
LocalFormatID | PtrToCustomWpt (Object *recp, Custom_Wpt_Type *pcust) UTIL_SECTION |
LocalFormatID | HandleToCustomWpt (ObjectHandle RecH, Custom_Wpt_Type *pcust) UTIL_SECTION |
Converts a waypoint object record, given a handle on it, to a Custom_Wpt_Type type waypoint. | |
LocalFormatID | IndexToCustomWpt (UInt16 index, DmOpenRef DB, Custom_Wpt_Type *pcust) UTIL_SECTION |
Converts a waypoint object record, given its index in waypoint data base, to a Custom_Wpt_Type. | |
Err | CustomToAnyWpt (Custom_Wpt_Type *pcust, LocalFormatID format, ObjectPtr newp, Boolean merge) UTIL_SECTION |
Converts a Custom_Wpt_Type waypoint to an object of given format. | |
Object * | AnyToAnyWpt (Object *from, Object *to, LocalFormatID toformat) UTIL_SECTION |
UInt16 | WptsInRteDB (MemHandle RecH) UTIL_SECTION |
Computes number of waypoints in route record. | |
LocalFormatID | PtrToCustomRteHdr (Object *recp, Custom_Rte_Hdr_Type *pcust) UTIL_SECTION |
LocalFormatID | HandleToCustomRteHdr (MemHandle RecH, Custom_Rte_Hdr_Type *pcust) UTIL_SECTION |
Converts route header object, given a handle on it, to Custom_Rte_Hdr_Type GPilotS' internal format. | |
Object * | CustomToRteHdrObj (Custom_Rte_Hdr_Type *pcust, Object *o, LocalFormatID toformat) UTIL_SECTION |
Object * | AnyToAnyRteHdr (Object *from, Object *to, LocalFormatID toformat) UTIL_SECTION |
UInt16 | TrkptsInTrkDB (MemHandle rech) UTIL_SECTION |
Returns number of track points in a track (should use number stored in track header). | |
void | CustomToRawD301TrkPt (Custom_Trk_Point_Type *from, Raw_D301_Trk_Point_Type *to) UTIL_SECTION |
Converts a GPilotS' standard custom format track point to a raw D301 one. | |
void | CompactToRawD301TrkPt (Compact_Trk_Point_Type *from, Raw_D301_Trk_Point_Type *to) UTIL_SECTION |
Converts a GPilotS' compact format track point to a raw D301 one. | |
void | CustomToRawD300TrkPt (Custom_Trk_Point_Type *from, Raw_D300_Trk_Point_Type *to) UTIL_SECTION |
Converts a GPilotS' custom format track point to a raw D300 one. | |
void | CompactToRawD300TrkPt (Compact_Trk_Point_Type *from, Raw_D300_Trk_Point_Type *to) UTIL_SECTION |
Converts a GPilotS' compact format track point to a raw D300 one. | |
UInt16 | AnyRawToAnyTrkPt (LocalFormatID in_format, LocalFormatID out_format, GarminObject *from, TrkPts *to) UTIL_SECTION |
Converts all known raw track point format to any internal format. | |
void | CustomTrkHdrToD310 (Object *trkhdr, D310_Trk_Hdr_Type *d310) UTIL_SECTION |
Symbol_Type | smblToSymbolType (byte smbl) UTIL_SECTION |
Converts a D103 symbol type into a Symbol_Type one. | |
byte | SymbolTypeTosmbl (Symbol_Type smbl) UTIL_SECTION |
Converts a Symbol_Type into a D103 symbol type. | |
UInt16 | symb_gid2lid (Symbol_Type gid) UTIL_SECTION |
Maps a garmin Symbol_Type value into a local bitmap index. | |
Symbol_Type | symb_lid2gid (UInt16 lid) UTIL_SECTION |
Maps a local bitmap index to a garmin Symbol_Type value. | |
void * | GetObjPtr (UInt16 objindex) UTIL_SECTION |
Get object form pointer from object ID. | |
void | HideObject (UInt16 objID) UTIL_SECTION |
Hides given object in current form. | |
void | ShowObject (UInt16 objID) UTIL_SECTION |
Show given object in current form. | |
Int16 | RecIdToPosition (DmOpenRef DB, UInt16 category, UInt32 recid, UInt16 *indexp) UTIL_SECTION |
Returns a record position in it's category and index given it's ID (avoids DmFindRecordByID pitfalls). | |
UInt32 | GetRecordID (DmOpenRef DB, UInt16 index) UTIL_SECTION |
Get unique ID of a record given it's index. | |
char * | DegreToDM (double coord, Boolean longitude, Boolean nmea) UTIL_SECTION |
Conversion of coordinate in degrees to ascii format [D]DD°MM.fff'L or [D]DDMM.fff,L if nmea. | |
char * | DegreToDMS (double coord, Boolean longitude) UTIL_SECTION |
degrees to string [D]DD°MM'SS.S"L | |
char * | DegreToD (double coord, Boolean longitude) UTIL_SECTION |
degrees to string [D]DD.DDDDD°L | |
char * | DegreToChars (double coord, Boolean longitude, DisplayFormat DispMode) UTIL_SECTION |
Converts coordinate to string in current format (specified in DisplayMode). | |
double | ReadCoord (char *string, Boolean *longitude) UTIL_SECTION |
Converts ASCII coordinate to double. | |
void | SemiToDegre (Semicircle_Type *p, double *latitude, double *longitude) UTIL_SECTION |
Conversion of coordinates from Semicircle_Type to degree. | |
void | DegreToSemi (double latitude, double longitude, Semicircle_Type *p) UTIL_SECTION |
conversion of degree coordinates to Semicircle_Type | |
void | DistBearToSemi (double dist, UInt16 bearing, Semicircle_Type *p) UTIL_SECTION |
Computes Semicircle_Type coordinates from distance and bearing from a given point. | |
char * | StrNCopySafe (char *dstp, char *srcp, UInt16 dstsize) UTIL_SECTION |
Copy at most dstsize-1 bytes from source to destination string. | |
void | StrNCatSafe (char *dstp, char *srcp, UInt16 dstsize, UInt16 srcsize) UTIL_SECTION |
Concatenation of a string and a char array. | |
double | StrToD (char *p, char **endp) UTIL_SECTION |
Conversion ascii floating point number ([+-]M[M...][.F[F...]][+-]eX[X]) to double. | |
void | StrNToField (char *str, UInt16 length, UInt16 fieldid) UTIL_SECTION |
copy a char array into a field, replacing the text handle of the field. | |
void | Canonicalize (char *p, UInt16 l) UTIL_SECTION |
Canonization of a string (all upper case, no non-alphanum,...). | |
double | Distance (long lat1, long lon1, long lat2, long lon2, DistanceUnit unit) UTIL_SECTION |
Computes distance between two points given their coordinates. | |
double | PDistance (long lat1, long lon1, long lat2, long lon2) UTIL_SECTION |
Pseudo distance between 2 points. | |
UInt16 | Bearing (long slat1, long slon1, long slat2, long slon2) UTIL_SECTION |
Bearing of point 2 from point 1. | |
char * | DToA (double x, UInt16 digits, UInt16 precision) UTIL_SECTION |
Conversion of a double to a string (fixed precision) of the form [-]ddd.ffff. | |
void | DrawCharsInWidth (char *string, Int16 x, Int16 y, UInt16 w, Boolean RightAligned) UTIL_SECTION |
Draws a string at given place and width. | |
Int16 | DistComp (long lat1, long lon1, long lat2, long lon2, long reflat, long reflon) UTIL_SECTION |
Distance comparison of two points against a reference point. | |
void | SetMathLibRef (UInt16 ref) UTIL_SECTION |
void | GpsutilSetDebugLevel (UInt16 debuglevel, LogProcPtr logprocp) UTIL_SECTION |
Sets the debugging level (no effect if compiled without DEBUG). | |
Boolean | WptHit (Custom_Wpt_Type *wptp, Semicircle_Type *position) UTIL_SECTION |
Test if position is inside waypoint's proximity distance. | |
void | SetControlValue (UInt16 objID, short value) UTIL_SECTION |
Set a control's values. | |
short | GetControlValue (UInt16 objID) UTIL_SECTION |
Get a control's (push button or check box) state. | |
void | GetObjectBounds (UInt16 objID, RectanglePtr rp) UTIL_SECTION |
Get an object's bounds. | |
Variables | |
const UInt32 | OnePower31 = (1UL << 31) |
const UInt32 | OnePower31Pi = (1UL << 31) / PI |
|
Converts all known raw track point format to any internal format.
|
|
Bearing of point 2 from point 1.
|
|
Canonization of a string (all upper case, no non-alphanum,...).
|
|
Converts a GPilotS' compact format track point to a raw D300 one.
|
|
Converts a GPilotS' compact format track point to a raw D301 one.
|
|
Converts a Custom_Wpt_Type waypoint to an object of given format.
|
|
Converts, and optionaly merge, a Custom_Wpt_Type waypoint to a B108_Wpt_Type one B108_Wpt_Type has the necessary size to hold a "full" Raw_D108_Wpt_Type.
|
|
Converts, and optionaly merge, a Custom_Wpt_Type waypoint to a B109_Wpt_Type one B109_Wpt_Type has the necessary size to hold a "full" Raw_D109_Wpt_Type.
|
|
Converts a GPilotS' internal format waypoint to a D100 one.
|
|
Converts a GPilotS' internal format waypoint to a D102 one.
|
|
Converts a GPilotS' internal format waypoint to a D103 one.
|
|
Converts a GPilotS' internal format waypoint to a D104 one.
|
|
Converts a GPilotS' internal format waypoint to a D105 one.
|
|
Converts a GPilotS' internal format waypoint to a D107 one.
|
|
Converts a GPilotS' custom format track point to a raw D300 one.
|
|
Converts a GPilotS' standard custom format track point to a raw D301 one.
|
|
Converts coordinate to string in current format (specified in DisplayMode).
|
|
degrees to string [D]DD.DDDDD°L
|
|
Conversion of coordinate in degrees to ascii format [D]DD°MM.fff'L or [D]DDMM.fff,L if nmea.
|
|
degrees to string [D]DD°MM'SS.S"L
|
|
conversion of degree coordinates to Semicircle_Type
|
|
Computes distance between two points given their coordinates.
|
|
Computes Semicircle_Type coordinates from distance and bearing from a given point.
|
|
Distance comparison of two points against a reference point.
|
|
Draws a string at given place and width. If the string don't fit in given width an ellipsis is drawn (...) at the end.
|
|
Conversion of a double to a string (fixed precision) of the form [-]ddd.ffff.
|
|
Converts a D100 waypoint to GPilotS' internal format.
|
|
Converts a D102 waypoint to GPilotS' internal format.
|
|
Converts a D103 waypoint to GPilotS' internal format.
|
|
Converts a D104 waypoint to GPilotS' internal format.
|
|
Converts a D105 waypoint to GPilotS' internal format.
|
|
Converts a D107 waypoint to GPilotS' internal format.
|
|
Converts a D108 waypoint to GPilotS' internal format.
|
|
Converts a D109 waypoint to GPilotS' internal format.
|
|
Get a control's (push button or check box) state.
|
|
Get an object's bounds.
|
|
Get object form pointer from object ID.
|
|
Get unique ID of a record given it's index.
|
|
Sets the debugging level (no effect if compiled without DEBUG).
|
|
Converts route header object, given a handle on it, to Custom_Rte_Hdr_Type GPilotS' internal format.
|
|
Converts a waypoint object record, given a handle on it, to a Custom_Wpt_Type type waypoint.
|
|
Hides given object in current form.
|
|
Converts a waypoint object record, given its index in waypoint data base, to a Custom_Wpt_Type.
|
|
Returns number of Object type objects in a record.
|
|
Computes offset of nth object in a record.
|
|
Pseudo distance between 2 points. This is approximate but fast !
|
|
Converts ASCII coordinate to double. Any format (D.DD, DM.MM, DMS) is accepted.
|
|
Returns a record position in it's category and index given it's ID (avoids DmFindRecordByID pitfalls).
|
|
Conversion of coordinates from Semicircle_Type to degree.
|
|
Set a control's values.
|
|
Show given object in current form.
|
|
Converts a D103 symbol type into a Symbol_Type one.
|
|
Concatenation of a string and a char array. The array don't need to be null terminated and, in all cases, the resulting string is null terminated (contrary to StrNCat)
|
|
Copy at most dstsize-1 bytes from source to destination string. Ensures that the destination string is null terminated (dstsize'th byte is 0) except if dstsize=0
|
|
copy a char array into a field, replacing the text handle of the field.
|
|
Conversion ascii floating point number ([+-]M[M...][.F[F...]][+-]eX[X]) to double.
|
|
Maps a garmin Symbol_Type value into a local bitmap index.
|
|
Maps a local bitmap index to a garmin Symbol_Type value.
|
|
Converts a Symbol_Type into a D103 symbol type. A default value is returned if the source value has no corresponding value.
|
|
Returns number of track points in a track (should use number stored in track header).
|
|
Test if position is inside waypoint's proximity distance.
|
|
Computes number of waypoints in route record. The route is supposed to contain only waypoints.
|