Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Methods to update the data for the moving average speed chart #195

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ captures/
.idea/libraries
.idea/caches
.idea/misc.xml

.idea/migrations.xml

# IntelliJ IDEA
*.iws
Expand Down Expand Up @@ -82,3 +82,5 @@ captures/
Appfile
releasePlayStore/*
Gemfile.lock

.DS_Store
10 changes: 10 additions & 0 deletions .idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added OpenTracks Data.zip
Binary file not shown.
24,555 changes: 24,555 additions & 0 deletions OpenTracks Data/2024-03-02_08_28_20.654_2024-03-02T08_28-05.gpx

Large diffs are not rendered by default.

23,233 changes: 23,233 additions & 0 deletions OpenTracks Data/2024-03-03_08_30_29.065_2024-03-03T08_30-05 - Copy.gpx

Large diffs are not rendered by default.

29,704 changes: 29,704 additions & 0 deletions OpenTracks Data/2024-03-09_08_26_58.708_2024-03-09T08_26-05.gpx

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.2.1'
classpath 'com.android.tools.build:gradle:8.3.1'
}
}

allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}

Expand Down Expand Up @@ -125,6 +126,7 @@ android {
}

dependencies {
androidTestImplementation 'org.junit.jupiter:junit-jupiter:5.8.1'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'

implementation 'androidx.appcompat:appcompat:1.6.1'
Expand All @@ -136,6 +138,8 @@ dependencies {
implementation 'androidx.core:core:1.12.0'
implementation 'androidx.core:core-splashscreen:1.0.1'
implementation 'androidx.mediarouter:mediarouter:1.6.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'com.google.code.gson:gson:2.10.1'

androidTestImplementation 'androidx.test:core:1.5.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package de.dennisguse.opentracks.ui.aggregatedStatistics.dailyStats;

import org.junit.Test;

import java.util.ArrayList; // import the ArrayList class
import java.util.List; // import the List class

import com.github.mikephil.charting.data.Entry;

public class DailyPlottingModuleTest {
@Test
public void movingAverageCorrect() throws Exception {
DailyPlottingModule plotModule = new DailyPlottingModule();
List<Entry> test_entries = new ArrayList<Entry>();
for (float i = 1f; i <= 10f; i++) {
test_entries.add(new Entry(i, i));
}
int frequency = 3;
System.out.println("************************");
System.out.println("ORIGINAL DATA ENTRIES:");
System.out.println("************************");
for (int i = 0; i < test_entries.size(); i++)
System.out.println(test_entries.get(i).toString());

System.out.println("\n************************");
System.out.println("MOVING AVERAGE DATA ENTRIES FOR FREQUENCY = " + frequency + " :");
System.out.println("************************");
List<Entry> results = plotModule.getMovingAverage(test_entries, frequency);
for (int i = 0; i < results.size(); i++)
System.out.println(results.get(i).toString());


}
}
Loading