Managing Rail Stops
Contents
PC*Miler Rail-Connect can calculate routes with many stops. When the client application adds stops to a trip, the DLL tries to geocode (match) the input place (station name/state, SPLC, etc.) to the PC*Miler Rail database. Station names are limited to 20 characters plus a 2-character state abbreviation. Geographic codes can be:
- 6 digits for SPLC
- 5 digits for FSACs (with leading zeros)
- 9 characters for ERPCs
- 5 characters for Rule260s
The following functions are used to manage a trip’s list of stops:
HRESULT PCRSAddStop(Trip trip, char *stopName, char *rrIn, char *geoChar)
Appends a stop-off to the stop list (or origin stop if the list is empty). Places are geocoded, and the first match is used (via PCRSGeoLookup()
). Returns the number of matching cities (or 0 if no cities match), and -1 on error.
HRESULT PCRSDeleteStop(Trip trip, int which)
Deletes a stop at index number which
, with stop number 0 being the origin. If the stop is invalid, it is not added to the trip’s list. The trip will recalculate, but the mileage and route will not include the invalid stop-off.
HRESULT PCRSGetNumStops(Trip trip, int pNumStops)
Gets the total number of stops currently in the trip’s stop list, including origin and destination.
HRESULT PCRSGetStop(Trip trip, int which, char *buffer, int bufSize, int NumChars, char *rr)
Puts a stop name into the supplied buffer
. Use which
to index into the list of stops (0 is the origin). The resulting string will be NULL-terminated and could be up to 24 bytes. The input buffer
should be at least 24 bytes. If bufSize
is less than 24, then bufSize-1
characters will be copied. The number of characters copied is placed into the pointer numChars
.
HRESULT PCRSClearStops(Trip trip)
Removes all stops from the stop list.