Warning: Can't use blame annotator:
svn blame failed on branches/fep_rpc_client/network.h: ("Can't find a temporary directory: Internal error", 20014)

source: tmcsimulator/branches/fep_rpc_client/network.h @ 77

Revision 77, 2.0 KB checked in by jtorres, 9 years ago (diff)

fep_rpc_client: NetworkReader? complete. All cpp code is commented and cleaned. Added tinyxml lib.

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