Added menu option to send init script to nodes. Added charts 'Average Power' and 'Average Temperature'. Limited the number of displayed chart items to 250 in the time charts
This commit is contained in:
parent
71c219f5fc
commit
ec69c1c825
5 changed files with 376 additions and 85 deletions
|
@ -26,7 +26,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: SensorData.java,v 1.2 2008/08/15 18:47:13 adamdunkels Exp $
|
||||
* $Id: SensorData.java,v 1.3 2008/08/29 09:00:15 nifi Exp $
|
||||
*
|
||||
* -----------------------------------------------------------------
|
||||
*
|
||||
|
@ -34,50 +34,16 @@
|
|||
*
|
||||
* Authors : Joakim Eriksson, Niclas Finne
|
||||
* Created : 3 jul 2008
|
||||
* Updated : $Date: 2008/08/15 18:47:13 $
|
||||
* $Revision: 1.2 $
|
||||
* Updated : $Date: 2008/08/29 09:00:15 $
|
||||
* $Revision: 1.3 $
|
||||
*/
|
||||
|
||||
package se.sics.contiki.collect;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class SensorData {
|
||||
|
||||
public static final int TICKS_PER_SECOND = 4096;
|
||||
private static final double VOLTAGE = 3;
|
||||
private static final double POWER_CPU = 1.800 * VOLTAGE; /* mW */
|
||||
private static final double POWER_LPM = 0.0545 * VOLTAGE; /* mW */
|
||||
private static final double POWER_TRANSMIT = 17.7 * VOLTAGE; /* mW */
|
||||
private static final double POWER_LISTEN = 20.0 * VOLTAGE; /* mW */
|
||||
|
||||
public static final int DATA_LEN = 0;
|
||||
public static final int TIMESTAMP1 = 1;
|
||||
public static final int TIMESTAMP2 = 2;
|
||||
public static final int TIMESYNCTIMESTAMP = 3;
|
||||
public static final int NODE_ID = 4;
|
||||
public static final int SEQNO = 5;
|
||||
public static final int HOPS = 6;
|
||||
public static final int LATENCY = 7;
|
||||
public static final int DATA_LEN2 = 8;
|
||||
public static final int CLOCK = 9;
|
||||
public static final int TIMESYNCHTIME = 10;
|
||||
public static final int LIGHT1 = 11;
|
||||
public static final int LIGHT2 = 12;
|
||||
public static final int TEMPERATURE = 13;
|
||||
public static final int HUMIDITY = 14;
|
||||
public static final int RSSI = 15;
|
||||
public static final int TIME_CPU = 16;
|
||||
public static final int TIME_LPM = 17;
|
||||
public static final int TIME_TRANSMIT = 18;
|
||||
public static final int TIME_LISTEN = 19;
|
||||
public static final int BEST_NEIGHBOR = 20;
|
||||
public static final int BEST_NEIGHBOR_ETX = 21;
|
||||
public static final int BEST_NEIGHBOR_RTMETRIC = 22;
|
||||
|
||||
public static final int VALUES_COUNT = 23;
|
||||
public class SensorData implements SensorInfo {
|
||||
|
||||
private final Node node;
|
||||
private final int[] values;
|
||||
|
@ -101,6 +67,10 @@ public class SensorData {
|
|||
return values[index];
|
||||
}
|
||||
|
||||
public int getValueCount() {
|
||||
return values.length;
|
||||
}
|
||||
|
||||
public long getTime() {
|
||||
return time;
|
||||
}
|
||||
|
@ -169,7 +139,7 @@ public class SensorData {
|
|||
}
|
||||
|
||||
public long getPowerMeasureTime() {
|
||||
return (1000 * (values[TIME_CPU] + values[TIME_LPM])) / TICKS_PER_SECOND;
|
||||
return (1000L * (values[TIME_CPU] + values[TIME_LPM])) / TICKS_PER_SECOND;
|
||||
}
|
||||
|
||||
public double getTemperature() {
|
||||
|
@ -185,12 +155,7 @@ public class SensorData {
|
|||
}
|
||||
|
||||
public double getHumidity() {
|
||||
double v;
|
||||
// double v = values[HUMIDITY];
|
||||
// double humidity = -4.0 + 0.0405 * v + -0.0000028 * v * v;
|
||||
// // Correct humidity using temperature compensation
|
||||
// return (getTemperature() - 25) * (0.01 + 0.00008*v + humidity);
|
||||
v = -4.0 + 405.0 * values[HUMIDITY] / 10000.0;
|
||||
double v = -4.0 + 405.0 * values[HUMIDITY] / 10000.0;
|
||||
if(v > 100) {
|
||||
return 100;
|
||||
} else {
|
||||
|
@ -199,8 +164,6 @@ public class SensorData {
|
|||
}
|
||||
|
||||
public double getLight1() {
|
||||
// double v = (values[LIGHT1] * VOLTAGE) / 4096.0;
|
||||
// return 0.625 * 1000000 * v * 10;
|
||||
return 10.0 * values[LIGHT1] / 7.0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue