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 1d7865cb5b140d2ab8b1360ca7b88e9617d878ce Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Jan 7 09:36:39 2016 +0100 Gestion des espèces qui ne viennent pas du protocole + correction de l'algorithme de choix du mode à afficher (See #7163) --- .../catches/benthos/create/CreateBenthosBatchUIHandler.java | 13 +++++++++---- .../catches/species/create/CreateSpeciesBatchUIHandler.java | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java index a6f6e31..e99dd58 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/create/CreateBenthosBatchUIHandler.java @@ -163,11 +163,16 @@ public class CreateBenthosBatchUIHandler extends AbstractTuttiTableUIHandler<Spl // get species protocol to check the measurement method SpeciesProtocol speciesProtocol = TuttiProtocols.getBenthosProtocol(getDataContext().getProtocol(), newValue.getReferenceTaxonId()); - String lengthStepPmfmId = speciesProtocol.getLengthStepPmfmId(); - source.setSpeciesProtocolFrequencyMode(lengthStepPmfmId != null ? - CreateBenthosBatchUIModel.SpeciesProtocolFrequencyMode.MEASURE : - CreateBenthosBatchUIModel.SpeciesProtocolFrequencyMode.COUNT); + CreateBenthosBatchUIModel.SpeciesProtocolFrequencyMode frequencyMode = null; + if (speciesProtocol != null) { + if (speciesProtocol.getLengthStepPmfmId() != null) { + frequencyMode = CreateBenthosBatchUIModel.SpeciesProtocolFrequencyMode.MEASURE; + } else if (speciesProtocol.isCountIfNoFrequencyEnabled()) { + frequencyMode = CreateBenthosBatchUIModel.SpeciesProtocolFrequencyMode.COUNT; + } + } + source.setSpeciesProtocolFrequencyMode(frequencyMode); } } }; diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java index 74ebcc4..7058de7 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/create/CreateSpeciesBatchUIHandler.java @@ -162,11 +162,16 @@ public class CreateSpeciesBatchUIHandler extends AbstractTuttiTableUIHandler<Spl // get species protocol to check the measurement method SpeciesProtocol speciesProtocol = TuttiProtocols.getSpeciesProtocol(getDataContext().getProtocol(), newValue.getReferenceTaxonId()); - String lengthStepPmfmId = speciesProtocol.getLengthStepPmfmId(); - source.setSpeciesProtocolFrequencyMode(lengthStepPmfmId != null ? - CreateSpeciesBatchUIModel.SpeciesProtocolFrequencyMode.MEASURE : - CreateSpeciesBatchUIModel.SpeciesProtocolFrequencyMode.COUNT); + CreateSpeciesBatchUIModel.SpeciesProtocolFrequencyMode frequencyMode = null; + if (speciesProtocol != null) { + if (speciesProtocol.getLengthStepPmfmId() != null) { + frequencyMode = CreateSpeciesBatchUIModel.SpeciesProtocolFrequencyMode.MEASURE; + } else if (speciesProtocol.isCountIfNoFrequencyEnabled()) { + frequencyMode = CreateSpeciesBatchUIModel.SpeciesProtocolFrequencyMode.COUNT; + } + } + source.setSpeciesProtocolFrequencyMode(frequencyMode); } } }; -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.