Changeset 186 in tmcsimulator for trunk/src/atmsdriver/model/FEPLine.java


Ignore:
Timestamp:
10/28/2017 06:48:11 PM (9 years ago)
Author:
jtorres
Message:

Highways.java, FEPLine.java, LoopDetector?.java, Station.java: reconfigured the getHighwaysMeta() function to a toCondensedFormat(boolean MetaDataOnly?) method. By specifying MetaDataOnly? as true, you get the same output as the previous getHighwaysMeta() function. By specifying MetaDataOnly? as false, you get the new condensed format needed to send to the FEPSim over the socket. This allows us to use the same function to get a meta data dump, as well as get the highways data format needed for FEPSim socket. HighwaysParser?.cpp: removed the old tinyxml code, set up skeleton for new parser. NetworkReader?.h: deleted, and added HighwaysParser?.h. LoadSadDotsTest?.java and StationTest?.java: configured to use new toCondensedFormat method instead of getHighwaysMeta.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/atmsdriver/model/FEPLine.java

    r184 r186  
    3737    } 
    3838     
    39     /** 
    40      * Returns the FEPLine meta data in string format 
    41      * @return FEPLine metadata 
     39    /** Returns a string of highways data. If MetaDataOnly is true, you get a full 
     40     *  dump of the highways meta data, which does not include dynamic loop values, 
     41     *  and does include the string location names. If MetaDataOnly is false, 
     42     *  dynamic loop values are included, and unnecessary information like string 
     43     *  location values are included. 
     44     *  
     45     *  The FEPSimulator takes in the toCondensedFormat() output, with a MetaDataOnly 
     46     *  value of false, over the socket. 
     47     *  
     48     *  The MetaDataOnly flag should be used to get a full dump of the highways 
     49     *  information. This was used to get the highways_fullmap.txt output. 
     50     *  
     51     * @param MetaDataOnly Whether you want meta data, or a full dump for FEPSim 
     52     * @return String, highways data in condensed format 
    4253     */ 
    43     public String getLineMeta() 
     54    public String toCondensedFormat(boolean MetaDataOnly) 
    4455    { 
    4556        StringBuilder build = new StringBuilder(); 
     
    5061        build.append(Integer.toString(this.stations.size())); 
    5162        build.append("\n"); 
    52         for (Station station : stations) 
     63        for(Station station : stations) 
    5364        { 
    54             build.append(station.getStationMeta()); 
     65            build.append(station.toCondensedFormat(MetaDataOnly)); 
    5566        } 
    5667        return build.toString(); 
Note: See TracChangeset for help on using the changeset viewer.