This is an automated email from the git hooks/post-receive script. New commit to branch support/3.13.x in repository tutti. See http://git.codelutin.com/tutti.git commit 4d87a9bfdc6123d5aa52580f0e871a46cd81fc8e Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Mar 12 15:03:10 2015 +0100 corrige la règle de mise en warning du hors vrac espèce observé et benthos observé --- .../operation/catches/EditCatchesUIModel.java | 37 ++++++++++++---------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java index 4f358b5..3d6737a 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIModel.java @@ -627,8 +627,11 @@ public class EditCatchesUIModel extends AbstractTuttiBeanUIModel<CatchBatch, Edi } /** - * Les espèces observées sont en warning lors qu'on a du Vrac non trié et que les espèces isolées sont - * exactement le vrac observé. + * Les espèces observées sont en warning lorsque : + * + * * pas de poids vrac non trié (ou = 0) + * * poids espèce observé (hors vrac) présent et > 0 + * * poids espèce observé (vrac) vaut poids espèce trié (vrac) * * @return {@code true} quand le les espèces observées sont en warning, {@code false} dans les autres cas. */ @@ -636,13 +639,12 @@ public class EditCatchesUIModel extends AbstractTuttiBeanUIModel<CatchBatch, Edi Float catchTotalRejectedWeight = getCatchTotalRejectedComputedOrNotWeight().getDataOrComputedData(); Float speciesTotalSortedWeight = getSpeciesTotalSortedComputedOrNotWeight().getDataOrComputedData(); - boolean warning = catchTotalRejectedWeight != null - && speciesTotalSortedWeight != null - && speciesTotalSampleSortedComputedWeight != null - && Weights.isGreaterWeight(catchTotalRejectedWeight, 0f) - && Weights.isEqualWeight(speciesTotalSortedWeight, - speciesTotalSampleSortedComputedWeight); + boolean noCatchTotalRejected = catchTotalRejectedWeight == null || Weights.isEqualWeight(catchTotalRejectedWeight, 0f); + boolean noTotalUnsortedWeight = speciesTotalUnsortedComputedWeight != null && Weights.isGreaterWeight(speciesTotalUnsortedComputedWeight, 0f); + boolean speciesWeightEquals = speciesTotalSortedWeight != null && speciesTotalSampleSortedComputedWeight !=null + && Weights.isEqualWeight(speciesTotalSortedWeight, speciesTotalSampleSortedComputedWeight); + boolean warning = noTotalUnsortedWeight && noCatchTotalRejected && speciesWeightEquals; return warning; } @@ -771,8 +773,11 @@ public class EditCatchesUIModel extends AbstractTuttiBeanUIModel<CatchBatch, Edi } /** - * Le benthos observé sont en warning lors qu'on a du Vrac non trié et que le benthos isolé vaut - * exactement le benthos vrac observé. + * Le benthos observé est en warning lorsque : + * + * * pas de poids vrac non trié (ou = 0) + * * poids benthos observé (hors vrac) présent et > 0 + * * poids benthos observé (vrac) vaut poids benthos trié (vrac) * * @return {@code true} quand le le benthos est en warning, {@code false} dans les autres cas. */ @@ -780,14 +785,14 @@ public class EditCatchesUIModel extends AbstractTuttiBeanUIModel<CatchBatch, Edi Float catchTotalRejectedWeight = getCatchTotalRejectedComputedOrNotWeight().getDataOrComputedData(); Float benthosTotalSortedWeight = getBenthosTotalSortedComputedOrNotWeight().getDataOrComputedData(); - boolean warning = catchTotalRejectedWeight != null - && benthosTotalSortedWeight != null - && benthosTotalSampleSortedComputedWeight != null - && Weights.isGreaterWeight(catchTotalRejectedWeight, 0f) - && Weights.isEqualWeight(benthosTotalSortedWeight, - benthosTotalSampleSortedComputedWeight); + boolean noCatchTotalRejected = catchTotalRejectedWeight == null || Weights.isEqualWeight(catchTotalRejectedWeight, 0f); + boolean noTotalUnsortedWeight = benthosTotalUnsortedComputedWeight != null && Weights.isGreaterWeight(benthosTotalUnsortedComputedWeight, 0f); + boolean benthosWeightEquals = benthosTotalSortedWeight != null && benthosTotalSampleSortedComputedWeight !=null + && Weights.isEqualWeight(benthosTotalSortedWeight, benthosTotalSampleSortedComputedWeight); + boolean warning = noTotalUnsortedWeight && noCatchTotalRejected && benthosWeightEquals; return warning; + } //------------------------------------------------------------------------// -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.