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


Ignore:
Timestamp:
10/09/2017 11:58:19 PM (9 years ago)
Author:
jtorres
Message:

branches/FEPSimulator: updated and improved comments, added Main.cpp which creates the FEPSimulator, minor project configurations (runtime command line arguments / tinyxml.a libosxtinyxml.a)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/FEPSimulator/FEPSim.h

    r84 r86  
    22 * File: FEPSim.h 
    33 *  
    4  * The FEPSim is an RPC Client which transfers network data to the 
    5  * ATMS Server. 
     4 * The FEP Simulator simulates the Front End Processor(FEP), which has the 
     5 * 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. 
     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. 
    616 * 
    7  * An FEPSim is created every 30 seconds, and an fep_reply structure 
    8  * for every FEP_LINE_LDS is transferred to the ATMS through an RPC Call. 
    9  * After the FEPSim has transferred all fep_replys, it is destroyed. 
    10  * 
    11  * An FEPSim is script-like in nature. There are no public methods other than 
    12  * the constructor. To construct an FEPSim, an input file (containing network  
    13  * data in xml form) and a host server_ip (for the ATMS) are necessary. The  
    14  * format of the xml input file can be fount in "networkReader.cpp" source file. 
     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. 
    1520 * 
    1621 * @author John A. Torres 
     
    4247class FEPSim { 
    4348public: 
    44     /* members */ 
    45     CLIENT *clnt; // RPC Client 
     49    // The RPC Client 
     50    CLIENT *clnt; 
    4651 
    47     /* methods */ 
    48     FEPSim(char * ATMSHost); // Constructor 
     52    /** 
     53     * Constructor. Sets data values for RPC Client and socket server. 
     54     *  
     55     * @param ATMSHost The IP of ATMS Server 
     56     * @param FEP RPC program number 
     57     * @param FEP RPC program revision number 
     58     * @param Socket Server listen port 
     59     */ 
     60    FEPSim(char * ATMSHost, int FEP_PROG, int FEP_REV, int SOCK_PORT); 
    4961     
    50     void updateATMS(char * xml); // updates ATMS 
    51  
     62    /** 
     63     * Creates a socket server and awaits the highway status XML responses from the 
     64     * ATMS Driver. Upon reciept of the highway status XML message, creates an RPC 
     65     * client and sends the fep_replys to the ATMS. 
     66     */ 
     67    void runSockServer(); 
     68     
     69    /** 
     70     * Creates an RPC Client, and on successful creation, sends fep_replys to ATMS. 
     71     * @param The recieved highway status xml. 
     72     */ 
     73    void updateATMS(char * xml); 
     74     
     75    /** 
     76     * Destructor: Does nothing, no cleaning necessary 
     77     */ 
    5278    ~FEPSim(); // Destructor 
    5379 
     
    5581    /* members */ 
    5682    char * ATMSHost; 
     83    int FEP_PROG; 
     84    int FEP_REV; 
     85    int SOCK_PORT; 
    5786 
    58     /* methods */ 
    59     void handleCallResponse(void *response); // 
    60     bool createClient(char *host); 
     87    /** 
     88     * Handler for the ATMS RPC Response (to the client RPC Call) 
     89     * @param response pointer to fep_reply struct 
     90     */ 
     91    void handleCallResponse(void *response); 
     92     
     93    /** 
     94     * Creates the RPC Client. If not successful, returns false. 
     95     */ 
     96    bool createClient(); 
     97     
     98    /** 
     99     * Sends an fep_reply for each FEP_LINE. Gets highway status from recieved XML 
     100     * data. 
     101     * @param xml The recieved highway status XML. 
     102     */ 
    61103    void sendReplys(char * xml); 
    62104 
Note: See TracChangeset for help on using the changeset viewer.