Changeset 205 in tmcsimulator for branches/FEPSimulator/HighwaysParser.cpp


Ignore:
Timestamp:
11/01/2017 03:53:59 AM (9 years ago)
Author:
jtorres
Message:

LoadHighwaysTest?.java: now passing. HighwaysParser?.cpp: added a bunch of debugging output to stdout, bug still not found. FEPSim.h: changed buffer size. FEPSim.cpp: some local debugging outputs/config.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/FEPSimulator/HighwaysParser.cpp

    r202 r205  
    7676            int numLoops = 0; 
    7777            getline(highwaysStream, currLine); 
    78             cout << currLine << endl; 
    7978            char direction; 
    8079            sscanf(currLine.c_str(), "%ld %hd %d %c %f %d", &lds, &dropNum, &routeNum, &direction, 
    8180                    &postmile, &numLoops); 
    82             cout << "NumberLoops: " << numLoops << endl; 
    83             cout << "DropNum: " << dropNum << endl; 
    84             cout << "LDS: " << lds << endl; 
    85             cout << "LDSIndex: " << ldsIndex << endl; 
    86             cout << "postmile: " << postmile << endl; 
    8781            newLine->lds.push_back(lds); 
    8882            newLine->ldsIndex.push_back(ldsIndex++); 
     
    10195                cout << currLine << endl; 
    10296                sscanf(currLine.c_str(), "%ld %f %d %s", &loopID, &occ, &vol, loopLoc); 
    103                 cout << "LOOP ID: " << loopID << endl; 
    104                 cout << "OCC: " << occ << endl; 
    105                 cout << "VOL: " << vol << endl; 
    106                 cout << "LOOPLOC: " << loopLoc << endl; 
    10797                newLoop->loopID = loopID; 
    10898                newLoop->occ = occ; 
    10999                newLoop->vol = vol; 
     100                newLoop->spd = 0; 
    110101                newLoop->loop_loc = loopLoc; 
    111                  
     102                cout << "Adding " << newLoop->loopID << " to " << newStation->lds << endl; 
    112103                newStation->loops.push_back(newLoop); 
    113104            } 
    114105            newStation->length = newStation->loops.size() * 2 + CONTROL_DATA_LEN; 
    115106            newStation->dataPack = DataPacker::packData(newStation); 
     107            for(int byte = 0; byte < newStation->length; byte++) 
     108            { 
     109                printf("%02X", (unsigned char) newStation->dataPack[byte]); 
     110            } 
    116111             
    117             cout << "NUMBER OF LOOPS: " << newStation->loops.size() << endl; 
    118              
     112            cout << "Adding " << newStation->lds << " to ldsMap " << " at index " << ldsIndex << endl; 
    119113            this->stations.push_back(newStation); 
    120114        } 
    121          
     115        cout << "Adding " << newLine->lineNum << " to lines" << endl; 
    122116        this->lines.push_back(newLine); 
    123117    } 
Note: See TracChangeset for help on using the changeset viewer.