This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 82ef39c9cefc9215691fde23d85e2f9a9b330ec6 Author: Tony CHEMIT <chemit@codelutin.com> Date: Tue Feb 10 11:30:02 2015 +0100 fixes #6628 --- .../tutti/service/catches/WeightComputingService.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/WeightComputingService.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/WeightComputingService.java index 05cd6d2..f0ec9f0 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/WeightComputingService.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/catches/WeightComputingService.java @@ -233,9 +233,7 @@ public class WeightComputingService extends AbstractTuttiService { if (speciesTotalSortedWeight == null) { speciesTotalSortedWeight = catchBatch.getSpeciesTotalSortedComputedWeight(); } - Float speciesTotalWeight = speciesTotalComputedUnsortedWeight + speciesTotalSortedWeight; - catchBatch.setSpeciesTotalComputedWeight( - Weights.roundKiloGram(speciesTotalWeight)); + // Benthos Float benthosTotalComputedSortedWeight = 0f; @@ -291,9 +289,6 @@ public class WeightComputingService extends AbstractTuttiService { if (benthosTotalSortedWeight == null) { benthosTotalSortedWeight = catchBatch.getBenthosTotalSortedComputedWeight(); } - Float benthosTotalWeight = benthosTotalComputedUnsortedWeight + benthosTotalSortedWeight; - catchBatch.setBenthosTotalComputedWeight( - Weights.roundKiloGram(benthosTotalWeight)); // Marine litter Float marineLitterTotalComputedWeight = 0f; @@ -366,6 +361,14 @@ public class WeightComputingService extends AbstractTuttiService { totalSortedWeight += rejectedWeight; } catchBatch.setCatchTotalSortedComputedWeight(Weights.roundKiloGram(totalSortedWeight)); + + Float catchRate = totalSortedWeight / totalSortedSortedWeight; + + Float speciesTotalWeight = speciesTotalSortedWeight * catchRate + speciesTotalComputedUnsortedWeight; + catchBatch.setSpeciesTotalComputedWeight(Weights.roundKiloGram(speciesTotalWeight)); + + Float benthosTotalWeight = benthosTotalSortedWeight * catchRate + benthosTotalComputedUnsortedWeight; + catchBatch.setBenthosTotalComputedWeight(Weights.roundKiloGram(benthosTotalWeight)); } private int currentSpeciesRowIndex; -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.