protected override void SpecificDataUpdated(Windows7.Sensors.SensorDataReport dataReport) { double x = Math.Round((float)dataReport.GetDataField(SensorPropertyKeys.SENSOR_DATA_TYPE_ACCELERATION_X_G), DecimalPrecision); double y = Math.Round((float)dataReport.GetDataField(SensorPropertyKeys.SENSOR_DATA_TYPE_ACCELERATION_Y_G), DecimalPrecision); double z = Math.Round((float)dataReport.GetDataField(SensorPropertyKeys.SENSOR_DATA_TYPE_ACCELERATION_Z_G), DecimalPrecision); if (x < AccelerationXMinimum) { AccelerationXMinimum = x; } if (x > AccelerationXMaximum) { AccelerationXMaximum = x; } if (y < AccelerationYMinimum) { AccelerationYMinimum = y; } if (y > AccelerationYMaximum) { AccelerationYMaximum = y; } if (z < AccelerationZMinimum) { AccelerationZMinimum = z; } if (z > AccelerationZMaximum) { AccelerationZMaximum = z; } this.AccelerationX = x; this.AccelerationY = y; this.AccelerationZ = z; if (AccelerationDataUpdated != null) { AccelerationDataUpdated(this, x, y, z); } }
protected override void SpecificDataUpdated(Windows7.Sensors.SensorDataReport dataReport) { double lux = Math.Round((float)dataReport.GetDataField(SensorPropertyKeys.SENSOR_DATA_TYPE_LIGHT_LUX), DecimalPrecision); if (resetCalibrate) { LuxMinimum = lux; LuxMaximum = lux; resetCalibrate = false; } this.Lux = lux; if (LuxDataUpdated != null) { LuxDataUpdated(this, lux); } }