[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/eyes/tools/java/de/tub/eyes/gis Jdbc.java, 1.1, 1.2

Till Wimmer twimmer at users.sourceforge.net
Thu May 18 10:06:43 PDT 2006


Update of /cvsroot/tinyos/tinyos-1.x/contrib/eyes/tools/java/de/tub/eyes/gis
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21325

Modified Files:
	Jdbc.java 
Log Message:
adapted to GIS change (TreeMap); swapped xy for map type 1

Index: Jdbc.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/eyes/tools/java/de/tub/eyes/gis/Jdbc.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Jdbc.java	4 Apr 2006 21:46:25 -0000	1.1
--- Jdbc.java	18 May 2006 17:06:41 -0000	1.2
***************
*** 121,149 ****
              try {
                  while (rs.next()) {
!                     MapXY node = new MapXY();
!                     node.map = map;
                      
                      Integer ID = new Integer(rs.getInt("node_id"));
                      switch (type[map]) {
                          
                          case 0:
!                             node.x = (int)(rs.getFloat("location_x")*scale[map]);
!                             node.y = (int)(rs.getFloat("location_y")*scale[map]);                            
!                             System.out.println("x="+node.x+" y="+node.y+" map="+map+" ID="+ID);
                              break;
                          case 1:
!                             node.x = (int)(rs.getFloat("location_y")*scale[map]);
!                             node.y = (int)(rs.getFloat("location_z")*scale[map]);                            
!                             System.out.println("y="+node.x+" z="+node.y+" map="+map+" ID="+ID);
                              break;
                          case 2:
!                             node.x = (int)(rs.getFloat("location_z")*scale[map]);
!                             node.y = (int)(rs.getFloat("location_x")*scale[map]);                            
!                             System.out.println("z="+node.x+" x="+node.y+" map="+map+" ID="+ID);
                              break;
                          default:
                              continue;
                      }
!                     //nodes.setSize(ID);
                      nodes.put(ID, node);
                  }
--- 121,151 ----
              try {
                  while (rs.next()) {
!                     MapXY node;
!                     int x,y;
                      
                      Integer ID = new Integer(rs.getInt("node_id"));
+                     if ((node = (MapXY)nodes.get(ID)) == null)
+                         node = new MapXY();
+                                         
                      switch (type[map]) {
                          
                          case 0:
!                             x = (int)(rs.getFloat("location_x")*scale[map]);
!                             y = (int)(rs.getFloat("location_y")*scale[map]);                            
                              break;
                          case 1:
!                             x = (int)(rs.getFloat("location_y")*scale[map]);
!                             y = (int)(rs.getFloat("location_z")*scale[map]);                            
                              break;
                          case 2:
!                             x = (int)(rs.getFloat("location_x")*scale[map]);
!                             y = (int)(rs.getFloat("location_z")*scale[map]);                            
                              break;
                          default:
                              continue;
                      }
!                             
!                     //System.out.println("x="+x+" y="+y+" map="+map+" ID="+ID);                    
!                     node.set(map,x,y);
                      nodes.put(ID, node);
                  }



More information about the Tinyos-contrib-commits mailing list