Changeset 203 in tmcsimulator for trunk/src/atmsdriver/model/Highways.java


Ignore:
Timestamp:
10/30/2017 08:23:20 PM (9 years ago)
Author:
jdalbey
Message:

Highways.java, Station.java Updated to prettify the console output.

File:
1 edited

Legend:

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

    r195 r203  
    480480        for (Highway hwy: highways) 
    481481        { 
     482            // Consider each route direction 
    482483            for (DIRECTION dir: DIRECTION.values()) 
    483484            { 
     485                String rowLabel = ""+String.format("%3s ",hwy.routeNumber)+dir.getLetter()+' '; 
    484486                StringBuilder lineout = new StringBuilder(); 
    485                 lineout.append(""+String.format("%3s ",hwy.routeNumber)+dir.getLetter()+' '); 
     487                // Examine every station on this highway and direction 
    486488                for (Station stat: hwy.stations) 
    487489                { 
    488                     if (stat.direction == dir) 
    489                     { 
    490                         //lineout.append("" + dir.getLetter() + stat.postmile); 
    491                         lineout.append(stat.getColorByDirection(stat.direction)); 
    492                         //lineout.append("  "); 
    493                     } 
     490                    //lineout.append("" + dir.getLetter() + stat.postmile); 
     491                    lineout.append(stat.getColorByDirection(dir)); 
     492                    //lineout.append("  "); 
    494493                } 
    495                 if (lineout.length() > 6) 
     494                // See if there were stations for this direction 
     495                String checkMe = lineout.toString().trim(); 
     496                // if any stations were colored, output the line 
     497                if (checkMe.length() > 1) 
    496498                { 
     499                    result.append(rowLabel); 
    497500                    result.append(lineout + "\n"); 
    498501                } 
Note: See TracChangeset for help on using the changeset viewer.