Changeset 23988 in osm for applications/editors/josm/plugins/videomapping
- Timestamp:
- 2010-11-01T13:12:05+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/GpsPlayer.java
r23667 r23988 90 90 } 91 91 92 //select the k-th waypoint 93 public void goTo(int k) 94 { 95 if (k>0) 96 { 97 if ((ls.indexOf(curr)+k>0)&&(ls.indexOf(curr)<ls.size())) //check range 98 { 99 goTo(ls.get(k)); 100 } 101 Main.map.mapView.repaint(); 102 } 103 } 104 92 105 //walk k waypoints forward/backward 93 106 public void move(int k) … … 100 113 Main.map.mapView.repaint(); //seperate modell and view logic... 101 114 } 102 103 //select the k-th waypoint104 public void goTo(int k)105 {106 if (k>0)107 {108 if ((ls.indexOf(curr)+k>0)&&(ls.indexOf(curr)<ls.size())) //check range109 {110 goTo(ls.get(k));111 }112 Main.map.mapView.repaint();113 }114 }115 116 115 //go to the position at the timecode e.g.g "14:00:01"; 117 public void jump( Time GPSAbsTime)116 public void jump(Date GPSAbsTime) 118 117 { 119 118 Date zero=start.getTime(); 120 Time starttime = new Time(zero.getHours(),zero.getMinutes(),zero.getSeconds());119 Date starttime = new Date(zero.getHours(),zero.getMinutes(),zero.getSeconds()); 121 120 long diff=GPSAbsTime.getTime()-starttime.getTime(); 122 121 goTo(getWaypoint(diff)); //TODO replace Time by Date? 123 122 } 124 125 /* 126 //go to the position at 127 public void jump(Date GPSDate) 128 { 129 long s,m,h,diff; 130 //calculate which waypoint is at the offset 131 System.out.println(start.getTime()); 132 System.out.println(start.getTime().getHours()+":"+start.getTime().getMinutes()+":"+start.getTime().getSeconds()); 133 s=GPSDate.getSeconds()-start.getTime().getSeconds(); 134 m=GPSDate.getMinutes()-start.getTime().getMinutes(); 135 h=GPSDate.getHours()-start.getTime().getHours(); 136 diff=s*1000+m*60*1000+h*60*60*1000; //FIXME ugly hack but nothing else works right 137 goTo(getWaypoint(diff)); 138 } 139 */ 123 140 124 //gets only points on the line of the GPS track (between waypoints) nearby the point m 141 125 private Point getInterpolated(Point m) … … 340 324 //jumps to a specific time 341 325 public void jump(long relTime) { 342 int pos = Math.round(relTime/1000);//TODO ugly quick hack326 int pos = Math.round(relTime/1000);//TODO assumes the time is constant 343 327 goTo(pos); 344 328 if (autoCenter) Main.map.mapView.zoomTo(curr.getCoor()); … … 346 330 347 331 //toggles walking along the track 348 public void play()349 { /*332 /* public void play(){ 333 350 334 if (t==null) 351 335 { … … 370 354 t.cancel(); 371 355 t=null; 372 } */373 } 356 } 357 }*/ 374 358 375 359 public long getLength() { -
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java
r23667 r23988 50 50 gps= new GpsPlayer(ls); 51 51 icon = new ImageIcon("images/videomapping.png"); 52 gpsTimeCode= new SimpleDateFormat("hh:mm:ss"); 52 gpsTimeCode= new SimpleDateFormat("hh:mm:ss");//TODO replace with DF small 53 53 Main.map.mapView.addMouseListener(this); 54 54 Main.map.mapView.addMouseMotionListener(this);
Note:
See TracChangeset
for help on using the changeset viewer.