Bugfix: dates are now correctly displayed. Capped humidity values at 100%

This commit is contained in:
adamdunkels 2008-08-15 18:47:13 +00:00
parent 46b824d80f
commit d0f8770263

View File

@ -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.1 2008/07/09 23:18:06 nifi Exp $
* $Id: SensorData.java,v 1.2 2008/08/15 18:47:13 adamdunkels Exp $
*
* -----------------------------------------------------------------
*
@ -34,8 +34,8 @@
*
* Authors : Joakim Eriksson, Niclas Finne
* Created : 3 jul 2008
* Updated : $Date: 2008/07/09 23:18:06 $
* $Revision: 1.1 $
* Updated : $Date: 2008/08/15 18:47:13 $
* $Revision: 1.2 $
*/
package se.sics.contiki.collect;
@ -86,7 +86,7 @@ public class SensorData {
public SensorData(Node node, int[] values) {
this.node = node;
this.values = values;
this.time = ((values[TIMESTAMP1] << 16) + values[TIMESTAMP2]) * 1000;
this.time = ((values[TIMESTAMP1] << 16) + values[TIMESTAMP2]) * 1000L;
}
public Node getNode() {
@ -176,16 +176,26 @@ public class SensorData {
return -39.6 + 0.01 * values[TEMPERATURE];
}
public double getRadioIntensity() {
return values[RSSI];
}
public double getLatency() {
return values[LATENCY] / 4096.0;
}
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);
return -4.0 + 405.0 * values[HUMIDITY] / 10000.0;
v = -4.0 + 405.0 * values[HUMIDITY] / 10000.0;
if(v > 100) {
return 100;
} else {
return v;
}
}
public double getLight1() {