From a090664a4c1709a7925621632e579632e3f1e39a Mon Sep 17 00:00:00 2001 From: panky-codes Date: Fri, 12 Mar 2021 09:43:13 +0100 Subject: Added a button for stop lap. Logic works. Need to implement symbol and buffer for lap --- src/displayapp/screens/StopWatch.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/displayapp/screens/StopWatch.h') diff --git a/src/displayapp/screens/StopWatch.h b/src/displayapp/screens/StopWatch.h index 9e5779a1..929813f8 100644 --- a/src/displayapp/screens/StopWatch.h +++ b/src/displayapp/screens/StopWatch.h @@ -13,6 +13,12 @@ namespace Pinetime::Applications::Screens { enum class Events { PLAY, PAUSE, STOP }; + struct TimeSeparated_t { + int mins; + int secs; + int msecs; + }; + class StopWatch : public Screen { public: StopWatch(DisplayApp* app, const Pinetime::Controllers::DateTime& dateTime); @@ -21,7 +27,7 @@ namespace Pinetime::Applications::Screens { bool OnButtonPushed() override; bool OnTouchEvent(uint16_t x, uint16_t y) override; void playPauseBtnEventHandler(lv_event_t event); - + void stopLapBtnEventHandler(lv_event_t event); private: const Pinetime::Controllers::DateTime& dateTime; @@ -30,6 +36,9 @@ namespace Pinetime::Applications::Screens { Events currentEvent; TickType_t startTime; TickType_t oldTimeElapsed; - lv_obj_t *time, *msecTime, *btnPlayPause, *btnStop, *txtPlayPause, *txtStop; + TimeSeparated_t timeSeparated; // Holds Mins, Secs, millisecs + int lapNr; + lv_obj_t *time, *msecTime, *btnPlayPause, *btnStopLap, *txtPlayPause, *txtStopLap; + lv_obj_t *lapOneText, *lapTwoText; }; } \ No newline at end of file -- cgit v1.2.3-70-g09d2