|
From: <an...@us...> - 2007-01-29 13:21:01
|
Revision: 518
http://svn.sourceforge.net/magicmap/?rev=518&view=rev
Author: anweiss
Date: 2007-01-29 05:20:50 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
performance optimization in signalLevelToStrength() and MagicMetric
Modified Paths:
--------------
trunk/magicmapclient/src/net/sf/magicmap/client/algorithms/MagicMetric.java
trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MeasureTableCellRenderer.java
trunk/magicmapclient/src/net/sf/magicmap/client/measurement/MeasurementUtils.java
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/algorithms/MagicMetric.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/algorithms/MagicMetric.java 2007-01-28 13:20:43 UTC (rev 517)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/algorithms/MagicMetric.java 2007-01-29 13:20:50 UTC (rev 518)
@@ -167,8 +167,7 @@
ap = (AccessPointNode) node2;
}
// TODO: Logarithmische Skalierung
- return Math.abs(Constants.MIN_SIGNALLEVEL
- - MeasurementUtils.signalLevelToStrength(seer.getSignalLevelForAccessPoint(ap)));
+ return Math.abs(MeasurementUtils.signalLevelToStrength(seer.getSignalLevelForAccessPoint(ap)));
} else
//Wir berechnen nur Abst\xE4nde zwischen APs, Clients und Referenzpunkten
return Double.POSITIVE_INFINITY;
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MeasureTableCellRenderer.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MeasureTableCellRenderer.java 2007-01-28 13:20:43 UTC (rev 517)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/gui/views/MeasureTableCellRenderer.java 2007-01-29 13:20:50 UTC (rev 518)
@@ -53,8 +53,8 @@
GradientPaint p2 = new GradientPaint(getWidth() / 2, 0, Color.YELLOW, getWidth(), getHeight(), Color.GREEN);
//double d = 100.0 - Math.abs(avg ? ap.getAverageSignalLevel() : ap.getLastSignalLevel());
- double d = MeasurementUtils.signalLevelToStrength(this.avg ? this.ap.getAverageSignalLevel() : this.ap
- .getLastSignalLevel());
+ double d = Math.abs(Constants.MIN_SIGNALLEVEL-MeasurementUtils.signalLevelToStrength(this.avg ? this.ap.getAverageSignalLevel() : this.ap
+ .getLastSignalLevel()));
g2.setPaint(p1);
int w = (int) (getWidth() * d / Constants.MIN_SIGNALLEVEL);
Modified: trunk/magicmapclient/src/net/sf/magicmap/client/measurement/MeasurementUtils.java
===================================================================
--- trunk/magicmapclient/src/net/sf/magicmap/client/measurement/MeasurementUtils.java 2007-01-28 13:20:43 UTC (rev 517)
+++ trunk/magicmapclient/src/net/sf/magicmap/client/measurement/MeasurementUtils.java 2007-01-29 13:20:50 UTC (rev 518)
@@ -32,7 +32,7 @@
result = Constants.MIN_SIGNALLEVEL;
System.out.println(Constants.MIN_SIGNALLEVEL + " \xFCberschritten");
}
- return Constants.MIN_SIGNALLEVEL - result;
+ return result;
}
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|