Changeset 127 in tmcsimulator for trunk/src/atmsdriver/ConsoleDriver.java


Ignore:
Timestamp:
10/16/2017 04:38:16 PM (9 years ago)
Author:
jdalbey
Message:

Station.java Enhance DOTCOLOR enum to have volume and occupancy fields. Minor changes to error messages in other files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/atmsdriver/ConsoleDriver.java

    r121 r127  
    409409     
    410410    /** 
    411      * Enum for highway status dot colors. 
     411     * Enum for highway status dot colors. Each color has associated volume 
     412     * and occupancy constants. 
    412413     * 
    413      * @author John A. Torres 
     414     * @author John A. Torres, jdalbey 
    414415     * @version 10/11/2017 
    415416     */ 
    416417    public static enum DOTCOLOR { 
    417418 
    418         RED, 
    419         YELLOW, 
    420         GREEN; 
     419        RED(10,10), 
     420        YELLOW(5,5), 
     421        GREEN(0,0); 
    421422         
    422423        // All the first letters of the values, in order. 
    423424        private static String allLetters = "RYG"; 
    424425         
     426        private int vol;  /* volume */ 
     427        private int occ;  /* occupancy */       
     428         
     429        private DOTCOLOR(int v, int o) 
     430        { 
     431            vol = v; 
     432            occ = o; 
     433        } 
    425434        /** 
    426435         * Return the first letter of this enum. 
     
    432441        } 
    433442 
     443        public int volume() 
     444        { 
     445            return vol; 
     446        } 
     447        public int occupancy() 
     448        { 
     449            return occ; 
     450        } 
    434451        /** 
    435452         * Returns a dot color given its first character. 
Note: See TracChangeset for help on using the changeset viewer.