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

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

added lds_data files, we are now dumping fep_reply to ATMS with real data

Line 
1#ifndef NETWORK_H
2#define NETWORK_H
3#include <vector>
4
5using namespace std;
6// the first byte is not considered in the calculation of "BYTE 2"
7const int Fixed_Byte_To_Checksum = 25;
8
9const int CONTROL_DATA_LEN = 27;
10
11char * const dp5[8] = { "ML_1", "ML_2", "ML_3", "ML_4", "ML_5",
12                                                "ML_6", "HOV_Lane", "FYW_Conn"};
13char * const dp6[8] = { "OS_1", "OS_2", "OS_3", "OS_4", "OS_5",
14                                                "OS_6", "COLL_DIST_2", "COLL_DIST_OFF"};
15char * const dp7[8] = { "DEMAND", "PASSAGE", "QUEUE", "RAMP_ON",
16                                                "RAMP_OFF", "RAMP_HOV", "COLL_DIST_1", "COLL_DIST_ON"};
17char * const dp8[8] = { "SD_1", "SD_2", "SD_3", "SD_4", "SD_5",
18                                                "SD_6", "Pass_Vol_Count", "X"};
19
20
21
22typedef struct loopagg LOOPAGG;
23struct loopagg
24{
25        int             index;
26        char    lane;                   // how namy lanes at the detector station
27        long    time;
28        int             interval;
29        int     g_vol;
30        float   g_occ;
31        double  g_spd;
32        int             *vol;
33        float   *occ;
34        double  *spd;
35};
36
37// FEP line: has several lds
38typedef struct fep_line_lds FEP_LINE_LDS;
39struct  fep_line_lds
40{
41        int             lineNum;
42        vector<long> lds;
43        vector<long> ldsIndex;  // location in ldsMap
44        short   ldsNum;                 // actual number of lds on the line
45
46        short   count;  // actual count from caltrans
47        int             schedule;
48        int             lineInfo;
49        long    systemKey;
50        long    globalSeq;
51        long    schedleSeq;
52};
53
54typedef struct Lds_loop LDS_LOOP;
55struct  Lds_loop
56{
57        // Each lds has its own line_num and drop (Caltrans use)
58        long    lds;
59        short   line_num;
60        short   drop;
61
62        int             num;    // number of loops
63        long    *loopID;
64        char    **loop_loc;
65
66        // LDS data
67        unsigned char   *dataPack;
68        int             length;         // total length of data (max: 87)
69        int             pos;            // pointer for data preparation
70        int             MlTotVol;       // each 30 sec, the following will be updated
71        int             OppTotVol;      // each 30 sec, the following will be updated
72};
73
74#endif
Note: See TracBrowser for help on using the repository browser.