Im testing a meter example that uses animation from uraich repo:
#!//opt/bin/lv_micropython -i
import time
import lvgl as lv
import display_driver
def set_value(indic, v):
meter.set_indicator_value(indic, v)
#
# A simple meter
#
meter = lv.meter(lv.scr_act())
meter.center()
meter.set_size(200, 200)
# Add a scale first
scale = meter.add_scale()
meter.set_scale_ticks(scale, 51, 2, 10, lv.palette_main(lv.PALETTE.GREY))
meter.set_scale_major_ticks(scale, 10, 4, 15, lv.color_black(), 10)
This file has been truncated. show original
When I run the script multiple times(reloading new clear screen) looks that previous animations still alive in the system.
I tried few things with lv.anim_del and a.custom_del functions but looks nothing works.
How can I stop/detach/delete the animation?
That’s a good question, thanks for bringing this up.
I think you found a problem.
I’ve added a related comment on GitHub:
opened 04:00PM - 16 Mar 21 UTC
Hi,
Almost every planned feature is implemented for v8. Now what we need the … most is a lot of feedback about bugs and possible regressions.
v8 is available in the `master` branch of lvgl.
https://github.com/lvgl/lv_sim_eclipse_sdl/tree/dev is a ready-to-use project with v8. Note that the driver registration part slightly changed. The most important thing is that drivers `lv_indev_drv_t`, `lv_disp_drv_t` and `lv_fs_drv_t` needs to be `static`.
I suggest trying the demo widget first. It should work well on small (240x240) and very large (1280x720) screens.
The followings will be added soon:
- The `copy` parameter is not working yet in the `create` functions
- the mono theme
- updating the docs
- updating the MicroPython binding
In v8 there is an `examples` directory where you find a lot of examples for widgets, layouts, etc.
If you have minor remarks, feel free to comment here. For bigger issues please open a new issue.
Here is a teaser about the new widgets demo on 800x480:
https://user-images.githubusercontent.com/7599318/111334210-a60a8380-8673-11eb-9092-72e1afb3549a.mp4
Thank you very much if you test v8 and tell your experience :slightly_smiling_face:
Fixed on latest lv_micropython dev-8 branch .
(dev-8 will be merged into “master” branch soon)
For example:
running_anim = lv.anim_t.start(a)
Then you can stop animation like this:
running_anim.custom_del(None)
Thank you for support.
I will update my repo and try test it tomorrow.
I updated my dev-8 branch with “git pull” command… But I after recomlipe I still see the problem: When I run twice the script, the meter start to jump randomly…
So maybe I need to do something more with git?? (Im not so experienced with such tools)
You also need to run git submodule update --recursive
to update git submodules (such as LVGL).
Also, as explained above, you are not supposed to delete “a
” like you are doing in your code, but the value returned from start
.
Something like this:
a = lv.anim_t()
a.init()
... initialize a ...
running_anim = a.start()
Then later you can call:
running_anim.custom_del(None)