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

✨ Add LKAnimationKit #217

Merged
merged 4 commits into from
Apr 20, 2021

Conversation

YannLocatelli
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Apr 12, 2021

Codecov Report

Merging #217 (9ab5bbe) into develop (6c6323a) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 9ab5bbe differs from pull request most recent head 7ed30a5. Consider uploading reports for the commit 7ed30a5 to get more accurate results
Impacted file tree graph

@@            Coverage Diff            @@
##           develop      #217   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           40        42    +2     
  Lines          651       665   +14     
=========================================
+ Hits           651       665   +14     
Impacted Files Coverage Δ
libs/LKAnimationKit/include/internal/CGAnimation.h 100.00% <100.00%> (ø)
libs/LKAnimationKit/source/LKAnimationKit.cpp 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c6323a...7ed30a5. Read the comment docs.

@YannLocatelli YannLocatelli changed the title Add LKAnimationKit ✨ Add LKAnimationKit Apr 12, 2021
Copy link
Member

@ladislas ladislas left a comment

Choose a reason for hiding this comment

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

premier passage! :)

libs/CMakeLists.txt Show resolved Hide resolved
libs/LKAnimationKit/CMakeLists.txt Outdated Show resolved Hide resolved
libs/LKAnimationKit/CMakeLists.txt Outdated Show resolved Hide resolved
libs/LKAnimationKit/include/LKAnimationKit.h Outdated Show resolved Hide resolved
libs/LKAnimationKit/include/LKAnimationKit.h Outdated Show resolved Hide resolved
libs/LKAnimationKit/source/LKAnimationKit.cpp Outdated Show resolved Hide resolved
libs/LKAnimationKit/source/LKAnimationKit.cpp Outdated Show resolved Hide resolved
libs/LKAnimationKit/source/LKAnimationKit.cpp Outdated Show resolved Hide resolved
spikes/lk_cg_animations/CMakeLists.txt Outdated Show resolved Hide resolved
spikes/lk_cg_animations/CMakeLists.txt Outdated Show resolved Hide resolved
@YannLocatelli YannLocatelli force-pushed the yann/images_and_animations/add-LKAnimationKit branch 2 times, most recently from 4a70ce6 to 4537fd0 Compare April 13, 2021 13:40
libs/LKAnimationKit/source/LKAnimationKit.cpp Outdated Show resolved Hide resolved
libs/LKAnimationKit/source/LKAnimationKit.cpp Outdated Show resolved Hide resolved
libs/LKAnimationKit/include/LKAnimationKit.h Outdated Show resolved Hide resolved
libs/LKAnimationKit/include/LKAnimationKit.h Outdated Show resolved Hide resolved
@YannLocatelli YannLocatelli force-pushed the yann/images_and_animations/add-LKAnimationKit branch 2 times, most recently from fb32c83 to 6a5d68c Compare April 19, 2021 08:49
Copy link
Member

@ladislas ladislas left a comment

Choose a reason for hiding this comment

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

on est quasi bon! quelques petits points de forme et un ajout sur les tests et on est bon 👍

libs/CMakeLists.txt Outdated Show resolved Hide resolved
libs/LKAnimationKit/include/internal/CGAnimation.h Outdated Show resolved Hide resolved
_animation.stop();
}

void LKAnimationKit::setRefreshRate(std::chrono::milliseconds rate)
Copy link
Member

Choose a reason for hiding this comment

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

quelles peuvent être les raisons de changer le refresh rate?

quel est l'impact? ne doit-on pas le passer aussi à CGAnimation pour pas qu'elle puisse s'adapter (on ne veut pas que le cube aille trop vite ou trop lentement)

Copy link
Member Author

Choose a reason for hiding this comment

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

Il n'y a pas de notion de temps dans les CGAnimation

Celui qui gère le temps, que ce soit avec des ThisThread::sleep_for() ou lors du event_queue, c'est dans LKAnimationKit. C'est l'appel de run() dans LKAnimationKit qui conditionnera la vitesse de l'animation

La raison pour le changer sont

  • D'un point de vue esthétique, chaque animation à des vitesse différentes
  • Dans LKAnimationKit, garder le contrôle du "Temps" à haut niveau

Copy link
Member

Choose a reason for hiding this comment

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

Il n'y a pas de notion de temps dans les CGAnimation

c'est pas l'object de la PR mais en fait si c'est là que ça doit être

D'un point de vue esthétique, chaque animation à des vitesse différentes

mais ça LKAnimationKit ne le sait pas, faut donc que l'utilisateur se rappelle de mettre le "bon temps"

Dans LKAnimationKit, garder le contrôle du "Temps" à haut niveau

je ne comprends pas ça

C'est l'appel de run() dans LKAnimationKit qui conditionnera la vitesse de l'animation

en animation en général tu veux justement tout l'inverse : si ton ordi rame sur une tâche lourde et que tu joues une vidéo en même temps, le durée absolue de la vidéo ne va pas changer, la vidéo ne sera pas jouée au ralenti. par contre tu vas avoir du lag avec des moments de freeze puis une courte séquence, freeze, et ainsi de suite. c'est le CPU qui donne trop peu de temps au process de la vidéo pour avancer correctement.

c'est au lecteur de s'adapter

ici c'est pareil:

  • une animation elle doit avoir une version de base avec une durée définie et une fréquence optimale définies aussi
  • tu peux vouloir la jouer plus ou moins vite mais je ne vois pas de cas d'usage pour ça
  • connaissant sa durée, tu sais dire à chaque fois que tu appelles run() ou tu dois en être. tu peux donc corriger si ça rame pour ne pas avoir l'animation qui dure plus longtemps que prévu e et qui risque donc de décaler tout le reste dans le temps

bien sûr le lag n'est pas ce qu'on recherche, mais c'est le moindre mal vis à vis du timing.

cela dit, ce n'est pas l'objet de la PR, on pourra revoir cela plus tard.

libs/LKAnimationKit/tests/LKAnimationKit_test.cpp Outdated Show resolved Hide resolved
libs/LKAnimationKit/tests/LKAnimationKit_test.cpp Outdated Show resolved Hide resolved
tests/unit/mbed-os/mocks/mock_CGAnimation.h Outdated Show resolved Hide resolved
tests/unit/mbed-os/stubs/stub_EventQueue_extended.cpp Outdated Show resolved Hide resolved
@YannLocatelli YannLocatelli force-pushed the yann/images_and_animations/add-LKAnimationKit branch 4 times, most recently from fead98e to 1e4347a Compare April 19, 2021 13:58
Copy link
Member

@ladislas ladislas left a comment

Choose a reason for hiding this comment

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

encore trois trucs et on merge 👍

libs/LKAnimationKit/include/LKAnimationKit.h Show resolved Hide resolved
libs/LKAnimationKit/include/internal/CGAnimation.h Outdated Show resolved Hide resolved
libs/LKAnimationKit/source/LKAnimationKit.cpp Outdated Show resolved Hide resolved
libs/LKAnimationKit/source/LKAnimationKit.cpp Outdated Show resolved Hide resolved
@YannLocatelli YannLocatelli force-pushed the yann/images_and_animations/add-LKAnimationKit branch 2 times, most recently from 9dcfce6 to d71a6d8 Compare April 20, 2021 09:05
Copy link
Member

@ladislas ladislas left a comment

Choose a reason for hiding this comment

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

3 points de formes et une question sur le setRefreshDuration

libs/LKAnimationKit/tests/LKAnimationKit_test.cpp Outdated Show resolved Hide resolved
libs/LKAnimationKit/source/LKAnimationKit.cpp Outdated Show resolved Hide resolved
Comment on lines 77 to 79
auto refresh_duration = std::chrono::milliseconds(42);

animationkit.setRefreshDuration(refresh_duration);
Copy link
Member

Choose a reason for hiding this comment

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

ici on test pas que dispatch est appelé avec le bon refresh duration? (voir comment plus haut)

Copy link
Member Author

Choose a reason for hiding this comment

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

Il faut faire un mock de event_queue, c'était pas spécialement prévu mais si c'est indispensable je peux le faire

spikes/lk_cg_animations/CMakeLists.txt Outdated Show resolved Hide resolved
@YannLocatelli YannLocatelli force-pushed the yann/images_and_animations/add-LKAnimationKit branch from 9ab5bbe to 167fa8a Compare April 20, 2021 10:53
@YannLocatelli YannLocatelli force-pushed the yann/images_and_animations/add-LKAnimationKit branch from 167fa8a to 5a2e531 Compare April 20, 2021 11:03
@ladislas ladislas force-pushed the yann/images_and_animations/add-LKAnimationKit branch from 5a2e531 to 7ed30a5 Compare April 20, 2021 12:08
@codeclimate
Copy link

codeclimate bot commented Apr 20, 2021

Code Climate has analyzed commit 7ed30a5 and detected 0 issues on this pull request.

View more on Code Climate.

@ladislas ladislas merged commit f70dbab into develop Apr 20, 2021
@sonarcloud
Copy link

sonarcloud bot commented Apr 20, 2021

@ladislas ladislas deleted the yann/images_and_animations/add-LKAnimationKit branch April 20, 2021 13:22
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.

2 participants