Attempt to make good
This commit is contained in:
@@ -76,7 +76,7 @@ public class ExerciseManager {
|
|||||||
content.get(PROPERTY_NAME).getAsString(),
|
content.get(PROPERTY_NAME).getAsString(),
|
||||||
content.get(PROPERTY_DESC).getAsString(),
|
content.get(PROPERTY_DESC).getAsString(),
|
||||||
gesturePathFromString(content.get(PROPERTY_VECTORS).getAsString()),
|
gesturePathFromString(content.get(PROPERTY_VECTORS).getAsString()),
|
||||||
DEFAULT_SEGMENT_SPEED
|
gesturePathFromString(content.get(PROPERTY_SEGMENT_SPEED).getAsString())
|
||||||
);
|
);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@@ -108,9 +108,10 @@ public class PersonalMotionPreviewElement extends View {
|
|||||||
|
|
||||||
// Handler that is called every time the motion processor receives new data.
|
// Handler that is called every time the motion processor receives new data.
|
||||||
this.motionProcessor.setMotionDataEventHandler((processed, preprocessed, sampleIndex, sampleRate, deviceId) -> {
|
this.motionProcessor.setMotionDataEventHandler((processed, preprocessed, sampleIndex, sampleRate, deviceId) -> {
|
||||||
this.exerciseProgress = Math.min(1, Math.max(0, this.motionProcessor.getAverageError(this.paths[0], 0) / 10));
|
double progress = this.motionProcessor.getAverageError(this.paths[0], 0);
|
||||||
|
this.exerciseProgress = Math.min(1, Math.max(0, progress));
|
||||||
this.invalidate();
|
this.invalidate();
|
||||||
Log.i("MotionProcessor", "Processed data: " + processed);
|
Log.i("MotionProcessor", "Processed data: " + progress + " (" + preprocessed + ")");
|
||||||
});
|
});
|
||||||
saySomethingNice();
|
saySomethingNice();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user