Index: trunk/src/atmsdriver/model/Station.java
===================================================================
--- trunk/src/atmsdriver/model/Station.java	(revision 191)
+++ trunk/src/atmsdriver/model/Station.java	(revision 203)
@@ -8,10 +8,10 @@
 /**
  * A Station (LDS or Loop Detector Station) represents a group of lane detectors
- * across all lanes at a particular point on a highway.  A station is
- * identified by its highway number and postmile.  A station has an associated
- * direction used to establish which direction is Main and which is Opposite.
- * The MLTotVol and OppTotVol for a station can be dynamically updated.
- * A station has other attributes: lineNum, ldsID, drop, and location which are
- * used by the FEP.  A station can be compared to other stations by its postmile.
+ * across all lanes at a particular point on a highway. A station is identified
+ * by its highway number and postmile. A station has an associated direction
+ * used to establish which direction is Main and which is Opposite. The MLTotVol
+ * and OppTotVol for a station can be dynamically updated. A station has other
+ * attributes: lineNum, ldsID, drop, and location which are used by the FEP. A
+ * station can be compared to other stations by its postmile.
  *
  * @author John A. Torres
@@ -52,8 +52,8 @@
         this.OppTotVol = getOPPTotVol();
     }
-    
+
     /**
      * Calculates the total ML Volume.
-     * 
+     *
      * @return total ML volume.
      */
@@ -61,7 +61,7 @@
     {
         int mlTotVol = 0;
-        for(LoopDetector loop : loops)
-        {
-            if(loop.loopLocation.startsWith("ML"))
+        for (LoopDetector loop : loops)
+        {
+            if (loop.loopLocation.startsWith("ML"))
             {
                 mlTotVol += loop.vol;
@@ -70,8 +70,8 @@
         return mlTotVol;
     }
-    
+
     /**
      * Calculates the total OPP Volume
-     * 
+     *
      * @return total OPP volume.
      */
@@ -79,7 +79,7 @@
     {
         int oppTotVol = 0;
-        for(LoopDetector loop : loops)
-        {
-            if(loop.loopLocation.startsWith("OS"))
+        for (LoopDetector loop : loops)
+        {
+            if (loop.loopLocation.startsWith("OS"))
             {
                 oppTotVol += loop.vol;
@@ -88,17 +88,18 @@
         return oppTotVol;
     }
-    
-    /** Returns a string of highways data. If MetaDataOnly is true, you get a full
-     *  dump of the highways meta data, which does not include dynamic loop values,
-     *  and does include the string location names. If MetaDataOnly is false,
-     *  dynamic loop values are included, and unnecessary information like string
-     *  location values are included.
-     * 
-     *  The FEPSimulator takes in the toCondensedFormat() output, with a MetaDataOnly
-     *  value of false, over the socket.
-     * 
-     *  The MetaDataOnly flag should be used to get a full dump of the highways
-     *  information. This was used to get the highways_fullmap.txt output.
-     * 
+
+    /**
+     * Returns a string of highways data. If MetaDataOnly is true, you get a
+     * full dump of the highways meta data, which does not include dynamic loop
+     * values, and does include the string location names. If MetaDataOnly is
+     * false, dynamic loop values are included, and unnecessary information like
+     * string location values are included.
+     *
+     * The FEPSimulator takes in the toCondensedFormat() output, with a
+     * MetaDataOnly value of false, over the socket.
+     *
+     * The MetaDataOnly flag should be used to get a full dump of the highways
+     * information. This was used to get the highways_fullmap.txt output.
+     *
      * @param MetaDataOnly Whether you want meta data, or a full dump for FEPSim
      * @return String, highways data in condensed format
@@ -119,5 +120,5 @@
         build.append(Integer.toString(loops.size()));
         build.append(" ");
-        if(MetaDataOnly)
+        if (MetaDataOnly)
         {
             build.append(this.location);
@@ -167,21 +168,23 @@
     }
 
-    /** Determine which lane fields to update based on given direction
-     * and update all the loop detectors with the given color.
+    /**
+     * Determine which lane fields to update based on given direction and update
+     * all the loop detectors with the given color.
+     *
      * @param direction desired highway direction
      * @param dotColor desired dot color
      */
-    public void updateByDirection(DIRECTION direction, DOTCOLOR dotColor) 
+    public void updateByDirection(DIRECTION direction, DOTCOLOR dotColor)
     {
         String laneDir = "OS";
-        if(direction.equals(this.direction))
+        if (direction.equals(this.direction))
         {
             laneDir = "ML";
         }
         outputUpdateMessage(dotColor, laneDir);
-        
-        for(LoopDetector loop : loops)
-        {
-            if(loop.loopLocation.startsWith(laneDir))
+
+        for (LoopDetector loop : loops)
+        {
+            if (loop.loopLocation.startsWith(laneDir))
             {
                 // UPDATE LOOP WITH VALUES
@@ -189,14 +192,15 @@
             }
         }
-        
+
         this.MLTotVol = getMLTotVol();
         this.OppTotVol = getOPPTotVol();
     }
-    
+
     /**
      * Return the color for the lanes in a given direction.
+     *
      * @param direction
-     * @return character representing color of lanes in given direction
-     * '@' = red,  '+' = yellow, '-' = green
+     * @return character representing color of lanes in given direction '@' =
+     * red, '+' = yellow, '-' = green
      */
     public char getColorByDirection(DIRECTION direction)
@@ -205,39 +209,53 @@
          * TODO: Average the color in all the lanes for the given direction */
 
-        String laneDir = "OS";
-        if(direction.equals(this.direction))
+        String laneDir = "";
+        if (direction.equals(this.direction))
         {
             laneDir = "ML";
         }
+        else if (direction.equals(this.direction.getOpposite()))
+        {
+            laneDir = "OS";
+        }
         // Examine all the lanes in a given direction
-        for(LoopDetector loop : loops)
-        {
-            if(loop.loopLocation.startsWith(laneDir))
+        for (LoopDetector loop : loops)
+        {
+            if (loop.loopLocation.substring(0,2).equals(laneDir))
             {
                 // Return color according to loop volume
-                if (loop.vol == 1) return '@';
-                if (loop.vol == 3) return '+';
-            }
-        }
-        // Default case
-        return '-';
-                
-    }
-    
+                if (loop.vol == 1)
+                {
+                    return '@';
+                }
+                if (loop.vol == 3)
+                {
+                    return '+';
+                }
+                if (loop.vol == 0)
+                {
+                    return '-';
+                }
+            }
+        }
+        // Default case for when the route is not on this direction
+        return ' ';
+
+    }
+
     /**
      * Output for updateByDirection. Logs the update to the console.
-     * 
+     *
      * @param dotcolor
-     * @param OPP_ML 
+     * @param OPP_ML
      */
     private void outputUpdateMessage(DOTCOLOR dotcolor, String OPP_ML)
     {
         System.out.printf("Updating %-3.3s %-5.5s %-3.3s lanes\t %-12.12s "
-                + "at postmile %-6.6s to %-7.7s\n", 
-                Integer.toString(this.routeNumber), this.direction.name(), 
-                OPP_ML, this.location, Double.toString(this.postmile), 
+                + "at postmile %-6.6s to %-7.7s\n",
+                Integer.toString(this.routeNumber), this.direction.name(),
+                OPP_ML, this.location, Double.toString(this.postmile),
                 dotcolor.name());
     }
-    
+
     /**
      * XML tags used for toXML() method.
@@ -265,8 +283,8 @@
         }
     }
-    
+
     /**
      * Returns the Station data in XMLFormat.
-     * 
+     *
      * @param currElem The current XML <Station> element
      */
@@ -347,4 +365,20 @@
         {
             return this.toString().substring(0, 1);
+        }
+
+        public DIRECTION getOpposite()
+        {
+            switch (this)
+            {
+                case NORTH:
+                    return SOUTH;
+                case SOUTH:
+                    return NORTH;
+                case EAST:
+                    return WEST;
+                case WEST:
+                    return EAST;
+            }
+            return null;
         }
 
Index: trunk/src/atmsdriver/model/Highways.java
===================================================================
--- trunk/src/atmsdriver/model/Highways.java	(revision 195)
+++ trunk/src/atmsdriver/model/Highways.java	(revision 203)
@@ -480,19 +480,22 @@
         for (Highway hwy: highways)
         {
+            // Consider each route direction
             for (DIRECTION dir: DIRECTION.values())
             {
+                String rowLabel = ""+String.format("%3s ",hwy.routeNumber)+dir.getLetter()+' ';
                 StringBuilder lineout = new StringBuilder();
-                lineout.append(""+String.format("%3s ",hwy.routeNumber)+dir.getLetter()+' ');
+                // Examine every station on this highway and direction
                 for (Station stat: hwy.stations)
                 {
-                    if (stat.direction == dir)
-                    {
-                        //lineout.append("" + dir.getLetter() + stat.postmile);
-                        lineout.append(stat.getColorByDirection(stat.direction));
-                        //lineout.append("  ");
-                    }
+                    //lineout.append("" + dir.getLetter() + stat.postmile);
+                    lineout.append(stat.getColorByDirection(dir));
+                    //lineout.append("  ");
                 }
-                if (lineout.length() > 6)
+                // See if there were stations for this direction
+                String checkMe = lineout.toString().trim();
+                // if any stations were colored, output the line
+                if (checkMe.length() > 1)
                 {
+                    result.append(rowLabel);
                     result.append(lineout + "\n");
                 }
