Changeset 205 in tmcsimulator for branches


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.

Location:
branches/FEPSimulator
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/FEPSimulator/FEPSim.cpp

    r202 r205  
    2626    vector<STATION*> ldsMap = highwaysParser.stations; 
    2727 
     28     
    2829    // Send one reply for every FEPLine 
    2930    for (int i = 0; i < lines.size(); i++) { 
     
    7475            fsa.msg.message[3 + aa] = 0xff; 
    7576             
    76             for(int l = 0; l < fsa.msg.message_len + 2; l++) 
     77            /*for(int l = 0; l < fsa.msg.message_len + 2; l++) 
    7778            { 
    7879                printf("%02X", (unsigned char) fsa.msg.message[l]); 
    7980            } 
    80             printf("\n"); 
     81            printf("\n");*/ 
    8182             
    8283            // info 
     
    8990            fepReply.answers.fep_answer_list_u.shortp.answers[0] = fsa; 
    9091            // send out data 
    91             printf("Transferring line=%d, lds_drop_no=%d...\n", lines.at(i)->lineNum, (int)ldsMap.at(index)->drop); 
     92            //printf("Transferring line=%d, lds_drop_no=%d...\n", lines.at(i)->lineNum, (int)ldsMap.at(index)->drop); 
    9293            // Make RPC Call and handle response 
    9394            // printf("Handling ATMS response...\n"); 
     
    178179        // zero out buffer 
    179180        bzero(buffer, BUFF_SIZE); 
    180  
     181         
    181182        // read XML from socket 
    182183        int totBytes = 0; 
     
    184185            totBytes += n; 
    185186        } 
     187        HighwaysParser highwaysParser = HighwaysParser(buffer); 
     188 
    186189 
    187190        if (n < 0) { 
  • branches/FEPSimulator/FEPSim.h

    r195 r205  
    4343#include <unistd.h> 
    4444 
    45 // const int BUFF_SIZE = 5500000; // where it was 
    46 // const int BUFF_SIZE = 11522291; // what it couldnt be :) 
    47 const int BUFF_SIZE = 950401; // where it is now :)  
     45const int BUFF_SIZE = 1266341; // where it is now :)  
    4846 
    4947class FEPSim { 
  • 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    } 
  • branches/FEPSimulator/nbproject/private/private.xml

    r195 r205  
    1111            <file>file:/Users/jtorres/tmcsimulator/branches/FEPSimulator/HighwaysParser.h</file> 
    1212            <file>file:/Users/jtorres/tmcsimulator/branches/FEPSimulator/DataPacker.h</file> 
     13            <file>file:/Users/jtorres/tmcsimulator/branches/FEPSimulator/DataPacker.cpp</file> 
    1314            <file>file:/Users/jtorres/tmcsimulator/branches/FEPSimulator/FEPSim.cpp</file> 
     15            <file>file:/Users/jtorres/tmcsimulator/branches/FEPSimulator/Main.cpp</file> 
    1416            <file>file:/Users/jtorres/tmcsimulator/branches/FEPSimulator/fep.h</file> 
    1517            <file>file:/Users/jtorres/tmcsimulator/branches/FEPSimulator/FEPSim.h</file> 
Note: See TracChangeset for help on using the changeset viewer.