From c0fb601354e8ce128b0a75108d628bbbf2885409 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Sun, 3 Oct 2010 20:19:12 +0000 Subject: [PATCH] Added the number of neighbors to the collection view app --- .../se/sics/contiki/collect/CollectServer.java | 17 ++++++++++++++--- .../src/se/sics/contiki/collect/SensorInfo.java | 9 +++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/examples/sky-shell/src/se/sics/contiki/collect/CollectServer.java b/examples/sky-shell/src/se/sics/contiki/collect/CollectServer.java index dc5089602..f7b719327 100644 --- a/examples/sky-shell/src/se/sics/contiki/collect/CollectServer.java +++ b/examples/sky-shell/src/se/sics/contiki/collect/CollectServer.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: CollectServer.java,v 1.22 2010/09/30 22:24:45 nifi Exp $ + * $Id: CollectServer.java,v 1.23 2010/10/03 20:19:12 adamdunkels Exp $ * * ----------------------------------------------------------------- * @@ -34,8 +34,8 @@ * * Authors : Joakim Eriksson, Niclas Finne * Created : 3 jul 2008 - * Updated : $Date: 2010/09/30 22:24:45 $ - * $Revision: 1.22 $ + * Updated : $Date: 2010/10/03 20:19:12 $ + * $Revision: 1.23 $ */ package se.sics.contiki.collect; @@ -310,6 +310,17 @@ public class CollectServer { return data.getLight2(); } }, + new TimeChartPanel(this, NETWORK, "Neighbors (Over Time)", "Neighbor Count", "Time", "Neighbors") { + { + ValueAxis axis = chart.getXYPlot().getRangeAxis(); + ((NumberAxis)axis).setAutoRangeIncludesZero(true); + axis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); + setMaxItemCount(defaultMaxItemCount); + } + protected double getSensorDataValue(SensorData data) { + return data.getValue(SensorData.NUM_NEIGHBORS); + } + }, new TimeChartPanel(this, NETWORK, "Network Hops (Over Time)", "Network Hops", "Time", "Hops") { { ValueAxis axis = chart.getXYPlot().getRangeAxis(); diff --git a/examples/sky-shell/src/se/sics/contiki/collect/SensorInfo.java b/examples/sky-shell/src/se/sics/contiki/collect/SensorInfo.java index 51479c031..86bb175d7 100644 --- a/examples/sky-shell/src/se/sics/contiki/collect/SensorInfo.java +++ b/examples/sky-shell/src/se/sics/contiki/collect/SensorInfo.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: SensorInfo.java,v 1.2 2008/11/10 21:14:20 adamdunkels Exp $ + * $Id: SensorInfo.java,v 1.3 2010/10/03 20:19:12 adamdunkels Exp $ * * ----------------------------------------------------------------- * @@ -34,8 +34,8 @@ * * Authors : Joakim Eriksson, Niclas Finne * Created : 20 aug 2008 - * Updated : $Date: 2008/11/10 21:14:20 $ - * $Revision: 1.2 $ + * Updated : $Date: 2010/10/03 20:19:12 $ + * $Revision: 1.3 $ */ package se.sics.contiki.collect; @@ -78,7 +78,8 @@ public interface SensorInfo { public static final int BEST_NEIGHBOR_RTMETRIC = 22; public static final int BATTERY_VOLTAGE = 23; public static final int BATTERY_INDICATOR = 24; + public static final int NUM_NEIGHBORS = 25; - public static final int VALUES_COUNT = 25; + public static final int VALUES_COUNT = 26; }