From be1c81893826121b1fa57c01d1a1c5b5b92c1760 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Mon, 7 Dec 2009 11:14:02 +0000 Subject: [PATCH] statistics bug fix: divide by number of motes + show time ruler at zoom in/out --- .../java/se/sics/cooja/plugins/TimeLine.java | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/plugins/TimeLine.java b/tools/cooja/java/se/sics/cooja/plugins/TimeLine.java index 100b9a190..6f2f56997 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/TimeLine.java +++ b/tools/cooja/java/se/sics/cooja/plugins/TimeLine.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: TimeLine.java,v 1.18 2009/12/07 11:04:15 fros4943 Exp $ + * $Id: TimeLine.java,v 1.19 2009/12/07 11:14:02 fros4943 Exp $ */ package se.sics.cooja.plugins; @@ -340,6 +340,11 @@ public class TimeLine extends VisPlugin { w, 1 ); timeline.scrollRectToVisible(r); + + /* Time ruler */ + mousePixelPositionX = centerPixel; + mouseDownPixelPositionX = centerPixel; + mousePixelPositionY = timeline.getHeight(); } }); } @@ -371,6 +376,12 @@ public class TimeLine extends VisPlugin { centerPixel - w/2, 0, w, 1 ); + + /* Time ruler */ + mousePixelPositionX = centerPixel; + mouseDownPixelPositionX = centerPixel; + mousePixelPositionY = timeline.getHeight(); + timeline.scrollRectToVisible(r); } }); @@ -577,7 +588,15 @@ public class TimeLine extends VisPlugin { all.onTimeTX += stats.onTimeTX; all.onTimeInterfered += stats.onTimeInterfered; } - logger.info("SUMMARY"); + all.onTimeBlueLED /= allStats.size(); + all.onTimeGreenLED /= allStats.size(); + all.onTimeBlueLED /= allStats.size(); + all.radioOn /= allStats.size(); + all.onTimeRX /= allStats.size(); + all.onTimeTX /= allStats.size(); + all.onTimeInterfered /= allStats.size(); + + logger.info("SIMULATION AVERAGE:"); logger.info(all.toString()); } };