WT 1.1.25+5 weight calculation fixes in the training
This commit is contained in:
@@ -84,6 +84,23 @@ class TrainingPlanRepository {
|
||||
return plan;
|
||||
}
|
||||
|
||||
CustomerTrainingPlanDetails? getDetailById(CustomerTrainingPlan? plan, int customerTrainingPlanDetailsId) {
|
||||
CustomerTrainingPlanDetails? foundDetail;
|
||||
|
||||
if (plan == null || plan.details.length == 0 || customerTrainingPlanDetailsId == 0) {
|
||||
return foundDetail;
|
||||
}
|
||||
|
||||
for (var detail in plan.details) {
|
||||
if (detail.customerTrainingPlanDetailsId == customerTrainingPlanDetailsId) {
|
||||
foundDetail = detail;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return foundDetail;
|
||||
}
|
||||
|
||||
CustomerTrainingPlanDetails createAlternativeDetail(
|
||||
CustomerTrainingPlan plan, CustomerTrainingPlanDetails detail, TrainingPlanDetail elem, int exerciseTypeId) {
|
||||
CustomerTrainingPlanDetails alternativeDetail = CustomerTrainingPlanDetails();
|
||||
@@ -256,7 +273,7 @@ class TrainingPlanRepository {
|
||||
//detail.weight = Common.calculateWeigthByChangedQuantity(detail.weight!, detail.repeats!.toDouble(), lastExercise1RM!.quantity!);
|
||||
//weight = lastExercise1RM!.unitQuantity! * detail.repeats! / lastExercise1RM!.quantity!;
|
||||
weight = Common.roundWeight(weight);
|
||||
print("Recaluclated weight ${detail.weight} - repeat: ${detail.repeats}");
|
||||
//print("Recaluclated weight ${detail.weight} - repeat: ${detail.repeats}");
|
||||
|
||||
//detail.repeats = Common.calculateQuantityByChangedWeight(oneRepMax, weight, detail.repeats!.toDouble());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user