summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-03-31 16:32:14 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-03-31 16:32:14 (GMT)
commit6631fee198720c2710bbf09308b30e74c11814b0 (patch)
tree1b427b6e594cf3299c6a4ccd6c990632d84c69c1
parentea0b6d97a43ac4c11bedefb0e71851e5292c1370 (diff)
Simplify chart, should hopefully improve performance
-rw-r--r--src/displayapp/screens/Motion.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/displayapp/screens/Motion.cpp b/src/displayapp/screens/Motion.cpp
index 1bc7bd4..fe630d9 100644
--- a/src/displayapp/screens/Motion.cpp
+++ b/src/displayapp/screens/Motion.cpp
@@ -7,7 +7,7 @@ using namespace Pinetime::Applications::Screens;
Motion::Motion(Pinetime::Applications::DisplayApp* app, Controllers::MotionController& motionController)
: Screen(app), motionController {motionController} {
chart = lv_chart_create(lv_scr_act(), NULL);
- lv_obj_set_size(chart, 240, 240);
+ lv_obj_set_size(chart, 100, 100);
lv_obj_align(chart, NULL, LV_ALIGN_IN_TOP_MID, 0, 0);
lv_chart_set_type(chart, LV_CHART_TYPE_LINE); /*Show lines and points too*/
// lv_chart_set_series_opa(chart, LV_OPA_70); /*Opacity of the data series*/
@@ -19,19 +19,19 @@ Motion::Motion(Pinetime::Applications::DisplayApp* app, Controllers::MotionContr
/*Add 3 data series*/
ser1 = lv_chart_add_series(chart, LV_COLOR_RED);
- ser2 = lv_chart_add_series(chart, LV_COLOR_GREEN);
- ser3 = lv_chart_add_series(chart, LV_COLOR_YELLOW);
+ // ser2 = lv_chart_add_series(chart, LV_COLOR_GREEN);
+ // ser3 = lv_chart_add_series(chart, LV_COLOR_YELLOW);
lv_chart_init_points(chart, ser1, 0);
- lv_chart_init_points(chart, ser2, 0);
- lv_chart_init_points(chart, ser3, 0);
+ // lv_chart_init_points(chart, ser2, 0);
+ // lv_chart_init_points(chart, ser3, 0);
lv_chart_refresh(chart); /*Required after direct set*/
- label = lv_label_create(lv_scr_act(), NULL);
- lv_label_set_text_fmt(label, "X #FF0000 %d# Y #008000 %d# Z #FFFF00 %d#", 0, 0, 0);
- lv_label_set_align(label, LV_LABEL_ALIGN_CENTER);
- lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 10);
- lv_label_set_recolor(label, true);
+ // label = lv_label_create(lv_scr_act(), NULL);
+ // lv_label_set_text_fmt(label, "X #FF0000 %d# Y #008000 %d# Z #FFFF00 %d#", 0, 0, 0);
+ // lv_label_set_align(label, LV_LABEL_ALIGN_CENTER);
+ // lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 10);
+ // lv_label_set_recolor(label, true);
taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
}
@@ -43,13 +43,14 @@ Motion::~Motion() {
void Motion::Refresh() {
lv_chart_set_next(chart, ser1, motionController.X());
- lv_chart_set_next(chart, ser2, motionController.Y());
- lv_chart_set_next(chart, ser3, motionController.Z());
-
+ // lv_chart_set_next(chart, ser2, motionController.Y());
+ // lv_chart_set_next(chart, ser3, motionController.Z());
+#if 0
lv_label_set_text_fmt(label,
"X #FF0000 %d# Y #008000 %d# Z #FFFF00 %d#",
motionController.X() / 0x10,
motionController.Y() / 0x10,
motionController.Z() / 0x10);
lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 10);
+#endif
}