This commit is contained in:
Luca Warmenhoven
2024-05-28 14:36:48 +02:00
parent 4c9a256d6c
commit 31135d1aa7

View File

@@ -89,11 +89,6 @@ public class PersonalMotionPreviewElement extends View {
this.exercise = exercise;
this.path = exercise.getPath();
this.motionProcessor = new MotionProcessor(qiContext);
this.motionProcessor.startListening();
this.motionProcessor.setMotionDataEventHandler((processed, preprocessed, sampleIndex, sampleRate, deviceId) -> {
// TODO: Implement the calculation of the `performingPath` based on the motion data
});
}
/**
@@ -105,6 +100,13 @@ public class PersonalMotionPreviewElement extends View {
*/
public void provideQiContext(QiContext context) {
this.qiContext = context;
if ( this.motionProcessor != null )
this.motionProcessor.stopListening();
this.motionProcessor = new MotionProcessor(qiContext);
this.motionProcessor.startListening();
this.motionProcessor.setMotionDataEventHandler((processed, preprocessed, sampleIndex, sampleRate, deviceId) -> {
// TODO: Implement the calculation of the `performingPath` based on the motion data
});
saySomethingNice();
}