Added cycling speed sensor.

Fixed speed and cadence computation.
Fixed that a sensor change in settings resulted in a disconnect for all connected sensors.
This commit is contained in:
Dennis Guse
2020-04-25 19:59:18 +02:00
parent 3408ea97f4
commit 4893a2b743
10 changed files with 111 additions and 62 deletions
+15
View File
@@ -20,6 +20,21 @@
<string name="settings_sensor_bluetooth_cycling_speed_key" translatable="false">bluetoothCyclingSpeedSensor</string>
<string name="sensor_type_value_none" translatable="false">NONE</string>
<string name="settings_sensor_bluetooth_cycling_speed_wheel_circumference_key" translatable="false">bluetoothCyclingSpeedWheelCircumference</string>
<string name="settings_sensor_bluetooth_cycling_speed_wheel_circumference_default" translatable="false">2135</string>
<string-array name="wheel_circumference_values">
<item>2100</item>
<item>2125</item>
<item>@string/settings_sensor_bluetooth_cycling_speed_wheel_circumference_default</item>
<item>2150</item>
</string-array>
<string-array name="wheel_circumference_options">
<item>20-622</item>
<item>23-622</item>
<item>25-622</item>
<item>28-622</item>
</string-array>
<string name="default_activity_key" translatable="false">defaultActivity</string>
<string name="default_activity_default" translatable="false">@string/activity_type_unknown</string>
<string-array name="activity_types">
+3
View File
@@ -397,6 +397,9 @@ limitations under the License.
<string name="settings_sensor_connecting">Connected to %1$s</string>
<string name="settings_sensor_connected">Connected to %1$s</string>
<string name="settings_sensor_disconnected">Disconnected from %1$s</string>
<string name="settings_sensor_wheel_circumference">Wheel size (ETRTO)</string>
<!-- Settings Stats -->
<string name="settings_stats_coordinate">Latitude/Longitude</string>
<string name="settings_stats_rate_title">Preferred rate</string>
+12 -5
View File
@@ -54,8 +54,8 @@ limitations under the License.
</PreferenceCategory>
<PreferenceCategory
android:title="@string/settings_recording"
android:key="@string/settings_recording_key"
android:title="@string/settings_recording"
app:initialExpandedChildrenCount="4">
<SwitchPreferenceCompat
android:defaultValue="@bool/stats_show_on_lockscreen_while_recording_default"
@@ -119,10 +119,17 @@ limitations under the License.
android:defaultValue="@string/sensor_type_value_none"
android:key="@string/settings_sensor_bluetooth_cycling_cadence_key"
android:title="@string/sensor_state_cadence" />
<!-- <de.dennisguse.opentracks.settings.bluetooth.BluetoothLeCyclingCadenceAndSpeedPreference-->
<!-- android:defaultValue="@string/sensor_type_value_none"-->
<!-- android:key="@string/settings_sensor_bluetooth_cycling_speed_key"-->
<!-- android:title="@string/stats_speed" />-->
<de.dennisguse.opentracks.settings.bluetooth.BluetoothLeCyclingCadenceAndSpeedPreference
android:defaultValue="@string/sensor_type_value_none"
android:key="@string/settings_sensor_bluetooth_cycling_speed_key"
android:title="@string/stats_speed" />
<ListPreference
android:defaultValue="@string/settings_sensor_bluetooth_cycling_speed_wheel_circumference_default"
android:entries="@array/wheel_circumference_options"
android:entryValues="@array/wheel_circumference_values"
android:key="settings_sensor_bluetooth_cycling_speed_wheel_circumference_key"
android:title="@string/settings_sensor_wheel_circumference"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/generic_tracks">