Changeset 233 in tmcsimulator for branches/FEPSimulator/FEPSim.h


Ignore:
Timestamp:
11/13/2017 06:07:07 PM (8 years ago)
Author:
jtorres
Message:

FEPSim: finalized comments, added to both header and source files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/FEPSimulator/FEPSim.h

    r221 r233  
    44 * The FEP Simulator simulates the Front End Processor(FEP), which has the 
    55 * responsibility of "polling" Loop Detector Stations for highway status data. 
    6  * The real FEP "polls" real stations over serial communication lines, whereas 
    7  * the FEP Simulator recieves highway status data through a socket from the Java 
    8  * 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. 
    99 *  
    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. 
    2013 * 
    2114 * @author John A. Torres 
     
    4336#include <netinet/in.h> 
    4437#include <unistd.h> 
     38#include <time.h> 
    4539 
     40// this buffer is the size of the entire highways data message + 1 for the 
     41// appended newline character, when sent over the socket 
    4642const int BUFF_SIZE = 1266341; 
     43// Log file for FEPSimulator 
    4744static ofstream FEPLogFile; 
    4845     
     
    6360     
    6461    /** 
    65      * Creates a socket server and awaits the highway status XML responses from the 
    66      * ATMS Driver. Upon reciept of the highway status XML message, creates an RPC 
     62     * 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 
    6764     * client and sends the fep_replys to the ATMS. 
    6865     */ 
     
    7168    /** 
    7269     * 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. 
    7471     */ 
    75     void manageClientConnection(char * xml); 
     72    void manageClientConnection(char * buffer); 
    7673     
    7774    /** 
    78      * Destructor: Does nothing, no cleaning necessary 
     75     * Destructor: closes the log file if open 
    7976     */ 
    8077    ~FEPSim(); // Destructor 
    8178 
    8279private: 
    83     /* members */ 
     80    // atms ip address 
    8481    char * ATMSHost; 
     82    // rpc program number 
    8583    int FEP_PROG; 
     84    // rpc revision number 
    8685    int FEP_REV; 
     86    // socket port 
    8787    int SOCK_PORT; 
     88    // name of logging file 
    8889    char * FEPLogFileName; 
    8990     
     
    9596     
    9697    /** 
    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 
    98100     */ 
    99101    bool createClient(); 
    100102     
    101103    /** 
    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. 
    105108     */ 
    106     void sendReplys(char * xml); 
    107      
     109    void sendReplys(char * buffer); 
    108110}; 
    109111 
Note: See TracChangeset for help on using the changeset viewer.