branch feature/8204 updated (fb7af9a -> 1b68887)
This is an automated email from the git hooks/post-receive script. New change to branch feature/8204 in repository tutti. See https://gitlab.nuiton.org/codelutin/tutti.git from fb7af9a On decremente uniquement si le code matché est le plus haut + amélioration code new 1f6c3a9 we show the popup until the user enters a valid sample code (refs #8204) new 1b68887 add or remove the sampling code even if the row should not be sampled according to the protocol (fixes #8204) The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 1b688874ee5f478e245dff4760439078e19a6d97 Author: Kevin Morin <morin@codelutin.com> Date: Mon Apr 4 16:24:32 2016 +0200 add or remove the sampling code even if the row should not be sampled according to the protocol (fixes #8204) commit 1f6c3a9a8b77b2ae102256dee0e1bb76274e1cc7 Author: Kevin Morin <morin@codelutin.com> Date: Mon Apr 4 16:22:38 2016 +0200 we show the popup until the user enters a valid sample code (refs #8204) Summary of changes: .../service/sampling/CruiseSamplingCache.java | 9 ++-- .../frequency/actions/EditSampleCodeAction.java | 50 +++++++++++++--------- 2 files changed, 34 insertions(+), 25 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/8204 in repository tutti. See https://gitlab.nuiton.org/codelutin/tutti.git commit 1f6c3a9a8b77b2ae102256dee0e1bb76274e1cc7 Author: Kevin Morin <morin@codelutin.com> Date: Mon Apr 4 16:22:38 2016 +0200 we show the popup until the user enters a valid sample code (refs #8204) --- .../frequency/actions/EditSampleCodeAction.java | 50 +++++++++++++--------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/actions/EditSampleCodeAction.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/actions/EditSampleCodeAction.java index 43478e8..91ff95a 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/actions/EditSampleCodeAction.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/actions/EditSampleCodeAction.java @@ -60,40 +60,48 @@ public class EditSampleCodeAction extends SimpleActionSupport<SpeciesFrequencyUI int selectedRowIndex = obsTable.getSelectedRow(); IndividualObservationBatchRowModel selectedRow = obsTableModel.getRows().get(selectedRowIndex); SampleCodeEditionPopupUI sampleCodeEditionPopupUI = new SampleCodeEditionPopupUI(ui); - sampleCodeEditionPopupUI.open(selectedRow.getSamplingCodePrefix(), selectedRow.getSamplingCodeId()); - SampleCodeEditionPopupUIModel model = sampleCodeEditionPopupUI.getModel(); - if (model.isValid()) { + boolean samplingCodeAvailable = false; + boolean modelValid; + do { + Integer samplingCodeId = selectedRow.getSamplingCodeId(); + sampleCodeEditionPopupUI.open(selectedRow.getSamplingCodePrefix(), samplingCodeId); - Integer sampleCode = model.getSampleCode(); + SampleCodeEditionPopupUIModel model = sampleCodeEditionPopupUI.getModel(); + modelValid = model.isValid(); - String samplingCode = model.getSampleCodePrefix().toSamplingCode(sampleCode); - if (log.isDebugEnabled()) { - log.debug("Test if sampling code " + samplingCode + " is available."); - } - - IndividualObservationUICache individualObservationUICache = ui.getHandler().getIndividualObservationUICache(); + if (modelValid) { - boolean samplingCodeAvailable = isSamplingCodeAvailable(individualObservationUICache, sampleCode, selectedRow); - if (!samplingCodeAvailable) { + Integer sampleCode = model.getSampleCode(); + String samplingCode = model.getSampleCodePrefix().toSamplingCode(sampleCode); if (log.isDebugEnabled()) { - log.debug("Sampling code " + samplingCode + " is not available."); + log.debug("Test if sampling code " + samplingCode + " is available."); } - TuttiUIContext.getApplicationContext().getErrorHelper().showErrorDialog(t("tutti.editSpeciesFrequencies.error.notAvailableSamplingCode", samplingCode)); - } else { + IndividualObservationUICache individualObservationUICache = ui.getHandler().getIndividualObservationUICache(); - if (log.isDebugEnabled()) { - log.debug("Sampling code " + samplingCode + " is available, use it on selected row."); - } + samplingCodeAvailable = samplingCodeId.equals(sampleCode) || isSamplingCodeAvailable(individualObservationUICache, sampleCode, selectedRow); + if (!samplingCodeAvailable) { - selectedRow.setSamplingCode(samplingCode); - obsTableModel.fireTableRowsUpdated(selectedRowIndex, selectedRowIndex); + if (log.isDebugEnabled()) { + log.debug("Sampling code " + samplingCode + " is not available."); + } + TuttiUIContext.getApplicationContext().getErrorHelper().showErrorDialog(t("tutti.editSpeciesFrequencies.error.notAvailableSamplingCode", samplingCode)); + } else { + + if (log.isDebugEnabled()) { + log.debug("Sampling code " + samplingCode + " is available, use it on selected row."); + } + + selectedRow.setSamplingCode(samplingCode); + obsTableModel.fireTableRowsUpdated(selectedRowIndex, selectedRowIndex); + + } } - } + } while (!samplingCodeAvailable && modelValid); } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/8204 in repository tutti. See https://gitlab.nuiton.org/codelutin/tutti.git commit 1b688874ee5f478e245dff4760439078e19a6d97 Author: Kevin Morin <morin@codelutin.com> Date: Mon Apr 4 16:24:32 2016 +0200 add or remove the sampling code even if the row should not be sampled according to the protocol (fixes #8204) --- .../fr/ifremer/tutti/service/sampling/CruiseSamplingCache.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSamplingCache.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSamplingCache.java index c2a25e2..dd03eb7 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSamplingCache.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSamplingCache.java @@ -390,8 +390,6 @@ public class CruiseSamplingCache implements Closeable { int operationSamplingNb = operationCache.incrementSamplingNb(operationKey); - addSamplingCode(species.getReferenceTaxonId(), samplingCode); - if (log.isInfoEnabled()) { log.info("add Sampling " + samplingKey + " => op " + operationSamplingNb + " / zone " + zoneSamplingNb + " / cruise " + totalSamplingNb); } @@ -399,6 +397,8 @@ public class CruiseSamplingCache implements Closeable { SamplingEvent event = new SamplingEvent(this, lengthStep, gender, maturity, cpsDefinition, optionalZone, totalSamplingNb, zoneSamplingNb, operationSamplingNb); fireResumeUpdated(event); } + + addSamplingCode(species.getReferenceTaxonId(), samplingCode); } /** @@ -593,8 +593,6 @@ public class CruiseSamplingCache implements Closeable { int operationSamplingNb = operationCache.decrementSamplingNb(operationKey); - removeSamplingCode(species.getReferenceTaxonId(), samplingCode); - if (log.isInfoEnabled()) { log.info("remove Sampling " + samplingKey + " => op " + operationSamplingNb + " / zone " + zoneSamplingNb + " / cruise " + totalSamplingNb); } @@ -602,6 +600,9 @@ public class CruiseSamplingCache implements Closeable { SamplingEvent event = new SamplingEvent(this, lengthStep, gender, maturity, cpsDefinition, optionalZone, totalSamplingNb, zoneSamplingNb, operationSamplingNb); fireResumeUpdated(event); } + + removeSamplingCode(species.getReferenceTaxonId(), samplingCode); + } /** -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm