Index: branches/green_dot/network.h
===================================================================
--- branches/green_dot/network.h	(revision 138)
+++ branches/green_dot/network.h	(revision 165)
@@ -9,11 +9,11 @@
 const int CONTROL_DATA_LEN = 27;
 char * const dp5[8] = { "ML_1", "ML_2", "ML_3", "ML_4", "ML_5",
-                                                "ML_6", "HOV_Lane", "FYW_Conn"};
+   "ML_6", "HOV_Lane", "FYW_Conn"};
 char * const dp6[8] = { "OS_1", "OS_2", "OS_3", "OS_4", "OS_5",
-                                                "OS_6", "COLL_DIST_2", "COLL_DIST_OFF"};
+   "OS_6", "COLL_DIST_2", "COLL_DIST_OFF"};
 char * const dp7[8] = { "DEMAND", "PASSAGE", "QUEUE", "RAMP_ON",
-                                                "RAMP_OFF", "RAMP_HOV", "COLL_DIST_1", "COLL_DIST_ON"};
+   "RAMP_OFF", "RAMP_HOV", "COLL_DIST_1", "COLL_DIST_ON"};
 char * const dp8[8] = { "SD_1", "SD_2", "SD_3", "SD_4", "SD_5",
-                                                "SD_6", "Pass_Vol_Count", "X"};
+   "SD_6", "Pass_Vol_Count", "X"};
 
 /*** NETWORK STRUCTS ***/
@@ -21,14 +21,14 @@
 struct loopagg
 {
-	int		index;
-	char	lane;			// how namy lanes at the detector station
-	long	time;
-	int		interval;
-	int 	g_vol;
-	float	g_occ;
-	double	g_spd;
-	int		*vol;
-	float	*occ;
-	double	*spd;
+   int		index;
+   char	lane;			// how namy lanes at the detector station
+   long	time;
+   int		interval;
+   int 	g_vol;
+   float	g_occ;
+   double	g_spd;
+   int		*vol;
+   float	*occ;
+   double	*spd;
 };
 
@@ -37,37 +37,57 @@
 struct  fep_line_lds
 {
-	int		lineNum;
-	vector<long> lds;
-	vector<long> ldsIndex;	// location in ldsMap
-	short	ldsNum;			// actual number of lds on the line
+   int		lineNum;
+   vector<long> lds;
+   vector<long> ldsIndex;	// location in ldsMap
+   short	ldsNum;			// actual number of lds on the line
 
-	short	count;	// actual count from caltrans
-	int		schedule;
-	int		lineInfo;
-	long	systemKey;
-	long	globalSeq;
-	long	schedleSeq;
+   short	count;	// actual count from caltrans
+   int		schedule;
+   int		lineInfo;
+   long	systemKey;
+   long	globalSeq;
+   long	schedleSeq;
+};
+// Loop detector
+typedef struct loop LOOP;
+struct loop
+{
+   long loopID;
+   char *loop_loc;
+
+   int vol;
+   float occ;
+   double spd;
 };
 
 // Loop detector station: has several loops
-typedef struct Lds_loop LDS_LOOP;
-struct  Lds_loop 
+typedef struct Station STATION;
+struct  Station 
 {
-	// Each lds has its own line_num and drop (Caltrans use)
-	long	lds;
-	short	line_num;
-	short	drop;
+   // Each lds has its own line_num and drop (Caltrans use)
+   long	lds;
+   short	line_num;
+   short	drop;
 
-	int		num;	// number of loops
-	long	*loopID;
-	char	**loop_loc;
+   vector<LOOP*> loops;
 
-	// LDS data
-	unsigned char	*dataPack;
-	int		length;		// total length of data (max: 87)
-	int		pos;		// pointer for data preparation
-	int		MlTotVol;	// each 30 sec, the following will be updated
-	int		OppTotVol;	// each 30 sec, the following will be updated
+   int		num;	// number of loops
+   // LDS data
+   unsigned char	*dataPack;
+   int		length;		// total length of data (max: 87)
+   int		pos;		// pointer for data preparation
+   int		MlTotVol;	// each 30 sec, the following will be updated
+   int		OppTotVol;	// each 30 sec, the following will be updated
+};
+// A helper structure used to pack the volume and occupancy at a loop into
+// // a two byte message
+typedef struct volOcc VOLOCC;
+struct  volOcc
+{
+   char high;
+   char low;
 };
 
+
+
 #endif
