Ignore:
Timestamp:
02/21/2019 02:34:48 PM (7 years ago)
Author:
jdalbey
Message:

PostmileCoords?.java: Add new fields for perpendicular vector (x and y components). This enables adjusting the dot position along line perpendicular to the highway when the map is zoomed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/atmsdriver/model/PostmileCoordsTest.java

    r266 r269  
    5454        pmc.load(scan); 
    5555        PostmileCoords.Postmile pm = new PostmileCoords.Postmile("5 N 4.02", "33.33",  
    56                 "-117.117","Dyer Rd"); 
     56                "-117.117","Dyer Rd","0","0"); 
     57        assertEquals(pm,pmc.get(0)); 
     58        assert(pmc.size() == 2); 
     59    } 
     60    public void testLoadNoPerps() throws FileNotFoundException 
     61    { 
     62 
     63        System.out.println("load"); 
     64        String line1 = "5 N 4.02, 33.33, -117.117,Dyer Rd,\n5 S 3.56, 33.33, -117.117,Dyer Rd,"; 
     65        Scanner scan = new Scanner(line1).useDelimiter("\\A");  
     66        pmc = new PostmileCoords(); 
     67        pmc.load(scan); 
     68        PostmileCoords.Postmile pm = new PostmileCoords.Postmile("5 N 4.02", "33.33",  
     69                "-117.117","Dyer Rd","0","0"); 
     70        assertEquals(pm,pmc.get(0)); 
     71        assert(pmc.size() == 2); 
     72    } 
     73    public void testLoadPerps() throws FileNotFoundException 
     74    { 
     75 
     76        System.out.println("load"); 
     77        String line1 = "5 N 4.02, 33.33, -117.117,Dyer Rd,.1,.1\n5 S 3.56, 33.33, -117.117,Dyer Rd,.2,.2"; 
     78        Scanner scan = new Scanner(line1).useDelimiter("\\A");  
     79        pmc = new PostmileCoords(); 
     80        pmc.load(scan); 
     81        PostmileCoords.Postmile pm = new PostmileCoords.Postmile("5 N 4.02", "33.33",  
     82                "-117.117","Dyer Rd",".1",".1"); 
    5783        assertEquals(pm,pmc.get(0)); 
    5884        assert(pmc.size() == 2); 
     
    75101        PostmileCoords.Postmile result = pmc.find("5 N 4.02"); 
    76102        assertNotNull(result); 
    77         PostmileCoords.Postmile pm = new PostmileCoords.Postmile("5 N 4.02", "33.33", "-117.117","Dyer Rd"); 
     103        PostmileCoords.Postmile pm = new PostmileCoords.Postmile("5 N 4.02", "33.33", "-117.117","Dyer Rd", "0.547592", "0.836745"); 
    78104        assertEquals(pm,result); 
    79105        PostmileCoords.Postmile result2 = pmc.find("X"); 
Note: See TracChangeset for help on using the changeset viewer.