Changeset 209 in tmcsimulator for branches/FEPSimulator/HighwaysParser.cpp
- Timestamp:
- 11/02/2017 12:07:25 AM (9 years ago)
- File:
-
- 1 edited
-
branches/FEPSimulator/HighwaysParser.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/FEPSimulator/HighwaysParser.cpp
r205 r209 35 35 int numLines; 36 36 sscanf(currLine.c_str(), "%d", &numLines); 37 cout << currLine << endl;38 37 int lineNum = 0; 39 38 long lds = 0; … … 51 50 float occ = 0; 52 51 int vol = 0; 53 char loopLoc[25]; 52 54 53 for(int lineIndex = 0; lineIndex < numLines; lineIndex++) 55 54 { … … 59 58 int numStations = 0; 60 59 sscanf(currLine.c_str(), "%d %hd %d", &lineNum, &count, &numStations); 61 cout << "Line num: " << lineNum << endl;62 cout << "Count: " << count << endl;63 cout << "numStations: " << numStations << endl;64 60 newLine->lineNum = lineNum; 65 61 newLine->count = count; … … 93 89 94 90 getline(highwaysStream, currLine); 95 cout << currLine << endl;96 sscanf(currLine.c_str(), "%ld %f %d %s", &loopID, &occ, &vol, loopLoc);91 newLoop->loop_loc = (char *) malloc(25 * sizeof(char)); 92 sscanf(currLine.c_str(), "%ld %f %d %s", &loopID, &occ, &vol, newLoop->loop_loc); 97 93 newLoop->loopID = loopID; 98 94 newLoop->occ = occ; 99 95 newLoop->vol = vol; 100 96 newLoop->spd = 0; 101 newLoop->loop_loc = loopLoc;102 cout << "Adding " << newLoop->loopID << " to " << newStation->lds << endl;103 97 newStation->loops.push_back(newLoop); 104 98 } … … 109 103 printf("%02X", (unsigned char) newStation->dataPack[byte]); 110 104 } 105 printf("\n"); 111 106 112 cout << "Adding " << newStation->lds << " to ldsMap " << " at index " << ldsIndex << endl;113 107 this->stations.push_back(newStation); 114 108 } 115 cout << "Adding " << newLine->lineNum << " to lines" << endl;116 109 this->lines.push_back(newLine); 117 110 }
Note: See TracChangeset
for help on using the changeset viewer.
