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


Ignore:
Timestamp:
10/30/2017 03:33:04 PM (9 years ago)
Author:
jtorres
Message:

FEPSim.h: changed buffer size. HighwaysParser?.cpp: began new condensed format parsing, not finished. atms_driver_config_local.properties: changed properties file for new highways_fullmap.txt. Highways.java: comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/FEPSimulator/HighwaysParser.cpp

    r186 r195  
    88#include "HighwaysParser.h" 
    99 
    10 HighwaysParser::HighwaysParser() { 
     10HighwaysParser::HighwaysParser(char * hwyData) { 
     11    string highwaysData = hwyData; 
     12    istringstream stream(highwaysData); 
     13    parseLines(highwaysData); 
    1114} 
    1215 
     
    1417} 
    1518 
     19vector<FEP_LINE *> HighwaysParser::getLines() { 
     20     
     21} 
     22 
     23vector<STATION *> HighwaysParser::getStations() { 
     24     
     25} 
     26// FEP line: Represents a serial communication line from field stations to the  
     27// An FEP Line has several Loop Detector Stations (Stations) connected) 
     28typedef struct fep_line FEP_LINE; 
     29struct  fep_line 
     30{ 
     31        int             lineNum; 
     32        vector<long>    lds; 
     33        vector<long>    ldsIndex;       // location in ldsMap 
     34 
     35        short   count;  // actual count from caltrans 
     36        int     schedule; 
     37        int     lineInfo; 
     38        long    systemKey; 
     39        long    globalSeq; 
     40        long    schedleSeq; 
     41}; 
     42void HighwaysParser::parseLines(istringstream highwaysData) 
     43{ 
     44    string currLine; 
     45    getline(highwaysData, currLine); 
     46    int numLines; 
     47    sscanf(highwaysData, "%d", &numLines); 
     48     
     49    int lineNum = 0; 
     50    long lds = 0; 
     51    long ldsIndex = 0; 
     52    short count = 0; 
     53    int schedule = 0; 
     54    int lineInfo = 0; 
     55    long systemKey = 0; 
     56    long globalSeq = 0; 
     57    long schedleSeq = 0; 
     58     
     59    for(int lineIndex = 0; lineIndex < numLines; lineIndex++) 
     60    { 
     61        getline(highwaysData, currLine); 
     62        int numStations = 0; 
     63        sscanf(currLine, "%d %d %d", &lineNum, &count, &numStations); 
     64        for(int stationIndex = 0; stationIndex < numStations; stationIndex++) 
     65        { 
     66            getline(highwaysData, currLine); 
     67            sscanf(currLine, "%d %d %d %d %d %d", &lds, ) 
     68             
     69        } 
     70    } 
     71    getline(highwaysData, currLine); 
     72} 
     73 
     74FEP_LINE * HighwaysParser::parseLine(istringstream highwaysData) 
     75{ 
     76 
     77} 
     78 
     79STATION * HighwaysParser::parseStation(istringstream highwaysData) 
     80{ 
     81     
     82} 
     83 
     84LOOP * HighwaysParser::parseLoop(istringstream highwaysData) 
     85{ 
     86     
     87} 
Note: See TracChangeset for help on using the changeset viewer.