This is an automated email from the git hooks/post-receive script. New commit to branch feature/5823 in repository tutti. See http://git.codelutin.com/tutti.git commit 259cbfd485181ede5b3167957d23ce83261039dd Author: Kevin Morin <morin@codelutin.com> Date: Fri Jan 16 17:57:18 2015 +0100 ajout du champ vrac trié --- .../src/main/xmi/tutti-persistence.zargo | Bin 57987 -> 58066 bytes .../service/catches/WeightComputingService.java | 27 +++++++++++++-------- .../resources/i18n/tutti-service_fr_FR.properties | 2 +- .../operation/catches/EditCatchesUIHandler.java | 16 +++++++++--- .../operation/catches/EditCatchesUIModel.java | 27 +++++++++++++++------ tutti-ui-swing/src/main/resources/EcranResume.svg | 16 ++++++------ .../resources/i18n/tutti-ui-swing_en_GB.properties | 2 ++ .../resources/i18n/tutti-ui-swing_fr_FR.properties | 2 ++ 8 files changed, 61 insertions(+), 31 deletions(-) diff --git a/tutti-persistence/src/main/xmi/tutti-persistence.zargo b/tutti-persistence/src/main/xmi/tutti-persistence.zargo index ea0d4d8..18682a6 100644 Binary files a/tutti-persistence/src/main/xmi/tutti-persistence.zargo and b/tutti-persistence/src/main/xmi/tutti-persistence.zargo differ 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 b5fcc14..05cd6d2 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 @@ -327,25 +327,26 @@ public class WeightComputingService extends AbstractTuttiService { Float totalUnsortedWeight = catchBatch.getSpeciesTotalUnsortedComputedWeight() + catchBatch.getBenthosTotalUnsortedComputedWeight(); - Float totalSortedWeight = speciesTotalSortedWeight + benthosTotalSortedWeight; + Float totalSortedSortedWeight = speciesTotalSortedWeight + benthosTotalSortedWeight; - catchBatch.setCatchTotalSortedComputedWeight(Weights.roundKiloGram(totalSortedWeight)); + catchBatch.setCatchTotalSortedSortedComputedWeight(Weights.roundKiloGram(totalSortedSortedWeight)); catchBatch.setCatchTotalUnsortedComputedWeight(Weights.roundKiloGram(totalUnsortedWeight)); Float totalWeight = catchBatch.getCatchTotalWeight(); Float rejectedWeight = catchBatch.getCatchTotalRejectedWeight(); if (rejectedWeight == null && totalWeight != null) { - if (Weights.isNotEqualWeight(totalWeight, totalUnsortedWeight + totalSortedWeight)) { + if (Weights.isNotEqualWeight(totalWeight, totalUnsortedWeight + totalSortedSortedWeight)) { throw new ApplicationBusinessException(t("tutti.service.operations.computeWeights.error.incoherentTotal")); - } else { - catchBatch.setCatchTotalRejectedComputedWeight( - Weights.roundKiloGram(totalWeight - - totalUnsortedWeight - - totalSortedWeight)); } + //FIXME voir avec Vincent si on calcule le poids rejeté + catchBatch.setCatchTotalRejectedComputedWeight( + Weights.roundKiloGram(totalWeight + - totalUnsortedWeight + - totalSortedSortedWeight)); + } else if (totalWeight == null) { if (rejectedWeight == null) { rejectedWeight = 0f; @@ -353,12 +354,18 @@ public class WeightComputingService extends AbstractTuttiService { } catchBatch.setCatchTotalComputedWeight( Weights.roundKiloGram(totalUnsortedWeight - + totalSortedWeight + + totalSortedSortedWeight + rejectedWeight)); - } else if (Weights.isNotEqualWeight(totalWeight, totalUnsortedWeight + totalSortedWeight + rejectedWeight)) { + } else if (Weights.isNotEqualWeight(totalWeight, totalUnsortedWeight + totalSortedSortedWeight + rejectedWeight)) { throw new ApplicationBusinessException(t("tutti.service.operations.computeWeights.error.incoherentTotal")); } + + Float totalSortedWeight = totalSortedSortedWeight; + if (rejectedWeight != null) { + totalSortedWeight += rejectedWeight; + } + catchBatch.setCatchTotalSortedComputedWeight(Weights.roundKiloGram(totalSortedWeight)); } private int currentSpeciesRowIndex; diff --git a/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties b/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties index 202911d..22d5621 100644 --- a/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties +++ b/tutti-service/src/main/resources/i18n/tutti-service_fr_FR.properties @@ -143,7 +143,7 @@ tutti.service.operations.computeWeights.error.benthos.incoherentSampleWeight=Ben tutti.service.operations.computeWeights.error.benthos.incoherentTotalSorted=Le poids total Vrac du benthos est inférieur à la somme des poids Vrac triés, inerte trié et vivant non détaillé trié tutti.service.operations.computeWeights.error.benthos.noWeight=Benthos - Le lot de %s/%s - %s n'a pas de poids tutti.service.operations.computeWeights.error.incoherentRowWeightCategory=Le poids de sous-échantillon est renseigné alors que le lot n'a pas de poids. -tutti.service.operations.computeWeights.error.incoherentTotal=Le poids total de la capture ne correspond pas à la somme des poids totaux Vrac, Hors Vrac et non triés +tutti.service.operations.computeWeights.error.incoherentTotal=Le poids total de la capture ne correspond pas à la somme des poids totaux Vrac et Hors Vrac tutti.service.operations.computeWeights.error.marineLitter.incoherentTotal=Le poids total des macro-déchets est inférieur à la somme des poids des macro-déchets saisis tutti.service.operations.computeWeights.error.species.incoherentCategoryWeight=Espèces - Le poids total des mensurations du lot de %s/%s - %s (%skg) est supérieur au poids de la catégorie (%skg) tutti.service.operations.computeWeights.error.species.incoherentParentCategoryWeight=Espèces - Le poids du lot de %s/%s - %s (%skg) est inférieur à la somme des poids de ses sous-catégories (%skg) diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java index f649c4b..6e8ac0a 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java @@ -80,6 +80,7 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.io.IOException; import java.net.URL; import java.util.Set; @@ -117,6 +118,7 @@ public class EditCatchesUIHandler extends AbstractTuttiTabContainerUIHandler<Edi n("tutti.editCatchBatch.field.marineLitterTotalWeight"); n("tutti.editCatchBatch.field.catchTotalSortedComputedWeight"); + n("tutti.editCatchBatch.field.catchTotalSortedSortedComputedWeight"); n("tutti.editCatchBatch.field.catchTotalUnsortedComputedWeight"); n("tutti.editCatchBatch.field.speciesTotalComputedWeight"); n("tutti.editCatchBatch.field.speciesTotalUnsortedComputedWeight"); @@ -251,7 +253,7 @@ public class EditCatchesUIHandler extends AbstractTuttiTabContainerUIHandler<Edi initSvgField(CatchBatch.PROPERTY_MARINE_LITTER_TOTAL_WEIGHT, getModel().getMarineLitterTotalComputedOrNotWeight(), marineLitterWeightUnit); initSvgField(CatchBatch.PROPERTY_CATCH_TOTAL_SORTED_COMPUTED_WEIGHT, catchWeightUnit); - // initSvgField("value_vrac_trie", getModel().getCatchTotalComputedOrNotWeight()); + initSvgField(CatchBatch.PROPERTY_CATCH_TOTAL_SORTED_SORTED_COMPUTED_WEIGHT, catchWeightUnit); initSvgField(CatchBatch.PROPERTY_CATCH_TOTAL_UNSORTED_COMPUTED_WEIGHT, catchWeightUnit); initSvgField(CatchBatch.PROPERTY_SPECIES_TOTAL_COMPUTED_WEIGHT, speciesWeightUnit); @@ -262,10 +264,11 @@ public class EditCatchesUIHandler extends AbstractTuttiTabContainerUIHandler<Edi initSvgField(CatchBatch.PROPERTY_BENTHOS_TOTAL_UNSORTED_COMPUTED_WEIGHT, benthosWeightUnit); initSvgField(CatchBatch.PROPERTY_BENTHOS_TOTAL_SAMPLE_SORTED_COMPUTED_WEIGHT, benthosWeightUnit); - } catch (Exception e) { + } catch (IOException e) { if (log.isErrorEnabled()) { log.error("error while initializing the resume background", e); } + getContext().getErrorHelper().showErrorDialog(t("tutti.editCatchBatch.svgLoading.error"), e); } } @@ -278,7 +281,10 @@ public class EditCatchesUIHandler extends AbstractTuttiTabContainerUIHandler<Edi final ComputableData<Float> computableData, final WeightUnit weightUnit) { - log.info("init " + property + " field"); + if (log.isDebugEnabled()) { + log.debug("init " + property + " field"); + } + Element labelElement = svgDocument.getElementById(property + "Label"); labelElement.setTextContent(t("tutti.editCatchBatch.field." + property)); @@ -326,7 +332,9 @@ public class EditCatchesUIHandler extends AbstractTuttiTabContainerUIHandler<Edi canvas.getUpdateManager().getUpdateRunnableQueue().invokeLater (new Runnable() { public void run() { - log.info("update " + id + " field"); + if (log.isDebugEnabled()) { + log.debug("update " + id + " field"); + } Element element = svgDocument.getElementById(id + "Value"); if (element == null) { 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 d224692..1f2de8a 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 @@ -89,25 +89,21 @@ public class EditCatchesUIModel extends AbstractTuttiBeanUIModel<CatchBatch, Edi protected ComputableData<Float> benthosTotalLivingNotItemizedComputedOrNotWeight = new ComputableData<Float>(); - protected Float planktonTotalWeight; - - protected Float planktonTotalSampleWeight; - protected ComputableData<Float> marineLitterTotalComputedOrNotWeight = new ComputableData<Float>(); - protected ComputableData<Float> catchTotalComputedOrNotWeight - = new ComputableData<Float>(); + protected ComputableData<Float> catchTotalComputedOrNotWeight = new ComputableData<Float>(); protected Float catchTotalSortedComputedWeight; + protected Float catchTotalSortedSortedComputedWeight; + protected Float catchTotalUnsortedComputedWeight; protected Float catchTotalSortedTremisWeight; protected Float catchTotalSortedCarousselWeight; - protected ComputableData<Float> catchTotalRejectedComputedOrNotWeight - = new ComputableData<Float>(); + protected ComputableData<Float> catchTotalRejectedComputedOrNotWeight = new ComputableData<Float>(); protected FishingOperation fishingOperation; @@ -257,6 +253,7 @@ public class EditCatchesUIModel extends AbstractTuttiBeanUIModel<CatchBatch, Edi setCatchTotalRejectedWeight(catchWeightUnit.fromEntity(entity.getCatchTotalRejectedWeight())); setCatchTotalSortedCarousselWeight(catchWeightUnit.fromEntity(entity.getCatchTotalSortedCarousselWeight())); setCatchTotalSortedComputedWeight(catchWeightUnit.fromEntity(entity.getCatchTotalSortedComputedWeight())); + setCatchTotalSortedSortedComputedWeight(catchWeightUnit.fromEntity(entity.getCatchTotalSortedSortedComputedWeight())); setCatchTotalSortedTremisWeight(catchWeightUnit.fromEntity(entity.getCatchTotalSortedTremisWeight())); setCatchTotalUnsortedComputedWeight(catchWeightUnit.fromEntity(entity.getCatchTotalUnsortedComputedWeight())); setCatchTotalWeight(catchWeightUnit.fromEntity(entity.getCatchTotalWeight())); @@ -303,6 +300,7 @@ public class EditCatchesUIModel extends AbstractTuttiBeanUIModel<CatchBatch, Edi result.setCatchTotalRejectedWeight(catchWeightUnit.toEntity(getCatchTotalRejectedWeight())); result.setCatchTotalSortedCarousselWeight(catchWeightUnit.toEntity(getCatchTotalSortedCarousselWeight())); result.setCatchTotalSortedComputedWeight(catchWeightUnit.toEntity(getCatchTotalSortedComputedWeight())); + result.setCatchTotalSortedSortedComputedWeight(catchWeightUnit.toEntity(getCatchTotalSortedSortedComputedWeight())); result.setCatchTotalSortedTremisWeight(catchWeightUnit.toEntity(getCatchTotalSortedTremisWeight())); result.setCatchTotalUnsortedComputedWeight(catchWeightUnit.toEntity(getCatchTotalUnsortedComputedWeight())); result.setCatchTotalWeight(catchWeightUnit.toEntity(getCatchTotalWeight())); @@ -838,6 +836,18 @@ public class EditCatchesUIModel extends AbstractTuttiBeanUIModel<CatchBatch, Edi firePropertyChange(PROPERTY_SYNCHRONIZATION_STATUS, oldValue, synchronizationStatus); } + @Override + public Float getCatchTotalSortedSortedComputedWeight() { + return catchTotalSortedSortedComputedWeight; + } + + @Override + public void setCatchTotalSortedSortedComputedWeight(Float catchTotalSortedSortedComputedWeight) { + Object oldValue = getCatchTotalSortedSortedComputedWeight(); + this.catchTotalSortedSortedComputedWeight = catchTotalSortedSortedComputedWeight; + firePropertyChange(PROPERTY_CATCH_TOTAL_SORTED_SORTED_COMPUTED_WEIGHT, oldValue, catchTotalSortedSortedComputedWeight); + } + public void reset() { setSpeciesTotalInertComputedWeight(null); setSpeciesTotalLivingNotItemizedComputedWeight(null); @@ -854,6 +864,7 @@ public class EditCatchesUIModel extends AbstractTuttiBeanUIModel<CatchBatch, Edi setMarineLitterTotalComputedWeight(null); setCatchTotalRejectedComputedWeight(null); setCatchTotalSortedComputedWeight(null); + setCatchTotalSortedSortedComputedWeight(null); setCatchTotalUnsortedComputedWeight(null); setCatchTotalComputedWeight(null); removeAllAttachment(getAttachment()); diff --git a/tutti-ui-swing/src/main/resources/EcranResume.svg b/tutti-ui-swing/src/main/resources/EcranResume.svg index bd63ad6..90473ec 100644 --- a/tutti-ui-swing/src/main/resources/EcranResume.svg +++ b/tutti-ui-swing/src/main/resources/EcranResume.svg @@ -653,7 +653,7 @@ id="g4041"> <rect style="fill:#006bba;fill-opacity:1;stroke:#444444;stroke-width:0.59367329;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" - id="rect4023" + id="catchTotalSortedComputedWeightLabelRect" width="154.08636" height="26.614988" x="409.6925" @@ -669,10 +669,10 @@ x="501.44632" height="26.829227" width="62.439663" - id="rect4029" + id="catchTotalSortedComputedWeightRect" style="fill:#ffffff;fill-opacity:1;stroke:#444444;stroke-width:0.37943435;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> <text - id="49626" + id="catchTotalSortedComputedWeightValue" y="-151.49626" x="531.71814" xml:space="preserve" @@ -898,11 +898,11 @@ style="filter:url(#filter4726)" transform="translate(4.9497475,-22.627416)"> <g - id="g4186" + id="catchTotalSortedSortedComputedWeight" transform="matrix(0.84647606,0,0,0.84647606,-245.9198,23.780278)"> <rect style="fill:#006bba;fill-opacity:1;stroke:#444444;stroke-width:0.59367329;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" - id="rect4188" + id="catchTotalSortedSortedComputedWeightLabelRect" width="154.08636" height="26.614988" x="783.69177" @@ -911,21 +911,21 @@ xml:space="preserve" x="829.71729" y="-79.496262" - id="label_vrac_trie" + id="catchTotalSortedSortedComputedWeightLabel" style="font-size:10.63231468px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;text-anchor:middle;fill:#ffffff;fill-opacity:1;font-family:Arial;-inkscape-font-specification:Arial">Vrac trié</text> <rect y="-97.070129" x="875.44556" height="26.829227" width="62.439663" - id="rect4194" + id="catchTotalSortedSortedComputedWeightRect" style="fill:#ffffff;fill-opacity:1;stroke:#444444;stroke-width:0.37943435;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> <text y="-79.496262" x="905.71741" xml:space="preserve" style="font-size:12.01316166px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;text-anchor:middle;fill:#000000;fill-opacity:1;font-family:Arial;-inkscape-font-specification:Arial" - id="value_vrac_trie">00.00 kg</text> + id="catchTotalSortedSortedComputedWeightValue">00.00 kg</text> </g> </g> <path diff --git a/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties b/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties index 748d3dd..04c644a 100644 --- a/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties +++ b/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties @@ -620,6 +620,7 @@ tutti.editCatchBatch.field.catchTotalRejectedWeight.tip= tutti.editCatchBatch.field.catchTotalSortedCarousselWeight= tutti.editCatchBatch.field.catchTotalSortedCarousselWeight.tip= tutti.editCatchBatch.field.catchTotalSortedComputedWeight= +tutti.editCatchBatch.field.catchTotalSortedSortedComputedWeight= tutti.editCatchBatch.field.catchTotalSortedTremisWeight= tutti.editCatchBatch.field.catchTotalSortedTremisWeight.tip= tutti.editCatchBatch.field.catchTotalSortedWeight= @@ -647,6 +648,7 @@ tutti.editCatchBatch.legend.benthos= tutti.editCatchBatch.legend.marineLitter= tutti.editCatchBatch.legend.species= tutti.editCatchBatch.legend.total= +tutti.editCatchBatch.svgLoading.error= tutti.editCruise.action.closeEditCruise= tutti.editCruise.action.closeEditCruise.mnemonic= tutti.editCruise.action.closeEditCruise.tip= diff --git a/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties b/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties index e8dfe70..4000b1f 100644 --- a/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties +++ b/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties @@ -605,6 +605,7 @@ tutti.editCatchBatch.field.catchTotalRejectedWeight.tip=Poids de la fraction non tutti.editCatchBatch.field.catchTotalSortedCarousselWeight=Carrousel observé tutti.editCatchBatch.field.catchTotalSortedCarousselWeight.tip=Sur Thalassa, poids total de la capture pesé sur la balance carrousel tutti.editCatchBatch.field.catchTotalSortedComputedWeight=VRAC +tutti.editCatchBatch.field.catchTotalSortedSortedComputedWeight=Vrac trié tutti.editCatchBatch.field.catchTotalSortedTremisWeight=Trémie vers carrousel tutti.editCatchBatch.field.catchTotalSortedTremisWeight.tip=Sur Thalassa, poids total de la capture pesé sur la balance trémie et envoyée sur la chaîne de tri tutti.editCatchBatch.field.catchTotalSortedWeight=Poids total VRAC TRIÉ @@ -632,6 +633,7 @@ tutti.editCatchBatch.legend.benthos=Benthos tutti.editCatchBatch.legend.marineLitter=Macro déchets tutti.editCatchBatch.legend.species=Espèces tutti.editCatchBatch.legend.total=Capture +tutti.editCatchBatch.svgLoading.error=Erreur lors du chargement du diagramme du résumé tutti.editCruise.action.closeEditCruise=Fermer tutti.editCruise.action.closeEditCruise.mnemonic=F tutti.editCruise.action.closeEditCruise.tip=Fermer l'écran d'édition de campagne -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.