" I represent a set logged against a prescription. " Class { #name : 'MFTSetLog', #superclass : 'MFTObject', #instVars : [ 'prescription', 'reps', 'load', 'failureAchieved' ], #category : 'MyFitnessTracker-Core-Logging', #package : 'MyFitnessTracker-Core', #tag : 'Logging' } { #category : 'accessing' } MFTSetLog class >> forPrescription: aMFTSetPrescription [ ^ self new prescription: aMFTSetPrescription; yourself ] { #category : 'as yet unclassified' } MFTSetLog class >> reps: anInteger load: aNumber [ ^ self new reps: anInteger; load: aNumber; yourself ] { #category : 'initialization' } MFTSetLog >> canonicalName [ ^ self isLogged ifTrue: [ reps asString , '×' , load asString , ' ' , prescription exercise canonicalName ] ifFalse: [ 'unlogged set' ] ] { #category : 'accessing' } MFTSetLog >> exercise [ ^ prescription exercise ] { #category : 'accessing' } MFTSetLog >> failureAchieved [ ^ failureAchieved ] { #category : 'accessing' } MFTSetLog >> failureAchieved: aBoolean [ failureAchieved := aBoolean ] { #category : 'initialization' } MFTSetLog >> initialize [ super initialize. failureAchieved := false ] { #category : 'as yet unclassified' } MFTSetLog >> intensityFactor [ failureAchieved ifTrue: [ ^ 100 ]. "TODO: determine intensity factor as a function of PR and maybe workout duration" ^ 0 ] { #category : 'initialization' } MFTSetLog >> isLogged [ ^ reps isNotNil and: [ load isNotNil ] ] { #category : 'as yet unclassified' } MFTSetLog >> load [ ^ load ] { #category : 'as yet unclassified' } MFTSetLog >> load: aNumber [ load := aNumber ] { #category : 'as yet unclassified' } MFTSetLog >> prescription [ ^ prescription ] { #category : 'as yet unclassified' } MFTSetLog >> prescription: aMFTSetPrescription [ prescription := aMFTSetPrescription ] { #category : 'as yet unclassified' } MFTSetLog >> progressionDecision [ ^ prescription repScheme progressionFor: reps ] { #category : 'as yet unclassified' } MFTSetLog >> reps [ ^ reps ] { #category : 'as yet unclassified' } MFTSetLog >> reps: anInteger [ reps := anInteger ] { #category : 'as yet unclassified' } MFTSetLog >> volume [ ^ (reps isNil or: [ load isNil ]) ifTrue: [ 0 ] ifFalse: [ reps * load ] ]