Changeset 114 in tmcsimulator for trunk/src/atmsdriver


Ignore:
Timestamp:
10/14/2017 10:11:04 AM (9 years ago)
Author:
jtorres
Message:

Updating FEPSimulator for JD's linux machine. Modified ATMS/Console Driver to show red dots.

Location:
trunk/src/atmsdriver
Files:
4 edited

Legend:

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

    r110 r114  
    150150        } 
    151151        System.out.println(""); 
     152        highways.writeToFEP(); 
    152153    } 
    153154     
  • trunk/src/atmsdriver/model/Highways.java

    r103 r114  
    211211    public void writeToFEP() { 
    212212        try { 
    213             Socket sock = new Socket(FEPHostName, FEPPortNum); 
     213            Socket sock = new Socket(FEPHostName /*"192.168.251.130"*/, 8080); 
    214214            PrintWriter out = new PrintWriter(sock.getOutputStream(), true); 
    215215            out.println(this.toXML()); 
  • trunk/src/atmsdriver/model/LoopDetector.java

    r103 r114  
    2222     
    2323    /* dynamic data */ 
    24     private int vol; 
    25     private int occ; 
     24    public int vol; 
     25    public int occ; 
    2626    private int spd; 
    2727     
     
    3434         
    3535        /* Init dynamic data */ 
    36         this.vol = 0; 
     36        this.vol = 100; 
    3737        this.spd = 0; 
    38         this.occ = 0; 
     38        this.occ = 100; 
    3939    } 
    4040     
  • trunk/src/atmsdriver/model/Station.java

    r109 r114  
    5050        this.routeNumber = hwy; 
    5151 
    52         this.MLTotVol = 0; 
    53         this.OppTotVol = 0; 
     52        this.MLTotVol = getMLTotVol(); 
     53        this.OppTotVol = getOPPTotVol(); 
     54    } 
     55     
     56    private int getMLTotVol() 
     57    { 
     58        int mlTotVol = 0; 
     59        for(LoopDetector loop : loops) 
     60        { 
     61            if(loop.loopLocation.startsWith("ML")) 
     62            { 
     63                mlTotVol += loop.vol; 
     64            } 
     65        } 
     66        return mlTotVol; 
     67    } 
     68     
     69    private int getOPPTotVol() 
     70    { 
     71        int oppTotVol = 0; 
     72        for(LoopDetector loop : loops) 
     73        { 
     74            if(loop.loopLocation.startsWith("OP")) 
     75            { 
     76                oppTotVol += loop.vol; 
     77            } 
     78        } 
     79        return oppTotVol; 
    5480    } 
    5581 
     
    143169                // vol and occ along with each color.  Then the updateLoop call 
    144170                // below could be update(dotColor.volume, dotColor.occ, speed) 
    145                 int volume = 0; 
    146                 int occ = 0; 
     171                int volume = 10; 
     172                int occ = 10; 
    147173                int speed = 0; 
    148174                loop.updateLoop(volume, occ, speed); 
Note: See TracChangeset for help on using the changeset viewer.