BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lvgl
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
lvgl
Commits
dda1a381
Commit
dda1a381
authored
Dec 20, 2017
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chart:init_points and set_points added
parent
d239b319
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
6 deletions
+54
-6
lv_refr.c
lv_core/lv_refr.c
+9
-6
lv_chart.c
lv_objx/lv_chart.c
+29
-0
lv_chart.h
lv_objx/lv_chart.h
+16
-0
No files found.
lv_core/lv_refr.c
View file @
dda1a381
...
...
@@ -260,16 +260,18 @@ static void lv_refr_area_with_vdb(const lv_area_t * area_p)
/*Calculate the max row num*/
lv_coord_t
w
=
lv_area_get_width
(
area_p
);
lv_coord_t
h
=
lv_area_get_height
(
area_p
);
lv_coord_t
x2
;
lv_coord_t
y2
=
area_p
->
y2
>=
LV_VER_RES
?
y2
=
LV_VER_RES
-
1
:
area_p
->
y2
;
lv_coord
_t
max_row
=
(
uint32_t
)
LV_VDB_SIZE
/
(
w
<<
LV_AA
);
uint32
_t
max_row
=
(
uint32_t
)
LV_VDB_SIZE
/
(
w
<<
LV_AA
);
if
(
max_row
>
(
h
<<
LV_AA
))
max_row
=
(
h
<<
LV_AA
);
max_row
=
max_row
>>
LV_AA
;
/*Always use the full row*/
lv_coord
_t
row
;
uint32
_t
row
;
lv_coord_t
row_last
=
0
;
for
(
row
=
area_p
->
y1
;
row
+
max_row
-
1
<=
area_p
->
y2
;
row
+=
max_row
)
{
for
(
row
=
area_p
->
y1
;
row
+
max_row
-
1
<=
y2
;
row
+=
max_row
)
{
lv_vdb_t
*
vdb_p
=
lv_vdb_get
();
/*Calc. the next y coordinates of VDB*/
...
...
@@ -277,19 +279,20 @@ static void lv_refr_area_with_vdb(const lv_area_t * area_p)
vdb_p
->
area
.
x2
=
area_p
->
x2
;
vdb_p
->
area
.
y1
=
row
;
vdb_p
->
area
.
y2
=
row
+
max_row
-
1
;
row_last
=
row
+
max_row
-
1
;
if
(
vdb_p
->
area
.
y2
>
y2
)
vdb_p
->
area
.
y2
=
y2
;
row_last
=
vdb_p
->
area
.
y2
;
lv_refr_area_part_vdb
(
area_p
);
}
/*If the last y coordinates are not handled yet ...*/
if
(
area_p
->
y2
!=
row_last
)
{
if
(
y2
!=
row_last
)
{
lv_vdb_t
*
vdb_p
=
lv_vdb_get
();
/*Calc. the next y coordinates of VDB*/
vdb_p
->
area
.
x1
=
area_p
->
x1
;
vdb_p
->
area
.
x2
=
area_p
->
x2
;
vdb_p
->
area
.
y1
=
row
;
vdb_p
->
area
.
y2
=
area_p
->
y2
;
vdb_p
->
area
.
y2
=
y2
;
/*Refresh this part too*/
lv_refr_area_part_vdb
(
area_p
);
...
...
lv_objx/lv_chart.c
View file @
dda1a381
...
...
@@ -260,6 +260,35 @@ void lv_chart_set_series_darking(lv_obj_t * chart, lv_opa_t dark_eff)
}
/**
* Initialize all data points with a value
* @param chart pointer to chart object
* @param ser pointer to a data series on 'chart'
* @param y the new value for all points
*/
void
lv_chart_init_points
(
lv_obj_t
*
chart
,
lv_chart_series_t
*
ser
,
lv_coord_t
y
)
{
lv_chart_ext_t
*
ext
=
lv_obj_get_ext_attr
(
chart
);
uint16_t
i
;
for
(
i
=
0
;
i
<
ext
->
point_cnt
;
i
++
)
{
ser
->
points
[
i
]
=
y
;
}
lv_chart_refresh
(
chart
);
}
/**
* Set the value s of points from an array
* @param chart pointer to chart object
* @param ser pointer to a data series on 'chart'
* @param y_array array of 'lv_coord_t' points (with 'points count' elements )
*/
void
lv_chart_set_points
(
lv_obj_t
*
chart
,
lv_chart_series_t
*
ser
,
lv_coord_t
*
y_array
)
{
lv_chart_ext_t
*
ext
=
lv_obj_get_ext_attr
(
chart
);
memcpy
(
ser
->
points
,
y_array
,
ext
->
point_cnt
*
(
sizeof
(
lv_coord_t
)));
lv_chart_refresh
(
chart
);
}
/**
* Shift all data right and set the most right data on a data line
* @param chart pointer to chart object
* @param ser pointer to a data series on 'chart'
...
...
lv_objx/lv_chart.h
View file @
dda1a381
...
...
@@ -141,6 +141,22 @@ void lv_chart_set_series_width(lv_obj_t * chart, lv_coord_t width);
void
lv_chart_set_series_darking
(
lv_obj_t
*
chart
,
lv_opa_t
dark_eff
);
/**
* Initialize all data points with a value
* @param chart pointer to chart object
* @param ser pointer to a data series on 'chart'
* @param y the new value for all points
*/
void
lv_chart_init_points
(
lv_obj_t
*
chart
,
lv_chart_series_t
*
ser
,
lv_coord_t
y
);
/**
* Set the value s of points from an array
* @param chart pointer to chart object
* @param ser pointer to a data series on 'chart'
* @param y_array array of 'lv_coord_t' points (with 'points count' elements )
*/
void
lv_chart_set_points
(
lv_obj_t
*
chart
,
lv_chart_series_t
*
ser
,
lv_coord_t
*
y_array
);
/**
* Shift all data right and set the most right data on a data line
* @param chart pointer to chart object
* @param ser pointer to a data series on 'chart'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment