Heartrate removed, steps moved, and seconds label added

This commit is contained in:
Josh 2023-10-21 19:15:42 -04:00
parent 8ada9410a1
commit 191f99904c
3 changed files with 9 additions and 41 deletions

View File

@ -127,7 +127,6 @@ std::unique_ptr<Screen> Clock::WatchFaceCasioStyleG7710() {
bleController,
notificationManager,
settingsController,
heartRateController,
motionController,
filesystem);
}

View File

@ -9,7 +9,6 @@
#include "components/battery/BatteryController.h"
#include "components/ble/BleController.h"
#include "components/ble/NotificationManager.h"
#include "components/heartrate/HeartRateController.h"
#include "components/motion/MotionController.h"
#include "components/settings/Settings.h"
using namespace Pinetime::Applications::Screens;
@ -19,7 +18,6 @@ WatchFaceCasioStyleG7710::WatchFaceCasioStyleG7710(Controllers::DateTime& dateTi
const Controllers::Ble& bleController,
Controllers::NotificationManager& notificatioManager,
Controllers::Settings& settingsController,
Controllers::HeartRateController& heartRateController,
Controllers::MotionController& motionController,
Controllers::FS& filesystem)
: currentDateTime {{}},
@ -29,7 +27,6 @@ WatchFaceCasioStyleG7710::WatchFaceCasioStyleG7710(Controllers::DateTime& dateTi
bleController {bleController},
notificatioManager {notificatioManager},
settingsController {settingsController},
heartRateController {heartRateController},
motionController {motionController} {
lfs_file f = {};
@ -160,15 +157,10 @@ WatchFaceCasioStyleG7710::WatchFaceCasioStyleG7710(Controllers::DateTime& dateTi
lv_label_set_text_static(stepValue, "");
lv_obj_align(stepValue, stepIcon, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
oldStepValue = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(oldStepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
lv_label_set_text_static(oldStepValue, "0");
lv_obj_align(oldStepValue, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -5, -2);
oldStepIcon = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(oldStepIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
lv_label_set_text_static(oldStepIcon, Symbols::shoe);
lv_obj_align(oldStepIcon, oldStepValue, LV_ALIGN_OUT_LEFT_MID, -5, 0);
label_seconds = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(label_seconds, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
lv_label_set_text_static(label_seconds, "0");
lv_obj_align(label_seconds, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -5, -2);
taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
Refresh();
@ -291,26 +283,11 @@ void WatchFaceCasioStyleG7710::Refresh() {
}
}
heartbeat = heartRateController.HeartRate();
heartbeatRunning = heartRateController.State() != Controllers::HeartRateController::States::Stopped;
if (heartbeat.IsUpdated() || heartbeatRunning.IsUpdated()) {
if (heartbeatRunning.Get()) {
lv_obj_set_style_local_text_color(stepIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
lv_label_set_text_fmt(heartbeatValue, "%d", heartbeat.Get());
} else {
lv_obj_set_style_local_text_color(stepIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x1B1B1B));
lv_label_set_text_static(heartbeatValue, "");
}
lv_obj_realign(stepIcon);
lv_obj_realign(heartbeatValue);
}
stepCount = motionController.NbSteps();
if (stepCount.IsUpdated()) {
lv_label_set_text_fmt(oldStepValue, "%lu", stepCount.Get());
lv_obj_realign(oldStepValue);
lv_obj_realign(oldStepIcon);
lv_label_set_text_fmt(stepValue, "%lu", stepCount.Get());
lv_obj_realign(stepValue);
lv_obj_realign(stepValue);
}
}

View File

@ -16,7 +16,6 @@ namespace Pinetime {
class Battery;
class Ble;
class NotificationManager;
class HeartRateController;
class MotionController;
}
@ -30,7 +29,6 @@ namespace Pinetime {
const Controllers::Ble& bleController,
Controllers::NotificationManager& notificatioManager,
Controllers::Settings& settingsController,
Controllers::HeartRateController& heartRateController,
Controllers::MotionController& motionController,
Controllers::FS& filesystem);
~WatchFaceCasioStyleG7710() override;
@ -46,8 +44,6 @@ namespace Pinetime {
Utility::DirtyValue<bool> bleRadioEnabled {};
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::minutes>> currentDateTime {};
Utility::DirtyValue<uint32_t> stepCount {};
Utility::DirtyValue<uint8_t> heartbeat {};
Utility::DirtyValue<bool> heartbeatRunning {};
Utility::DirtyValue<bool> notificationState {};
using days = std::chrono::duration<int32_t, std::ratio<86400>>; // TODO: days is standard in c++20
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, days>> currentDate;
@ -64,6 +60,7 @@ namespace Pinetime {
lv_style_t style_border;
lv_obj_t* label_time;
lv_obj_t* label_seconds;
lv_obj_t* line_time;
lv_obj_t* label_time_ampm;
lv_obj_t* label_date;
@ -77,12 +74,8 @@ namespace Pinetime {
lv_obj_t* bleIcon;
lv_obj_t* batteryPlug;
lv_obj_t* label_battery_value;
lv_obj_t* heartbeatIcon;
lv_obj_t* heartbeatValue;
lv_obj_t* stepIcon; //TODO: remove unused variables
lv_obj_t* oldStepIcon;
lv_obj_t* stepIcon;
lv_obj_t* stepValue;
lv_obj_t* oldStepValue;
lv_obj_t* notificationIcon;
lv_obj_t* line_icons;
@ -93,7 +86,6 @@ namespace Pinetime {
const Controllers::Ble& bleController;
Controllers::NotificationManager& notificatioManager;
Controllers::Settings& settingsController;
Controllers::HeartRateController& heartRateController;
Controllers::MotionController& motionController;
lv_task_t* taskRefresh;