forked from upstream-mirrors/OpenTracks
Compare commits
227 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3db0a53377 | |||
| 58dac8b706 | |||
| f29b6d4088 | |||
| 80fb4f9998 | |||
| 6340e55fff | |||
| 625549d381 | |||
| 7d9878b32e | |||
| a5553211af | |||
| 044e84154c | |||
| f61d718b2d | |||
| c7a54dcee8 | |||
| 3dc2ee3462 | |||
| 6817ff3234 | |||
| fb0400001a | |||
| 16591b3e80 | |||
| 28da32f573 | |||
| c687308d97 | |||
| 65c8e8542e | |||
| ca4cb648e7 | |||
| 53240c3d1a | |||
| 95b27f66fb | |||
| f31e146cda | |||
| 696939112a | |||
| 73ce97a63e | |||
| 5988ae3d3f | |||
| 58655814b2 | |||
| 11f1b6e72d | |||
| 8f537f33a7 | |||
| 4db72230ff | |||
| fd92793c2a | |||
| 05e45b6870 | |||
| 7521f906ed | |||
| 3222a0c497 | |||
| caf3d957cd | |||
| 005d00cfaa | |||
| c227d54f26 | |||
| bc62320b9f | |||
| 0ad32f676c | |||
| fff5f2d406 | |||
| be653b73ee | |||
| 4580f2a7bb | |||
| 5dd56892fb | |||
| e3460d94ed | |||
| 920ad5129a | |||
| fba08fe8dd | |||
| 5746a41905 | |||
| 361ae909e7 | |||
| 4b59660ea1 | |||
| cabf5d238e | |||
| 9c902b89ed | |||
| c31b8a5802 | |||
| 901c548d13 | |||
| b77de1e10d | |||
| b8c7fba7d8 | |||
| 466719fbc8 | |||
| 4f0ab71503 | |||
| daa4689f44 | |||
| 023a5aa221 | |||
| 291633c1d5 | |||
| 00990076fb | |||
| e672df7a60 | |||
| 82eb237117 | |||
| 832005565a | |||
| 894699f009 | |||
| f45dba258b | |||
| 17be49af70 | |||
| e91d36fc16 | |||
| 56f333180b | |||
| 9af8b0d353 | |||
| 57c0750980 | |||
| 8e36ee2e7d | |||
| ec2e527fd1 | |||
| d968e5d0c1 | |||
| 4257f21cae | |||
| 26e7059af2 | |||
| 94595f2a1f | |||
| 1fa76301e2 | |||
| ce2c608cc9 | |||
| 916f26dfda | |||
| a108edc125 | |||
| 1a1a8a851b | |||
| ddd1efeb58 | |||
| 6c30dd8509 | |||
| 21fe59f32c | |||
| f79b2b51c8 | |||
| b16e9ad964 | |||
| 65f8ba16b3 | |||
| 9b48993cd0 | |||
| 54cec3e821 | |||
| daeb972c8a | |||
| 73872e8926 | |||
| c15fa21a56 | |||
| e9d1080e5d | |||
| d0b3f45151 | |||
| 32b0b02d28 | |||
| d6617f61b7 | |||
| b5180f235f | |||
| e879eedbd6 | |||
| c7ca6800f7 | |||
| fed884a6ce | |||
| 02a77e5ce7 | |||
| 6f97399aeb | |||
| 1c4f0e67ab | |||
| ebed386d96 | |||
| e44f63feb7 | |||
| 34c5a3ab97 | |||
| eac47db058 | |||
| e72d2a750c | |||
| f54856c3f1 | |||
| 81f6bbe955 | |||
| c162c0a0ff | |||
| 385d05dcdb | |||
| 308ce4ac07 | |||
| f8a0241e1f | |||
| c74a5c8749 | |||
| defdd49a65 | |||
| 46cdae399d | |||
| a19f363b4a | |||
| b55b25e00d | |||
| d527770a0a | |||
| fb75b0fa58 | |||
| 1c986e48f2 | |||
| 7f666c571e | |||
| 3c23a9f540 | |||
| ec08717d01 | |||
| 30dc440d43 | |||
| 919e670f95 | |||
| 8ff95efc65 | |||
| b2b98210d5 | |||
| b3f2db4619 | |||
| caede289d0 | |||
| 7a09e32261 | |||
| 388f1d0213 | |||
| f44d72a51f | |||
| 5e9b1d1cb7 | |||
| 305c0d2502 | |||
| 4306634fb2 | |||
| 9fded8953d | |||
| a416b4b0e7 | |||
| e795fbf07d | |||
| 41401e2f13 | |||
| 848c5a8db8 | |||
| becd65f9f5 | |||
| ece4470fec | |||
| de08707000 | |||
| d7a5bf8231 | |||
| 10453e3d4e | |||
| 4d4898e01a | |||
| 286fbc9b45 | |||
| b1ea89a548 | |||
| 2e5643aa0d | |||
| f48e175578 | |||
| 252909b133 | |||
| 125cafa79d | |||
| d15810f908 | |||
| a89e25b00c | |||
| f256c25cb6 | |||
| db75b28d5b | |||
| 87c4428a86 | |||
| 8f1eda9726 | |||
| dc88007154 | |||
| 8f82375fa4 | |||
| dd37526914 | |||
| 16d2f080b2 | |||
| 2cce5c56cd | |||
| 24be37aea5 | |||
| f1c9f7512b | |||
| 03a200ec4b | |||
| 93eefe5cf2 | |||
| 792e88acaa | |||
| f1b3ce9db5 | |||
| 6f65808932 | |||
| cf4e1d07ef | |||
| dff5cd0088 | |||
| 3c52a5b38a | |||
| ea53326183 | |||
| 5bea48096c | |||
| c34e9bd7b6 | |||
| edac784b1e | |||
| 87228d2341 | |||
| 00e62b7d6f | |||
| 024e5e0e5f | |||
| 2feb7d1c1e | |||
| 2f29433a09 | |||
| 5ecb058789 | |||
| 820f26cf1d | |||
| d91f59e1ff | |||
| 0b541b7590 | |||
| f3f8075a5e | |||
| e41df73919 | |||
| 0f05100807 | |||
| d16de9789f | |||
| ca809bde6b | |||
| 692650cf99 | |||
| 9bf77c41a0 | |||
| 3986172095 | |||
| 943e05f17d | |||
| 65e7044d49 | |||
| b072635a32 | |||
| 9237693063 | |||
| 4999b54a97 | |||
| 0dca1461e1 | |||
| 2e13054042 | |||
| 3eba204b9d | |||
| 8b8eaa5ea9 | |||
| c0b6b9e5e4 | |||
| da109fb8fe | |||
| fca4206c86 | |||
| a2531c8651 | |||
| 7b4ab81f5c | |||
| 90446639b0 | |||
| 8744724c0f | |||
| 1113cb1764 | |||
| f9466b7347 | |||
| 45be184d76 | |||
| 730ace0b60 | |||
| b662a8bc42 | |||
| a0b4f78977 | |||
| 6334c03dbc | |||
| 57fd2fd160 | |||
| d76131a34f | |||
| 3bae0869c4 | |||
| a164876615 | |||
| 5bbb5f789f | |||
| 6e42857023 | |||
| b883bb3862 | |||
| 9b5ef0707e |
@@ -0,0 +1,36 @@
|
|||||||
|
name: Android Test
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Android Lint
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: 'ubuntu:android-24.04'
|
||||||
|
steps:
|
||||||
|
- name: Checkout sources
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew lint
|
||||||
|
|
||||||
|
android-check:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: 'ubuntu:android-24.04'
|
||||||
|
steps:
|
||||||
|
- name: Checkout sources
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
shell: bash
|
||||||
|
run: ./gradlew testNightlyDebugUnitTest --stacktrace
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# These are supported funding model platforms
|
|
||||||
|
|
||||||
liberapay: OpenTracks
|
|
||||||
github: [rgmf, pstorch, dennisguse]
|
|
||||||
custom: https://play.google.com/store/apps/details?id=de.dennisguse.opentracks.playstore
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: "gradle"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
||||||
- package-ecosystem: "github-actions"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
#https://github.com/marketplace/actions/android-emulator-runner
|
|
||||||
name: Build APK
|
|
||||||
on:
|
|
||||||
push
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
apk-build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-tags: true
|
|
||||||
fetch-depth: 0 #TODO See https://github.com/actions/checkout/issues/1471
|
|
||||||
|
|
||||||
- uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
distribution: 'adopt'
|
|
||||||
java-version: '17'
|
|
||||||
|
|
||||||
- name: Assemble APK
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo ${NIGHTLY_STORE_FILE} | base64 -d > KEY_NIGHTLY.jks
|
|
||||||
./gradlew assembleNightlyRelease -Dnightly_store_file=KEY_NIGHTLY.jks -Dnightly_store_password="${NIGHTLY_STORE_PASSWORD}" -Dnightly_key_alias="${NIGHTLY_KEY_ALIAS}" -Dnightly_key_password="${NIGHTLY_STORE_PASSWORD}"
|
|
||||||
env:
|
|
||||||
NIGHTLY_STORE_FILE: ${{ secrets.NIGHTLY_STORE_FILE }}
|
|
||||||
NIGHTLY_STORE_PASSWORD: ${{ secrets.NIGHTLY_STORE_PASSWORD }}
|
|
||||||
NIGHTLY_KEY_ALIAS: ${{ secrets.NIGHTLY_KEY_ALIAS }}
|
|
||||||
|
|
||||||
- name: Archive
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: OpenTracks-APK.apk
|
|
||||||
path: ./build/outputs/apk/nightly/*.apk
|
|
||||||
retention-days: 7
|
|
||||||
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
name: Linting
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
analyse:
|
|
||||||
name: Analyse
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-tags: true
|
|
||||||
fetch-depth: 0 #TODO See https://github.com/actions/checkout/issues/1471
|
|
||||||
|
|
||||||
- uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
distribution: 'adopt'
|
|
||||||
java-version: '17'
|
|
||||||
|
|
||||||
- run: ./gradlew lint
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
#https://github.com/marketplace/actions/android-emulator-runner
|
|
||||||
name: Test
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
timeout-minutes: 45
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-tags: true
|
|
||||||
fetch-depth: 0 #TODO See https://github.com/actions/checkout/issues/1471
|
|
||||||
|
|
||||||
- uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
distribution: 'adopt'
|
|
||||||
java-version: '17'
|
|
||||||
|
|
||||||
- name: Enable KVM
|
|
||||||
run: |
|
|
||||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
|
||||||
sudo udevadm control --reload-rules
|
|
||||||
sudo udevadm trigger --name-match=kvm
|
|
||||||
|
|
||||||
- name: run tests
|
|
||||||
uses: reactivecircus/android-emulator-runner@v2.34.0
|
|
||||||
with:
|
|
||||||
arch: x86_64
|
|
||||||
api-level: 34
|
|
||||||
script: ./gradlew connectedCheck
|
|
||||||
|
|
||||||
- name: Archive
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: code-coverage-report
|
|
||||||
path: build/reports/androidTests/
|
|
||||||
retention-days: 7
|
|
||||||
|
|
||||||
Generated
+41
@@ -1,5 +1,40 @@
|
|||||||
<component name="ProjectCodeStyleConfiguration">
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
<code_scheme name="Project" version="173">
|
<code_scheme name="Project" version="173">
|
||||||
|
<JavaCodeStyleSettings>
|
||||||
|
<option name="IMPORT_LAYOUT_TABLE">
|
||||||
|
<value>
|
||||||
|
<package name="" withSubpackages="true" static="false" module="true" />
|
||||||
|
<package name="android" withSubpackages="true" static="true" />
|
||||||
|
<package name="androidx" withSubpackages="true" static="true" />
|
||||||
|
<package name="com" withSubpackages="true" static="true" />
|
||||||
|
<package name="junit" withSubpackages="true" static="true" />
|
||||||
|
<package name="net" withSubpackages="true" static="true" />
|
||||||
|
<package name="org" withSubpackages="true" static="true" />
|
||||||
|
<package name="java" withSubpackages="true" static="true" />
|
||||||
|
<package name="javax" withSubpackages="true" static="true" />
|
||||||
|
<package name="" withSubpackages="true" static="true" />
|
||||||
|
<emptyLine />
|
||||||
|
<package name="android" withSubpackages="true" static="false" />
|
||||||
|
<emptyLine />
|
||||||
|
<package name="androidx" withSubpackages="true" static="false" />
|
||||||
|
<emptyLine />
|
||||||
|
<package name="com" withSubpackages="true" static="false" />
|
||||||
|
<emptyLine />
|
||||||
|
<package name="junit" withSubpackages="true" static="false" />
|
||||||
|
<emptyLine />
|
||||||
|
<package name="net" withSubpackages="true" static="false" />
|
||||||
|
<emptyLine />
|
||||||
|
<package name="org" withSubpackages="true" static="false" />
|
||||||
|
<emptyLine />
|
||||||
|
<package name="java" withSubpackages="true" static="false" />
|
||||||
|
<emptyLine />
|
||||||
|
<package name="javax" withSubpackages="true" static="false" />
|
||||||
|
<emptyLine />
|
||||||
|
<package name="" withSubpackages="true" static="false" />
|
||||||
|
<emptyLine />
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
</JavaCodeStyleSettings>
|
||||||
<JetCodeStyleSettings>
|
<JetCodeStyleSettings>
|
||||||
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
||||||
<value>
|
<value>
|
||||||
@@ -12,6 +47,12 @@
|
|||||||
<MarkdownNavigatorCodeStyleSettings>
|
<MarkdownNavigatorCodeStyleSettings>
|
||||||
<option name="RIGHT_MARGIN" value="72" />
|
<option name="RIGHT_MARGIN" value="72" />
|
||||||
</MarkdownNavigatorCodeStyleSettings>
|
</MarkdownNavigatorCodeStyleSettings>
|
||||||
|
<editorconfig>
|
||||||
|
<option name="ENABLED" value="false" />
|
||||||
|
</editorconfig>
|
||||||
|
<codeStyleSettings language="JAVA">
|
||||||
|
<option name="RIGHT_MARGIN" value="200" />
|
||||||
|
</codeStyleSettings>
|
||||||
<codeStyleSettings language="XML">
|
<codeStyleSettings language="XML">
|
||||||
<indentOptions>
|
<indentOptions>
|
||||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@
|
|||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
Just use OpenTracks and tell us what can be improved by opening an
|
Just use OpenTracks and tell us what can be improved by opening an
|
||||||
issue [here](https://github.com/OpenTracksApp/OpenTracks/issues/new/choose).
|
issue [here](https://codeberg.org/OpenTracksApp/OpenTracks/issues/new/choose).
|
||||||
|
|
||||||
If we broke things (happens now and then), please tell us also.
|
If we broke things (happens now and then), please tell us also.
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ Translations are hosted on [hosted.weblate.org](https://hosted.weblate.org/engag
|
|||||||
You have a cool idea for a feature that is missing in OpenTracks?
|
You have a cool idea for a feature that is missing in OpenTracks?
|
||||||
And you would like to help by implementing it?
|
And you would like to help by implementing it?
|
||||||
If not, you can just take a look at
|
If not, you can just take a look at
|
||||||
the [issue tracker](https://github.com/OpenTracksApp/OpenTracks/issues).
|
the [issue tracker](https://codeberg.org/OpenTracksApp/OpenTracks/issues).
|
||||||
|
|
||||||
Advices:
|
Advices:
|
||||||
|
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ _OpenTracks_ is a sport tracking application that completely respects your priva
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
Translations are hosted on <a href="https://hosted.weblate.org/engage/opentracks/">
|
Translations are hosted on <a href="https://translate.codeberg.org/engage/opentracks/">
|
||||||
hosted.weblate.org</a>.
|
translate.codeberg.org/projects/opentracks/</a>.
|
||||||
<a href="https://hosted.weblate.org/engage/opentracks/">
|
<a href="https://translate.codeberg.org/engage/opentracks/">
|
||||||
<img src="https://hosted.weblate.org/widgets/opentracks/-/horizontal-auto.svg" alt="Translation status" />
|
<img src="https://translate.codeberg.org/widget/opentracks/opentracks-src-main-res-values-strings-xml-main/horizontal-auto.svg" alt="Translation status" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
@@ -151,7 +151,7 @@ adb shell am start -n "de.dennisguse.opentracks.playstore/de.dennisguse.opentrac
|
|||||||
As of v3.3.1, OpenTracks supports custom dashboards for displaying previously recorded and live
|
As of v3.3.1, OpenTracks supports custom dashboards for displaying previously recorded and live
|
||||||
tracks.
|
tracks.
|
||||||
|
|
||||||
The reference implementation is [OSMDashboard](https://github.com/OpenTracksApp/OSMDashboard), which
|
The reference implementation is [OSMDashboard](https://codeberg.org/OpenTracksApp/OSMDashboard), which
|
||||||
presents an OpenStreetMap map (showing the current track, incl. updates). The Dashboard API is also
|
presents an OpenStreetMap map (showing the current track, incl. updates). The Dashboard API is also
|
||||||
used by [Gadgetbridge](https://codeberg.org/Freeyourgadget/Gadgetbridge/) for displaying live track
|
used by [Gadgetbridge](https://codeberg.org/Freeyourgadget/Gadgetbridge/) for displaying live track
|
||||||
statistics on supported wearables.
|
statistics on supported wearables.
|
||||||
|
|||||||
+1
-1
@@ -31,4 +31,4 @@ By using explicit Intents for the calls and URIs with specific temporary read pe
|
|||||||
|
|
||||||
All required information can be found in `IntentDashboardUtils.java`.
|
All required information can be found in `IntentDashboardUtils.java`.
|
||||||
|
|
||||||
A _reference implementation_ is the [OSMDashboard](https://github.com/OpenTracksApp/OSMDashboard).
|
A _reference implementation_ is the [OSMDashboard](https://codeberg.org/OpenTracksApp/OSMDashboard).
|
||||||
|
|||||||
+3
-3
@@ -3,10 +3,10 @@
|
|||||||
## Craft new releases
|
## Craft new releases
|
||||||
|
|
||||||
1. Execute use `RELEASE.sh`.
|
1. Execute use `RELEASE.sh`.
|
||||||
2. Push to Github
|
2. Push to Codeberg
|
||||||
3. Create release on Github (incl. changelog)
|
3. Create release on Codeberg (incl. changelog)
|
||||||
This actually creates a tag that is later used by F-Droid
|
This actually creates a tag that is later used by F-Droid
|
||||||
4. Pull from Github
|
4. Pull from Codeberg
|
||||||
5. Build reproducible release and attach to release
|
5. Build reproducible release and attach to release
|
||||||
6. ... wait until reproducibility is verified by F-Droid
|
6. ... wait until reproducibility is verified by F-Droid
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
* Amazfit Neo. But first you have to enable "Discoverable" and "Activity heart rate sharing" in the official Zepp app. (after pairing with OpenTracks you can disable them again)
|
* Amazfit Neo. But first you have to enable "Discoverable" and "Activity heart rate sharing" in the official Zepp app. (after pairing with OpenTracks you can disable them again)
|
||||||
* Garmin HRM-Dual (Reference: 010-12883-00)
|
* Garmin HRM-Dual (Reference: 010-12883-00)
|
||||||
* CYCPLUS H1
|
* CYCPLUS H1
|
||||||
|
* Mojawa Haptifit Terra - all you have to do is connect the app to device called "HT"
|
||||||
|
* Decathlon HRM Band
|
||||||
|
|
||||||
## 0x1816: Cycling Cadence and Speed Service
|
## 0x1816: Cycling Cadence and Speed Service
|
||||||
|
|
||||||
@@ -67,7 +69,7 @@ We do not support type of movement (i.e., walking vs running).
|
|||||||
Sadly, Bluetooth sensors providing _air pressure_ via Environmental Sensing Service seem to be very rare.
|
Sadly, Bluetooth sensors providing _air pressure_ via Environmental Sensing Service seem to be very rare.
|
||||||
|
|
||||||
* [Flybeeper Pressure Sensor](https://market.flybeeper.com/device/ps1)
|
* [Flybeeper Pressure Sensor](https://market.flybeeper.com/device/ps1)
|
||||||
* NoTrustIssues: https://github.com/OpenTracksApp/NoTrustIssues
|
* NoTrustIssues: https://codeberg.org/OpenTracksApp/NoTrustIssues
|
||||||
An Android app that exposes the internal barometer via Environmental Sensing Service.
|
An Android app that exposes the internal barometer via Environmental Sensing Service.
|
||||||
|
|
||||||
### Internal: tested Barometric Sensor Smartphones
|
### Internal: tested Barometric Sensor Smartphones
|
||||||
|
|||||||
+1
-1
@@ -48,4 +48,4 @@ read
|
|||||||
git add -u
|
git add -u
|
||||||
git commit -m "$COMMIT_MESSAGE"
|
git commit -m "$COMMIT_MESSAGE"
|
||||||
|
|
||||||
echo -e "Next steps:\n1. Push to Github\n2. Create release on Github: https://github.com/OpenTracksApp/OpenTracks/releases"
|
echo -e "Next steps:\n1. Push to Codeberg\n2. Create release on Codeberg: https://codeberg.org/OpenTracksApp/OpenTracks/releases"
|
||||||
+3
-3
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/
|
export JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64/
|
||||||
|
|
||||||
JAVA_VERSION=`java --version`
|
JAVA_VERSION=`java --version`
|
||||||
if [[ $JAVA_VERSION != "openjdk 17."* ]]; then
|
if [[ $JAVA_VERSION != "openjdk 21."* ]]; then
|
||||||
echo "OpenJDK version should be 17.X"
|
echo "OpenJDK version should be 21.X"
|
||||||
exit -1;
|
exit -1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
+17
-16
@@ -6,7 +6,7 @@ buildscript {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:8.10.1'
|
classpath 'com.android.tools.build:gradle:8.11.1'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,8 +46,8 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId 'de.dennisguse.opentracks'
|
applicationId 'de.dennisguse.opentracks'
|
||||||
versionCode 6180
|
versionCode 6407
|
||||||
versionName "v4.19.5"
|
versionName "v4.23.2"
|
||||||
|
|
||||||
buildConfigField "String", "VERSION_NAME_FULL", "\"${getVersionName()}\""
|
buildConfigField "String", "VERSION_NAME_FULL", "\"${getVersionName()}\""
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ android {
|
|||||||
versionNameSuffix 'irreproducible'
|
versionNameSuffix 'irreproducible'
|
||||||
}
|
}
|
||||||
reproducible {
|
reproducible {
|
||||||
// Developer Binaries: https://github.com/OpenTracksApp/OSMDashboard/releases/download/v%v/de.dennisguse.opentracks.playstore_%v.apk
|
// Developer Binaries: https://codeberg.org/OpenTracksApp/OSMDashboard/releases/download/v%v/de.dennisguse.opentracks.playstore_%v.apk
|
||||||
// FDroid: https://f-droid.org/de/packages/de.dennisguse.opentracks.playstore
|
// FDroid: https://f-droid.org/de/packages/de.dennisguse.opentracks.playstore
|
||||||
// PlayStore: https://play.google.com/store/apps/details?id=de.dennisguse.opentracks.playstore
|
// PlayStore: https://play.google.com/store/apps/details?id=de.dennisguse.opentracks.playstore
|
||||||
dimension 'version'
|
dimension 'version'
|
||||||
@@ -146,19 +146,20 @@ dependencies {
|
|||||||
implementation 'androidx.preference:preference:1.2.1'
|
implementation 'androidx.preference:preference:1.2.1'
|
||||||
implementation 'androidx.documentfile:documentfile:1.1.0'
|
implementation 'androidx.documentfile:documentfile:1.1.0'
|
||||||
implementation 'androidx.gridlayout:gridlayout:1.1.0'
|
implementation 'androidx.gridlayout:gridlayout:1.1.0'
|
||||||
implementation 'com.google.android.material:material:1.12.0'
|
implementation 'com.google.android.material:material:1.13.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
|
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
|
||||||
implementation 'androidx.core:core:1.16.0'
|
implementation 'androidx.core:core:1.17.0'
|
||||||
implementation 'androidx.core:core-splashscreen:1.0.1'
|
implementation 'androidx.core:core-splashscreen:1.2.0'
|
||||||
implementation 'androidx.mediarouter:mediarouter:1.8.0'
|
implementation 'androidx.mediarouter:mediarouter:1.8.1'
|
||||||
implementation 'androidx.core:core-location-altitude:1.0.0-alpha03'
|
implementation 'androidx.core:core-location-altitude:1.0.0-beta01'
|
||||||
|
implementation 'androidx.work:work-runtime:2.11.0'
|
||||||
|
|
||||||
androidTestImplementation 'androidx.test:core:1.6.1'
|
androidTestImplementation 'androidx.test:core:1.7.0'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
|
||||||
androidTestImplementation 'androidx.test:rules:1.6.1'
|
androidTestImplementation 'androidx.test:rules:1.7.0'
|
||||||
androidTestImplementation 'androidx.test:runner:1.6.2'
|
androidTestImplementation 'androidx.test:runner:1.7.0'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
|
||||||
androidTestImplementation 'org.mockito:mockito-android:5.18.0'
|
androidTestImplementation 'org.mockito:mockito-android:5.20.0'
|
||||||
|
|
||||||
androidTestUtil 'androidx.test:orchestrator:1.5.1'
|
androidTestUtil 'androidx.test:orchestrator:1.6.1'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,116 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="210mm"
|
|
||||||
height="297mm"
|
|
||||||
viewBox="0 0 210 297"
|
|
||||||
version="1.1"
|
|
||||||
id="svg8"
|
|
||||||
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
|
|
||||||
sodipodi:docname="ic_marker_orange_pushpin_with_shadow.svg">
|
|
||||||
<defs
|
|
||||||
id="defs2">
|
|
||||||
<linearGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
id="linearGradient871"
|
|
||||||
|
|
||||||
x1="91.712517"
|
|
||||||
y1="266.48581"
|
|
||||||
x2="95.902588"
|
|
||||||
y2="266.72339"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
gradientTransform="rotate(22.027833,208.46275,168.26892)"
|
|
||||||
|
|
||||||
|
|
||||||
>
|
|
||||||
<stop
|
|
||||||
style="stop-color:#ffffff;stop-opacity:1"
|
|
||||||
offset="0"
|
|
||||||
id="stop867" />
|
|
||||||
<stop
|
|
||||||
style="stop-color:#898d8d;stop-opacity:1"
|
|
||||||
offset="1"
|
|
||||||
id="stop869" />
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
<sodipodi:namedview
|
|
||||||
id="base"
|
|
||||||
pagecolor="#ffffff"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1.0"
|
|
||||||
inkscape:pageopacity="0.0"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:zoom="0.49497475"
|
|
||||||
inkscape:cx="298.98541"
|
|
||||||
inkscape:cy="561.0427"
|
|
||||||
inkscape:document-units="mm"
|
|
||||||
inkscape:current-layer="layer1"
|
|
||||||
inkscape:document-rotation="0"
|
|
||||||
showgrid="false"
|
|
||||||
inkscape:window-width="1920"
|
|
||||||
inkscape:window-height="1012"
|
|
||||||
inkscape:window-x="0"
|
|
||||||
inkscape:window-y="1080"
|
|
||||||
inkscape:window-maximized="1" />
|
|
||||||
<metadata
|
|
||||||
id="metadata5">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title></dc:title>
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
inkscape:label="Ebene 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1">
|
|
||||||
<path
|
|
||||||
d="m 108.52826,213.29755 a 56.035402,7.0061195 5.281088 0 0 -22.425508,2.5321 56.035402,7.0061195 5.281088 0 0 -0.233576,0.17697 l -0.206706,-0.0237 c -0.04471,0.11554 -0.07454,0.2314 -0.09612,0.34752 a 56.035402,7.0061195 5.281088 0 0 0.337963,1.58159 c 0.980726,1.70884 3.760629,3.46326 6.583579,5.2188 l -22.744347,15.50009 a 67.064653,11.556784 4.2275244 0 0 -39.967588,5.26867 67.064653,11.556784 4.2275244 0 0 -0.729154,0.57564 67.064653,11.556784 4.2275244 0 0 -2.754353,1.36358 67.064653,11.556784 4.2275244 0 0 38.908736,16.04324 l -32.176847,27.0646 52.228334,-24.74551 a 67.064653,11.556784 4.2275244 0 0 71.411147,-3.8186 67.064653,11.556784 4.2275244 0 0 0.72812,-0.57507 67.064653,11.556784 4.2275244 0 0 2.75539,-1.36415 67.064653,11.556784 4.2275244 0 0 -12.38374,-10.59818 40.033569,5.0733922 5.2502179 0 0 0.0563,-0.0369 40.033569,5.0733922 5.2502179 0 0 0.37672,-0.34325 l 22.45186,-15.30075 c 8.23597,-0.65161 17.65581,-1.47811 22.94433,-3.00957 a 56.035402,7.0061195 5.281088 0 0 2.65514,-1.03772 56.035402,7.0061195 5.281088 0 0 -46.08401,-12.26953 56.035402,7.0061195 5.281088 0 0 -41.6357,-2.54991 z"
|
|
||||||
style="fill:#333333;fill-opacity:0.49421525;stroke:#000000;stroke-width:0.138931px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.265501"
|
|
||||||
id="path839" />
|
|
||||||
<path
|
|
||||||
style="fill:url(#linearGradient871);fill-opacity:1;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.265501"
|
|
||||||
d="M 70.603317,174.30832 33.024148,288.94657 94.566672,183.19473 Z"
|
|
||||||
id="path865"
|
|
||||||
sodipodi:nodetypes="cccc" />
|
|
||||||
<ellipse
|
|
||||||
cx="144.42586"
|
|
||||||
cy="113.06232"
|
|
||||||
rx="70.318817"
|
|
||||||
ry="39.974442"
|
|
||||||
id="ellipse26"
|
|
||||||
style="fill:#d45500;fill-opacity:1;fill-rule:evenodd;stroke-width:0.264583"
|
|
||||||
transform="rotate(22.027833)" />
|
|
||||||
<ellipse
|
|
||||||
style="fill:#ff6600;fill-opacity:1;fill-rule:evenodd;stroke-width:0.264583"
|
|
||||||
id="ellipse30"
|
|
||||||
ry="39.974442"
|
|
||||||
rx="70.318817"
|
|
||||||
cy="105.23625"
|
|
||||||
cx="145.017"
|
|
||||||
transform="rotate(22.027833)" />
|
|
||||||
<path
|
|
||||||
id="rect28"
|
|
||||||
style="fill:#d45500;fill-opacity:1;fill-rule:evenodd;stroke-width:0.264583"
|
|
||||||
d="m 85.662408,24.322061 c -0.890996,8.350369 2.928035,17.133472 6.825491,25.923906 l -23.333902,57.672763 -0.730686,1.80598 0.248621,0.10059 a 42.43035,17.360788 22.027833 0 0 33.303948,30.10067 42.43035,17.360788 22.027833 0 0 44.86507,1.52585 l 0.13892,0.0562 0.24519,-0.60599 a 42.43035,17.360788 22.027833 0 0 0.59472,-1.15581 42.43035,17.360788 22.027833 0 0 0.37668,-1.24514 l 22.45185,-55.492655 c 9.28986,-2.66566 20.09069,-6.13552 24.76397,-13.17485 z" />
|
|
||||||
<ellipse
|
|
||||||
style="fill:#ff6600;fill-opacity:1;fill-rule:evenodd;stroke-width:0.264583"
|
|
||||||
id="path24"
|
|
||||||
ry="23.966745"
|
|
||||||
rx="59.409279"
|
|
||||||
cy="-10.262156"
|
|
||||||
cx="148.14029"
|
|
||||||
transform="rotate(22.027833)" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 5.0 KiB |
@@ -0,0 +1,5 @@
|
|||||||
|
v4.19.5: OpenTracks
|
||||||
|
|
||||||
|
Oprava chyby:
|
||||||
|
- Ikona v launcheru byla někdy příliš malá
|
||||||
|
- Ikona trasy v podrobnostech používá lokalizovaný typ aktivity
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
v4.19.6: OpenTracks
|
||||||
|
|
||||||
|
Změny:
|
||||||
|
- Podpora edge-to-edge by nyní měla fungovat na všech verzích systému Android
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
v4.20.0: OpenTracks
|
||||||
|
|
||||||
|
Změny:
|
||||||
|
- Umožnění změny časového pásma stop
|
||||||
|
- Zjednodušené rozhraní značek
|
||||||
|
|
||||||
|
Oprava chyby:
|
||||||
|
- Edge-2-edge: reakce na virtuální klávesnici
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
v4.21.0: OpenTracks
|
||||||
|
|
||||||
|
Změny:
|
||||||
|
- Seznam stop podporuje posunutí pro odstranění
|
||||||
|
- Reimplementovány motivy (pro dynamické barvy a OLED)
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
v4.21.1: OpenTracks
|
||||||
|
|
||||||
|
Oprava chyby:
|
||||||
|
- Opraven pád v rozhraní exportu/importu (vznikl ve v4.21.0)
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
v4.22.0: OpenTracks
|
||||||
|
|
||||||
|
Změny:
|
||||||
|
- Přesun na https://codeberg.org/OpenTracksApp/OpenTracks
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
v4.23.0: OpenTracks
|
||||||
|
|
||||||
|
Änderungen:
|
||||||
|
- Benutzeroberfläche: Durchschnittsgeschwindigkeit des aktuellen Segments hinzugefügt
|
||||||
|
(derzeit nur in neuen Layouts verfügbar)
|
||||||
|
- Durch Klicken auf die Benachrichtigung wird die eigentliche Aufzeichnungs-Benutzeroberfläche geöffnet
|
||||||
|
|
||||||
|
Entwickler:
|
||||||
|
- Veralteter JobIntentService durch WorkManager ersetzt
|
||||||
|
- Verwende .isEmpty() außer für CharSequence und Stream.toList()
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
v4.23.1: OpenTracks
|
||||||
|
|
||||||
|
Änderungen:
|
||||||
|
|
||||||
|
- Neue UI-Komponente zur Anzeige der verstrichenen Zeit im aktuellen Segment
|
||||||
|
|
||||||
|
Fehlerbehebung:
|
||||||
|
- Sofortiger Export nach Workout abgestürzt (eingeführt in v4.23.0)
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
v4.19.6: OpenTracks
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
- Edge-2-edge should now be working on all Android versions
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
v4.20.0: OpenTracks
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
- Allow to change timezone offset of tracks
|
||||||
|
- Simplified Marker UI
|
||||||
|
|
||||||
|
Bugfix:
|
||||||
|
- Edge-2-edge: react to virtual keyboard
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
v4.21.0: OpenTracks
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
- Track list supports swipe-to-delete
|
||||||
|
- Re-implemented themes (for DynamicColor and OLED)
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
v4.21.1: OpenTracks
|
||||||
|
|
||||||
|
Bugfix:
|
||||||
|
- Fixed crash on export/import UI (introduced in v4.21.0)
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
v4.22.0: OpenTracks
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
- Migration to https://codeberg.org/OpenTracksApp/OpenTracks
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
v4.22.1: OpenTracks
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
- First release via Codeberg
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
v4.22.2: OpenTracks
|
||||||
|
|
||||||
|
Bugfix:
|
||||||
|
- Voice annoucements setting for time and unit were linked
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
v4.23.0: OpenTracks
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
- UI: added average pace of current segment
|
||||||
|
(currently only available in new layouts)
|
||||||
|
- Clicking on notification opens actual recording UI
|
||||||
|
|
||||||
|
Developer:
|
||||||
|
- Deprecated JobIntentService replaced with WorkManager
|
||||||
|
- Use .isEmpty() except for CharSequence and Stream.toList()
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
v4.23.1: OpenTracks
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
- New UI component to show elapsed time in the current segment
|
||||||
|
|
||||||
|
Bugfix:
|
||||||
|
- Instant post-workout export crashed (introduced in v4.23.0)
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
v4.23.2: OpenTracks
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
- Predictive back works completely
|
||||||
|
|
||||||
|
Bugfix:
|
||||||
|
- Fixed in crash related to the track filename in the settings
|
||||||
|
|
||||||
|
Developer:
|
||||||
|
- Introduced data class for Statistics
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
v4.19.5: OpenTracks
|
||||||
|
|
||||||
|
Ceartú fabht:
|
||||||
|
- Taispeánadh deilbhín an lainseálaí róbheag uaireanta
|
||||||
|
- Deilbhín an rianaithe ar an leathanach sonraí ag baint úsáide as cineál gníomhaíochta logánaithe
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
v4.19.6: OpenTracks
|
||||||
|
|
||||||
|
Athruithe:
|
||||||
|
- Ba chóir go mbeadh Edge-2-edge ag obair anois ar gach leagan de Android
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
v4.20.0: OpenTracks
|
||||||
|
|
||||||
|
Athruithe:
|
||||||
|
- Ceadaítear athrú ar fhritháireamh crios ama rianta
|
||||||
|
- Comhéadan Úsáideora Marcóra Simplithe
|
||||||
|
|
||||||
|
Ceartú:
|
||||||
|
- Imeall-2-imeall: imoibríonn le méarchlár fíorúil
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
v4.21.0: OpenTracks
|
||||||
|
|
||||||
|
Athruithe:
|
||||||
|
- Tacaíonn liosta na rianta le svaidhpeáil chun scriosadh
|
||||||
|
- Téamaí athchurtha i bhfeidhm (do DynamicColor agus OLED)
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
v4.21.1: OpenTracks
|
||||||
|
|
||||||
|
Ceartú fabht:
|
||||||
|
- Tuairteáil socraithe ar chomhéadan úsáideora easpórtála/allmhairithe (tugtha isteach i v4.21.0)
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
v4.22.0: OpenTracks
|
||||||
|
|
||||||
|
Athruithe:
|
||||||
|
- Aistriú go https://codeberg.org/OpenTracksApp/OpenTracks
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
v4.22.0: OpenTracks
|
||||||
|
|
||||||
|
Modifiche:
|
||||||
|
- Migrazione a https://codeberg.org/OpenTracksApp/OpenTracks
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
v4.22.1: OpenTracks
|
||||||
|
|
||||||
|
Modiciche:
|
||||||
|
- Primo rilascio da Codeberg
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
v4.22.2: OpenTracks
|
||||||
|
|
||||||
|
Correzione di errori:
|
||||||
|
- L'impostazione degli annunci vocali per l'ora e l'unità di misura è stata collegata
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
(versionName): OpenTracks
|
||||||
|
|
||||||
|
Modifiche:
|
||||||
|
-
|
||||||
|
|
||||||
|
Correzioni di errori:
|
||||||
|
-
|
||||||
|
|
||||||
|
Sviluppatore:
|
||||||
|
-
|
||||||
@@ -19,4 +19,4 @@ v3.12.0: ஓபன்ட்ராக்ச்
|
|||||||
|
|
||||||
டெவலப்பர்:
|
டெவலப்பர்:
|
||||||
- வியூ பிண்டிங்சைப் பயன்படுத்துங்கள்
|
- வியூ பிண்டிங்சைப் பயன்படுத்துங்கள்
|
||||||
- தரவுத்தளம் வெளிநாட்டு விசையை செயல்படுத்துகிறது மற்றும் அடுக்கு நீக்குதல்களைப் பயன்படுத்துகிறது
|
- தரவுத்தளம் வெளிநாட்டு விசையைச் செயல்படுத்துகிறது மற்றும் அடுக்கு நீக்குதல்களைப் பயன்படுத்துகிறது
|
||||||
|
|||||||
@@ -2,19 +2,19 @@ v3.15.0: ஓபன்ட்ராக்ச்
|
|||||||
|
|
||||||
எச்சரிக்கை:
|
எச்சரிக்கை:
|
||||||
இந்த வெளியீடு மாற்ற முடியாத தரவுத்தள மாற்றங்களைப் பயன்படுத்துகிறது.
|
இந்த வெளியீடு மாற்ற முடியாத தரவுத்தள மாற்றங்களைப் பயன்படுத்துகிறது.
|
||||||
KMZ/KML ஏற்றுமதி/இறக்குமதி நடத்தை மாற்றப்படுவதால், (அ) மேம்படுத்துவதற்கு முன் காப்புப்பிரதி எடுக்க பரிந்துரைக்கப்படுகிறது, பின்னர் (ஆ).
|
KMZ/KML ஏற்றுமதி/இறக்குமதி நடத்தை மாற்றப்படுவதால், (அ) மேம்படுத்துவதற்கு முன் காப்புப்பிரதி எடுக்கப் பரிந்துரைக்கப்படுகிறது, பின்னர் (ஆ).
|
||||||
பரிந்துரைக்கப்பட்ட வடிவம்: KMZ.
|
பரிந்துரைக்கப்பட்ட வடிவம்: KMZ.
|
||||||
|
|
||||||
மாற்றங்களை உடைத்தல்:
|
மாற்றங்களை உடைத்தல்:
|
||||||
- டிராக் பிரிவுகளின் உள் சேமிப்பு மாற்றப்பட்டுள்ளது
|
- டிராக் பிரிவுகளின் உள் சேமிப்பு மாற்றப்பட்டுள்ளது
|
||||||
(பயனர் உருவாக்கிய நிகழ்வுகள் இப்போது இடம் இல்லாமல் டிராக் பாயிண்டுகளாகக் கருதப்படுகின்றன, ஆனால் நேர முத்திரையுடன்)
|
(பயனர் உருவாக்கிய நிகழ்வுகள் இப்போது இடம் இல்லாமல் டிராக் பாயிண்டுகளாகக் கருதப்படுகின்றன, ஆனால் நேர முத்திரையுடன்)
|
||||||
- சி.பி.எச் நேரத்திற்கு பதிலாக சாதன நேரம் சேமிக்கப்படுகிறது
|
- சி.பி.எச் நேரத்திற்கு பதிலாகச் சாதன நேரம் சேமிக்கப்படுகிறது
|
||||||
(இருக்கும் தரவு மாற்றியமைக்கப்படவில்லை)
|
(இருக்கும் தரவு மாற்றியமைக்கப்படவில்லை)
|
||||||
- டாச்போர்டு பநிஇ வி 2
|
- டாச்போர்டு பநிஇ வி 2
|
||||||
(தயவுசெய்து OSMDashboard 2.10.0 ஐ மேம்படுத்தவும்)
|
(தயவுசெய்து OSMDashboard 2.10.0 ஐ மேம்படுத்தவும்)
|
||||||
|
|
||||||
மாற்றங்கள்:
|
மாற்றங்கள்:
|
||||||
.
|
- KML/KMZ சரியாக காப்புப் பிரதி எடுக்கவும் மீட்டமைக்கவும் பயன்படுத்தலாம் (புள்ளிவிவரங்கள் உட்பட)
|
||||||
|
|
||||||
டெவலப்பர்:
|
டெவலப்பர்:
|
||||||
- மறுவேலை செய்யப்பட்ட தட பிரிவு மற்றும் அது சேமிப்பு (முன்னர் இடைநிறுத்தம்/மீண்டும் மார்க்கர்)
|
- மறுவேலை செய்யப்பட்ட தட பிரிவு மற்றும் அது சேமிப்பு (முன்னர் இடைநிறுத்தம்/மீண்டும் மார்க்கர்)
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ v3.16.0: ஓபன்ட்ராக்ச்
|
|||||||
- சைக்கிள் ஓட்டுதல்: பி.எல்.இ வேக சென்சாரிலிருந்து தூரத்தைப் பெறுங்கள்
|
- சைக்கிள் ஓட்டுதல்: பி.எல்.இ வேக சென்சாரிலிருந்து தூரத்தைப் பெறுங்கள்
|
||||||
- பதிவு செய்யும்போது வழங்கப்பட்ட இடைமுகம் மறுவேலை
|
- பதிவு செய்யும்போது வழங்கப்பட்ட இடைமுகம் மறுவேலை
|
||||||
- இடைமுகம் செயல்திறன் மேம்படுத்தல்கள்
|
- இடைமுகம் செயல்திறன் மேம்படுத்தல்கள்
|
||||||
- ஏற்றுமதி செய்யப்பட்ட கோப்பு பெயர்கள்: <முதல் 32bits uuid> _ <டிராக்கின் பெயர்>
|
- ஏற்றுமதி செய்யப்பட்ட கோப்புப் பெயர்கள்: <முதல் 32bits uuid> _ <டிராக்கின் பெயர்>
|
||||||
- பல கோப்புகளை நோக்கம் வழியாக இறக்குமதி செய்யுங்கள் (எ.கா., கேசெட் பிரிட்சிலிருந்து)
|
- பல கோப்புகளை நோக்கம் வழியாக இறக்குமதி செய்யுங்கள் (எ.கா., கேசெட் பிரிட்சிலிருந்து)
|
||||||
- சி.பி.எக்ச்: ஏற்றுமதி ஆற்றல் தரவு
|
- சி.பி.எக்ச்: ஏற்றுமதி ஆற்றல் தரவு
|
||||||
- புதுப்பிக்கப்பட்ட மொழிபெயர்ப்புகள்
|
- புதுப்பிக்கப்பட்ட மொழிபெயர்ப்புகள்
|
||||||
|
|
||||||
பிழைத்திருத்த:
|
பிழைத்திருத்த:
|
||||||
- குரல் அறிவிப்பு நிமிடங்களை சரியாகப் பயன்படுத்துங்கள்
|
- குரல் அறிவிப்பு நிமிடங்களைச் சரியாகப் பயன்படுத்துங்கள்
|
||||||
|
|||||||
@@ -2,16 +2,16 @@ v3.17.0: Opentracks
|
|||||||
|
|
||||||
மாற்றங்கள்:
|
மாற்றங்கள்:
|
||||||
- கயாக்கிங்கிற்கு ஐகானைச் சேர்க்கவும்
|
- கயாக்கிங்கிற்கு ஐகானைச் சேர்க்கவும்
|
||||||
- விளக்கப்படங்கள் காணாமல் போன சென்சார் தரவை சரியாக வரையவும்
|
- விளக்கப்படங்கள் காணாமல் போன சென்சார் தரவைச் சரியாக வரையவும்
|
||||||
- இயல்புநிலை: பதிவு செய்யும்போது ஆயத்தொலைவுகளைக் காட்டு
|
- இயல்புநிலை: பதிவு செய்யும்போது ஆயத்தொலைவுகளைக் காட்டு
|
||||||
|
|
||||||
பிழைத்திருத்தங்கள்:
|
பிழைத்திருத்தங்கள்:
|
||||||
- சிபிஎக்ச் ச்கீமா சரி செய்யப்பட்டது
|
- சிபிஎக்ச் ச்கீமா சரி செய்யப்பட்டது
|
||||||
- சிபிஎக்ச் உயரத்தை சென்சார் தூரமாக ஏற்றுமதி செய்தது
|
- சிபிஎக்ச் உயரத்தை சென்சார் தூரமாக ஏற்றுமதி செய்தது
|
||||||
- வேகம்/தூர சென்சார் பயன்படுத்தினால் புள்ளிவிவரங்கள் சரியாக கணக்கிடப்படவில்லை
|
- வேகம்/தூர சென்சார் பயன்படுத்தினால் புள்ளிவிவரங்கள் சரியாகக் கணக்கிடப்படவில்லை
|
||||||
|
|
||||||
டெவலப்பர்:
|
டெவலப்பர்:
|
||||||
- தூரம்/வேக மதிப்பு பொருள்கள்
|
- தூரம்/வேக மதிப்புப் பொருள்கள்
|
||||||
- பகிர்வு முன்னேற்றங்கள் வழியாக தகவல்தொடர்புகளை மாற்றியது
|
- பகிர்வு முன்னேற்றங்கள் வழியாகத் தகவல்தொடர்புகளை மாற்றியது
|
||||||
- நிலையான அல்லாத பணி பைண்டரைப் பயன்படுத்தவும்
|
- நிலையான அல்லாத பணி பைண்டரைப் பயன்படுத்தவும்
|
||||||
- குறியீடு தளத்தில் உயரத்தைப் பயன்படுத்தவும் (உயரத்திற்கு பதிலாக)
|
- குறியீடு தளத்தில் உயரத்தைப் பயன்படுத்தவும் (உயரத்திற்கு பதிலாக)
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
v3.18.0: ஓபன்ட்ராக்ச்
|
v3.18.0: ஓபன்ட்ராக்ச்
|
||||||
|
|
||||||
மாற்றங்கள்:
|
மாற்றங்கள்:
|
||||||
- உயரம் EGM2008 இல் காட்டப்பட்டுள்ளது (WGS84 என சேமிக்கப்படுகிறது/ஏற்றுமதி செய்யப்படுகிறது)
|
- உயரம் EGM2008 இல் காட்டப்பட்டுள்ளது (WGS84 எனச் சேமிக்கப்படுகிறது/ஏற்றுமதி செய்யப்படுகிறது)
|
||||||
|
|
||||||
பிழைத்திருத்த:
|
பிழைத்திருத்த:
|
||||||
- நிலையான நினைவக கசிவு (V3.17.0 இல் அறிமுகப்படுத்தப்பட்டது)
|
- நிலையான நினைவக கசிவு (V3.17.0 இல் அறிமுகப்படுத்தப்பட்டது)
|
||||||
- விளக்கப்படங்கள்: உயரம் M/ft இல் இருக்க வேண்டும் (V3.17.1 இல் அறிமுகப்படுத்தப்பட்டது)
|
- விளக்கப்படங்கள்: உயரம் M/ft இல் இருக்க வேண்டும் (V3.17.1 இல் அறிமுகப்படுத்தப்பட்டது)
|
||||||
- விளக்கப்படங்கள்: பதிவு சரியாக புதுப்பிக்கப்படவில்லை (V3.17.3 இல் அறிமுகப்படுத்தப்பட்டது)
|
- விளக்கப்படங்கள்: பதிவு சரியாகப் புதுப்பிக்கப்படவில்லை (V3.17.3 இல் அறிமுகப்படுத்தப்பட்டது)
|
||||||
.
|
- TrackDataHub பதிவுசெய்தல் தொலைநிலை இடைவெளியைக் கணக்கில் எடுத்துக்கொள்ளவில்லை (v3.17.2 இல் அறிமுகப்படுத்தப்பட்டது)
|
||||||
|
|
||||||
டெவலப்பர்:
|
டெவலப்பர்:
|
||||||
- பி.என்.சி க்ரஞ்சிங் முடக்கு (இனப்பெருக்கம் உருவாக்க)
|
- பி.என்.சி க்ரஞ்சிங் முடக்கு (இனப்பெருக்கம் உருவாக்க)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
v3.18.6: Opentracks
|
v3.18.6: Opentracks
|
||||||
|
|
||||||
மாற்றங்கள்:
|
மாற்றங்கள்:
|
||||||
- "வரைபடத்தில் காட்டு"- KMZ க்கு பதிலாக KML வழியாக செயல்பாடு
|
- "வரைபடத்தில் காட்டு"- KMZ க்கு பதிலாக KML வழியாகச் செயல்பாடு
|
||||||
- குரல் அறிவிப்பில் பயன்பாட்டு பெயர் இல்லை
|
- குரல் அறிவிப்பில் பயன்பாட்டு பெயர் இல்லை
|
||||||
- பதிவு செய்யும்போது: ஒவ்வொரு நொடியும் உயர ஆதாயம்/இழப்பு புதுப்பிக்கப்படும்
|
- பதிவு செய்யும்போது: ஒவ்வொரு நொடியும் உயர ஆதாயம்/இழப்பு புதுப்பிக்கப்படும்
|
||||||
- கடை விளக்கங்கள் மொழிபெயர்க்கப்பட்டவை
|
- கடை விளக்கங்கள் மொழிபெயர்க்கப்பட்டவை
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ v3.19.0: Opentracks
|
|||||||
|
|
||||||
மாற்றங்கள்:
|
மாற்றங்கள்:
|
||||||
- இயங்கும் விரைவு மற்றும் கேடென்ச் (ஆர்.சி.எச்) சென்சார்களுக்கான உதவி செயல்படுத்தப்பட்டது
|
- இயங்கும் விரைவு மற்றும் கேடென்ச் (ஆர்.சி.எச்) சென்சார்களுக்கான உதவி செயல்படுத்தப்பட்டது
|
||||||
- ஒரு பாதையைப் பகிரும்போது: ஒரு பங்கு படம் உருவாக்கப்பட்டது
|
- ஒரு பாதையைப் பகிரும்போது: ஒரு பங்குப் படம் உருவாக்கப்பட்டது
|
||||||
- பதிவைத் தொடங்கும்போது அதிர்வு இல்லை
|
- பதிவைத் தொடங்கும்போது அதிர்வு இல்லை
|
||||||
- பதிவு செய்யும்போது: இடைமுகம் மிக அண்மைக் காலத்தில் பெறப்பட்ட உயரம், விரைவு மற்றும் தாங்கி (சேமிக்கப்படாவிட்டாலும் கூட) காட்டுகிறது
|
- பதிவு செய்யும்போது: இடைமுகம் மிக அண்மைக் காலத்தில் பெறப்பட்ட உயரம், விரைவு மற்றும் தாங்கி (சேமிக்கப்படாவிட்டாலும் கூட) காட்டுகிறது
|
||||||
|
|
||||||
@@ -12,5 +12,5 @@ v3.19.0: Opentracks
|
|||||||
|
|
||||||
டெவலப்பர்:
|
டெவலப்பர்:
|
||||||
- SDK31 மற்றும் AGP7.0.0 க்கு மேம்படுத்தவும் (JDK11 தேவை)
|
- SDK31 மற்றும் AGP7.0.0 க்கு மேம்படுத்தவும் (JDK11 தேவை)
|
||||||
.
|
- டிராக் ரெக்கார்டிங் சேவை: எக்ஸ்டாக்டட் சென்சார் ஃப்யூஷன் (டிராக்பாயிண்ட் கிரியேட்டர்) மற்றும் டிராக்பாயிண்ட் ஸ்டோரேஜ் (டிராக் ரெக்கார்டிங் மேனேஜர்)
|
||||||
- எக்ச்போர்ட்டிம்போர்ட்டெச்ட் இப்போது தீர்மானிக்கும்/ மாறிலி
|
- எக்ச்போர்ட்டிம்போர்ட்டெச்ட் இப்போது தீர்மானிக்கும்/ மாறிலி
|
||||||
|
|||||||
@@ -6,6 +6,6 @@ v3.20.2: ஓபன்ட்ராக்ச்
|
|||||||
|
|
||||||
பிழைத்திருத்த:
|
பிழைத்திருத்த:
|
||||||
- ஆண்ட்ராய்டு 12 இல் செயலிழப்பதைத் தவிர்ப்பதற்கு நிலுவைத் தொகைக்கு கொடி_இம் செய்யக்கூடியதாக அமைக்கவும்
|
- ஆண்ட்ராய்டு 12 இல் செயலிழப்பதைத் தவிர்ப்பதற்கு நிலுவைத் தொகைக்கு கொடி_இம் செய்யக்கூடியதாக அமைக்கவும்
|
||||||
- பயனர் பெடலிங் செய்யாதபோது எதற்கும் பதிலாக காடென்ச் சென்சார் 0 ஐ வழங்குகிறது
|
- பயனர் பெடலிங் செய்யாதபோது எதற்கும் பதிலாகக் காடென்ச் சென்சார் 0 ஐ வழங்குகிறது
|
||||||
- வேக சென்சார் நிறுத்தப்படும்போது கடைசி வேகத்திற்கு பதிலாக 0 ஐ வழங்குகிறது
|
- வேக சென்சார் நிறுத்தப்படும்போது கடைசி வேகத்திற்கு பதிலாக 0 ஐ வழங்குகிறது
|
||||||
- சென்சார்களுடன், நகரும் நேரம் நகரும்போது நிறுத்தப்படும்
|
- சென்சார்களுடன், நகரும் நேரம் நகரும்போது நிறுத்தப்படும்
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
v3.21.0: Opentracks
|
v3.21.0: Opentracks
|
||||||
|
|
||||||
மாற்றங்கள்:
|
மாற்றங்கள்:
|
||||||
- பதிவு செய்யும் போது: டிராக் பாயிண்டுகளின் செயலற்ற/செயலற்ற அல்லாத உருவாக்கத்தை அகற்று
|
- பதிவு செய்யும்போது: டிராக் பாயிண்டுகளின் செயலற்ற அல்லாத உருவாக்கத்தை அகற்று
|
||||||
- அமைப்புகள் இப்போது தனி கோப்புறைகளில் உள்ளன
|
- அமைப்புகள் இப்போது தனி கோப்புறைகளில் உள்ளன
|
||||||
.
|
- அறிவிப்பிலிருந்து OpenTracks ஐத் திறந்து (பதிவு செய்யும்போது) மீண்டும் அழுத்தினால் டிராக் பட்டியல் திறக்கும்.
|
||||||
- GPX compatibilty: support <speed> க்கு import
|
- GPX compatibilty: support <speed> க்கு import
|
||||||
|
|
||||||
பிழைத்திருத்தங்கள்:
|
பிழைத்திருத்தங்கள்:
|
||||||
- உயரம் மற்றும் தூரம் (பி.எல்.இ சென்சாரிலிருந்து): தரவு உண்மையில் சேமிக்கப்பட்டிருந்தால் மட்டுமே கவுண்டர்களை மீட்டமைக்கவும்
|
- உயரம் மற்றும் தூரம் (பி.எல்.இ சென்சாரிலிருந்து): தரவு உண்மையில் சேமிக்கப்பட்டிருந்தால் மட்டுமே கவுண்டர்களை மீட்டமைக்கவும்
|
||||||
- விரைவு இல்லாமல் இறக்குமதி செய்ய, கணினி விரைவு தேவை
|
- விரைவு இல்லாமல் இறக்குமதி செய்ய, கணினி விரைவு தேவை
|
||||||
- ப்ளூ இயங்கும் சென்சார் இணைக்கப்படவில்லை, தற்போது போல புகாரளிக்கக்கூடாது
|
- ப்ளூ இயங்கும் சென்சார் இணைக்கப்படவில்லை, தற்போது போலப் புகாரளிக்கக் கூடாது
|
||||||
- BLE இயங்கும் சென்சார்: பதிவு செய்யும்போது தரவைக் காட்டு
|
- BLE இயங்கும் சென்சார்: பதிவு செய்யும்போது தரவைக் காட்டு
|
||||||
- செயல்பாட்டை மாற்றும்போது செயல்பாட்டு வகை படவுரு புதுப்பிக்கப்படவில்லை
|
- செயல்பாட்டை மாற்றும்போது செயல்பாட்டு வகை படவுரு புதுப்பிக்கப்படவில்லை
|
||||||
|
|
||||||
டெவலப்பர்:
|
டெவலப்பர்:
|
||||||
- நிலையான குறிப்பு வழியாக பகிரப்பட்டவை
|
- நிலையான குறிப்பு வழியாகப் பகிரப்பட்டவை
|
||||||
- நினைவக தரவுத்தளத்திற்கு எதிராக சோதனைகள் செயல்படுத்தப்படுகின்றன
|
- நினைவக தரவுத்தளத்திற்கு எதிராகச் சோதனைகள் செயல்படுத்தப்படுகின்றன
|
||||||
- ட்ராக் ரெக்கார்டிங்மேனேசர் கடைசி ட்ராக் பாயிண்ட்டை நினைவகத்தில் வைத்திருக்கிறது
|
- ட்ராக் ரெக்கார்டிங்மேனேசர் கடைசி ட்ராக் பாயிண்ட்டை நினைவகத்தில் வைத்திருக்கிறது
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ V3.22.0: Opentracks
|
|||||||
|
|
||||||
மாற்றங்கள்:
|
மாற்றங்கள்:
|
||||||
- பயணம் செய்தால் மட்டுமே இடங்கள் சேமிக்கப்படும்> தூர இடைவெளியைப் பதிவுசெய்க
|
- பயணம் செய்தால் மட்டுமே இடங்கள் சேமிக்கப்படும்> தூர இடைவெளியைப் பதிவுசெய்க
|
||||||
(செயலற்ற/செயலற்ற கண்டறிதலில் இருந்து செயல்பாட்டுக்கு மேல் அகற்றப்பட்டது)
|
(செயலற்ற கண்டறிதலிலிருந்து செயல்பாட்டுக்கு மேல் அகற்றப்பட்டது)
|
||||||
- ஒரு கடிகாரத்தைக் காட்ட இடைமுகம் ஐ கட்டமைக்க முடியும்
|
- ஒரு கடிகாரத்தைக் காட்ட இடைமுகம் ஐ கட்டமைக்க முடியும்
|
||||||
- செயலற்ற விரைவு இப்போது கட்டமைக்கப்படுகிறது
|
- செயலற்ற விரைவு இப்போது கட்டமைக்கப்படுகிறது
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ v3.23.0: Opentracks
|
|||||||
மாற்றங்கள்:
|
மாற்றங்கள்:
|
||||||
- இடைமுகம் சுயவிவரங்கள் சேர்க்கப்பட்டன
|
- இடைமுகம் சுயவிவரங்கள் சேர்க்கப்பட்டன
|
||||||
- தேர்ந்தெடுக்கப்பட்ட தடங்களுக்கான ஒருங்கிணைந்த புள்ளிவிவரங்கள்
|
- தேர்ந்தெடுக்கப்பட்ட தடங்களுக்கான ஒருங்கிணைந்த புள்ளிவிவரங்கள்
|
||||||
-நகரும் நேரம் வேலை செய்வதை நிறுத்துவதால் மீண்டும் செயல்படுத்தப்பட்ட செயலற்ற/செயலற்ற டிராக் பாயிண்ட்ச் (V3.22.0 இல் அறிமுகப்படுத்தப்பட்டது)
|
-நகரும் நேரம் வேலை செய்வதை நிறுத்துவதால் மீண்டும் செயல்படுத்தப்பட்ட செயலற்ற டிராக் பாயிண்ட்ச் (V3.22.0 இல் அறிமுகப்படுத்தப்பட்டது)
|
||||||
|
|
||||||
பிழைத்திருத்தங்கள்:
|
பிழைத்திருத்தங்கள்:
|
||||||
- பி.எல்.இ சென்சார்கள்: துண்டிக்கப்படுவதற்கான தரவை அழிக்கவும்
|
- பி.எல்.இ சென்சார்கள்: துண்டிக்கப்படுவதற்கான தரவை அழிக்கவும்
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ v3.24.0: Opentracks
|
|||||||
மாற்றங்கள்:
|
மாற்றங்கள்:
|
||||||
- சி.பி.எச் விருப்பமானது (உட்புற பயன்பாட்டிற்கும்): தூரத்தை வழங்கும் பி.எல்.இ சென்சார்களைப் பயன்படுத்தினால் பயன்படுத்தப்பட்டால்
|
- சி.பி.எச் விருப்பமானது (உட்புற பயன்பாட்டிற்கும்): தூரத்தை வழங்கும் பி.எல்.இ சென்சார்களைப் பயன்படுத்தினால் பயன்படுத்தப்பட்டால்
|
||||||
- அமைப்புகள்: சாதனங்களின் BLE வடிகட்டலை முடக்க விருப்பம்
|
- அமைப்புகள்: சாதனங்களின் BLE வடிகட்டலை முடக்க விருப்பம்
|
||||||
- விளக்கப்படங்கள்: உயரம் 0M க்கு பதிலாக குறைந்தபட்ச மதிப்பில் தொடங்குகிறது.
|
- விளக்கப்படங்கள்: உயரம் 0M க்கு பதிலாகக் குறைந்தபட்ச மதிப்பில் தொடங்குகிறது.
|
||||||
- சேமிக்கப்பட்ட நேர மண்டல தகவல்களைக் காண்பிப்பதை இடைமுகம் ஆதரிக்கிறது
|
- சேமிக்கப்பட்ட நேர மண்டல தகவல்களைக் காண்பிப்பதை இடைமுகம் ஆதரிக்கிறது
|
||||||
|
|
||||||
பிழைத்திருத்த:
|
பிழைத்திருத்த:
|
||||||
- கடிகாரம் சரியான நேரத்தில் பயணித்ததால் விபத்துக்கான மறு சேர்க்கப்பட்ட பணித்தொகுப்பு (V3.23.0 இல் பணித்தொகுப்பு அகற்றப்பட்டது)
|
- கடிகாரம் சரியான நேரத்தில் பயணித்ததால் விபத்துக்கான மறு சேர்க்கப்பட்ட பணித்தொகுப்பு (V3.23.0 இல் பணித்தொகுப்பு அகற்றப்பட்டது)
|
||||||
- பி.எல்.இ சைக்கிள் ஓட்டுதல் சென்சார் (ஆர்.டி.எஃப்.எம்) க்கான தேவையற்ற பணித்தொகுப்பு அகற்றப்பட்டது
|
- பி.எல்.இ சைக்கிள் ஓட்டுதல் சென்சார் (ஆர்.டி.எஃப்.எம்) க்கான தேவையற்ற பணித்தொகுப்பு அகற்றப்பட்டது
|
||||||
- காணாமல் போன தரவை சிபிஎக்ச் இறக்குமதியாளர் சரியாக கையாளவில்லை
|
- காணாமல் போன தரவை சிபிஎக்ச் இறக்குமதியாளர் சரியாகக் கையாளவில்லை
|
||||||
|
|
||||||
டெவலப்பர்:
|
டெவலப்பர்:
|
||||||
-BLE சென்சார்கள் புல் அடிப்படையிலானதை விட தரவு நிகழ்வு-இயக்கப்படும் என்று தெரிவிக்கின்றன
|
-BLE சென்சார்கள் புல் அடிப்படையிலானதை விடத் தரவு நிகழ்வு-இயக்கப்படும் என்று தெரிவிக்கின்றன
|
||||||
- பதிவு செய்வதற்கான ஒருங்கிணைப்பு சோதனைகளை மறுவேலை செய்து சேர்த்தது
|
- பதிவு செய்வதற்கான ஒருங்கிணைப்பு சோதனைகளை மறுவேலை செய்து சேர்த்தது
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ v4.0.0: Opentracks
|
|||||||
|
|
||||||
மாற்றங்கள்:
|
மாற்றங்கள்:
|
||||||
- கீழ் பயன்பாட்டு பட்டியுடன் இடைமுகம் மறுசீரமைப்பு.
|
- கீழ் பயன்பாட்டு பட்டியுடன் இடைமுகம் மறுசீரமைப்பு.
|
||||||
- பொது ஏபிஐ: சரியாக செயல்படுத்தப்பட்டது.
|
- பொது ஏபிஐ: சரியாகச் செயல்படுத்தப்பட்டது.
|
||||||
- தூய்மைப்படுத்துதல்: ட்ராக்ஃபைல்ஃபார்மட்டுக்கு வெளிப்படையான விருப்பத்தேர்வுகளைப் பயன்படுத்தவும்.
|
- தூய்மைப்படுத்துதல்: ட்ராக்ஃபைல்ஃபார்மட்டுக்கு வெளிப்படையான விருப்பத்தேர்வுகளைப் பயன்படுத்தவும்.
|
||||||
- BLE ஏண்ட்லரில் மேம்பாடுகள்.
|
- BLE ஏண்ட்லரில் மேம்பாடுகள்.
|
||||||
- விதிவிலக்கு கையாளுபவரைச் சேர்த்து பிழை செயல்பாட்டைக் காட்டுங்கள், இதனால் பயனர்கள் பிழைகள்பற்றிய அறிக்கைகளை அனுப்ப முடியும்.
|
- விதிவிலக்கு கையாளுபவரைச் சேர்த்து பிழை செயல்பாட்டைக் காட்டுங்கள், இதனால் பயனர்கள் பிழைகள்பற்றிய அறிக்கைகளை அனுப்ப முடியும்.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ V4.5.0: Opentracks
|
|||||||
- புதிய அலகு: மீட்டர் கொண்ட மைல்கள்
|
- புதிய அலகு: மீட்டர் கொண்ட மைல்கள்
|
||||||
|
|
||||||
பிழைத்திருத்த:
|
பிழைத்திருத்த:
|
||||||
- சி.பி.எச் முடக்கப்பட்ட எச்சரிக்கைகள் மீண்டும் மீண்டும் காட்டப்பட்டுள்ளன (#1429)
|
- சி.பி.எச் முடக்கப்பட்ட எச்சரிக்கைகள் மறுநிகழ்வுகள் காட்டப்பட்டுள்ளன (#1429)
|
||||||
|
|
||||||
டெவலப்பர்:
|
டெவலப்பர்:
|
||||||
- சாவா பதிவுகளைப் பயன்படுத்தவும்
|
- சாவா பதிவுகளைப் பயன்படுத்தவும்
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ V4.9.0: Opentracks
|
|||||||
இப்போது வரை, விரைவு (சி.பி.எச் அல்லது சென்சார்) ஒரு வாசலைப் பயன்படுத்துவதன் மூலம் பயன்படுத்தப்பட்டது (எ.கா., 0.3 மீ/வி க்கும் குறைவாக).
|
இப்போது வரை, விரைவு (சி.பி.எச் அல்லது சென்சார்) ஒரு வாசலைப் பயன்படுத்துவதன் மூலம் பயன்படுத்தப்பட்டது (எ.கா., 0.3 மீ/வி க்கும் குறைவாக).
|
||||||
இருப்பினும், இது மிகவும் சத்தமாக இருக்கலாம்.
|
இருப்பினும், இது மிகவும் சத்தமாக இருக்கலாம்.
|
||||||
இனிமேல், ஒரு காலக்கெடு காலம் பயன்படுத்தப்படுகிறது (அதாவது, கடைசி ஃச் விநாடிகளில் குறிப்பிடத் தக்க நிலை மாற்றம் இல்லை).
|
இனிமேல், ஒரு காலக்கெடு காலம் பயன்படுத்தப்படுகிறது (அதாவது, கடைசி ஃச் விநாடிகளில் குறிப்பிடத் தக்க நிலை மாற்றம் இல்லை).
|
||||||
இந்த காலம் பயனர் கட்டமைக்கக்கூடியது.
|
இந்தக் காலம் பயனர் கட்டமைக்கக்கூடியது.
|
||||||
சும்மா ஆகும் நிகழ்வுகள் தரவுத்தள உள்ளிட்டவற்றில் சேமிக்கப்படுகின்றன. ஒரு நேர முத்திரை, எனவே புள்ளிவிவரங்களை மீண்டும் கணக்கிட முடியும்.
|
சும்மா ஆகும் நிகழ்வுகள் தரவுத்தள உள்ளிட்டவற்றில் சேமிக்கப்படுகின்றன. ஒரு நேர முத்திரை, எனவே புள்ளிவிவரங்களை மீண்டும் கணக்கிட முடியும்.
|
||||||
|
|
||||||
இந்த பதிப்பிலிருந்து தரமிறக்குதல் செயல்படுத்தப்படவில்லை.
|
இந்தப் பதிப்பிலிருந்து தரமிறக்குதல் செயல்படுத்தப்படவில்லை.
|
||||||
மேம்படுத்துவதற்கு முன் அனைத்தையும் காப்புப் பிரதி எடுக்கவும்.
|
மேம்படுத்துவதற்கு முன் அனைத்தையும் காப்புப் பிரதி எடுக்கவும்.
|
||||||
|
|
||||||
மாற்றங்கள்:
|
மாற்றங்கள்:
|
||||||
@@ -17,7 +17,7 @@ V4.9.0: Opentracks
|
|||||||
- ச்கூட்டர் செயல்பாடு சேர்க்கப்பட்டது
|
- ச்கூட்டர் செயல்பாடு சேர்க்கப்பட்டது
|
||||||
|
|
||||||
பிழைத்திருத்த:
|
பிழைத்திருத்த:
|
||||||
- பதிவு செய்யும் போது, ட்ராக்லிச்ட் அனைத்து தடங்களையும் பதிவாக காட்டியது
|
- பதிவு செய்யும்போது, ட்ராக்லிச்ட் அனைத்து தடங்களையும் பதிவாகக் காட்டியது
|
||||||
|
|
||||||
டெவலப்பர்:
|
டெவலப்பர்:
|
||||||
- மீண்டும் இயக்கப்பட்ட அறிவிலிமையம் நடவடிக்கை சோதனைகளை இயக்கும்
|
- மீண்டும் இயக்கப்பட்ட அறிவிலிமையம் நடவடிக்கை சோதனைகளை இயக்கும்
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ v4.10.1: ஓபன்ட்ராக்ச்
|
|||||||
பிழைத்திருத்த:
|
பிழைத்திருத்த:
|
||||||
- பி.எல்.இ சென்சார் மறு இணைப்பு விபத்துக்குள்ளானது (V4.9.6 இல் அறிமுகப்படுத்தப்பட்டது)
|
- பி.எல்.இ சென்சார் மறு இணைப்பு விபத்துக்குள்ளானது (V4.9.6 இல் அறிமுகப்படுத்தப்பட்டது)
|
||||||
- சைக்கிள் ஓட்டுதல் ஆற்றல் செயலாக்கப்படவில்லை (V4.9.6 இல் அறிமுகப்படுத்தப்பட்டது)
|
- சைக்கிள் ஓட்டுதல் ஆற்றல் செயலாக்கப்படவில்லை (V4.9.6 இல் அறிமுகப்படுத்தப்பட்டது)
|
||||||
- சைக்கிள் ஓட்டுதல் மற்றும் தூரம் மீண்டும் மீண்டும் தரவை அனுமதிக்கிறது
|
- சைக்கிள் ஓட்டுதல் மற்றும் தூரம் மறுநிகழ்வு தரவை அனுமதிக்கிறது
|
||||||
- BLE காற்றழுத்தமானி தரவு சரியாக செயலாக்கப்படவில்லை
|
- BLE காற்றழுத்தமானி தரவு சரியாகச் செயலாக்கப்படவில்லை
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ v4.11.2: ஓபன்ட்ராக்ச்
|
|||||||
|
|
||||||
பிழைத்திருத்த:
|
பிழைத்திருத்த:
|
||||||
- திரை திரும்பும்போது பதிவு நிறுத்தப்பட்டது (V4.11.1 இல் அறிமுகப்படுத்தப்பட்டது)
|
- திரை திரும்பும்போது பதிவு நிறுத்தப்பட்டது (V4.11.1 இல் அறிமுகப்படுத்தப்பட்டது)
|
||||||
.
|
. (மாற்றியமைத்தல் da3dd29b8e44624a8222caea9067955f252ef5f8)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
v4.13.0: ஓபன்ட்ராக்ச்
|
v4.13.0: ஓபன்ட்ராக்ச்
|
||||||
|
|
||||||
மாற்றங்கள்:
|
மாற்றங்கள்:
|
||||||
- பொது பநிஇ வழியாக குறிப்பான்களை உருவாக்க முடியும்
|
- பொது பநிஇ வழியாகக் குறிப்பான்களை உருவாக்க முடியும்
|
||||||
இது எந்த இடத்திலும் பதிவுசெய்த பிறகு குறிப்பான்களை உருவாக்க அனுமதிக்கிறது.
|
இது எந்த இடத்திலும் பதிவுசெய்த பிறகு குறிப்பான்களை உருவாக்க அனுமதிக்கிறது.
|
||||||
குறைபாடு: குறிப்பான்கள் இனி வரைபடங்களில் காட்டப்படவில்லை.
|
குறைபாடு: குறிப்பான்கள் இனி வரைபடங்களில் காட்டப்படவில்லை.
|
||||||
குறிப்பு: பதிப்பிற்குப் பிறகு இந்த பநிஇ ஐ ஆதரிக்கிறது: v4.1.0
|
குறிப்பு: பதிப்பிற்குப் பிறகு இந்த பநிஇ ஐ ஆதரிக்கிறது: v4.1.0
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
V4.19.3: Opentracks
|
V4.19.3: Opentracks
|
||||||
|
|
||||||
பிழைத்திருத்த:
|
பிழைத்திருத்த:
|
||||||
- உயரத்திற்கு காபிம ஏற்றுமதியை சரிசெய்யவும் (1000 மீ.
|
- உயரத்திற்கு காபிம ஏற்றுமதியை சரிசெய்யவும் (1000 மீட்டரில் வெட்டப்பட்டது)
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
v4.19.5: OpenTracks
|
||||||
|
|
||||||
|
பிழைத்திருத்தம்:
|
||||||
|
- துவக்கி ஐகான் சில நேரங்களில் மிகச் சிறியதாகக் காட்டப்பட்டது
|
||||||
|
- உள்ளூர்மயமாக்கப்பட்ட செயல்பாட்டு வகையைப் பயன்படுத்தி விவரப் பக்கத்தில் டிராக் ஐகான்
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
v4.19.6: OpenTracks
|
||||||
|
|
||||||
|
மாற்றங்கள்:
|
||||||
|
- Edge-2-edge இப்போது அனைத்து Android பதிப்புகளிலும் வேலை செய்ய வேண்டும்
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
v4.20.0: OpenTracks
|
||||||
|
|
||||||
|
மாற்றங்கள்:
|
||||||
|
- டிராக்குகளின் நேர மண்டல ஆஃப்செட்டை மாற்ற அனுமதிக்கவும்
|
||||||
|
- எளிமைப்படுத்தப்பட்ட மார்க்கர் UI
|
||||||
|
|
||||||
|
பிழைத்திருத்தம்:
|
||||||
|
- எட்ஜ்-2-எட்ஜ்: மெய்நிகர் விசைப்பலகைக்கு எதிர்வினையாற்று
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
v4.21.0: OpenTracks
|
||||||
|
|
||||||
|
மாற்றங்கள்:
|
||||||
|
- டிராக் பட்டியல் ஸ்வைப்-டு-டிலீட்டை ஆதரிக்கிறது
|
||||||
|
- மீண்டும் செயல்படுத்தப்பட்ட தீம்கள் (டைனமிக் கலர் மற்றும் OLED க்கு)
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
v4.21.1: OpenTracks
|
||||||
|
|
||||||
|
பிழைத்திருத்தம்:
|
||||||
|
- ஏற்றுமதி/இறக்குமதி UI இல் ஏற்பட்ட செயலிழப்பு சரி செய்யப்பட்டது (v4.21.0 இல் அறிமுகப்படுத்தப்பட்டது)
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
一款尊重您的隐私的运动追踪应用。
|
尊重您隐私的运动追踪伙伴。
|
||||||
|
|
||||||
健康幸福的生活总少不了各种运动和户外活动。
|
运动与户外活动能带来快乐、提升技能、增强自信。
|
||||||
|
|
||||||
使用本应用,您可以保持对您的训练数据的有效追踪,为您的健康助力。
|
通过跟踪训练数据,珍视您的健康。
|
||||||
本应用可以在您跑步或散步时记录数据,也可以在您骑车时作为一个大屏幕自行车电脑。
|
记录您的跑步或步行数据,并提供大屏的专用骑行码表。
|
||||||
您可以为路上的有趣位置创建标记,还可以用图片作为标记。
|
用照片标记沿途有趣的地点。
|
||||||
您的数据会被详尽地记录下来,供您查阅分析。
|
保留详细记录的统计数据以供分析。
|
||||||
您的数据只会分享给您想要分享给的人。
|
仅分享您愿意公开的数据。
|
||||||
|
|
||||||
* 语音播报
|
* 语音播报。
|
||||||
* 支持蓝牙LE传感器:心率、速度和距离(骑车)、踏频(骑车)和功率计(骑车)。
|
* 支持蓝牙低功耗传感器:心率、速度和距离(骑行)、踏频(骑行)、功率计(骑行)。
|
||||||
* 海拔增减:通过气压传感器。
|
* 海拔上升和下降:通过气压传感器。
|
||||||
* EGM2008 海拔显示(平均海平面以上);导出为 WGS84。
|
* 采用 EGM2008 显示海拔(平均海平面以上);导出为 WGS84。
|
||||||
* 导出路线数据,支持 KMZ(包括照片)、KML 和 GPX 格式。
|
* 以 KMZ(含照片)、KML 或 GPX 格式导出轨迹数据。
|
||||||
* 不需要联网,不需要额外权限。
|
* 无需互联网访问或额外权限。
|
||||||
* 深色和浅色主题,跟随系统设置。
|
* 深色和浅色主题,跟随系统设置。
|
||||||
* 没有广告。
|
* 无广告。
|
||||||
|
|
||||||
本应用是开源软件
|
自由软件/开放源代码
|
||||||
意味着您可以使用、学习、修改和分发本应用的源代码。
|
意味着您可以使用、研究、修改和分享源代码。
|
||||||
本应用使用 Apache 2.0 协议发布。
|
采用 Apache 2.0 许可
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
一款尊重您的隐私的运动追踪应用。
|
尊重您隐私的运动追踪伙伴。
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright © 2015-2021 the original authors.
|
# Copyright © 2015 the original authors.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -86,8 +86,7 @@ done
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||||
' "$PWD" ) || exit
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
@@ -115,7 +114,7 @@ case "$( uname )" in #(
|
|||||||
NONSTOP* ) nonstop=true ;;
|
NONSTOP* ) nonstop=true ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
CLASSPATH="\\\"\\\""
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
@@ -206,7 +205,7 @@ fi
|
|||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command:
|
# Collect all arguments for the java command:
|
||||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# and any embedded shellness will be escaped.
|
# and any embedded shellness will be escaped.
|
||||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# treated as '${Hostname}' itself on the command line.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
@@ -214,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
-classpath "$CLASSPATH" \
|
-classpath "$CLASSPATH" \
|
||||||
org.gradle.wrapper.GradleWrapperMain \
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
# Stop when "xargs" is not available.
|
||||||
|
|||||||
Vendored
+2
-2
@@ -70,11 +70,11 @@ goto fail
|
|||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
set CLASSPATH=
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
|||||||
@@ -13,18 +13,20 @@ import java.time.Duration;
|
|||||||
import de.dennisguse.opentracks.data.models.Altitude;
|
import de.dennisguse.opentracks.data.models.Altitude;
|
||||||
import de.dennisguse.opentracks.data.models.Distance;
|
import de.dennisguse.opentracks.data.models.Distance;
|
||||||
import de.dennisguse.opentracks.data.models.Speed;
|
import de.dennisguse.opentracks.data.models.Speed;
|
||||||
|
import de.dennisguse.opentracks.data.models.Statistics;
|
||||||
import de.dennisguse.opentracks.data.models.TrackPoint;
|
import de.dennisguse.opentracks.data.models.TrackPoint;
|
||||||
import de.dennisguse.opentracks.settings.UnitSystem;
|
import de.dennisguse.opentracks.settings.UnitSystem;
|
||||||
import de.dennisguse.opentracks.stats.TrackStatistics;
|
|
||||||
|
|
||||||
|
//TODO assertEquals with ChartPoint (instead of individual comparisons)
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
public class ChartPointTest {
|
public class ChartPointTest {
|
||||||
|
|
||||||
|
private static final Statistics STATISTIC_NULL = new Statistics(null, null, Duration.ZERO, null, null, null, null, null, null, null);
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void create_by_time() {
|
public void create_by_time() {
|
||||||
// given
|
// given
|
||||||
TrackStatistics statistics = new TrackStatistics();
|
Statistics statistics = new Statistics(null, null, Duration.ofSeconds(1000), null, null, null, null, null, null, null);
|
||||||
statistics.setTotalTime(Duration.ofSeconds(1000));
|
|
||||||
|
|
||||||
// when
|
// when
|
||||||
ChartPoint point = ChartPoint.create(statistics, TrackStubUtils.createDefaultTrackPoint(), Speed.of(0), false, UnitSystem.IMPERIAL_FEET);
|
ChartPoint point = ChartPoint.create(statistics, TrackStubUtils.createDefaultTrackPoint(), Speed.of(0), false, UnitSystem.IMPERIAL_FEET);
|
||||||
@@ -36,8 +38,7 @@ public class ChartPointTest {
|
|||||||
@Test
|
@Test
|
||||||
public void create_by_distance() {
|
public void create_by_distance() {
|
||||||
// given
|
// given
|
||||||
TrackStatistics statistics = new TrackStatistics();
|
Statistics statistics = new Statistics(null, null, null, null, Distance.of(1000), null, null, null, null, null);
|
||||||
statistics.setTotalDistance(Distance.of(1000));
|
|
||||||
|
|
||||||
// when
|
// when
|
||||||
ChartPoint point = ChartPoint.create(statistics, TrackStubUtils.createDefaultTrackPoint(), Speed.of(0), true, UnitSystem.METRIC);
|
ChartPoint point = ChartPoint.create(statistics, TrackStubUtils.createDefaultTrackPoint(), Speed.of(0), true, UnitSystem.METRIC);
|
||||||
@@ -49,12 +50,11 @@ public class ChartPointTest {
|
|||||||
@Test
|
@Test
|
||||||
public void create_get_altitude_speed_and_pace() {
|
public void create_get_altitude_speed_and_pace() {
|
||||||
// given
|
// given
|
||||||
TrackStatistics statistics = new TrackStatistics();
|
|
||||||
TrackPoint trackPoint = TrackStubUtils.createDefaultTrackPoint()
|
TrackPoint trackPoint = TrackStubUtils.createDefaultTrackPoint()
|
||||||
.setAltitude(Altitude.EGM2008.of(50));
|
.setAltitude(Altitude.EGM2008.of(50));
|
||||||
|
|
||||||
// when
|
// when
|
||||||
ChartPoint point = ChartPoint.create(statistics, trackPoint, Speed.of(10), false, UnitSystem.METRIC);
|
ChartPoint point = ChartPoint.create(STATISTIC_NULL, trackPoint, Speed.of(10), false, UnitSystem.METRIC);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(50, point.altitude(), 0.01);
|
assertEquals(50, point.altitude(), 0.01);
|
||||||
@@ -65,11 +65,10 @@ public class ChartPointTest {
|
|||||||
@Test
|
@Test
|
||||||
public void create_sensorNotAvailable() {
|
public void create_sensorNotAvailable() {
|
||||||
// given
|
// given
|
||||||
TrackStatistics statistics = new TrackStatistics();
|
|
||||||
TrackPoint trackPoint = TrackStubUtils.createDefaultTrackPoint()
|
TrackPoint trackPoint = TrackStubUtils.createDefaultTrackPoint()
|
||||||
.setAltitude(Altitude.EGM2008.of(50));
|
.setAltitude(Altitude.EGM2008.of(50));
|
||||||
// when
|
// when
|
||||||
ChartPoint point = ChartPoint.create(statistics, trackPoint, Speed.of(10), false, UnitSystem.METRIC);
|
ChartPoint point = ChartPoint.create(STATISTIC_NULL, trackPoint, Speed.of(10), false, UnitSystem.METRIC);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertNull(point.heartRate());
|
assertNull(point.heartRate());
|
||||||
@@ -86,10 +85,8 @@ public class ChartPointTest {
|
|||||||
.setCadence(101f)
|
.setCadence(101f)
|
||||||
.setPower(102f);
|
.setPower(102f);
|
||||||
|
|
||||||
TrackStatistics statistics = new TrackStatistics();
|
|
||||||
|
|
||||||
// when
|
// when
|
||||||
ChartPoint point = ChartPoint.create(statistics, trackPoint, Speed.of(10), false, UnitSystem.METRIC);
|
ChartPoint point = ChartPoint.create(STATISTIC_NULL, trackPoint, Speed.of(10), false, UnitSystem.METRIC);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(100.0, point.heartRate(), 0.01);
|
assertEquals(100.0, point.heartRate(), 0.01);
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ import android.util.Pair;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.time.Duration;
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import de.dennisguse.opentracks.data.ContentProviderUtils;
|
import de.dennisguse.opentracks.data.ContentProviderUtils;
|
||||||
import de.dennisguse.opentracks.data.TrackPointIterator;
|
|
||||||
import de.dennisguse.opentracks.data.models.Altitude;
|
import de.dennisguse.opentracks.data.models.Altitude;
|
||||||
import de.dennisguse.opentracks.data.models.Distance;
|
import de.dennisguse.opentracks.data.models.Distance;
|
||||||
import de.dennisguse.opentracks.data.models.Marker;
|
import de.dennisguse.opentracks.data.models.Marker;
|
||||||
@@ -20,9 +18,8 @@ import de.dennisguse.opentracks.data.models.Position;
|
|||||||
import de.dennisguse.opentracks.data.models.Speed;
|
import de.dennisguse.opentracks.data.models.Speed;
|
||||||
import de.dennisguse.opentracks.data.models.Track;
|
import de.dennisguse.opentracks.data.models.Track;
|
||||||
import de.dennisguse.opentracks.data.models.TrackPoint;
|
import de.dennisguse.opentracks.data.models.TrackPoint;
|
||||||
import de.dennisguse.opentracks.stats.TrackStatistics;
|
|
||||||
import de.dennisguse.opentracks.stats.TrackStatisticsUpdater;
|
|
||||||
import de.dennisguse.opentracks.ui.markers.MarkerUtils;
|
import de.dennisguse.opentracks.ui.markers.MarkerUtils;
|
||||||
|
import de.dennisguse.opentracks.util.AutoCloseableIterator;
|
||||||
import de.dennisguse.opentracks.util.FileUtils;
|
import de.dennisguse.opentracks.util.FileUtils;
|
||||||
|
|
||||||
public class TestDataUtil {
|
public class TestDataUtil {
|
||||||
@@ -85,10 +82,6 @@ public class TestDataUtil {
|
|||||||
createTrackPoint(i, TrackPoint.Type.SEGMENT_END_MANUAL)
|
createTrackPoint(i, TrackPoint.Type.SEGMENT_END_MANUAL)
|
||||||
);
|
);
|
||||||
|
|
||||||
//TODO Use TrackStatisticsUpdater
|
|
||||||
TrackStatistics stats = new TrackStatistics();
|
|
||||||
stats.setTotalDistance(Distance.of(0));
|
|
||||||
stats.setTotalTime(Duration.ofMillis(0));
|
|
||||||
List<Marker> markers = List.of(
|
List<Marker> markers = List.of(
|
||||||
new Marker(trackId, trackPoints.get(1), "Marker 1", "Marker description 1", "Marker category 3", "", null),
|
new Marker(trackId, trackPoints.get(1), "Marker 1", "Marker description 1", "Marker category 3", "", null),
|
||||||
new Marker(trackId, trackPoints.get(4), "Marker 2", "Marker description 2", "Marker category 3", "", null),
|
new Marker(trackId, trackPoints.get(4), "Marker 2", "Marker description 2", "Marker category 3", "", null),
|
||||||
@@ -126,8 +119,7 @@ public class TestDataUtil {
|
|||||||
trackPoint.setHeartRate(100f + i % 80);
|
trackPoint.setHeartRate(100f + i % 80);
|
||||||
trackPoint.setCadence(300f + i);
|
trackPoint.setCadence(300f + i);
|
||||||
trackPoint.setPower(400f + i);
|
trackPoint.setPower(400f + i);
|
||||||
trackPoint.setAltitudeGain(ALTITUDE_GAIN);
|
trackPoint.setAltitudeGainLoss(ALTITUDE_GAIN, ALTITUDE_LOSS);
|
||||||
trackPoint.setAltitudeLoss(ALTITUDE_LOSS);
|
|
||||||
return trackPoint;
|
return trackPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,16 +145,11 @@ public class TestDataUtil {
|
|||||||
dstFile.createNewFile();
|
dstFile.createNewFile();
|
||||||
Uri photoUri = FileUtils.getUriForFile(context, dstFile);
|
Uri photoUri = FileUtils.getUriForFile(context, dstFile);
|
||||||
|
|
||||||
//TODO Use TrackStatisticsUpdater
|
|
||||||
TrackStatistics stats = new TrackStatistics();
|
|
||||||
stats.setTotalDistance(Distance.of(0));
|
|
||||||
stats.setTotalTime(Duration.ofMillis(0));
|
|
||||||
|
|
||||||
return new Marker(trackId, trackPoint, "Marker name", "Marker description", "Marker category", "", photoUri);
|
return new Marker(trackId, trackPoint, "Marker name", "Marker description", "Marker category", "", photoUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<TrackPoint> getTrackPoints(ContentProviderUtils contentProviderUtils, Track.Id trackId) {
|
public static List<TrackPoint> getTrackPoints(ContentProviderUtils contentProviderUtils, Track.Id trackId) {
|
||||||
try (TrackPointIterator trackPointIterator = contentProviderUtils.getTrackPointLocationIterator(trackId, null)) {
|
try (AutoCloseableIterator<TrackPoint> trackPointIterator = contentProviderUtils.getTrackPointLocationIterator(trackId, null)) {
|
||||||
ArrayList<TrackPoint> trackPoints = new ArrayList<>();
|
ArrayList<TrackPoint> trackPoints = new ArrayList<>();
|
||||||
while (trackPointIterator.hasNext()) {
|
while (trackPointIterator.hasNext()) {
|
||||||
trackPoints.add(trackPointIterator.next());
|
trackPoints.add(trackPointIterator.next());
|
||||||
@@ -170,20 +157,4 @@ public class TestDataUtil {
|
|||||||
return trackPoints;
|
return trackPoints;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Pair<Track.Id, TrackStatistics> buildTrackWithTrackPoints(ContentProviderUtils contentProviderUtils, int numberOfPoints) {
|
|
||||||
Track dummyTrack = new Track();
|
|
||||||
dummyTrack.setId(new Track.Id(System.currentTimeMillis()));
|
|
||||||
dummyTrack.setName("Dummy Track");
|
|
||||||
contentProviderUtils.insertTrack(dummyTrack);
|
|
||||||
TrackStatisticsUpdater trackStatisticsUpdater = new TrackStatisticsUpdater();
|
|
||||||
for (int i = 0; i < numberOfPoints; i++) {
|
|
||||||
TrackPoint tp = TestDataUtil.createTrackPoint(i);
|
|
||||||
contentProviderUtils.insertTrackPoint(tp, dummyTrack.getId());
|
|
||||||
trackStatisticsUpdater.addTrackPoint(tp);
|
|
||||||
}
|
|
||||||
dummyTrack.setTrackStatistics(trackStatisticsUpdater.getTrackStatistics());
|
|
||||||
contentProviderUtils.updateTrack(dummyTrack);
|
|
||||||
return new Pair<>(dummyTrack.getId(), trackStatisticsUpdater.getTrackStatistics());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,8 +41,7 @@ public class TestSensorDataUtil {
|
|||||||
if (power != null) {
|
if (power != null) {
|
||||||
tp.setPower(power);
|
tp.setPower(power);
|
||||||
}
|
}
|
||||||
tp.setAltitudeGain(3f);
|
tp.setAltitudeGainLoss(3, 3);
|
||||||
tp.setAltitudeLoss(3f);
|
|
||||||
trackPointList.add(tp);
|
trackPointList.add(tp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+25
-23
@@ -47,23 +47,25 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import de.dennisguse.opentracks.content.data.TestDataUtil;
|
import de.dennisguse.opentracks.content.data.TestDataUtil;
|
||||||
import de.dennisguse.opentracks.content.data.TestSensorDataUtil;
|
import de.dennisguse.opentracks.content.data.TestSensorDataUtil;
|
||||||
import de.dennisguse.opentracks.data.models.Altitude;
|
import de.dennisguse.opentracks.data.models.Altitude;
|
||||||
|
import de.dennisguse.opentracks.data.models.AltitudeExtremities;
|
||||||
|
import de.dennisguse.opentracks.data.models.AltitudeGainLoss;
|
||||||
import de.dennisguse.opentracks.data.models.Distance;
|
import de.dennisguse.opentracks.data.models.Distance;
|
||||||
import de.dennisguse.opentracks.data.models.HeartRate;
|
import de.dennisguse.opentracks.data.models.HeartRate;
|
||||||
import de.dennisguse.opentracks.data.models.Marker;
|
import de.dennisguse.opentracks.data.models.Marker;
|
||||||
import de.dennisguse.opentracks.data.models.Position;
|
import de.dennisguse.opentracks.data.models.Position;
|
||||||
import de.dennisguse.opentracks.data.models.Speed;
|
import de.dennisguse.opentracks.data.models.Speed;
|
||||||
|
import de.dennisguse.opentracks.data.models.Statistics;
|
||||||
import de.dennisguse.opentracks.data.models.Track;
|
import de.dennisguse.opentracks.data.models.Track;
|
||||||
import de.dennisguse.opentracks.data.models.TrackPoint;
|
import de.dennisguse.opentracks.data.models.TrackPoint;
|
||||||
import de.dennisguse.opentracks.data.tables.MarkerColumns;
|
import de.dennisguse.opentracks.data.tables.MarkerColumns;
|
||||||
import de.dennisguse.opentracks.data.tables.TrackPointsColumns;
|
import de.dennisguse.opentracks.data.tables.TrackPointsColumns;
|
||||||
import de.dennisguse.opentracks.data.tables.TracksColumns;
|
import de.dennisguse.opentracks.data.tables.TracksColumns;
|
||||||
import de.dennisguse.opentracks.stats.SensorStatistics;
|
import de.dennisguse.opentracks.stats.SensorStatistics;
|
||||||
import de.dennisguse.opentracks.stats.TrackStatistics;
|
import de.dennisguse.opentracks.util.AutoCloseableIterator;
|
||||||
import de.dennisguse.opentracks.util.FileUtils;
|
import de.dennisguse.opentracks.util.FileUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -115,7 +117,7 @@ public class CustomContentProviderUtilsTest {
|
|||||||
private void testIterator(Track.Id trackId, int numPoints) {
|
private void testIterator(Track.Id trackId, int numPoints) {
|
||||||
TrackPoint.Id lastPointId = initializeTrack(trackId, numPoints);
|
TrackPoint.Id lastPointId = initializeTrack(trackId, numPoints);
|
||||||
List<TrackPoint> locations = new ArrayList<>(numPoints);
|
List<TrackPoint> locations = new ArrayList<>(numPoints);
|
||||||
try (TrackPointIterator it = contentProviderUtils.getTrackPointLocationIterator(trackId, null)) {
|
try (AutoCloseableIterator<TrackPoint> it = contentProviderUtils.getTrackPointLocationIterator(trackId, null)) {
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
TrackPoint trackPoint = it.next();
|
TrackPoint trackPoint = it.next();
|
||||||
assertNotNull(trackPoint);
|
assertNotNull(trackPoint);
|
||||||
@@ -153,7 +155,7 @@ public class CustomContentProviderUtilsTest {
|
|||||||
// Load all inserted trackPoints.
|
// Load all inserted trackPoints.
|
||||||
TrackPoint.Id lastPointId = null;
|
TrackPoint.Id lastPointId = null;
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
try (TrackPointIterator it = contentProviderUtils.getTrackPointLocationIterator(id, null)) {
|
try (AutoCloseableIterator<TrackPoint> it = contentProviderUtils.getTrackPointLocationIterator(id, null)) {
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
TrackPoint trackPoint = it.next();
|
TrackPoint trackPoint = it.next();
|
||||||
lastPointId = trackPoint.getId();
|
lastPointId = trackPoint.getId();
|
||||||
@@ -407,18 +409,18 @@ public class CustomContentProviderUtilsTest {
|
|||||||
Pair<Track, List<TrackPoint>> track = TestDataUtil.createTrack(trackId, 10);
|
Pair<Track, List<TrackPoint>> track = TestDataUtil.createTrack(trackId, 10);
|
||||||
|
|
||||||
// AverageSpeed
|
// AverageSpeed
|
||||||
TrackStatistics statistics = new TrackStatistics();
|
track.first.setStatistics(new Statistics(
|
||||||
statistics.setStartTime(Instant.ofEpochMilli(1000));
|
Instant.ofEpochMilli(1000),
|
||||||
statistics.setStopTime(Instant.ofEpochMilli(2500));
|
Instant.ofEpochMilli(2500),
|
||||||
statistics.setTotalTime(Duration.ofMillis(1500));
|
Duration.ofMillis(1500),
|
||||||
statistics.setMovingTime(Duration.ofMillis(700));
|
Duration.ofMillis(700),
|
||||||
statistics.setTotalDistance(Distance.of(750.0));
|
Distance.of(750),
|
||||||
statistics.setTotalAltitudeGain(50.0f);
|
Speed.of(60),
|
||||||
statistics.setMaxSpeed(Speed.of(60.0));
|
new AltitudeExtremities(1250, 1200),
|
||||||
statistics.setMaxAltitude(1250.0);
|
new AltitudeGainLoss(50, 50),
|
||||||
statistics.setMinAltitude(1200.0);
|
null,
|
||||||
|
null
|
||||||
track.first.setTrackStatistics(statistics);
|
));
|
||||||
contentProviderUtils.insertTrack(track.first);
|
contentProviderUtils.insertTrack(track.first);
|
||||||
|
|
||||||
Marker marker = new Marker(trackId, track.second.get(0));
|
Marker marker = new Marker(trackId, track.second.get(0));
|
||||||
@@ -451,7 +453,7 @@ public class CustomContentProviderUtilsTest {
|
|||||||
contentProviderUtils.insertMarker(marker1);
|
contentProviderUtils.insertMarker(marker1);
|
||||||
|
|
||||||
// Check insert was done.
|
// Check insert was done.
|
||||||
assertEquals(contentProviderUtils.getMarkers(trackId).size(), 1);
|
assertEquals(1, contentProviderUtils.getMarkers(trackId).size());
|
||||||
|
|
||||||
// Get marker id that needs to delete.
|
// Get marker id that needs to delete.
|
||||||
Marker.Id marker1Id = contentProviderUtils.insertMarker(marker1);
|
Marker.Id marker1Id = contentProviderUtils.insertMarker(marker1);
|
||||||
@@ -478,7 +480,7 @@ public class CustomContentProviderUtilsTest {
|
|||||||
contentProviderUtils.insertMarker(marker1);
|
contentProviderUtils.insertMarker(marker1);
|
||||||
|
|
||||||
// Check insert was done.
|
// Check insert was done.
|
||||||
assertEquals(contentProviderUtils.getMarkers(trackId).size(), 1);
|
assertEquals(1, contentProviderUtils.getMarkers(trackId).size());
|
||||||
|
|
||||||
// Get marker id that needs to delete.
|
// Get marker id that needs to delete.
|
||||||
Marker.Id marker1Id = contentProviderUtils.insertMarker(marker1);
|
Marker.Id marker1Id = contentProviderUtils.insertMarker(marker1);
|
||||||
@@ -763,8 +765,8 @@ public class CustomContentProviderUtilsTest {
|
|||||||
TrackPoint trackPoint = contentProviderUtils.createTrackPoint(cursorMock);
|
TrackPoint trackPoint = contentProviderUtils.createTrackPoint(cursorMock);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(longitude, trackPoint.getLongitude(), 0.01);
|
assertEquals(latitude, trackPoint.getPosition().latitude(), 0.01);
|
||||||
assertEquals(latitude, trackPoint.getLatitude(), 0.01);
|
assertEquals(longitude, trackPoint.getPosition().longitude(), 0.01);
|
||||||
assertEquals(time, trackPoint.getTime().toEpochMilli());
|
assertEquals(time, trackPoint.getTime().toEpochMilli());
|
||||||
assertEquals(speed, trackPoint.getSpeed().toMPS(), 0.01);
|
assertEquals(speed, trackPoint.getSpeed().toMPS(), 0.01);
|
||||||
assertEquals(HeartRate.of(75f), trackPoint.getHeartRate());
|
assertEquals(HeartRate.of(75f), trackPoint.getHeartRate());
|
||||||
@@ -832,7 +834,7 @@ public class CustomContentProviderUtilsTest {
|
|||||||
|
|
||||||
List<TrackPoint.Id> trackpointIds = track.second.stream()
|
List<TrackPoint.Id> trackpointIds = track.second.stream()
|
||||||
.map(it -> ContentUris.parseId(contentProviderUtils.insertTrackPoint(it, track.first.getId())))
|
.map(it -> ContentUris.parseId(contentProviderUtils.insertTrackPoint(it, track.first.getId())))
|
||||||
.map(TrackPoint.Id::new).collect(Collectors.toList());
|
.map(TrackPoint.Id::new).toList();
|
||||||
|
|
||||||
// when
|
// when
|
||||||
try (Cursor cursor = contentProviderUtils.getTrackPointCursor(trackId, trackpointIds.get(8))) {
|
try (Cursor cursor = contentProviderUtils.getTrackPointCursor(trackId, trackpointIds.get(8))) {
|
||||||
@@ -850,12 +852,12 @@ public class CustomContentProviderUtilsTest {
|
|||||||
|
|
||||||
List<TrackPoint.Id> trackpointIds = track.second.stream()
|
List<TrackPoint.Id> trackpointIds = track.second.stream()
|
||||||
.map(it -> ContentUris.parseId(contentProviderUtils.insertTrackPoint(it, track.first.getId())))
|
.map(it -> ContentUris.parseId(contentProviderUtils.insertTrackPoint(it, track.first.getId())))
|
||||||
.map(TrackPoint.Id::new).collect(Collectors.toList());
|
.map(TrackPoint.Id::new).toList();
|
||||||
|
|
||||||
TrackPoint.Id startTrackPointId = trackpointIds.get(0);
|
TrackPoint.Id startTrackPointId = trackpointIds.get(0);
|
||||||
|
|
||||||
// when
|
// when
|
||||||
TrackPointIterator trackPointIterator = contentProviderUtils.getTrackPointLocationIterator(trackId, trackpointIds.get(0));
|
AutoCloseableIterator<TrackPoint> trackPointIterator = contentProviderUtils.getTrackPointLocationIterator(trackId, trackpointIds.get(0));
|
||||||
|
|
||||||
// then
|
// then
|
||||||
for (int i = 0; i < trackpointIds.size(); i++) {
|
for (int i = 0; i < trackpointIds.size(); i++) {
|
||||||
|
|||||||
@@ -48,12 +48,10 @@ public class CustomSQLiteOpenHelperTest {
|
|||||||
public static Map<String, String> getSQL(SQLiteDatabase db, String type) {
|
public static Map<String, String> getSQL(SQLiteDatabase db, String type) {
|
||||||
HashMap<String, String> sqlMap = new HashMap<>();
|
HashMap<String, String> sqlMap = new HashMap<>();
|
||||||
try (Cursor cursor = db.query("sqlite_master", new String[]{"name", "SQL"}, "type=?", new String[]{type}, null, null, "name")) {
|
try (Cursor cursor = db.query("sqlite_master", new String[]{"name", "SQL"}, "type=?", new String[]{type}, null, null, "name")) {
|
||||||
if (cursor != null) {
|
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
sqlMap.put(cursor.getString(0), cursor.getString(1));
|
sqlMap.put(cursor.getString(0), cursor.getString(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return sqlMap;
|
return sqlMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +62,6 @@ public class CustomSQLiteOpenHelperTest {
|
|||||||
*/
|
*/
|
||||||
private static boolean hasSqlCreate(SQLiteDatabase db, String sqlCreate) {
|
private static boolean hasSqlCreate(SQLiteDatabase db, String sqlCreate) {
|
||||||
try (Cursor cursor = db.rawQuery("SELECT SQL FROM sqlite_master", null)) {
|
try (Cursor cursor = db.rawQuery("SELECT SQL FROM sqlite_master", null)) {
|
||||||
if (cursor != null) {
|
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
String sql = cursor.getString(0);
|
String sql = cursor.getString(0);
|
||||||
if (sqlCreate.equals(sql)) {
|
if (sqlCreate.equals(sql)) {
|
||||||
@@ -72,7 +69,6 @@ public class CustomSQLiteOpenHelperTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ public class TrackSelectionTest extends TestCase {
|
|||||||
SelectionData selection = filter.buildSelection();
|
SelectionData selection = filter.buildSelection();
|
||||||
|
|
||||||
// Then
|
// Then
|
||||||
assertEquals(selection.selection(), "_id IN (?)");
|
assertEquals("_id IN (?)", selection.selection());
|
||||||
assertEquals(selection.selectionArgs().length, 1);
|
assertEquals(1, selection.selectionArgs().length);
|
||||||
assertEquals(selection.selectionArgs()[0], "1");
|
assertEquals("1", selection.selectionArgs()[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -57,11 +57,11 @@ public class TrackSelectionTest extends TestCase {
|
|||||||
SelectionData selection = filter.buildSelection();
|
SelectionData selection = filter.buildSelection();
|
||||||
|
|
||||||
// Then
|
// Then
|
||||||
assertEquals(selection.selection(), "_id IN (?,?,?)");
|
assertEquals("_id IN (?,?,?)", selection.selection());
|
||||||
assertEquals(selection.selectionArgs().length, 3);
|
assertEquals(3, selection.selectionArgs().length);
|
||||||
assertEquals(selection.selectionArgs()[0], "1");
|
assertEquals("1", selection.selectionArgs()[0]);
|
||||||
assertEquals(selection.selectionArgs()[1], "2");
|
assertEquals("2", selection.selectionArgs()[1]);
|
||||||
assertEquals(selection.selectionArgs()[2], "3");
|
assertEquals("3", selection.selectionArgs()[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -73,9 +73,9 @@ public class TrackSelectionTest extends TestCase {
|
|||||||
SelectionData selection = filter.buildSelection();
|
SelectionData selection = filter.buildSelection();
|
||||||
|
|
||||||
// Then
|
// Then
|
||||||
assertEquals(selection.selection(), "category IN (?)");
|
assertEquals("category IN (?)", selection.selection());
|
||||||
assertEquals(selection.selectionArgs().length, 1);
|
assertEquals(1, selection.selectionArgs().length);
|
||||||
assertEquals(selection.selectionArgs()[0], "running");
|
assertEquals("running", selection.selectionArgs()[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -91,12 +91,12 @@ public class TrackSelectionTest extends TestCase {
|
|||||||
SelectionData selection = filter.buildSelection();
|
SelectionData selection = filter.buildSelection();
|
||||||
|
|
||||||
// Then
|
// Then
|
||||||
assertEquals(selection.selection(), "category IN (?,?,?,?)");
|
assertEquals("category IN (?,?,?,?)", selection.selection());
|
||||||
assertEquals(selection.selectionArgs().length, 4);
|
assertEquals(4, selection.selectionArgs().length);
|
||||||
assertEquals(selection.selectionArgs()[0], "running");
|
assertEquals("running", selection.selectionArgs()[0]);
|
||||||
assertEquals(selection.selectionArgs()[1], "road biking");
|
assertEquals("road biking", selection.selectionArgs()[1]);
|
||||||
assertEquals(selection.selectionArgs()[2], "mountain biking");
|
assertEquals("mountain biking", selection.selectionArgs()[2]);
|
||||||
assertEquals(selection.selectionArgs()[3], "trail walking");
|
assertEquals("trail walking", selection.selectionArgs()[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -120,8 +120,8 @@ public class TrackSelectionTest extends TestCase {
|
|||||||
assertNull(selectionWrong2.selection());
|
assertNull(selectionWrong2.selection());
|
||||||
assertNull(selectionWrong2.selectionArgs());
|
assertNull(selectionWrong2.selectionArgs());
|
||||||
|
|
||||||
assertEquals(selectionOk.selection(), "starttime BETWEEN ? AND ?");
|
assertEquals("starttime BETWEEN ? AND ?", selectionOk.selection());
|
||||||
assertEquals(selectionOk.selectionArgs().length, 2);
|
assertEquals(2, selectionOk.selectionArgs().length);
|
||||||
assertEquals(selectionOk.selectionArgs()[0], Long.toString(instant.toEpochMilli()));
|
assertEquals(selectionOk.selectionArgs()[0], Long.toString(instant.toEpochMilli()));
|
||||||
assertEquals(selectionOk.selectionArgs()[1], Long.toString(instant.toEpochMilli() + oneDay));
|
assertEquals(selectionOk.selectionArgs()[1], Long.toString(instant.toEpochMilli() + oneDay));
|
||||||
}
|
}
|
||||||
@@ -143,13 +143,13 @@ public class TrackSelectionTest extends TestCase {
|
|||||||
SelectionData selection = filter.buildSelection();
|
SelectionData selection = filter.buildSelection();
|
||||||
|
|
||||||
// Then
|
// Then
|
||||||
assertEquals(selection.selection(), "_id IN (?,?,?) AND category IN (?,?)");
|
assertEquals("_id IN (?,?,?) AND category IN (?,?)", selection.selection());
|
||||||
assertEquals(selection.selectionArgs().length, 5);
|
assertEquals(5, selection.selectionArgs().length);
|
||||||
assertEquals(selection.selectionArgs()[0], "1");
|
assertEquals("1", selection.selectionArgs()[0]);
|
||||||
assertEquals(selection.selectionArgs()[1], "2");
|
assertEquals("2", selection.selectionArgs()[1]);
|
||||||
assertEquals(selection.selectionArgs()[2], "3");
|
assertEquals("3", selection.selectionArgs()[2]);
|
||||||
assertEquals(selection.selectionArgs()[3], "running");
|
assertEquals("running", selection.selectionArgs()[3]);
|
||||||
assertEquals(selection.selectionArgs()[4], "road biking");
|
assertEquals("road biking", selection.selectionArgs()[4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -172,11 +172,11 @@ public class TrackSelectionTest extends TestCase {
|
|||||||
SelectionData selection = filter.buildSelection();
|
SelectionData selection = filter.buildSelection();
|
||||||
|
|
||||||
// Then
|
// Then
|
||||||
assertEquals(selection.selection(), "_id IN (?,?,?) AND starttime BETWEEN ? AND ?");
|
assertEquals("_id IN (?,?,?) AND starttime BETWEEN ? AND ?", selection.selection());
|
||||||
assertEquals(selection.selectionArgs().length, 5);
|
assertEquals(5, selection.selectionArgs().length);
|
||||||
assertEquals(selection.selectionArgs()[0], "1");
|
assertEquals("1", selection.selectionArgs()[0]);
|
||||||
assertEquals(selection.selectionArgs()[1], "2");
|
assertEquals("2", selection.selectionArgs()[1]);
|
||||||
assertEquals(selection.selectionArgs()[2], "3");
|
assertEquals("3", selection.selectionArgs()[2]);
|
||||||
assertEquals(selection.selectionArgs()[3], Long.toString(instant.toEpochMilli()));
|
assertEquals(selection.selectionArgs()[3], Long.toString(instant.toEpochMilli()));
|
||||||
assertEquals(selection.selectionArgs()[4], Long.toString(instant.toEpochMilli() + oneDay));
|
assertEquals(selection.selectionArgs()[4], Long.toString(instant.toEpochMilli() + oneDay));
|
||||||
}
|
}
|
||||||
@@ -196,10 +196,10 @@ public class TrackSelectionTest extends TestCase {
|
|||||||
SelectionData selection = filter.buildSelection();
|
SelectionData selection = filter.buildSelection();
|
||||||
|
|
||||||
// Then
|
// Then
|
||||||
assertEquals(selection.selection(), "category IN (?,?) AND starttime BETWEEN ? AND ?");
|
assertEquals("category IN (?,?) AND starttime BETWEEN ? AND ?", selection.selection());
|
||||||
assertEquals(selection.selectionArgs().length, 4);
|
assertEquals(4, selection.selectionArgs().length);
|
||||||
assertEquals(selection.selectionArgs()[0], "running");
|
assertEquals("running", selection.selectionArgs()[0]);
|
||||||
assertEquals(selection.selectionArgs()[1], "road biking");
|
assertEquals("road biking", selection.selectionArgs()[1]);
|
||||||
assertEquals(selection.selectionArgs()[2], Long.toString(instant.toEpochMilli()));
|
assertEquals(selection.selectionArgs()[2], Long.toString(instant.toEpochMilli()));
|
||||||
assertEquals(selection.selectionArgs()[3], Long.toString(instant.toEpochMilli() + oneDay));
|
assertEquals(selection.selectionArgs()[3], Long.toString(instant.toEpochMilli() + oneDay));
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -21,7 +21,7 @@ public class DistanceFormatterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testFormatDistance_metric() {
|
public void testFormatDistance_metric() {
|
||||||
DistanceFormatter formatter = DistanceFormatter.Builder()
|
DistanceFormatter formatter = DistanceFormatter.Builder()
|
||||||
.setDecimalCount(2)
|
.setDecimalPlaces(2)
|
||||||
.setUnit(UnitSystem.METRIC)
|
.setUnit(UnitSystem.METRIC)
|
||||||
.build(context);
|
.build(context);
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public class DistanceFormatterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testFormatDistance_imperial() {
|
public void testFormatDistance_imperial() {
|
||||||
DistanceFormatter formatter = DistanceFormatter.Builder()
|
DistanceFormatter formatter = DistanceFormatter.Builder()
|
||||||
.setDecimalCount(2)
|
.setDecimalPlaces(2)
|
||||||
.setUnit(UnitSystem.IMPERIAL_FEET)
|
.setUnit(UnitSystem.IMPERIAL_FEET)
|
||||||
.build(context);
|
.build(context);
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ public class DistanceFormatterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testFormatDistance_nautical() {
|
public void testFormatDistance_nautical() {
|
||||||
DistanceFormatter formatter = DistanceFormatter.Builder()
|
DistanceFormatter formatter = DistanceFormatter.Builder()
|
||||||
.setDecimalCount(2)
|
.setDecimalPlaces(2)
|
||||||
.setUnit(UnitSystem.NAUTICAL_IMPERIAL)
|
.setUnit(UnitSystem.NAUTICAL_IMPERIAL)
|
||||||
.build(context);
|
.build(context);
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ public class SpeedFormatterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetSpeedParts_pace_metric() {
|
public void testGetSpeedParts_pace_metric() {
|
||||||
SpeedFormatter formatter = SpeedFormatter.Builder()
|
SpeedFormatter formatter = SpeedFormatter.Builder()
|
||||||
.setDecimalCount(2)
|
|
||||||
.setUnit(UnitSystem.METRIC)
|
.setUnit(UnitSystem.METRIC)
|
||||||
.setReportSpeedOrPace(false)
|
.setReportSpeedOrPace(false)
|
||||||
.build(context);
|
.build(context);
|
||||||
@@ -35,7 +34,6 @@ public class SpeedFormatterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetSpeedParts_pace_imperial() {
|
public void testGetSpeedParts_pace_imperial() {
|
||||||
SpeedFormatter formatter = SpeedFormatter.Builder()
|
SpeedFormatter formatter = SpeedFormatter.Builder()
|
||||||
.setDecimalCount(2)
|
|
||||||
.setUnit(UnitSystem.IMPERIAL_FEET)
|
.setUnit(UnitSystem.IMPERIAL_FEET)
|
||||||
.setReportSpeedOrPace(false)
|
.setReportSpeedOrPace(false)
|
||||||
.build(context);
|
.build(context);
|
||||||
@@ -47,7 +45,6 @@ public class SpeedFormatterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetSpeedParts_pace_nautical() {
|
public void testGetSpeedParts_pace_nautical() {
|
||||||
SpeedFormatter formatter = SpeedFormatter.Builder()
|
SpeedFormatter formatter = SpeedFormatter.Builder()
|
||||||
.setDecimalCount(2)
|
|
||||||
.setUnit(UnitSystem.NAUTICAL_IMPERIAL)
|
.setUnit(UnitSystem.NAUTICAL_IMPERIAL)
|
||||||
.setReportSpeedOrPace(false)
|
.setReportSpeedOrPace(false)
|
||||||
.build(context);
|
.build(context);
|
||||||
@@ -59,7 +56,6 @@ public class SpeedFormatterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetSpeedParts_speed_metric() {
|
public void testGetSpeedParts_speed_metric() {
|
||||||
SpeedFormatter formatter = SpeedFormatter.Builder()
|
SpeedFormatter formatter = SpeedFormatter.Builder()
|
||||||
.setDecimalCount(2)
|
|
||||||
.setUnit(UnitSystem.METRIC)
|
.setUnit(UnitSystem.METRIC)
|
||||||
.setReportSpeedOrPace(true)
|
.setReportSpeedOrPace(true)
|
||||||
.build(context);
|
.build(context);
|
||||||
@@ -71,7 +67,6 @@ public class SpeedFormatterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetSpeedParts_speed_imperial() {
|
public void testGetSpeedParts_speed_imperial() {
|
||||||
SpeedFormatter formatter = SpeedFormatter.Builder()
|
SpeedFormatter formatter = SpeedFormatter.Builder()
|
||||||
.setDecimalCount(2)
|
|
||||||
.setUnit(UnitSystem.IMPERIAL_FEET)
|
.setUnit(UnitSystem.IMPERIAL_FEET)
|
||||||
.setReportSpeedOrPace(true)
|
.setReportSpeedOrPace(true)
|
||||||
.build(context);
|
.build(context);
|
||||||
@@ -83,7 +78,6 @@ public class SpeedFormatterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetSpeedParts_speed_nautical() {
|
public void testGetSpeedParts_speed_nautical() {
|
||||||
SpeedFormatter formatter = SpeedFormatter.Builder()
|
SpeedFormatter formatter = SpeedFormatter.Builder()
|
||||||
.setDecimalCount(2)
|
|
||||||
.setUnit(UnitSystem.NAUTICAL_IMPERIAL)
|
.setUnit(UnitSystem.NAUTICAL_IMPERIAL)
|
||||||
.setReportSpeedOrPace(true)
|
.setReportSpeedOrPace(true)
|
||||||
.build(context);
|
.build(context);
|
||||||
@@ -95,7 +89,6 @@ public class SpeedFormatterTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testFormatSpeed() {
|
public void testFormatSpeed() {
|
||||||
SpeedFormatter formatter = SpeedFormatter.Builder()
|
SpeedFormatter formatter = SpeedFormatter.Builder()
|
||||||
.setDecimalCount(2)
|
|
||||||
.setUnit(UnitSystem.METRIC)
|
.setUnit(UnitSystem.METRIC)
|
||||||
.setReportSpeedOrPace(false)
|
.setReportSpeedOrPace(false)
|
||||||
.build(context);
|
.build(context);
|
||||||
|
|||||||
+3
-2
@@ -9,6 +9,7 @@ import java.util.Collection;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import de.dennisguse.opentracks.data.models.Statistics;
|
||||||
import de.dennisguse.opentracks.data.models.Track;
|
import de.dennisguse.opentracks.data.models.Track;
|
||||||
|
|
||||||
//TODO Merge with TrackFilenameGeneratorTest whenever Junit5 gets available.
|
//TODO Merge with TrackFilenameGeneratorTest whenever Junit5 gets available.
|
||||||
@@ -36,9 +37,9 @@ public class TrackFilenameGenerator2Test {
|
|||||||
Track track = new Track();
|
Track track = new Track();
|
||||||
track.setName("Best Track");
|
track.setName("Best Track");
|
||||||
track.setUuid(UUID.fromString("f81d4fae-7dec-11d0-a765-00a0c91e6bf6"));
|
track.setUuid(UUID.fromString("f81d4fae-7dec-11d0-a765-00a0c91e6bf6"));
|
||||||
track.getTrackStatistics().setStartTime(Instant.parse("2020-02-02T02:02:02Z"));
|
track.setStatistics(new Statistics(Instant.parse("2020-02-02T02:02:02Z"), null, null, null, null, null, null, null, null, null));
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String filename = subject.format(track, TrackFileFormat.GPX);
|
subject.format(track, TrackFileFormat.GPX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-1
@@ -17,6 +17,7 @@ import java.util.UUID;
|
|||||||
|
|
||||||
import de.dennisguse.opentracks.R;
|
import de.dennisguse.opentracks.R;
|
||||||
import de.dennisguse.opentracks.TimezoneRule;
|
import de.dennisguse.opentracks.TimezoneRule;
|
||||||
|
import de.dennisguse.opentracks.data.models.Statistics;
|
||||||
import de.dennisguse.opentracks.data.models.Track;
|
import de.dennisguse.opentracks.data.models.Track;
|
||||||
|
|
||||||
@RunWith(Parameterized.class)
|
@RunWith(Parameterized.class)
|
||||||
@@ -50,7 +51,7 @@ public class TrackFilenameGeneratorTest {
|
|||||||
Track track = new Track();
|
Track track = new Track();
|
||||||
track.setName("Best Track");
|
track.setName("Best Track");
|
||||||
track.setUuid(UUID.fromString("0000fee0-0000-1000-8000-00805f9b34fb"));
|
track.setUuid(UUID.fromString("0000fee0-0000-1000-8000-00805f9b34fb"));
|
||||||
track.getTrackStatistics().setStartTime(Instant.parse("2020-02-02T02:02:02Z"));
|
track.setStatistics(new Statistics(Instant.parse("2020-02-02T02:02:02Z"), null, null, null, null, null, null, null, null, null));
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String filename = subject.format(track, TrackFileFormat.GPX);
|
String filename = subject.format(track, TrackFileFormat.GPX);
|
||||||
|
|||||||
+40
-53
@@ -60,6 +60,7 @@ import de.dennisguse.opentracks.data.models.Marker;
|
|||||||
import de.dennisguse.opentracks.data.models.Position;
|
import de.dennisguse.opentracks.data.models.Position;
|
||||||
import de.dennisguse.opentracks.data.models.Power;
|
import de.dennisguse.opentracks.data.models.Power;
|
||||||
import de.dennisguse.opentracks.data.models.Speed;
|
import de.dennisguse.opentracks.data.models.Speed;
|
||||||
|
import de.dennisguse.opentracks.data.models.Statistics;
|
||||||
import de.dennisguse.opentracks.data.models.Track;
|
import de.dennisguse.opentracks.data.models.Track;
|
||||||
import de.dennisguse.opentracks.data.models.TrackPoint;
|
import de.dennisguse.opentracks.data.models.TrackPoint;
|
||||||
import de.dennisguse.opentracks.io.file.TrackFileFormat;
|
import de.dennisguse.opentracks.io.file.TrackFileFormat;
|
||||||
@@ -75,7 +76,6 @@ import de.dennisguse.opentracks.sensors.sensorData.Raw;
|
|||||||
import de.dennisguse.opentracks.sensors.sensorData.SensorDataSet;
|
import de.dennisguse.opentracks.sensors.sensorData.SensorDataSet;
|
||||||
import de.dennisguse.opentracks.services.TrackRecordingService;
|
import de.dennisguse.opentracks.services.TrackRecordingService;
|
||||||
import de.dennisguse.opentracks.services.handlers.TrackPointCreator;
|
import de.dennisguse.opentracks.services.handlers.TrackPointCreator;
|
||||||
import de.dennisguse.opentracks.stats.TrackStatistics;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Export a track to {@link TrackFileFormat} and verify that the import is identical.
|
* Export a track to {@link TrackFileFormat} and verify that the import is identical.
|
||||||
@@ -203,20 +203,20 @@ public class ExportImportTest {
|
|||||||
setUp();
|
setUp();
|
||||||
|
|
||||||
Track track = contentProviderUtils.getTrack(trackId);
|
Track track = contentProviderUtils.getTrack(trackId);
|
||||||
TrackStatistics trackStatistics = track.getTrackStatistics();
|
Statistics trackStatistics = track.getStatistics();
|
||||||
|
|
||||||
assertEquals(ZoneOffset.of("+01:00"), track.getZoneOffset());
|
assertEquals(ZoneOffset.of("+01:00"), track.getZoneOffset());
|
||||||
assertEquals(Instant.parse("2020-02-02T02:02:02Z"), trackStatistics.getStartTime());
|
assertEquals(Instant.parse("2020-02-02T02:02:02Z"), trackStatistics.startTime());
|
||||||
assertEquals(Instant.parse("2020-02-02T02:04:00Z"), trackStatistics.getStopTime());
|
assertEquals(Instant.parse("2020-02-02T02:04:00Z"), trackStatistics.stopTime());
|
||||||
|
|
||||||
assertEquals(Duration.ofSeconds(56), trackStatistics.getTotalTime());
|
assertEquals(Duration.ofSeconds(56), trackStatistics.totalTime());
|
||||||
assertEquals(Duration.ofSeconds(26), trackStatistics.getMovingTime()); //TODO Likely too low
|
assertEquals(Duration.ofSeconds(26), trackStatistics.movingTime()); //TODO Likely too low
|
||||||
|
|
||||||
// Distance
|
// Distance
|
||||||
assertEquals(222049.34375, trackStatistics.getTotalDistance().toM(), 0.01); //TODO Too low
|
assertEquals(222049.34375, trackStatistics.totalDistance().toM(), 0.01); //TODO Too low
|
||||||
|
|
||||||
// Speed
|
// Speed
|
||||||
assertEquals(8540.359, trackStatistics.getMaxSpeed().toMPS(), 0.01);
|
assertEquals(8540.359, trackStatistics.maxSpeed().toMPS(), 0.01);
|
||||||
assertEquals(3965.166, trackStatistics.getAverageSpeed().toMPS(), 0.01);
|
assertEquals(3965.166, trackStatistics.getAverageSpeed().toMPS(), 0.01);
|
||||||
assertEquals(8540.359, trackStatistics.getAverageMovingSpeed().toMPS(), 0.01);
|
assertEquals(8540.359, trackStatistics.getAverageMovingSpeed().toMPS(), 0.01);
|
||||||
|
|
||||||
@@ -224,8 +224,8 @@ public class ExportImportTest {
|
|||||||
assertEquals(999.122, trackStatistics.getMinAltitude(), 0.01);
|
assertEquals(999.122, trackStatistics.getMinAltitude(), 0.01);
|
||||||
assertEquals(1020.25, trackStatistics.getMaxAltitude(), 0.01);
|
assertEquals(1020.25, trackStatistics.getMaxAltitude(), 0.01);
|
||||||
|
|
||||||
assertEquals(2, trackStatistics.getTotalAltitudeGain(), 0.01);
|
assertEquals(2, trackStatistics.altitudeGainLoss().gain_m(), 0.01);
|
||||||
assertEquals(2, trackStatistics.getTotalAltitudeLoss(), 0.01);
|
assertEquals(2, trackStatistics.altitudeGainLoss().loss_m(), 0.01);
|
||||||
|
|
||||||
List<TrackPoint> actual = TestDataUtil.getTrackPoints(contentProviderUtils, trackId);
|
List<TrackPoint> actual = TestDataUtil.getTrackPoints(contentProviderUtils, trackId);
|
||||||
new TrackPointAssert().assertEquals(List.of(
|
new TrackPointAssert().assertEquals(List.of(
|
||||||
@@ -237,17 +237,14 @@ public class ExportImportTest {
|
|||||||
Altitude.WGS84.of(1020.25), null,
|
Altitude.WGS84.of(1020.25), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeLoss(1f)
|
.setAltitudeGainLoss(1, 1),
|
||||||
.setAltitudeGain(1f),
|
|
||||||
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||||
Instant.parse("2020-02-02T02:02:04Z"))
|
Instant.parse("2020-02-02T02:02:04Z"))
|
||||||
.setSensorDistance(Distance.of(10))
|
.setSensorDistance(Distance.of(10))
|
||||||
.setSpeed(Speed.of(15))
|
.setSpeed(Speed.of(15))
|
||||||
.setHeartRate(HeartRate.of(66))
|
.setHeartRate(HeartRate.of(66))
|
||||||
.setCadence(3)
|
.setCadence(3)
|
||||||
.setPower(50)
|
.setPower(50).setAltitudeGainLoss(1, 1),
|
||||||
.setAltitudeLoss(1f)
|
|
||||||
.setAltitudeGain(1f),
|
|
||||||
new TrackPoint(TrackPoint.Type.TRACKPOINT, Instant.parse("2020-02-02T02:02:15Z"))
|
new TrackPoint(TrackPoint.Type.TRACKPOINT, Instant.parse("2020-02-02T02:02:15Z"))
|
||||||
.setHeartRate(HeartRate.of(68))
|
.setHeartRate(HeartRate.of(68))
|
||||||
.setCadence(3)
|
.setCadence(3)
|
||||||
@@ -260,8 +257,7 @@ public class ExportImportTest {
|
|||||||
null,
|
null,
|
||||||
Speed.of(5)))
|
Speed.of(5)))
|
||||||
.setSensorDistance(Distance.of(2))
|
.setSensorDistance(Distance.of(2))
|
||||||
.setAltitudeLoss(0f)
|
.setAltitudeGainLoss(0, 0)
|
||||||
.setAltitudeGain(0f)
|
|
||||||
.setHeartRate(HeartRate.of(69))
|
.setHeartRate(HeartRate.of(69))
|
||||||
.setCadence(3)
|
.setCadence(3)
|
||||||
.setPower(50),
|
.setPower(50),
|
||||||
@@ -274,27 +270,23 @@ public class ExportImportTest {
|
|||||||
Altitude.WGS84.of(999.1229858398438), null,
|
Altitude.WGS84.of(999.1229858398438), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeLoss(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeGain(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_AUTOMATIC,
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_AUTOMATIC,
|
||||||
new Position(Instant.parse("2020-02-02T02:03:22Z"),
|
new Position(Instant.parse("2020-02-02T02:03:22Z"),
|
||||||
3.123456, 16d, Distance.of(10),
|
3.123456, 16d, Distance.of(10),
|
||||||
Altitude.WGS84.of(999.1229858398438), null,
|
Altitude.WGS84.of(999.1229858398438), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeLoss(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeGain(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.IDLE, Instant.parse("2020-02-02T02:03:30Z"))
|
new TrackPoint(TrackPoint.Type.IDLE, Instant.parse("2020-02-02T02:03:30Z"))
|
||||||
.setAltitudeLoss(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeGain(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse("2020-02-02T02:03:50Z"),
|
Instant.parse("2020-02-02T02:03:50Z"),
|
||||||
3.123456, 16.001, Distance.of(10),
|
3.123456, 16.001, Distance.of(10),
|
||||||
Altitude.WGS84.of(999.1229858398438), null,
|
Altitude.WGS84.of(999.1229858398438), null,
|
||||||
null, Speed.of(15)))
|
null, Speed.of(15)))
|
||||||
.setAltitudeLoss(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeGain(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse("2020-02-02T02:04:00Z"))
|
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse("2020-02-02T02:04:00Z"))
|
||||||
), actual);
|
), actual);
|
||||||
}
|
}
|
||||||
@@ -334,29 +326,29 @@ public class ExportImportTest {
|
|||||||
a.assertEquals(trackPoints, actual);
|
a.assertEquals(trackPoints, actual);
|
||||||
|
|
||||||
// 3. trackstatistics
|
// 3. trackstatistics
|
||||||
TrackStatistics importedTrackStatistics = importedTrack.getTrackStatistics();
|
Statistics importedTrackStatistics = importedTrack.getStatistics();
|
||||||
|
|
||||||
// Time
|
// Time
|
||||||
assertEquals(track.getZoneOffset(), importedTrack.getZoneOffset());
|
assertEquals(track.getZoneOffset(), importedTrack.getZoneOffset());
|
||||||
assertEquals(Instant.parse("2020-02-02T02:02:02Z"), importedTrackStatistics.getStartTime());
|
assertEquals(Instant.parse("2020-02-02T02:02:02Z"), importedTrackStatistics.startTime());
|
||||||
assertEquals(Instant.parse("2020-02-02T02:04:00Z"), importedTrackStatistics.getStopTime());
|
assertEquals(Instant.parse("2020-02-02T02:04:00Z"), importedTrackStatistics.stopTime());
|
||||||
|
|
||||||
assertEquals(Duration.ofSeconds(56), importedTrackStatistics.getTotalTime());
|
assertEquals(Duration.ofSeconds(56), importedTrackStatistics.totalTime());
|
||||||
assertEquals(Duration.ofSeconds(26), importedTrackStatistics.getMovingTime());
|
assertEquals(Duration.ofSeconds(26), importedTrackStatistics.movingTime());
|
||||||
|
|
||||||
// Distance
|
// Distance
|
||||||
assertEquals(222049.421, importedTrackStatistics.getTotalDistance().toM(), 0.01);
|
assertEquals(222049.421, importedTrackStatistics.totalDistance().toM(), 0.01);
|
||||||
|
|
||||||
// Speed
|
// Speed
|
||||||
assertEquals(8540.362, importedTrackStatistics.getMaxSpeed().toMPS(), 0.01);
|
assertEquals(8540.362, importedTrackStatistics.maxSpeed().toMPS(), 0.01);
|
||||||
assertEquals(3965.168, importedTrackStatistics.getAverageSpeed().toMPS(), 0.01);
|
assertEquals(3965.168, importedTrackStatistics.getAverageSpeed().toMPS(), 0.01);
|
||||||
assertEquals(8540.362, importedTrackStatistics.getAverageMovingSpeed().toMPS(), 0.01);
|
assertEquals(8540.362, importedTrackStatistics.getAverageMovingSpeed().toMPS(), 0.01);
|
||||||
|
|
||||||
// Altitude
|
// Altitude
|
||||||
assertEquals(999.122, importedTrackStatistics.getMinAltitude(), 0.01);
|
assertEquals(999.122, importedTrackStatistics.getMinAltitude(), 0.01);
|
||||||
assertEquals(1020.25, importedTrackStatistics.getMaxAltitude(), 0.01);
|
assertEquals(1020.25, importedTrackStatistics.getMaxAltitude(), 0.01);
|
||||||
assertEquals(2, importedTrackStatistics.getTotalAltitudeGain(), 0.01);
|
assertEquals(2, importedTrackStatistics.altitudeGainLoss().gain_m(), 0.01);
|
||||||
assertEquals(2, importedTrackStatistics.getTotalAltitudeLoss(), 0.01);
|
assertEquals(2, importedTrackStatistics.altitudeGainLoss().loss_m(), 0.01);
|
||||||
|
|
||||||
|
|
||||||
// 4. markers
|
// 4. markers
|
||||||
@@ -433,8 +425,7 @@ public class ExportImportTest {
|
|||||||
Altitude.WGS84.of(1020.2), null,
|
Altitude.WGS84.of(1020.2), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeLoss(1f)
|
.setAltitudeGainLoss(1, 1),
|
||||||
.setAltitudeGain(1f),
|
|
||||||
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse("2020-02-02T02:02:17Z"),
|
Instant.parse("2020-02-02T02:02:17Z"),
|
||||||
@@ -442,8 +433,7 @@ public class ExportImportTest {
|
|||||||
Altitude.WGS84.of(1020.2), null,
|
Altitude.WGS84.of(1020.2), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(5)))
|
Speed.of(5)))
|
||||||
.setAltitudeLoss(1f)
|
.setAltitudeGainLoss(1, 1)
|
||||||
.setAltitudeGain(1f)
|
|
||||||
.setSensorDistance(Distance.of(12))
|
.setSensorDistance(Distance.of(12))
|
||||||
.setHeartRate(69)
|
.setHeartRate(69)
|
||||||
.setPower(50f)
|
.setPower(50f)
|
||||||
@@ -455,8 +445,7 @@ public class ExportImportTest {
|
|||||||
Altitude.WGS84.of(999.0999755859375), null,
|
Altitude.WGS84.of(999.0999755859375), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeLoss(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeGain(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_AUTOMATIC,
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_AUTOMATIC,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse("2020-02-02T02:03:22Z"),
|
Instant.parse("2020-02-02T02:03:22Z"),
|
||||||
@@ -464,8 +453,7 @@ public class ExportImportTest {
|
|||||||
Altitude.WGS84.of(999.0999755859375), null,
|
Altitude.WGS84.of(999.0999755859375), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeLoss(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeGain(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse("2020-02-02T02:03:50Z"),
|
Instant.parse("2020-02-02T02:03:50Z"),
|
||||||
@@ -473,35 +461,34 @@ public class ExportImportTest {
|
|||||||
Altitude.WGS84.of(999.0999755859375), null,
|
Altitude.WGS84.of(999.0999755859375), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(10)))
|
Speed.of(10)))
|
||||||
.setAltitudeLoss(0f)
|
.setAltitudeGainLoss(0, 0)
|
||||||
.setAltitudeGain(0f)
|
|
||||||
.setSpeed(Speed.of(15))
|
.setSpeed(Speed.of(15))
|
||||||
), actual);
|
), actual);
|
||||||
|
|
||||||
// 3. trackstatistics
|
// 3. trackstatistics
|
||||||
TrackStatistics importedTrackStatistics = importedTrack.getTrackStatistics();
|
Statistics importedTrackStatistics = importedTrack.getStatistics();
|
||||||
|
|
||||||
// Time
|
// Time
|
||||||
assertEquals(track.getZoneOffset(), importedTrack.getZoneOffset());
|
assertEquals(track.getZoneOffset(), importedTrack.getZoneOffset());
|
||||||
assertEquals(Instant.parse("2020-02-02T02:02:03Z"), importedTrackStatistics.getStartTime());
|
assertEquals(Instant.parse("2020-02-02T02:02:03Z"), importedTrackStatistics.startTime());
|
||||||
assertEquals(Instant.parse("2020-02-02T02:03:50Z"), importedTrackStatistics.getStopTime());
|
assertEquals(Instant.parse("2020-02-02T02:03:50Z"), importedTrackStatistics.stopTime());
|
||||||
|
|
||||||
assertEquals(Duration.ofSeconds(107), importedTrackStatistics.getTotalTime());
|
assertEquals(Duration.ofSeconds(107), importedTrackStatistics.totalTime());
|
||||||
assertEquals(Duration.ofSeconds(107), importedTrackStatistics.getMovingTime());
|
assertEquals(Duration.ofSeconds(107), importedTrackStatistics.movingTime());
|
||||||
|
|
||||||
// Distance
|
// Distance
|
||||||
assertEquals(222271.734, importedTrackStatistics.getTotalDistance().toM(), 0.01);
|
assertEquals(222271.734, importedTrackStatistics.totalDistance().toM(), 0.01);
|
||||||
|
|
||||||
// Speed
|
// Speed
|
||||||
assertEquals(2077.305, importedTrackStatistics.getMaxSpeed().toMPS(), 0.01);
|
assertEquals(2077.305, importedTrackStatistics.maxSpeed().toMPS(), 0.01);
|
||||||
assertEquals(2077.305, importedTrackStatistics.getAverageSpeed().toMPS(), 0.01);
|
assertEquals(2077.305, importedTrackStatistics.getAverageSpeed().toMPS(), 0.01);
|
||||||
assertEquals(2077.305, importedTrackStatistics.getAverageMovingSpeed().toMPS(), 0.01);
|
assertEquals(2077.305, importedTrackStatistics.getAverageMovingSpeed().toMPS(), 0.01);
|
||||||
|
|
||||||
// Altitude
|
// Altitude
|
||||||
assertEquals(999.099, importedTrackStatistics.getMinAltitude(), 0.01);
|
assertEquals(999.099, importedTrackStatistics.getMinAltitude(), 0.01);
|
||||||
assertEquals(1020.2, importedTrackStatistics.getMaxAltitude(), 0.01);
|
assertEquals(1020.2, importedTrackStatistics.getMaxAltitude(), 0.01);
|
||||||
assertEquals(2, importedTrackStatistics.getTotalAltitudeGain(), 0.01);
|
assertEquals(2, importedTrackStatistics.altitudeGainLoss().gain_m(), 0.01);
|
||||||
assertEquals(2, importedTrackStatistics.getTotalAltitudeLoss(), 0.01);
|
assertEquals(2, importedTrackStatistics.altitudeGainLoss().loss_m(), 0.01);
|
||||||
|
|
||||||
// 4. markers
|
// 4. markers
|
||||||
assertMarkers();
|
assertMarkers();
|
||||||
|
|||||||
+12
-17
@@ -30,11 +30,11 @@ import de.dennisguse.opentracks.data.models.Altitude;
|
|||||||
import de.dennisguse.opentracks.data.models.Distance;
|
import de.dennisguse.opentracks.data.models.Distance;
|
||||||
import de.dennisguse.opentracks.data.models.Position;
|
import de.dennisguse.opentracks.data.models.Position;
|
||||||
import de.dennisguse.opentracks.data.models.Speed;
|
import de.dennisguse.opentracks.data.models.Speed;
|
||||||
|
import de.dennisguse.opentracks.data.models.Statistics;
|
||||||
import de.dennisguse.opentracks.data.models.Track;
|
import de.dennisguse.opentracks.data.models.Track;
|
||||||
import de.dennisguse.opentracks.data.models.TrackPoint;
|
import de.dennisguse.opentracks.data.models.TrackPoint;
|
||||||
import de.dennisguse.opentracks.io.file.TrackFileFormat;
|
import de.dennisguse.opentracks.io.file.TrackFileFormat;
|
||||||
import de.dennisguse.opentracks.io.file.exporter.TrackExporter;
|
import de.dennisguse.opentracks.io.file.exporter.TrackExporter;
|
||||||
import de.dennisguse.opentracks.stats.TrackStatistics;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test that legacy KML/GPX formats can still be imported.
|
* Test that legacy KML/GPX formats can still be imported.
|
||||||
@@ -149,9 +149,9 @@ public class GPXTrackImporterTest {
|
|||||||
assertEquals(ActivityType.UNKNOWN, importedTrack.getActivityType());
|
assertEquals(ActivityType.UNKNOWN, importedTrack.getActivityType());
|
||||||
|
|
||||||
// 3. trackstatistics
|
// 3. trackstatistics
|
||||||
TrackStatistics trackStatistics = importedTrack.getTrackStatistics();
|
Statistics trackStatistics = importedTrack.getStatistics();
|
||||||
assertEquals(0.75, trackStatistics.getMaxSpeed().toMPS(), 0.01);
|
assertEquals(0.75, trackStatistics.maxSpeed().toMPS(), 0.01);
|
||||||
assertEquals(Duration.ofSeconds(101), trackStatistics.getMovingTime());
|
assertEquals(Duration.ofSeconds(101), trackStatistics.movingTime());
|
||||||
|
|
||||||
// 4. trackpoints
|
// 4. trackpoints
|
||||||
List<TrackPoint> importedTrackPoints = TestDataUtil.getTrackPoints(contentProviderUtils, importTrackId);
|
List<TrackPoint> importedTrackPoints = TestDataUtil.getTrackPoints(contentProviderUtils, importTrackId);
|
||||||
@@ -204,9 +204,9 @@ public class GPXTrackImporterTest {
|
|||||||
assertEquals(ActivityType.UNKNOWN, importedTrack.getActivityType());
|
assertEquals(ActivityType.UNKNOWN, importedTrack.getActivityType());
|
||||||
|
|
||||||
// 3. trackstatistics
|
// 3. trackstatistics
|
||||||
TrackStatistics trackStatistics = importedTrack.getTrackStatistics();
|
Statistics trackStatistics = importedTrack.getStatistics();
|
||||||
assertEquals(5.0, trackStatistics.getMaxSpeed().toMPS(), 0.01);
|
assertEquals(5.0, trackStatistics.maxSpeed().toMPS(), 0.01);
|
||||||
assertEquals(Duration.ofSeconds(101), trackStatistics.getMovingTime());
|
assertEquals(Duration.ofSeconds(101), trackStatistics.movingTime());
|
||||||
|
|
||||||
// 4. trackpoints
|
// 4. trackpoints
|
||||||
List<TrackPoint> importedTrackPoints = TestDataUtil.getTrackPoints(contentProviderUtils, importTrackId);
|
List<TrackPoint> importedTrackPoints = TestDataUtil.getTrackPoints(contentProviderUtils, importTrackId);
|
||||||
@@ -267,8 +267,7 @@ public class GPXTrackImporterTest {
|
|||||||
Altitude.WGS84.of(10), null,
|
Altitude.WGS84.of(10), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeLoss(1f)
|
.setAltitudeGainLoss(1, 1),
|
||||||
.setAltitudeGain(1f),
|
|
||||||
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse("2020-02-02T02:02:17Z"),
|
Instant.parse("2020-02-02T02:02:17Z"),
|
||||||
@@ -276,8 +275,7 @@ public class GPXTrackImporterTest {
|
|||||||
Altitude.WGS84.of(10), null,
|
Altitude.WGS84.of(10), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(5)))
|
Speed.of(5)))
|
||||||
.setAltitudeLoss(1f)
|
.setAltitudeGainLoss(1, 1)
|
||||||
.setAltitudeGain(1f)
|
|
||||||
.setSensorDistance(Distance.of(12))
|
.setSensorDistance(Distance.of(12))
|
||||||
.setHeartRate(69)
|
.setHeartRate(69)
|
||||||
.setPower(50f)
|
.setPower(50f)
|
||||||
@@ -289,8 +287,7 @@ public class GPXTrackImporterTest {
|
|||||||
Altitude.WGS84.of(10), null,
|
Altitude.WGS84.of(10), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeLoss(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeGain(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_AUTOMATIC,
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_AUTOMATIC,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse("2020-02-02T02:03:22Z"),
|
Instant.parse("2020-02-02T02:03:22Z"),
|
||||||
@@ -298,8 +295,7 @@ public class GPXTrackImporterTest {
|
|||||||
Altitude.WGS84.of(10), null,
|
Altitude.WGS84.of(10), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeLoss(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeGain(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse("2020-02-02T02:03:50Z"),
|
Instant.parse("2020-02-02T02:03:50Z"),
|
||||||
@@ -307,8 +303,7 @@ public class GPXTrackImporterTest {
|
|||||||
Altitude.WGS84.of(10), null,
|
Altitude.WGS84.of(10), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(10)))
|
Speed.of(10)))
|
||||||
.setAltitudeLoss(0f)
|
.setAltitudeGainLoss(0, 0)
|
||||||
.setAltitudeGain(0f)
|
|
||||||
.setSpeed(Speed.of(15))
|
.setSpeed(Speed.of(15))
|
||||||
), actual);
|
), actual);
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-11
@@ -189,24 +189,21 @@ public class KMLTrackImporterTest {
|
|||||||
12.340097, 1.234156, null,
|
12.340097, 1.234156, null,
|
||||||
Altitude.WGS84.of(469.286376953125), null,
|
Altitude.WGS84.of(469.286376953125), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(0.539)))
|
Speed.of(0.539))),
|
||||||
.setAltitudeGain(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse("2020-11-28T17:06:25.448Z"),
|
Instant.parse("2020-11-28T17:06:25.448Z"),
|
||||||
12.340036, 1.23415, null,
|
12.340036, 1.23415, null,
|
||||||
Altitude.WGS84.of(439.1626281738281), null,
|
Altitude.WGS84.of(439.1626281738281), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(0.1577)))
|
Speed.of(0.1577))),
|
||||||
.setAltitudeGain(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse("2020-11-28T17:06:47.888Z"),
|
Instant.parse("2020-11-28T17:06:47.888Z"),
|
||||||
12.340057, 1.23405, null,
|
12.340057, 1.23405, null,
|
||||||
Altitude.WGS84.of(421.8070983886719), null,
|
Altitude.WGS84.of(421.8070983886719), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(0)))
|
Speed.of(0))),
|
||||||
.setAltitudeGain(0f),
|
|
||||||
// created resume trackpoint with time of next valid trackpoint
|
// created resume trackpoint with time of next valid trackpoint
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_AUTOMATIC,
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_AUTOMATIC,
|
||||||
new Position(
|
new Position(
|
||||||
@@ -214,16 +211,14 @@ public class KMLTrackImporterTest {
|
|||||||
12.340057, 1.23405, null,
|
12.340057, 1.23405, null,
|
||||||
Altitude.WGS84.of(419.93902587890625), null,
|
Altitude.WGS84.of(419.93902587890625), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(0)))
|
Speed.of(0))),
|
||||||
.setAltitudeGain(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse("2020-11-28T17:06:56.905Z"),
|
Instant.parse("2020-11-28T17:06:56.905Z"),
|
||||||
12.340057, 1.23405, null,
|
12.340057, 1.23405, null,
|
||||||
Altitude.WGS84.of(419.9036560058594), null,
|
Altitude.WGS84.of(419.9036560058594), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(0)))
|
Speed.of(0))),
|
||||||
.setAltitudeGain(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse("2020-11-28T17:07:20.870Z"),
|
Instant.parse("2020-11-28T17:07:20.870Z"),
|
||||||
@@ -231,7 +226,6 @@ public class KMLTrackImporterTest {
|
|||||||
Altitude.WGS84.of(417.99432373046875), null,
|
Altitude.WGS84.of(417.99432373046875), null,
|
||||||
null,
|
null,
|
||||||
Speed.of(0)))
|
Speed.of(0)))
|
||||||
.setAltitudeGain(0f)
|
|
||||||
), importedTrackPoints);
|
), importedTrackPoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-9
@@ -20,8 +20,8 @@ public class TrackPointAssert {
|
|||||||
|
|
||||||
Assert.assertEquals("has location,", expected.hasLocation(), actual.hasLocation());
|
Assert.assertEquals("has location,", expected.hasLocation(), actual.hasLocation());
|
||||||
if (expected.hasLocation()) {
|
if (expected.hasLocation()) {
|
||||||
Assert.assertEquals("latitude", expected.getLatitude(), actual.getLatitude(), 0.001);
|
Assert.assertEquals("latitude", expected.getPosition().latitude(), actual.getPosition().latitude(), 0.001);
|
||||||
Assert.assertEquals("longitude", expected.getLongitude(), actual.getLongitude(), 0.001);
|
Assert.assertEquals("longitude", expected.getPosition().longitude(), actual.getPosition().longitude(), 0.001);
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.assertEquals("has altitude", expected.hasAltitude(), actual.hasAltitude());
|
Assert.assertEquals("has altitude", expected.hasAltitude(), actual.hasAltitude());
|
||||||
@@ -29,13 +29,9 @@ public class TrackPointAssert {
|
|||||||
Assert.assertEquals("altitude", expected.getAltitude().toM(), actual.getAltitude().toM(), delta);
|
Assert.assertEquals("altitude", expected.getAltitude().toM(), actual.getAltitude().toM(), delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.assertEquals("has altitudeGain", expected.hasAltitudeGain(), actual.hasAltitudeGain());
|
Assert.assertEquals("has altitudeGainLoss", expected.hasAltitudeGainLoss(), actual.hasAltitudeGainLoss());
|
||||||
if (expected.hasAltitudeGain()) {
|
if (expected.hasAltitudeGainLoss()) {
|
||||||
Assert.assertEquals("altitudeGain", expected.getAltitudeGain(), actual.getAltitudeGain(), delta);
|
Assert.assertEquals("altitudeGainLoss", expected.getAltitudeGainLoss(), actual.getAltitudeGainLoss());
|
||||||
}
|
|
||||||
Assert.assertEquals("has altitudeLoss", expected.hasAltitudeLoss(), actual.hasAltitudeLoss());
|
|
||||||
if (expected.hasAltitudeLoss()) {
|
|
||||||
Assert.assertEquals("altitudeLoss", expected.getAltitudeLoss(), actual.getAltitudeLoss(), delta);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.assertEquals("has speed", expected.hasSpeed(), actual.hasSpeed());
|
Assert.assertEquals("has speed", expected.hasSpeed(), actual.hasSpeed());
|
||||||
|
|||||||
@@ -1,50 +1,54 @@
|
|||||||
package de.dennisguse.opentracks.sensors;
|
package de.dennisguse.opentracks.sensors;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertThrows;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class UintUtilsTest {
|
public class UintUtilsTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void diff() {
|
public void diff_uint16_valid() {
|
||||||
assertEquals(0, UintUtils.diff(1, 1, UintUtils.UINT16_MAX));
|
assertEquals(0, UintUtils.diff(1, 1, UintUtils.UINT16_MAX));
|
||||||
assertEquals(1, UintUtils.diff(2, 1, UintUtils.UINT16_MAX));
|
assertEquals(1, UintUtils.diff(2, 1, UintUtils.UINT16_MAX));
|
||||||
assertEquals(3, UintUtils.diff(5, 2, UintUtils.UINT16_MAX));
|
assertEquals(3, UintUtils.diff(5, 2, UintUtils.UINT16_MAX));
|
||||||
assertEquals(65535, UintUtils.diff(1, 2, UintUtils.UINT16_MAX)); /* unsigned 16 arithmetic is modulo UINT16_MAX + 1, not modulo UINT16_MAX */
|
assertEquals(65535, UintUtils.diff(1, 2, UintUtils.UINT16_MAX)); /* unsigned 16 arithmetic is modulo UINT16_MAX + 1, not modulo UINT16_MAX */
|
||||||
assertEquals(65530, UintUtils.diff(UintUtils.UINT16_MAX, 5, UintUtils.UINT16_MAX));
|
assertEquals(65530, UintUtils.diff(UintUtils.UINT16_MAX, 5, UintUtils.UINT16_MAX));
|
||||||
|
|
||||||
/* Test modulo arithmetic for arguments that are out of range */
|
|
||||||
|
|
||||||
if (false) { /* false means UintUtils.diff() throws if arguments out of range */
|
|
||||||
assertEquals(0, UintUtils.diff(65537, 1, UintUtils.UINT16_MAX));
|
|
||||||
assertEquals(0, UintUtils.diff(1, 65537, UintUtils.UINT16_MAX));
|
|
||||||
assertEquals(0, UintUtils.diff(65537, 65537, UintUtils.UINT16_MAX));
|
|
||||||
assertEquals(0, UintUtils.diff(-65535, 1, UintUtils.UINT16_MAX));
|
|
||||||
assertEquals(0, UintUtils.diff(1, -65535, UintUtils.UINT16_MAX));
|
|
||||||
assertEquals(0, UintUtils.diff(-65535, -65535, UintUtils.UINT16_MAX));
|
|
||||||
assertEquals(0, UintUtils.diff(-65535, 65537, UintUtils.UINT16_MAX));
|
|
||||||
assertEquals(0, UintUtils.diff(65537, -65535, UintUtils.UINT16_MAX));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The following tests are the above, but for 32-bit unsigned. */
|
@Test
|
||||||
|
public void diff_uint16_invalid() {
|
||||||
|
/* Test modulo arithmetic for arguments that are out of range */
|
||||||
|
assertThrows(RuntimeException.class, () -> UintUtils.diff(65537, 1, UintUtils.UINT16_MAX));
|
||||||
|
assertThrows(RuntimeException.class, () -> UintUtils.diff(1, 65537, UintUtils.UINT16_MAX));
|
||||||
|
assertThrows(RuntimeException.class, () -> UintUtils.diff(65537, 65537, UintUtils.UINT16_MAX));
|
||||||
|
assertThrows(RuntimeException.class, () -> UintUtils.diff(-65535, 1, UintUtils.UINT16_MAX));
|
||||||
|
assertThrows(RuntimeException.class, () -> UintUtils.diff(1, -65535, UintUtils.UINT16_MAX));
|
||||||
|
assertThrows(RuntimeException.class, () -> UintUtils.diff(-65535, -65535, UintUtils.UINT16_MAX));
|
||||||
|
assertThrows(RuntimeException.class, () -> UintUtils.diff(-65535, 65537, UintUtils.UINT16_MAX));
|
||||||
|
assertThrows(RuntimeException.class, () -> UintUtils.diff(65537, -65535, UintUtils.UINT16_MAX));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void diff_uint32() {
|
||||||
assertEquals(0, UintUtils.diff(1, 1, UintUtils.UINT32_MAX));
|
assertEquals(0, UintUtils.diff(1, 1, UintUtils.UINT32_MAX));
|
||||||
assertEquals(1, UintUtils.diff(2, 1, UintUtils.UINT32_MAX));
|
assertEquals(1, UintUtils.diff(2, 1, UintUtils.UINT32_MAX));
|
||||||
assertEquals(3, UintUtils.diff(5, 2, UintUtils.UINT32_MAX));
|
assertEquals(3, UintUtils.diff(5, 2, UintUtils.UINT32_MAX));
|
||||||
assertEquals(4294967295L, UintUtils.diff(1, 2, UintUtils.UINT32_MAX));
|
assertEquals(4294967295L, UintUtils.diff(1, 2, UintUtils.UINT32_MAX));
|
||||||
assertEquals(4294967290L, UintUtils.diff(UintUtils.UINT32_MAX, 5, UintUtils.UINT32_MAX));
|
assertEquals(4294967290L, UintUtils.diff(UintUtils.UINT32_MAX, 5, UintUtils.UINT32_MAX));
|
||||||
|
|
||||||
if (false) { /* false means UintUtils.diff() throws if arguments out of range */
|
|
||||||
assertEquals(0, UintUtils.diff(4294967297L, 1, UintUtils.UINT32_MAX));
|
|
||||||
assertEquals(0, UintUtils.diff(1, 4294967297L, UintUtils.UINT32_MAX));
|
|
||||||
assertEquals(0, UintUtils.diff(4294967297L, 4294967297L, UintUtils.UINT32_MAX));
|
|
||||||
assertEquals(0, UintUtils.diff(-4294967295L, 1, UintUtils.UINT32_MAX));
|
|
||||||
assertEquals(0, UintUtils.diff(1, -4294967295L, UintUtils.UINT32_MAX));
|
|
||||||
assertEquals(0, UintUtils.diff(-4294967295L, -4294967295L, UintUtils.UINT32_MAX));
|
|
||||||
assertEquals(0, UintUtils.diff(-4294967295L, 4294967297L, UintUtils.UINT32_MAX));
|
|
||||||
assertEquals(0, UintUtils.diff(65537, -4294967297L, UintUtils.UINT32_MAX));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void diff_unint32_invalid() {
|
||||||
|
/* Test modulo arithmetic for arguments that are out of range */
|
||||||
|
assertThrows(RuntimeException.class, () -> UintUtils.diff(4294967297L, 1, UintUtils.UINT32_MAX));
|
||||||
|
assertThrows(RuntimeException.class, () -> UintUtils.diff(1, 4294967297L, UintUtils.UINT32_MAX));
|
||||||
|
assertThrows(RuntimeException.class, () -> UintUtils.diff(4294967297L, 4294967297L, UintUtils.UINT32_MAX));
|
||||||
|
assertThrows(RuntimeException.class, () -> UintUtils.diff(-4294967295L, 1, UintUtils.UINT32_MAX));
|
||||||
|
assertThrows(RuntimeException.class, () -> UintUtils.diff(1, -4294967295L, UintUtils.UINT32_MAX));
|
||||||
|
assertThrows(RuntimeException.class, () -> UintUtils.diff(-4294967295L, -4294967295L, UintUtils.UINT32_MAX));
|
||||||
|
assertThrows(RuntimeException.class, () -> UintUtils.diff(-4294967295L, 4294967297L, UintUtils.UINT32_MAX));
|
||||||
|
assertThrows(RuntimeException.class, () -> UintUtils.diff(65537, -4294967297L, UintUtils.UINT32_MAX));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+31
-15
@@ -16,23 +16,20 @@ import org.junit.runner.RunWith;
|
|||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import org.mockito.junit.MockitoJUnitRunner;
|
import org.mockito.junit.MockitoJUnitRunner;
|
||||||
|
|
||||||
|
import de.dennisguse.opentracks.data.models.Altitude;
|
||||||
import de.dennisguse.opentracks.data.models.Distance;
|
import de.dennisguse.opentracks.data.models.Distance;
|
||||||
|
import de.dennisguse.opentracks.data.models.Position;
|
||||||
import de.dennisguse.opentracks.data.models.Speed;
|
import de.dennisguse.opentracks.data.models.Speed;
|
||||||
|
import de.dennisguse.opentracks.data.models.Statistics;
|
||||||
|
import de.dennisguse.opentracks.data.models.Track;
|
||||||
import de.dennisguse.opentracks.data.models.TrackPoint;
|
import de.dennisguse.opentracks.data.models.TrackPoint;
|
||||||
import de.dennisguse.opentracks.settings.UnitSystem;
|
import de.dennisguse.opentracks.settings.UnitSystem;
|
||||||
import de.dennisguse.opentracks.stats.TrackStatistics;
|
|
||||||
|
|
||||||
@RunWith(MockitoJUnitRunner.class)
|
@RunWith(MockitoJUnitRunner.class)
|
||||||
public class TrackRecordingServiceNotificationManagerTest {
|
public class TrackRecordingServiceNotificationManagerTest {
|
||||||
|
|
||||||
private final Context context = ApplicationProvider.getApplicationContext();
|
private final Context context = ApplicationProvider.getApplicationContext();
|
||||||
|
|
||||||
@Mock
|
|
||||||
private TrackPoint trackPointMock;
|
|
||||||
|
|
||||||
@Mock
|
|
||||||
private TrackStatistics trackStatisticsMock;
|
|
||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
private NotificationCompat.Builder notificationCompatBuilder;
|
private NotificationCompat.Builder notificationCompatBuilder;
|
||||||
|
|
||||||
@@ -41,21 +38,40 @@ public class TrackRecordingServiceNotificationManagerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void updateLocation_triggersAlertOnlyOnFirstInaccurateLocation() {
|
public void updateLocation_triggersAlertOnlyOnFirstInaccurateLocation() {
|
||||||
when(trackPointMock.hasHorizontalAccuracy()).thenReturn(true);
|
TrackPoint trackPointMock = new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||||
when(trackPointMock.getHorizontalAccuracy()).thenReturn(Distance.of(999f));
|
new Position(
|
||||||
when(trackPointMock.getSpeed()).thenReturn(Speed.of(0));
|
null,
|
||||||
when(trackStatisticsMock.getTotalDistance()).thenReturn(Distance.of(0));
|
null, null, Distance.of(999f),
|
||||||
|
Altitude.WGS84.of(10), null,
|
||||||
|
null,
|
||||||
|
Speed.of(0))
|
||||||
|
);
|
||||||
|
|
||||||
when(notificationCompatBuilder.setOnlyAlertOnce(anyBoolean()))
|
when(notificationCompatBuilder.setOnlyAlertOnce(anyBoolean()))
|
||||||
.thenReturn(notificationCompatBuilder);
|
.thenReturn(notificationCompatBuilder);
|
||||||
|
|
||||||
TrackRecordingServiceNotificationManager subject = new TrackRecordingServiceNotificationManager(notificationManager, notificationCompatBuilder);
|
TrackRecordingServiceNotificationManager subject = new TrackRecordingServiceNotificationManager(notificationManager, notificationCompatBuilder);
|
||||||
subject.setUnitSystem(UnitSystem.METRIC);
|
subject.setUnitSystem(UnitSystem.METRIC);
|
||||||
|
|
||||||
|
Track track = new Track(new Statistics(
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
Distance.of(0),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
));
|
||||||
|
RecordingData data = new RecordingData(track, trackPointMock, null, null);
|
||||||
|
|
||||||
// when
|
// when
|
||||||
subject.updateTrackPoint(context, trackStatisticsMock, trackPointMock, Distance.of(100));
|
subject.updateTrackPoint(context, data, Distance.of(100));
|
||||||
subject.updateTrackPoint(context, trackStatisticsMock, trackPointMock, Distance.of(100));
|
subject.updateTrackPoint(context, data, Distance.of(100));
|
||||||
subject.updateTrackPoint(context, trackStatisticsMock, trackPointMock, Distance.of(1000));
|
subject.updateTrackPoint(context, data, Distance.of(1000));
|
||||||
subject.updateTrackPoint(context, trackStatisticsMock, trackPointMock, Distance.of(100));
|
subject.updateTrackPoint(context, data, Distance.of(100));
|
||||||
|
|
||||||
// then
|
// then
|
||||||
verify(notificationCompatBuilder, times(6)).setOnlyAlertOnce(true);
|
verify(notificationCompatBuilder, times(6)).setOnlyAlertOnce(true);
|
||||||
|
|||||||
+94
-95
@@ -5,8 +5,11 @@ import static org.junit.Assert.assertFalse;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.location.Location;
|
||||||
|
import android.location.LocationManager;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
|
||||||
|
import androidx.core.location.LocationManagerCompat;
|
||||||
import androidx.test.core.app.ApplicationProvider;
|
import androidx.test.core.app.ApplicationProvider;
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
import androidx.test.filters.MediumTest;
|
import androidx.test.filters.MediumTest;
|
||||||
@@ -30,11 +33,13 @@ import de.dennisguse.opentracks.R;
|
|||||||
import de.dennisguse.opentracks.TestUtil;
|
import de.dennisguse.opentracks.TestUtil;
|
||||||
import de.dennisguse.opentracks.content.data.TestDataUtil;
|
import de.dennisguse.opentracks.content.data.TestDataUtil;
|
||||||
import de.dennisguse.opentracks.data.ContentProviderUtils;
|
import de.dennisguse.opentracks.data.ContentProviderUtils;
|
||||||
|
import de.dennisguse.opentracks.data.models.AltitudeExtremities;
|
||||||
import de.dennisguse.opentracks.data.models.AltitudeGainLoss;
|
import de.dennisguse.opentracks.data.models.AltitudeGainLoss;
|
||||||
import de.dennisguse.opentracks.data.models.Distance;
|
import de.dennisguse.opentracks.data.models.Distance;
|
||||||
import de.dennisguse.opentracks.data.models.HeartRate;
|
import de.dennisguse.opentracks.data.models.HeartRate;
|
||||||
import de.dennisguse.opentracks.data.models.Position;
|
import de.dennisguse.opentracks.data.models.Position;
|
||||||
import de.dennisguse.opentracks.data.models.Speed;
|
import de.dennisguse.opentracks.data.models.Speed;
|
||||||
|
import de.dennisguse.opentracks.data.models.Statistics;
|
||||||
import de.dennisguse.opentracks.data.models.Track;
|
import de.dennisguse.opentracks.data.models.Track;
|
||||||
import de.dennisguse.opentracks.data.models.TrackPoint;
|
import de.dennisguse.opentracks.data.models.TrackPoint;
|
||||||
import de.dennisguse.opentracks.io.file.importer.TrackPointAssert;
|
import de.dennisguse.opentracks.io.file.importer.TrackPointAssert;
|
||||||
@@ -46,7 +51,6 @@ import de.dennisguse.opentracks.sensors.sensorData.AggregatorRunning;
|
|||||||
import de.dennisguse.opentracks.sensors.sensorData.Raw;
|
import de.dennisguse.opentracks.sensors.sensorData.Raw;
|
||||||
import de.dennisguse.opentracks.services.handlers.TrackPointCreator;
|
import de.dennisguse.opentracks.services.handlers.TrackPointCreator;
|
||||||
import de.dennisguse.opentracks.settings.PreferencesUtils;
|
import de.dennisguse.opentracks.settings.PreferencesUtils;
|
||||||
import de.dennisguse.opentracks.stats.TrackStatistics;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests insert location.
|
* Tests insert location.
|
||||||
@@ -106,8 +110,8 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
|
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(new TrackStatistics(startTime, startTime, 0, 0, 0, 0, null, null)
|
assertEquals(new Statistics(Instant.parse(startTime), Instant.parse(startTime), Duration.ZERO, Duration.ZERO, Distance.of(0), Speed.zero(), new AltitudeExtremities(0.0, 0.0), null, null, null)
|
||||||
, contentProviderUtils.getTrack(trackId).getTrackStatistics());
|
, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
new TrackPointAssert().assertEquals(List.of(
|
new TrackPointAssert().assertEquals(List.of(
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime))
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime))
|
||||||
@@ -120,14 +124,13 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
service.endCurrentTrack();
|
service.endCurrentTrack();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(new TrackStatistics(startTime, stopTime, 0, 1, 1, 0, 0f, 0f)
|
assertEquals(new Statistics(Instant.parse(startTime), Instant.parse(stopTime), Duration.ofSeconds(1), Duration.ofSeconds(1), Distance.of(0), Speed.zero(), new AltitudeExtremities(0.0, 0.0), new AltitudeGainLoss(0, 0), null, null)
|
||||||
, contentProviderUtils.getTrack(trackId).getTrackStatistics());
|
, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
new TrackPointAssert().assertEquals(List.of(
|
new TrackPointAssert().assertEquals(List.of(
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime)),
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime)),
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(stopTime))
|
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(stopTime))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0)
|
||||||
.setAltitudeLoss(0f)
|
|
||||||
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,10 +146,14 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
String startTime = "2020-02-02T02:02:02Z";
|
String startTime = "2020-02-02T02:02:02Z";
|
||||||
trackPointCreator.setClock(startTime);
|
trackPointCreator.setClock(startTime);
|
||||||
Track.Id trackId = service.startNewTrack();
|
Track.Id trackId = service.startNewTrack();
|
||||||
|
|
||||||
|
//We do not want the real GPS to interfere.
|
||||||
|
LocationManagerCompat.removeUpdates((LocationManager) context.getSystemService(Context.LOCATION_SERVICE), trackPointCreator.getSensorManager().getGpsManager());
|
||||||
|
|
||||||
String gps1 = "2020-02-02T02:02:03Z";
|
String gps1 = "2020-02-02T02:02:03Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps1, 45.0, 35.0, 1, 15);
|
sendGPSLocation(trackPointCreator, gps1, 45.0, 35.0, 1, 15);
|
||||||
String gps2 = "2020-02-02T02:02:04Z";
|
String gps2 = "2020-02-02T02:02:04Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps2, 45.0, 35.0, 1, 15);
|
sendGPSLocation(trackPointCreator, gps2, 45.0, 35.0, 1, 15);
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String idleTime = "2020-02-02T02:02:17Z";
|
String idleTime = "2020-02-02T02:02:17Z";
|
||||||
@@ -192,14 +199,13 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
service.endCurrentTrack();
|
service.endCurrentTrack();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(new TrackStatistics(startTime, pauseTime, 0, 1, 1, 0, 0f, 0f)
|
assertEquals(new Statistics(Instant.parse(startTime), Instant.parse(pauseTime), Duration.ofSeconds(1), Duration.ofSeconds(1), Distance.of(0), Speed.zero(), new AltitudeExtremities(0.0, 0.0), new AltitudeGainLoss(0, 0), null, null)
|
||||||
, contentProviderUtils.getTrack(trackId).getTrackStatistics());
|
, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
new TrackPointAssert().assertEquals(List.of(
|
new TrackPointAssert().assertEquals(List.of(
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime)),
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime)),
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(pauseTime))
|
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(pauseTime))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0)
|
||||||
.setAltitudeLoss(0f)
|
|
||||||
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
||||||
|
|
||||||
//when
|
//when
|
||||||
@@ -208,14 +214,13 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
service.resumeTrack(trackId);
|
service.resumeTrack(trackId);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(new TrackStatistics(startTime, resumeTime, 0, 1, 1, 0, 0f, 0f)
|
assertEquals(new Statistics(Instant.parse(startTime), Instant.parse(resumeTime), Duration.ofSeconds(1), Duration.ofSeconds(1), Distance.of(0), Speed.zero(), new AltitudeExtremities(0.0, 0.0), new AltitudeGainLoss(0, 0), null, null)
|
||||||
, contentProviderUtils.getTrack(trackId).getTrackStatistics());
|
, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
new TrackPointAssert().assertEquals(List.of(
|
new TrackPointAssert().assertEquals(List.of(
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime)),
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime)),
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(pauseTime))
|
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(pauseTime))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeLoss(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(resumeTime))
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(resumeTime))
|
||||||
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
||||||
}
|
}
|
||||||
@@ -248,8 +253,7 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
new TrackPointAssert().assertEquals(List.of(
|
new TrackPointAssert().assertEquals(List.of(
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(starTime)),
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(starTime)),
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(pauseTime))
|
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(pauseTime))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0)
|
||||||
.setAltitudeLoss(0f)
|
|
||||||
), trackPoints);
|
), trackPoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,8 +282,7 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
new TrackPointAssert().assertEquals(List.of(
|
new TrackPointAssert().assertEquals(List.of(
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime)),
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime)),
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(stopTime))
|
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(stopTime))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeLoss(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(resumeTime))
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(resumeTime))
|
||||||
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
||||||
}
|
}
|
||||||
@@ -315,12 +318,10 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
new TrackPointAssert().assertEquals(List.of(
|
new TrackPointAssert().assertEquals(List.of(
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime)),
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime)),
|
||||||
new TrackPoint(TrackPoint.Type.TRACKPOINT, Instant.parse(sensor3))
|
new TrackPoint(TrackPoint.Type.TRACKPOINT, Instant.parse(sensor3))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0)
|
||||||
.setAltitudeLoss(0f)
|
|
||||||
.setHeartRate(HeartRate.of(7)),
|
.setHeartRate(HeartRate.of(7)),
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(stopTime))
|
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(stopTime))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0)
|
||||||
.setAltitudeLoss(0f)
|
|
||||||
.setHeartRate(HeartRate.of(7))
|
.setHeartRate(HeartRate.of(7))
|
||||||
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
||||||
}
|
}
|
||||||
@@ -338,28 +339,27 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
|
|
||||||
// when
|
// when
|
||||||
String gps1 = "2020-02-02T02:02:03Z";
|
String gps1 = "2020-02-02T02:02:03Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps1, 45.0, 35.0, 1, 15);
|
sendGPSLocation(trackPointCreator, gps1, 45.0, 35.0, 1, 15);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(new TrackStatistics(startTime, gps1, 0, 1, 1, 15, 0f, 0f)
|
assertEquals(new Statistics(Instant.parse(startTime), Instant.parse(gps1), Duration.ofSeconds(1), Duration.ofSeconds(1), Distance.of(0), Speed.of(15), new AltitudeExtremities(0.0, 0.0), new AltitudeGainLoss(0, 0), null, null)
|
||||||
, contentProviderUtils.getTrack(trackId).getTrackStatistics());
|
, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String gps2 = "2020-02-02T02:02:06Z";
|
String gps2 = "2020-02-02T02:02:06Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps2, 45.0001, 35.0, 1, 15);
|
sendGPSLocation(trackPointCreator, gps2, 45.0001, 35.0, 1, 15);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(new TrackStatistics(startTime, gps2, 11.113178253173828f, 4, 4, 15, 0f, 0f)
|
assertEquals(new Statistics(Instant.parse(startTime), Instant.parse(gps2), Duration.ofSeconds(4), Duration.ofSeconds(4), Distance.of(11.113178253173828), Speed.of(15), new AltitudeExtremities(0.0, 0.0), new AltitudeGainLoss(0, 0), null, null)
|
||||||
, contentProviderUtils.getTrack(trackId).getTrackStatistics());
|
, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String gps3 = "2020-02-02T02:02:08Z";
|
String gps3 = "2020-02-02T02:02:08Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps3, 45.0002, 35.0, 1, 15);
|
sendGPSLocation(trackPointCreator, gps3, 45.0002, 35.0, 1, 15);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(new TrackStatistics(startTime, gps3, 22.226356506347656, 6, 6, 15, 0f, 0f)
|
assertEquals(new Statistics(Instant.parse(startTime), Instant.parse(gps3), Duration.ofSeconds(6), Duration.ofSeconds(6), Distance.of(22.226356506347656), Speed.of(15), new AltitudeExtremities(0.0, 0.0), new AltitudeGainLoss(0, 0), null, null)
|
||||||
, contentProviderUtils.getTrack(trackId).getTrackStatistics());
|
, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String stopTime = "2020-02-02T02:02:12Z";
|
String stopTime = "2020-02-02T02:02:12Z";
|
||||||
@@ -367,8 +367,8 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
service.endCurrentTrack();
|
service.endCurrentTrack();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(new TrackStatistics(startTime, stopTime, 22.226356506347656, 10, 10, 15, 0f, 0f)
|
assertEquals(new Statistics(Instant.parse(startTime), Instant.parse(stopTime), Duration.ofSeconds(10), Duration.ofSeconds(10), Distance.of(22.226356506347656), Speed.of(15), new AltitudeExtremities(0.0, 0.0), new AltitudeGainLoss(0, 0), null, null)
|
||||||
, contentProviderUtils.getTrack(trackId).getTrackStatistics());
|
, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
new TrackPointAssert().assertEquals(List.of(
|
new TrackPointAssert().assertEquals(List.of(
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime)),
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime)),
|
||||||
@@ -379,8 +379,7 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
null, null,
|
null, null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeLoss(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse(gps2),
|
Instant.parse(gps2),
|
||||||
@@ -388,8 +387,7 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
null, null,
|
null, null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeLoss(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse(gps3),
|
Instant.parse(gps3),
|
||||||
@@ -397,11 +395,9 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
null, null,
|
null, null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeLoss(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(stopTime))
|
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(stopTime))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0)
|
||||||
.setAltitudeLoss(0f)
|
|
||||||
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,25 +413,25 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
|
|
||||||
// when
|
// when
|
||||||
String gps1 = "2020-02-02T02:02:03Z";
|
String gps1 = "2020-02-02T02:02:03Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps1, 45.0, 35.0, 1, 15);
|
sendGPSLocation(trackPointCreator, gps1, 45.0, 35.0, 1, 15);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
TrackStatistics gps1Statistics = new TrackStatistics(startTime, gps1, 0, 1, 1, 15, 0f, 0f);
|
Statistics gps1Statistics = new Statistics(Instant.parse(startTime), Instant.parse(gps1), Duration.ofSeconds(1), Duration.ofSeconds(1), Distance.of(0), Speed.of(15), new AltitudeExtremities(0.0, 0.0), new AltitudeGainLoss(0, 0), null, null);
|
||||||
assertEquals(gps1Statistics, contentProviderUtils.getTrack(trackId).getTrackStatistics());
|
assertEquals(gps1Statistics, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String gps2 = "2020-02-02T02:02:06Z";
|
String gps2 = "2020-02-02T02:02:06Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps2, 45.00001, 35.0, 1, 15);
|
sendGPSLocation(trackPointCreator, gps2, 45.00001, 35.0, 1, 15);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(gps1Statistics, contentProviderUtils.getTrack(trackId).getTrackStatistics());
|
assertEquals(gps1Statistics, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String gps3 = "2020-02-02T02:02:08Z";
|
String gps3 = "2020-02-02T02:02:08Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps3, 45.00002, 35.0, 1, 15);
|
sendGPSLocation(trackPointCreator, gps3, 45.00002, 35.0, 1, 15);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(gps1Statistics, contentProviderUtils.getTrack(trackId).getTrackStatistics());
|
assertEquals(gps1Statistics, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String stopTime = "2020-02-02T02:02:12Z";
|
String stopTime = "2020-02-02T02:02:12Z";
|
||||||
@@ -443,8 +439,8 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
service.endCurrentTrack();
|
service.endCurrentTrack();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(new TrackStatistics(startTime, stopTime, 2.222635507583618, 10, 10, 15, 0f, 0f)
|
assertEquals(new Statistics(Instant.parse(startTime), Instant.parse(stopTime), Duration.ofSeconds(10), Duration.ofSeconds(10), Distance.of(2.222635507583618), Speed.of(15), new AltitudeExtremities(0.0, 0.0), new AltitudeGainLoss(0, 0), null, null)
|
||||||
, contentProviderUtils.getTrack(trackId).getTrackStatistics());
|
, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
new TrackPointAssert().assertEquals(List.of(
|
new TrackPointAssert().assertEquals(List.of(
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime)),
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime)),
|
||||||
@@ -455,8 +451,7 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
null, null,
|
null, null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeLoss(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse(gps3),
|
Instant.parse(gps3),
|
||||||
@@ -464,8 +459,7 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
null, null,
|
null, null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeLoss(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL,
|
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse(stopTime),
|
Instant.parse(stopTime),
|
||||||
@@ -473,8 +467,7 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
null, null,
|
null, null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0)
|
||||||
.setAltitudeLoss(0f)
|
|
||||||
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -491,15 +484,15 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
|
|
||||||
// when
|
// when
|
||||||
String gps1 = "2020-02-02T02:02:03Z";
|
String gps1 = "2020-02-02T02:02:03Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps1, 45.0, 35.0, 1, 15);
|
sendGPSLocation(trackPointCreator, gps1, 45.0, 35.0, 1, 15);
|
||||||
|
|
||||||
// when - will be ignored
|
// when - will be ignored
|
||||||
String gps2 = "2020-02-02T02:02:04Z";
|
String gps2 = "2020-02-02T02:02:04Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps2, 45.0, 35.0, 1, 15);
|
sendGPSLocation(trackPointCreator, gps2, 45.0, 35.0, 1, 15);
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String gps3 = "2020-02-02T02:02:05Z";
|
String gps3 = "2020-02-02T02:02:05Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps3, 45.0001, 35.0, 1, 15);
|
sendGPSLocation(trackPointCreator, gps3, 45.0001, 35.0, 1, 15);
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String stopTime = "2020-02-02T02:02:12Z";
|
String stopTime = "2020-02-02T02:02:12Z";
|
||||||
@@ -516,8 +509,7 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
null, null,
|
null, null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeLoss(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
new TrackPoint(TrackPoint.Type.TRACKPOINT,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse(gps3),
|
Instant.parse(gps3),
|
||||||
@@ -525,11 +517,9 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
null, null,
|
null, null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeLoss(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(stopTime))
|
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(stopTime))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0)
|
||||||
.setAltitudeLoss(0f)
|
|
||||||
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -545,19 +535,19 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
|
|
||||||
// when
|
// when
|
||||||
String gps1 = "2020-02-02T02:02:03Z";
|
String gps1 = "2020-02-02T02:02:03Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps1, 45.0, 35.0, 100, 15);
|
sendGPSLocation(trackPointCreator, gps1, 45.0, 35.0, 100, 15);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
TrackStatistics startStatistics = new TrackStatistics(startTime, startTime, 0, 0, 0, 0, null, null);
|
Statistics startStatistics = new Statistics(Instant.parse(startTime), Instant.parse(startTime), Duration.ofSeconds(0), Duration.ofSeconds(0), Distance.of(0), Speed.of(0), new AltitudeExtremities(0.0, 0.0), null, null, null);
|
||||||
assertEquals(startStatistics, contentProviderUtils.getTrack(trackId).getTrackStatistics());
|
assertEquals(startStatistics, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String gps2 = "2020-02-02T02:02:06Z";
|
String gps2 = "2020-02-02T02:02:06Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps2, 45.1, 35.0, 100, 15);
|
sendGPSLocation(trackPointCreator, gps2, 45.1, 35.0, 100, 15);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(startStatistics, contentProviderUtils.getTrack(trackId).getTrackStatistics());
|
assertEquals(startStatistics, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
|
|
||||||
// when
|
// when
|
||||||
@@ -566,16 +556,14 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
service.endCurrentTrack();
|
service.endCurrentTrack();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(new TrackStatistics(startTime, stopTime, 0, 10, 10, 0, 0f, 0f)
|
assertEquals(new Statistics(Instant.parse(startTime), Instant.parse(stopTime), Duration.ofSeconds(10), Duration.ofSeconds(10), Distance.of(0), Speed.of(0), new AltitudeExtremities(0.0, 0.0), new AltitudeGainLoss(0, 0), null, null)
|
||||||
, contentProviderUtils.getTrack(trackId).getTrackStatistics());
|
, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
|
|
||||||
// then
|
// then
|
||||||
new TrackPointAssert().assertEquals(List.of(
|
new TrackPointAssert().assertEquals(List.of(
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime)),
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_MANUAL, Instant.parse(startTime)),
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(stopTime))
|
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(stopTime))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0)
|
||||||
.setAltitudeLoss(0f)
|
|
||||||
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -591,18 +579,19 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
|
|
||||||
// when
|
// when
|
||||||
String gps1 = "2020-02-02T02:02:03Z";
|
String gps1 = "2020-02-02T02:02:03Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps1, 45.0, 35.0, 1, 15);
|
sendGPSLocation(trackPointCreator, gps1, 45.0, 35.0, 1, 15);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(new TrackStatistics(startTime, gps1, 0, 1, 1, 15, 0f, 0f), contentProviderUtils.getTrack(trackId).getTrackStatistics());
|
assertEquals(new Statistics(Instant.parse(startTime), Instant.parse(gps1), Duration.ofSeconds(1), Duration.ofSeconds(1), Distance.of(0), Speed.of(15), new AltitudeExtremities(0.0, 0.0), new AltitudeGainLoss(0, 0), null, null)
|
||||||
|
, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String gps2 = "2020-02-02T02:02:06Z";
|
String gps2 = "2020-02-02T02:02:06Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps2, 45.1, 35.0, 1, 15);
|
sendGPSLocation(trackPointCreator, gps2, 45.1, 35.0, 1, 15);
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(new TrackStatistics(startTime, gps2, 11113.275390625, 4, 4, 2778.31884765625f, 0f, 0f).toString(), contentProviderUtils.getTrack(trackId).getTrackStatistics().toString());
|
assertEquals(new Statistics(Instant.parse(startTime), Instant.parse(gps2), Duration.ofSeconds(4), Duration.ofSeconds(4), Distance.of(11113.275390625), Speed.of(2778.31884765625f), new AltitudeExtremities(0.0, 0.0), new AltitudeGainLoss(0, 0), null, null)
|
||||||
|
, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String stopTime = "2020-02-02T02:02:12Z";
|
String stopTime = "2020-02-02T02:02:12Z";
|
||||||
@@ -610,7 +599,8 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
service.endCurrentTrack();
|
service.endCurrentTrack();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(new TrackStatistics(startTime, stopTime, 11113.275390625, 10, 10, 1111.3275390625f, 0f, 0f).toString(), contentProviderUtils.getTrack(trackId).getTrackStatistics().toString());
|
assertEquals(new Statistics(Instant.parse(startTime), Instant.parse(stopTime), Duration.ofSeconds(10), Duration.ofSeconds(10), Distance.of(11113.275390625), Speed.of(1111.3275146484375), new AltitudeExtremities(0.0, 0.0), new AltitudeGainLoss(0, 0), null, null)
|
||||||
|
, contentProviderUtils.getTrack(trackId).getStatistics());
|
||||||
|
|
||||||
|
|
||||||
// then
|
// then
|
||||||
@@ -623,8 +613,7 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
null, null,
|
null, null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeLoss(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_START_AUTOMATIC,
|
new TrackPoint(TrackPoint.Type.SEGMENT_START_AUTOMATIC,
|
||||||
new Position(
|
new Position(
|
||||||
Instant.parse(gps2),
|
Instant.parse(gps2),
|
||||||
@@ -632,11 +621,9 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
null, null,
|
null, null,
|
||||||
null,
|
null,
|
||||||
Speed.of(15)))
|
Speed.of(15)))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0),
|
||||||
.setAltitudeLoss(0f),
|
|
||||||
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(stopTime))
|
new TrackPoint(TrackPoint.Type.SEGMENT_END_MANUAL, Instant.parse(stopTime))
|
||||||
.setAltitudeGain(0f)
|
.setAltitudeGainLoss(0, 0)
|
||||||
.setAltitudeLoss(0f)
|
|
||||||
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
), TestDataUtil.getTrackPoints(contentProviderUtils, trackId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -669,7 +656,7 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
|
|
||||||
// when
|
// when
|
||||||
String gps1 = "2020-02-02T02:02:05Z";
|
String gps1 = "2020-02-02T02:02:05Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps1, 45.0, 35.0, 1, 15);
|
sendGPSLocation(trackPointCreator, gps1, 45.0, 35.0, 1, 15);
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String sensor3 = "2020-02-02T02:02:06Z";
|
String sensor3 = "2020-02-02T02:02:06Z";
|
||||||
@@ -683,7 +670,7 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
|
|
||||||
// when
|
// when
|
||||||
String gps2 = "2020-02-02T02:02:08Z";
|
String gps2 = "2020-02-02T02:02:08Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps2, 45.0, 35.0, 4, 15); //Should be ignored
|
sendGPSLocation(trackPointCreator, gps2, 45.0, 35.0, 4, 15); //Should be ignored
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String sensor5 = "2020-02-02T02:02:10Z";
|
String sensor5 = "2020-02-02T02:02:10Z";
|
||||||
@@ -692,11 +679,11 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
|
|
||||||
// when
|
// when
|
||||||
String gps3 = "2020-02-02T02:02:12Z";
|
String gps3 = "2020-02-02T02:02:12Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps3, 45.001, 35.0, 1, 15);
|
sendGPSLocation(trackPointCreator, gps3, 45.001, 35.0, 1, 15);
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String gps4 = "2020-02-02T02:02:14Z";
|
String gps4 = "2020-02-02T02:02:14Z";
|
||||||
TrackRecordingServiceTestUtils.sendGPSLocation(trackPointCreator, gps4, 45.001, 35.0, 1, 15);
|
sendGPSLocation(trackPointCreator, gps4, 45.001, 35.0, 1, 15);
|
||||||
|
|
||||||
|
|
||||||
// when
|
// when
|
||||||
@@ -761,4 +748,16 @@ public class TrackRecordingServiceRecordingTest {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void sendGPSLocation(TrackPointCreator trackPointCreator, String time, double latitude, double longitude, float accuracy, long speed) {
|
||||||
|
Location location = new Location("mock");
|
||||||
|
location.setTime(1L); // Should be ignored anyhow.
|
||||||
|
location.setLatitude(latitude);
|
||||||
|
location.setLongitude(longitude);
|
||||||
|
location.setAccuracy(accuracy);
|
||||||
|
location.setSpeed(speed);
|
||||||
|
|
||||||
|
trackPointCreator.setClock(time);
|
||||||
|
trackPointCreator.getSensorManager().getGpsManager().onLocationChanged(location);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-20
@@ -1,20 +0,0 @@
|
|||||||
package de.dennisguse.opentracks.services;
|
|
||||||
|
|
||||||
import android.location.Location;
|
|
||||||
|
|
||||||
import de.dennisguse.opentracks.services.handlers.TrackPointCreator;
|
|
||||||
|
|
||||||
public class TrackRecordingServiceTestUtils {
|
|
||||||
|
|
||||||
static void sendGPSLocation(TrackPointCreator trackPointCreator, String time, double latitude, double longitude, float accuracy, long speed) {
|
|
||||||
Location location = new Location("mock");
|
|
||||||
location.setTime(1L); // Should be ignored anyhow.
|
|
||||||
location.setLatitude(latitude);
|
|
||||||
location.setLongitude(longitude);
|
|
||||||
location.setAccuracy(accuracy);
|
|
||||||
location.setSpeed(speed);
|
|
||||||
|
|
||||||
trackPointCreator.setClock(time);
|
|
||||||
trackPointCreator.getSensorManager().getGpsManager().onLocationChanged(location);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+7
-7
@@ -22,7 +22,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
|
|
||||||
import de.dennisguse.opentracks.data.models.Distance;
|
import de.dennisguse.opentracks.data.models.Distance;
|
||||||
import de.dennisguse.opentracks.services.TrackRecordingService;
|
import de.dennisguse.opentracks.services.TrackRecordingService;
|
||||||
import de.dennisguse.opentracks.stats.TrackStatistics;
|
import de.dennisguse.opentracks.stats.SegmentStatisticUpdater;
|
||||||
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
public class VoiceAnnouncementManagerTest {
|
public class VoiceAnnouncementManagerTest {
|
||||||
@@ -54,13 +54,13 @@ public class VoiceAnnouncementManagerTest {
|
|||||||
voiceAnnouncementManager.setFrequency(Distance.ofKilometer(5));
|
voiceAnnouncementManager.setFrequency(Distance.ofKilometer(5));
|
||||||
|
|
||||||
// when
|
// when
|
||||||
TrackStatistics statistics = new TrackStatistics();
|
SegmentStatisticUpdater statistics = new SegmentStatisticUpdater();
|
||||||
statistics.setTotalDistance(Distance.ofKilometer(13));
|
statistics.setTotalDistance(Distance.ofKilometer(13));
|
||||||
voiceAnnouncementManager.start(statistics);
|
voiceAnnouncementManager.start(statistics.getStatistics());
|
||||||
assertEquals(Distance.of(15000), voiceAnnouncementManager.getNextTotalDistance());
|
assertEquals(Distance.of(15000), voiceAnnouncementManager.getNextTotalDistance());
|
||||||
|
|
||||||
statistics.setTotalDistance(Distance.of(15100));
|
statistics.setTotalDistance(Distance.of(15100));
|
||||||
voiceAnnouncementManager.start(statistics);
|
voiceAnnouncementManager.start(statistics.getStatistics());
|
||||||
assertEquals(Distance.of(20000), voiceAnnouncementManager.getNextTotalDistance());
|
assertEquals(Distance.of(20000), voiceAnnouncementManager.getNextTotalDistance());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,13 +74,13 @@ public class VoiceAnnouncementManagerTest {
|
|||||||
voiceAnnouncementManager.setFrequency(Duration.ofSeconds(5));
|
voiceAnnouncementManager.setFrequency(Duration.ofSeconds(5));
|
||||||
|
|
||||||
// when
|
// when
|
||||||
TrackStatistics statistics = new TrackStatistics();
|
SegmentStatisticUpdater statistics = new SegmentStatisticUpdater();
|
||||||
statistics.setTotalTime(Duration.ofSeconds(91));
|
statistics.setTotalTime(Duration.ofSeconds(91));
|
||||||
voiceAnnouncementManager.start(statistics);
|
voiceAnnouncementManager.start(statistics.getStatistics());
|
||||||
assertEquals(Duration.ofSeconds(95), voiceAnnouncementManager.getNextTotalTime());
|
assertEquals(Duration.ofSeconds(95), voiceAnnouncementManager.getNextTotalTime());
|
||||||
|
|
||||||
statistics.setTotalTime(Duration.ofSeconds(95));
|
statistics.setTotalTime(Duration.ofSeconds(95));
|
||||||
voiceAnnouncementManager.start(statistics);
|
voiceAnnouncementManager.start(statistics.getStatistics());
|
||||||
assertEquals(Duration.ofSeconds(100), voiceAnnouncementManager.getNextTotalTime());
|
assertEquals(Duration.ofSeconds(100), voiceAnnouncementManager.getNextTotalTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+167
-191
@@ -19,23 +19,24 @@ import org.mockito.Mockito;
|
|||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import de.dennisguse.opentracks.LocaleRule;
|
import de.dennisguse.opentracks.LocaleRule;
|
||||||
import de.dennisguse.opentracks.content.data.TestDataUtil;
|
import de.dennisguse.opentracks.content.data.TestDataUtil;
|
||||||
import de.dennisguse.opentracks.data.ContentProviderUtils;
|
import de.dennisguse.opentracks.data.models.AltitudeGainLoss;
|
||||||
import de.dennisguse.opentracks.data.TrackPointIterator;
|
|
||||||
import de.dennisguse.opentracks.data.models.Distance;
|
import de.dennisguse.opentracks.data.models.Distance;
|
||||||
import de.dennisguse.opentracks.data.models.HeartRate;
|
import de.dennisguse.opentracks.data.models.HeartRate;
|
||||||
import de.dennisguse.opentracks.data.models.Speed;
|
import de.dennisguse.opentracks.data.models.Speed;
|
||||||
|
import de.dennisguse.opentracks.data.models.Statistics;
|
||||||
import de.dennisguse.opentracks.data.models.Track;
|
import de.dennisguse.opentracks.data.models.Track;
|
||||||
|
import de.dennisguse.opentracks.data.models.TrackPoint;
|
||||||
import de.dennisguse.opentracks.sensors.sensorData.SensorDataSet;
|
import de.dennisguse.opentracks.sensors.sensorData.SensorDataSet;
|
||||||
import de.dennisguse.opentracks.settings.PreferencesUtils;
|
import de.dennisguse.opentracks.settings.PreferencesUtils;
|
||||||
import de.dennisguse.opentracks.settings.UnitSystem;
|
import de.dennisguse.opentracks.settings.UnitSystem;
|
||||||
import de.dennisguse.opentracks.stats.SensorStatistics;
|
import de.dennisguse.opentracks.stats.SensorStatistics;
|
||||||
import de.dennisguse.opentracks.stats.TrackStatistics;
|
import de.dennisguse.opentracks.ui.intervals.IntervalStatisticsUpdater;
|
||||||
import de.dennisguse.opentracks.ui.intervals.IntervalStatistics;
|
|
||||||
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
public class VoiceAnnouncementUtilsTest {
|
public class VoiceAnnouncementUtilsTest {
|
||||||
@@ -44,12 +45,9 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
public final LocaleRule mLocaleRule = new LocaleRule(Locale.ENGLISH);
|
public final LocaleRule mLocaleRule = new LocaleRule(Locale.ENGLISH);
|
||||||
|
|
||||||
private final Context context = ApplicationProvider.getApplicationContext();
|
private final Context context = ApplicationProvider.getApplicationContext();
|
||||||
private ContentProviderUtils contentProviderUtils;
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
contentProviderUtils = new ContentProviderUtils(context);
|
|
||||||
|
|
||||||
PreferencesUtils.setVoiceAnnounceHeartRateCurrent(false);
|
PreferencesUtils.setVoiceAnnounceHeartRateCurrent(false);
|
||||||
PreferencesUtils.setVoiceAnnounceLapHeartRate(false);
|
PreferencesUtils.setVoiceAnnounceLapHeartRate(false);
|
||||||
PreferencesUtils.setVoiceAnnounceAverageHeartRate(false);
|
PreferencesUtils.setVoiceAnnounceAverageHeartRate(false);
|
||||||
@@ -66,16 +64,18 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAnnouncement_metric_speed() {
|
public void getAnnouncement_metric_speed() {
|
||||||
TrackStatistics stats = new TrackStatistics();
|
Track track = new Track(new Statistics(
|
||||||
stats.setStartTime(Instant.EPOCH);
|
Instant.EPOCH,
|
||||||
stats.setTotalDistance(Distance.of(20000));
|
Instant.EPOCH,
|
||||||
stats.setTotalTime(Duration.ofHours(2).plusMinutes(5).plusSeconds(10));
|
Duration.ofHours(2).plusMinutes(5).plusSeconds(10),
|
||||||
stats.setMovingTime(Duration.ofHours(1).plusMinutes(5).plusSeconds(10));
|
Duration.ofHours(1).plusMinutes(5).plusSeconds(10),
|
||||||
stats.setMaxSpeed(Speed.of(100));
|
Distance.of(20000),
|
||||||
stats.setTotalAltitudeGain(6000f);
|
Speed.of(100),
|
||||||
|
null,
|
||||||
Track track = new Track();
|
null,
|
||||||
track.setTrackStatistics(stats);
|
null,
|
||||||
|
null
|
||||||
|
));
|
||||||
|
|
||||||
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
||||||
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
||||||
@@ -89,16 +89,18 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAnnouncement_metric_speed_rounding_check() {
|
public void getAnnouncement_metric_speed_rounding_check() {
|
||||||
TrackStatistics stats = new TrackStatistics();
|
Track track = new Track(new Statistics(
|
||||||
stats.setStartTime(Instant.EPOCH);
|
Instant.EPOCH,
|
||||||
stats.setTotalDistance(Distance.of(20000));
|
Instant.EPOCH,
|
||||||
stats.setTotalTime(Duration.ofHours(1).plusMinutes(5).plusSeconds(10));
|
Duration.ofHours(2).plusMinutes(5).plusSeconds(10),
|
||||||
stats.setMovingTime(Duration.ofHours(1).plusSeconds(1));
|
Duration.ofHours(1).plusSeconds(1),
|
||||||
stats.setMaxSpeed(Speed.of(100));
|
Distance.of(20000),
|
||||||
stats.setTotalAltitudeGain(6000f);
|
Speed.of(100),
|
||||||
|
null,
|
||||||
Track track = new Track();
|
new AltitudeGainLoss(6000, 6000),
|
||||||
track.setTrackStatistics(stats);
|
null,
|
||||||
|
null
|
||||||
|
));
|
||||||
|
|
||||||
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
||||||
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
||||||
@@ -112,16 +114,18 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAnnouncement_metric_distance_rounding_check() {
|
public void getAnnouncement_metric_distance_rounding_check() {
|
||||||
TrackStatistics stats = new TrackStatistics();
|
Track track = new Track(new Statistics(
|
||||||
stats.setStartTime(Instant.EPOCH);
|
Instant.EPOCH,
|
||||||
stats.setTotalDistance(Distance.of(19999));
|
Instant.EPOCH,
|
||||||
stats.setTotalTime(Duration.ofHours(1).plusMinutes(5).plusSeconds(10));
|
Duration.ofHours(2).plusMinutes(5).plusSeconds(10),
|
||||||
stats.setMovingTime(Duration.ofHours(1));
|
Duration.ofHours(1),
|
||||||
stats.setMaxSpeed(Speed.of(100));
|
Distance.of(19999),
|
||||||
stats.setTotalAltitudeGain(6000f);
|
Speed.of(100),
|
||||||
|
null,
|
||||||
Track track = new Track();
|
new AltitudeGainLoss(6000, 6000),
|
||||||
track.setTrackStatistics(stats);
|
null,
|
||||||
|
null
|
||||||
|
));
|
||||||
|
|
||||||
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
||||||
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
||||||
@@ -135,16 +139,18 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAnnouncement_metric_distance_rounding_check_two() {
|
public void getAnnouncement_metric_distance_rounding_check_two() {
|
||||||
TrackStatistics stats = new TrackStatistics();
|
Track track = new Track(new Statistics(
|
||||||
stats.setStartTime(Instant.EPOCH);
|
Instant.EPOCH,
|
||||||
stats.setTotalDistance(Distance.of(19900));
|
Instant.EPOCH,
|
||||||
stats.setTotalTime(Duration.ofHours(1).plusMinutes(5).plusSeconds(10));
|
Duration.ofHours(2).plusMinutes(5).plusSeconds(10),
|
||||||
stats.setMovingTime(Duration.ofHours(1));
|
Duration.ofHours(1),
|
||||||
stats.setMaxSpeed(Speed.of(100));
|
Distance.of(19900),
|
||||||
stats.setTotalAltitudeGain(6000f);
|
Speed.of(100),
|
||||||
|
null,
|
||||||
Track track = new Track();
|
new AltitudeGainLoss(6000, 6000),
|
||||||
track.setTrackStatistics(stats);
|
null,
|
||||||
|
null
|
||||||
|
));
|
||||||
|
|
||||||
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
||||||
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
||||||
@@ -159,26 +165,13 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
@Test
|
@Test
|
||||||
public void getAnnouncement_withInterval_metric_speed() {
|
public void getAnnouncement_withInterval_metric_speed() {
|
||||||
// given
|
// given
|
||||||
int numberOfPoints = 1000;
|
Pair<Track, Statistics> data = buildTrackWithTrackPoints();
|
||||||
Pair<Track.Id, TrackStatistics> trackWithStats = TestDataUtil.buildTrackWithTrackPoints(contentProviderUtils, numberOfPoints);
|
|
||||||
Track.Id trackId = trackWithStats.first;
|
|
||||||
TrackStatistics stats = trackWithStats.second;
|
|
||||||
IntervalStatistics.Interval lastInterval;
|
|
||||||
try (TrackPointIterator trackPointIterator = contentProviderUtils.getTrackPointLocationIterator(trackId, null)) {
|
|
||||||
assertEquals(trackPointIterator.getCount(), numberOfPoints);
|
|
||||||
IntervalStatistics intervalStatistics = new IntervalStatistics(Distance.of(1000));
|
|
||||||
intervalStatistics.addTrackPoints(trackPointIterator);
|
|
||||||
lastInterval = intervalStatistics.getIntervalList().get(intervalStatistics.getIntervalList().size() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
||||||
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
||||||
|
|
||||||
Track track = new Track();
|
|
||||||
track.setTrackStatistics(stats);
|
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String announcement = VoiceAnnouncementUtils.createStatistics(context, track, dataSet, UnitSystem.METRIC, true, lastInterval, null).toString();
|
String announcement = VoiceAnnouncementUtils.createStatistics(context, data.first, dataSet, UnitSystem.METRIC, true, data.second, null).toString();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals("12:16 AM. Total distance 14.2 kilometers. 16 minutes 39 seconds. Average moving speed 51.2 kilometers per hour. Lap speed 51.2 kilometers per hour.", announcement);
|
assertEquals("12:16 AM. Total distance 14.2 kilometers. 16 minutes 39 seconds. Average moving speed 51.2 kilometers per hour. Lap speed 51.2 kilometers per hour.", announcement);
|
||||||
@@ -186,16 +179,18 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAnnouncement_metric_pace() {
|
public void getAnnouncement_metric_pace() {
|
||||||
TrackStatistics stats = new TrackStatistics();
|
Track track = new Track(new Statistics(
|
||||||
stats.setStartTime(Instant.EPOCH);
|
Instant.EPOCH,
|
||||||
stats.setTotalDistance(Distance.of(20000));
|
Instant.EPOCH,
|
||||||
stats.setTotalTime(Duration.ofHours(2).plusMinutes(5).plusSeconds(10));
|
Duration.ofHours(2).plusMinutes(5).plusSeconds(10),
|
||||||
stats.setMovingTime(Duration.ofHours(1).plusMinutes(5).plusSeconds(10));
|
Duration.ofHours(1).plusMinutes(5).plusSeconds(10),
|
||||||
stats.setMaxSpeed(Speed.of(100));
|
Distance.of(20000),
|
||||||
stats.setTotalAltitudeGain(6000f);
|
Speed.of(100),
|
||||||
|
null,
|
||||||
Track track = new Track();
|
new AltitudeGainLoss(6000, 6000),
|
||||||
track.setTrackStatistics(stats);
|
null,
|
||||||
|
null
|
||||||
|
));
|
||||||
|
|
||||||
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
||||||
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
||||||
@@ -210,26 +205,13 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
@Test
|
@Test
|
||||||
public void getAnnouncement_withInterval_metric_pace() {
|
public void getAnnouncement_withInterval_metric_pace() {
|
||||||
// given
|
// given
|
||||||
int numberOfPoints = 1000;
|
Pair<Track, Statistics> data = buildTrackWithTrackPoints();
|
||||||
Pair<Track.Id, TrackStatistics> trackWithStats = TestDataUtil.buildTrackWithTrackPoints(contentProviderUtils, numberOfPoints);
|
|
||||||
Track.Id trackId = trackWithStats.first;
|
|
||||||
TrackStatistics stats = trackWithStats.second;
|
|
||||||
IntervalStatistics.Interval lastInterval;
|
|
||||||
try (TrackPointIterator trackPointIterator = contentProviderUtils.getTrackPointLocationIterator(trackId, null)) {
|
|
||||||
assertEquals(trackPointIterator.getCount(), numberOfPoints);
|
|
||||||
IntervalStatistics intervalStatistics = new IntervalStatistics(Distance.of(1000));
|
|
||||||
intervalStatistics.addTrackPoints(trackPointIterator);
|
|
||||||
lastInterval = intervalStatistics.getIntervalList().get(intervalStatistics.getIntervalList().size() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
Track track = new Track();
|
|
||||||
track.setTrackStatistics(stats);
|
|
||||||
|
|
||||||
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
||||||
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String announcement = VoiceAnnouncementUtils.createStatistics(context, track, dataSet, UnitSystem.METRIC, false, lastInterval, null).toString();
|
String announcement = VoiceAnnouncementUtils.createStatistics(context, data.first, dataSet, UnitSystem.METRIC, false, data.second, null).toString();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals("12:16 AM. Total distance 14.2 kilometers. 16 minutes 39 seconds. Pace 1 minute 10 seconds per kilometer. Lap time 1 minute 10 seconds per kilometer.", announcement);
|
assertEquals("12:16 AM. Total distance 14.2 kilometers. 16 minutes 39 seconds. Pace 1 minute 10 seconds per kilometer. Lap time 1 minute 10 seconds per kilometer.", announcement);
|
||||||
@@ -237,16 +219,18 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAnnouncement_imperial_speed() {
|
public void getAnnouncement_imperial_speed() {
|
||||||
TrackStatistics stats = new TrackStatistics();
|
Track track = new Track(new Statistics(
|
||||||
stats.setStartTime(Instant.EPOCH);
|
Instant.EPOCH,
|
||||||
stats.setTotalDistance(Distance.of(20000));
|
Instant.EPOCH,
|
||||||
stats.setTotalTime(Duration.ofHours(2).plusMinutes(5).plusSeconds(10));
|
Duration.ofHours(2).plusMinutes(5).plusSeconds(10),
|
||||||
stats.setMovingTime(Duration.ofHours(1).plusMinutes(5).plusSeconds(10));
|
Duration.ofHours(1).plusMinutes(5).plusSeconds(10),
|
||||||
stats.setMaxSpeed(Speed.of(100));
|
Distance.of(20000),
|
||||||
stats.setTotalAltitudeGain(6000f);
|
Speed.of(100),
|
||||||
|
null,
|
||||||
Track track = new Track();
|
new AltitudeGainLoss(6000, 6000),
|
||||||
track.setTrackStatistics(stats);
|
null,
|
||||||
|
null
|
||||||
|
));
|
||||||
|
|
||||||
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
||||||
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
||||||
@@ -260,14 +244,18 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAnnouncement_imperial_speed_1() {
|
public void getAnnouncement_imperial_speed_1() {
|
||||||
TrackStatistics stats = new TrackStatistics();
|
Track track = new Track(new Statistics(
|
||||||
stats.setStartTime(Instant.EPOCH);
|
Instant.EPOCH,
|
||||||
stats.setTotalDistance(Distance.ofMile(1.1));
|
Instant.EPOCH,
|
||||||
stats.setTotalTime(Duration.ofHours(2).plusMinutes(5).plusSeconds(10));
|
Duration.ofHours(2).plusMinutes(5).plusSeconds(10),
|
||||||
stats.setMovingTime(Duration.ofHours(1));
|
Duration.ofHours(1),
|
||||||
|
Distance.ofMile(1.1),
|
||||||
Track track = new Track();
|
null,
|
||||||
track.setTrackStatistics(stats);
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
));
|
||||||
|
|
||||||
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
||||||
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
||||||
@@ -281,14 +269,18 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAnnouncement_imperial_meter_speed_1() {
|
public void getAnnouncement_imperial_meter_speed_1() {
|
||||||
TrackStatistics stats = new TrackStatistics();
|
Track track = new Track(new Statistics(
|
||||||
stats.setStartTime(Instant.EPOCH);
|
Instant.EPOCH,
|
||||||
stats.setTotalDistance(Distance.ofMile(1.1));
|
Instant.EPOCH,
|
||||||
stats.setTotalTime(Duration.ofHours(2).plusMinutes(5).plusSeconds(10));
|
Duration.ofHours(2).plusMinutes(5).plusSeconds(10),
|
||||||
stats.setMovingTime(Duration.ofHours(1));
|
Duration.ofHours(1),
|
||||||
|
Distance.ofMile(1.1),
|
||||||
Track track = new Track();
|
null,
|
||||||
track.setTrackStatistics(stats);
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
));
|
||||||
|
|
||||||
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
||||||
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
||||||
@@ -302,14 +294,18 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAnnouncement_metric_speed_1() {
|
public void getAnnouncement_metric_speed_1() {
|
||||||
TrackStatistics stats = new TrackStatistics();
|
Track track = new Track(new Statistics(
|
||||||
stats.setStartTime(Instant.EPOCH);
|
Instant.EPOCH,
|
||||||
stats.setTotalDistance(Distance.ofKilometer(1.1));
|
Instant.EPOCH,
|
||||||
stats.setTotalTime(Duration.ofHours(2).plusMinutes(5).plusSeconds(10));
|
Duration.ofHours(2).plusMinutes(5).plusSeconds(10),
|
||||||
stats.setMovingTime(Duration.ofHours(1));
|
Duration.ofHours(1),
|
||||||
|
Distance.ofKilometer(1.1),
|
||||||
Track track = new Track();
|
null,
|
||||||
track.setTrackStatistics(stats);
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
));
|
||||||
|
|
||||||
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
||||||
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
||||||
@@ -324,26 +320,13 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
@Test
|
@Test
|
||||||
public void getAnnouncement_withInterval_imperial_speed() {
|
public void getAnnouncement_withInterval_imperial_speed() {
|
||||||
// given
|
// given
|
||||||
int numberOfPoints = 1000;
|
Pair<Track, Statistics> data = buildTrackWithTrackPoints();
|
||||||
Pair<Track.Id, TrackStatistics> trackWithStats = TestDataUtil.buildTrackWithTrackPoints(contentProviderUtils, numberOfPoints);
|
|
||||||
Track.Id trackId = trackWithStats.first;
|
|
||||||
TrackStatistics stats = trackWithStats.second;
|
|
||||||
IntervalStatistics.Interval lastInterval;
|
|
||||||
try (TrackPointIterator trackPointIterator = contentProviderUtils.getTrackPointLocationIterator(trackId, null)) {
|
|
||||||
assertEquals(trackPointIterator.getCount(), numberOfPoints);
|
|
||||||
IntervalStatistics intervalStatistics = new IntervalStatistics(Distance.of(1000));
|
|
||||||
intervalStatistics.addTrackPoints(trackPointIterator);
|
|
||||||
lastInterval = intervalStatistics.getIntervalList().get(intervalStatistics.getIntervalList().size() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
Track track = new Track();
|
|
||||||
track.setTrackStatistics(stats);
|
|
||||||
|
|
||||||
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
||||||
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String announcement = VoiceAnnouncementUtils.createStatistics(context, track, dataSet, UnitSystem.IMPERIAL_FEET, true, lastInterval, null).toString();
|
String announcement = VoiceAnnouncementUtils.createStatistics(context, data.first, dataSet, UnitSystem.IMPERIAL_FEET, true, data.second, null).toString();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals("12:16 AM. Total distance 8.8 miles. 16 minutes 39 seconds. Average moving speed 31.8 miles per hour. Lap speed 31.8 miles per hour.", announcement);
|
assertEquals("12:16 AM. Total distance 8.8 miles. 16 minutes 39 seconds. Average moving speed 31.8 miles per hour. Lap speed 31.8 miles per hour.", announcement);
|
||||||
@@ -351,16 +334,18 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAnnouncement_imperial_pace() {
|
public void getAnnouncement_imperial_pace() {
|
||||||
TrackStatistics stats = new TrackStatistics();
|
Track track = new Track(new Statistics(
|
||||||
stats.setStartTime(Instant.EPOCH);
|
Instant.EPOCH,
|
||||||
stats.setTotalDistance(Distance.of(20000));
|
Instant.EPOCH,
|
||||||
stats.setTotalTime(Duration.ofHours(2).plusMinutes(5).plusSeconds(10));
|
Duration.ofHours(2).plusMinutes(5).plusSeconds(10),
|
||||||
stats.setMovingTime(Duration.ofHours(1).plusMinutes(5).plusSeconds(10));
|
Duration.ofHours(1).plusMinutes(5).plusSeconds(10),
|
||||||
stats.setMaxSpeed(Speed.of(100));
|
Distance.of(20000),
|
||||||
stats.setTotalAltitudeGain(6000f);
|
Speed.of(100),
|
||||||
|
null,
|
||||||
Track track = new Track();
|
new AltitudeGainLoss(6000, 6000),
|
||||||
track.setTrackStatistics(stats);
|
null,
|
||||||
|
null
|
||||||
|
));
|
||||||
|
|
||||||
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
||||||
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
||||||
@@ -375,26 +360,13 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
@Test
|
@Test
|
||||||
public void getAnnouncement_withInterval_imperial_pace() {
|
public void getAnnouncement_withInterval_imperial_pace() {
|
||||||
// given
|
// given
|
||||||
int numberOfPoints = 1000;
|
Pair<Track, Statistics> data = buildTrackWithTrackPoints();
|
||||||
Pair<Track.Id, TrackStatistics> trackWithStats = TestDataUtil.buildTrackWithTrackPoints(contentProviderUtils, numberOfPoints);
|
|
||||||
Track.Id trackId = trackWithStats.first;
|
|
||||||
TrackStatistics stats = trackWithStats.second;
|
|
||||||
IntervalStatistics.Interval lastInterval;
|
|
||||||
try (TrackPointIterator trackPointIterator = contentProviderUtils.getTrackPointLocationIterator(trackId, null)) {
|
|
||||||
assertEquals(trackPointIterator.getCount(), numberOfPoints);
|
|
||||||
IntervalStatistics intervalStatistics = new IntervalStatistics(Distance.of(1000));
|
|
||||||
intervalStatistics.addTrackPoints(trackPointIterator);
|
|
||||||
lastInterval = intervalStatistics.getIntervalList().get(intervalStatistics.getIntervalList().size() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
Track track = new Track();
|
|
||||||
track.setTrackStatistics(stats);
|
|
||||||
|
|
||||||
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
||||||
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String announcement = VoiceAnnouncementUtils.createStatistics(context, track, dataSet, UnitSystem.IMPERIAL_FEET, false, lastInterval, null).toString();
|
String announcement = VoiceAnnouncementUtils.createStatistics(context, data.first, dataSet, UnitSystem.IMPERIAL_FEET, false, data.second, null).toString();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals("12:16 AM. Total distance 8.8 miles. 16 minutes 39 seconds. Pace 1 minute 53 seconds per mile. Lap time 1 minute 53 seconds per mile.", announcement);
|
assertEquals("12:16 AM. Total distance 8.8 miles. 16 minutes 39 seconds. Pace 1 minute 53 seconds per mile. Lap time 1 minute 53 seconds per mile.", announcement);
|
||||||
@@ -402,31 +374,19 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAnnouncement_heart_rate_and_sensor_statistics() {
|
public void getAnnouncement_heart_rate_and_sensor_statistics() {
|
||||||
|
// given
|
||||||
PreferencesUtils.setVoiceAnnounceAverageHeartRate(true);
|
PreferencesUtils.setVoiceAnnounceAverageHeartRate(true);
|
||||||
PreferencesUtils.setVoiceAnnounceLapHeartRate(true);
|
PreferencesUtils.setVoiceAnnounceLapHeartRate(true);
|
||||||
|
|
||||||
int numberOfPoints = 1000;
|
Pair<Track, Statistics> data = buildTrackWithTrackPoints();
|
||||||
Pair<Track.Id, TrackStatistics> trackWithStats = TestDataUtil.buildTrackWithTrackPoints(contentProviderUtils, numberOfPoints);
|
|
||||||
Track.Id trackId = trackWithStats.first;
|
|
||||||
TrackStatistics stats = trackWithStats.second;
|
|
||||||
IntervalStatistics.Interval lastInterval;
|
|
||||||
try (TrackPointIterator trackPointIterator = contentProviderUtils.getTrackPointLocationIterator(trackId, null)) {
|
|
||||||
assertEquals(trackPointIterator.getCount(), numberOfPoints);
|
|
||||||
IntervalStatistics intervalStatistics = new IntervalStatistics(Distance.of(1000));
|
|
||||||
intervalStatistics.addTrackPoints(trackPointIterator);
|
|
||||||
lastInterval = intervalStatistics.getIntervalList().get(intervalStatistics.getIntervalList().size() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
SensorStatistics sensorStatistics = new SensorStatistics(HeartRate.of(180f), HeartRate.of(180f), null, null, null, null);
|
SensorStatistics sensorStatistics = new SensorStatistics(HeartRate.of(180f), HeartRate.of(180f), null, null, null, null);
|
||||||
|
|
||||||
Track track = new Track();
|
|
||||||
track.setTrackStatistics(stats);
|
|
||||||
|
|
||||||
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
||||||
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String announcement = VoiceAnnouncementUtils.createStatistics(context, track, dataSet, UnitSystem.METRIC, true, lastInterval, sensorStatistics).toString();
|
String announcement = VoiceAnnouncementUtils.createStatistics(context, data.first, dataSet, UnitSystem.METRIC, true, data.second, sensorStatistics).toString();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals("12:16 AM. Total distance 14.2 kilometers. 16 minutes 39 seconds. Average moving speed 51.2 kilometers per hour. Lap speed 51.2 kilometers per hour. Average heart rate 180 bpm. Lap heart rate 133 bpm.", announcement);
|
assertEquals("12:16 AM. Total distance 14.2 kilometers. 16 minutes 39 seconds. Average moving speed 51.2 kilometers per hour. Lap speed 51.2 kilometers per hour. Average heart rate 180 bpm. Lap heart rate 133 bpm.", announcement);
|
||||||
@@ -434,6 +394,7 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAnnouncement_heart_rate() {
|
public void getAnnouncement_heart_rate() {
|
||||||
|
// given
|
||||||
PreferencesUtils.setVoiceAnnounceHeartRateCurrent(true);
|
PreferencesUtils.setVoiceAnnounceHeartRateCurrent(true);
|
||||||
PreferencesUtils.setVoiceAnnounceLapHeartRate(true);
|
PreferencesUtils.setVoiceAnnounceLapHeartRate(true);
|
||||||
PreferencesUtils.setVoiceAnnounceAverageHeartRate(true);
|
PreferencesUtils.setVoiceAnnounceAverageHeartRate(true);
|
||||||
@@ -443,28 +404,15 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
PreferencesUtils.setVoiceAnnounceAverageSpeedPace(false);
|
PreferencesUtils.setVoiceAnnounceAverageSpeedPace(false);
|
||||||
PreferencesUtils.setVoiceAnnounceLapSpeedPace(false);
|
PreferencesUtils.setVoiceAnnounceLapSpeedPace(false);
|
||||||
|
|
||||||
int numberOfPoints = 1000;
|
Pair<Track, Statistics> data = buildTrackWithTrackPoints();
|
||||||
Pair<Track.Id, TrackStatistics> trackWithStats = TestDataUtil.buildTrackWithTrackPoints(contentProviderUtils, numberOfPoints);
|
|
||||||
Track.Id trackId = trackWithStats.first;
|
|
||||||
TrackStatistics stats = trackWithStats.second;
|
|
||||||
IntervalStatistics.Interval lastInterval;
|
|
||||||
try (TrackPointIterator trackPointIterator = contentProviderUtils.getTrackPointLocationIterator(trackId, null)) {
|
|
||||||
assertEquals(trackPointIterator.getCount(), numberOfPoints);
|
|
||||||
IntervalStatistics intervalStatistics = new IntervalStatistics(Distance.of(1000));
|
|
||||||
intervalStatistics.addTrackPoints(trackPointIterator);
|
|
||||||
lastInterval = intervalStatistics.getIntervalList().get(intervalStatistics.getIntervalList().size() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
SensorStatistics sensorStatistics = new SensorStatistics(HeartRate.of(180f), HeartRate.of(180f), null, null, null, null);
|
SensorStatistics sensorStatistics = new SensorStatistics(HeartRate.of(180f), HeartRate.of(180f), null, null, null, null);
|
||||||
|
|
||||||
Track track = new Track();
|
|
||||||
track.setTrackStatistics(stats);
|
|
||||||
|
|
||||||
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
SensorDataSet dataSet = Mockito.mock(SensorDataSet.class);
|
||||||
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
Mockito.when(dataSet.getHeartRate()).thenReturn(new Pair<>(HeartRate.of(60), "unused"));
|
||||||
|
|
||||||
// when
|
// when
|
||||||
String announcement = VoiceAnnouncementUtils.createStatistics(context, track, dataSet, UnitSystem.METRIC, true, lastInterval, sensorStatistics).toString();
|
String announcement = VoiceAnnouncementUtils.createStatistics(context, data.first, dataSet, UnitSystem.METRIC, true, data.second, sensorStatistics).toString();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals("12:16 AM. Current heart rate 60 bpm. Average heart rate 180 bpm. Lap heart rate 133 bpm.", announcement);
|
assertEquals("12:16 AM. Current heart rate 60 bpm. Average heart rate 180 bpm. Lap heart rate 133 bpm.", announcement);
|
||||||
@@ -484,4 +432,32 @@ public class VoiceAnnouncementUtilsTest {
|
|||||||
assertEquals("1.1 miles", MessageFormat.format(template, Map.of("n", 1.11)));
|
assertEquals("1.1 miles", MessageFormat.format(template, Map.of("n", 1.11)));
|
||||||
assertEquals("1.2 miles", MessageFormat.format(template, Map.of("n", 1.18)));
|
assertEquals("1.2 miles", MessageFormat.format(template, Map.of("n", 1.18)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Pair<Track, Statistics> buildTrackWithTrackPoints() {
|
||||||
|
int numberOfPoints = 1000;
|
||||||
|
|
||||||
|
ArrayList<TrackPoint> trackPoints = new ArrayList<>();
|
||||||
|
for (int i = 0; i < numberOfPoints; i++) {
|
||||||
|
trackPoints.add(TestDataUtil.createTrackPoint(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
IntervalStatisticsUpdater intervalStatistics = new IntervalStatisticsUpdater(Distance.of(1000));
|
||||||
|
intervalStatistics.addTrackPoints(trackPoints.iterator());
|
||||||
|
Statistics lastInterval = intervalStatistics.getLastInterval();
|
||||||
|
|
||||||
|
Track track = new Track(new Statistics(
|
||||||
|
Instant.EPOCH,
|
||||||
|
Instant.EPOCH.plusSeconds(999),
|
||||||
|
Duration.ofMinutes(16).plusSeconds(39),
|
||||||
|
Duration.ofMinutes(16).plusSeconds(39),
|
||||||
|
Distance.of(14208),
|
||||||
|
Speed.of(104),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
));
|
||||||
|
|
||||||
|
return new Pair<>(track, lastInterval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -41,7 +41,7 @@ public class PreferencesOpenHelperTest {
|
|||||||
// then there should be one layout with old custom layout that has the new CSV value.
|
// then there should be one layout with old custom layout that has the new CSV value.
|
||||||
List<RecordingLayout> recordingLayouts = PreferencesUtils.getAllCustomLayouts();
|
List<RecordingLayout> recordingLayouts = PreferencesUtils.getAllCustomLayouts();
|
||||||
assertNotNull(recordingLayouts);
|
assertNotNull(recordingLayouts);
|
||||||
assertEquals(recordingLayouts.size(), 1);
|
assertEquals(1, recordingLayouts.size());
|
||||||
assertEquals(recordingLayouts.get(0).toCsv(), PreferencesUtils.getCustomLayout().toCsv());
|
assertEquals(recordingLayouts.get(0).toCsv(), PreferencesUtils.getCustomLayout().toCsv());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ public class PreferencesOpenHelperTest {
|
|||||||
// then there should be one layout with old custom layout that has the new CSV value.
|
// then there should be one layout with old custom layout that has the new CSV value.
|
||||||
List<RecordingLayout> recordingLayouts = PreferencesUtils.getAllCustomLayouts();
|
List<RecordingLayout> recordingLayouts = PreferencesUtils.getAllCustomLayouts();
|
||||||
assertNotNull(recordingLayouts);
|
assertNotNull(recordingLayouts);
|
||||||
assertEquals(recordingLayouts.size(), 1);
|
assertEquals(1, recordingLayouts.size());
|
||||||
assertEquals(recordingLayouts.get(0).toCsv(), updatedOldCustomLayoutCsv);
|
assertEquals(recordingLayouts.get(0).toCsv(), updatedOldCustomLayoutCsv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,8 +90,8 @@ public class PreferencesOpenHelperTest {
|
|||||||
// then there should be one layout with old custom layout that has the new CSV value.
|
// then there should be one layout with old custom layout that has the new CSV value.
|
||||||
List<RecordingLayout> recordingLayouts = PreferencesUtils.getAllCustomLayouts();
|
List<RecordingLayout> recordingLayouts = PreferencesUtils.getAllCustomLayouts();
|
||||||
assertNotNull(recordingLayouts);
|
assertNotNull(recordingLayouts);
|
||||||
assertEquals(recordingLayouts.size(), 1);
|
assertEquals(1, recordingLayouts.size());
|
||||||
assertEquals(recordingLayouts.get(0).toCsv(), updatedOldCustomLayoutCsv);
|
assertEquals(updatedOldCustomLayoutCsv, recordingLayouts.get(0).toCsv());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -113,7 +113,7 @@ public class PreferencesOpenHelperTest {
|
|||||||
RecordingLayout defaultRecordingLayout = RecordingLayoutIO.fromCsv(PreferencesUtils.buildDefaultLayout(), resources);
|
RecordingLayout defaultRecordingLayout = RecordingLayoutIO.fromCsv(PreferencesUtils.buildDefaultLayout(), resources);
|
||||||
List<RecordingLayout> customRecordingLayout = PreferencesUtils.getAllCustomLayouts();
|
List<RecordingLayout> customRecordingLayout = PreferencesUtils.getAllCustomLayouts();
|
||||||
|
|
||||||
assertEquals(customRecordingLayout.size(), 1);
|
assertEquals(1, customRecordingLayout.size());
|
||||||
assertEquals(defaultRecordingLayout.toCsv(), customRecordingLayout.get(0).toCsv());
|
assertEquals(defaultRecordingLayout.toCsv(), customRecordingLayout.get(0).toCsv());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ public class PreferencesUtilsTest {
|
|||||||
List<RecordingLayout> recordingLayouts = PreferencesUtils.getAllCustomLayouts();
|
List<RecordingLayout> recordingLayouts = PreferencesUtils.getAllCustomLayouts();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(recordingLayouts.size(), 1);
|
assertEquals(1, recordingLayouts.size());
|
||||||
assertTrue(recordingLayouts.get(0).getFields().size() > 0);
|
assertFalse(recordingLayouts.get(0).getFields().isEmpty());
|
||||||
assertEquals(recordingLayouts.get(0).getName(), context.getString(R.string.stats_custom_layout_default_layout));
|
assertEquals(recordingLayouts.get(0).getName(), context.getString(R.string.stats_custom_layout_default_layout));
|
||||||
assertTrue(recordingLayouts.get(0).getFields().stream().anyMatch(DataField::isVisible));
|
assertTrue(recordingLayouts.get(0).getFields().stream().anyMatch(DataField::isVisible));
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ public class PreferencesUtilsTest {
|
|||||||
RecordingLayout recordingLayout = PreferencesUtils.getCustomLayout();
|
RecordingLayout recordingLayout = PreferencesUtils.getCustomLayout();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertTrue(recordingLayout.getFields().size() > 0);
|
assertFalse(recordingLayout.getFields().isEmpty());
|
||||||
assertEquals(recordingLayout.getName(), context.getString(R.string.stats_custom_layout_default_layout));
|
assertEquals(recordingLayout.getName(), context.getString(R.string.stats_custom_layout_default_layout));
|
||||||
assertTrue(recordingLayout.getFields().stream().anyMatch(DataField::isVisible));
|
assertTrue(recordingLayout.getFields().stream().anyMatch(DataField::isVisible));
|
||||||
}
|
}
|
||||||
@@ -130,9 +130,9 @@ public class PreferencesUtilsTest {
|
|||||||
RecordingLayout recordingLayout = PreferencesUtils.getCustomLayout();
|
RecordingLayout recordingLayout = PreferencesUtils.getCustomLayout();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(recordingLayout.getFields().size(), 4);
|
assertEquals(4, recordingLayout.getFields().size());
|
||||||
assertEquals(recordingLayout.getName(), "run");
|
assertEquals("run", recordingLayout.getName());
|
||||||
assertEquals(recordingLayout.getColumnsPerRow(), 2);
|
assertEquals(2, recordingLayout.getColumnsPerRow());
|
||||||
|
|
||||||
assertEquals(recordingLayout.getFields().get(0).getKey(), context.getString(R.string.stats_custom_layout_moving_time_key));
|
assertEquals(recordingLayout.getFields().get(0).getKey(), context.getString(R.string.stats_custom_layout_moving_time_key));
|
||||||
assertTrue(recordingLayout.getFields().get(0).isVisible());
|
assertTrue(recordingLayout.getFields().get(0).isVisible());
|
||||||
@@ -169,9 +169,9 @@ public class PreferencesUtilsTest {
|
|||||||
RecordingLayout recordingLayout = PreferencesUtils.getCustomLayout();
|
RecordingLayout recordingLayout = PreferencesUtils.getCustomLayout();
|
||||||
|
|
||||||
// then
|
// then
|
||||||
assertEquals(recordingLayout.getFields().size(), 4);
|
assertEquals(4, recordingLayout.getFields().size());
|
||||||
assertEquals(recordingLayout.getName(), "walking");
|
assertEquals("walking", recordingLayout.getName());
|
||||||
assertEquals(recordingLayout.getColumnsPerRow(), 2);
|
assertEquals(2, recordingLayout.getColumnsPerRow());
|
||||||
|
|
||||||
assertEquals(recordingLayout.getFields().get(0).getKey(), context.getString(R.string.stats_custom_layout_moving_time_key));
|
assertEquals(recordingLayout.getFields().get(0).getKey(), context.getString(R.string.stats_custom_layout_moving_time_key));
|
||||||
assertTrue(recordingLayout.getFields().get(0).isVisible());
|
assertTrue(recordingLayout.getFields().get(0).isVisible());
|
||||||
@@ -266,11 +266,11 @@ public class PreferencesUtilsTest {
|
|||||||
// then only updated profile is modified in the custom layouts
|
// then only updated profile is modified in the custom layouts
|
||||||
List<RecordingLayout> layoutsAfter = PreferencesUtils.getAllCustomLayouts();
|
List<RecordingLayout> layoutsAfter = PreferencesUtils.getAllCustomLayouts();
|
||||||
|
|
||||||
assertEquals(layoutsBefore.size(), 2);
|
assertEquals(2, layoutsBefore.size());
|
||||||
assertEquals(layoutsAfter.size(), 2);
|
assertEquals(2, layoutsAfter.size());
|
||||||
|
|
||||||
assertEquals(layoutsBefore.get(0).getFields().stream().filter(DataField::isVisible).count(), 4);
|
assertEquals(4, layoutsBefore.get(0).getFields().stream().filter(DataField::isVisible).count());
|
||||||
assertEquals(layoutsAfter.get(0).getFields().stream().filter(DataField::isVisible).count(), 1);
|
assertEquals(1, layoutsAfter.get(0).getFields().stream().filter(DataField::isVisible).count());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -309,11 +309,11 @@ public class PreferencesUtilsTest {
|
|||||||
// then only updated profile is modified in the custom layouts
|
// then only updated profile is modified in the custom layouts
|
||||||
List<RecordingLayout> layoutsAfter = PreferencesUtils.getAllCustomLayouts();
|
List<RecordingLayout> layoutsAfter = PreferencesUtils.getAllCustomLayouts();
|
||||||
|
|
||||||
assertEquals(layoutsBefore.size(), 2);
|
assertEquals(2, layoutsBefore.size());
|
||||||
assertEquals(layoutsAfter.size(), 2);
|
assertEquals(2, layoutsAfter.size());
|
||||||
|
|
||||||
assertEquals(layoutsBefore.get(0).getFields().stream().filter(DataField::isVisible).count(), 4);
|
assertEquals(4, layoutsBefore.get(0).getFields().stream().filter(DataField::isVisible).count());
|
||||||
assertEquals(layoutsAfter.get(0).getFields().stream().filter(DataField::isVisible).count(), 1);
|
assertEquals(1, layoutsAfter.get(0).getFields().stream().filter(DataField::isVisible).count());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -341,6 +341,6 @@ public class PreferencesUtilsTest {
|
|||||||
RecordingLayout recordingLayout = PreferencesUtils.getCustomLayout();
|
RecordingLayout recordingLayout = PreferencesUtils.getCustomLayout();
|
||||||
|
|
||||||
// then the first one was returned
|
// then the first one was returned
|
||||||
assertEquals(recordingLayout.getName(), "cycling");
|
assertEquals("cycling", recordingLayout.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user