Index: /trunk/src/tmcsim/application.properties
===================================================================
--- /trunk/src/tmcsim/application.properties	(revision 195)
+++ /trunk/src/tmcsim/application.properties	(revision 202)
@@ -1,5 +1,5 @@
-#Mon, 30 Oct 2017 00:56:17 -0700
+#Mon, 30 Oct 2017 19:17:39 -0700
 
-Application.revision=190
+Application.revision=195
 
-Application.buildnumber=67
+Application.buildnumber=68
Index: /trunk/src/atmsdriver/model/LoopDetector.java
===================================================================
--- /trunk/src/atmsdriver/model/LoopDetector.java	(revision 190)
+++ /trunk/src/atmsdriver/model/LoopDetector.java	(revision 202)
@@ -88,9 +88,7 @@
             build.append(" ");
             build.append(this.vol);
+            build.append(" ");
         }
-        else
-        {
-            build.append(this.loopLocation);
-        }
+        build.append(this.loopLocation);
         build.append("\n");
         return build.toString();
Index: /branches/FEPSimulator/DataPacker.cpp
===================================================================
--- /branches/FEPSimulator/DataPacker.cpp	(revision 159)
+++ /branches/FEPSimulator/DataPacker.cpp	(revision 202)
@@ -127,5 +127,4 @@
     // dataPack2 (2 bytes per loop)
     dataPack[2 - 1] = station->loops.size() * 2 + Fixed_Byte_To_Checksum;
-
     // dataPacket 3 (lowbyte: # of mainline loops, highbyte: # of opposite loops)
     int low = 0, high = 0;
Index: /branches/FEPSimulator/HighwaysParser.cpp
===================================================================
--- /branches/FEPSimulator/HighwaysParser.cpp	(revision 199)
+++ /branches/FEPSimulator/HighwaysParser.cpp	(revision 202)
@@ -21,7 +21,5 @@
       * */
 HighwaysParser::HighwaysParser(char * hwyData) {
-    string highwaysData = hwyData;
-    istringstream stream(highwaysData);
-    parseLines(highwaysData);
+    parseLines(hwyData);
 }
 
@@ -29,33 +27,13 @@
 }
 
-vector<FEP_LINE *> HighwaysParser::getLines() {
-    
-}
-
-vector<STATION *> HighwaysParser::getStations() {
-    
-}
-
-// Loop Detector: A single sensor that detects the volume, occupancy, and speed
-// in a single highway lane
-typedef struct loop LOOP;
-struct loop
+void HighwaysParser::parseLines(char * hwyData)
 {
-    // meta data
-    long loopID;
-    char *loop_loc;
-    
-    // dynamic data
-    int vol;
-    float occ;
-    double spd;
-};
-void HighwaysParser::parseLines(istringstream highwaysData)
-{
+    string highwaysData = hwyData;
+    istringstream highwaysStream(highwaysData);
     string currLine;
-    getline(highwaysData, currLine);
+    getline(highwaysStream, currLine);
     int numLines;
-    sscanf(highwaysData, "%d", &numLines);
-    
+    sscanf(currLine.c_str(), "%d", &numLines);
+    cout << currLine << endl;
     int lineNum = 0;
     long lds = 0;
@@ -69,18 +47,19 @@
     short dropNum = 0;
     int routeNum = 0;
-    char * direction = "";
     float postmile = 0;
     long loopID = 0;
     float occ = 0;
     int vol = 0;
-    
+    char loopLoc[25];
     for(int lineIndex = 0; lineIndex < numLines; lineIndex++)
     {
         FEP_LINE * newLine = new FEP_LINE;
         
-        getline(highwaysData, currLine);
+        getline(highwaysStream, currLine);
         int numStations = 0;
-        sscanf(currLine, "%d %d %d", &lineNum, &count, &numStations);
-
+        sscanf(currLine.c_str(), "%d %hd %d", &lineNum, &count, &numStations);
+        cout << "Line num: " << lineNum << endl;
+        cout << "Count: " << count << endl;
+        cout << "numStations: " << numStations << endl;
         newLine->lineNum = lineNum;
         newLine->count = count;
@@ -94,18 +73,49 @@
         {
             STATION * newStation = new STATION;
-            
+    
             int numLoops = 0;
-            getline(highwaysData, currLine);
-            sscanf(currLine, "%ld %d %d %s %d %d", &lds, &dropNum,&routeNum, 
-                    direction, postmile, &numLoops);
-            
+            getline(highwaysStream, currLine);
+            cout << currLine << endl;
+            char direction;
+            sscanf(currLine.c_str(), "%ld %hd %d %c %f %d", &lds, &dropNum, &routeNum, &direction,
+                    &postmile, &numLoops);
+            cout << "NumberLoops: " << numLoops << endl;
+            cout << "DropNum: " << dropNum << endl;
+            cout << "LDS: " << lds << endl;
+            cout << "LDSIndex: " << ldsIndex << endl;
+            cout << "postmile: " << postmile << endl;
             newLine->lds.push_back(lds);
             newLine->ldsIndex.push_back(ldsIndex++);
+            newStation->lds = lds;
+            newStation->line_num = lineNum;
+            newStation->drop = dropNum;
+            newStation->pos = 0;
+            newStation->MlTotVol = 0;
+            newStation->OppTotVol = 0;
             
             for(int loopIndex = 0; loopIndex < numLoops; loopIndex++)
             {
-                getline(highwaysData, currLine);
-                sscanf(currLine, "%ld %f %d", &loopID, &occ, &vol);
+                LOOP * newLoop = new LOOP;
+                
+                getline(highwaysStream, currLine);
+                cout << currLine << endl;
+                sscanf(currLine.c_str(), "%ld %f %d %s", &loopID, &occ, &vol, loopLoc);
+                cout << "LOOP ID: " << loopID << endl;
+                cout << "OCC: " << occ << endl;
+                cout << "VOL: " << vol << endl;
+                cout << "LOOPLOC: " << loopLoc << endl;
+                newLoop->loopID = loopID;
+                newLoop->occ = occ;
+                newLoop->vol = vol;
+                newLoop->loop_loc = loopLoc;
+                
+                newStation->loops.push_back(newLoop);
             }
+            newStation->length = newStation->loops.size() * 2 + CONTROL_DATA_LEN;
+            newStation->dataPack = DataPacker::packData(newStation);
+            
+            cout << "NUMBER OF LOOPS: " << newStation->loops.size() << endl;
+            
+            this->stations.push_back(newStation);
         }
         
@@ -113,17 +123,2 @@
     }
 }
-
-FEP_LINE * HighwaysParser::parseLine(istringstream highwaysData)
-{
-
-}
-
-STATION * HighwaysParser::parseStation(istringstream highwaysData)
-{
-    
-}
-
-LOOP * HighwaysParser::parseLoop(istringstream highwaysData)
-{
-    
-}
Index: /branches/FEPSimulator/HighwaysParser.h
===================================================================
--- /branches/FEPSimulator/HighwaysParser.h	(revision 198)
+++ /branches/FEPSimulator/HighwaysParser.h	(revision 202)
@@ -13,4 +13,6 @@
 #include <iostream>
 #include <sstream>
+#include <stdio.h>
+#include "DataPacker.h"
 
 class HighwaysParser {
@@ -18,16 +20,9 @@
     HighwaysParser(char * highwaysData);
     
-    vector<FEP_LINE*> getLines();
-    vector<STATION*> getStations();
-    
+    vector<FEP_LINE*> lines;
+    vector<STATION*> stations;
     virtual ~HighwaysParser();
 private:
-    vector<FEP_LINE*> lines;
-    vector<STATION*> stations;
-    
-    FEP_LINE * parseLine(istringstream highwaysData);
-    STATION * parseStation(istringstream highwaysData);
-    LOOP * parseLoop(istringstream highwaysData);
-    void parseLines(istringstream highwaysData);
+    void parseLines(char * highwaysData);
 };
 
Index: /branches/FEPSimulator/FEPSim.cpp
===================================================================
--- /branches/FEPSimulator/FEPSim.cpp	(revision 177)
+++ /branches/FEPSimulator/FEPSim.cpp	(revision 202)
@@ -23,6 +23,6 @@
 void FEPSim::sendReplys(char * buffer) {
     HighwaysParser highwaysParser = HighwaysParser(buffer);
-    vector<FEP_LINE*> lines = highwaysParser.getLines();
-    vector<STATION*> ldsMap = highwaysParser.getStations();
+    vector<FEP_LINE*> lines = highwaysParser.lines;
+    vector<STATION*> ldsMap = highwaysParser.stations;
 
     // Send one reply for every FEPLine
@@ -94,4 +94,6 @@
             // Transfer the station data to ATMS and listen for response
             handleCallResponse(fep_reply_xfer_32(&fepReply, clnt));
+            unsigned int sleepseconds = /* 100 * */1000;
+            usleep(sleepseconds);
         }
     }
