diff options
Diffstat (limited to 'src/displayapp/screens/Motion.cpp')
-rw-r--r-- | src/displayapp/screens/Motion.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/displayapp/screens/Motion.cpp b/src/displayapp/screens/Motion.cpp index e7196267..a8bb3c18 100644 --- a/src/displayapp/screens/Motion.cpp +++ b/src/displayapp/screens/Motion.cpp @@ -3,8 +3,6 @@ #include "../DisplayApp.h" using namespace Pinetime::Applications::Screens; -extern lv_font_t jetbrains_mono_extrabold_compressed; -extern lv_font_t jetbrains_mono_bold_20; Motion::Motion(Pinetime::Applications::DisplayApp* app, Controllers::MotionController& motionController) : Screen(app), motionController {motionController} { @@ -29,13 +27,16 @@ Motion::Motion(Pinetime::Applications::DisplayApp* app, Controllers::MotionContr 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); + labelStep = lv_label_create(lv_scr_act(), NULL); lv_obj_align(labelStep, chart, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0); - lv_label_set_text(labelStep, "Steps: "); + lv_label_set_text(labelStep, "Steps ---"); - labelStepValue = lv_label_create(lv_scr_act(), NULL); - lv_obj_align(labelStepValue, labelStep, LV_ALIGN_OUT_RIGHT_MID, 0, 0); - lv_label_set_text(labelStepValue, "-"); } Motion::~Motion() { @@ -47,8 +48,10 @@ bool Motion::Refresh() { lv_chart_set_next(chart, ser2, motionController.Y()); lv_chart_set_next(chart, ser3, motionController.Z()); - snprintf(nbStepsBuffer, nbStepsBufferSize, "%lu", motionController.NbSteps()); - lv_label_set_text(labelStepValue, nbStepsBuffer); + lv_label_set_text_fmt(labelStep, "Steps %lu", motionController.NbSteps()); + + 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); return running; } |