Changeset 233 in tmcsimulator for branches/FEPSimulator/FEPSim.h
- Timestamp:
- 11/13/2017 06:07:07 PM (8 years ago)
- File:
-
- 1 edited
-
branches/FEPSimulator/FEPSim.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/FEPSimulator/FEPSim.h
r221 r233 4 4 * The FEP Simulator simulates the Front End Processor(FEP), which has the 5 5 * responsibility of "polling" Loop Detector Stations for highway status data. 6 * The real FEP "polls" real stations over serial communication lines, whereas7 * the FEP Simulator rec ieves highway status data througha socket from the Java8 * ATMS Driver. 6 * The actual FEP "polls" actual stations over serial communication lines, whereas 7 * the FEP Simulator receives highways status data over a socket from the Java 8 * ATMS Driver. The highways status data is then parsed by the Network Reader. 9 9 * 10 * Highway status data is transmitted to the FEP Simulator over the socket in 11 * XML Form. The XML highway status data is then parsed by the Network Reader. 12 * 13 * The data is then sent to the ATMS, using RPC Calls. The RPC Calls to the 14 * ATMS Server send an fep_reply structure. There is one fep_reply structure 15 * sent to the ATMS for every FEP_LINE. 16 * 17 * The FEP Simulator is a socket server that runs persistently and awaits the 18 * XML highway status data over the socket. When the XML highway status data is 19 * recieved, it executes the RPC Calls to update the ATMS. 10 * The data is reconfigured into an fep_reply struct, then sent to the ATMS via 11 * RPC Calls. The RPC Calls to the ATMS Server send an the fep_reply structs. 12 * There is one fep_reply structure sent to the ATMS for every station. 20 13 * 21 14 * @author John A. Torres … … 43 36 #include <netinet/in.h> 44 37 #include <unistd.h> 38 #include <time.h> 45 39 40 // this buffer is the size of the entire highways data message + 1 for the 41 // appended newline character, when sent over the socket 46 42 const int BUFF_SIZE = 1266341; 43 // Log file for FEPSimulator 47 44 static ofstream FEPLogFile; 48 45 … … 63 60 64 61 /** 65 * Creates a socket server and awaits the highway status XML responsesfrom the66 * ATMS Driver. Upon rec iept of the highway status XMLmessage, creates an RPC62 * Creates a socket server and awaits the highway status message from the 63 * ATMS Driver. Upon receipt of the highway status message, creates an RPC 67 64 * client and sends the fep_replys to the ATMS. 68 65 */ … … 71 68 /** 72 69 * Creates an RPC Client, and on successful creation, sends fep_replys to ATMS. 73 * @param The recieved highway status xml.70 * @param The recieved highway status msg. 74 71 */ 75 void manageClientConnection(char * xml);72 void manageClientConnection(char * buffer); 76 73 77 74 /** 78 * Destructor: Does nothing, no cleaning necessary75 * Destructor: closes the log file if open 79 76 */ 80 77 ~FEPSim(); // Destructor 81 78 82 79 private: 83 / * members */80 // atms ip address 84 81 char * ATMSHost; 82 // rpc program number 85 83 int FEP_PROG; 84 // rpc revision number 86 85 int FEP_REV; 86 // socket port 87 87 int SOCK_PORT; 88 // name of logging file 88 89 char * FEPLogFileName; 89 90 … … 95 96 96 97 /** 97 * Creates the RPC Client. If not successful, returns false. 98 * Creates an RPC Client to the ATMS Server. If unsuccessful, returns false 99 * @return bool success 98 100 */ 99 101 bool createClient(); 100 102 101 103 /** 102 * Sends an fep_reply for each FEP_LINE. Gets highway status from recieved XML 103 * data. 104 * @param xml The recieved highway status XML. 104 * Sends an fep_reply for each station on the FEPLine. 105 * Gets highway status from recieved socket msg. 106 * 107 * @param buffer The recieved highway status msg. 105 108 */ 106 void sendReplys(char * xml); 107 109 void sendReplys(char * buffer); 108 110 }; 109 111
Note: See TracChangeset
for help on using the changeset viewer.
