Changeset 285 in tmcsimulator for trunk/src


Ignore:
Timestamp:
02/28/2019 10:21:36 AM (7 years ago)
Author:
jdalbey
Message:

Station.java: Add getColorName method, comment out dead code.

Location:
trunk/src
Files:
3 edited

Legend:

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

    r274 r285  
    510510                { 
    511511                    //lineout.append("" + dir.getLetter() + stat.postmile); 
    512                     lineout.append(stat.getColorByDirection(dir)); 
     512                    lineout.append(stat.getColor()); 
    513513                    //lineout.append("  "); 
    514514                } 
     
    543543        Scanner s = new Scanner(fis).useDelimiter("\\A"); 
    544544        pmList.load(s); 
     545         
    545546        String header = "{\n" + 
    546547        "  \"type\": \"FeatureCollection\",\n" + 
     
    573574                        String outString = currentPM.toJson(); 
    574575                        // replace the color code with the color name 
    575                         String colorName=""; 
    576                         switch (stat.getColorByDirection(stat.direction)) 
    577                         { 
    578                             case '@': colorName = "red";break; 
    579                             case '+': colorName = "yellow"; break; 
    580                             case '-': colorName = "lime";break; 
    581                             case ' ': colorName = "lime";break; 
    582                         } 
     576                        String colorName=stat.getColorName(); 
    583577                        outString = outString.replace("desiredcolor",colorName); 
    584578                        lineout.append(outString); 
  • trunk/src/atmsdriver/model/Station.java

    r278 r285  
    202202    /** 
    203203     * Return the color for the lanes in a given direction. 
    204      * 
    205      * @param direction 
    206      * @return character representing color of lanes in given direction '@' = 
    207      * red, '+' = yellow, '-' = green 
    208      */ 
    209     public char getColorByDirection(DIRECTION direction) 
     204     * @return character representing color of this station's traffic flow 
     205     * '@' = red, '+' = yellow, '-' = green 
     206     */ 
     207    public char getColor() 
    210208    { 
    211209        /* For now just use the color of the first lane.  
     
    213211 
    214212        String laneDir = ""; 
    215         if (direction.equals(this.direction)) 
    216         { 
    217             laneDir = "ML"; 
    218         } 
    219         else if (direction.equals(this.direction.getOpposite())) 
    220         { 
    221             laneDir = "OS"; 
    222         } 
     213         
     214            // THIS DECISION ISN'T NEEDED after JD's BuildHighwayFile pgm 
     215            // creates a highway map based on VDS instead of Controller (LDS). 
     216//        if (direction.equals(this.direction)) 
     217//        { 
     218//            laneDir = "ML"; 
     219//        } 
     220//        else if (direction.equals(this.direction.getOpposite())) 
     221//        { 
     222//            laneDir = "OS"; 
     223//        } 
    223224        // Search lanes to find specified direction 
    224225        for (LoopDetector loop : loops) 
     
    245246        // Default case for when the route is not on this direction 
    246247        return ' '; 
    247  
    248     } 
    249  
     248    } 
     249    /** 
     250     * Return the color name for the traffic volume of this station. 
     251     */ 
     252    public String getColorName() 
     253    { 
     254        String colorName = ""; 
     255        switch (this.getColor()) 
     256        { 
     257            case '@': colorName = "red";break; 
     258            case '+': colorName = "yellow"; break; 
     259            case '-': colorName = "lime";break; 
     260            case ' ': colorName = "lime";break; 
     261        } 
     262        return colorName; 
     263    } 
    250264    /** 
    251265     * Output for updateByDirection. Logs the update to the console. 
  • trunk/src/tmcsim/application.properties

    r280 r285  
    1 #Tue, 26 Feb 2019 10:41:58 -0800 
     1#Thu, 28 Feb 2019 10:42:26 -0800 
    22 
    3 Application.revision=278 
     3Application.revision=283 
    44 
    5 Application.buildnumber=100 
     5Application.buildnumber=101 
Note: See TracChangeset for help on using the changeset viewer.