Luca stuff

This commit is contained in:
2024-06-05 16:16:10 +02:00
parent 8e57713152
commit f53d628d3b

View File

@@ -27,7 +27,7 @@ public class InputProcessor {
private Vector3f[][] targetRotationVectorPaths; // Target path of the motion data
private float exerciseRepetitionDurationInSeconds = 0.0f;
private int exercisesRemaining = 0;
private int exercisesRemaining = 1;
private float errorCheckInterval_s;
private int checksPerformed = 0;
@@ -134,6 +134,7 @@ public class InputProcessor {
* @param exercise The exercise to move on to.
*/
private void nextExercise(Exercise exercise) {
Log.i("InputProcessor", "Acquired next exercise: " + exercise.name);
if (this.exercisesRemaining-- <= 0) {
// Move to end screen on main activity
@@ -147,9 +148,6 @@ public class InputProcessor {
this.checksPerformed = 0;
this.totalChecks = ExerciseManager.DEFAULT_EXERCISE_REPETITIONS * 6;
Log.i("InputProcessor", "Exercise error checking interval: " + this.errorCheckInterval_s);
this.selfRotationVectorPaths = new ArrayList[2];
this.selfRotationVectorPaths[0] = new ArrayList<>();
this.selfRotationVectorPaths[1] = new ArrayList<>();
@@ -161,7 +159,10 @@ public class InputProcessor {
this.secondsPassed = 0.0D;
this.lastTime = System.currentTimeMillis();
this.errorCheckInterval_s = this.exerciseRepetitionDurationInSeconds * ExerciseManager.DEFAULT_EXERCISE_REPETITIONS / 6.0f;
Log.i("InputProcessor", "Repetition time: " + exercise.exerciseTimeInSeconds);
this.exerciseRepetitionDurationInSeconds = Math.max(this.exerciseRepetitionDurationInSeconds, 2);
this.errorCheckInterval_s = exercise.exerciseTimeInSeconds / 6.0f;
Log.i("InputProcessor", "Exercise error checking interval: " + this.errorCheckInterval_s);
}
/**
@@ -170,7 +171,7 @@ public class InputProcessor {
public void onAdequateRepetition() {
ExerciseManager.TOTAL_REPETITIONS_PERFORMED++;
Log.i("InputProcessor", "Adequate repetition performed");
this.parentActivity.incrementProgress();
this.parentActivity.runOnUiThread(this.parentActivity::incrementProgress);
}
/**
@@ -178,7 +179,7 @@ public class InputProcessor {
*/
public void onInadequateRepetition() {
Log.i("InputProcessor", "Inadequate repetition performed");
this.parentActivity.triggerColorBurst(false);
this.parentActivity.runOnUiThread(() -> this.parentActivity.triggerColorBurst(false));
}
/**
@@ -239,7 +240,6 @@ public class InputProcessor {
* Upon successful retrieval, it will call the nextExercise method.
*/
private void acquireExercise() {
this.exercisesRemaining--;
Log.i("MotionProcessor", "Fetching exercise data.");