Detailed instructions for use are in the User's Guide.
[. . . ] Routing, Mileage, and Mapping Software
VERSION
17
PC*MILER|Rail - Connect
Users Guide
ALL RIGHTS RESERVED You may print one (1) copy of this document for your personal use. Otherwise, no part of this document may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language, in any form or by any means electronic, mechanical, magnetic, optical, or otherwise, without prior written permission from ALK Technologies, Inc. IBM is a registered trademark of International Business Machines Corporation. Windows is a trademark of Microsoft Corporation. [. . . ] Input names can be any of the aforementioned geocode types (station name/state, SPLC, FSAC, ERPC, Rule260). The argument geoChar denotes which of these types is being given (S=SPLC, E=ERPC, C=City/State (station name), F=FSAC, R=Rule260). The number of matches found is returned in the given pointer `pNumChars'. Note that these input places can be `mapped' to other places in the
PC*MILER|Rail-Connect User's Guide
22
PC*MILER|Rail network via overrides, should this be necessary based on the input data (see section 3. 8, Managing Overrides, below). Once you've seeded the trip with matching cities, use PCRSGetGeoMatch() to retrieve each matching place. Pass the index of the desired match and a buffer to store the information in. The name stored in the buffer (first 22 chars) is the place name as PC*MILER|Rail knows it and should be the name passed to PCRSAddStop(). PC*MILER|Rail names are the 22-character station/state names previously discussed, including the NULL terminator. Note that the buffer should be long enough to contain the entire name. Additional information will be included in the buffer (such as SPLC and FSAC) where possible. The following is a code sample for Geocode lookups: #define BUFLEN 25 char buffer[BUFLEN]; int matches, numChars; HRESULT srvRet; /* Lookup all cities that match */ srvRet = PCRSGeoLookup(myTrip, "HOU* TX", "C", NULL, &matches); printf ("%d matching cities to 'HOU* TX'\n", matches); /* Show all the matching cities. Note: You could use variable*/ for (i = 0; i < matches; i++) { PCRSGetGeoMatch(trip, i, buffer, BUFLEN, &numChars); printf ("[%s]\n", buffer); } The Lookup functions work like the Geocoding functions described above. PCRSRRLookup()and PCRSJunctionLookup() return lists of matching railroads and junctions respectively, and return how many match your input. The number of matches found is returned in the given pointer numMatches. Then, you can use PCRSGetRRMatch() or PCRSGetJunctionMatch to retrieve each matching railroad or junction. Pass the index of the desired match and a buffer to store the information. PCRSConvertGeoCode() is a geocode conversion function. The argument geoCharFrom and geoCharTo are one of the following: (S=SPLC, E=ERPC, C=City/State (station name), F=FSAC, R=Rule260). The following is a code sample of PCRSConvertGeoCode(). Note that RR information is required to and from the FSAC code conversion.
Chapter 3: Using PC*MILER|Rail-Connect From `C'
23
#define BUFLEN 256 char buffer[BUFLEN]; if (0 == (srvRet = PCRSConvertGeoCode("384188", "S", "C", "", buffer, BUFLEN, NULL))) { printf (buf, "Conversion: \"384188\" (SPLC --> Station/ST)\n"); printf (buf, "Result: %s\n", buffer); } /* ERPC code needs to be followed by state code with or without a blank */ if (0 == (srvRet = PCRSConvertGeoCode("GRUMBLER NT", "E", "C", "", buffer, BUFLEN, NULL))) { printf (buf, "Conversion: \"GRUMBLER NT\" (ERPC --> Station/ST)\n"); printf (buf, " } /* RR is required to and from the FSAC code conversion */ if (0 == (srvRet = PCRSConvertGeoCode("ABEE IN", "C", "F", "EVWR", buffer, BUFLEN, NULL))) { printf (buf, "Conversion: \"ABEE IN\" (Station/ST -> FSAC, RR: EVWR)\n"); printf (buf, "Result: %s\n", buffer); } if (0 == (srvRet = PCRSConvertGeoCode("ADA", "R", "S", "", buffer, BUFLEN, NULL))) { printf (buf, "Conversion: \"ADA\" (R260 --> SPLC)\n"); printf (buf, "Result: %s\n", buffer); } Result : %s\n", buffer);
PC*MILER|Rail-Connect User's Guide
24
The output from this program is: Conversion: "384188" (SPLC --> Station/ST) Result: LORENZO IL
Conversion: "GRUMBLER NT" (ERPC --> Station/ST) Result: GRUMBLER NT
Conversion: "ABEE IN" (Station/ST --> FSAC, RR: EVWR) Result: 70328 Conversion: "ADA" (R260 --> SPLC) Result: 628240
3. 7 Changing Options
The following functions affect the trip's routing calculation: HRESULT PCRSSetRouteFormula (Trip trip, char *newParam); HRESULT PCRSSetRouteMethod (Trip trip, char *newParam); HRESULT PCRSSetRouteType (Trip trip, char *newParam); HRESULT PCRSSetUnitsMiles (Trip trip); HRESULT PCRSSetUnitsKilometers (Trip trip); HRESULT PCRSSetIncNonStationRR (Trip tripID, char *newParam); HRESULT PCRSSetIncAMTK (Trip tripID, char *newParam); PCRSSetRouteFormula allows users to choose between PRACTICAL (P), SHORTEST (S) path, INTERMODAL (I), COAL/BULK (C), AUTO RACKS (A), and FUEL SURCHARGE (F) style routing. PCRSSetRouteMethod allows users to choose FAMILIZED (F) versus NON-FAMILIZED (N) routing (i. e. determines if moves over railroad family members should occur as if they were a movement over the specified railroad). [. . . ] Most applicable functions of PC*MILER|RailConnect are supported. Mapping functions are currently not supported via TCP/IP interface.
Important Changes to the Interface
PC*MILER|Rail-Connect (version 15 and higher) is thread-safe. The TCP/IP Interface does not disconnect automatically and thus can support true simultaneous connections. Note, however, that earlier versions of the above-mentioned sofware and ARE NOT THREAD-SAFE, and the TCP/IP Interface will disconnect (revert to old behavior) after every transaction.
Hardware Requirements
PC with a 1. 5-2 GHz processor and TCP/IP Capability UNIX or other host with TCP/IP Capability Physical Connection (cable) An additional 2 MB hard disk space
Software Requirements
Microsoft Windows (2003, Windows 7, Server 2008, Vista, or XP) PC*MILER|Rail (V17. 0) PC*MILER|Rail-Connect Client software on the UNIX host
1. [. . . ]