From 6163437afd4502a5ecf9940c805a06cc3f161f86 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 12 Oct 2023 17:21:52 +0200 Subject: [PATCH] refactor(scale): remove lv_meter use lv_scale instead --- demos/stress/lv_demo_stress.c | 4 +- .../widgets/assets/img_demo_widgets_needle.c | 42 ++ demos/widgets/lv_demo_widgets.c | 528 +++++++-------- docs/widgets/btnmatrix.md | 0 docs/widgets/index.rst | 1 - docs/widgets/meter.rst | 158 ----- docs/widgets/scale.rst | 4 +- examples/assets/img_hand.c | 26 - examples/widgets/chart/lv_example_chart_3.c | 52 +- examples/widgets/chart/lv_example_chart_4.c | 4 +- examples/widgets/chart/lv_example_chart_5.c | 6 +- examples/widgets/chart/lv_example_chart_6.c | 6 +- examples/widgets/chart/lv_example_chart_7.c | 4 +- examples/widgets/meter/index.rst | 28 - examples/widgets/meter/lv_example_meter_1.c | 65 -- examples/widgets/meter/lv_example_meter_1.py | 53 -- examples/widgets/meter/lv_example_meter_2.c | 59 -- examples/widgets/meter/lv_example_meter_2.py | 65 -- examples/widgets/meter/lv_example_meter_3.c | 74 --- examples/widgets/meter/lv_example_meter_3.py | 1 - examples/widgets/meter/lv_example_meter_4.c | 37 -- examples/widgets/meter/lv_example_meter_4.py | 33 - examples/widgets/scale/lv_example_scale_2.c | 8 +- examples/widgets/scale/lv_example_scale_4.c | 6 +- examples/widgets/scale/lv_example_scale_5.c | 4 +- lvgl.h | 1 - src/core/lv_obj_tree.c | 7 + src/core/lv_obj_tree.h | 13 + src/themes/default/lv_theme_default.c | 10 +- src/widgets/chart/lv_chart.c | 392 ++--------- src/widgets/chart/lv_chart.h | 20 +- src/widgets/meter/lv_meter.c | 625 ------------------ src/widgets/meter/lv_meter.h | 235 ------- src/widgets/scale/lv_scale.c | 46 +- src/widgets/scale/lv_scale.h | 6 +- tests/src/test_cases/widgets/test_chart.c | 12 - 36 files changed, 443 insertions(+), 2192 deletions(-) create mode 100644 demos/widgets/assets/img_demo_widgets_needle.c delete mode 100644 docs/widgets/btnmatrix.md delete mode 100644 docs/widgets/meter.rst delete mode 100644 examples/widgets/meter/index.rst delete mode 100644 examples/widgets/meter/lv_example_meter_1.c delete mode 100644 examples/widgets/meter/lv_example_meter_1.py delete mode 100644 examples/widgets/meter/lv_example_meter_2.c delete mode 100644 examples/widgets/meter/lv_example_meter_2.py delete mode 100644 examples/widgets/meter/lv_example_meter_3.c delete mode 100644 examples/widgets/meter/lv_example_meter_3.py delete mode 100644 examples/widgets/meter/lv_example_meter_4.c delete mode 100644 examples/widgets/meter/lv_example_meter_4.py delete mode 100644 src/widgets/meter/lv_meter.c delete mode 100644 src/widgets/meter/lv_meter.h diff --git a/demos/stress/lv_demo_stress.c b/demos/stress/lv_demo_stress.c index b5d7176e1..8a1aa6d02 100644 --- a/demos/stress/lv_demo_stress.c +++ b/demos/stress/lv_demo_stress.c @@ -233,9 +233,9 @@ static void obj_test_task_cb(lv_timer_t * tmr) lv_anim_set_exec_cb(&a, arc_set_end_angle_anim); lv_anim_start(&a); - obj = lv_meter_create(main_page); + obj = lv_scale_create(main_page); + lv_scale_set_mode(obj, LV_SCALE_MODE_ROUND_INNER); lv_obj_scroll_to_view(obj, LV_ANIM_ON); - lv_meter_add_needle_line(obj, 3, lv_palette_main(LV_PALETTE_RED), -10); auto_del(obj, LV_DEMO_STRESS_TIME_STEP * 6 + 30); break; diff --git a/demos/widgets/assets/img_demo_widgets_needle.c b/demos/widgets/assets/img_demo_widgets_needle.c new file mode 100644 index 000000000..08161817f --- /dev/null +++ b/demos/widgets/assets/img_demo_widgets_needle.c @@ -0,0 +1,42 @@ +#ifdef __has_include + #if __has_include("lvgl.h") + #ifndef LV_LVGL_H_INCLUDE_SIMPLE + #define LV_LVGL_H_INCLUDE_SIMPLE + #endif + #endif +#endif + +#if defined(LV_LVGL_H_INCLUDE_SIMPLE) + #include "lvgl.h" +#else + #include "lvgl/lvgl.h" +#endif + +#ifndef LV_ATTRIBUTE_MEM_ALIGN + #define LV_ATTRIBUTE_MEM_ALIGN +#endif + +#ifndef LV_ATTRIBUTE_IMAGE_IMG_DEMO_WIDGETS_NEEDLE + #define LV_ATTRIBUTE_IMAGE_IMG_DEMO_WIDGETS_NEEDLE +#endif + +const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMAGE_IMG_DEMO_WIDGETS_NEEDLE uint8_t img_demo_widgets_needle_map[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x04, 0x63, 0x63, 0x63, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x4f, 0x4f, 0x47, 0x03, 0x03, 0x03, 0x57, 0x22, 0x22, 0x22, 0x57, 0x3c, 0x3c, 0x3c, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5b, 0x5b, 0x5b, 0x0c, 0x38, 0x38, 0x38, 0x74, 0x19, 0x19, 0x19, 0xeb, 0x18, 0x18, 0x18, 0xf0, 0x3a, 0x3a, 0x3a, 0xbc, 0x3e, 0x3e, 0x3e, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x03, 0x1e, 0x1e, 0x1e, 0x8f, 0x16, 0x16, 0x16, 0xfb, 0x04, 0x04, 0x04, 0xff, 0x06, 0x06, 0x06, 0xff, 0x0b, 0x0b, 0x0b, 0xec, 0x20, 0x20, 0x20, 0x87, 0x4a, 0x4a, 0x4a, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7b, 0x7b, 0x7b, 0x0f, 0x35, 0x35, 0x35, 0xcb, 0x03, 0x03, 0x03, 0xff, 0x06, 0x06, 0x06, 0xff, 0x04, 0x04, 0x04, 0xff, 0x03, 0x03, 0x03, 0xff, 0x1a, 0x1a, 0x1a, 0xc4, 0xb9, 0xb9, 0xb9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0x27, 0x27, 0xa0, 0x02, 0x02, 0x02, 0xff, 0x02, 0x02, 0x02, 0xff, 0x01, 0x01, 0x01, 0xff, 0x02, 0x02, 0x02, 0xff, 0x02, 0x02, 0x02, 0xff, 0x00, 0x00, 0x00, 0xff, 0x29, 0x29, 0x29, 0xf8, 0x16, 0x16, 0x16, 0xa8, 0x65, 0x65, 0x65, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0d, 0x0d, 0x0d, 0x4b, 0x0d, 0x0d, 0x0d, 0xff, 0x17, 0x17, 0x17, 0xdb, 0x62, 0x62, 0x62, 0x54, 0x5c, 0x5c, 0x5c, 0x50, 0x0f, 0x0f, 0x0f, 0xb8, 0x05, 0x05, 0x05, 0xff, 0x22, 0x22, 0x22, 0xff, 0x39, 0x39, 0x39, 0xff, 0x3b, 0x3b, 0x3b, 0xff, 0x2f, 0x2f, 0x2f, 0xff, 0x3d, 0x3d, 0x3d, 0xff, 0x3d, 0x3d, 0x3d, 0xff, 0x3e, 0x3e, 0x3e, 0xff, 0x3f, 0x3f, 0x3f, 0xff, 0x40, 0x40, 0x40, 0xfb, 0x43, 0x43, 0x43, 0xe8, 0x44, 0x44, 0x44, 0xe4, 0x45, 0x45, 0x45, 0xdc, 0x46, 0x46, 0x46, 0xd7, 0x46, 0x46, 0x46, 0xd0, 0x49, 0x49, 0x49, 0xb3, 0x49, 0x49, 0x49, 0xb0, 0x49, 0x49, 0x49, 0xaf, 0x49, 0x49, 0x49, 0xab, 0x49, 0x49, 0x49, 0xa7, 0x46, 0x46, 0x46, 0x87, 0x45, 0x45, 0x45, 0x84, 0x44, 0x44, 0x44, 0x80, 0x43, 0x43, 0x43, 0x7f, 0x42, 0x42, 0x42, 0x7b, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x57, 0x01, 0x01, 0x01, 0x57, 0x02, 0x02, 0x02, 0x57, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x57, 0x02, 0x02, 0x02, 0x57, 0x04, 0x04, 0x04, 0x57, 0x06, 0x06, 0x06, 0x57, 0x04, 0x04, 0x04, 0x57, 0x04, 0x04, 0x04, 0x57, 0x05, 0x05, 0x05, 0x57, 0x07, 0x07, 0x07, 0x57, 0x08, 0x08, 0x08, 0x57, 0x06, 0x06, 0x06, 0x57, 0x07, 0x07, 0x07, 0x57, 0x08, 0x08, 0x08, 0x57, 0x0a, 0x0a, 0x0a, 0x57, 0x0c, 0x0c, 0x0c, 0x57, 0x0a, 0x0a, 0x0a, 0x57, 0x0b, 0x0b, 0x0b, 0x57, 0x0c, 0x0c, 0x0c, 0x57, 0x0f, 0x0f, 0x0f, 0x57, 0x11, 0x11, 0x11, 0x57, 0x10, 0x10, 0x10, 0x57, 0x10, 0x10, 0x10, 0x57, 0x12, 0x12, 0x12, 0x57, 0x14, 0x14, 0x14, 0x57, 0x16, 0x16, 0x16, 0x57, 0x13, 0x13, 0x13, 0x57, 0x14, 0x14, 0x14, 0x57, 0x15, 0x15, 0x15, 0x57, 0x30, 0x30, 0x30, 0x9c, 0x0c, 0x0c, 0x0c, 0xff, 0x06, 0x06, 0x06, 0xff, 0x0a, 0x0a, 0x0a, 0xff, 0x04, 0x04, 0x04, 0xff, 0x04, 0x04, 0x04, 0xff, 0x09, 0x09, 0x09, 0xff, 0x05, 0x05, 0x05, 0xff, 0x03, 0x03, 0x03, 0xff, 0x00, 0x00, 0x00, 0xff, 0x03, 0x03, 0x03, 0xff, 0x25, 0x25, 0x25, 0xff, 0x40, 0x40, 0x40, 0xa0, 0x18, 0x18, 0x18, 0x57, 0x37, 0x37, 0x37, 0x57, 0x3e, 0x3e, 0x3e, 0x57, 0x41, 0x41, 0x41, 0x57, 0x3e, 0x3e, 0x3e, 0x57, 0x35, 0x35, 0x35, 0x57, 0x34, 0x34, 0x34, 0x57, 0x33, 0x33, 0x33, 0x57, 0x35, 0x35, 0x35, 0x57, 0x35, 0x35, 0x35, 0x57, 0x2d, 0x2d, 0x2d, 0x57, 0x26, 0x26, 0x26, 0x57, 0x20, 0x20, 0x20, 0x57, 0x20, 0x20, 0x20, 0x57, 0x22, 0x22, 0x22, 0x57, 0x1f, 0x1f, 0x1f, 0x57, 0x19, 0x19, 0x19, 0x57, 0x14, 0x14, 0x14, 0x57, 0x15, 0x15, 0x15, 0x57, 0x18, 0x18, 0x18, 0x57, 0x14, 0x14, 0x14, 0x57, 0x16, 0x16, 0x16, 0x57, 0x44, 0x44, 0x44, 0x50, + 0x49, 0x49, 0x49, 0xb7, 0x04, 0x04, 0x04, 0xff, 0x35, 0x35, 0x35, 0x8c, 0x6f, 0x6f, 0x6f, 0x04, 0x6f, 0x6f, 0x6f, 0x0f, 0x21, 0x21, 0x21, 0x37, 0x0f, 0x0f, 0x0f, 0xff, 0x02, 0x02, 0x02, 0xff, 0x01, 0x01, 0x01, 0xff, 0x05, 0x05, 0x05, 0xff, 0x02, 0x02, 0x02, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x01, 0x01, 0x01, 0xff, 0x02, 0x02, 0x02, 0xff, 0x01, 0x01, 0x01, 0xff, 0x02, 0x02, 0x02, 0xff, 0x01, 0x01, 0x01, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x01, 0x01, 0x01, 0xff, 0x02, 0x02, 0x02, 0xff, 0x01, 0x01, 0x01, 0xff, 0x00, 0x00, 0x00, 0xff, 0x03, 0x03, 0x03, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x02, 0x02, 0x02, 0xff, 0x01, 0x01, 0x01, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x01, 0x01, 0x01, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x03, 0x03, 0x03, 0xff, 0x03, 0x03, 0x03, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x03, 0x03, 0x03, 0xff, 0x03, 0x03, 0x03, 0xff, 0x02, 0x02, 0x02, 0xff, 0x02, 0x02, 0x02, 0xff, 0x03, 0x03, 0x03, 0xff, 0x04, 0x04, 0x04, 0xff, 0x02, 0x02, 0x02, 0xff, 0x02, 0x02, 0x02, 0xff, 0x03, 0x03, 0x03, 0xff, 0x03, 0x03, 0x03, 0xff, 0x03, 0x03, 0x03, 0xff, 0x03, 0x03, 0x03, 0xff, 0x03, 0x03, 0x03, 0xff, 0x03, 0x03, 0x03, 0xff, 0x05, 0x05, 0x05, 0xff, 0x05, 0x05, 0x05, 0xff, 0x05, 0x05, 0x05, 0xff, 0x02, 0x02, 0x02, 0xff, 0x06, 0x06, 0x06, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x00, 0x00, 0x00, 0xff, 0x01, 0x01, 0x01, 0xff, 0x03, 0x03, 0x03, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x05, 0x05, 0x05, 0xff, 0x0c, 0x0c, 0x0c, 0xff, 0x10, 0x10, 0x10, 0xff, 0x16, 0x16, 0x16, 0xff, 0x15, 0x15, 0x15, 0xff, 0x14, 0x14, 0x14, 0xff, 0x16, 0x16, 0x16, 0xff, 0x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0xfc, 0x18, 0x18, 0x18, 0xfb, 0x17, 0x17, 0x17, 0xf8, 0x16, 0x16, 0x16, 0xf7, 0x16, 0x16, 0x16, 0xf4, 0x15, 0x15, 0x15, 0xf3, 0x14, 0x14, 0x14, 0xf3, 0x13, 0x13, 0x13, 0xf3, 0x10, 0x10, 0x10, 0xf0, 0x07, 0x07, 0x07, 0xec, 0x02, 0x02, 0x02, 0xeb, 0x03, 0x03, 0x03, 0xeb, 0x05, 0x05, 0x05, 0xeb, 0x02, 0x02, 0x02, 0xeb, 0x1b, 0x1b, 0x1b, 0xe8, + 0x38, 0x38, 0x38, 0x77, 0x0f, 0x0f, 0x0f, 0xff, 0x20, 0x20, 0x20, 0x8b, 0x80, 0x80, 0x80, 0x03, 0x6a, 0x6a, 0x6a, 0x14, 0x4e, 0x4e, 0x4e, 0x5c, 0x03, 0x03, 0x03, 0xff, 0x03, 0x03, 0x03, 0xff, 0x04, 0x04, 0x04, 0xff, 0x03, 0x03, 0x03, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x01, 0x01, 0x01, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x02, 0x02, 0x02, 0xff, 0x06, 0x06, 0x06, 0xff, 0x06, 0x06, 0x06, 0xff, 0x05, 0x05, 0x05, 0xff, 0x06, 0x06, 0x06, 0xff, 0x09, 0x09, 0x09, 0xff, 0x0d, 0x0d, 0x0d, 0xff, 0x14, 0x14, 0x14, 0xff, 0x14, 0x14, 0x14, 0xff, 0x15, 0x15, 0x15, 0xff, 0x19, 0x19, 0x19, 0xff, 0x1c, 0x1c, 0x1c, 0xff, 0x26, 0x26, 0x26, 0xff, 0x26, 0x26, 0x26, 0xff, 0x26, 0x26, 0x26, 0xff, 0x26, 0x26, 0x26, 0xff, 0x25, 0x25, 0x25, 0xff, 0x37, 0x37, 0x37, 0xff, 0x3b, 0x3b, 0x3b, 0xff, 0x3e, 0x3e, 0x3e, 0xff, 0x3f, 0x3f, 0x3f, 0xfc, 0x41, 0x41, 0x41, 0xf7, 0x48, 0x48, 0x48, 0xb7, 0x49, 0x49, 0x49, 0xa8, 0x49, 0x49, 0x49, 0xa3, 0x49, 0x49, 0x49, 0xa3, 0x49, 0x49, 0x49, 0xa8, 0x48, 0x48, 0x48, 0x93, 0x43, 0x43, 0x43, 0x7f, 0x36, 0x36, 0x36, 0x6b, 0x22, 0x22, 0x22, 0x5c, 0x0a, 0x0a, 0x0a, 0x57, 0x01, 0x01, 0x01, 0x57, 0x03, 0x03, 0x03, 0x57, 0x09, 0x09, 0x09, 0x57, 0x0c, 0x0c, 0x0c, 0x57, 0x0c, 0x0c, 0x0c, 0x57, 0x0d, 0x0d, 0x0d, 0x57, 0x13, 0x13, 0x13, 0x57, 0x0f, 0x0f, 0x0f, 0x57, 0x1e, 0x1e, 0x1e, 0x9c, 0x07, 0x07, 0x07, 0xff, 0x00, 0x00, 0x00, 0xff, 0x05, 0x05, 0x05, 0xff, 0x03, 0x03, 0x03, 0xff, 0x01, 0x01, 0x01, 0xff, 0x07, 0x07, 0x07, 0xff, 0x05, 0x05, 0x05, 0xff, 0x01, 0x01, 0x01, 0xff, 0x02, 0x02, 0x02, 0xff, 0x00, 0x00, 0x00, 0xff, 0x07, 0x07, 0x07, 0xff, 0x31, 0x31, 0x31, 0xff, 0x45, 0x45, 0x45, 0x90, 0x12, 0x12, 0x12, 0x54, 0x25, 0x25, 0x25, 0x57, 0x36, 0x36, 0x36, 0x57, 0x3d, 0x3d, 0x3d, 0x57, 0x3f, 0x3f, 0x3f, 0x57, 0x47, 0x47, 0x47, 0x57, 0x50, 0x50, 0x50, 0x53, 0x55, 0x55, 0x55, 0x4b, 0x59, 0x59, 0x59, 0x44, 0x62, 0x62, 0x62, 0x37, 0x67, 0x67, 0x67, 0x2f, 0x6d, 0x6d, 0x6d, 0x27, 0x6e, 0x6e, 0x6e, 0x24, 0x6e, 0x6e, 0x6e, 0x24, 0x6e, 0x6e, 0x6e, 0x24, 0x79, 0x79, 0x79, 0x17, 0xa7, 0xa7, 0xa7, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x23, 0x23, 0x23, 0x30, 0x0b, 0x0b, 0x0b, 0xf4, 0x05, 0x05, 0x05, 0xff, 0x38, 0x38, 0x38, 0xff, 0x33, 0x33, 0x33, 0xff, 0x07, 0x07, 0x07, 0xff, 0x10, 0x10, 0x10, 0xff, 0x37, 0x37, 0x37, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x2f, 0x2f, 0xcc, 0x02, 0x02, 0x02, 0xff, 0x01, 0x01, 0x01, 0xff, 0x03, 0x03, 0x03, 0xff, 0x03, 0x03, 0x03, 0xff, 0x01, 0x01, 0x01, 0xff, 0x00, 0x00, 0x00, 0xff, 0x20, 0x20, 0x20, 0xf8, 0x14, 0x14, 0x14, 0xa8, 0x53, 0x53, 0x53, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x53, 0x53, 0x53, 0x2b, 0x0d, 0x0d, 0x0d, 0xf3, 0x0d, 0x0d, 0x0d, 0xff, 0x10, 0x10, 0x10, 0xff, 0x10, 0x10, 0x10, 0xf3, 0x17, 0x17, 0x17, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x5a, 0x5a, 0x18, 0x34, 0x34, 0x34, 0xd8, 0x0d, 0x0d, 0x0d, 0xff, 0x02, 0x02, 0x02, 0xff, 0x05, 0x05, 0x05, 0xff, 0x0b, 0x0b, 0x0b, 0xec, 0x19, 0x19, 0x19, 0x87, 0x38, 0x38, 0x38, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, 0x7b, 0x7b, 0x0c, 0x3e, 0x3e, 0x3e, 0x5f, 0x41, 0x41, 0x41, 0x8c, 0x74, 0x74, 0x74, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, 0x39, 0x39, 0x54, 0x05, 0x05, 0x05, 0x57, 0x24, 0x24, 0x24, 0x57, 0x3c, 0x3c, 0x3c, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const lv_image_dsc_t img_demo_widgets_needle = { + .header.always_zero = 0, + .header.w = 100, + .header.h = 9, + .header.cf = LV_COLOR_FORMAT_ARGB8888, + .data = img_demo_widgets_needle_map, +}; + diff --git a/demos/widgets/lv_demo_widgets.c b/demos/widgets/lv_demo_widgets.c index 7e53d54eb..d2004d03b 100644 --- a/demos/widgets/lv_demo_widgets.c +++ b/demos/widgets/lv_demo_widgets.c @@ -35,7 +35,7 @@ static void analytics_create(lv_obj_t * parent); static void shop_create(lv_obj_t * parent); static void color_changer_create(lv_obj_t * parent); -static lv_obj_t * create_meter_box(lv_obj_t * parent, const char * title, const char * text1, const char * text2, +static lv_obj_t * create_scale_box(lv_obj_t * parent, const char * title, const char * text1, const char * text2, const char * text3); static lv_obj_t * create_shop_item(lv_obj_t * parent, const void * img_src, const char * name, const char * category, const char * price); @@ -48,12 +48,10 @@ static void calendar_event_cb(lv_event_t * e); static void slider_event_cb(lv_event_t * e); static void chart_event_cb(lv_event_t * e); static void shop_chart_event_cb(lv_event_t * e); -static void meter2_event_cb(lv_event_t * e); -static void meter1_indic1_anim_cb(void * var, int32_t v); -static void meter1_indic2_anim_cb(void * var, int32_t v); -static void meter1_indic3_anim_cb(void * var, int32_t v); -static void meter2_timer_cb(lv_timer_t * timer); -static void meter3_anim_cb(void * var, int32_t v); +static void scale2_event_cb(lv_event_t * e); +static void scale1_indic1_anim_cb(void * var, int32_t v); +static void scale2_timer_cb(lv_timer_t * timer); +static void scale3_anim_cb(void * var, int32_t v); /********************** * STATIC VARIABLES @@ -67,9 +65,9 @@ static lv_style_t style_title; static lv_style_t style_icon; static lv_style_t style_bullet; -static lv_obj_t * meter1; -static lv_obj_t * meter2; -static lv_obj_t * meter3; +static lv_obj_t * scale1; +static lv_obj_t * scale2; +static lv_obj_t * scale3; static lv_obj_t * chart1; static lv_obj_t * chart2; @@ -529,250 +527,269 @@ static void profile_create(lv_obj_t * parent) } +static lv_obj_t * create_chart_with_scales(lv_obj_t * parent, const char * title, const char * hor_text[]) +{ + static const lv_coord_t col_dsc[] = {40, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; + static const lv_coord_t row_dsc[] = {LV_GRID_CONTENT, LV_GRID_FR(1), 40, LV_GRID_TEMPLATE_LAST}; + + lv_obj_set_grid_dsc_array(parent, col_dsc, row_dsc); + lv_obj_set_style_pad_column(parent, 0, 0); + lv_obj_set_style_pad_row(parent, 0, 0); + + lv_obj_t * label = lv_label_create(parent); + lv_label_set_text(label, title); + lv_obj_add_style(label, &style_title, 0); + lv_obj_set_grid_cell(label, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_STRETCH, 0, 1); + + lv_obj_t * scale_ver = lv_scale_create(parent); + lv_scale_set_mode(scale_ver, LV_SCALE_MODE_VERTICAL_LEFT); + lv_obj_set_grid_cell(scale_ver, LV_GRID_ALIGN_END, 0, 1, LV_GRID_ALIGN_STRETCH, 1, 1); + lv_scale_set_total_tick_count(scale_ver, 10); + lv_scale_set_major_tick_every(scale_ver, 2); + lv_scale_set_range(scale_ver, 0, 100); + + lv_obj_t * wrapper = lv_obj_create(parent); + lv_obj_remove_style(wrapper, NULL, LV_PART_MAIN); + lv_obj_set_grid_dsc_array(wrapper, NULL, NULL); + lv_obj_set_grid_cell(wrapper, LV_GRID_ALIGN_STRETCH, 1, 1, LV_GRID_ALIGN_STRETCH, 1, 2); + lv_obj_set_scroll_dir(wrapper, LV_DIR_HOR); + + lv_obj_t * chart = lv_chart_create(wrapper); + lv_group_add_obj(lv_group_get_default(), chart); + lv_obj_add_flag(chart, LV_OBJ_FLAG_SCROLL_ON_FOCUS | LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS); + lv_chart_set_div_line_count(chart, 0, 12); + lv_chart_set_point_count(chart, 12); + lv_obj_set_grid_cell(chart, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_STRETCH, 0, 1); + lv_obj_set_style_border_width(chart, 0, 0); + lv_obj_add_event(chart, chart_event_cb, LV_EVENT_ALL, NULL); + lv_obj_set_width(chart, lv_pct(200)); + lv_obj_set_style_radius(chart, 0, 0); + + lv_obj_t * scale_hor = lv_scale_create(wrapper); + lv_scale_set_mode(scale_hor, LV_SCALE_MODE_HORIZONTAL_BOTTOM); + lv_obj_set_grid_cell(scale_hor, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_START, 1, 1); + lv_scale_set_total_tick_count(scale_hor, 11); + lv_scale_set_major_tick_every(scale_hor, 1); + lv_scale_set_text_src(scale_hor, hor_text); + lv_obj_set_width(scale_hor, lv_pct(200)); + lv_obj_set_height(scale_hor, 40); + lv_obj_set_style_pad_hor(scale_hor, lv_obj_get_style_pad_left(chart, 0), 0); + lv_obj_set_style_pad_ver(scale_ver, lv_obj_get_style_pad_top(chart, 0), 0); + return chart; +} + static void analytics_create(lv_obj_t * parent) { - lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_ROW_WRAP); - - static lv_coord_t grid_chart_row_dsc[] = {LV_GRID_CONTENT, LV_GRID_FR(1), 10, LV_GRID_TEMPLATE_LAST}; - static lv_coord_t grid_chart_col_dsc[] = {20, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST}; + lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_ROW); lv_obj_t * chart1_cont = lv_obj_create(parent); - lv_obj_set_flex_grow(chart1_cont, 1); - lv_obj_set_grid_dsc_array(chart1_cont, grid_chart_col_dsc, grid_chart_row_dsc); - - lv_obj_set_height(chart1_cont, LV_PCT(100)); + lv_obj_set_height(chart1_cont, lv_pct(100)); lv_obj_set_style_max_height(chart1_cont, 300, 0); + lv_obj_set_flex_grow(chart1_cont, 1); - lv_obj_t * title = lv_label_create(chart1_cont); - lv_label_set_text(title, "Unique visitors"); - lv_obj_add_style(title, &style_title, 0); - lv_obj_set_grid_cell(title, LV_GRID_ALIGN_START, 0, 2, LV_GRID_ALIGN_START, 0, 1); - chart1 = lv_chart_create(chart1_cont); - lv_group_add_obj(lv_group_get_default(), chart1); - lv_obj_add_flag(chart1, LV_OBJ_FLAG_SCROLL_ON_FOCUS | LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS); - lv_obj_set_grid_cell(chart1, LV_GRID_ALIGN_STRETCH, 1, 1, LV_GRID_ALIGN_STRETCH, 1, 1); - lv_chart_set_axis_tick(chart1, LV_CHART_AXIS_PRIMARY_Y, 0, 0, 5, 1, true, 80); - lv_chart_set_axis_tick(chart1, LV_CHART_AXIS_PRIMARY_X, 0, 0, 12, 1, true, 50); - lv_chart_set_div_line_count(chart1, 0, 12); - lv_chart_set_point_count(chart1, 12); - lv_obj_add_event(chart1, chart_event_cb, LV_EVENT_ALL, NULL); - if(disp_size == DISP_SMALL) lv_chart_set_zoom_x(chart1, 256 * 3); - else if(disp_size == DISP_MEDIUM) lv_chart_set_zoom_x(chart1, 256 * 2); - - lv_obj_set_style_border_side(chart1, LV_BORDER_SIDE_LEFT | LV_BORDER_SIDE_BOTTOM, 0); - lv_obj_set_style_radius(chart1, 0, 0); + static const char * chart1_texts[] = {"Jan", "Feb", "March", "April", "May", "Jun", "July", "Aug", "Sept", "Oct", "Nov", "Dec", NULL}; + chart1 = create_chart_with_scales(chart1_cont, "Unique visitors", chart1_texts); ser1 = lv_chart_add_series(chart1, lv_theme_get_color_primary(chart1), LV_CHART_AXIS_PRIMARY_Y); - lv_chart_set_next_value(chart1, ser1, lv_rand(10, 80)); - lv_chart_set_next_value(chart1, ser1, lv_rand(10, 80)); - lv_chart_set_next_value(chart1, ser1, lv_rand(10, 80)); - lv_chart_set_next_value(chart1, ser1, lv_rand(10, 80)); - lv_chart_set_next_value(chart1, ser1, lv_rand(10, 80)); - lv_chart_set_next_value(chart1, ser1, lv_rand(10, 80)); - lv_chart_set_next_value(chart1, ser1, lv_rand(10, 80)); - lv_chart_set_next_value(chart1, ser1, lv_rand(10, 80)); - lv_chart_set_next_value(chart1, ser1, lv_rand(10, 80)); - lv_chart_set_next_value(chart1, ser1, lv_rand(10, 80)); - lv_chart_set_next_value(chart1, ser1, lv_rand(10, 80)); - lv_chart_set_next_value(chart1, ser1, lv_rand(10, 80)); + uint32_t i; + for(i = 0; i < 12; i++) { + lv_chart_set_next_value(chart1, ser1, lv_rand(10, 80)); + } lv_obj_t * chart2_cont = lv_obj_create(parent); - lv_obj_add_flag(chart2_cont, LV_OBJ_FLAG_FLEX_IN_NEW_TRACK); - lv_obj_set_flex_grow(chart2_cont, 1); - - lv_obj_set_height(chart2_cont, LV_PCT(100)); + lv_obj_set_height(chart2_cont, lv_pct(100)); lv_obj_set_style_max_height(chart2_cont, 300, 0); + lv_obj_set_flex_grow(chart2_cont, 1); + lv_obj_add_flag(chart2_cont, LV_OBJ_FLAG_FLEX_IN_NEW_TRACK); - lv_obj_set_grid_dsc_array(chart2_cont, grid_chart_col_dsc, grid_chart_row_dsc); - title = lv_label_create(chart2_cont); - lv_label_set_text(title, "Monthly revenue"); - lv_obj_add_style(title, &style_title, 0); - lv_obj_set_grid_cell(title, LV_GRID_ALIGN_START, 0, 2, LV_GRID_ALIGN_START, 0, 1); - - chart2 = lv_chart_create(chart2_cont); - lv_group_add_obj(lv_group_get_default(), chart2); - lv_obj_add_flag(chart2, LV_OBJ_FLAG_SCROLL_ON_FOCUS | LV_OBJ_FLAG_SEND_DRAW_TASK_EVENTS); - - lv_obj_set_grid_cell(chart2, LV_GRID_ALIGN_STRETCH, 1, 1, LV_GRID_ALIGN_STRETCH, 1, 1); - lv_chart_set_axis_tick(chart2, LV_CHART_AXIS_PRIMARY_Y, 0, 0, 5, 1, true, 80); - lv_chart_set_axis_tick(chart2, LV_CHART_AXIS_PRIMARY_X, 0, 0, 12, 1, true, 50); - lv_obj_set_size(chart2, LV_PCT(100), LV_PCT(100)); + static const char * chart2_texts[] = {"I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII", NULL}; + chart2 = create_chart_with_scales(chart2_cont, "Monthly revenue", chart2_texts); lv_chart_set_type(chart2, LV_CHART_TYPE_BAR); - lv_chart_set_div_line_count(chart2, 6, 0); - lv_chart_set_point_count(chart2, 12); - lv_obj_add_event(chart2, chart_event_cb, LV_EVENT_ALL, NULL); - lv_chart_set_zoom_x(chart2, 256 * 2); - lv_obj_set_style_border_side(chart2, LV_BORDER_SIDE_LEFT | LV_BORDER_SIDE_BOTTOM, 0); - lv_obj_set_style_radius(chart2, 0, 0); - if(disp_size == DISP_SMALL) { - lv_obj_set_style_pad_gap(chart2, 0, LV_PART_ITEMS); - lv_obj_set_style_pad_gap(chart2, 2, LV_PART_MAIN); + ser2 = lv_chart_add_series(chart2, lv_palette_main(LV_PALETTE_GREY), LV_CHART_AXIS_PRIMARY_Y); + ser3 = lv_chart_add_series(chart2, lv_theme_get_color_primary(chart2), LV_CHART_AXIS_PRIMARY_Y); + for(i = 0; i < 12; i++) { + lv_chart_set_next_value(chart2, ser2, lv_rand(10, 80)); + lv_chart_set_next_value(chart2, ser3, lv_rand(10, 80)); } - else if(disp_size == DISP_LARGE) { - lv_obj_set_style_pad_gap(chart2, 16, 0); + lv_obj_t * chart2_hor_scale = lv_obj_get_sibling(chart2, 1); + lv_obj_set_style_pad_hor(chart2_hor_scale, lv_chart_get_first_point_center_offset(chart2), 0); + + /*Create all 3 scales first to have their size resolved*/ + scale1 = create_scale_box(parent, "Monthly Target", "Revenue: -", "Sales: -", "Costs: -"); + lv_obj_add_flag(lv_obj_get_parent(scale1), LV_OBJ_FLAG_FLEX_IN_NEW_TRACK); + + scale2 = create_scale_box(parent, "Sessions", "Desktop: -", "Tablet: -", "Mobile: -"); + if(disp_size < DISP_LARGE) lv_obj_add_flag(lv_obj_get_parent(scale2), LV_OBJ_FLAG_FLEX_IN_NEW_TRACK); + + scale3 = create_scale_box(parent, "Network Speed", "Low speed", "Normal Speed", "High Speed"); + if(disp_size < DISP_LARGE) lv_obj_add_flag(lv_obj_get_parent(scale3), LV_OBJ_FLAG_FLEX_IN_NEW_TRACK); + + lv_obj_update_layout(parent); + lv_coord_t scale_w; + if(disp_size == DISP_MEDIUM) { + scale_w = 200; + lv_obj_set_size(scale1, scale_w, scale_w); + lv_obj_set_size(scale2, scale_w, scale_w); + lv_obj_set_size(scale3, scale_w, scale_w); + } + else { + scale_w = lv_obj_get_width(scale1); + lv_obj_set_height(scale1, scale_w); + lv_obj_set_height(scale2, scale_w); + lv_obj_set_height(scale3, scale_w); } - - ser2 = lv_chart_add_series(chart2, lv_palette_lighten(LV_PALETTE_GREY, 1), LV_CHART_AXIS_PRIMARY_Y); - lv_chart_set_next_value(chart2, ser2, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser2, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser2, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser2, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser2, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser2, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser2, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser2, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser2, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser2, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser2, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser2, lv_rand(10, 80)); - - ser3 = lv_chart_add_series(chart2, lv_theme_get_color_primary(chart1), LV_CHART_AXIS_PRIMARY_Y); - lv_chart_set_next_value(chart2, ser3, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser3, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser3, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser3, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser3, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser3, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser3, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser3, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser3, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser3, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser3, lv_rand(10, 80)); - lv_chart_set_next_value(chart2, ser3, lv_rand(10, 80)); - - lv_meter_indicator_t * indic; - meter1 = create_meter_box(parent, "Monthly Target", "Revenue: 63%", "Sales: 44%", "Costs: 58%"); - lv_obj_add_flag(lv_obj_get_parent(meter1), LV_OBJ_FLAG_FLEX_IN_NEW_TRACK); - lv_meter_set_scale_range(meter1, 0, 100, 270, 90); - lv_meter_set_scale_ticks(meter1, 0, 0, 0, lv_color_black()); lv_anim_t a; lv_anim_init(&a); lv_anim_set_values(&a, 20, 100); lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE); - indic = lv_meter_add_arc(meter1, 15, lv_palette_main(LV_PALETTE_BLUE), 0); - lv_anim_set_exec_cb(&a, meter1_indic1_anim_cb); - lv_anim_set_var(&a, indic); + /*Scale 1*/ + lv_scale_set_mode(scale1, LV_SCALE_MODE_ROUND_OUTER); + lv_obj_set_style_pad_all(scale1, 30, 0); + lv_obj_t * arc; + arc = lv_arc_create(scale1); + lv_obj_remove_style(arc, NULL, LV_PART_KNOB); + lv_obj_set_size(arc, lv_pct(100), lv_pct(100)); + lv_obj_set_style_arc_opa(arc, 0, 0); + lv_obj_set_style_arc_width(arc, 15, LV_PART_INDICATOR); + lv_obj_set_style_arc_color(arc, lv_palette_main(LV_PALETTE_BLUE), LV_PART_INDICATOR); + lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); + + lv_anim_set_exec_cb(&a, scale1_indic1_anim_cb); + lv_anim_set_var(&a, arc); lv_anim_set_time(&a, 4100); lv_anim_set_playback_time(&a, 2700); lv_anim_start(&a); - indic = lv_meter_add_arc(meter1, 15, lv_palette_main(LV_PALETTE_RED), -20); - lv_anim_set_exec_cb(&a, meter1_indic2_anim_cb); - lv_anim_set_var(&a, indic); + arc = lv_arc_create(scale1); + lv_obj_remove_style(arc, NULL, LV_PART_KNOB); + lv_obj_set_size(arc, lv_pct(100), lv_pct(100)); + lv_obj_set_style_margin_all(arc, 20, 0); + lv_obj_set_style_arc_opa(arc, 0, 0); + lv_obj_set_style_arc_width(arc, 15, LV_PART_INDICATOR); + lv_obj_set_style_arc_color(arc, lv_palette_main(LV_PALETTE_RED), LV_PART_INDICATOR); + lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); + lv_obj_center(arc); + + lv_anim_set_exec_cb(&a, scale1_indic1_anim_cb); + lv_anim_set_var(&a, arc); lv_anim_set_time(&a, 2600); lv_anim_set_playback_time(&a, 3200); - a.user_data = indic; lv_anim_start(&a); - indic = lv_meter_add_arc(meter1, 15, lv_palette_main(LV_PALETTE_GREEN), -40); - lv_anim_set_exec_cb(&a, meter1_indic3_anim_cb); - lv_anim_set_var(&a, indic); + arc = lv_arc_create(scale1); + lv_obj_remove_style(arc, NULL, LV_PART_KNOB); + lv_obj_set_size(arc, lv_pct(100), lv_pct(100)); + lv_obj_set_style_margin_all(arc, 40, 0); + lv_obj_set_style_arc_opa(arc, 0, 0); + lv_obj_set_style_arc_width(arc, 15, LV_PART_INDICATOR); + lv_obj_set_style_arc_color(arc, lv_palette_main(LV_PALETTE_GREEN), LV_PART_INDICATOR); + lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); + lv_obj_center(arc); + + lv_anim_set_exec_cb(&a, scale1_indic1_anim_cb); + lv_anim_set_var(&a, arc); lv_anim_set_time(&a, 2800); lv_anim_set_playback_time(&a, 1800); lv_anim_start(&a); - meter2 = create_meter_box(parent, "Sessions", "Desktop: ", "Tablet: ", "Mobile: "); - if(disp_size < DISP_LARGE) lv_obj_add_flag(lv_obj_get_parent(meter2), LV_OBJ_FLAG_FLEX_IN_NEW_TRACK); - lv_meter_set_scale_range(meter2, 0, 100, 360, 90); - lv_meter_set_scale_ticks(meter2, 0, 0, 0, lv_color_black()); + /*Scale 2*/ + lv_scale_set_round_props(scale2, 330, 0); + lv_scale_set_total_tick_count(scale2, 10); + lv_scale_set_major_tick_length(scale2, 30); + lv_scale_set_major_tick_every(scale2, 1); + arc = lv_arc_create(scale2); + lv_obj_set_size(arc, lv_pct(100), lv_pct(100)); + lv_obj_set_style_margin_all(arc, 10, 0); + lv_obj_set_style_bg_opa(arc, 0, LV_PART_KNOB); + lv_obj_set_style_bg_opa(arc, 0, LV_PART_KNOB); + lv_obj_set_style_arc_width(arc, 10, LV_PART_INDICATOR); + lv_obj_set_style_arc_rounded(arc, false, LV_PART_INDICATOR); + lv_obj_set_style_arc_color(arc, lv_palette_main(LV_PALETTE_BLUE), LV_PART_INDICATOR); + lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); + lv_obj_center(arc); - static lv_meter_indicator_t * meter2_indic[3]; - meter2_indic[0] = lv_meter_add_arc(meter2, 20, lv_palette_main(LV_PALETTE_RED), -10); - lv_meter_set_indicator_start_value(meter2, meter2_indic[0], 0); - lv_meter_set_indicator_end_value(meter2, meter2_indic[0], 39); + arc = lv_arc_create(scale2); + lv_obj_set_size(arc, lv_pct(100), lv_pct(100)); + lv_obj_set_style_margin_all(arc, 5, 0); + lv_obj_set_style_arc_opa(arc, 0, 0); + lv_obj_set_style_bg_opa(arc, 0, LV_PART_KNOB); + lv_obj_set_style_arc_width(arc, 20, LV_PART_INDICATOR); + lv_obj_set_style_arc_rounded(arc, false, LV_PART_INDICATOR); + lv_obj_set_style_arc_color(arc, lv_palette_main(LV_PALETTE_RED), LV_PART_INDICATOR); + lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); + lv_obj_center(arc); - meter2_indic[1] = lv_meter_add_arc(meter2, 30, lv_palette_main(LV_PALETTE_BLUE), 0); - lv_meter_set_indicator_start_value(meter2, meter2_indic[1], 40); - lv_meter_set_indicator_end_value(meter2, meter2_indic[1], 69); + arc = lv_arc_create(scale2); + lv_obj_set_size(arc, lv_pct(100), lv_pct(100)); + lv_obj_set_style_arc_opa(arc, 0, 0); + lv_obj_set_style_bg_opa(arc, 0, LV_PART_KNOB); + lv_obj_set_style_arc_width(arc, 30, LV_PART_INDICATOR); + lv_obj_set_style_arc_rounded(arc, false, LV_PART_INDICATOR); + lv_obj_set_style_arc_color(arc, lv_palette_main(LV_PALETTE_GREEN), LV_PART_INDICATOR); + lv_obj_clear_flag(arc, LV_OBJ_FLAG_CLICKABLE); + lv_obj_center(arc); - meter2_indic[2] = lv_meter_add_arc(meter2, 10, lv_palette_main(LV_PALETTE_GREEN), -20); - lv_meter_set_indicator_start_value(meter2, meter2_indic[2], 70); - lv_meter_set_indicator_end_value(meter2, meter2_indic[2], 99); + lv_timer_t * scale2_timer = lv_timer_create(scale2_timer_cb, 100, scale2); + lv_obj_add_event(scale2, scale2_event_cb, LV_EVENT_DELETE, scale2_timer); - lv_timer_t * meter2_timer = lv_timer_create(meter2_timer_cb, 100, meter2_indic); - lv_obj_add_event(meter2, meter2_event_cb, LV_EVENT_DELETE, meter2_timer); + /*Scale 3*/ + lv_scale_set_range(scale3, 10, 60); + lv_scale_set_total_tick_count(scale3, 20); + lv_scale_set_major_tick_every(scale3, 4); + lv_scale_set_minor_tick_length(scale3, 10); + lv_scale_set_major_tick_length(scale3, 20); + lv_scale_set_round_props(scale3, 225, 135); + static lv_style_t scale3_section1_main_style; + static lv_style_t scale3_section1_indicator_style; + static lv_style_t scale3_section1_tick_style; - meter3 = create_meter_box(parent, "Network Speed", "Low speed", "Normal Speed", "High Speed"); - if(disp_size < DISP_LARGE) lv_obj_add_flag(lv_obj_get_parent(meter3), LV_OBJ_FLAG_FLEX_IN_NEW_TRACK); + lv_style_init(&scale3_section1_main_style); + lv_style_set_arc_width(&scale3_section1_main_style, 5); + lv_style_set_arc_color(&scale3_section1_main_style, lv_palette_main(LV_PALETTE_RED)); - /*Add a special circle to the needle's pivot*/ - lv_obj_set_style_pad_hor(meter3, 10, 0); - lv_obj_set_style_size(meter3, 10, 10, LV_PART_INDICATOR); - lv_obj_set_style_radius(meter3, LV_RADIUS_CIRCLE, LV_PART_INDICATOR); - lv_obj_set_style_bg_opa(meter3, LV_OPA_COVER, LV_PART_INDICATOR); - lv_obj_set_style_bg_color(meter3, lv_palette_darken(LV_PALETTE_GREY, 4), LV_PART_INDICATOR); - lv_obj_set_style_outline_color(meter3, lv_color_white(), LV_PART_INDICATOR); - lv_obj_set_style_outline_width(meter3, 3, LV_PART_INDICATOR); - lv_obj_set_style_text_color(meter3, lv_palette_darken(LV_PALETTE_GREY, 1), LV_PART_TICKS); + lv_style_init(&scale3_section1_indicator_style); + lv_style_set_line_width(&scale3_section1_indicator_style, 4); + lv_style_set_line_color(&scale3_section1_indicator_style, lv_palette_darken(LV_PALETTE_RED, 2)); - lv_meter_set_scale_range(meter3, 10, 60, 220, 360 - 220); - lv_meter_set_scale_ticks(meter3, 21, 3, 17, lv_color_white()); - lv_meter_set_scale_major_ticks(meter3, 4, 4, 22, lv_color_white(), 15); + lv_style_init(&scale3_section1_tick_style); + lv_style_set_line_width(&scale3_section1_tick_style, 4); + lv_style_set_line_color(&scale3_section1_tick_style, lv_palette_darken(LV_PALETTE_RED, 2)); - indic = lv_meter_add_arc(meter3, 10, lv_palette_main(LV_PALETTE_RED), 0); - lv_meter_set_indicator_start_value(meter3, indic, 0); - lv_meter_set_indicator_end_value(meter3, indic, 20); + lv_scale_section_t * section; + section = lv_scale_add_section(scale3); + lv_scale_section_set_range(section, 0, 20); + lv_scale_section_set_style(section, LV_PART_MAIN, &scale3_section1_main_style); + lv_scale_section_set_style(section, LV_PART_INDICATOR, &scale3_section1_indicator_style); + lv_scale_section_set_style(section, LV_PART_TICKS, &scale3_section1_tick_style); - indic = lv_meter_add_scale_lines(meter3, lv_palette_darken(LV_PALETTE_RED, 3), lv_palette_darken(LV_PALETTE_RED, - 3), true, 0); - lv_meter_set_indicator_start_value(meter3, indic, 0); - lv_meter_set_indicator_end_value(meter3, indic, 20); + LV_IMG_DECLARE(img_demo_widgets_needle); + lv_obj_t * needle = lv_image_create(scale3); + lv_image_set_src(needle, &img_demo_widgets_needle); + lv_image_set_pivot(needle, 3, 4); + lv_obj_align(needle, LV_ALIGN_CENTER, 47, -2); - indic = lv_meter_add_arc(meter3, 12, lv_palette_main(LV_PALETTE_BLUE), 0); - lv_meter_set_indicator_start_value(meter3, indic, 20); - lv_meter_set_indicator_end_value(meter3, indic, 40); - - indic = lv_meter_add_scale_lines(meter3, lv_palette_darken(LV_PALETTE_BLUE, 3), - lv_palette_darken(LV_PALETTE_BLUE, 3), true, 0); - lv_meter_set_indicator_start_value(meter3, indic, 20); - lv_meter_set_indicator_end_value(meter3, indic, 40); - - indic = lv_meter_add_arc(meter3, 10, lv_palette_main(LV_PALETTE_GREEN), 0); - lv_meter_set_indicator_start_value(meter3, indic, 40); - lv_meter_set_indicator_end_value(meter3, indic, 60); - - indic = lv_meter_add_scale_lines(meter3, lv_palette_darken(LV_PALETTE_GREEN, 3), - lv_palette_darken(LV_PALETTE_GREEN, 3), true, 0); - lv_meter_set_indicator_start_value(meter3, indic, 40); - lv_meter_set_indicator_end_value(meter3, indic, 60); - - indic = lv_meter_add_needle_line(meter3, 4, lv_palette_darken(LV_PALETTE_GREY, 4), -25); - - lv_obj_t * mbps_label = lv_label_create(meter3); + lv_obj_t * mbps_label = lv_label_create(scale3); lv_label_set_text(mbps_label, "-"); lv_obj_add_style(mbps_label, &style_title, 0); - lv_obj_t * mbps_unit_label = lv_label_create(meter3); + lv_obj_t * mbps_unit_label = lv_label_create(scale3); lv_label_set_text(mbps_unit_label, "Mbps"); lv_anim_init(&a); - lv_anim_set_values(&a, 10, 60); + lv_anim_set_values(&a, 0, 60); lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE); - lv_anim_set_exec_cb(&a, meter3_anim_cb); - lv_anim_set_var(&a, indic); + lv_anim_set_exec_cb(&a, scale3_anim_cb); + lv_anim_set_var(&a, needle); lv_anim_set_time(&a, 4100); lv_anim_set_playback_time(&a, 800); lv_anim_start(&a); - lv_obj_update_layout(parent); - if(disp_size == DISP_MEDIUM) { - lv_obj_set_size(meter1, 200, 200); - lv_obj_set_size(meter2, 200, 200); - lv_obj_set_size(meter3, 200, 200); - } - else { - lv_coord_t meter_w = lv_obj_get_width(meter1); - lv_obj_set_height(meter1, meter_w); - lv_obj_set_height(meter2, meter_w); - lv_obj_set_height(meter3, meter_w); - } - lv_obj_align(mbps_label, LV_ALIGN_TOP_MID, 10, lv_pct(55)); lv_obj_align_to(mbps_unit_label, mbps_label, LV_ALIGN_OUT_RIGHT_BOTTOM, 10, 0); } @@ -802,8 +819,8 @@ void shop_create(lv_obj_t * parent) lv_obj_set_style_text_color(hint, lv_palette_main(LV_PALETTE_GREEN), 0); chart3 = lv_chart_create(panel1); - lv_chart_set_axis_tick(chart3, LV_CHART_AXIS_PRIMARY_Y, 0, 0, 6, 1, true, 80); - lv_chart_set_axis_tick(chart3, LV_CHART_AXIS_PRIMARY_X, 0, 0, 7, 1, true, 50); + // lv_chart_set_axis_tick(chart3, LV_CHART_AXIS_PRIMARY_Y, 0, 0, 6, 1, true, 80); + // lv_chart_set_axis_tick(chart3, LV_CHART_AXIS_PRIMARY_X, 0, 0, 7, 1, true, 50); lv_chart_set_type(chart3, LV_CHART_TYPE_BAR); lv_chart_set_div_line_count(chart3, 6, 0); lv_chart_set_point_count(chart3, 7); @@ -874,7 +891,7 @@ void shop_create(lv_obj_t * parent) lv_obj_set_width(chart3, LV_PCT(95)); lv_obj_set_height(chart3, LV_VER_RES - 70); lv_obj_set_style_max_height(chart3, 300, 0); - lv_chart_set_zoom_x(chart3, 512); + // lv_chart_set_zoom_x(chart3, 512); lv_obj_set_grid_dsc_array(panel1, grid1_col_dsc, grid1_row_dsc); lv_obj_set_grid_cell(title, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_START, 0, 1); @@ -1086,7 +1103,7 @@ static void color_event_cb(lv_event_t * e) } } -static lv_obj_t * create_meter_box(lv_obj_t * parent, const char * title, const char * text1, const char * text2, +static lv_obj_t * create_scale_box(lv_obj_t * parent, const char * title, const char * text1, const char * text2, const char * text3) { lv_obj_t * cont = lv_obj_create(parent); @@ -1097,10 +1114,10 @@ static lv_obj_t * create_meter_box(lv_obj_t * parent, const char * title, const lv_label_set_text(title_label, title); lv_obj_add_style(title_label, &style_title, 0); - lv_obj_t * meter = lv_meter_create(cont); - lv_obj_remove_style(meter, NULL, LV_PART_MAIN); - lv_obj_remove_style(meter, NULL, LV_PART_INDICATOR); - lv_obj_set_width(meter, LV_PCT(100)); + lv_obj_t * scale = lv_scale_create(cont); + lv_scale_set_mode(scale, LV_SCALE_MODE_ROUND_INNER); + lv_scale_set_post_draw(scale, true); + lv_obj_set_width(scale, LV_PCT(100)); lv_obj_t * bullet1 = lv_obj_create(cont); lv_obj_set_size(bullet1, 13, 13); @@ -1132,7 +1149,7 @@ static lv_obj_t * create_meter_box(lv_obj_t * parent, const char * title, const lv_obj_set_grid_dsc_array(cont, grid_col_dsc, grid_row_dsc); lv_obj_set_grid_cell(title_label, LV_GRID_ALIGN_START, 0, 4, LV_GRID_ALIGN_START, 0, 1); - lv_obj_set_grid_cell(meter, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_START, 1, 3); + lv_obj_set_grid_cell(scale, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_START, 1, 3); lv_obj_set_grid_cell(bullet1, LV_GRID_ALIGN_START, 2, 1, LV_GRID_ALIGN_CENTER, 2, 1); lv_obj_set_grid_cell(bullet2, LV_GRID_ALIGN_START, 2, 1, LV_GRID_ALIGN_CENTER, 3, 1); lv_obj_set_grid_cell(bullet3, LV_GRID_ALIGN_START, 2, 1, LV_GRID_ALIGN_CENTER, 4, 1); @@ -1145,7 +1162,7 @@ static lv_obj_t * create_meter_box(lv_obj_t * parent, const char * title, const static lv_coord_t grid_row_dsc[] = {LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST}; lv_obj_set_grid_dsc_array(cont, grid_col_dsc, grid_row_dsc); lv_obj_set_grid_cell(title_label, LV_GRID_ALIGN_START, 0, 2, LV_GRID_ALIGN_START, 0, 1); - lv_obj_set_grid_cell(meter, LV_GRID_ALIGN_START, 0, 2, LV_GRID_ALIGN_START, 1, 1); + lv_obj_set_grid_cell(scale, LV_GRID_ALIGN_START, 0, 2, LV_GRID_ALIGN_START, 1, 1); lv_obj_set_grid_cell(bullet1, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_START, 2, 1); lv_obj_set_grid_cell(bullet2, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_START, 3, 1); lv_obj_set_grid_cell(bullet3, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_START, 4, 1); @@ -1153,10 +1170,7 @@ static lv_obj_t * create_meter_box(lv_obj_t * parent, const char * title, const lv_obj_set_grid_cell(label2, LV_GRID_ALIGN_STRETCH, 1, 1, LV_GRID_ALIGN_START, 3, 1); lv_obj_set_grid_cell(label3, LV_GRID_ALIGN_STRETCH, 1, 1, LV_GRID_ALIGN_START, 4, 1); } - - - return meter; - + return scale; } static lv_obj_t * create_shop_item(lv_obj_t * parent, const void * img_src, const char * name, const char * category, @@ -1327,32 +1341,7 @@ static void chart_event_cb(lv_event_t * e) lv_draw_task_t * draw_task = lv_event_get_param(e); lv_draw_dsc_base_t * base_dsc = draw_task->draw_dsc; - if(base_dsc->part == LV_PART_TICKS && draw_task->type == LV_DRAW_TASK_TYPE_LABEL) { - /*Set the markers' text*/ - if(base_dsc->id1 == LV_CHART_AXIS_PRIMARY_X) { - lv_draw_label_dsc_t * label_draw_dsc = draw_task->draw_dsc; - if(label_draw_dsc->text_local) lv_free((void *)label_draw_dsc->text); - const char * txt; - if(lv_chart_get_type(obj) == LV_CHART_TYPE_BAR) { - const char * month[] = {"I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"}; - txt = month[base_dsc->id2]; - - } - else { - const char * month[] = {"Jan", "Febr", "March", "Apr", "May", "Jun", "July", "Aug", "Sept", "Oct", "Nov", "Dec"}; - txt = month[base_dsc->id2]; - } - label_draw_dsc->align = LV_TEXT_ALIGN_CENTER; - label_draw_dsc->text_local = 1; - label_draw_dsc->text = lv_malloc(strlen(txt) + 1); - strcpy((char *)label_draw_dsc->text, txt); - draw_task->area.x1 -= 30; - draw_task->area.x2 += 30; - - } - - } - else if(base_dsc->part == LV_PART_ITEMS && draw_task->type == LV_DRAW_TASK_TYPE_LINE) { + if(base_dsc->part == LV_PART_ITEMS && draw_task->type == LV_DRAW_TASK_TYPE_LINE) { const lv_chart_series_t * ser = lv_chart_get_series_next(obj, NULL); if(base_dsc->id1 == 1) ser = lv_chart_get_series_next(obj, ser); @@ -1398,7 +1387,6 @@ static void chart_event_cb(lv_event_t * e) lv_draw_rect(base_dsc->layer, &rect_dsc, &rect_area); } - bool add_value = false; if(base_dsc->part == LV_PART_INDICATOR && lv_chart_get_pressed_point(obj) == base_dsc->id2) { if(lv_chart_get_type(obj) == LV_CHART_TYPE_LINE) { @@ -1431,7 +1419,9 @@ static void chart_event_cb(lv_event_t * e) if(add_value) { const lv_chart_series_t * ser = lv_chart_get_series_next(obj, NULL); - if(base_dsc->id1 == 1) ser = lv_chart_get_series_next(obj, ser); + if(base_dsc->id1 == 1) { + ser = lv_chart_get_series_next(obj, ser); + } char buf[8]; lv_snprintf(buf, sizeof(buf), "%"LV_PRIu32, ser->y_points[base_dsc->id2]); @@ -1490,46 +1480,27 @@ static void shop_chart_event_cb(lv_event_t * e) } -static void meter1_indic1_anim_cb(void * var, int32_t v) +static void scale1_indic1_anim_cb(void * var, int32_t v) { - lv_meter_set_indicator_end_value(meter1, var, v); + lv_arc_set_value(var, v); - lv_obj_t * card = lv_obj_get_parent(meter1); + lv_obj_t * card = lv_obj_get_parent(scale1); lv_obj_t * label = lv_obj_get_child(card, -5); lv_label_set_text_fmt(label, "Revenue: %"LV_PRId32" %%", v); } -static void meter1_indic2_anim_cb(void * var, int32_t v) -{ - lv_meter_set_indicator_end_value(meter1, var, v); - - lv_obj_t * card = lv_obj_get_parent(meter1); - lv_obj_t * label = lv_obj_get_child(card, -3); - lv_label_set_text_fmt(label, "Sales: %"LV_PRId32" %%", v); - -} - -static void meter1_indic3_anim_cb(void * var, int32_t v) -{ - lv_meter_set_indicator_end_value(meter1, var, v); - - lv_obj_t * card = lv_obj_get_parent(meter1); - lv_obj_t * label = lv_obj_get_child(card, -1); - lv_label_set_text_fmt(label, "Costs: %"LV_PRId32" %%", v); -} - -static void meter2_event_cb(lv_event_t * e) +static void scale2_event_cb(lv_event_t * e) { lv_event_code_t code = lv_event_get_code(e); if(code == LV_EVENT_DELETE) { - lv_timer_t * meter2_timer = lv_event_get_user_data(e); - if(meter2_timer) lv_timer_del(meter2_timer); + lv_timer_t * scale2_timer = lv_event_get_user_data(e); + if(scale2_timer) lv_timer_del(scale2_timer); } } -static void meter2_timer_cb(lv_timer_t * timer) +static void scale2_timer_cb(lv_timer_t * timer) { - lv_meter_indicator_t ** indics = timer->user_data; + LV_UNUSED(timer); static bool down1 = false; static bool down2 = false; @@ -1564,19 +1535,14 @@ static void meter2_timer_cb(lv_timer_t * timer) } uint32_t all = session_desktop + session_tablet + session_mobile; - uint32_t pct1 = (session_desktop * 97) / all; - uint32_t pct2 = (session_tablet * 97) / all; + uint32_t angle1 = (session_desktop * 354) / all; + uint32_t angle2 = (session_tablet * 354) / all; - lv_meter_set_indicator_start_value(meter2, indics[0], 0); - lv_meter_set_indicator_end_value(meter2, indics[0], pct1); + lv_arc_set_angles(lv_obj_get_child(scale2, 0), 0, angle1); + lv_arc_set_angles(lv_obj_get_child(scale2, 1), angle1 + 2, angle1 + 2 + angle2); + lv_arc_set_angles(lv_obj_get_child(scale2, 2), angle1 + 2 + angle2 + 2, 358); - lv_meter_set_indicator_start_value(meter2, indics[1], pct1 + 1); - lv_meter_set_indicator_end_value(meter2, indics[1], pct1 + 1 + pct2); - - lv_meter_set_indicator_start_value(meter2, indics[2], pct1 + 1 + pct2 + 1); - lv_meter_set_indicator_end_value(meter2, indics[2], 99); - - lv_obj_t * card = lv_obj_get_parent(meter2); + lv_obj_t * card = lv_obj_get_parent(scale2); lv_obj_t * label; label = lv_obj_get_child(card, -5); @@ -1589,11 +1555,15 @@ static void meter2_timer_cb(lv_timer_t * timer) lv_label_set_text_fmt(label, "Mobile: %"LV_PRIu32, session_mobile); } -static void meter3_anim_cb(void * var, int32_t v) +static void scale3_anim_cb(void * var, int32_t v) { - lv_meter_set_indicator_value(meter3, var, v); + LV_UNUSED(var); - lv_obj_t * label = lv_obj_get_child(meter3, 0); + int32_t angle = lv_map(v, 0, 60, 1350, 3600); + lv_obj_t * needle = lv_obj_get_child(scale3, 0); + lv_image_set_rotation(needle, angle); + + lv_obj_t * label = lv_obj_get_child(scale3, 1); lv_label_set_text_fmt(label, "%"LV_PRId32, v); } diff --git a/docs/widgets/btnmatrix.md b/docs/widgets/btnmatrix.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/widgets/index.rst b/docs/widgets/index.rst index a90dbb0ca..0134119f7 100644 --- a/docs/widgets/index.rst +++ b/docs/widgets/index.rst @@ -27,7 +27,6 @@ Widgets line list menu - meter msgbox roller scale diff --git a/docs/widgets/meter.rst b/docs/widgets/meter.rst deleted file mode 100644 index fc4be44ec..000000000 --- a/docs/widgets/meter.rst +++ /dev/null @@ -1,158 +0,0 @@ -Meter (lv_meter) -================ - -Overview -******** - -The Meter widget can visualize data in very flexible ways. In can show -arcs, needles, ticks lines and labels. - -Parts and Styles -**************** - -- :cpp:enumerator:`LV_PART_MAIN` The background of the Meter. Uses the typical - background properties. -- :cpp:enumerator:`LV_PART_TICK` The tick lines a labels using the *line* and *text* - style properties. -- :cpp:enumerator:`LV_PART_INDICATOR` The needle line or image using the *line* and - *img* style properties, as well as the background properties to draw - a square (or circle) on the pivot of the needles. Padding makes the - square larger. -- :cpp:enumerator:`LV_PART_ITEMS` The arcs using the *arc* properties. - -Usage -***** - -Scale ------ - -The Scale has minor and major ticks, and labels on the major ticks. - -The minor tick lines can be configured with: -:cpp:expr:`lv_meter_set_scale_ticks(meter, tick_count, line_width, tick_length, tick_color)`. - -To show major tick lines use -:cpp:expr:`lv_meter_set_scale_major_ticks(meter, nth_major, tick_width, tick_length, tick_color, label_gap)`. -``nth_major`` to specify how many minor ticks to skip to draw a major -tick. - -Labels are added automatically on major ticks with ``label_gap`` -distance from the ticks with text proportionally to the values of the -tick line. - -:cpp:expr:`lv_meter_set_scale_range(meter, min, max, angle_range, rotation)` -sets the value and angle range of the scale. - -Add indicators --------------- - -Indicators can be added to meter and their value is interpreted in the -range of the scale. - -All the indicator add functions return an ``lv_meter_indicator_t *``. - -Needle line -^^^^^^^^^^^ - -``indic = lv_meter_add_needle_line(meter, line_width, line_color, r_mod)`` -adds a needle line to a Scale. By default, the length of the line is the -same as the scale's radius but ``r_mod`` changes the length. - -:cpp:expr:`lv_meter_set_indicator_value(meter, indic, value)` sets the value of -the indicator. - -Needle image -^^^^^^^^^^^^ - -``indic = lv_meter_add_needle_img(meter, img_src, pivot_x, pivot_y)`` -sets an image that will be used as a needle. ``img_src`` should be a -needle pointing to the right like this ``-O--->``. ``pivot_x`` and -``pivot_y`` sets the pivot point of the rotation relative to the top -left corner of the image. - -:cpp:expr:`lv_meter_set_indicator_value(meter, indicator, value)` sets the -value of the indicator. - -Arc -^^^ - -``indic = lv_meter_add_arc(meter, arc_width, arc_color, r_mod)`` adds -and arc indicator. . By default, the radius of the arc is the same as -the scale's radius but ``r_mod`` changes the radius. - -:cpp:expr:`lv_meter_set_indicator_start_value(meter, indic, value)` and -:cpp:expr:`lv_meter_set_indicator_end_value(meter, indicator, value)` sets the -value of the indicator. - -Scale lines (ticks) -^^^^^^^^^^^^^^^^^^^ - -``indic = lv_meter_add_scale_lines(meter, color_start, color_end, local, width_mod)`` -adds an indicator that modifies the ticks lines. If ``local`` is -``true`` the ticks' color will be faded from ``color_start`` to -``color_end`` in the indicator's start and end value range. If ``local`` -is ``false`` ``color_start`` and ``color_end`` will be mapped to the -start and end value of the scale and only a "slice" of that color -gradient will be visible in the indicator's start and end value range. -``width_mod`` modifies the width of the tick lines. - -:cpp:expr:`lv_meter_set_indicator_start_value(meter, indicator, value)` and -:cpp:expr:`lv_meter_set_indicator_end_value(meter, indicator, value)` sets the -value of the indicator. - -Events -****** - -- :cpp:enumerator:`LV_EVENT_DRAW_PART_BEGIN` and :cpp:enumerator:`LV_EVENT_DRAW_PART_END` is sent - for the following types: - - - :cpp:enumerator:`LV_METER_DRAW_PART_ARC` The arc indicator - - - ``part``: :cpp:enumerator:`LV_PART_ITEMS` - - ``sub_part_ptr``: pointer to the indicator - - ``arc_dsc`` - - ``radius``: radius of the arc - - ``p1`` center of the arc - - - :cpp:enumerator:`LV_METER_DRAW_PART_NEEDLE_LINE` The needle lines - - - ``part``: :cpp:enumerator:`LV_PART_ITEMS` - - ``p1``, ``p2`` points of the line - - ``line_dsc`` - - ``sub_part_ptr``: pointer to the indicator - - - :cpp:enumerator:`LV_METER_DRAW_PART_NEEDLE_IMG` The needle images - - - ``part``: :cpp:enumerator:`LV_PART_ITEMS` - - ``p1``, ``p2`` points of the line - - ``img_dsc`` - - ``sub_part_ptr``: pointer to the indicator - - - :cpp:enumerator:`LV_METER_DRAW_PART_TICK` The tick lines and labels - - - ``part``: :cpp:enumerator:`LV_PART_TICKS` - - ``value``: the value of the line - - ``text``: ``value`` converted to decimal or ``NULL`` on minor - lines - - ``label_dsc``: label draw descriptor or ``NULL`` on minor lines - - ``line_dsc``: - - ``id``: the index of the line - -See the events of the `Base object `__ too. - -Learn more about :ref:`events`. - -Keys -**** - -No keys are handled by the Meter widget. - -Learn more about :ref:`indev_keys`. - -Example -******* - -.. include:: ../examples/widgets/meter/index.rst - -API -*** diff --git a/docs/widgets/scale.rst b/docs/widgets/scale.rst index 69d8470be..8f6234d01 100644 --- a/docs/widgets/scale.rst +++ b/docs/widgets/scale.rst @@ -12,7 +12,7 @@ Parts and Styles The scale widget is divided in the following three parts: - :cpp:enumerator: `LV_PART_MAIN` Main line. See blue line in the example image. -- :cpp:enumerator: `LV_PART_ITEMS` Minor ticks. See red minor ticks in the example image. +- :cpp:enumerator: `LV_PART_TICKS` Minor ticks. See red minor ticks in the example image. - :cpp:enumerator: `LV_PART_INDICATOR` Major ticks and its labels (if enabled). See pink labels and green major ticks in the example image. ![](/misc/scale.png "Scale example") @@ -37,7 +37,7 @@ Sections A section is the space between a minor and a major range. They can be created with :cpp:expr: `lv_scale_add_section(scale)` and it handles back an :cpp:expr: `lv_scale_section_t` pointer. -The range of the section is configured with :cpp:expr: `lv_scale_section_set_range(section, minor_range, major_range)`. The style of each of the three parts of the scale section can be set with :cpp:expr: `lv_scale_section_set_style(section, PART, style_pointer)`, where `PART` can be :cpp:enumarator: `LV_PART_MAIN`, :cpp:enumarator: `LV_PART_ITEMS` or :cpp:enumarator: `LV_PART_INDICATOR`, :cpp:expr: `style_pointer` should point to a global or static :cpp:expr: `lv_style_t` variable. +The range of the section is configured with :cpp:expr: `lv_scale_section_set_range(section, minor_range, major_range)`. The style of each of the three parts of the scale section can be set with :cpp:expr: `lv_scale_section_set_style(section, PART, style_pointer)`, where `PART` can be :cpp:enumarator: `LV_PART_MAIN`, :cpp:enumarator: `LV_PART_TICKS` or :cpp:enumarator: `LV_PART_INDICATOR`, :cpp:expr: `style_pointer` should point to a global or static :cpp:expr: `lv_style_t` variable. For labels the following properties can be configured: :cpp:expr: `lv_style_set_text_font`, :cpp:expr: `lv_style_set_text_color`, :cpp:expr: `lv_style_set_text_letter_space`, :cpp:expr: `lv_style_set_text_opa`. diff --git a/examples/assets/img_hand.c b/examples/assets/img_hand.c index e1d28ca35..0a4a9b84e 100644 --- a/examples/assets/img_hand.c +++ b/examples/assets/img_hand.c @@ -11,31 +11,6 @@ #endif const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMAGE_IMG_HAND uint8_t img_hand_map[] = { -#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8 - /*Pixel format: Alpha 8 bit, Red: 3 bit, Green: 3 bit, Blue: 2 bit*/ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x04, 0x6e, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x47, 0x00, 0x57, 0x25, 0x57, 0x49, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x6d, 0x0c, 0x49, 0x74, 0x24, 0xeb, 0x24, 0xf0, 0x49, 0xbc, 0x49, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x03, 0x24, 0x8f, 0x24, 0xfb, 0x00, 0xff, 0x00, 0xff, 0x00, 0xec, 0x24, 0x87, 0x49, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x92, 0x0f, 0x49, 0xcb, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x24, 0xc4, 0xdb, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x25, 0xa0, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x25, 0xf8, 0x24, 0xa8, 0x6e, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x4b, 0x00, 0xff, 0x24, 0xdb, 0x6e, 0x54, 0x6d, 0x50, 0x00, 0xb8, 0x00, 0xff, 0x25, 0xff, 0x49, 0xff, 0x49, 0xff, 0x25, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xfb, 0x49, 0xe8, 0x49, 0xe4, 0x49, 0xdc, 0x49, 0xd7, 0x49, 0xd0, 0x49, 0xb3, 0x49, 0xb0, 0x49, 0xaf, 0x49, 0xab, 0x49, 0xa7, 0x49, 0x87, 0x49, 0x84, 0x49, 0x80, 0x49, 0x7f, 0x49, 0x7b, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x24, 0x57, 0x00, 0x57, 0x00, 0x57, 0x24, 0x57, 0x24, 0x57, 0x24, 0x57, 0x24, 0x57, 0x24, 0x57, 0x24, 0x57, 0x25, 0x9c, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x25, 0xff, 0x49, 0xa0, 0x24, 0x57, 0x49, 0x57, 0x49, 0x57, 0x49, 0x57, 0x49, 0x57, 0x49, 0x57, 0x49, 0x57, 0x49, 0x57, 0x49, 0x57, 0x49, 0x57, 0x25, 0x57, 0x25, 0x57, 0x24, 0x57, 0x24, 0x57, 0x25, 0x57, 0x24, 0x57, 0x24, 0x57, 0x24, 0x57, 0x24, 0x57, 0x24, 0x57, 0x24, 0x57, 0x24, 0x57, 0x49, 0x50, - 0x49, 0xb7, 0x00, 0xff, 0x49, 0x8c, 0x6e, 0x04, 0x6e, 0x0f, 0x25, 0x37, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x24, 0xff, 0x24, 0xff, 0x24, 0xff, 0x24, 0xff, 0x24, 0xff, 0x24, 0xfc, 0x24, 0xfb, 0x24, 0xf8, 0x24, 0xf7, 0x24, 0xf4, 0x24, 0xf3, 0x24, 0xf3, 0x24, 0xf3, 0x00, 0xf0, 0x00, 0xec, 0x00, 0xeb, 0x00, 0xeb, 0x00, 0xeb, 0x00, 0xeb, 0x24, 0xe8, - 0x49, 0x77, 0x00, 0xff, 0x24, 0x8b, 0x92, 0x03, 0x6e, 0x14, 0x49, 0x5c, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x24, 0xff, 0x24, 0xff, 0x24, 0xff, 0x24, 0xff, 0x24, 0xff, 0x25, 0xff, 0x25, 0xff, 0x25, 0xff, 0x25, 0xff, 0x25, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xff, 0x49, 0xfc, 0x49, 0xf7, 0x49, 0xb7, 0x49, 0xa8, 0x49, 0xa3, 0x49, 0xa3, 0x49, 0xa8, 0x49, 0x93, 0x49, 0x7f, 0x49, 0x6b, 0x25, 0x5c, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x00, 0x57, 0x24, 0x57, 0x00, 0x57, 0x24, 0x9c, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x49, 0xff, 0x49, 0x90, 0x24, 0x54, 0x25, 0x57, 0x49, 0x57, 0x49, 0x57, 0x49, 0x57, 0x49, 0x57, 0x49, 0x53, 0x6d, 0x4b, 0x6d, 0x44, 0x6e, 0x37, 0x6e, 0x2f, 0x6e, 0x27, 0x6e, 0x24, 0x6e, 0x24, 0x6e, 0x24, 0x92, 0x17, 0xb7, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x25, 0x30, 0x00, 0xf4, 0x00, 0xff, 0x49, 0xff, 0x49, 0xff, 0x00, 0xff, 0x00, 0xff, 0x49, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x25, 0xcc, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x24, 0xf8, 0x24, 0xa8, 0x6d, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x6d, 0x2b, 0x00, 0xf3, 0x00, 0xff, 0x00, 0xff, 0x00, 0xf3, 0x24, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x18, 0x49, 0xd8, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xec, 0x24, 0x87, 0x49, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x92, 0x0c, 0x49, 0x5f, 0x49, 0x8c, 0x92, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x54, 0x00, 0x57, 0x25, 0x57, 0x49, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -#endif -#if LV_COLOR_DEPTH == 16 - /*Pixel format: Alpha 8 bit, Red: 5 bit, Green: 6 bit, Blue: 5 bit*/ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x84, 0x04, 0x2c, 0x63, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x52, 0x47, 0x20, 0x00, 0x57, 0x04, 0x21, 0x57, 0xe7, 0x39, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xeb, 0x5a, 0x0c, 0xc7, 0x39, 0x74, 0xc3, 0x18, 0xeb, 0xc3, 0x18, 0xf0, 0xc7, 0x39, 0xbc, 0xe8, 0x41, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x10, 0x03, 0xe4, 0x20, 0x8f, 0xa3, 0x18, 0xfb, 0x20, 0x00, 0xff, 0x21, 0x08, 0xff, 0x61, 0x08, 0xec, 0x04, 0x21, 0x87, 0x49, 0x4a, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xef, 0x7b, 0x0f, 0xa7, 0x39, 0xcb, 0x20, 0x00, 0xff, 0x21, 0x08, 0xff, 0x20, 0x00, 0xff, 0x20, 0x00, 0xff, 0xc3, 0x18, 0xc4, 0xd7, 0xbd, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x29, 0xa0, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x45, 0x29, 0xf8, 0xa3, 0x18, 0xa8, 0x2d, 0x6b, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x62, 0x10, 0x4b, 0x62, 0x10, 0xff, 0xc3, 0x18, 0xdb, 0x0c, 0x63, 0x54, 0xeb, 0x5a, 0x50, 0x82, 0x10, 0xb8, 0x21, 0x08, 0xff, 0x04, 0x21, 0xff, 0xc7, 0x39, 0xff, 0xe7, 0x39, 0xff, 0x86, 0x31, 0xff, 0xe8, 0x41, 0xff, 0xe8, 0x41, 0xff, 0xe8, 0x41, 0xff, 0x08, 0x42, 0xff, 0x08, 0x42, 0xfb, 0x28, 0x42, 0xe8, 0x28, 0x42, 0xe4, 0x29, 0x4a, 0xdc, 0x29, 0x4a, 0xd7, 0x29, 0x4a, 0xd0, 0x49, 0x4a, 0xb3, 0x49, 0x4a, 0xb0, 0x49, 0x4a, 0xaf, 0x49, 0x4a, 0xab, 0x49, 0x4a, 0xa7, 0x29, 0x4a, 0x87, 0x29, 0x4a, 0x84, 0x28, 0x42, 0x80, 0x28, 0x42, 0x7f, 0x08, 0x42, 0x7b, 0x00, 0x00, 0x57, 0x00, 0x00, 0x57, 0x00, 0x00, 0x57, 0x00, 0x00, 0x57, 0x00, 0x00, 0x57, 0x00, 0x00, 0x57, 0x00, 0x00, 0x57, 0x00, 0x00, 0x57, 0x20, 0x00, 0x57, 0x21, 0x08, 0x57, 0x20, 0x00, 0x57, 0x20, 0x00, 0x57, 0x21, 0x08, 0x57, 0x41, 0x08, 0x57, 0x41, 0x08, 0x57, 0x21, 0x08, 0x57, 0x41, 0x08, 0x57, 0x41, 0x08, 0x57, 0x41, 0x08, 0x57, 0x61, 0x08, 0x57, 0x41, 0x08, 0x57, 0x61, 0x08, 0x57, 0x61, 0x08, 0x57, 0x82, 0x10, 0x57, 0x82, 0x10, 0x57, 0x82, 0x10, 0x57, 0x82, 0x10, 0x57, 0x82, 0x10, 0x57, 0xa2, 0x10, 0x57, 0xa3, 0x18, 0x57, 0xa2, 0x10, 0x57, 0xa2, 0x10, 0x57, 0xa3, 0x18, 0x57, 0x86, 0x31, 0x9c, 0x61, 0x08, 0xff, 0x21, 0x08, 0xff, 0x41, 0x08, 0xff, 0x20, 0x00, 0xff, 0x20, 0x00, 0xff, 0x41, 0x08, 0xff, 0x21, 0x08, 0xff, 0x20, 0x00, 0xff, 0x00, 0x00, 0xff, 0x20, 0x00, 0xff, 0x25, 0x29, 0xff, 0x08, 0x42, 0xa0, 0xc3, 0x18, 0x57, 0xc7, 0x39, 0x57, 0xe8, 0x41, 0x57, 0x08, 0x42, 0x57, 0xe8, 0x41, 0x57, 0xa7, 0x39, 0x57, 0xa6, 0x31, 0x57, 0xa6, 0x31, 0x57, 0xa7, 0x39, 0x57, 0xa7, 0x39, 0x57, 0x66, 0x31, 0x57, 0x25, 0x29, 0x57, 0x04, 0x21, 0x57, 0x04, 0x21, 0x57, 0x04, 0x21, 0x57, 0x04, 0x21, 0x57, 0xc3, 0x18, 0x57, 0xa2, 0x10, 0x57, 0xa3, 0x18, 0x57, 0xc3, 0x18, 0x57, 0xa2, 0x10, 0x57, 0xa3, 0x18, 0x57, 0x28, 0x42, 0x50, - 0x49, 0x4a, 0xb7, 0x20, 0x00, 0xff, 0xa7, 0x39, 0x8c, 0x8e, 0x73, 0x04, 0x8e, 0x73, 0x0f, 0x04, 0x21, 0x37, 0x82, 0x10, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x21, 0x08, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x20, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x20, 0x00, 0xff, 0x20, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x20, 0x00, 0xff, 0x20, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x20, 0x00, 0xff, 0x20, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x20, 0x00, 0xff, 0x20, 0x00, 0xff, 0x20, 0x00, 0xff, 0x20, 0x00, 0xff, 0x20, 0x00, 0xff, 0x20, 0x00, 0xff, 0x21, 0x08, 0xff, 0x21, 0x08, 0xff, 0x21, 0x08, 0xff, 0x00, 0x00, 0xff, 0x21, 0x08, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x20, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x21, 0x08, 0xff, 0x61, 0x08, 0xff, 0x82, 0x10, 0xff, 0xa3, 0x18, 0xff, 0xa3, 0x18, 0xff, 0xa2, 0x10, 0xff, 0xa3, 0x18, 0xff, 0xc3, 0x18, 0xff, 0xc3, 0x18, 0xfc, 0xc3, 0x18, 0xfb, 0xc3, 0x18, 0xf8, 0xa3, 0x18, 0xf7, 0xa3, 0x18, 0xf4, 0xa3, 0x18, 0xf3, 0xa2, 0x10, 0xf3, 0xa2, 0x10, 0xf3, 0x82, 0x10, 0xf0, 0x41, 0x08, 0xec, 0x00, 0x00, 0xeb, 0x20, 0x00, 0xeb, 0x21, 0x08, 0xeb, 0x00, 0x00, 0xeb, 0xe3, 0x18, 0xe8, - 0xc7, 0x39, 0x77, 0x82, 0x10, 0xff, 0x04, 0x21, 0x8b, 0x10, 0x84, 0x03, 0x4d, 0x6b, 0x14, 0x6a, 0x52, 0x5c, 0x20, 0x00, 0xff, 0x20, 0x00, 0xff, 0x20, 0x00, 0xff, 0x20, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x21, 0x08, 0xff, 0x21, 0x08, 0xff, 0x21, 0x08, 0xff, 0x21, 0x08, 0xff, 0x41, 0x08, 0xff, 0x62, 0x10, 0xff, 0xa2, 0x10, 0xff, 0xa2, 0x10, 0xff, 0xa3, 0x18, 0xff, 0xc3, 0x18, 0xff, 0xe3, 0x18, 0xff, 0x25, 0x29, 0xff, 0x25, 0x29, 0xff, 0x25, 0x29, 0xff, 0x25, 0x29, 0xff, 0x25, 0x29, 0xff, 0xc7, 0x39, 0xff, 0xe7, 0x39, 0xff, 0xe8, 0x41, 0xff, 0x08, 0x42, 0xfc, 0x08, 0x42, 0xf7, 0x49, 0x4a, 0xb7, 0x49, 0x4a, 0xa8, 0x49, 0x4a, 0xa3, 0x49, 0x4a, 0xa3, 0x49, 0x4a, 0xa8, 0x49, 0x4a, 0x93, 0x28, 0x42, 0x7f, 0xa7, 0x39, 0x6b, 0x04, 0x21, 0x5c, 0x41, 0x08, 0x57, 0x00, 0x00, 0x57, 0x20, 0x00, 0x57, 0x41, 0x08, 0x57, 0x61, 0x08, 0x57, 0x61, 0x08, 0x57, 0x62, 0x10, 0x57, 0xa2, 0x10, 0x57, 0x82, 0x10, 0x57, 0xe4, 0x20, 0x9c, 0x41, 0x08, 0xff, 0x00, 0x00, 0xff, 0x21, 0x08, 0xff, 0x20, 0x00, 0xff, 0x00, 0x00, 0xff, 0x41, 0x08, 0xff, 0x21, 0x08, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x41, 0x08, 0xff, 0x86, 0x31, 0xff, 0x29, 0x4a, 0x90, 0x82, 0x10, 0x54, 0x25, 0x29, 0x57, 0xa7, 0x39, 0x57, 0xe8, 0x41, 0x57, 0x08, 0x42, 0x57, 0x49, 0x4a, 0x57, 0x8a, 0x52, 0x53, 0xab, 0x5a, 0x4b, 0xcb, 0x5a, 0x44, 0x0c, 0x63, 0x37, 0x4d, 0x6b, 0x2f, 0x6e, 0x73, 0x27, 0x6e, 0x73, 0x24, 0x6e, 0x73, 0x24, 0x6e, 0x73, 0x24, 0xcf, 0x7b, 0x17, 0x55, 0xad, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x24, 0x21, 0x30, 0x61, 0x08, 0xf4, 0x21, 0x08, 0xff, 0xc7, 0x39, 0xff, 0xa6, 0x31, 0xff, 0x41, 0x08, 0xff, 0x82, 0x10, 0xff, 0xc7, 0x39, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x31, 0xcc, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x20, 0x00, 0xff, 0x20, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x04, 0x21, 0xf8, 0xa2, 0x10, 0xa8, 0xaa, 0x52, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xaa, 0x52, 0x2b, 0x62, 0x10, 0xf3, 0x62, 0x10, 0xff, 0x82, 0x10, 0xff, 0x82, 0x10, 0xf3, 0xc3, 0x18, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcb, 0x5a, 0x18, 0xa6, 0x31, 0xd8, 0x62, 0x10, 0xff, 0x00, 0x00, 0xff, 0x21, 0x08, 0xff, 0x61, 0x08, 0xec, 0xc3, 0x18, 0x87, 0xc7, 0x39, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x7b, 0x0c, 0xe8, 0x41, 0x5f, 0x08, 0x42, 0x8c, 0xae, 0x73, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x39, 0x54, 0x21, 0x08, 0x57, 0x24, 0x21, 0x57, 0xe7, 0x39, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -#endif -#if LV_COLOR_DEPTH == 32 || LV_COLOR_DEPTH == 24 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x04, 0x63, 0x63, 0x63, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x4f, 0x4f, 0x47, 0x03, 0x03, 0x03, 0x57, 0x22, 0x22, 0x22, 0x57, 0x3c, 0x3c, 0x3c, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x5b, 0x5b, 0x0c, 0x38, 0x38, 0x38, 0x74, 0x19, 0x19, 0x19, 0xeb, 0x18, 0x18, 0x18, 0xf0, 0x3a, 0x3a, 0x3a, 0xbc, 0x3e, 0x3e, 0x3e, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x03, 0x1e, 0x1e, 0x1e, 0x8f, 0x16, 0x16, 0x16, 0xfb, 0x04, 0x04, 0x04, 0xff, 0x06, 0x06, 0x06, 0xff, 0x0b, 0x0b, 0x0b, 0xec, 0x20, 0x20, 0x20, 0x87, 0x4a, 0x4a, 0x4a, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, 0x7b, 0x7b, 0x0f, 0x35, 0x35, 0x35, 0xcb, 0x03, 0x03, 0x03, 0xff, 0x06, 0x06, 0x06, 0xff, 0x04, 0x04, 0x04, 0xff, 0x03, 0x03, 0x03, 0xff, 0x1a, 0x1a, 0x1a, 0xc4, 0xb9, 0xb9, 0xb9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0x27, 0x27, 0xa0, 0x02, 0x02, 0x02, 0xff, 0x02, 0x02, 0x02, 0xff, 0x01, 0x01, 0x01, 0xff, 0x02, 0x02, 0x02, 0xff, 0x02, 0x02, 0x02, 0xff, 0x00, 0x00, 0x00, 0xff, 0x29, 0x29, 0x29, 0xf8, 0x16, 0x16, 0x16, 0xa8, 0x65, 0x65, 0x65, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -45,7 +20,6 @@ const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_IMAGE_IMG_HAND uint8_t img_hand_map[] 0x23, 0x23, 0x23, 0x30, 0x0b, 0x0b, 0x0b, 0xf4, 0x05, 0x05, 0x05, 0xff, 0x38, 0x38, 0x38, 0xff, 0x33, 0x33, 0x33, 0xff, 0x07, 0x07, 0x07, 0xff, 0x10, 0x10, 0x10, 0xff, 0x37, 0x37, 0x37, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x2f, 0x2f, 0xcc, 0x02, 0x02, 0x02, 0xff, 0x01, 0x01, 0x01, 0xff, 0x03, 0x03, 0x03, 0xff, 0x03, 0x03, 0x03, 0xff, 0x01, 0x01, 0x01, 0xff, 0x00, 0x00, 0x00, 0xff, 0x20, 0x20, 0x20, 0xf8, 0x14, 0x14, 0x14, 0xa8, 0x53, 0x53, 0x53, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x53, 0x53, 0x2b, 0x0d, 0x0d, 0x0d, 0xf3, 0x0d, 0x0d, 0x0d, 0xff, 0x10, 0x10, 0x10, 0xff, 0x10, 0x10, 0x10, 0xf3, 0x17, 0x17, 0x17, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x5a, 0x5a, 0x18, 0x34, 0x34, 0x34, 0xd8, 0x0d, 0x0d, 0x0d, 0xff, 0x02, 0x02, 0x02, 0xff, 0x05, 0x05, 0x05, 0xff, 0x0b, 0x0b, 0x0b, 0xec, 0x19, 0x19, 0x19, 0x87, 0x38, 0x38, 0x38, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, 0x7b, 0x7b, 0x0c, 0x3e, 0x3e, 0x3e, 0x5f, 0x41, 0x41, 0x41, 0x8c, 0x74, 0x74, 0x74, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, 0x39, 0x39, 0x54, 0x05, 0x05, 0x05, 0x57, 0x24, 0x24, 0x24, 0x57, 0x3c, 0x3c, 0x3c, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -#endif }; const lv_image_dsc_t img_hand = { diff --git a/examples/widgets/chart/lv_example_chart_3.c b/examples/widgets/chart/lv_example_chart_3.c index 918bff461..fde782900 100644 --- a/examples/widgets/chart/lv_example_chart_3.c +++ b/examples/widgets/chart/lv_example_chart_3.c @@ -1,41 +1,49 @@ #include "../../lv_examples.h" -//TODO when lv_scale is ready #if LV_USE_CHART && LV_BUILD_EXAMPLES && 0 -static void draw_event_cb(lv_event_t * e) -{ - lv_obj_draw_part_dsc_t * dsc = lv_event_get_draw_part_dsc(e); - if(!lv_obj_draw_part_check_type(dsc, &lv_chart_class, LV_CHART_DRAW_PART_TICK_LABEL)) return; - - if(dsc->id == LV_CHART_AXIS_PRIMARY_X && dsc->text) { - const char * month[] = {"Jan", "Febr", "March", "Apr", "May", "Jun", "July", "Aug", "Sept", "Oct", "Nov", "Dec"}; - lv_snprintf(dsc->text, dsc->text_length, "%s", month[dsc->value]); - } -} +//static void draw_event_cb(lv_event_t * e) +//{ +// lv_obj_draw_part_dsc_t * dsc = lv_event_get_draw_part_dsc(e); +// if(!lv_obj_draw_part_check_type(dsc, &lv_chart_class, LV_CHART_DRAW_PART_TICK_LABEL)) return; +// +// if(dsc->id == LV_CHART_AXIS_PRIMARY_X && dsc->text) { +// const char * month[] = {"Jan", "Febr", "March", "Apr", "May", "Jun", "July", "Aug", "Sept", "Oct", "Nov", "Dec"}; +// lv_snprintf(dsc->text, dsc->text_length, "%s", month[dsc->value]); +// } +//} /** * Add ticks and labels to the axis and demonstrate scrolling */ void lv_example_chart_3(void) { + lv_obj_t * main_cont = lv_obj_create(lv_scr_act()); + lv_obj_set_size(main_cont, 200, 150); + + lv_obj_t * wrapper = lv_obj_create(main_cont); + lv_obj_remove_style_all(wrapper); + lv_obj_set_size(wrapper, 800, lv_pct(100)); + lv_obj_set_flex_flow(wrapper, LV_FLEX_FLOW_COLUMN); + /*Create a chart*/ - lv_obj_t * chart; - chart = lv_chart_create(lv_scr_act()); - lv_obj_set_size(chart, 200, 150); - lv_obj_center(chart); + lv_obj_t * chart = lv_chart_create(wrapper); + lv_obj_set_width(chart, lv_pct(100)); + lv_obj_set_flex_grow(chart, 1); lv_chart_set_type(chart, LV_CHART_TYPE_BAR); lv_chart_set_range(chart, LV_CHART_AXIS_PRIMARY_Y, 0, 100); lv_chart_set_range(chart, LV_CHART_AXIS_SECONDARY_Y, 0, 400); lv_chart_set_point_count(chart, 12); - lv_obj_add_event(chart, draw_event_cb, LV_EVENT_DRAW_PART_BEGIN, NULL); + lv_obj_set_style_radius(chart, 0, 0); - /*Add ticks and label to every axis*/ - lv_chart_set_axis_tick(chart, LV_CHART_AXIS_PRIMARY_X, 10, 5, 12, 3, true, 40); - lv_chart_set_axis_tick(chart, LV_CHART_AXIS_PRIMARY_Y, 10, 5, 6, 2, true, 50); - lv_chart_set_axis_tick(chart, LV_CHART_AXIS_SECONDARY_Y, 10, 5, 3, 4, true, 50); + lv_obj_t * scale_bottom = lv_scale_create(wrapper); + lv_scale_set_mode(scale_bottom, LV_SCALE_MODE_HORIZONTAL_BOTTOM); + lv_obj_set_size(scale_bottom, lv_pct(100), 25); + lv_scale_set_total_tick_count(scale_bottom, 12); + lv_scale_set_major_tick_every(scale_bottom, 1); + lv_obj_set_style_pad_hor(scale_bottom, 50, 0); - /*Zoom in a little in X*/ - lv_chart_set_zoom_x(chart, 800); + static const char * month[] = {"Jan", "Febr", "March", "Apr", "May", "Jun", "July", "Aug", "Sept", "Oct", "Nov", "Dec", NULL}; + lv_scale_set_text_src(scale_bottom, month); /*Add two data series*/ lv_chart_series_t * ser1 = lv_chart_add_series(chart, lv_palette_lighten(LV_PALETTE_GREEN, 2), LV_CHART_AXIS_PRIMARY_Y); diff --git a/examples/widgets/chart/lv_example_chart_4.c b/examples/widgets/chart/lv_example_chart_4.c index 6d4fdc62c..e6b7b97ef 100644 --- a/examples/widgets/chart/lv_example_chart_4.c +++ b/examples/widgets/chart/lv_example_chart_4.c @@ -1,5 +1,5 @@ #include "../../lv_examples.h" -#if LV_USE_CHART && LV_BUILD_EXAMPLES +#if LV_USE_CHART && LV_BUILD_EXAMPLES && 0 static void event_cb(lv_event_t * e) @@ -71,7 +71,7 @@ void lv_example_chart_4(void) lv_obj_refresh_ext_draw_size(chart); /*Zoom in a little in X*/ - lv_chart_set_zoom_x(chart, 800); + // lv_chart_set_zoom_x(chart, 800); /*Add two data series*/ lv_chart_series_t * ser1 = lv_chart_add_series(chart, lv_palette_main(LV_PALETTE_RED), LV_CHART_AXIS_PRIMARY_Y); diff --git a/examples/widgets/chart/lv_example_chart_5.c b/examples/widgets/chart/lv_example_chart_5.c index cf03287d0..dbd62a680 100644 --- a/examples/widgets/chart/lv_example_chart_5.c +++ b/examples/widgets/chart/lv_example_chart_5.c @@ -1,5 +1,5 @@ #include "../../lv_examples.h" -#if LV_USE_CHART && LV_USE_SLIDER && LV_BUILD_EXAMPLES +#if LV_USE_CHART && LV_USE_SLIDER && LV_BUILD_EXAMPLES && 0 static lv_obj_t * chart; /* Source: https://github.com/ankur219/ECG-Arrhythmia-classification/blob/642230149583adfae1e4bd26c6f0e1fd8af2be0e/sample.csv*/ @@ -50,14 +50,14 @@ static void slider_x_event_cb(lv_event_t * e) { lv_obj_t * obj = lv_event_get_target(e); int32_t v = lv_slider_get_value(obj); - lv_chart_set_zoom_x(chart, v); + // lv_chart_set_zoom_x(chart, v); } static void slider_y_event_cb(lv_event_t * e) { lv_obj_t * obj = lv_event_get_target(e); int32_t v = lv_slider_get_value(obj); - lv_chart_set_zoom_y(chart, v); + // lv_chart_set_zoom_y(chart, v); } /** diff --git a/examples/widgets/chart/lv_example_chart_6.c b/examples/widgets/chart/lv_example_chart_6.c index abf398389..e4e6a61a5 100644 --- a/examples/widgets/chart/lv_example_chart_6.c +++ b/examples/widgets/chart/lv_example_chart_6.c @@ -25,8 +25,8 @@ void lv_example_chart_6(void) lv_obj_set_size(chart, 200, 150); lv_obj_align(chart, LV_ALIGN_CENTER, 0, -10); - lv_chart_set_axis_tick(chart, LV_CHART_AXIS_PRIMARY_Y, 10, 5, 6, 5, true, 40); - lv_chart_set_axis_tick(chart, LV_CHART_AXIS_PRIMARY_X, 10, 5, 10, 1, true, 30); + // lv_chart_set_axis_tick(chart, LV_CHART_AXIS_PRIMARY_Y, 10, 5, 6, 5, true, 40); + // lv_chart_set_axis_tick(chart, LV_CHART_AXIS_PRIMARY_X, 10, 5, 10, 1, true, 30); lv_obj_add_event(chart, value_changed_event_cb, LV_EVENT_VALUE_CHANGED, NULL); lv_obj_refresh_ext_draw_size(chart); @@ -39,7 +39,7 @@ void lv_example_chart_6(void) lv_chart_set_next_value(chart, ser, lv_rand(10, 90)); } - lv_chart_set_zoom_x(chart, 500); + // lv_chart_set_zoom_x(chart, 500); lv_obj_t * label = lv_label_create(lv_scr_act()); lv_label_set_text(label, "Click on a point"); diff --git a/examples/widgets/chart/lv_example_chart_7.c b/examples/widgets/chart/lv_example_chart_7.c index 2c325e06a..ed52a45c1 100644 --- a/examples/widgets/chart/lv_example_chart_7.c +++ b/examples/widgets/chart/lv_example_chart_7.c @@ -50,8 +50,8 @@ void lv_example_chart_7(void) lv_chart_set_type(chart, LV_CHART_TYPE_SCATTER); - lv_chart_set_axis_tick(chart, LV_CHART_AXIS_PRIMARY_X, 5, 5, 5, 1, true, 30); - lv_chart_set_axis_tick(chart, LV_CHART_AXIS_PRIMARY_Y, 10, 5, 6, 5, true, 50); + // lv_chart_set_axis_tick(chart, LV_CHART_AXIS_PRIMARY_X, 5, 5, 5, 1, true, 30); + // lv_chart_set_axis_tick(chart, LV_CHART_AXIS_PRIMARY_Y, 10, 5, 6, 5, true, 50); lv_chart_set_range(chart, LV_CHART_AXIS_PRIMARY_X, 0, 200); lv_chart_set_range(chart, LV_CHART_AXIS_PRIMARY_Y, 0, 1000); diff --git a/examples/widgets/meter/index.rst b/examples/widgets/meter/index.rst deleted file mode 100644 index 6462e5081..000000000 --- a/examples/widgets/meter/index.rst +++ /dev/null @@ -1,28 +0,0 @@ - -Simple meter ------------- - -.. lv_example:: widgets/meter/lv_example_meter_1 - :language: c - - -A meter with multiple arcs --------------------------- - -.. lv_example:: widgets/meter/lv_example_meter_2 - :language: c - - -A clock from a meter --------------------- - -.. lv_example:: widgets/meter/lv_example_meter_3 - :language: c - - -Pie chart ---------- - -.. lv_example:: widgets/meter/lv_example_meter_4 - :language: c - diff --git a/examples/widgets/meter/lv_example_meter_1.c b/examples/widgets/meter/lv_example_meter_1.c deleted file mode 100644 index dd295ea0e..000000000 --- a/examples/widgets/meter/lv_example_meter_1.c +++ /dev/null @@ -1,65 +0,0 @@ -#include "../../lv_examples.h" -#if LV_USE_METER && LV_BUILD_EXAMPLES - -static lv_obj_t * meter; - -static void set_value(void * indic, int32_t v) -{ - lv_meter_set_indicator_value(meter, indic, v); -} - -/** - * A simple meter - */ -void lv_example_meter_1(void) -{ - meter = lv_meter_create(lv_scr_act()); - lv_obj_center(meter); - lv_obj_set_size(meter, 200, 200); - - /*Add a scale first*/ - lv_meter_set_scale_ticks(meter, 41, 2, 10, lv_palette_main(LV_PALETTE_GREY)); - lv_meter_set_scale_major_ticks(meter, 8, 4, 15, lv_color_black(), 10); - - lv_meter_indicator_t * indic; - - /*Add a blue arc to the start*/ - indic = lv_meter_add_arc(meter, 3, lv_palette_main(LV_PALETTE_BLUE), 0); - lv_meter_set_indicator_start_value(meter, indic, 0); - lv_meter_set_indicator_end_value(meter, indic, 20); - - /*Make the tick lines blue at the start of the scale*/ - indic = lv_meter_add_scale_lines(meter, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_BLUE), - false, 0); - lv_meter_set_indicator_start_value(meter, indic, 0); - lv_meter_set_indicator_end_value(meter, indic, 20); - - /*Add a red arc to the end*/ - indic = lv_meter_add_arc(meter, 3, lv_palette_main(LV_PALETTE_RED), 0); - lv_meter_set_indicator_start_value(meter, indic, 80); - lv_meter_set_indicator_end_value(meter, indic, 100); - - /*Make the tick lines red at the end of the scale*/ - indic = lv_meter_add_scale_lines(meter, lv_palette_main(LV_PALETTE_RED), lv_palette_main(LV_PALETTE_RED), false, - 0); - lv_meter_set_indicator_start_value(meter, indic, 80); - lv_meter_set_indicator_end_value(meter, indic, 100); - - /*Add a needle line indicator*/ - indic = lv_meter_add_needle_line(meter, 4, lv_palette_main(LV_PALETTE_GREY), -10); - - /*Create an animation to set the value*/ - lv_anim_t a; - lv_anim_init(&a); - lv_anim_set_exec_cb(&a, set_value); - lv_anim_set_var(&a, indic); - lv_anim_set_values(&a, 0, 100); - lv_anim_set_time(&a, 2000); - lv_anim_set_repeat_delay(&a, 100); - lv_anim_set_playback_time(&a, 500); - lv_anim_set_playback_delay(&a, 100); - lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE); - lv_anim_start(&a); -} - -#endif diff --git a/examples/widgets/meter/lv_example_meter_1.py b/examples/widgets/meter/lv_example_meter_1.py deleted file mode 100644 index d7a174d40..000000000 --- a/examples/widgets/meter/lv_example_meter_1.py +++ /dev/null @@ -1,53 +0,0 @@ -import utime as time -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 -meter.set_scale_ticks(41, 2, 10, lv.palette_main(lv.PALETTE.GREY)) -meter.set_scale_major_ticks(8, 4, 15, lv.color_black(), 10) - -indic = lv.meter_indicator_t() - -# Add a blue arc to the start -indic = meter.add_arc(3, lv.palette_main(lv.PALETTE.BLUE), 0) -meter.set_indicator_start_value(indic, 0) -meter.set_indicator_end_value(indic, 20) - -# Make the tick lines blue at the start of the scale -indic = meter.add_scale_lines(lv.palette_main(lv.PALETTE.BLUE), lv.palette_main(lv.PALETTE.BLUE), False, 0) -meter.set_indicator_start_value(indic, 0) -meter.set_indicator_end_value(indic, 20) - -# Add a red arc to the end -indic = meter.add_arc(3, lv.palette_main(lv.PALETTE.RED), 0) -meter.set_indicator_start_value(indic, 80) -meter.set_indicator_end_value(indic, 100) - -# Make the tick lines red at the end of the scale -indic = meter.add_scale_lines(lv.palette_main(lv.PALETTE.RED), lv.palette_main(lv.PALETTE.RED), False, 0) -meter.set_indicator_start_value(indic, 80) -meter.set_indicator_end_value(indic, 100) - -# Add a needle line indicator -indic = meter.add_needle_line(4, lv.palette_main(lv.PALETTE.GREY), -10) - -# Create an animation to set the value -a = lv.anim_t() -a.init() -a.set_var(indic) -a.set_values(0, 100) -a.set_time(2000) -a.set_repeat_delay(100) -a.set_playback_time(500) -a.set_playback_delay(100) -a.set_repeat_count(lv.ANIM_REPEAT_INFINITE) -a.set_custom_exec_cb(lambda a,val: set_value(indic,val)) -lv.anim_t.start(a) - diff --git a/examples/widgets/meter/lv_example_meter_2.c b/examples/widgets/meter/lv_example_meter_2.c deleted file mode 100644 index 0e4159b47..000000000 --- a/examples/widgets/meter/lv_example_meter_2.c +++ /dev/null @@ -1,59 +0,0 @@ -#include "../../lv_examples.h" -#if LV_USE_METER && LV_BUILD_EXAMPLES - -static lv_obj_t * meter; - -static void set_value(void * indic, int32_t v) -{ - lv_meter_set_indicator_end_value(meter, indic, v); -} - - -/** - * A meter with multiple arcs - */ -void lv_example_meter_2(void) -{ - meter = lv_meter_create(lv_scr_act()); - lv_obj_center(meter); - lv_obj_set_size(meter, 220, 220); - - /*Remove the circle from the middle*/ - lv_obj_remove_style(meter, NULL, LV_PART_INDICATOR); - - /*Add a scale first*/ - lv_meter_set_scale_ticks(meter, 11, 2, 10, lv_palette_main(LV_PALETTE_GREY)); - lv_meter_set_scale_major_ticks(meter, 1, 2, 30, lv_color_hex3(0xeee), 15); - lv_meter_set_scale_range(meter, 0, 100, 270, 90); - - /*Add a three arc indicator*/ - lv_meter_indicator_t * indic1 = lv_meter_add_arc(meter, 10, lv_palette_main(LV_PALETTE_RED), 0); - lv_meter_indicator_t * indic2 = lv_meter_add_arc(meter, 10, lv_palette_main(LV_PALETTE_GREEN), -10); - lv_meter_indicator_t * indic3 = lv_meter_add_arc(meter, 10, lv_palette_main(LV_PALETTE_BLUE), -20); - - /*Create an animation to set the value*/ - lv_anim_t a; - lv_anim_init(&a); - lv_anim_set_exec_cb(&a, set_value); - lv_anim_set_values(&a, 0, 100); - lv_anim_set_repeat_delay(&a, 100); - lv_anim_set_playback_delay(&a, 100); - lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE); - - lv_anim_set_time(&a, 2000); - lv_anim_set_playback_time(&a, 500); - lv_anim_set_var(&a, indic1); - lv_anim_start(&a); - - lv_anim_set_time(&a, 1000); - lv_anim_set_playback_time(&a, 1000); - lv_anim_set_var(&a, indic2); - lv_anim_start(&a); - - lv_anim_set_time(&a, 1000); - lv_anim_set_playback_time(&a, 2000); - lv_anim_set_var(&a, indic3); - lv_anim_start(&a); -} - -#endif diff --git a/examples/widgets/meter/lv_example_meter_2.py b/examples/widgets/meter/lv_example_meter_2.py deleted file mode 100644 index c4c6b31d2..000000000 --- a/examples/widgets/meter/lv_example_meter_2.py +++ /dev/null @@ -1,65 +0,0 @@ -import utime as time - -def set_value(indic,v): - meter.set_indicator_end_value(indic, v) - -# -# A meter with multiple arcs -# - -meter = lv.meter(lv.scr_act()) -meter.center() -meter.set_size(200, 200) - -# Remove the circle from the middle -meter.remove_style(None, lv.PART.INDICATOR) - -# Scale settings -meter.set_scale_ticks(11, 2, 10, lv.palette_main(lv.PALETTE.GREY)) -meter.set_scale_major_ticks(1, 2, 30, lv.color_hex3(0xeee), 10) -meter.set_scale_range(0, 100, 270, 90) - -# Add a three arc indicator -indic1 = meter.add_arc(10, lv.palette_main(lv.PALETTE.RED), 0) -indic2 = meter.add_arc(10, lv.palette_main(lv.PALETTE.GREEN), -10) -indic3 = meter.add_arc(10, lv.palette_main(lv.PALETTE.BLUE), -20) - -# Create an animation to set the value -a1 = lv.anim_t() -a1.init() -a1.set_values(0, 100) -a1.set_time(2000) -a1.set_repeat_delay(100) -a1.set_playback_delay(100) -a1.set_playback_time(500) -a1.set_var(indic1) -a1.set_repeat_count(lv.ANIM_REPEAT_INFINITE) -a1.set_custom_exec_cb(lambda a,val: set_value(indic1,val)) -lv.anim_t.start(a1) - -a2 = lv.anim_t() -a2.init() -a2.set_values(0, 100) -a2.set_time(1000) -a2.set_repeat_delay(100) -a2.set_playback_delay(100) -a2.set_playback_time(1000) -a2.set_var(indic2) -a2.set_repeat_count(lv.ANIM_REPEAT_INFINITE) -a2.set_custom_exec_cb(lambda a,val: set_value(indic2,val)) -lv.anim_t.start(a2) - -a3 = lv.anim_t() -a3.init() -a3.set_values(0, 100) -a3.set_time(1000) -a3.set_repeat_delay(100) -a3.set_playback_delay(100) -a3.set_playback_time(2000) -a3.set_var(indic3) -a3.set_repeat_count(lv.ANIM_REPEAT_INFINITE) -a3.set_custom_exec_cb(lambda a,val: set_value(indic3,val)) -lv.anim_t.start(a3) - - - diff --git a/examples/widgets/meter/lv_example_meter_3.c b/examples/widgets/meter/lv_example_meter_3.c deleted file mode 100644 index 3ef81a9c0..000000000 --- a/examples/widgets/meter/lv_example_meter_3.c +++ /dev/null @@ -1,74 +0,0 @@ -#include "../../lv_examples.h" -//TODO -#if LV_USE_METER && LV_BUILD_EXAMPLES && 0 - -static lv_obj_t * meter; - -static void set_value(void * indic, int32_t v) -{ - lv_meter_set_indicator_end_value(meter, indic, v); -} - -static void tick_label_event(lv_event_t * e) -{ - lv_obj_draw_part_dsc_t * draw_part_dsc = lv_event_get_draw_part_dsc(e); - - /*Be sure it's drawing meter related parts*/ - if(draw_part_dsc->class_p != &lv_meter_class) return; - - /*Be sure it's drawing the ticks*/ - if(draw_part_dsc->type != LV_METER_DRAW_PART_TICK) return; - - /*Be sure it's a major ticks*/ - if(draw_part_dsc->id % 5) return; - - /*The order of numbers on the clock is tricky: 12, 1, 2, 3...*/ - if(draw_part_dsc->id == 0) { - lv_strncpy(draw_part_dsc->text, "12", 4); - } - else { - lv_snprintf(draw_part_dsc->text, 4, "%d", draw_part_dsc->id / 5); - } -} - -/** - * A clock from a meter - */ -void lv_example_meter_3(void) -{ - meter = lv_meter_create(lv_scr_act()); - lv_obj_set_size(meter, 220, 220); - lv_obj_center(meter); - - /*Create a scale for the minutes*/ - /*61 ticks in a 360 degrees range (the last and the first line overlaps)*/ - lv_meter_set_scale_ticks(meter, 60, 1, 10, lv_palette_main(LV_PALETTE_GREY)); - lv_meter_set_scale_major_ticks(meter, 5, 2, 20, lv_color_black(), 10); - lv_meter_set_scale_range(meter, 0, 59, 354, 270); - - LV_IMAGE_DECLARE(img_hand) - - /*Add a the hands from images*/ - lv_meter_indicator_t * indic_min = lv_meter_add_needle_image(meter, &img_hand, 5, 5); - lv_meter_indicator_t * indic_hour = lv_meter_add_needle_image(meter, &img_hand, 5, 5); - - lv_obj_add_event(meter, tick_label_event, LV_EVENT_DRAW_PART_BEGIN, NULL); - - - /*Create an animation to set the value*/ - lv_anim_t a; - lv_anim_init(&a); - lv_anim_set_exec_cb(&a, set_value); - lv_anim_set_values(&a, 0, 59); - lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE); - lv_anim_set_time(&a, 5000); /*2 sec for 1 turn of the minute hand (1 hour)*/ - lv_anim_set_var(&a, indic_min); - lv_anim_start(&a); - - lv_anim_set_var(&a, indic_hour); - lv_anim_set_time(&a, 240000); /*24 sec for 1 turn of the hour hand*/ - lv_anim_set_values(&a, 0, 59); - lv_anim_start(&a); -} - -#endif diff --git a/examples/widgets/meter/lv_example_meter_3.py b/examples/widgets/meter/lv_example_meter_3.py deleted file mode 100644 index fc80254b6..000000000 --- a/examples/widgets/meter/lv_example_meter_3.py +++ /dev/null @@ -1 +0,0 @@ -pass \ No newline at end of file diff --git a/examples/widgets/meter/lv_example_meter_4.c b/examples/widgets/meter/lv_example_meter_4.c deleted file mode 100644 index 4df61fbec..000000000 --- a/examples/widgets/meter/lv_example_meter_4.c +++ /dev/null @@ -1,37 +0,0 @@ -#include "../../lv_examples.h" -#if LV_USE_METER && LV_BUILD_EXAMPLES - -/** - * Create a pie chart - */ -void lv_example_meter_4(void) -{ - lv_obj_t * meter = lv_meter_create(lv_scr_act()); - - /*Remove the background and the circle from the middle*/ - lv_obj_remove_style(meter, NULL, LV_PART_MAIN); - lv_obj_remove_style(meter, NULL, LV_PART_INDICATOR); - - lv_obj_set_size(meter, 200, 200); - lv_obj_center(meter); - - /*Add a scale first with no ticks.*/ - lv_meter_set_scale_ticks(meter, 0, 0, 0, lv_color_black()); - lv_meter_set_scale_range(meter, 0, 100, 360, 0); - - /*Add a three arc indicator*/ - lv_coord_t indic_w = 100; - lv_meter_indicator_t * indic1 = lv_meter_add_arc(meter, indic_w, lv_palette_main(LV_PALETTE_ORANGE), 0); - lv_meter_set_indicator_start_value(meter, indic1, 0); - lv_meter_set_indicator_end_value(meter, indic1, 40); - - lv_meter_indicator_t * indic2 = lv_meter_add_arc(meter, indic_w, lv_palette_main(LV_PALETTE_YELLOW), 0); - lv_meter_set_indicator_start_value(meter, indic2, 40); /*Start from the previous*/ - lv_meter_set_indicator_end_value(meter, indic2, 80); - - lv_meter_indicator_t * indic3 = lv_meter_add_arc(meter, indic_w, lv_palette_main(LV_PALETTE_DEEP_ORANGE), 0); - lv_meter_set_indicator_start_value(meter, indic3, 80); /*Start from the previous*/ - lv_meter_set_indicator_end_value(meter, indic3, 100); -} - -#endif diff --git a/examples/widgets/meter/lv_example_meter_4.py b/examples/widgets/meter/lv_example_meter_4.py deleted file mode 100644 index 542316fa6..000000000 --- a/examples/widgets/meter/lv_example_meter_4.py +++ /dev/null @@ -1,33 +0,0 @@ -import utime as time - -# -# Create a pie chart -# - -meter = lv.meter(lv.scr_act()) - -# Remove the background and the circle from the middle -meter.remove_style(None, lv.PART.MAIN) -meter.remove_style(None, lv.PART.INDICATOR) - -meter.set_size(200, 200) -meter.center() - -# Add a scale first with no ticks. -meter.set_scale_ticks( 0, 0, 0, lv.color_black()) -meter.set_scale_range(0, 100, 360, 0) - -# Add a three arc indicator* -indic_w = 100 -indic1 = meter.add_arc(indic_w,lv.palette_main(lv.PALETTE.ORANGE), 0) -meter.set_indicator_start_value(indic1, 0) -meter.set_indicator_end_value(indic1, 40) - -indic2 = meter.add_arc(indic_w, lv.palette_main(lv.PALETTE.YELLOW), 0) -meter.set_indicator_start_value(indic2, 40) # Start from the previous -meter.set_indicator_end_value(indic2, 80) - -indic3 = meter.add_arc(indic_w, lv.palette_main(lv.PALETTE.DEEP_ORANGE), 0) -meter.set_indicator_start_value(indic3, 80) # Start from the previous -meter.set_indicator_end_value(indic3, 100) - diff --git a/examples/widgets/scale/lv_example_scale_2.c b/examples/widgets/scale/lv_example_scale_2.c index 11298d60f..9514fdc76 100644 --- a/examples/widgets/scale/lv_example_scale_2.c +++ b/examples/widgets/scale/lv_example_scale_2.c @@ -19,7 +19,7 @@ void lv_example_scale_2(void) lv_scale_set_minor_tick_length(scale, 5); lv_scale_set_range(scale, 0, 100); - static char * custom_labels[] = {"0 °C", "25 °C", "50 °C", "75 °C", "100 °C", NULL}; + static const char * custom_labels[] = {"0 °C", "25 °C", "50 °C", "75 °C", "100 °C", NULL}; lv_scale_set_text_src(scale, custom_labels); static lv_style_t indicator_style; @@ -40,7 +40,7 @@ void lv_example_scale_2(void) lv_style_set_line_color(&minor_ticks_style, lv_palette_lighten(LV_PALETTE_BLUE, 2)); lv_style_set_width(&minor_ticks_style, 5U); /*Tick length*/ lv_style_set_line_width(&minor_ticks_style, 2U); /*Tick width*/ - lv_obj_add_style(scale, &minor_ticks_style, LV_PART_ITEMS); + lv_obj_add_style(scale, &minor_ticks_style, LV_PART_TICKS); static lv_style_t main_line_style; lv_style_init(&main_line_style); @@ -78,6 +78,10 @@ void lv_example_scale_2(void) lv_scale_section_set_style(section, LV_PART_INDICATOR, §ion_label_style); lv_scale_section_set_style(section, LV_PART_ITEMS, §ion_minor_tick_style); lv_scale_section_set_style(section, LV_PART_MAIN, §ion_main_line_style); + + + lv_obj_set_style_bg_opa(scale, 40, 0); + lv_obj_set_style_pad_ver(scale, 20, 0); } #endif diff --git a/examples/widgets/scale/lv_example_scale_4.c b/examples/widgets/scale/lv_example_scale_4.c index a3987441f..37f24795e 100644 --- a/examples/widgets/scale/lv_example_scale_4.c +++ b/examples/widgets/scale/lv_example_scale_4.c @@ -9,7 +9,7 @@ void lv_example_scale_4(void) lv_obj_t * scale = lv_scale_create(lv_scr_act()); lv_obj_set_size(scale, 150, 150); lv_scale_set_label_show(scale, true); - lv_scale_set_mode(scale, LV_SCALE_MODE_ROUND_OUTTER); + lv_scale_set_mode(scale, LV_SCALE_MODE_ROUND_OUTER); lv_obj_center(scale); lv_scale_set_total_tick_count(scale, 20); @@ -19,7 +19,7 @@ void lv_example_scale_4(void) lv_scale_set_minor_tick_length(scale, 5); lv_scale_set_range(scale, 0, 100); - static char * custom_labels[] = {"0 °C", "25 °C", "50 °C", "75 °C", "100 °C", NULL}; + static const char * custom_labels[] = {"0 °C", "25 °C", "50 °C", "75 °C", "100 °C", NULL}; lv_scale_set_text_src(scale, custom_labels); static lv_style_t indicator_style; @@ -40,7 +40,7 @@ void lv_example_scale_4(void) lv_style_set_line_color(&minor_ticks_style, lv_palette_lighten(LV_PALETTE_BLUE, 2)); lv_style_set_width(&minor_ticks_style, 5U); /*Tick length*/ lv_style_set_line_width(&minor_ticks_style, 2U); /*Tick width*/ - lv_obj_add_style(scale, &minor_ticks_style, LV_PART_ITEMS); + lv_obj_add_style(scale, &minor_ticks_style, LV_PART_TICKS); static lv_style_t main_line_style; lv_style_init(&main_line_style); diff --git a/examples/widgets/scale/lv_example_scale_5.c b/examples/widgets/scale/lv_example_scale_5.c index 41516ae1b..bad2058d9 100644 --- a/examples/widgets/scale/lv_example_scale_5.c +++ b/examples/widgets/scale/lv_example_scale_5.c @@ -17,7 +17,7 @@ void lv_example_scale_5(void) lv_scale_set_minor_tick_length(scale, 5); lv_scale_set_range(scale, 25, 35); - static char * custom_labels[3] = {"One", "Two", NULL}; + static const char * custom_labels[3] = {"One", "Two", NULL}; lv_scale_set_text_src(scale, custom_labels); static lv_style_t indicator_style; @@ -36,7 +36,7 @@ void lv_example_scale_5(void) lv_style_set_line_color(&minor_ticks_style, lv_color_hex(0xff0000)); lv_style_set_width(&minor_ticks_style, 5U); // Tick length lv_style_set_line_width(&minor_ticks_style, 2U); // Tick width - lv_obj_add_style(scale, &minor_ticks_style, LV_PART_ITEMS); + lv_obj_add_style(scale, &minor_ticks_style, LV_PART_TICKS); static lv_style_t main_line_style; lv_style_init(&main_line_style); diff --git a/lvgl.h b/lvgl.h index e815e0c68..9a35a7787 100644 --- a/lvgl.h +++ b/lvgl.h @@ -64,7 +64,6 @@ extern "C" { #include "src/widgets/line/lv_line.h" #include "src/widgets/list/lv_list.h" #include "src/widgets/menu/lv_menu.h" -#include "src/widgets/meter/lv_meter.h" #include "src/widgets/msgbox/lv_msgbox.h" #include "src/widgets/roller/lv_roller.h" #include "src/widgets/scale/lv_scale.h" diff --git a/src/core/lv_obj_tree.c b/src/core/lv_obj_tree.c index 187de6880..3221c8ed0 100644 --- a/src/core/lv_obj_tree.c +++ b/src/core/lv_obj_tree.c @@ -335,6 +335,13 @@ lv_obj_t * lv_obj_get_child(const lv_obj_t * obj, int32_t id) else return obj->spec_attr->children[id]; } +lv_obj_t * lv_obj_get_sibling(const lv_obj_t * obj, int32_t id) +{ + lv_obj_t * parent = lv_obj_get_parent(obj); + return lv_obj_get_child(parent, (int32_t)lv_obj_get_index(obj) + id); +} + + uint32_t lv_obj_get_child_cnt(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); diff --git a/src/core/lv_obj_tree.h b/src/core/lv_obj_tree.h index 0e1bcca06..6471865e3 100644 --- a/src/core/lv_obj_tree.h +++ b/src/core/lv_obj_tree.h @@ -140,6 +140,19 @@ struct _lv_obj_t * lv_obj_get_parent(const struct _lv_obj_t * obj); */ struct _lv_obj_t * lv_obj_get_child(const struct _lv_obj_t * obj, int32_t id); +/** + * Return a sibling of an object + * @param obj pointer to an object whose sibling should be get + * @param id 0: `obj` itself + * -1: the first older sibling + * -2: the next older sibling + * 1: the first younger sibling + * 2: the next younger sibling + * etc + * @return pointer to the requested sibling or NULL if there is no such sibling + */ +struct _lv_obj_t * lv_obj_get_sibling(const struct _lv_obj_t * obj, int32_t id); + /** * Get the number of children * @param obj pointer to an object diff --git a/src/themes/default/lv_theme_default.c b/src/themes/default/lv_theme_default.c index 5187681b0..b6e619736 100644 --- a/src/themes/default/lv_theme_default.c +++ b/src/themes/default/lv_theme_default.c @@ -653,10 +653,10 @@ static void style_init(struct _my_theme_t * theme) #if LV_USE_SCALE style_init_reset(&theme->styles.scale); - lv_style_set_line_color(&theme->styles.scale, lv_color_black()); - lv_style_set_line_width(&theme->styles.scale, 2U); - lv_style_set_arc_color(&theme->styles.scale, lv_color_black()); - lv_style_set_arc_width(&theme->styles.scale, 2U); + lv_style_set_line_color(&theme->styles.scale, theme->color_grey); + lv_style_set_line_width(&theme->styles.scale, LV_DPX(2)); + lv_style_set_arc_color(&theme->styles.scale, theme->color_grey); + lv_style_set_arc_width(&theme->styles.scale, LV_DPX(2)); #endif } @@ -1209,7 +1209,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj) else if(lv_obj_check_type(obj, &lv_scale_class)) { lv_obj_add_style(obj, &theme->styles.scale, LV_PART_MAIN); lv_obj_add_style(obj, &theme->styles.scale, LV_PART_INDICATOR); - lv_obj_add_style(obj, &theme->styles.scale, LV_PART_ITEMS); + lv_obj_add_style(obj, &theme->styles.scale, LV_PART_TICKS); } #endif } diff --git a/src/widgets/chart/lv_chart.c b/src/widgets/chart/lv_chart.c index 0ae551a02..f96af0c60 100644 --- a/src/widgets/chart/lv_chart.c +++ b/src/widgets/chart/lv_chart.c @@ -37,11 +37,9 @@ static void draw_series_line(lv_obj_t * obj, lv_layer_t * layer); static void draw_series_bar(lv_obj_t * obj, lv_layer_t * layer); static void draw_series_scatter(lv_obj_t * obj, lv_layer_t * layer); static void draw_cursors(lv_obj_t * obj, lv_layer_t * layer); -static void draw_axes(lv_obj_t * obj, lv_layer_t * layer); static uint32_t get_index_from_x(lv_obj_t * obj, lv_coord_t x); static void invalidate_point(lv_obj_t * obj, uint32_t i); static void new_points_alloc(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t cnt, lv_coord_t ** a); -lv_chart_tick_dsc_t * get_tick_gsc(lv_obj_t * obj, lv_chart_axis_t axis); /********************** * STATIC VARIABLES @@ -183,70 +181,6 @@ void lv_chart_set_div_line_count(lv_obj_t * obj, uint8_t hdiv, uint8_t vdiv) lv_obj_invalidate(obj); } - -void lv_chart_set_zoom_x(lv_obj_t * obj, uint32_t zoom_x) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_chart_t * chart = (lv_chart_t *)obj; - if(chart->zoom_x == zoom_x) return; - if(LV_SCALE_NONE > zoom_x) zoom_x = LV_SCALE_NONE; - - chart->zoom_x = zoom_x; - lv_obj_refresh_self_size(obj); - /*Be the chart doesn't remain scrolled out*/ - lv_obj_readjust_scroll(obj, LV_ANIM_OFF); - lv_obj_invalidate(obj); -} - -void lv_chart_set_zoom_y(lv_obj_t * obj, uint32_t zoom_y) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_chart_t * chart = (lv_chart_t *)obj; - if(chart->zoom_y == zoom_y) return; - if(LV_SCALE_NONE > zoom_y) zoom_y = LV_SCALE_NONE; - - chart->zoom_y = zoom_y; - lv_obj_refresh_self_size(obj); - /*Be the chart doesn't remain scrolled out*/ - lv_obj_readjust_scroll(obj, LV_ANIM_OFF); - lv_obj_invalidate(obj); -} - -uint32_t lv_chart_get_zoom_x(const lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_chart_t * chart = (lv_chart_t *)obj; - return chart->zoom_x; -} - -uint32_t lv_chart_get_zoom_y(const lv_obj_t * obj) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_chart_t * chart = (lv_chart_t *)obj; - return chart->zoom_y; -} - -void lv_chart_set_axis_tick(lv_obj_t * obj, lv_chart_axis_t axis, lv_coord_t major_len, lv_coord_t minor_len, - lv_coord_t major_cnt, lv_coord_t minor_cnt, bool label_en, lv_coord_t draw_size) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - - lv_chart_tick_dsc_t * t = get_tick_gsc(obj, axis); - t->major_len = major_len; - t->minor_len = minor_len; - t->minor_cnt = minor_cnt; - t->major_cnt = major_cnt; - t->label_en = label_en; - t->draw_size = draw_size; - - lv_obj_refresh_ext_draw_size(obj); - lv_obj_invalidate(obj); -} - lv_chart_type_t lv_chart_get_type(const lv_obj_t * obj) { LV_ASSERT_OBJ(obj, MY_CLASS); @@ -285,8 +219,8 @@ void lv_chart_get_point_pos_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint3 return; } - lv_coord_t w = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; - lv_coord_t h = ((int32_t)lv_obj_get_content_height(obj) * chart->zoom_y) >> 8; + lv_coord_t w = lv_obj_get_content_width(obj); + lv_coord_t h = lv_obj_get_content_height(obj); if(chart->type == LV_CHART_TYPE_LINE) { p_out->x = (w * id) / (chart->point_cnt - 1); @@ -296,10 +230,10 @@ void lv_chart_get_point_pos_by_id(lv_obj_t * obj, lv_chart_series_t * ser, uint3 } else if(chart->type == LV_CHART_TYPE_BAR) { uint32_t ser_cnt = _lv_ll_get_len(&chart->series_ll); - int32_t ser_gap = ((int32_t)lv_obj_get_style_pad_column(obj, LV_PART_ITEMS) * chart->zoom_x) >> 8; + int32_t ser_gap = lv_obj_get_style_pad_column(obj, LV_PART_ITEMS); /*Gap between the columns on adjacent X ticks*/ - int32_t block_gap = ((int32_t)lv_obj_get_style_pad_column(obj, LV_PART_MAIN) * chart->zoom_x) >> 8; + int32_t block_gap = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); lv_coord_t block_w = (w - ((chart->point_cnt - 1) * block_gap)) / chart->point_cnt; @@ -352,7 +286,7 @@ lv_chart_series_t * lv_chart_add_series(lv_obj_t * obj, lv_color_t color, lv_cha lv_chart_t * chart = (lv_chart_t *)obj; /* Allocate space for a new series and add it to the chart series linked list */ - lv_chart_series_t * ser = _lv_ll_ins_head(&chart->series_ll); + lv_chart_series_t * ser = _lv_ll_ins_tail(&chart->series_ll); LV_ASSERT_MALLOC(ser); if(ser == NULL) return NULL; @@ -656,6 +590,24 @@ uint32_t lv_chart_get_pressed_point(const lv_obj_t * obj) return chart->pressed_point_id; } +int32_t lv_chart_get_first_point_center_offset(lv_obj_t * obj) +{ + lv_chart_t * chart = (lv_chart_t *)obj; + + int32_t x_ofs = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); + if(chart->type == LV_CHART_TYPE_BAR) { + lv_obj_update_layout(obj); + /*Gap between the columns on ~adjacent X*/ + int32_t block_gap = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); + lv_coord_t w = lv_obj_get_content_width(obj); + lv_coord_t block_w = (w + block_gap) / (chart->point_cnt); + + x_ofs += (block_w - block_gap) / 2; + } + + return x_ofs; +} + /********************** * STATIC FUNCTIONS **********************/ @@ -685,8 +637,6 @@ static void lv_chart_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) chart->pressed_point_id = LV_CHART_POINT_NONE; chart->type = LV_CHART_TYPE_LINE; chart->update_mode = LV_CHART_UPDATE_MODE_SHIFT; - chart->zoom_x = LV_SCALE_NONE; - chart->zoom_y = LV_SCALE_NONE; LV_TRACE_OBJ_CREATE("finished"); } @@ -753,22 +703,9 @@ static void lv_chart_event(const lv_obj_class_t * class_p, lv_event_t * e) invalidate_point(obj, chart->pressed_point_id); chart->pressed_point_id = LV_CHART_POINT_NONE; } - else if(code == LV_EVENT_SIZE_CHANGED) { - lv_obj_refresh_self_size(obj); - } - else if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) { - lv_event_set_ext_draw_size(e, LV_MAX4(chart->tick[0].draw_size, chart->tick[1].draw_size, chart->tick[2].draw_size, - chart->tick[3].draw_size)); - } - else if(code == LV_EVENT_GET_SELF_SIZE) { - lv_point_t * p = lv_event_get_param(e); - p->x = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; - p->y = ((int32_t)lv_obj_get_content_height(obj) * chart->zoom_y) >> 8; - } else if(code == LV_EVENT_DRAW_MAIN) { lv_layer_t * layer = lv_event_get_layer(e); draw_div_lines(obj, layer); - draw_axes(obj, layer); if(_lv_ll_is_empty(&chart->series_ll) == false) { if(chart->type == LV_CHART_TYPE_LINE) draw_series_line(obj, layer); @@ -797,8 +734,8 @@ static void draw_div_lines(lv_obj_t * obj, lv_layer_t * layer) lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width; lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + border_width; - lv_coord_t w = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; - lv_coord_t h = ((int32_t)lv_obj_get_content_height(obj) * chart->zoom_y) >> 8; + lv_coord_t w = lv_obj_get_content_width(obj); + lv_coord_t h = lv_obj_get_content_height(obj); lv_draw_line_dsc_t line_dsc; lv_draw_line_dsc_init(&line_dsc); @@ -869,8 +806,8 @@ static void draw_series_line(lv_obj_t * obj, lv_layer_t * layer) lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + border_width; lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN) + border_width; - lv_coord_t w = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; - lv_coord_t h = ((int32_t)lv_obj_get_content_height(obj) * chart->zoom_y) >> 8; + lv_coord_t w = lv_obj_get_content_width(obj); + lv_coord_t h = lv_obj_get_content_height(obj); lv_coord_t x_ofs = obj->coords.x1 + pad_left - lv_obj_get_scroll_left(obj); lv_coord_t y_ofs = obj->coords.y1 + pad_top - lv_obj_get_scroll_top(obj); lv_chart_series_t * ser; @@ -1016,8 +953,8 @@ static void draw_series_scatter(lv_obj_t * obj, lv_layer_t * layer) lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); - lv_coord_t w = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; - lv_coord_t h = ((int32_t)lv_obj_get_content_height(obj) * chart->zoom_y) >> 8; + lv_coord_t w = lv_obj_get_content_width(obj); + lv_coord_t h = lv_obj_get_content_height(obj); lv_coord_t x_ofs = obj->coords.x1 + pad_left + border_width - lv_obj_get_scroll_left(obj); lv_coord_t y_ofs = obj->coords.y1 + pad_top + border_width - lv_obj_get_scroll_top(obj); lv_chart_series_t * ser; @@ -1136,16 +1073,14 @@ static void draw_series_bar(lv_obj_t * obj, lv_layer_t * layer) lv_area_t col_a; lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); - lv_coord_t w = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; - lv_coord_t h = ((int32_t)lv_obj_get_content_height(obj) * chart->zoom_y) >> 8; + lv_coord_t w = lv_obj_get_content_width(obj); + lv_coord_t h = lv_obj_get_content_height(obj); int32_t y_tmp; lv_chart_series_t * ser; uint32_t ser_cnt = _lv_ll_get_len(&chart->series_ll); - int32_t block_gap = ((int32_t)lv_obj_get_style_pad_column(obj, - LV_PART_MAIN) * chart->zoom_x) >> 8; /*Gap between the column on ~adjacent X*/ + int32_t block_gap = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); /*Gap between the column on ~adjacent X*/ lv_coord_t block_w = (w - ((chart->point_cnt - 1) * block_gap)) / chart->point_cnt; - int32_t ser_gap = ((int32_t)lv_obj_get_style_pad_column(obj, - LV_PART_ITEMS) * chart->zoom_x) >> 8; /*Gap between the columns on the ~same X*/ + int32_t ser_gap = lv_obj_get_style_pad_column(obj, LV_PART_ITEMS); /*Gap between the columns on the ~same X*/ lv_coord_t col_w = (block_w - (ser_cnt - 1) * ser_gap) / ser_cnt; if(col_w < 1) col_w = 1; @@ -1169,7 +1104,7 @@ static void draw_series_bar(lv_obj_t * obj, lv_layer_t * layer) col_dsc.base.id1 = 0; /*Draw the current point of all data line*/ - _LV_LL_READ_BACK(&chart->series_ll, ser) { + _LV_LL_READ(&chart->series_ll, ser) { if(ser->hidden) continue; lv_coord_t start_point = lv_chart_get_x_start_point(obj, ser); @@ -1295,240 +1230,6 @@ static void draw_cursors(lv_obj_t * obj, lv_layer_t * layer) layer->clip_area = clip_area_ori; } -static void draw_y_ticks(lv_obj_t * obj, lv_layer_t * layer, lv_chart_axis_t axis) -{ - lv_chart_t * chart = (lv_chart_t *)obj; - - lv_chart_tick_dsc_t * t = get_tick_gsc(obj, axis); - - if(t->major_cnt <= 1) return; - if(!t->label_en && !t->major_len && !t->minor_len) return; - - uint8_t sec_axis = axis == LV_CHART_AXIS_PRIMARY_Y ? 0 : 1; - - uint32_t i; - - lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN); - lv_coord_t pad_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN); - lv_coord_t h = ((int32_t)lv_obj_get_content_height(obj) * chart->zoom_y) >> 8; - lv_coord_t y_ofs = obj->coords.y1 + pad_top + border_width - lv_obj_get_scroll_top(obj); - - lv_coord_t label_gap; - lv_coord_t x_ofs; - if(axis == LV_CHART_AXIS_PRIMARY_Y) { - label_gap = lv_obj_get_style_pad_left(obj, LV_PART_TICKS); - x_ofs = obj->coords.x1; - } - else { - label_gap = lv_obj_get_style_pad_right(obj, LV_PART_TICKS); - x_ofs = obj->coords.x2; - } - - lv_coord_t major_len = t->major_len; - lv_coord_t minor_len = t->minor_len; - /*tick lines on secondary y axis are drawn in other direction*/ - if(axis == LV_CHART_AXIS_SECONDARY_Y) { - major_len *= -1; - minor_len *= -1; - } - - lv_draw_line_dsc_t line_dsc; - lv_draw_line_dsc_init(&line_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_TICKS, &line_dsc); - - lv_draw_label_dsc_t label_dsc; - lv_draw_label_dsc_init(&label_dsc); - lv_obj_init_draw_label_dsc(obj, LV_PART_TICKS, &label_dsc); - - uint32_t total_tick_num = (t->major_cnt - 1) * (t->minor_cnt); - for(i = 0; i <= total_tick_num; i++) { - /*draw a line at moving y position*/ - line_dsc.p2.y = line_dsc.p1.y = y_ofs + (int32_t)((int32_t)(h - line_dsc.width) * i) / total_tick_num; - - /*first point of the tick*/ - line_dsc.p1.x = x_ofs; - - /*move extra pixel out of chart boundary*/ - if(axis == LV_CHART_AXIS_PRIMARY_Y) line_dsc.p1.x--; - else line_dsc.p1.x++; - - /*second point of the tick*/ - bool major = false; - if(i % t->minor_cnt == 0) major = true; - - if(major) line_dsc.p2.x = line_dsc.p1.x - major_len; /*major tick*/ - else line_dsc.p2.x = line_dsc.p1.x - minor_len; /*minor tick*/ - - int32_t tick_value = lv_map(total_tick_num - i, 0, total_tick_num, chart->ymin[sec_axis], chart->ymax[sec_axis]); - - /*add text only to major tick*/ - if(major && t->label_en) { - char buf[LV_CHART_LABEL_MAX_TEXT_LENGTH]; - lv_snprintf(buf, sizeof(buf), "%" LV_PRId32, tick_value); - - label_dsc.text = buf; - label_dsc.text_local = true; - - /*reserve appropriate area*/ - lv_point_t size; - lv_text_get_size(&size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, - LV_TEXT_FLAG_NONE); - - /*set the area at some distance of the major tick len left of the tick*/ - lv_area_t a; - a.y1 = line_dsc.p2.y - size.y / 2; - a.y2 = line_dsc.p2.y + size.y / 2; - - if(!sec_axis) { - a.x1 = line_dsc.p2.x - size.x - label_gap; - a.x2 = line_dsc.p2.x - label_gap; - } - else { - a.x1 = line_dsc.p2.x + label_gap; - a.x2 = line_dsc.p2.x + size.x + label_gap; - } - - if(a.y2 >= obj->coords.y1 && - a.y1 <= obj->coords.y2) { - lv_draw_label(layer, &label_dsc, &a); - } - } - - if(line_dsc.p1.y + line_dsc.width / 2 >= obj->coords.y1 && - line_dsc.p2.y - line_dsc.width / 2 <= obj->coords.y2) { - lv_draw_line(layer, &line_dsc); - } - } -} - -static void draw_x_ticks(lv_obj_t * obj, lv_layer_t * layer, lv_chart_axis_t axis) -{ - lv_chart_t * chart = (lv_chart_t *)obj; - - lv_chart_tick_dsc_t * t = get_tick_gsc(obj, axis); - if(t->major_cnt <= 1) return; - if(!t->label_en && !t->major_len && !t->minor_len) return; - - uint32_t i; - - lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN) + lv_obj_get_style_border_width(obj, LV_PART_MAIN); - lv_coord_t w = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; - - lv_draw_label_dsc_t label_dsc; - lv_draw_label_dsc_init(&label_dsc); - lv_obj_init_draw_label_dsc(obj, LV_PART_TICKS, &label_dsc); - label_dsc.base.id1 = axis; - - lv_coord_t x_ofs = obj->coords.x1 + pad_left - lv_obj_get_scroll_left(obj); - lv_coord_t y_ofs; - lv_coord_t label_gap; - if(axis == LV_CHART_AXIS_PRIMARY_X) { - label_gap = t->label_en ? lv_obj_get_style_pad_bottom(obj, LV_PART_TICKS) : 0; - y_ofs = obj->coords.y2 + 1; - } - else { - label_gap = t->label_en ? lv_obj_get_style_pad_top(obj, LV_PART_TICKS) : 0; - y_ofs = obj->coords.y1 - 1; - } - - if(axis == LV_CHART_AXIS_PRIMARY_X) { - if(y_ofs > layer->clip_area.y2) return; - if(y_ofs + label_gap + label_dsc.font->line_height + t->major_len < layer->clip_area.y1) return; - } - - lv_draw_line_dsc_t line_dsc; - lv_draw_line_dsc_init(&line_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_TICKS, &line_dsc); - line_dsc.dash_gap = 0; - line_dsc.dash_width = 0; - line_dsc.base.id1 = axis; - - uint8_t sec_axis = axis == LV_CHART_AXIS_PRIMARY_X ? 0 : 1; - - /*The columns ticks should be aligned to the center of blocks*/ - if(chart->type == LV_CHART_TYPE_BAR) { - int32_t block_gap = ((int32_t)lv_obj_get_style_pad_column(obj, - LV_PART_MAIN) * chart->zoom_x) >> 8; /*Gap between the columns on ~adjacent X*/ - lv_coord_t block_w = (w + block_gap) / (chart->point_cnt); - - x_ofs += (block_w - block_gap) / 2; - w -= block_w - block_gap; - } - - line_dsc.p1.y = y_ofs; - uint32_t total_tick_num; - if(chart->type == LV_CHART_TYPE_LINE && - ((uint32_t)((t->major_cnt - 1) * t->minor_cnt) == chart->point_cnt)) { - total_tick_num = chart->point_cnt - 1; - } - else { - total_tick_num = (t->major_cnt - 1) * t->minor_cnt; - } - if(!total_tick_num) return; /*Ensure total_tick_num is not equal to zero*/ - for(i = 0; i <= total_tick_num; i++) { /*one extra loop - it may not exist in the list, empty label*/ - bool major = false; - if(i % t->minor_cnt == 0) major = true; - - /*draw a line at moving x position*/ - line_dsc.p2.x = line_dsc.p1.x = x_ofs + (int32_t)((int32_t)(w - line_dsc.width) * i) / total_tick_num; - - if(sec_axis) line_dsc.p2.y = line_dsc.p1.y - (major ? t->major_len : t->minor_len); - else line_dsc.p2.y = line_dsc.p1.y + (major ? t->major_len : t->minor_len); - - /*add text only to major tick*/ - int32_t tick_value; - if(chart->type == LV_CHART_TYPE_SCATTER) { - tick_value = lv_map(i, 0, total_tick_num, chart->xmin[sec_axis], chart->xmax[sec_axis]); - } - else { - tick_value = i / t->minor_cnt; - } - - line_dsc.base.id2 = i; - if(major && t->label_en) { - char buf[LV_CHART_LABEL_MAX_TEXT_LENGTH]; - lv_snprintf(buf, sizeof(buf), "%" LV_PRId32, tick_value); - label_dsc.text = buf; - label_dsc.text_local = true; - /*reserve appropriate area*/ - lv_point_t size; - lv_text_get_size(&size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX, - LV_TEXT_FLAG_NONE); - - /*set the area at some distance of the major tick len under of the tick*/ - lv_area_t a; - a.x1 = (line_dsc.p2.x - size.x / 2); - a.x2 = (line_dsc.p2.x + size.x / 2); - if(sec_axis) { - a.y2 = line_dsc.p2.y - label_gap; - a.y1 = a.y2 - size.y; - } - else { - a.y1 = line_dsc.p2.y + label_gap; - a.y2 = a.y1 + size.y; - } - - if(a.x2 >= obj->coords.x1 && - a.x1 <= obj->coords.x2) { - label_dsc.base.id2 = i; - lv_draw_label(layer, &label_dsc, &a); - } - } - - if(line_dsc.p1.x + line_dsc.width / 2 >= obj->coords.x1 && - line_dsc.p2.x - line_dsc.width / 2 <= obj->coords.x2) { - lv_draw_line(layer, &line_dsc); - } - } -} - -static void draw_axes(lv_obj_t * obj, lv_layer_t * layer) -{ - draw_y_ticks(obj, layer, LV_CHART_AXIS_PRIMARY_Y); - draw_y_ticks(obj, layer, LV_CHART_AXIS_SECONDARY_Y); - draw_x_ticks(obj, layer, LV_CHART_AXIS_PRIMARY_X); - draw_x_ticks(obj, layer, LV_CHART_AXIS_SECONDARY_X); -} /** * Get the nearest index to an X coordinate @@ -1539,7 +1240,7 @@ static void draw_axes(lv_obj_t * obj, lv_layer_t * layer) static uint32_t get_index_from_x(lv_obj_t * obj, lv_coord_t x) { lv_chart_t * chart = (lv_chart_t *)obj; - lv_coord_t w = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; + lv_coord_t w = lv_obj_get_content_width(obj); lv_coord_t pad_left = lv_obj_get_style_pad_left(obj, LV_PART_MAIN); x -= pad_left; @@ -1556,7 +1257,7 @@ static void invalidate_point(lv_obj_t * obj, uint32_t i) lv_chart_t * chart = (lv_chart_t *)obj; if(i >= chart->point_cnt) return; - lv_coord_t w = ((int32_t)lv_obj_get_content_width(obj) * chart->zoom_x) >> 8; + lv_coord_t w = lv_obj_get_content_width(obj); lv_coord_t scroll_left = lv_obj_get_scroll_left(obj); /*In shift mode the whole chart changes so the whole object*/ @@ -1591,8 +1292,8 @@ static void invalidate_point(lv_obj_t * obj, uint32_t i) } else if(chart->type == LV_CHART_TYPE_BAR) { lv_area_t col_a; - int32_t block_gap = ((int32_t)lv_obj_get_style_pad_column(obj, - LV_PART_MAIN) * chart->zoom_x) >> 8; /*Gap between the column on ~adjacent X*/ + /*Gap between the column on ~adjacent X*/ + int32_t block_gap = lv_obj_get_style_pad_column(obj, LV_PART_MAIN); lv_coord_t block_w = (w + block_gap) / chart->point_cnt; @@ -1659,22 +1360,5 @@ static void new_points_alloc(lv_obj_t * obj, lv_chart_series_t * ser, uint32_t c } } -lv_chart_tick_dsc_t * get_tick_gsc(lv_obj_t * obj, lv_chart_axis_t axis) -{ - lv_chart_t * chart = (lv_chart_t *) obj; - switch(axis) { - case LV_CHART_AXIS_PRIMARY_Y: - return &chart->tick[0]; - case LV_CHART_AXIS_PRIMARY_X: - return &chart->tick[1]; - case LV_CHART_AXIS_SECONDARY_Y: - return &chart->tick[2]; - case LV_CHART_AXIS_SECONDARY_X: - return &chart->tick[3]; - default: - return NULL; - } -} - #endif diff --git a/src/widgets/chart/lv_chart.h b/src/widgets/chart/lv_chart.h index 4d986d43a..f301abcfb 100644 --- a/src/widgets/chart/lv_chart.h +++ b/src/widgets/chart/lv_chart.h @@ -107,21 +107,11 @@ typedef struct { uint32_t pos_set: 1; /*1: pos is set; 0: point_id is set*/ } lv_chart_cursor_t; -typedef struct { - lv_coord_t major_len; - lv_coord_t minor_len; - lv_coord_t draw_size; - uint32_t minor_cnt : 15; - uint32_t major_cnt : 15; - uint32_t label_en : 1; -} lv_chart_tick_dsc_t; - typedef struct { lv_obj_t obj; lv_ll_t series_ll; /**< Linked list for the series (stores lv_chart_series_t)*/ lv_ll_t cursor_ll; /**< Linked list for the cursors (stores lv_chart_cursor_t)*/ - lv_chart_tick_dsc_t tick[4]; lv_coord_t ymin[2]; lv_coord_t ymax[2]; lv_coord_t xmin[2]; @@ -130,8 +120,6 @@ typedef struct { uint32_t hdiv_cnt; /**< Number of horizontal division lines*/ uint32_t vdiv_cnt; /**< Number of vertical division lines*/ uint32_t point_cnt; /**< Point number in a data line*/ - uint32_t zoom_x; - uint32_t zoom_y; lv_chart_type_t type : 3; /**< Line or column chart*/ lv_chart_update_mode_t update_mode : 1; } lv_chart_t; @@ -451,6 +439,14 @@ lv_coord_t * lv_chart_get_x_array(const lv_obj_t * obj, lv_chart_series_t * ser) */ uint32_t lv_chart_get_pressed_point(const lv_obj_t * obj); +/** + * Get the overall offset from the chart's side to the center of the first point. + * In case of a bar chart it will be the center of the first column group + * @param obj pointer to a chart object + * @return the offset of the center + */ +int32_t lv_chart_get_first_point_center_offset(lv_obj_t * obj); + /********************** * MACROS **********************/ diff --git a/src/widgets/meter/lv_meter.c b/src/widgets/meter/lv_meter.c deleted file mode 100644 index 962c43498..000000000 --- a/src/widgets/meter/lv_meter.c +++ /dev/null @@ -1,625 +0,0 @@ -/** - * @file lv_meter.c - * - */ - -/********************* - * INCLUDES - *********************/ -#include "lv_meter.h" -#if LV_USE_METER != 0 - -#include "../../misc/lv_assert.h" -#include "../../misc/lv_color.h" -#include "../../stdlib/lv_sprintf.h" - -/********************* - * DEFINES - *********************/ -#define MY_CLASS &lv_meter_class - -/********************** - * TYPEDEFS - **********************/ - -/********************** - * STATIC PROTOTYPES - **********************/ -static void lv_meter_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void lv_meter_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj); -static void lv_meter_event(const lv_obj_class_t * class_p, lv_event_t * e); -static void draw_arcs(lv_obj_t * obj, lv_layer_t * layer, const lv_area_t * scale_area); -static void draw_ticks_and_labels(lv_obj_t * obj, lv_layer_t * layer, const lv_area_t * scale_area); -static void draw_needles(lv_obj_t * obj, lv_layer_t * layer, const lv_area_t * scale_area); -static void inv_arc(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t old_value, int32_t new_value); -static void inv_line(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value); - -/********************** - * STATIC VARIABLES - **********************/ - -const lv_obj_class_t lv_meter_class = { - .constructor_cb = lv_meter_constructor, - .destructor_cb = lv_meter_destructor, - .event_cb = lv_meter_event, - .instance_size = sizeof(lv_meter_t), - .base_class = &lv_obj_class, - .name = "meter", -}; - -/********************** - * MACROS - **********************/ - -/********************** - * GLOBAL FUNCTIONS - **********************/ - -lv_obj_t * lv_meter_create(lv_obj_t * parent) -{ - LV_LOG_INFO("begin"); - lv_obj_t * obj = lv_obj_class_create_obj(MY_CLASS, parent); - lv_obj_class_init_obj(obj); - return obj; -} - -/*===================== - * Add scale - *====================*/ - -void lv_meter_set_scale_ticks(lv_obj_t * obj, uint16_t cnt, uint16_t width, uint16_t len, - lv_color_t color) -{ - lv_meter_t * meter = (lv_meter_t *)obj; - meter->scale.tick_cnt = cnt; - meter->scale.tick_width = width; - meter->scale.tick_length = len; - meter->scale.tick_color = color; - lv_obj_invalidate(obj); -} - -void lv_meter_set_scale_major_ticks(lv_obj_t * obj, uint16_t nth, uint16_t width, - uint16_t len, lv_color_t color, int16_t label_gap) -{ - lv_meter_t * meter = (lv_meter_t *)obj; - meter->scale.tick_major_nth = nth; - meter->scale.tick_major_width = width; - meter->scale.tick_major_length = len; - meter->scale.tick_major_color = color; - meter->scale.label_gap = label_gap; - lv_obj_invalidate(obj); -} - -void lv_meter_set_scale_range(lv_obj_t * obj, int32_t min, int32_t max, uint32_t angle_range, - uint32_t rotation) -{ - lv_meter_t * meter = (lv_meter_t *)obj; - meter->scale.min = min; - meter->scale.max = max; - meter->scale.angle_range = angle_range; - meter->scale.rotation = rotation; - lv_obj_invalidate(obj); -} - -/*===================== - * Add indicator - *====================*/ - -lv_meter_indicator_t * lv_meter_add_needle_line(lv_obj_t * obj, uint16_t width, - lv_color_t color, int16_t r_mod) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_meter_t * meter = (lv_meter_t *)obj; - lv_meter_indicator_t * indic = _lv_ll_ins_head(&meter->indicator_ll); - LV_ASSERT_MALLOC(indic); - if(NULL == indic) { - return NULL; - } - - lv_memzero(indic, sizeof(lv_meter_indicator_t)); - indic->opa = LV_OPA_COVER; - - indic->type = LV_METER_INDICATOR_TYPE_NEEDLE_LINE; - indic->type_data.needle_line.width = width; - indic->type_data.needle_line.color = color; - indic->type_data.needle_line.r_mod = r_mod; - lv_obj_invalidate(obj); - - return indic; -} - -lv_meter_indicator_t * lv_meter_add_needle_image(lv_obj_t * obj, const void * src, - lv_coord_t pivot_x, lv_coord_t pivot_y) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_meter_t * meter = (lv_meter_t *)obj; - lv_meter_indicator_t * indic = _lv_ll_ins_head(&meter->indicator_ll); - LV_ASSERT_MALLOC(indic); - if(NULL == indic) { - return NULL; - } - - lv_memzero(indic, sizeof(lv_meter_indicator_t)); - indic->opa = LV_OPA_COVER; - - indic->type = LV_METER_INDICATOR_TYPE_NEEDLE_IMG; - indic->type_data.needle_img.src = src; - indic->type_data.needle_img.pivot.x = pivot_x; - indic->type_data.needle_img.pivot.y = pivot_y; - lv_obj_invalidate(obj); - - return indic; -} - -lv_meter_indicator_t * lv_meter_add_arc(lv_obj_t * obj, uint16_t width, lv_color_t color, - int16_t r_mod) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_meter_t * meter = (lv_meter_t *)obj; - lv_meter_indicator_t * indic = _lv_ll_ins_head(&meter->indicator_ll); - LV_ASSERT_MALLOC(indic); - if(NULL == indic) { - return NULL; - } - - lv_memzero(indic, sizeof(lv_meter_indicator_t)); - indic->opa = LV_OPA_COVER; - - indic->type = LV_METER_INDICATOR_TYPE_ARC; - indic->type_data.arc.width = width; - indic->type_data.arc.color = color; - indic->type_data.arc.r_mod = r_mod; - - lv_obj_invalidate(obj); - return indic; -} - -lv_meter_indicator_t * lv_meter_add_scale_lines(lv_obj_t * obj, lv_color_t color_start, - lv_color_t color_end, bool local, int16_t width_mod) -{ - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_meter_t * meter = (lv_meter_t *)obj; - lv_meter_indicator_t * indic = _lv_ll_ins_head(&meter->indicator_ll); - LV_ASSERT_MALLOC(indic); - if(NULL == indic) { - return NULL; - } - - lv_memzero(indic, sizeof(lv_meter_indicator_t)); - indic->opa = LV_OPA_COVER; - - indic->type = LV_METER_INDICATOR_TYPE_SCALE_LINES; - indic->type_data.scale_lines.color_start = color_start; - indic->type_data.scale_lines.color_end = color_end; - indic->type_data.scale_lines.local_grad = local; - indic->type_data.scale_lines.width_mod = width_mod; - - lv_obj_invalidate(obj); - return indic; -} - -/*===================== - * Set indicator value - *====================*/ - -void lv_meter_set_indicator_value(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value) -{ - int32_t old_start = indic->start_value; - int32_t old_end = indic->end_value; - indic->start_value = value; - indic->end_value = value; - - if(indic->type == LV_METER_INDICATOR_TYPE_ARC) { - inv_arc(obj, indic, old_start, value); - inv_arc(obj, indic, old_end, value); - } - else if(indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_IMG || indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_LINE) { - inv_line(obj, indic, old_start); - inv_line(obj, indic, old_end); - inv_line(obj, indic, value); - } - else { - lv_obj_invalidate(obj); - } -} - -void lv_meter_set_indicator_start_value(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value) -{ - int32_t old_value = indic->start_value; - indic->start_value = value; - - if(indic->type == LV_METER_INDICATOR_TYPE_ARC) { - inv_arc(obj, indic, old_value, value); - } - else if(indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_IMG || indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_LINE) { - inv_line(obj, indic, old_value); - inv_line(obj, indic, value); - } - else { - lv_obj_invalidate(obj); - } -} - -void lv_meter_set_indicator_end_value(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value) -{ - int32_t old_value = indic->end_value; - indic->end_value = value; - - if(indic->type == LV_METER_INDICATOR_TYPE_ARC) { - inv_arc(obj, indic, old_value, value); - } - else if(indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_IMG || indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_LINE) { - inv_line(obj, indic, old_value); - inv_line(obj, indic, value); - } - else { - lv_obj_invalidate(obj); - } -} - -/********************** - * STATIC FUNCTIONS - **********************/ - -static void lv_meter_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - LV_TRACE_OBJ_CREATE("begin"); - - lv_meter_t * meter = (lv_meter_t *)obj; - - _lv_ll_init(&meter->indicator_ll, sizeof(lv_meter_indicator_t)); - - meter->scale.angle_range = 270; - meter->scale.rotation = 90 + (360 - meter->scale.angle_range) / 2; - meter->scale.min = 0; - meter->scale.max = 100; - meter->scale.tick_cnt = 6; - meter->scale.tick_length = 8; - meter->scale.tick_width = 2; - meter->scale.label_gap = 2; - - - LV_TRACE_OBJ_CREATE("finished"); -} - -static void lv_meter_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj) -{ - LV_UNUSED(class_p); - LV_ASSERT_OBJ(obj, MY_CLASS); - lv_meter_t * meter = (lv_meter_t *)obj; - - lv_meter_indicator_t * indic; - _LV_LL_READ_BACK(&meter->indicator_ll, indic) { - lv_anim_del(indic, NULL); - } - - _lv_ll_clear(&meter->indicator_ll); -} - -static void lv_meter_event(const lv_obj_class_t * class_p, lv_event_t * e) -{ - LV_UNUSED(class_p); - - lv_result_t res = lv_obj_event_base(MY_CLASS, e); - if(res != LV_RESULT_OK) return; - - lv_event_code_t code = lv_event_get_code(e); - lv_obj_t * obj = lv_event_get_target(e); - if(code == LV_EVENT_DRAW_MAIN) { - lv_layer_t * layer = lv_event_get_layer(e); - lv_area_t scale_area; - lv_obj_get_content_coords(obj, &scale_area); - - draw_arcs(obj, layer, &scale_area); - draw_ticks_and_labels(obj, layer, &scale_area); - draw_needles(obj, layer, &scale_area); - - lv_coord_t r_edge = lv_area_get_width(&scale_area) / 2; - lv_point_t scale_center; - scale_center.x = scale_area.x1 + r_edge; - scale_center.y = scale_area.y1 + r_edge; - - lv_draw_rect_dsc_t mid_dsc; - lv_draw_rect_dsc_init(&mid_dsc); - lv_obj_init_draw_rect_dsc(obj, LV_PART_INDICATOR, &mid_dsc); - lv_coord_t w = lv_obj_get_style_width(obj, LV_PART_INDICATOR) / 2; - lv_coord_t h = lv_obj_get_style_height(obj, LV_PART_INDICATOR) / 2; - lv_area_t nm_cord; - nm_cord.x1 = scale_center.x - w; - nm_cord.y1 = scale_center.y - h; - nm_cord.x2 = scale_center.x + w; - nm_cord.y2 = scale_center.y + h; - lv_draw_rect(layer, &mid_dsc, &nm_cord); - } -} - -static void draw_arcs(lv_obj_t * obj, lv_layer_t * layer, const lv_area_t * scale_area) -{ - lv_meter_t * meter = (lv_meter_t *)obj; - - lv_draw_arc_dsc_t arc_dsc; - lv_draw_arc_dsc_init(&arc_dsc); - arc_dsc.rounded = lv_obj_get_style_arc_rounded(obj, LV_PART_ITEMS); - - lv_coord_t r_out = lv_area_get_width(scale_area) / 2 ; - lv_point_t scale_center; - scale_center.x = scale_area->x1 + r_out; - scale_center.y = scale_area->y1 + r_out; - - lv_opa_t opa_main = lv_obj_get_style_opa_recursive(obj, LV_PART_MAIN); - lv_meter_indicator_t * indic; - - _LV_LL_READ_BACK(&meter->indicator_ll, indic) { - if(indic->type != LV_METER_INDICATOR_TYPE_ARC) continue; - - arc_dsc.color = indic->type_data.arc.color; - arc_dsc.img_src = indic->type_data.arc.src; - arc_dsc.width = indic->type_data.arc.width; - arc_dsc.opa = indic->opa > LV_OPA_MAX ? opa_main : (opa_main * indic->opa) >> 8; - - int32_t start_angle = lv_map(indic->start_value, meter->scale.min, meter->scale.max, meter->scale.rotation, - meter->scale.rotation + meter->scale.angle_range); - int32_t end_angle = lv_map(indic->end_value, meter->scale.min, meter->scale.max, meter->scale.rotation, - meter->scale.rotation + meter->scale.angle_range); - - lv_coord_t radius = r_out + indic->type_data.arc.r_mod; - - arc_dsc.center = scale_center; - arc_dsc.radius = radius; - arc_dsc.start_angle = start_angle; - arc_dsc.end_angle = end_angle; - lv_draw_arc(layer, &arc_dsc); - } -} - -static void draw_ticks_and_labels(lv_obj_t * obj, lv_layer_t * layer, const lv_area_t * scale_area) -{ - lv_meter_t * meter = (lv_meter_t *)obj; - - lv_point_t p_center; - lv_coord_t r_edge = LV_MIN(lv_area_get_width(scale_area) / 2, lv_area_get_height(scale_area) / 2); - p_center.x = scale_area->x1 + r_edge; - p_center.y = scale_area->y1 + r_edge; - - lv_draw_line_dsc_t line_dsc; - lv_draw_line_dsc_init(&line_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_TICKS, &line_dsc); - - lv_draw_label_dsc_t label_dsc; - lv_draw_label_dsc_init(&label_dsc); - lv_obj_init_draw_label_dsc(obj, LV_PART_TICKS, &label_dsc); - - lv_coord_t r_out = r_edge; - lv_coord_t r_in_major = r_out - meter->scale.tick_major_length; - lv_coord_t r_in_minor = r_out - meter->scale.tick_length; - - uint32_t minor_cnt = meter->scale.tick_major_nth ? meter->scale.tick_major_nth - 1 : 0xFFFF; - uint16_t i; - for(i = 0; i < meter->scale.tick_cnt; i++) { - minor_cnt++; - bool major = false; - if(minor_cnt == meter->scale.tick_major_nth) { - minor_cnt = 0; - major = true; - } - - int32_t value_of_line = lv_map(i, 0, meter->scale.tick_cnt - 1, meter->scale.min, meter->scale.max); - lv_color_t line_color = major ? meter->scale.tick_major_color : meter->scale.tick_color; - lv_coord_t line_width = major ? meter->scale.tick_major_width : meter->scale.tick_width; - - lv_meter_indicator_t * indic; - _LV_LL_READ_BACK(&meter->indicator_ll, indic) { - if(indic->type != LV_METER_INDICATOR_TYPE_SCALE_LINES) continue; - if(value_of_line >= indic->start_value && value_of_line <= indic->end_value) { - line_width += indic->type_data.scale_lines.width_mod; - - if(lv_color_eq(indic->type_data.scale_lines.color_start, indic->type_data.scale_lines.color_end)) { - line_color = indic->type_data.scale_lines.color_start; - } - else { - lv_opa_t ratio; - if(indic->type_data.scale_lines.local_grad) { - ratio = lv_map(value_of_line, indic->start_value, indic->end_value, LV_OPA_TRANSP, LV_OPA_COVER); - } - else { - ratio = lv_map(value_of_line, meter->scale.min, meter->scale.max, LV_OPA_TRANSP, LV_OPA_COVER); - } - line_color = lv_color_mix(indic->type_data.scale_lines.color_end, indic->type_data.scale_lines.color_start, ratio); - } - } - } - - int32_t angle_upscale = ((i * meter->scale.angle_range) * 10) / (meter->scale.tick_cnt - 1); - angle_upscale += meter->scale.rotation * 10; - - line_dsc.color = line_color; - line_dsc.width = line_width; - - /*Draw a little bit longer lines to be sure the mask will clip them correctly - *and to get a better precision*/ - lv_point_t p_outer; - p_outer.x = p_center.x + r_out; - p_outer.y = p_center.y; - lv_point_transform(&p_outer, angle_upscale, 256, &p_center); - - lv_point_t p_inner; - p_inner.x = p_center.x + (major ? r_in_major : r_in_minor); - p_inner.y = p_center.y; - lv_point_transform(&p_inner, angle_upscale, 256, &p_center); - - /*Draw the text*/ - if(major) { - uint32_t r_text = r_in_major - meter->scale.label_gap; - lv_point_t p; - p.x = p_center.x + r_text; - p.y = p_center.y; - lv_point_transform(&p, angle_upscale, 256, &p_center); - - lv_draw_label_dsc_t label_dsc_tmp; - lv_memcpy(&label_dsc_tmp, &label_dsc, sizeof(label_dsc_tmp)); - - char buf[16]; - - lv_snprintf(buf, sizeof(buf), "%" LV_PRId32, value_of_line); - - lv_point_t label_size; - label_dsc_tmp.text = buf; - lv_text_get_size(&label_size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, - LV_COORD_MAX, LV_TEXT_FLAG_NONE); - - lv_area_t label_cord; - label_cord.x1 = p.x - label_size.x / 2; - label_cord.y1 = p.y - label_size.y / 2; - label_cord.x2 = label_cord.x1 + label_size.x; - label_cord.y2 = label_cord.y1 + label_size.y; - - lv_draw_label(layer, &label_dsc, &label_cord); - } - - line_dsc.p1 = p_outer; - line_dsc.p2 = p_inner; - lv_draw_line(layer, &line_dsc); - } -} - - -static void draw_needles(lv_obj_t * obj, lv_layer_t * layer, const lv_area_t * scale_area) -{ - lv_meter_t * meter = (lv_meter_t *)obj; - - lv_coord_t r_edge = lv_area_get_width(scale_area) / 2; - lv_point_t scale_center; - scale_center.x = scale_area->x1 + r_edge; - scale_center.y = scale_area->y1 + r_edge; - - lv_draw_line_dsc_t line_dsc; - lv_draw_line_dsc_init(&line_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_ITEMS, &line_dsc); - - lv_draw_image_dsc_t img_dsc; - lv_draw_image_dsc_init(&img_dsc); - lv_obj_init_draw_image_dsc(obj, LV_PART_ITEMS, &img_dsc); - lv_opa_t opa_main = lv_obj_get_style_opa_recursive(obj, LV_PART_MAIN); - - lv_meter_indicator_t * indic; - _LV_LL_READ_BACK(&meter->indicator_ll, indic) { - - if(indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_LINE) { - int32_t angle = lv_map(indic->end_value, meter->scale.min, meter->scale.max, meter->scale.rotation, - meter->scale.rotation + meter->scale.angle_range); - lv_coord_t r_out = r_edge + meter->scale.r_mod + indic->type_data.needle_line.r_mod; - lv_point_t p_end; - p_end.y = (lv_trigo_sin(angle) * (r_out)) / LV_TRIGO_SIN_MAX + scale_center.y; - p_end.x = (lv_trigo_cos(angle) * (r_out)) / LV_TRIGO_SIN_MAX + scale_center.x; - line_dsc.color = indic->type_data.needle_line.color; - line_dsc.width = indic->type_data.needle_line.width; - line_dsc.opa = indic->opa > LV_OPA_MAX ? opa_main : (opa_main * indic->opa) >> 8; - line_dsc.p1 = scale_center; - line_dsc.p2 = p_end; - lv_draw_line(layer, &line_dsc); - } - else if(indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_IMG) { - if(indic->type_data.needle_img.src == NULL) continue; - - int32_t angle = lv_map(indic->end_value, meter->scale.min, meter->scale.max, meter->scale.rotation, - meter->scale.rotation + meter->scale.angle_range); - lv_image_header_t info; - lv_image_decoder_get_info(indic->type_data.needle_img.src, &info); - lv_area_t a; - a.x1 = scale_center.x - indic->type_data.needle_img.pivot.x; - a.y1 = scale_center.y - indic->type_data.needle_img.pivot.y; - a.x2 = a.x1 + info.w - 1; - a.y2 = a.y1 + info.h - 1; - - img_dsc.opa = indic->opa > LV_OPA_MAX ? opa_main : (opa_main * indic->opa) >> 8; - img_dsc.pivot.x = indic->type_data.needle_img.pivot.x; - img_dsc.pivot.y = indic->type_data.needle_img.pivot.y; - angle = angle * 10; - if(angle > 3600) angle -= 3600; - img_dsc.rotation = angle; - - img_dsc.src = indic->type_data.needle_img.src; - lv_draw_image(layer, &img_dsc, &a); - } - } -} - -static void inv_arc(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t old_value, int32_t new_value) -{ - lv_meter_t * meter = (lv_meter_t *)obj; - - bool rounded = lv_obj_get_style_arc_rounded(obj, LV_PART_ITEMS); - - lv_area_t scale_area; - lv_obj_get_content_coords(obj, &scale_area); - - lv_coord_t r_out = lv_area_get_width(&scale_area) / 2; - lv_point_t scale_center; - scale_center.x = scale_area.x1 + r_out; - scale_center.y = scale_area.y1 + r_out; - - r_out += indic->type_data.arc.r_mod; - - int32_t start_angle = lv_map(old_value, meter->scale.min, meter->scale.max, meter->scale.rotation, - meter->scale.angle_range + meter->scale.rotation); - int32_t end_angle = lv_map(new_value, meter->scale.min, meter->scale.max, meter->scale.rotation, - meter->scale.angle_range + meter->scale.rotation); - - lv_area_t a; - lv_draw_arc_get_area(scale_center.x, scale_center.y, r_out, LV_MIN(start_angle, end_angle), LV_MAX(start_angle, - end_angle), indic->type_data.arc.width, rounded, &a); - lv_obj_invalidate_area(obj, &a); -} - - -static void inv_line(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value) -{ - lv_meter_t * meter = (lv_meter_t *)obj; - - lv_area_t scale_area; - lv_obj_get_content_coords(obj, &scale_area); - - lv_coord_t r_out = lv_area_get_width(&scale_area) / 2; - lv_point_t scale_center; - scale_center.x = scale_area.x1 + r_out; - scale_center.y = scale_area.y1 + r_out; - - if(indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_LINE) { - int32_t angle = lv_map(value, meter->scale.min, meter->scale.max, meter->scale.rotation, - meter->scale.rotation + meter->scale.angle_range); - r_out += meter->scale.r_mod + indic->type_data.needle_line.r_mod; - lv_point_t p_end; - p_end.y = (lv_trigo_sin(angle) * (r_out)) / LV_TRIGO_SIN_MAX + scale_center.y; - p_end.x = (lv_trigo_cos(angle) * (r_out)) / LV_TRIGO_SIN_MAX + scale_center.x; - - lv_area_t a; - a.x1 = LV_MIN(scale_center.x, p_end.x) - indic->type_data.needle_line.width - 2; - a.y1 = LV_MIN(scale_center.y, p_end.y) - indic->type_data.needle_line.width - 2; - a.x2 = LV_MAX(scale_center.x, p_end.x) + indic->type_data.needle_line.width + 2; - a.y2 = LV_MAX(scale_center.y, p_end.y) + indic->type_data.needle_line.width + 2; - - lv_obj_invalidate_area(obj, &a); - } - else if(indic->type == LV_METER_INDICATOR_TYPE_NEEDLE_IMG) { - int32_t angle = lv_map(value, meter->scale.min, meter->scale.max, meter->scale.rotation, - meter->scale.rotation + meter->scale.angle_range); - lv_image_header_t info; - lv_image_decoder_get_info(indic->type_data.needle_img.src, &info); - - angle = angle * 10; - if(angle > 3600) angle -= 3600; - - scale_center.x -= indic->type_data.needle_img.pivot.x; - scale_center.y -= indic->type_data.needle_img.pivot.y; - lv_area_t a; - _lv_image_buf_get_transformed_area(&a, info.w, info.h, angle, LV_SCALE_NONE, &indic->type_data.needle_img.pivot); - a.x1 += scale_center.x - 2; - a.y1 += scale_center.y - 2; - a.x2 += scale_center.x + 2; - a.y2 += scale_center.y + 2; - - lv_obj_invalidate_area(obj, &a); - } -} -#endif diff --git a/src/widgets/meter/lv_meter.h b/src/widgets/meter/lv_meter.h deleted file mode 100644 index a9e7d96a7..000000000 --- a/src/widgets/meter/lv_meter.h +++ /dev/null @@ -1,235 +0,0 @@ -/** - * @file lv_meter.h - * - */ - -#ifndef LV_METER_H -#define LV_METER_H - -#ifdef __cplusplus -extern "C" { -#endif - -/********************* - * INCLUDES - *********************/ -#include "../../../lvgl.h" - -#if LV_USE_METER != 0 - -/********************* - * DEFINES - *********************/ - -/********************** - * TYPEDEFS - **********************/ - -enum _lv_meter_indicator_type_t { - LV_METER_INDICATOR_TYPE_NEEDLE_IMG, - LV_METER_INDICATOR_TYPE_NEEDLE_LINE, - LV_METER_INDICATOR_TYPE_SCALE_LINES, - LV_METER_INDICATOR_TYPE_ARC, -}; - -#ifdef DOXYGEN -typedef _lv_meter_indicator_type_t lv_meter_indicator_type_t; -#else -typedef uint8_t lv_meter_indicator_type_t; -#endif /*DOXYGEN*/ - - -typedef struct { - lv_meter_indicator_type_t type; - lv_opa_t opa; - int32_t start_value; - int32_t end_value; - union { - struct { - const void * src; - lv_point_t pivot; - } needle_img; - struct { - uint16_t width; - int16_t r_mod; - lv_color_t color; - } needle_line; - struct { - uint16_t width; - const void * src; - lv_color_t color; - int16_t r_mod; - } arc; - struct { - int16_t width_mod; - lv_color_t color_start; - lv_color_t color_end; - uint8_t local_grad : 1; - } scale_lines; - } type_data; -} lv_meter_indicator_t; - -/*Data of line meter*/ -typedef struct { - lv_obj_t obj; - struct { - lv_color_t tick_color; - uint16_t tick_cnt; - uint16_t tick_length; - uint16_t tick_width; - - lv_color_t tick_major_color; - uint16_t tick_major_nth; - uint16_t tick_major_length; - uint16_t tick_major_width; - - int16_t label_gap; - int16_t label_color; - - int32_t min; - int32_t max; - int16_t r_mod; - uint16_t angle_range; - int16_t rotation; - } scale; - lv_ll_t indicator_ll; -} lv_meter_t; - -extern const lv_obj_class_t lv_meter_class; - -/********************** - * GLOBAL PROTOTYPES - **********************/ - -/** - * Create a Meter object - * @param parent pointer to an object, it will be the parent of the new bar. - * @return pointer to the created meter - */ -lv_obj_t * lv_meter_create(lv_obj_t * parent); - -/** - * Set the properties of the ticks of a scale - * @param obj pointer to a meter object - * @param cnt number of tick lines - * @param width width of tick lines - * @param len length of tick lines - * @param color color of tick lines - */ -void lv_meter_set_scale_ticks(lv_obj_t * obj, uint16_t cnt, uint16_t width, uint16_t len, - lv_color_t color); - -/** - * Make some "normal" ticks major ticks and set their attributes. - * Texts with the current value are also added to the major ticks. - * @param obj pointer to a meter object - * @param nth make every Nth normal tick major tick. (start from the first on the left) - * @param width width of the major ticks - * @param len length of the major ticks - * @param color color of the major ticks - * @param label_gap gap between the major ticks and the labels - */ -void lv_meter_set_scale_major_ticks(lv_obj_t * obj, uint16_t nth, uint16_t width, - uint16_t len, lv_color_t color, int16_t label_gap); - -/** - * Set the value and angular range of a scale. - * @param obj pointer to a meter object - * @param min the minimum value - * @param max the maximal value - * @param angle_range the angular range of the scale - * @param rotation the angular offset from the 3 o'clock position (clock-wise) - */ -void lv_meter_set_scale_range(lv_obj_t * obj, int32_t min, int32_t max, uint32_t angle_range, - uint32_t rotation); - -/*===================== - * Add indicator - *====================*/ - -/** - * Add a needle line indicator the scale - * @param obj pointer to a meter object - * @param width width of the line - * @param color color of the line - * @param r_mod the radius modifier (added to the scale's radius) to get the lines length - * @return the new indicator or NULL on allocation failure. - */ -lv_meter_indicator_t * lv_meter_add_needle_line(lv_obj_t * obj, uint16_t width, - lv_color_t color, int16_t r_mod); - -/** - * Add a needle image indicator the scale - * @param obj pointer to a meter object - * @param src the image source of the indicator. path or pointer to ::lv_image_dsc_t - * @param pivot_x the X pivot point of the needle - * @param pivot_y the Y pivot point of the needle - * @return the new indicator or NULL on allocation failure. - * @note the needle image should point to the right, like -O-----> - */ -lv_meter_indicator_t * lv_meter_add_needle_image(lv_obj_t * obj, const void * src, - lv_coord_t pivot_x, lv_coord_t pivot_y); - -/** - * Add an arc indicator the scale - * @param obj pointer to a meter object - * @param width width of the arc - * @param color color of the arc - * @param r_mod the radius modifier (added to the scale's radius) to get the outer radius of the arc - * @return the new indicator or NULL on allocation failure. - */ -lv_meter_indicator_t * lv_meter_add_arc(lv_obj_t * obj, uint16_t width, lv_color_t color, - int16_t r_mod); - - -/** - * Add a scale line indicator the scale. It will modify the ticks. - * @param obj pointer to a meter object - * @param color_start the start color - * @param color_end the end color - * @param local tell how to map start and end color. true: the indicator's start and end_value; false: the scale's min max value - * @param width_mod add this the affected tick's width - * @return the new indicator or NULL on allocation failure. - */ -lv_meter_indicator_t * lv_meter_add_scale_lines(lv_obj_t * obj, lv_color_t color_start, - lv_color_t color_end, bool local, int16_t width_mod); - -/*===================== - * Set indicator value - *====================*/ - -/** - * Set the value of the indicator. It will set start and and value to the same value - * @param obj pointer to a meter object - * @param indic pointer to an indicator - * @param value the new value - */ -void lv_meter_set_indicator_value(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value); - -/** - * Set the start value of the indicator. - * @param obj pointer to a meter object - * @param indic pointer to an indicator - * @param value the new value - */ -void lv_meter_set_indicator_start_value(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value); - -/** - * Set the start value of the indicator. - * @param obj pointer to a meter object - * @param indic pointer to an indicator - * @param value the new value - */ -void lv_meter_set_indicator_end_value(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value); - -/********************** - * MACROS - **********************/ - -#endif /*LV_USE_METER*/ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /*LV_METER_H*/ diff --git a/src/widgets/scale/lv_scale.c b/src/widgets/scale/lv_scale.c index 8373d316c..d853f0d48 100644 --- a/src/widgets/scale/lv_scale.c +++ b/src/widgets/scale/lv_scale.c @@ -182,17 +182,18 @@ void lv_scale_set_round_props(lv_obj_t * obj, uint32_t angle_range, int32_t rota lv_obj_invalidate(obj); } -void lv_scale_set_text_src(lv_obj_t * obj, char * txt_src[]) +void lv_scale_set_text_src(lv_obj_t * obj, const char * txt_src[]) { LV_ASSERT_OBJ(obj, MY_CLASS); lv_scale_t * scale = (lv_scale_t *)obj; scale->txt_src = txt_src; - scale->custom_label_cnt = 0; - lv_coord_t idx; - for(idx = 0; txt_src[idx]; ++idx) { - scale->custom_label_cnt++; + if(scale->txt_src) { + lv_coord_t idx; + for(idx = 0; txt_src[idx]; ++idx) { + scale->custom_label_cnt++; + } } lv_obj_invalidate(obj); @@ -252,7 +253,7 @@ void lv_scale_section_set_style(lv_scale_section_t * section, uint32_t part, lv_ case LV_PART_INDICATOR: section->indicator_style = section_part_style; break; - case LV_PART_ITEMS: + case LV_PART_TICKS: section->items_style = section_part_style; break; default: @@ -261,7 +262,6 @@ void lv_scale_section_set_style(lv_scale_section_t * section, uint32_t part, lv_ } } - /*===================== * Getter functions *====================*/ @@ -375,7 +375,7 @@ static void scale_draw_indicator(lv_obj_t * obj, lv_event_t * event) /* Configure line draw descriptor for the minor tick drawing */ lv_draw_line_dsc_t minor_tick_dsc; lv_draw_line_dsc_init(&minor_tick_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_ITEMS, &minor_tick_dsc); + lv_obj_init_draw_line_dsc(obj, LV_PART_TICKS, &minor_tick_dsc); /* Main line style */ lv_draw_line_dsc_t main_line_dsc; @@ -405,14 +405,14 @@ static void scale_draw_indicator(lv_obj_t * obj, lv_event_t * event) scale_set_line_properties(obj, &major_tick_dsc, section->indicator_style, LV_PART_INDICATOR); } else { - scale_set_line_properties(obj, &minor_tick_dsc, section->items_style, LV_PART_ITEMS); + scale_set_line_properties(obj, &minor_tick_dsc, section->items_style, LV_PART_TICKS); } } else { /* Tick is not in section, get the proper styles */ lv_obj_init_draw_label_dsc(obj, LV_PART_INDICATOR, &label_dsc); lv_obj_init_draw_line_dsc(obj, LV_PART_INDICATOR, &major_tick_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_ITEMS, &minor_tick_dsc); + lv_obj_init_draw_line_dsc(obj, LV_PART_TICKS, &minor_tick_dsc); } } @@ -460,7 +460,7 @@ static void scale_draw_indicator(lv_obj_t * obj, lv_event_t * event) } } } - else if(LV_SCALE_MODE_ROUND_OUTTER == scale->mode || LV_SCALE_MODE_ROUND_INNER == scale->mode) { + else if(LV_SCALE_MODE_ROUND_OUTER == scale->mode || LV_SCALE_MODE_ROUND_INNER == scale->mode) { lv_area_t scale_area; lv_obj_get_content_coords(obj, &scale_area); @@ -493,14 +493,14 @@ static void scale_draw_indicator(lv_obj_t * obj, lv_event_t * event) scale_set_line_properties(obj, &major_tick_dsc, section->indicator_style, LV_PART_INDICATOR); } else { - scale_set_line_properties(obj, &minor_tick_dsc, section->items_style, LV_PART_ITEMS); + scale_set_line_properties(obj, &minor_tick_dsc, section->items_style, LV_PART_TICKS); } } else { /* Tick is not in section, get the proper styles */ lv_obj_init_draw_label_dsc(obj, LV_PART_INDICATOR, &label_dsc); lv_obj_init_draw_line_dsc(obj, LV_PART_INDICATOR, &major_tick_dsc); - lv_obj_init_draw_line_dsc(obj, LV_PART_ITEMS, &minor_tick_dsc); + lv_obj_init_draw_line_dsc(obj, LV_PART_TICKS, &minor_tick_dsc); } } @@ -533,7 +533,7 @@ static void scale_draw_indicator(lv_obj_t * obj, lv_event_t * event) if(LV_SCALE_MODE_ROUND_INNER == scale->mode) { radius_text = (radius_edge - scale->major_len) - (label_gap + label_dsc.letter_space); } - else if(LV_SCALE_MODE_ROUND_OUTTER == scale->mode) { + else if(LV_SCALE_MODE_ROUND_OUTER == scale->mode) { radius_text = (radius_edge + scale->major_len) + (label_gap + label_dsc.letter_space); } else { /* Nothing to do */ } @@ -616,7 +616,7 @@ static void scale_draw_main(lv_obj_t * obj, lv_event_t * event) main_line_point_a.x = x_ofs - 1U; main_line_point_a.y = y_ofs; main_line_point_b.x = x_ofs - 1U; - main_line_point_b.y = obj->coords.y2 - pad_left; + main_line_point_b.y = obj->coords.y2 - pad_bottom; /* Adjust main line with initial and last tick width */ main_line_point_a.y -= scale->last_tick_width / 2U; @@ -679,7 +679,7 @@ static void scale_draw_main(lv_obj_t * obj, lv_event_t * event) lv_draw_line(layer, &main_line_section_dsc); } } - else if(LV_SCALE_MODE_ROUND_OUTTER == scale->mode || LV_SCALE_MODE_ROUND_INNER == scale->mode) { + else if(LV_SCALE_MODE_ROUND_OUTER == scale->mode || LV_SCALE_MODE_ROUND_INNER == scale->mode) { /* Configure arc draw descriptors for the main part */ lv_draw_arc_dsc_t arc_dsc; lv_draw_arc_dsc_init(&arc_dsc); @@ -873,7 +873,7 @@ static void scale_get_tick_points(lv_obj_t * obj, const uint32_t tick_idx, bool tick_point_b->y = tick_point_a->y + tick_length; } } - else if(LV_SCALE_MODE_ROUND_OUTTER == scale->mode || LV_SCALE_MODE_ROUND_INNER == scale->mode) { + else if(LV_SCALE_MODE_ROUND_OUTER == scale->mode || LV_SCALE_MODE_ROUND_INNER == scale->mode) { lv_area_t scale_area; lv_obj_get_content_coords(obj, &scale_area); @@ -895,7 +895,7 @@ static void scale_get_tick_points(lv_obj_t * obj, const uint32_t tick_idx, bool point_closer_to_arc = radius_edge - main_line_dsc.width; adjusted_radio_with_tick_len = point_closer_to_arc - (is_major_tick ? major_len : minor_len); } - else if(LV_SCALE_MODE_ROUND_OUTTER == scale->mode) { + else if(LV_SCALE_MODE_ROUND_OUTER == scale->mode) { point_closer_to_arc = radius_edge - main_line_dsc.width; adjusted_radio_with_tick_len = point_closer_to_arc + (is_major_tick ? major_len : minor_len); } @@ -957,7 +957,7 @@ static void scale_get_label_coords(lv_obj_t * obj, lv_draw_label_dsc_t * label_d label_coords->x2 = tick_point->x + label_size.x + lv_obj_get_style_pad_right(obj, LV_PART_INDICATOR); } } - else if(LV_SCALE_MODE_ROUND_OUTTER == scale->mode || LV_SCALE_MODE_ROUND_INNER == scale->mode) { + else if(LV_SCALE_MODE_ROUND_OUTER == scale->mode || LV_SCALE_MODE_ROUND_INNER == scale->mode) { label_coords->x1 = tick_point->x - (label_size.x / 2U); label_coords->y1 = tick_point->y - (label_size.y / 2U); label_coords->x2 = label_coords->x1 + label_size.x; @@ -974,7 +974,7 @@ static void scale_get_label_coords(lv_obj_t * obj, lv_draw_label_dsc_t * label_d * @param obj pointer to a scale object * @param line_dsc pointer to line descriptor * @param items_section_style pointer to indicator section style - * @param part line part, example: LV_PART_INDICATOR, LV_PART_ITEMS, LV_PART_MAIN + * @param part line part, example: LV_PART_INDICATOR, LV_PART_TICKS, LV_PART_MAIN */ static void scale_set_line_properties(lv_obj_t * obj, lv_draw_line_dsc_t * line_dsc, lv_style_t * section_style, uint32_t part) @@ -1183,7 +1183,7 @@ static void scale_store_main_line_tick_width_compensation(lv_obj_t * obj, const else if((LV_SCALE_MODE_HORIZONTAL_BOTTOM == scale->mode) || (LV_SCALE_MODE_HORIZONTAL_TOP == scale->mode)) { scale->first_tick_width = is_major_tick ? major_tick_width : minor_tick_width; } - else if((LV_SCALE_MODE_ROUND_INNER == scale->mode) || (LV_SCALE_MODE_ROUND_OUTTER == scale->mode)) { + else if((LV_SCALE_MODE_ROUND_INNER == scale->mode) || (LV_SCALE_MODE_ROUND_OUTER == scale->mode)) { /* TODO */ } else { /* Nothing to do */ } @@ -1195,7 +1195,7 @@ static void scale_store_main_line_tick_width_compensation(lv_obj_t * obj, const else if((LV_SCALE_MODE_HORIZONTAL_BOTTOM == scale->mode) || (LV_SCALE_MODE_HORIZONTAL_TOP == scale->mode)) { scale->last_tick_width = is_major_tick ? major_tick_width : minor_tick_width; } - else if((LV_SCALE_MODE_ROUND_INNER == scale->mode) || (LV_SCALE_MODE_ROUND_OUTTER == scale->mode)) { + else if((LV_SCALE_MODE_ROUND_INNER == scale->mode) || (LV_SCALE_MODE_ROUND_OUTER == scale->mode)) { /* TODO */ } else { /* Nothing to do */ } @@ -1259,7 +1259,7 @@ static void scale_store_section_line_tick_width_compensation(lv_obj_t * obj, con scale_set_line_properties(obj, major_tick_dsc, section->indicator_style, LV_PART_INDICATOR); } else { - scale_set_line_properties(obj, minor_tick_dsc, section->items_style, LV_PART_ITEMS); + scale_set_line_properties(obj, minor_tick_dsc, section->items_style, LV_PART_TICKS); } } diff --git a/src/widgets/scale/lv_scale.h b/src/widgets/scale/lv_scale.h index cefc1a6f1..64358e46d 100644 --- a/src/widgets/scale/lv_scale.h +++ b/src/widgets/scale/lv_scale.h @@ -48,7 +48,7 @@ enum { LV_SCALE_MODE_VERTICAL_LEFT = 0x02U, LV_SCALE_MODE_VERTICAL_RIGHT = 0x04U, LV_SCALE_MODE_ROUND_INNER = 0x08U, - LV_SCALE_MODE_ROUND_OUTTER = 0x10U, + LV_SCALE_MODE_ROUND_OUTER = 0x10U, _LV_SCALE_MODE_LAST }; typedef uint32_t lv_scale_mode_t; @@ -72,7 +72,7 @@ typedef struct { typedef struct { lv_obj_t obj; lv_ll_t section_ll; /**< Linked list for the sections (stores lv_scale_section_t)*/ - char ** txt_src; + const char ** txt_src; lv_coord_t custom_label_cnt; lv_coord_t major_len; lv_coord_t minor_len; @@ -174,7 +174,7 @@ void lv_scale_set_round_props(lv_obj_t * obj, uint32_t angle_range, int32_t rota * @param obj pointer to a scale object * @param txt_src pointer to an array of strings which will be display at major ticks */ -void lv_scale_set_text_src(lv_obj_t * obj, char * txt_src[]); +void lv_scale_set_text_src(lv_obj_t * obj, const char * txt_src[]); /** * Draw the scale after all the children are drawn diff --git a/tests/src/test_cases/widgets/test_chart.c b/tests/src/test_cases/widgets/test_chart.c index 103efc2b2..5f6ed9305 100644 --- a/tests/src/test_cases/widgets/test_chart.c +++ b/tests/src/test_cases/widgets/test_chart.c @@ -104,16 +104,4 @@ void test_chart_one_point_when_setting_point_count_to_zero(void) TEST_ASSERT_EQUAL(1u, lv_chart_get_point_count(chart)); } -void test_chart_set_zoom_y_to_none_when_factor_is_less_than_256(void) -{ - lv_chart_set_zoom_y(chart, 128); - TEST_ASSERT_EQUAL(LV_SCALE_NONE, lv_chart_get_zoom_y(chart)); -} - -void test_chart_set_zoom_x_to_none_when_factor_is_less_than_256(void) -{ - lv_chart_set_zoom_x(chart, 128); - TEST_ASSERT_EQUAL(LV_SCALE_NONE, lv_chart_get_zoom_x(chart)); -} - #endif