Changeset 165 in tmcsimulator for branches/green_dot/network.h


Ignore:
Timestamp:
10/23/2017 11:44:05 AM (9 years ago)
Author:
jtorres
Message:

green_dot now has datapacking implemented

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/green_dot/network.h

    r138 r165  
    99const int CONTROL_DATA_LEN = 27; 
    1010char * const dp5[8] = { "ML_1", "ML_2", "ML_3", "ML_4", "ML_5", 
    11                                                 "ML_6", "HOV_Lane", "FYW_Conn"}; 
     11   "ML_6", "HOV_Lane", "FYW_Conn"}; 
    1212char * const dp6[8] = { "OS_1", "OS_2", "OS_3", "OS_4", "OS_5", 
    13                                                 "OS_6", "COLL_DIST_2", "COLL_DIST_OFF"}; 
     13   "OS_6", "COLL_DIST_2", "COLL_DIST_OFF"}; 
    1414char * const dp7[8] = { "DEMAND", "PASSAGE", "QUEUE", "RAMP_ON", 
    15                                                 "RAMP_OFF", "RAMP_HOV", "COLL_DIST_1", "COLL_DIST_ON"}; 
     15   "RAMP_OFF", "RAMP_HOV", "COLL_DIST_1", "COLL_DIST_ON"}; 
    1616char * const dp8[8] = { "SD_1", "SD_2", "SD_3", "SD_4", "SD_5", 
    17                                                 "SD_6", "Pass_Vol_Count", "X"}; 
     17   "SD_6", "Pass_Vol_Count", "X"}; 
    1818 
    1919/*** NETWORK STRUCTS ***/ 
     
    2121struct loopagg 
    2222{ 
    23         int             index; 
    24         char    lane;                   // how namy lanes at the detector station 
    25         long    time; 
    26         int             interval; 
    27         int     g_vol; 
    28         float   g_occ; 
    29         double  g_spd; 
    30         int             *vol; 
    31         float   *occ; 
    32         double  *spd; 
     23   int          index; 
     24   char lane;                   // how namy lanes at the detector station 
     25   long time; 
     26   int          interval; 
     27   int  g_vol; 
     28   float        g_occ; 
     29   double       g_spd; 
     30   int          *vol; 
     31   float        *occ; 
     32   double       *spd; 
    3333}; 
    3434 
     
    3737struct  fep_line_lds 
    3838{ 
    39         int             lineNum; 
    40         vector<long> lds; 
    41         vector<long> ldsIndex;  // location in ldsMap 
    42         short   ldsNum;                 // actual number of lds on the line 
     39   int          lineNum; 
     40   vector<long> lds; 
     41   vector<long> ldsIndex;       // location in ldsMap 
     42   short        ldsNum;                 // actual number of lds on the line 
    4343 
    44         short   count;  // actual count from caltrans 
    45         int             schedule; 
    46         int             lineInfo; 
    47         long    systemKey; 
    48         long    globalSeq; 
    49         long    schedleSeq; 
     44   short        count;  // actual count from caltrans 
     45   int          schedule; 
     46   int          lineInfo; 
     47   long systemKey; 
     48   long globalSeq; 
     49   long schedleSeq; 
     50}; 
     51// Loop detector 
     52typedef struct loop LOOP; 
     53struct loop 
     54{ 
     55   long loopID; 
     56   char *loop_loc; 
     57 
     58   int vol; 
     59   float occ; 
     60   double spd; 
    5061}; 
    5162 
    5263// Loop detector station: has several loops 
    53 typedef struct Lds_loop LDS_LOOP; 
    54 struct  Lds_loop  
     64typedef struct Station STATION; 
     65struct  Station  
    5566{ 
    56         // Each lds has its own line_num and drop (Caltrans use) 
    57         long    lds; 
    58         short   line_num; 
    59         short   drop; 
     67   // Each lds has its own line_num and drop (Caltrans use) 
     68   long lds; 
     69   short        line_num; 
     70   short        drop; 
    6071 
    61         int             num;    // number of loops 
    62         long    *loopID; 
    63         char    **loop_loc; 
     72   vector<LOOP*> loops; 
    6473 
    65         // LDS data 
    66         unsigned char   *dataPack; 
    67         int             length;         // total length of data (max: 87) 
    68         int             pos;            // pointer for data preparation 
    69         int             MlTotVol;       // each 30 sec, the following will be updated 
    70         int             OppTotVol;      // each 30 sec, the following will be updated 
     74   int          num;    // number of loops 
     75   // LDS data 
     76   unsigned char        *dataPack; 
     77   int          length;         // total length of data (max: 87) 
     78   int          pos;            // pointer for data preparation 
     79   int          MlTotVol;       // each 30 sec, the following will be updated 
     80   int          OppTotVol;      // each 30 sec, the following will be updated 
     81}; 
     82// A helper structure used to pack the volume and occupancy at a loop into 
     83// // a two byte message 
     84typedef struct volOcc VOLOCC; 
     85struct  volOcc 
     86{ 
     87   char high; 
     88   char low; 
    7189}; 
    7290 
     91 
     92 
    7393#endif 
Note: See TracChangeset for help on using the changeset viewer.