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

[Feat/#25] onboarding / bpm level 저장 #26

Merged
merged 4 commits into from
Jul 30, 2024
Merged

Conversation

chattymin
Copy link
Member

⛳️ Work Description

  • bpm level 저장

📢 To Reviewers

  • 후다다다다다다닥

@chattymin chattymin requested a review from Marchbreeze July 30, 2024 14:39
@chattymin chattymin self-assigned this Jul 30, 2024
Comment on lines +41 to +55
fun setBpmLevel() {
val level = when (_speed.value / (_stepCount.value / SPEED_CALC_INTERVAL)) {
in 55f..65f -> 2
in 65f..75f -> 3
in 75f..85f -> 4
in 85f..95f -> 5
in 95f..105f -> 6
in 15f..115f -> 7
in 115f..125f -> 8
in 125f..Float.MAX_VALUE -> 9
else -> 1
}

userRepository.setBpmLevel(level)
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else로 1을 넣은 이유는 분모가 0이 될 수 있는 가능성 때문입니다.
1분간 사용자가 만약 10회 이하의 걸음을 걸었다면 분모가 0이 되어 무한에 가까운 숫자가 나오게 되어 level이 9가 되게 됩니다.
하지만, 해당 상황의 경우 level 1에 더 가깝다고 판단되어 else를 1로 설정했습니다.

Copy link
Member

@Marchbreeze Marchbreeze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

크크 개굿~

@chattymin chattymin merged commit ae1ceba into develop Jul 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] OnBoarding / 측정한 결과 값 저장
2 participants