source: tmcsimulator/branches/fep_client_cpp/network.h @ 73

Revision 73, 1.9 KB checked in by jtorres, 9 years ago (diff)

changed some comments / housekeeping

Line 
1#ifndef NETWORK_H
2#define NETWORK_H
3#include <vector>
4
5using namespace std;
6
7/*** CONSTANTS ***/
8const int Fixed_Byte_To_Checksum = 25; // the first byte is not considered in the calculation of "BYTE 2"
9const int CONTROL_DATA_LEN = 27;
10char * const dp5[8] = { "ML_1", "ML_2", "ML_3", "ML_4", "ML_5",
11                                                "ML_6", "HOV_Lane", "FYW_Conn"};
12char * const dp6[8] = { "OS_1", "OS_2", "OS_3", "OS_4", "OS_5",
13                                                "OS_6", "COLL_DIST_2", "COLL_DIST_OFF"};
14char * const dp7[8] = { "DEMAND", "PASSAGE", "QUEUE", "RAMP_ON",
15                                                "RAMP_OFF", "RAMP_HOV", "COLL_DIST_1", "COLL_DIST_ON"};
16char * const dp8[8] = { "SD_1", "SD_2", "SD_3", "SD_4", "SD_5",
17                                                "SD_6", "Pass_Vol_Count", "X"};
18
19/*** NETWORK STRUCTS ***/
20typedef struct loopagg LOOPAGG;
21struct loopagg
22{
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;
33};
34
35// FEP line: has several lds
36typedef struct fep_line_lds FEP_LINE_LDS;
37struct  fep_line_lds
38{
39        int             lineNum;
40        vector<long> lds;
41        vector<long> ldsIndex;  // location in ldsMap
42        short   ldsNum;                 // actual number of lds on the line
43
44        short   count;  // actual count from caltrans
45        int             schedule;
46        int             lineInfo;
47        long    systemKey;
48        long    globalSeq;
49        long    schedleSeq;
50};
51
52// Loop detector station: has several loops
53typedef struct Lds_loop LDS_LOOP;
54struct  Lds_loop
55{
56        // Each lds has its own line_num and drop (Caltrans use)
57        long    lds;
58        short   line_num;
59        short   drop;
60
61        int             num;    // number of loops
62        long    *loopID;
63        char    **loop_loc;
64
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
71};
72
73#endif
Note: See TracBrowser for help on using the repository browser.