mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
Clean up ant code
This commit is contained in:
@@ -44,22 +44,6 @@ public class Ant extends Base<Object>
|
||||
releaseHandle.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void alterCurrentData(int key, float value)
|
||||
{
|
||||
super.alterCurrentData(key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void alterCurrentData(int[] keys, float[] values)
|
||||
{
|
||||
super.alterCurrentData(keys, values);
|
||||
}
|
||||
|
||||
|
||||
public void zeroReadings() {}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -50,6 +50,9 @@ public class Base<T>
|
||||
|
||||
//Clean up my listeners here
|
||||
public void onDestroy() {}
|
||||
|
||||
//zero any of my values
|
||||
public void zeroReadings() {}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class HeartRate extends Ant
|
||||
new IHeartRateDataReceiver() {
|
||||
@Override
|
||||
public void onNewHeartRateData(final long estTimestamp, EnumSet<EventFlag> eventFlags, final int computedHeartRate, final long heartBeatCount, final BigDecimal heartBeatEventTime, final DataState dataState) {
|
||||
alterCurrentData(RideService.HR, computedHeartRate);
|
||||
alterCurrentData(RideService.HR, (float) computedHeartRate);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ridelogger.listners;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import com.dsi.ant.plugins.antplus.pcc.AntPlusBikePowerPcc;
|
||||
import com.dsi.ant.plugins.antplus.pcc.AntPlusBikePowerPcc.CalculatedWheelDistanceReceiver;
|
||||
import com.dsi.ant.plugins.antplus.pcc.AntPlusBikePowerPcc.CalculatedWheelSpeedReceiver;
|
||||
import com.dsi.ant.plugins.antplus.pcc.AntPlusBikePowerPcc.DataSource;
|
||||
import com.dsi.ant.plugins.antplus.pcc.AntPlusBikePowerPcc.ICalculatedCrankCadenceReceiver;
|
||||
@@ -81,7 +82,7 @@ public class Power extends Ant
|
||||
}
|
||||
);
|
||||
|
||||
/*result.subscribeCalculatedWheelDistanceEvent(
|
||||
result.subscribeCalculatedWheelDistanceEvent(
|
||||
new CalculatedWheelDistanceReceiver(wheelCircumferenceInMeters) {
|
||||
@Override
|
||||
public void onNewCalculatedWheelDistance(final long estTimestamp, final EnumSet<EventFlag> eventFlags, final DataSource dataSource, final BigDecimal calculatedWheelDistance)
|
||||
@@ -89,14 +90,14 @@ public class Power extends Ant
|
||||
alterCurrentData(RideService.KM, calculatedWheelDistance.floatValue());
|
||||
}
|
||||
}
|
||||
);*/
|
||||
);
|
||||
|
||||
result.subscribeInstantaneousCadenceEvent(
|
||||
new IInstantaneousCadenceReceiver() {
|
||||
@Override
|
||||
public void onNewInstantaneousCadence(final long estTimestamp, final EnumSet<EventFlag> eventFlags, final DataSource dataSource, final int instantaneousCadence)
|
||||
{
|
||||
alterCurrentData(RideService.CAD, instantaneousCadence);
|
||||
alterCurrentData(RideService.CAD, (float) instantaneousCadence);
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -106,7 +107,7 @@ public class Power extends Ant
|
||||
@Override
|
||||
public void onNewRawPowerOnlyData(final long estTimestamp, final EnumSet<EventFlag> eventFlags, final long powerOnlyUpdateEventCount, final int instantaneousPower, final long accumulatedPower)
|
||||
{
|
||||
alterCurrentData(RideService.WATTS, instantaneousPower);
|
||||
alterCurrentData(RideService.WATTS, (float) instantaneousPower);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user