[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips ABCDMeasurement.java, 1.1, 1.2 ABCDTableModel.java, 1.1, 1.2 Constants.java, 1.1, 1.2 GALocDisplay.java, 1.1, 1.2 GALocDisplay2.java, 1.1, 1.2 LocalizationData.java, 1.2, 1.3 LocalizationSolution.java, 1.1, 1.2 LocalizationSolutionCallback.java, 1.1, 1.2 LocalizationThread.java, 1.1, 1.2 MeasurementEndedCallback.java, 1.1, 1.2 MeasurementThread.java, 1.1, 1.2 MoteParams.java, 1.2, 1.3 MoteQueryLogic.java, 1.1, 1.2 MotesTableModel.java, 1.1, 1.2 Point.java, 1.1, 1.2 RipsDataTableModel.java, 1.1, 1.2 RipsDisplay.java, 1.2, 1.3 Utils.java, 1.1, 1.2

Brano Kusy kusyb at users.sourceforge.net
Mon Sep 11 22:20:45 PDT 2006


Update of /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv1922

Modified Files:
	ABCDMeasurement.java ABCDTableModel.java Constants.java 
	GALocDisplay.java GALocDisplay2.java LocalizationData.java 
	LocalizationSolution.java LocalizationSolutionCallback.java 
	LocalizationThread.java MeasurementEndedCallback.java 
	MeasurementThread.java MoteParams.java MoteQueryLogic.java 
	MotesTableModel.java Point.java RipsDataTableModel.java 
	RipsDisplay.java Utils.java 
Log Message:
adding copyright, changing some stuff to support replay of our large scale demo.

Index: ABCDMeasurement.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/ABCDMeasurement.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ABCDMeasurement.java	25 Feb 2006 02:04:27 -0000	1.1
--- ABCDMeasurement.java	12 Sep 2006 05:20:39 -0000	1.2
***************
*** 1,3 ****
! package isis.nest.localization.rips;
  
  //import java.io.BufferedReader;
--- 1,26 ----
! /*
!  * Copyright (c) 2005, Vanderbilt University
!  * All rights reserved.
!  *
!  * Permission to use, copy, modify, and distribute this software and its
!  * documentation for instruction and non-commercial research only, without
!  * fee, and without written agreement is hereby granted, provided that the
!  * this copyright notice including the following two paragraphs and the 
!  * author's name appear in all copies of this software.
!  * 
!  * IN NO EVENT SHALL VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
!  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
!  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF VANDERBILT
!  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!  * 
!  * VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
!  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
!  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
!  * ON AN "AS IS" BASIS, AND VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
!  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
!  */
!  // @author Brano Kusy: kusy at isis.vanderbilt.edu
!  
!  package isis.nest.localization.rips;
  
  //import java.io.BufferedReader;

Index: ABCDTableModel.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/ABCDTableModel.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ABCDTableModel.java	25 Feb 2006 02:04:27 -0000	1.1
--- ABCDTableModel.java	12 Sep 2006 05:20:39 -0000	1.2
***************
*** 1,6 ****
  /*
!  * Created on Jul 9, 2005
   *
   */
  package isis.nest.localization.rips;
  
--- 1,25 ----
  /*
!  * Copyright (c) 2005, Vanderbilt University
!  * All rights reserved.
   *
+  * Permission to use, copy, modify, and distribute this software and its
+  * documentation for instruction and non-commercial research only, without
+  * fee, and without written agreement is hereby granted, provided that the
+  * this copyright notice including the following two paragraphs and the 
+  * author's name appear in all copies of this software.
+  * 
+  * IN NO EVENT SHALL VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
+  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF VANDERBILT
+  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  * 
+  * VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+  * ON AN "AS IS" BASIS, AND VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
+  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   */
+  // @author Brano Kusy: kusy at isis.vanderbilt.edu
+  
  package isis.nest.localization.rips;
  
***************
*** 94,97 ****
--- 113,124 ----
  	}
  	
+ 	void writeAll(){
+         Iterator it = localizationData.abcd_measurements.iterator();
+         setRowCount(localizationData.abcd_measurements.size());
+         int i = 0;
+         while (it.hasNext())
+             writeRow((ABCDMeasurement)it.next(),i++);
+ 	}
+ 
  	void recalculateAll(){
  		resetTable();
***************
*** 100,108 ****
  		if (filterOutBad)
  			localizationData.cheatFilter();
!         Iterator it = localizationData.abcd_measurements.iterator();
!         setRowCount(localizationData.abcd_measurements.size());
!         int i = 0;
!         while (it.hasNext())
!             writeRow((ABCDMeasurement)it.next(),i++);
  //		fireTableDataChanged();
  	}
--- 127,131 ----
  		if (filterOutBad)
  			localizationData.cheatFilter();
! 		writeAll();
  //		fireTableDataChanged();
  	}

Index: Constants.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/Constants.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Constants.java	25 Feb 2006 02:04:27 -0000	1.1
--- Constants.java	12 Sep 2006 05:20:39 -0000	1.2
***************
*** 1,8 ****
  /*
!  * Created on Jul 3, 2005
   *
!  * To change the template for this generated file go to
!  * Window>Preferences>Java>Code Generation>Code and Comments
   */
  package isis.nest.localization.rips;
  
--- 1,25 ----
  /*
!  * Copyright (c) 2005, Vanderbilt University
!  * All rights reserved.
   *
!  * Permission to use, copy, modify, and distribute this software and its
!  * documentation for instruction and non-commercial research only, without
!  * fee, and without written agreement is hereby granted, provided that the
!  * this copyright notice including the following two paragraphs and the 
!  * author's name appear in all copies of this software.
!  * 
!  * IN NO EVENT SHALL VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
!  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
!  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF VANDERBILT
!  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!  * 
!  * VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
!  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
!  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
!  * ON AN "AS IS" BASIS, AND VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
!  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   */
+  // @author Brano Kusy: kusy at isis.vanderbilt.edu
+  
  package isis.nest.localization.rips;
  
***************
*** 21,23 ****
--- 38,41 ----
      
      public static final int    POPULATION_SIZE = 100;
+     public static final int	   MAX_LOC_STEPS = 250;
  }

Index: GALocDisplay.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/GALocDisplay.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** GALocDisplay.java	25 Feb 2006 02:04:27 -0000	1.1
--- GALocDisplay.java	12 Sep 2006 05:20:39 -0000	1.2
***************
*** 1,2 ****
--- 1,25 ----
+ /*
+  * Copyright (c) 2005, Vanderbilt University
+  * All rights reserved.
+  *
+  * Permission to use, copy, modify, and distribute this software and its
+  * documentation for instruction and non-commercial research only, without
+  * fee, and without written agreement is hereby granted, provided that the
+  * this copyright notice including the following two paragraphs and the 
+  * author's name appear in all copies of this software.
+  * 
+  * IN NO EVENT SHALL VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
+  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF VANDERBILT
+  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  * 
+  * VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+  * ON AN "AS IS" BASIS, AND VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
+  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+  */
+  // @author Brano Kusy: kusy at isis.vanderbilt.edu
+  
  package isis.nest.localization.rips;
  

Index: GALocDisplay2.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/GALocDisplay2.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** GALocDisplay2.java	25 Feb 2006 02:04:27 -0000	1.1
--- GALocDisplay2.java	12 Sep 2006 05:20:39 -0000	1.2
***************
*** 1,2 ****
--- 1,25 ----
+ /*
+  * Copyright (c) 2005, Vanderbilt University
+  * All rights reserved.
+  *
+  * Permission to use, copy, modify, and distribute this software and its
+  * documentation for instruction and non-commercial research only, without
+  * fee, and without written agreement is hereby granted, provided that the
+  * this copyright notice including the following two paragraphs and the 
+  * author's name appear in all copies of this software.
+  * 
+  * IN NO EVENT SHALL VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
+  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF VANDERBILT
+  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  * 
+  * VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+  * ON AN "AS IS" BASIS, AND VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
+  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+  */
+  // @author Brano Kusy: kusy at isis.vanderbilt.edu
+  
  package isis.nest.localization.rips;
  
***************
*** 131,135 ****
      }            
      
!     public void localizationSolution(LocalizationSolution solution)
      {        
          this.solution = solution;                
--- 154,158 ----
      }            
      
!     public void localizationSolution(int steps, LocalizationSolution solution)
      {        
          this.solution = solution;                
***************
*** 137,146 ****
          canvas.repaint();
                          
!         double weightStat[] = solution.calcWeightStat(0.5);
!                 
!         String s = formatter.format(-solution.fitness) + "\t" +  
                     formatter.format(solution.locError()) + "\t" +
!                    formatter.format(weightStat[0]) + "\t" +
!                    formatter.format(weightStat[1]) + "\n";
                     
          addLog(s);     
--- 160,166 ----
          canvas.repaint();
                          
!         String s = steps + "\t" +  
                     formatter.format(solution.locError()) + "\t" +
!                    formatter.format(solution.maxLocError())+"\n";
                     
          addLog(s);     
***************
*** 148,152 ****
      
      public void localizationFinished()
!     {               
      }
         
--- 168,174 ----
      
      public void localizationFinished()
!     {
!         if( solution != null )
!             solution.printSensorCoordinates(); 
      }
         
***************
*** 189,193 ****
          if( locThread != null )
              locThread.stopLoc();
!         locThread = null;    
      }
      
--- 211,215 ----
          if( locThread != null )
              locThread.stopLoc();
!         locThread = null;
      }
      
***************
*** 258,262 ****
                                  
          logPanel.setLayout(new java.awt.GridBagLayout());
!         logPanel.setBorder(new javax.swing.border.TitledBorder("Log (fitness,loc error,avg good weight,avg bad weight)"));
          gridBagConstraints = new java.awt.GridBagConstraints();
          gridBagConstraints.gridx = 1;
--- 280,284 ----
                                  
          logPanel.setLayout(new java.awt.GridBagLayout());
!         logPanel.setBorder(new javax.swing.border.TitledBorder("Log (steps, avg error, max error)"));
          gridBagConstraints = new java.awt.GridBagConstraints();
          gridBagConstraints.gridx = 1;

Index: LocalizationData.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/LocalizationData.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** LocalizationData.java	13 Mar 2006 20:34:40 -0000	1.2
--- LocalizationData.java	12 Sep 2006 05:20:39 -0000	1.3
***************
*** 1,6 ****
  /*
!  * Created on Jun 27, 2005
   *
   */
  package isis.nest.localization.rips;
  
--- 1,25 ----
  /*
!  * Copyright (c) 2005, Vanderbilt University
!  * All rights reserved.
   *
+  * Permission to use, copy, modify, and distribute this software and its
+  * documentation for instruction and non-commercial research only, without
+  * fee, and without written agreement is hereby granted, provided that the
+  * this copyright notice including the following two paragraphs and the 
+  * author's name appear in all copies of this software.
+  * 
+  * IN NO EVENT SHALL VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
+  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF VANDERBILT
+  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  * 
+  * VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+  * ON AN "AS IS" BASIS, AND VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
+  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   */
+  // @author Brano Kusy: kusy at isis.vanderbilt.edu
+  
  package isis.nest.localization.rips;
  
***************
*** 210,213 ****
--- 229,270 ----
      }
  
+     public void processRangeLine(String line)
+     {
+         StringTokenizer t = new StringTokenizer(line);
+         
+         int A = Integer.parseInt(t.nextToken());
+         int B = Integer.parseInt(t.nextToken());
+         int C = Integer.parseInt(t.nextToken());
+         int D = Integer.parseInt(t.nextToken());
+         
+         int offsets = Integer.parseInt(t.nextToken());
+         
+         double calcDist = Double.parseDouble(t.nextToken());
+         double distDev = Double.parseDouble(t.nextToken());
+         double realDist = Double.parseDouble(t.nextToken());
+         double error = Double.parseDouble(t.nextToken());
+         
+ 
+         ABCDMeasurement abcd = new ABCDMeasurement();
+         abcd.sensor_A = A;
+         abcd.sensor_B = B;
+         abcd.sensor_C = C;
+         abcd.sensor_D = D;
+         
+         abcd.goodOffsetMeasurements = offsets;
+         
+         abcd.calc_dist = calcDist;
+         abcd.dist_dev = distDev;
+         abcd.real_dist = realDist;
+         abcd.error = error;
+ 
+         abcd.sensor_A_ind = getSensorInd(abcd.sensor_A);
+         abcd.sensor_B_ind = getSensorInd(abcd.sensor_B);
+         abcd.sensor_C_ind = getSensorInd(abcd.sensor_C);
+         abcd.sensor_D_ind = getSensorInd(abcd.sensor_D);
+         
+         abcd_measurements.add(abcd);
+     }
+     
      private void processLine(String line, boolean freq)
      {
***************
*** 267,270 ****
--- 324,340 ----
      }
  
+     private void readRanges(String fileName) throws Exception
+     {
+         BufferedReader r = new BufferedReader(new FileReader(fileName));
+         String line = r.readLine();
+         while(line != null)
+         {
+             line = line.trim();
+             if(line.length() > 0 && line.charAt(0) != '#')
+                 processRangeLine(line);
+             line = r.readLine();
+         }
+     }
+ 
      private void readFreqOrPhase(String fileName, boolean freq) throws Exception
      {
***************
*** 298,301 ****
--- 368,378 ----
      }
  
+     private String getRangeFileName(String fileNameBase)
+     {
+         String ret = new String(fileNameBase);
+         ret = ret.concat(".ranges");
+         return ret;
+     }
+ 
      private String getFreqFileName(String fileNameBase)
      {
***************
*** 318,321 ****
--- 395,422 ----
          return ret;
      }
+     public void readRangeFile(String fileNameBase) throws Exception{
+         // read settings
+         readSettings(getSettingsFileName(fileNameBase));
+ 
+         // read sensors
+         try
+         {
+             readSensors(getPosFileName(fileNameBase));
+         }
+         catch(Exception e)
+         {
+             System.out.println("reading position file failed");
+         }
+         try
+         {
+             // read ranges
+             readRanges(getRangeFileName(fileNameBase));
+         }
+         catch(Exception e)
+         {
+             System.out.println("reading ranges file failed");
+         }
+     }
+     
  
      public void read(String fileNameBase) throws Exception

Index: LocalizationSolution.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/LocalizationSolution.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** LocalizationSolution.java	25 Feb 2006 02:04:27 -0000	1.1
--- LocalizationSolution.java	12 Sep 2006 05:20:39 -0000	1.2
***************
*** 1,2 ****
--- 1,25 ----
+ /*
+  * Copyright (c) 2005, Vanderbilt University
+  * All rights reserved.
+  *
+  * Permission to use, copy, modify, and distribute this software and its
+  * documentation for instruction and non-commercial research only, without
+  * fee, and without written agreement is hereby granted, provided that the
+  * this copyright notice including the following two paragraphs and the 
+  * author's name appear in all copies of this software.
+  * 
+  * IN NO EVENT SHALL VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
+  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF VANDERBILT
+  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  * 
+  * VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+  * ON AN "AS IS" BASIS, AND VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
+  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+  */
+  // @author Brano Kusy: kusy at isis.vanderbilt.edu
+  
  package isis.nest.localization.rips;
  
***************
*** 40,43 ****
--- 63,67 ----
      {
      	Object[] sensorsArray = problem.sensors.values().toArray(); 
+     	System.out.println("Calculated locations (nodeID, x, y, z):");
          for( int i=0; i<sensors.length; ++i )
              System.out.println( ((LocalizationData.Sensor)sensorsArray[i]).getId() + "\t" + sensors[i].x + "\t " + sensors[i].y + "\t" + sensors[i].z );       
***************
*** 271,274 ****
--- 295,314 ----
      }
  
+     public double maxLocError()
+     {
+         double max_error = - Double.MAX_VALUE;
+         for( int i=0; i<sensors.length; ++i )
+         {
+            	LocalizationData.Sensor sensor = (LocalizationData.Sensor)problem.sensors.values().toArray()[i];
+             if( !sensor.anchor )
+             {
+                 if (max_error < Math.abs(sensor.pos.distance(sensors[i])))
+                     max_error = Math.abs(sensor.pos.distance(sensors[i]));
+             }
+         }
+         return max_error;
+         
+     }
+ 
      public double locError()
      {

Index: LocalizationSolutionCallback.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/LocalizationSolutionCallback.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** LocalizationSolutionCallback.java	25 Feb 2006 02:04:27 -0000	1.1
--- LocalizationSolutionCallback.java	12 Sep 2006 05:20:40 -0000	1.2
***************
*** 1,6 ****
  /*
!  * Created on Jul 11, 2005
   *
   */
  package isis.nest.localization.rips;
  
--- 1,25 ----
  /*
!  * Copyright (c) 2005, Vanderbilt University
!  * All rights reserved.
   *
+  * Permission to use, copy, modify, and distribute this software and its
+  * documentation for instruction and non-commercial research only, without
+  * fee, and without written agreement is hereby granted, provided that the
+  * this copyright notice including the following two paragraphs and the 
+  * author's name appear in all copies of this software.
+  * 
+  * IN NO EVENT SHALL VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
+  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF VANDERBILT
+  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  * 
+  * VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+  * ON AN "AS IS" BASIS, AND VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
+  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   */
+  // @author Brano Kusy: kusy at isis.vanderbilt.edu
+  
  package isis.nest.localization.rips;
  
***************
*** 10,14 ****
   */
  public interface LocalizationSolutionCallback {
!    public void localizationSolution(LocalizationSolution localizationSolution);
     public void localizationFinished();
  }
--- 29,33 ----
   */
  public interface LocalizationSolutionCallback {
!    public void localizationSolution(int steps, LocalizationSolution localizationSolution);
     public void localizationFinished();
  }

Index: LocalizationThread.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/LocalizationThread.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** LocalizationThread.java	25 Feb 2006 02:04:27 -0000	1.1
--- LocalizationThread.java	12 Sep 2006 05:20:40 -0000	1.2
***************
*** 1,6 ****
  /*
!  * Created on Jul 11, 2005
   *
   */
  package isis.nest.localization.rips;
  
--- 1,25 ----
  /*
!  * Copyright (c) 2005, Vanderbilt University
!  * All rights reserved.
   *
+  * Permission to use, copy, modify, and distribute this software and its
+  * documentation for instruction and non-commercial research only, without
+  * fee, and without written agreement is hereby granted, provided that the
+  * this copyright notice including the following two paragraphs and the 
+  * author's name appear in all copies of this software.
+  * 
+  * IN NO EVENT SHALL VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
+  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF VANDERBILT
+  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  * 
+  * VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+  * ON AN "AS IS" BASIS, AND VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
+  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   */
+  // @author Brano Kusy: kusy at isis.vanderbilt.edu
+  
  package isis.nest.localization.rips;
  
***************
*** 57,66 ****
      public void run()
      {
!         while( state == LT_STATE_RUNING )
          {
!             optimizer.run(1000, 0);
              LocalizationSolution best = (LocalizationSolution)optimizer.getBestSolution();
              if( callback != null )            
!                 callback.localizationSolution(best);         
              try 
              {
--- 76,87 ----
      public void run()
      {
!         int steps = 0;
!         while( state == LT_STATE_RUNING && steps < Constants.MAX_LOC_STEPS)
          {
!             steps++;
!             optimizer.run(200, 0);
              LocalizationSolution best = (LocalizationSolution)optimizer.getBestSolution();
              if( callback != null )            
!                 callback.localizationSolution(steps, best);         
              try 
              {
***************
*** 73,76 ****
--- 94,99 ----
              }          
          }           
+         if( callback != null )
+             callback.localizationFinished();
          synchronized(this)
          {

Index: MeasurementEndedCallback.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/MeasurementEndedCallback.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MeasurementEndedCallback.java	25 Feb 2006 02:04:27 -0000	1.1
--- MeasurementEndedCallback.java	12 Sep 2006 05:20:40 -0000	1.2
***************
*** 1,6 ****
  /*
!  * Created on Jul 8, 2005
   *
   */
  package isis.nest.localization.rips;
  
--- 1,25 ----
  /*
!  * Copyright (c) 2005, Vanderbilt University
!  * All rights reserved.
   *
+  * Permission to use, copy, modify, and distribute this software and its
+  * documentation for instruction and non-commercial research only, without
+  * fee, and without written agreement is hereby granted, provided that the
+  * this copyright notice including the following two paragraphs and the 
+  * author's name appear in all copies of this software.
+  * 
+  * IN NO EVENT SHALL VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
+  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF VANDERBILT
+  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  * 
+  * VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+  * ON AN "AS IS" BASIS, AND VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
+  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   */
+  // @author Brano Kusy: kusy at isis.vanderbilt.edu
+  
  package isis.nest.localization.rips;
  

Index: MeasurementThread.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/MeasurementThread.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MeasurementThread.java	25 Feb 2006 02:04:27 -0000	1.1
--- MeasurementThread.java	12 Sep 2006 05:20:40 -0000	1.2
***************
*** 1,6 ****
  /*
!  * Created on Jul 7, 2005
   *
   */
  package isis.nest.localization.rips;
  
--- 1,25 ----
  /*
!  * Copyright (c) 2005, Vanderbilt University
!  * All rights reserved.
   *
+  * Permission to use, copy, modify, and distribute this software and its
+  * documentation for instruction and non-commercial research only, without
+  * fee, and without written agreement is hereby granted, provided that the
+  * this copyright notice including the following two paragraphs and the 
+  * author's name appear in all copies of this software.
+  * 
+  * IN NO EVENT SHALL VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
+  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF VANDERBILT
+  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  * 
+  * VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+  * ON AN "AS IS" BASIS, AND VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
+  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   */
+  // @author Brano Kusy: kusy at isis.vanderbilt.edu
+  
  package isis.nest.localization.rips;
  

Index: MoteParams.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/MoteParams.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MoteParams.java	15 Mar 2006 17:35:53 -0000	1.2
--- MoteParams.java	12 Sep 2006 05:20:40 -0000	1.3
***************
*** 1,5 ****
  /*
!  * Created on Jul 8, 2005
   */
  package isis.nest.localization.rips;
  
--- 1,25 ----
  /*
!  * Copyright (c) 2005, Vanderbilt University
!  * All rights reserved.
!  *
!  * Permission to use, copy, modify, and distribute this software and its
!  * documentation for instruction and non-commercial research only, without
!  * fee, and without written agreement is hereby granted, provided that the
!  * this copyright notice including the following two paragraphs and the 
!  * author's name appear in all copies of this software.
!  * 
!  * IN NO EVENT SHALL VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
!  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
!  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF VANDERBILT
!  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!  * 
!  * VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
!  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
!  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
!  * ON AN "AS IS" BASIS, AND VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
!  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   */
+  // @author Brano Kusy: kusy at isis.vanderbilt.edu
+  
  package isis.nest.localization.rips;
  

Index: MoteQueryLogic.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/MoteQueryLogic.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MoteQueryLogic.java	25 Feb 2006 02:04:27 -0000	1.1
--- MoteQueryLogic.java	12 Sep 2006 05:20:40 -0000	1.2
***************
*** 1,6 ****
  /*
!  * Created on Jul 8, 2005
   *
   */
  package isis.nest.localization.rips;
  
--- 1,25 ----
  /*
!  * Copyright (c) 2005, Vanderbilt University
!  * All rights reserved.
   *
+  * Permission to use, copy, modify, and distribute this software and its
+  * documentation for instruction and non-commercial research only, without
+  * fee, and without written agreement is hereby granted, provided that the
+  * this copyright notice including the following two paragraphs and the 
+  * author's name appear in all copies of this software.
+  * 
+  * IN NO EVENT SHALL VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
+  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF VANDERBILT
+  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  * 
+  * VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+  * ON AN "AS IS" BASIS, AND VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
+  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   */
+  // @author Brano Kusy: kusy at isis.vanderbilt.edu
+  
  package isis.nest.localization.rips;
  

Index: MotesTableModel.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/MotesTableModel.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MotesTableModel.java	25 Feb 2006 02:04:27 -0000	1.1
--- MotesTableModel.java	12 Sep 2006 05:20:40 -0000	1.2
***************
*** 3,26 ****
   * All rights reserved.
   *
!  * Permission to use, copy,	modify,	and	distribute this	software and its
!  * documentation for any purpose, without fee, and without written agreement is
!  * hereby granted, provided	that the above copyright notice, the following
!  * two paragraphs and the author appear	in all copies of this software.
   * 
!  * IN NO EVENT SHALL THE VANDERBILT	UNIVERSITY BE LIABLE TO	ANY	PARTY FOR
   * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
!  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE VANDERBILT
   * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   * 
!  * THE VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS	ANY	WARRANTIES,
!  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF	MERCHANTABILITY
!  * AND FITNESS FOR A PARTICULAR	PURPOSE.  THE SOFTWARE PROVIDED	HEREUNDER IS
!  * ON AN "AS IS" BASIS,	AND	THE	VANDERBILT UNIVERSITY HAS NO OBLIGATION	TO
!  * PROVIDE MAINTENANCE,	SUPPORT, UPDATES, ENHANCEMENTS,	OR MODIFICATIONS.
!  *
!  * @author Andras Nadas, nadand at isis.vanderbilt.edu
!  * @modified 04/11/05
   */
! 
  package isis.nest.localization.rips;
  
--- 3,25 ----
   * All rights reserved.
   *
!  * Permission to use, copy, modify, and distribute this software and its
!  * documentation for instruction and non-commercial research only, without
!  * fee, and without written agreement is hereby granted, provided that the
!  * this copyright notice including the following two paragraphs and the 
!  * author's name appear in all copies of this software.
   * 
!  * IN NO EVENT SHALL VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
   * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
!  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF VANDERBILT
   * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   * 
!  * VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
!  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
!  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
!  * ON AN "AS IS" BASIS, AND VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
!  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   */
!  // @author Brano Kusy: kusy at isis.vanderbilt.edu
!  
  package isis.nest.localization.rips;
  

Index: Point.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/Point.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Point.java	25 Feb 2006 02:04:27 -0000	1.1
--- Point.java	12 Sep 2006 05:20:40 -0000	1.2
***************
*** 1,2 ****
--- 1,25 ----
+ /*
+  * Copyright (c) 2005, Vanderbilt University
+  * All rights reserved.
+  *
+  * Permission to use, copy, modify, and distribute this software and its
+  * documentation for instruction and non-commercial research only, without
+  * fee, and without written agreement is hereby granted, provided that the
+  * this copyright notice including the following two paragraphs and the 
+  * author's name appear in all copies of this software.
+  * 
+  * IN NO EVENT SHALL VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
+  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF VANDERBILT
+  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  * 
+  * VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+  * ON AN "AS IS" BASIS, AND VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
+  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+  */
+  // @author Brano Kusy: kusy at isis.vanderbilt.edu
+  
  package isis.nest.localization.rips;
  

Index: RipsDataTableModel.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/RipsDataTableModel.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RipsDataTableModel.java	25 Feb 2006 02:04:27 -0000	1.1
--- RipsDataTableModel.java	12 Sep 2006 05:20:40 -0000	1.2
***************
*** 30,34 ****
  class RipsDataTableModel extends DefaultTableModel
  {
!     static final int NUM_CHANNELS = 20;
      static final int PACKET_LENGTH = 24;
  	static final int PACKET_DATA = 5;
--- 30,34 ----
  class RipsDataTableModel extends DefaultTableModel
  {
!     static final int NUM_CHANNELS = 55;
      static final int PACKET_LENGTH = 24;
  	static final int PACKET_DATA = 5;
***************
*** 290,298 ****
  	}
  	
! 	void readFromFile(String fileBaseName) throws Exception {
  		resetTable();
  		resetEntries();
  		try{
! 			localizationData.read(fileBaseName);
  		}
  		catch(Exception e){
--- 290,301 ----
  	}
  	
! 	void readFromFile(String fileBaseName, boolean readRanges) throws Exception {
  		resetTable();
  		resetEntries();
  		try{
! 			if (!readRanges)
! 				localizationData.read(fileBaseName);
! 			else
! 				localizationData.readRangeFile(fileBaseName);
  		}
  		catch(Exception e){

Index: RipsDisplay.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/RipsDisplay.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** RipsDisplay.java	15 Mar 2006 17:35:53 -0000	1.2
--- RipsDisplay.java	12 Sep 2006 05:20:40 -0000	1.3
***************
*** 161,165 ****
      	measurementThread.setMeasurementSleepTime(prefs.getInt("measurementSleepTime",measurementThread.getMeasurementSleepTime()));
      	for (int i=0; i<RipsDataTableModel.NUM_CHANNELS; i++)
!     		localizationData.channels[i] = prefs.getInt("ch"+i,localizationData.channels[i]);
  
      	moteParams = MoteParams.getInstance();
--- 161,166 ----
      	measurementThread.setMeasurementSleepTime(prefs.getInt("measurementSleepTime",measurementThread.getMeasurementSleepTime()));
      	for (int i=0; i<RipsDataTableModel.NUM_CHANNELS; i++)
!     		if (i<localizationData.channels.length)
!     			localizationData.channels[i] = prefs.getInt("ch"+i,localizationData.channels[i]);
  
      	moteParams = MoteParams.getInstance();
***************
*** 235,238 ****
--- 236,240 ----
          tabbedPanel.setLayout(new java.awt.BorderLayout());
          tabbedPanel.setMinimumSize(new java.awt.Dimension(500, 260));
+         tabbedPanel.setPreferredSize(new java.awt.Dimension(800, 500));
  
  //RIPS DATA PANEL
***************
*** 722,726 ****
          	gridBagConstraints = new java.awt.GridBagConstraints();
          	gridBagConstraints.weighty = 0; 
!         	gridBagConstraints.weightx = 0;
          	gridBagConstraints.insets = new java.awt.Insets(3,3,3,3);
          	if (i==RipsDataTableModel.NUM_CHANNELS-1)
--- 724,728 ----
          	gridBagConstraints = new java.awt.GridBagConstraints();
          	gridBagConstraints.weighty = 0; 
!         	gridBagConstraints.weightx = 1.0;
          	gridBagConstraints.insets = new java.awt.Insets(3,3,3,3);
          	if (i==RipsDataTableModel.NUM_CHANNELS-1)
***************
*** 733,740 ****
          	chTextFields[i].setPreferredSize(new java.awt.Dimension(25,20));
          	chTextFields[i].addActionListener(new ChannelListener(i));
!         	chTextFields[i].setText(""+localizationData.channels[i]);
          	gridBagConstraints = new java.awt.GridBagConstraints();
          	gridBagConstraints.weighty = 0; 
!         	gridBagConstraints.weightx = 0;
          	gridBagConstraints.insets = new java.awt.Insets(3,2,3,2);
          	if (i==RipsDataTableModel.NUM_CHANNELS-1){
--- 735,745 ----
          	chTextFields[i].setPreferredSize(new java.awt.Dimension(25,20));
          	chTextFields[i].addActionListener(new ChannelListener(i));
!         	if (i<localizationData.channels.length)
!         		chTextFields[i].setText(""+localizationData.channels[i]);
!         	else
!         		chTextFields[i].setText("0");
          	gridBagConstraints = new java.awt.GridBagConstraints();
          	gridBagConstraints.weighty = 0; 
!         	gridBagConstraints.weightx = 1.0;
          	gridBagConstraints.insets = new java.awt.Insets(3,2,3,2);
          	if (i==RipsDataTableModel.NUM_CHANNELS-1){
***************
*** 743,747 ****
          	parametersSubPanelChannels.add(chTextFields[i], gridBagConstraints);
          }
!         parametersPanel.add(parametersSubPanelChannels, java.awt.BorderLayout.CENTER);
  
          GridLayout gL = new java.awt.GridLayout(6, 4, 10, 5);
--- 748,753 ----
          	parametersSubPanelChannels.add(chTextFields[i], gridBagConstraints);
          }
!         javax.swing.JScrollPane channelsScroll = new javax.swing.JScrollPane(parametersSubPanelChannels);
!         parametersPanel.add(channelsScroll, java.awt.BorderLayout.CENTER);
  
          GridLayout gL = new java.awt.GridLayout(6, 4, 10, 5);
***************
*** 773,776 ****
--- 779,788 ----
          parametersSubPanelMote.add(powerAssistTextField);
          
+         algorithmTypeComboBox.setPreferredSize(new java.awt.Dimension(100,20));
+         algorithmTypeComboBox.setMaximumRowCount(3);
+         algorithmTypeComboBox.addItem("Exact channels");
+         algorithmTypeComboBox.addItem("Channel hop");
+         algorithmTypeComboBox.addItem("Raw data");
+ 
          algorithmTypeComboBox.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
***************
*** 778,787 ****
              }
          });
!         algorithmTypeComboBox.setPreferredSize(new java.awt.Dimension(100,20));
!         algorithmTypeComboBox.addItem("Exact channels");
!         algorithmTypeComboBox.addItem("Channel hop");
!         algorithmTypeComboBox.addItem("Raw data");
!         algorithmTypeComboBox.setMaximumRowCount(3);
!                
          algorithmTypeLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
          algorithmTypeLabel.setText("Algorithm type(53):");
--- 790,794 ----
              }
          });
!         
          algorithmTypeLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
          algorithmTypeLabel.setText("Algorithm type(53):");
***************
*** 1174,1184 ****
          	tmpFileName = chooser.getSelectedFile().getAbsolutePath();//getName();
          
          if ( (tmpIdx = tmpFileName.indexOf(".freq")) > 0 ||
!         	 (tmpIdx = tmpFileName.indexOf(".phase")) > 0 ||	
! 			 (tmpIdx = tmpFileName.indexOf(".pos")) > 0 ||
! 			 (tmpIdx = tmpFileName.indexOf(".set")) > 0||
! 			 (tmpIdx = tmpFileName.indexOf(".rssi")) > 0||
! 			 (tmpIdx = tmpFileName.indexOf(".log")) > 0 )
          	tmpFileName = tmpFileName.substring(0,tmpIdx);
          
          System.out.println("Reading fileBase:"+tmpFileName);
--- 1181,1194 ----
          	tmpFileName = chooser.getSelectedFile().getAbsolutePath();//getName();
          
+         boolean readRanges = false;
          if ( (tmpIdx = tmpFileName.indexOf(".freq")) > 0 ||
!         	 (tmpIdx = tmpFileName.indexOf(".phase")) > 0)
          	tmpFileName = tmpFileName.substring(0,tmpIdx);
+         else if ((tmpIdx = tmpFileName.indexOf(".ranges")) > 0){
+         	tmpFileName = tmpFileName.substring(0,tmpIdx);
+         	readRanges = true;
+         }
+         else
+         	System.out.println("Click on either .freq,.phase, or .ranges file!");
          
          System.out.println("Reading fileBase:"+tmpFileName);
***************
*** 1189,1193 ****
      		localizationData.sensors.clear();
          	
!         	tableModel.readFromFile(tmpFileName);
          	abcdTableModel.resetTable();
              
--- 1199,1203 ----
      		localizationData.sensors.clear();
          	
!         	tableModel.readFromFile(tmpFileName, readRanges);
          	abcdTableModel.resetTable();
              
***************
*** 1201,1204 ****
--- 1211,1218 ----
          	return;
          }
+         
+         if (readRanges)
+         	abcdTableModel.writeAll();
+         
          // update channels
          for (int i=0; i<RipsDataTableModel.NUM_CHANNELS; i++)                        

Index: Utils.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/vu/tools/java/isis/nest/localization/rips/Utils.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Utils.java	25 Feb 2006 02:04:27 -0000	1.1
--- Utils.java	12 Sep 2006 05:20:40 -0000	1.2
***************
*** 1,2 ****
--- 1,25 ----
+ /*
+  * Copyright (c) 2005, Vanderbilt University
+  * All rights reserved.
+  *
+  * Permission to use, copy, modify, and distribute this software and its
+  * documentation for instruction and non-commercial research only, without
+  * fee, and without written agreement is hereby granted, provided that the
+  * this copyright notice including the following two paragraphs and the 
+  * author's name appear in all copies of this software.
+  * 
+  * IN NO EVENT SHALL VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
+  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF VANDERBILT
+  * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  * 
+  * VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+  * ON AN "AS IS" BASIS, AND VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
+  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+  */
+  // @author Brano Kusy: kusy at isis.vanderbilt.edu
+  
  package isis.nest.localization.rips;
  



More information about the Tinyos-contrib-commits mailing list