2015-10-21 16:11:16 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.devices.pebble;
|
|
|
|
|
2016-05-08 23:14:58 +02:00
|
|
|
import de.greenrobot.dao.AbstractDao;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractSampleProvider;
|
2015-10-21 16:11:16 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
|
2016-05-08 23:14:58 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.entities.PebbleActivitySample;
|
2015-10-21 16:11:16 +02:00
|
|
|
|
2016-05-08 23:14:58 +02:00
|
|
|
public class MisfitSampleProvider extends AbstractSampleProvider<PebbleActivitySample> {
|
2015-10-21 16:11:16 +02:00
|
|
|
|
2015-11-23 23:04:46 +01:00
|
|
|
protected final float movementDivisor = 300f;
|
2015-10-21 16:11:16 +02:00
|
|
|
|
2016-05-08 23:41:34 +02:00
|
|
|
public MisfitSampleProvider(DaoSession session) {
|
2016-05-08 23:14:58 +02:00
|
|
|
super(session);
|
|
|
|
}
|
|
|
|
|
2015-10-21 16:11:16 +02:00
|
|
|
@Override
|
2016-02-29 20:54:39 +01:00
|
|
|
public int normalizeType(int rawType) {
|
2015-10-21 16:11:16 +02:00
|
|
|
return (int) rawType;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-02-29 20:54:39 +01:00
|
|
|
public int toRawActivityKind(int activityKind) {
|
2015-10-21 16:11:16 +02:00
|
|
|
return (byte) activityKind;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
2016-02-29 20:54:39 +01:00
|
|
|
public float normalizeIntensity(int rawIntensity) {
|
2015-10-21 16:11:16 +02:00
|
|
|
return rawIntensity / movementDivisor;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
2016-02-29 20:54:39 +01:00
|
|
|
public int getID() {
|
2015-10-21 16:11:16 +02:00
|
|
|
return SampleProvider.PROVIDER_PEBBLE_MISFIT;
|
|
|
|
}
|
2016-05-08 23:14:58 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
protected AbstractDao<PebbleActivitySample, ?> getSampleDao() {
|
2016-05-08 23:41:34 +02:00
|
|
|
return getSession().getPebbleActivitySampleDao();
|
2016-05-08 23:14:58 +02:00
|
|
|
}
|
2015-10-21 16:11:16 +02:00
|
|
|
}
|