- Timestamp:
- 11/01/2017 03:53:59 AM (9 years ago)
- Location:
- branches/FEPSimulator
- Files:
-
- 4 edited
-
FEPSim.cpp (modified) (5 diffs)
-
FEPSim.h (modified) (1 diff)
-
HighwaysParser.cpp (modified) (2 diffs)
-
nbproject/private/private.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/FEPSimulator/FEPSim.cpp
r202 r205 26 26 vector<STATION*> ldsMap = highwaysParser.stations; 27 27 28 28 29 // Send one reply for every FEPLine 29 30 for (int i = 0; i < lines.size(); i++) { … … 74 75 fsa.msg.message[3 + aa] = 0xff; 75 76 76 for(int l = 0; l < fsa.msg.message_len + 2; l++)77 /*for(int l = 0; l < fsa.msg.message_len + 2; l++) 77 78 { 78 79 printf("%02X", (unsigned char) fsa.msg.message[l]); 79 80 } 80 printf("\n"); 81 printf("\n");*/ 81 82 82 83 // info … … 89 90 fepReply.answers.fep_answer_list_u.shortp.answers[0] = fsa; 90 91 // 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); 92 93 // Make RPC Call and handle response 93 94 // printf("Handling ATMS response...\n"); … … 178 179 // zero out buffer 179 180 bzero(buffer, BUFF_SIZE); 180 181 181 182 // read XML from socket 182 183 int totBytes = 0; … … 184 185 totBytes += n; 185 186 } 187 HighwaysParser highwaysParser = HighwaysParser(buffer); 188 186 189 187 190 if (n < 0) { -
branches/FEPSimulator/FEPSim.h
r195 r205 43 43 #include <unistd.h> 44 44 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 :) 45 const int BUFF_SIZE = 1266341; // where it is now :) 48 46 49 47 class FEPSim { -
branches/FEPSimulator/HighwaysParser.cpp
r202 r205 76 76 int numLoops = 0; 77 77 getline(highwaysStream, currLine); 78 cout << currLine << endl;79 78 char direction; 80 79 sscanf(currLine.c_str(), "%ld %hd %d %c %f %d", &lds, &dropNum, &routeNum, &direction, 81 80 &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;87 81 newLine->lds.push_back(lds); 88 82 newLine->ldsIndex.push_back(ldsIndex++); … … 101 95 cout << currLine << endl; 102 96 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;107 97 newLoop->loopID = loopID; 108 98 newLoop->occ = occ; 109 99 newLoop->vol = vol; 100 newLoop->spd = 0; 110 101 newLoop->loop_loc = loopLoc; 111 102 cout << "Adding " << newLoop->loopID << " to " << newStation->lds << endl; 112 103 newStation->loops.push_back(newLoop); 113 104 } 114 105 newStation->length = newStation->loops.size() * 2 + CONTROL_DATA_LEN; 115 106 newStation->dataPack = DataPacker::packData(newStation); 107 for(int byte = 0; byte < newStation->length; byte++) 108 { 109 printf("%02X", (unsigned char) newStation->dataPack[byte]); 110 } 116 111 117 cout << "NUMBER OF LOOPS: " << newStation->loops.size() << endl; 118 112 cout << "Adding " << newStation->lds << " to ldsMap " << " at index " << ldsIndex << endl; 119 113 this->stations.push_back(newStation); 120 114 } 121 115 cout << "Adding " << newLine->lineNum << " to lines" << endl; 122 116 this->lines.push_back(newLine); 123 117 } -
branches/FEPSimulator/nbproject/private/private.xml
r195 r205 11 11 <file>file:/Users/jtorres/tmcsimulator/branches/FEPSimulator/HighwaysParser.h</file> 12 12 <file>file:/Users/jtorres/tmcsimulator/branches/FEPSimulator/DataPacker.h</file> 13 <file>file:/Users/jtorres/tmcsimulator/branches/FEPSimulator/DataPacker.cpp</file> 13 14 <file>file:/Users/jtorres/tmcsimulator/branches/FEPSimulator/FEPSim.cpp</file> 15 <file>file:/Users/jtorres/tmcsimulator/branches/FEPSimulator/Main.cpp</file> 14 16 <file>file:/Users/jtorres/tmcsimulator/branches/FEPSimulator/fep.h</file> 15 17 <file>file:/Users/jtorres/tmcsimulator/branches/FEPSimulator/FEPSim.h</file>
Note: See TracChangeset
for help on using the changeset viewer.
