Index: /branches/FEPSimulator/DataPacker.cpp
===================================================================
--- /branches/FEPSimulator/DataPacker.cpp	(revision 117)
+++ /branches/FEPSimulator/DataPacker.cpp	(revision 137)
@@ -6,6 +6,10 @@
 unsigned char * DataPacker::packData(STATION *station) {
     int pos = 26;
+    
     DataPacker packer;
+    // static meta data pack
     msg = packer.staticDataPack(station);
+    
+    // dynamic data pack
     pos = packer.dynamicDataPack(station, 5, pos);    
     pos = packer.dynamicDataPack(station, 6, pos);
@@ -31,20 +35,24 @@
             packer.chksum(msg, station->length - 1 - 1);
     
+    /* hex dump of full datapack message - for debugging purposes
     for (int j = 0; j < station->length; j++) {
         printf("%02X", msg[j]);
     }
     printf("\n");
-
+    */
+    
     return msg;	
 }
 
 int DataPacker::dynamicDataPack(STATION *station, int packNo, int pos) {
+    
     int i, j, vol, occ, haveData;
+    
     //used for data byte 23 and 24
+    // Need to check: should we do this here? or is this already set?
     station->MlTotVol = 0;
     station->OppTotVol = 0;
 
     for (j = 1; j <= 8; j++) {
-        
         if (DataAvail(msg[packNo - 1], j)) {
             // loop at bit j has data
@@ -52,4 +60,7 @@
                 // what's the corresponding loop of bit j
                 char * currLoopLoc = station->loops.at(lane)->loop_loc;
+                
+                // check loop location type and see if there is data for this
+                // loop in the station
                 if (packNo == 5)
                     haveData = strcmp(currLoopLoc, dp5[j - 1]);
@@ -62,5 +73,7 @@
                 else
                     return -1;
-
+                
+                // if there is NO data for this loop in the station
+                // Need to check: is this if clause doing the correct thing?
                 if (haveData == 0) {
                     LOOP *currLoop = station->loops.at(lane);
@@ -73,5 +86,6 @@
                     pos++;
                     msg[pos - 1] = packedVOLOCC.low;
-
+                    
+                    // Need to check: same. should this be in this if clause?
                     if (packNo == 5) {
                         station->MlTotVol += vol;
@@ -146,5 +160,8 @@
         }
     }
+    // Need to check: if there is a demand loop, we set bit 14 to 0x0B (No metering)
+    // is this correct?
     if (found) {
+        // Need to check: what does this flag represent??
         // BYTE 14: mostly 07, some are 05, 03, 00
         dataPack[14 - 1] = 0x07;
@@ -163,5 +180,5 @@
         // Local Responsive Rate. DON'T UNDERSTAND YET
         dataPack[21 - 1] = 0x00;
-        // TOD Rate: need to query RAMP plugin!
+        // TOD Rate: need to query RAMP plugin! Need to check, might be important?
         dataPack[22 - 1] = 0x00;
     }// LDS: NO Metering
@@ -179,4 +196,6 @@
 
     // dataPack 23-24: sum of mainline/Opp traffic data; need to be updated every 30 sec
+    // Need to check, is this in sync with the notes in dynamicDataPack? why
+    // are we setting it to 0 here, might not need to...
     station->MlTotVol = 0;
     station->OppTotVol = 0;
@@ -185,4 +204,5 @@
 
     // dataPack 25-26: BYTE 25 is fixed, i.e. 03; BYTE 26 is either 0xA2 or 0x84
+    // Need to check: what is byte 26? what are 0xA2 and 0x84
     dataPack[25 - 1] = 0x03;
     dataPack[26 - 1] = 0x84;
