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 ea5bb503c3260d314f95279414e3eb4256765053 Author: Kevin Morin <morin@codelutin.com> Date: Mon Mar 14 17:20:40 2016 +0100 on cherche la classe de taille dans les observations individuelles en plus des mensurations (au cas où il n'y ait pas de mensurations) --- .../frequency/SpeciesFrequencyUIHandler.java | 29 +++++++++++++--------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java index 393c4e9..bf798b1 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java @@ -695,7 +695,6 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci frequencyEditor = editor; Caracteristic lengthStepCaracteristic = null; - Float lengthStep; List<SpeciesFrequencyRowModel> rows = Lists.newArrayList(); List<IndividualObservationBatchRowModel> obsRows = Lists.newArrayList(); @@ -743,6 +742,7 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci } List<SpeciesFrequencyRowModel> frequency = speciesBatch.getFrequency(); + List<IndividualObservationBatchRowModel> individualObservations = speciesBatch.getIndividualObservation(); // try to load existing frequency @@ -764,13 +764,11 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci SpeciesFrequencyRowModel rowModel = frequency.get(0); lengthStepCaracteristic = rowModel.getLengthStepCaracteristic(); - lengthStep = rowModel.getLengthStep(); if (log.isInfoEnabled()) { log.info("Use existing lengthStep " + "caracteristic / step " + - decorate(lengthStepCaracteristic) + " / " + - lengthStep); + decorate(lengthStepCaracteristic)); } } @@ -782,8 +780,6 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci addMaturityCaracteristicColumnToModel(maturityCaracteristic.get()); } - List<IndividualObservationBatchRowModel> individualObservations = speciesBatch.getIndividualObservation(); - // try to load existing frequency if (CollectionUtils.isNotEmpty(individualObservations)) { @@ -810,6 +806,19 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci obsRows.add(newRow); } + + // use first frequency row length step caracteristics + + if (lengthStepCaracteristic == null) { + IndividualObservationBatchRowModel rowModel = individualObservations.get(0); + lengthStepCaracteristic = rowModel.getLengthStepCaracteristic(); + + if (log.isInfoEnabled()) { + log.info("Use existing lengthStep " + + "caracteristic / step " + + decorate(lengthStepCaracteristic)); + } + } } SpeciesBatchRowModel previousSiblingRow = frequencyEditor.getPreviousSiblingRow(); @@ -824,12 +833,10 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci // use the first frequency length step caracteristic / step SpeciesFrequencyRowModel rowModel = previousFrequency.get(0); lengthStepCaracteristic = rowModel.getLengthStepCaracteristic(); - lengthStep = rowModel.getLengthStep(); if (log.isInfoEnabled()) { log.info("Use previous sibling existing lengthStep " + "caracteristic / step " + - decorate(lengthStepCaracteristic) + " / " + - lengthStep); + decorate(lengthStepCaracteristic)); } } } @@ -841,13 +848,11 @@ public class SpeciesFrequencyUIHandler extends AbstractTuttiTableUIHandler<Speci if (lengthStepPmfmId != null) { lengthStepCaracteristic = lengthStepCaracteristics.get(lengthStepPmfmId); - lengthStep = taxonCache.getLengthStep(species); if (log.isInfoEnabled()) { log.info("Use existing from protocol lengthStep " + "caracteristic / step " + - decorate(lengthStepCaracteristic) + " / " + - lengthStep); + decorate(lengthStepCaracteristic)); } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.