|
|
|
@ -40,7 +40,7 @@ MovesenseExerciseService::MovesenseExerciseService()
|
|
|
|
|
isRunning(false),
|
|
|
|
|
mLastTimeStamp(0),
|
|
|
|
|
mTimer(whiteboard::ID_INVALID_TIMER),
|
|
|
|
|
mMaxAccelerationData(SAMPLE_RATE)
|
|
|
|
|
mAccelerationData(SAMPLE_RATE)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -189,7 +189,7 @@ void MovesenseExerciseService::onNotify(whiteboard::ResourceId resourceId, const
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < arrayData.size(); i++)
|
|
|
|
|
{
|
|
|
|
|
mMaxAccelerationData.push_back(arrayData[i]);
|
|
|
|
|
mAccelerationData.push_back(arrayData[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
@ -270,11 +270,11 @@ void MovesenseExerciseService::onTimer(whiteboard::TimerId timerId)
|
|
|
|
|
/// @todo The timestamp is the last measurement's timestamp and not the current time.
|
|
|
|
|
WB_RES::SampleDataValue sampleDataValue;
|
|
|
|
|
sampleDataValue.relativeTime = mLastTimeStamp;
|
|
|
|
|
sampleDataValue.value = SumVectorAverage(mMaxAccelerationData);
|
|
|
|
|
sampleDataValue.value = SumVectorAverage(mAccelerationData);
|
|
|
|
|
|
|
|
|
|
// Reset members
|
|
|
|
|
mLastTimeStamp = 0;
|
|
|
|
|
mMaxAccelerationData.clear();
|
|
|
|
|
mAccelerationData.clear();
|
|
|
|
|
|
|
|
|
|
// and update our WB resource. This causes notification to be fired to our subscribers
|
|
|
|
|
updateResource(WB_RES::LOCAL::EXERCISE_SUMVECTOR_DENES(),
|
|
|
|
|