From fa09e6ce131e9669baca8ce2562fe87dd1f43528 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Thu, 3 Nov 2022 12:06:04 -0400 Subject: rename --- repgoal.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'repgoal.hs') diff --git a/repgoal.hs b/repgoal.hs index ab50b67..5a4e6e4 100755 --- a/repgoal.hs +++ b/repgoal.hs @@ -83,7 +83,7 @@ data Performance = Achieved { } deriving Generic deriving (Read, Show) via Surgery Derecordify Performance data LiftRecord = LiftRecord { - liftName :: Text, + liftRecordName :: Text, stats :: [Performance] } deriving Generic deriving (Read, Show) via Surgery Derecordify LiftRecord @@ -164,20 +164,20 @@ lookup' i seq = fromJust $ NESeq.lookup (i `mod` NESeq.length seq) seq drawUI :: St -> [Widget ()] drawUI st = [vCenter $ vBox [hCenter $ hBox [header, oneRepMaxTable], withVScrollBarHandles $ withVScrollBars OnRight $ viewport () Vertical $ hCenter lastSetTable]] where - lifts' = filter ((flip Set.member $ view sessions st & lookup' (view selectedSession st)) . liftName) (view lifts st) + lifts' = filter ((flip Set.member $ view sessions st & lookup' (view selectedSession st)) . liftRecordName) (view lifts st) lastSetTable = renderTable $ table $ map (padLeftRight 1 . txt) ["Lift", "Set", "Plates", "Goal", "Done", "Rest"] : concatMap (toLiftRows (view week st)) lifts' header = renderTable $ table $ map (padLeftRight 1 . txt) ["Date", "Time", "Bodyweight", "Week", "Session"] : [ map (padLeftRight 2 . txt) [" ", " ", " ", weekNumber, sessionName] ] weekNumber = case (view week st) of Week1 -> "1"; Week2 -> "2"; Week3 -> "3" - sessionName = liftName $ head lifts' + sessionName = liftRecordName $ head lifts' oneRepMaxTable = renderTable $ table $ map (padLeftRight 1 . txt) ["Lift", "Achieved Best", "Computed 1RM"] : map toRow lifts' toRow LiftRecord{..} = let best@Achieved{..} = bestPerformance stats in map (padLeftRight 2) [ - txt $ liftName, + txt $ liftRecordName, str $ printf "%d @ %d" achievedReps achievedWeight, str $ showRational $ computeOneRepMax best ] -- cgit v1.2.3