displayapp: Make Battery class references const

This commit is contained in:
Riku Isokoski 2023-02-23 22:16:44 +02:00
parent 1516b082fd
commit 1c4b97382a
30 changed files with 41 additions and 41 deletions

View File

@ -62,7 +62,7 @@ namespace {
DisplayApp::DisplayApp(Drivers::St7789& lcd,
Components::LittleVgl& lvgl,
Drivers::Cst816S& touchPanel,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController,
Drivers::WatchdogView& watchdog,

View File

@ -54,7 +54,7 @@ namespace Pinetime {
DisplayApp(Drivers::St7789& lcd,
Components::LittleVgl& lvgl,
Drivers::Cst816S&,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController,
Drivers::WatchdogView& watchdog,
@ -81,7 +81,7 @@ namespace Pinetime {
Pinetime::Drivers::St7789& lcd;
Pinetime::Components::LittleVgl& lvgl;
Pinetime::Drivers::Cst816S& touchPanel;
Pinetime::Controllers::Battery& batteryController;
const Pinetime::Controllers::Battery& batteryController;
Pinetime::Controllers::Ble& bleController;
Pinetime::Controllers::DateTime& dateTimeController;
Pinetime::Drivers::WatchdogView& watchdog;

View File

@ -13,7 +13,7 @@ using namespace Pinetime::Applications;
DisplayApp::DisplayApp(Drivers::St7789& lcd,
Components::LittleVgl& /*lvgl*/,
Drivers::Cst816S& /*touchPanel*/,
Controllers::Battery& /*batteryController*/,
const Controllers::Battery& /*batteryController*/,
Controllers::Ble& bleController,
Controllers::DateTime& /*dateTimeController*/,
Drivers::WatchdogView& /*watchdog*/,

View File

@ -49,7 +49,7 @@ namespace Pinetime {
DisplayApp(Drivers::St7789& lcd,
Components::LittleVgl& lvgl,
Drivers::Cst816S&,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController,
Drivers::WatchdogView& watchdog,

View File

@ -20,7 +20,7 @@ auto ApplicationList::CreateScreenList() const {
ApplicationList::ApplicationList(Pinetime::Applications::DisplayApp* app,
Pinetime::Controllers::Settings& settingsController,
Pinetime::Controllers::Battery& batteryController,
const Pinetime::Controllers::Battery& batteryController,
Pinetime::Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController)
: Screen(app),

View File

@ -18,7 +18,7 @@ namespace Pinetime {
public:
explicit ApplicationList(DisplayApp* app,
Pinetime::Controllers::Settings& settingsController,
Pinetime::Controllers::Battery& batteryController,
const Pinetime::Controllers::Battery& batteryController,
Pinetime::Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController);
~ApplicationList() override;
@ -29,7 +29,7 @@ namespace Pinetime {
std::unique_ptr<Screen> CreateScreen(unsigned int screenNum) const;
Controllers::Settings& settingsController;
Pinetime::Controllers::Battery& batteryController;
const Pinetime::Controllers::Battery& batteryController;
Pinetime::Controllers::Ble& bleController;
Controllers::DateTime& dateTimeController;

View File

@ -5,7 +5,7 @@
using namespace Pinetime::Applications::Screens;
BatteryInfo::BatteryInfo(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Battery& batteryController)
BatteryInfo::BatteryInfo(Pinetime::Applications::DisplayApp* app, const Pinetime::Controllers::Battery& batteryController)
: Screen(app), batteryController {batteryController} {
batteryPercent = batteryController.PercentRemaining();

View File

@ -14,13 +14,13 @@ namespace Pinetime {
class BatteryInfo : public Screen {
public:
BatteryInfo(DisplayApp* app, Pinetime::Controllers::Battery& batteryController);
BatteryInfo(DisplayApp* app, const Pinetime::Controllers::Battery& batteryController);
~BatteryInfo() override;
void Refresh() override;
private:
Pinetime::Controllers::Battery& batteryController;
const Pinetime::Controllers::Battery& batteryController;
lv_obj_t* voltage;
lv_obj_t* percent;

View File

@ -19,7 +19,7 @@ using namespace Pinetime::Applications::Screens;
Clock::Clock(DisplayApp* app,
Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,

View File

@ -23,7 +23,7 @@ namespace Pinetime {
public:
Clock(DisplayApp* app,
Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
@ -37,7 +37,7 @@ namespace Pinetime {
private:
Controllers::DateTime& dateTimeController;
Controllers::Battery& batteryController;
const Controllers::Battery& batteryController;
Controllers::Ble& bleController;
Controllers::NotificationManager& notificationManager;
Controllers::Settings& settingsController;

View File

@ -32,7 +32,7 @@ namespace {
SystemInfo::SystemInfo(Pinetime::Applications::DisplayApp* app,
Pinetime::Controllers::DateTime& dateTimeController,
Pinetime::Controllers::Battery& batteryController,
const Pinetime::Controllers::Battery& batteryController,
Pinetime::Controllers::BrightnessController& brightnessController,
Pinetime::Controllers::Ble& bleController,
Pinetime::Drivers::WatchdogView& watchdog,

View File

@ -24,7 +24,7 @@ namespace Pinetime {
public:
explicit SystemInfo(DisplayApp* app,
Pinetime::Controllers::DateTime& dateTimeController,
Pinetime::Controllers::Battery& batteryController,
const Pinetime::Controllers::Battery& batteryController,
Pinetime::Controllers::BrightnessController& brightnessController,
Pinetime::Controllers::Ble& bleController,
Pinetime::Drivers::WatchdogView& watchdog,
@ -35,7 +35,7 @@ namespace Pinetime {
private:
Pinetime::Controllers::DateTime& dateTimeController;
Pinetime::Controllers::Battery& batteryController;
const Pinetime::Controllers::Battery& batteryController;
Pinetime::Controllers::BrightnessController& brightnessController;
Pinetime::Controllers::Ble& bleController;
Pinetime::Drivers::WatchdogView& watchdog;

View File

@ -28,7 +28,7 @@ Tile::Tile(uint8_t screenID,
uint8_t numScreens,
DisplayApp* app,
Controllers::Settings& settingsController,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController,
std::array<Applications, 6>& applications)

View File

@ -25,7 +25,7 @@ namespace Pinetime {
uint8_t numScreens,
DisplayApp* app,
Controllers::Settings& settingsController,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController,
std::array<Applications, 6>& applications);

View File

@ -45,7 +45,7 @@ namespace {
WatchFaceAnalog::WatchFaceAnalog(Pinetime::Applications::DisplayApp* app,
Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController)

View File

@ -26,7 +26,7 @@ namespace Pinetime {
public:
WatchFaceAnalog(DisplayApp* app,
Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController);
@ -74,7 +74,7 @@ namespace Pinetime {
BatteryIcon batteryIcon;
const Controllers::DateTime& dateTimeController;
Controllers::Battery& batteryController;
const Controllers::Battery& batteryController;
Controllers::Ble& bleController;
Controllers::NotificationManager& notificationManager;
Controllers::Settings& settingsController;

View File

@ -17,7 +17,7 @@ using namespace Pinetime::Applications::Screens;
WatchFaceCasioStyleG7710::WatchFaceCasioStyleG7710(DisplayApp* app,
Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::NotificationManager& notificatioManager,
Controllers::Settings& settingsController,

View File

@ -26,7 +26,7 @@ namespace Pinetime {
public:
WatchFaceCasioStyleG7710(DisplayApp* app,
Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::NotificationManager& notificatioManager,
Controllers::Settings& settingsController,
@ -94,7 +94,7 @@ namespace Pinetime {
BatteryIcon batteryIcon;
Controllers::DateTime& dateTimeController;
Controllers::Battery& batteryController;
const Controllers::Battery& batteryController;
Controllers::Ble& bleController;
Controllers::NotificationManager& notificatioManager;
Controllers::Settings& settingsController;

View File

@ -16,7 +16,7 @@ using namespace Pinetime::Applications::Screens;
WatchFaceDigital::WatchFaceDigital(DisplayApp* app,
Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,

View File

@ -26,7 +26,7 @@ namespace Pinetime {
public:
WatchFaceDigital(DisplayApp* app,
Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,

View File

@ -22,7 +22,7 @@ namespace {
WatchFaceInfineat::WatchFaceInfineat(DisplayApp* app,
Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,

View File

@ -23,7 +23,7 @@ namespace Pinetime {
public:
WatchFaceInfineat(DisplayApp* app,
Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
@ -101,7 +101,7 @@ namespace Pinetime {
} infineatColors;
Controllers::DateTime& dateTimeController;
Controllers::Battery& batteryController;
const Controllers::Battery& batteryController;
Controllers::Ble& bleController;
Controllers::NotificationManager& notificationManager;
Controllers::Settings& settingsController;

View File

@ -46,7 +46,7 @@ namespace {
WatchFacePineTimeStyle::WatchFacePineTimeStyle(DisplayApp* app,
Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,

View File

@ -26,7 +26,7 @@ namespace Pinetime {
public:
WatchFacePineTimeStyle(DisplayApp* app,
Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
@ -103,7 +103,7 @@ namespace Pinetime {
BatteryIcon batteryIcon;
Controllers::DateTime& dateTimeController;
Controllers::Battery& batteryController;
const Controllers::Battery& batteryController;
Controllers::Ble& bleController;
Controllers::NotificationManager& notificationManager;
Controllers::Settings& settingsController;

View File

@ -15,7 +15,7 @@ using namespace Pinetime::Applications::Screens;
WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app,
Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,

View File

@ -24,7 +24,7 @@ namespace Pinetime {
public:
WatchFaceTerminal(DisplayApp* app,
Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController,
const Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
@ -66,7 +66,7 @@ namespace Pinetime {
lv_obj_t* connectState;
Controllers::DateTime& dateTimeController;
Controllers::Battery& batteryController;
const Controllers::Battery& batteryController;
Controllers::Ble& bleController;
Controllers::NotificationManager& notificationManager;
Controllers::Settings& settingsController;

View File

@ -28,7 +28,7 @@ namespace {
}
QuickSettings::QuickSettings(Pinetime::Applications::DisplayApp* app,
Pinetime::Controllers::Battery& batteryController,
const Pinetime::Controllers::Battery& batteryController,
Controllers::DateTime& dateTimeController,
Controllers::BrightnessController& brightness,
Controllers::MotorController& motorController,

View File

@ -18,7 +18,7 @@ namespace Pinetime {
class QuickSettings : public Screen {
public:
QuickSettings(DisplayApp* app,
Pinetime::Controllers::Battery& batteryController,
const Pinetime::Controllers::Battery& batteryController,
Controllers::DateTime& dateTimeController,
Controllers::BrightnessController& brightness,
Controllers::MotorController& motorController,

View File

@ -3,7 +3,7 @@
using namespace Pinetime::Applications::Widgets;
StatusIcons::StatusIcons(Controllers::Battery& batteryController, Controllers::Ble& bleController)
StatusIcons::StatusIcons(const Controllers::Battery& batteryController, Controllers::Ble& bleController)
: batteryController {batteryController}, bleController {bleController} {
}

View File

@ -12,7 +12,7 @@ namespace Pinetime {
namespace Widgets {
class StatusIcons {
public:
StatusIcons(Controllers::Battery& batteryController, Controllers::Ble& bleController);
StatusIcons(const Controllers::Battery& batteryController, Controllers::Ble& bleController);
void Align();
void Create();
@ -24,7 +24,7 @@ namespace Pinetime {
private:
Screens::BatteryIcon batteryIcon;
Pinetime::Controllers::Battery& batteryController;
const Pinetime::Controllers::Battery& batteryController;
Controllers::Ble& bleController;
Screens::DirtyValue<uint8_t> batteryPercentRemaining {};