Changeset 285 in tmcsimulator for trunk/src/atmsdriver/model/Station.java
- Timestamp:
- 02/28/2019 10:21:36 AM (7 years ago)
- File:
-
- 1 edited
-
trunk/src/atmsdriver/model/Station.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/atmsdriver/model/Station.java
r278 r285 202 202 /** 203 203 * 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() 210 208 { 211 209 /* For now just use the color of the first lane. … … 213 211 214 212 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 // } 223 224 // Search lanes to find specified direction 224 225 for (LoopDetector loop : loops) … … 245 246 // Default case for when the route is not on this direction 246 247 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 } 250 264 /** 251 265 * Output for updateByDirection. Logs the update to the console.
Note: See TracChangeset
for help on using the changeset viewer.
