Package org.contikios.contiki.collect

Examples of org.contikios.contiki.collect.SensorData


        int groupSize = getGroupSize(node);
        if (groupSize > 1) {
          updateSeries(series, node, groupSize);
        } else {
          for (int i = 0, n = node.getSensorDataCount(); i < n; i++) {
            SensorData data = node.getSensorData(i);
            series.addOrUpdate(new Second(new Date(data.getNodeTime())), getSensorDataValue(data));
          }
        }
        timeSeries.addSeries(series);
      }
    }
View Full Code Here


  protected void updateSeries(TimeSeries series, Node node, int groupSize) {
    for (int i = 0, n = node.getSensorDataCount(); i < n; i += groupSize) {
      double value = 0.0;
      long time = 0L;
      for (int j = 0; j < groupSize; j++) {
        SensorData data = node.getSensorData(i);
        value += getSensorDataValue(data);
        time += data.getNodeTime() / 1000L;
      }
      series.addOrUpdate(new Second(new Date((time / groupSize) * 1000L)), value / groupSize);
    }
  }
View Full Code Here

      long minute = server.getSensorData(0).getNodeTime() / 60000;
      long lastMinute = minute;
      int count = 0;
      clearState(selectedMap);
      for(int i = 0; i < server.getSensorDataCount(); i++) {
        SensorData sd = server.getSensorData(i);
        T nodeState = selectedMap.get(sd.getNode());
        if (nodeState != null) {
          if (sd.isDuplicate()) {
            duplicates++;
          } else {
            long min = sd.getNodeTime() / 60000;
            if (min != minute) {
              if (lastMinute < minute) {
                series.add(new Minute(new Date(lastMinute * 60000L)), 0);
                if (lastMinute < minute - 1) {
                  series.add(new Minute(new Date((minute - 1) * 60000L)), 0);
View Full Code Here

TOP

Related Classes of org.contikios.contiki.collect.SensorData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.