Changeset 73 in tmcsimulator for branches/fep_client_cpp


Ignore:
Timestamp:
09/07/2017 03:25:09 PM (9 years ago)
Author:
jtorres
Message:

changed some comments / housekeeping

Location:
branches/fep_client_cpp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/fep_client_cpp/fep_client.cpp

    r72 r73  
    3030void xfer_replys(CLIENT *clnt, FEP_LINE_LDS *lines, int lines_size, LDS_LOOP *ldsMap) 
    3131{ 
    32         printf("Lines_size %d\n", lines_size); 
    3332        int i, j; // i == line_index, j == lds_index 
    3433        void *rv; 
     34 
    3535        // Send one reply for every "line" in the FEP 
    3636        for (i = 0; i < lines_size; i++) 
     
    5959                */ 
    6060                fepReply.schedule_time = time(NULL); 
    61  
    6261 
    6362                fepReply.user_info1 = lines[i].lineNum; 
     
    9998                         
    10099                        // send out data 
    101                         printf("line=%d, lds=%d\n", lines[i].lineNum, ldsMap[index].drop); 
     100                        printf("Transferring line=%d, lds_drop_no=%d...\n", lines[i].lineNum, ldsMap[index].drop); 
    102101                        rv = fep_reply_xfer_32(&fepReply, clnt); 
    103102 
     
    138137        /* Load data to be xfered to ATMS */ 
    139138        int lines_size = 0; 
    140         printf("Loading lines and ldsMap\n"); 
     139        printf("Loading lines\n"); 
    141140        FEP_LINE_LDS *lines = load_lines(&lines_size, "./lines_atms.txt"); 
    142         printf("Done loading lines\n"); 
     141        printf("Loading ldsMap...\n"); 
    143142        LDS_LOOP *ldsMap = load_lds("./lds_atms.txt"); 
    144         printf("Done loading lines and lds...\n"); 
    145143 
    146144        /* Transfer data to ATMS */ 
     145        printf("Transferring data to ATMS...\n"); 
    147146        xfer_replys(clnt, lines, lines_size, ldsMap); 
    148147 
    149148        /* Free allocated memory */ 
     149        printf("Freeing lines and ldsMap...\n"); 
     150        free(lines); 
     151        free(ldsMap); 
    150152 
    151153        /* Destroy client */ 
  • branches/fep_client_cpp/network.h

    r72 r73  
    44 
    55using namespace std; 
    6 // the first byte is not considered in the calculation of "BYTE 2" 
    7 const int Fixed_Byte_To_Checksum = 25; 
    86 
     7/*** CONSTANTS ***/ 
     8const int Fixed_Byte_To_Checksum = 25; // the first byte is not considered in the calculation of "BYTE 2" 
    99const int CONTROL_DATA_LEN = 27; 
    10  
    1110char * const dp5[8] = { "ML_1", "ML_2", "ML_3", "ML_4", "ML_5", 
    1211                                                "ML_6", "HOV_Lane", "FYW_Conn"}; 
     
    1817                                                "SD_6", "Pass_Vol_Count", "X"}; 
    1918 
    20  
    21  
     19/*** NETWORK STRUCTS ***/ 
    2220typedef struct loopagg LOOPAGG; 
    2321struct loopagg 
     
    5250}; 
    5351 
     52// Loop detector station: has several loops 
    5453typedef struct Lds_loop LDS_LOOP; 
    5554struct  Lds_loop  
  • branches/fep_client_cpp/network_factory.cpp

    r72 r73  
    22#include <vector> 
    33#include <math.h> 
     4 
    45// determine if a loop has data based on lane config data 
    56bool DataAvail(char flag, int num) 
     
    3435} 
    3536 
     37// Initializes the LDS_LOOP dataPack with all necessary static data and default dynamic data 
    3638void init_loop_dataPack(LDS_LOOP *loop) 
    3739{ 
    38         int j = 0; 
     40        int j; 
     41        // Allocate memory for dataPack 
    3942        loop->dataPack = (unsigned char *) calloc(sizeof(unsigned char), loop->length); 
     43 
    4044        // dataPack 5-8: lane config 
    4145        char d5 = 0, d6 = 0, d7 = 0, d8 = 0;             
Note: See TracChangeset for help on using the changeset viewer.