From scm@users.codelutin.com Wed Apr  6 13:57:22 2016
From: "codelutin.com scm" <scm@users.codelutin.com>
To: tutti-commits@list.forge.codelutin.com
Subject: [Tutti-commits] branch feature/8203 updated (2f55a8d -> 36f362f)
Date: Wed, 06 Apr 2016 13:57:22 +0200
Message-ID: <20160406115722.22327.32852@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7619037802976925147=="

--===============7619037802976925147==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New change to branch feature/8203 in repository tutti.

See https://gitlab.nuiton.org/codelutin/tutti.git

     omits  2f55a8d   correction (pas d'incr=C3=A9ment, on r=C3=A9cup=C3=A8re=
 juste le nombre d'observations) (fixes #8203)
     omits  30f4e68   on demande au cache le r=C3=A9sum=C3=A9 de pr=C3=A9l=C3=
=A8vement pour la ligne s=C3=A9lectionn=C3=A9e (s'il n'y a qu'une ligne s=C3=
=A9lectionn=C3=A9e) (fixes #8203)
      adds  2c7e788   i18n
      adds  fb9c233   r=C3=A9cup du nombre de pr=C3=A9l=C3=A8vement par class=
e de taille pour une espece/maturit=C3=A9/sexe (refs #8157)
      adds  ee83fe8   service d'export du rapport de pr=C3=A9l=C3=A8vements (=
refs #8157)
      adds  7ba8cc4   ajout de l'action de rapport de pr=C3=A9l=C3=A8vement p=
our la campagne (refs #8157)
      adds  25ee74b   i18n (fixes #8157)
      adds  0c32490   on demande au cache de cr=C3=A9er les lignes pour l'exp=
ort (refs #8157)
      adds  eae0937   On prend en compte les pr=C3=A9l=C3=A8vements qui ne re=
ntrent pas dans le protocole (fixes #8157)
      adds  059bd44   add comment
      adds  82606f5   lengthstep non null dans l'event (refs #8157)
      adds  6fa51c5   - finalement, on ne permet pas de code pr=C3=A9l=C3=A8v=
ement si pas de taille - on remplace le code campagne par le code ruben s'iln=
 'y en a pas - dans le prefixe, on met ~ au lieu de # quand il n'y a pas de c=
ode (fixes #8157)
      adds  a44c7eb   Livrable #8157 Merge branch 'feature/8157' into develop
       new  7cec81f   on demande au cache le r=C3=A9sum=C3=A9 de pr=C3=A9l=C3=
=A8vement pour la ligne s=C3=A9lectionn=C3=A9e (s'il n'y a qu'une ligne s=C3=
=A9lectionn=C3=A9e) (fixes #8203)
       new  36f362f   correction (pas d'incr=C3=A9ment, on r=C3=A9cup=C3=A8re=
 juste le nombre d'observations) (fixes #8203)

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (2f55a8d)
            \
             N -- N -- N   refs/heads/feature/8203 (36f362f)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omits" are not gone; other references still
refer to them.  Any revisions marked "discards" are gone forever.

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 36f362fc8ae942d69b3f41a8218b1030c57ab0d1
Author: Kevin Morin <morin@codelutin.com>
Date:   Wed Apr 6 11:41:01 2016 +0200

    correction (pas d'incr=C3=A9ment, on r=C3=A9cup=C3=A8re juste le nombre d=
'observations) (fixes #8203)

commit 7cec81f6cb60ab9807e50b5a7bf9d0c954600bf6
Author: Kevin Morin <morin@codelutin.com>
Date:   Wed Apr 6 11:34:34 2016 +0200

    on demande au cache le r=C3=A9sum=C3=A9 de pr=C3=A9l=C3=A8vement pour la =
ligne s=C3=A9lectionn=C3=A9e (s'il n'y a qu'une ligne s=C3=A9lectionn=C3=A9e)=
 (fixes #8203)

Summary of changes:
 .../cps/CalcifiedPiecesSamplingExportService.java  |  85 ++++++++++
 .../service/export/cps/SamplingNumberRowModel.java |  65 ++++++++
 .../tutti/service/sampling/CacheExtractedKey.java  |  75 +++++++++
 .../service/sampling/CruiseSamplingCache.java      | 143 ++++++++--------
 .../sampling/CruiseSamplingCacheLoader.java        |   4 +-
 .../sampling/CruiseSamplingInternalCache.java      |  62 ++++++-
 .../tutti/service/sampling/SamplingCodePrefix.java |   7 +-
 .../resources/i18n/tutti-service_en_GB.properties  |  11 ++
 .../resources/i18n/tutti-service_fr_FR.properties  |  15 +-
 .../fr/ifremer/tutti/ui/swing/TuttiUIContext.java  |   5 +
 .../ui/swing/content/home/SelectCruiseUI.jaxx      |   1 +
 .../ui/swing/content/home/SelectCruiseUI.jcss      |  10 +-
 .../CalcifiedPiecesSamplingReportAction.java       | 117 ++++++++++++++
 .../IndividualObservationBatchTableModel.java      |   2 +-
 .../frequency/IndividualObservationUICache.java    |   7 +-
 .../frequency/SpeciesFrequencyUIHandler.java       | 179 +++++++++++--------=
--
 .../resources/i18n/tutti-ui-swing_en_GB.properties |  10 ++
 .../resources/i18n/tutti-ui-swing_fr_FR.properties |  10 ++
 18 files changed, 638 insertions(+), 170 deletions(-)
 create mode 100644 tutti-service/src/main/java/fr/ifremer/tutti/service/expo=
rt/cps/CalcifiedPiecesSamplingExportService.java
 create mode 100644 tutti-service/src/main/java/fr/ifremer/tutti/service/expo=
rt/cps/SamplingNumberRowModel.java
 create mode 100644 tutti-service/src/main/java/fr/ifremer/tutti/service/samp=
ling/CacheExtractedKey.java
 create mode 100644 tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/co=
ntent/home/actions/CalcifiedPiecesSamplingReportAction.java

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============7619037802976925147==--


From scm@users.codelutin.com Wed Apr  6 13:57:22 2016
From: "codelutin.com scm" <scm@users.codelutin.com>
To: tutti-commits@list.forge.codelutin.com
Subject: [Tutti-commits]  01/02: on demande au cache le =?utf-8?q?r=C3=A9sum?=
 =?utf-8?q?=C3=A9_de_pr=C3=A9l=C3=A8vement_pour_la_ligne_s=C3=A9lectionn?=
 =?utf-8?b?w6llIChzJ2lsIG4neSBhIHF1J3VuZSBsaWduZSBzw6lsZWN0aW9ubsOpZSk=?=
 (fixes #8203)
Date: Wed, 06 Apr 2016 13:57:23 +0200
Message-ID: <20160406115722.A1A295C246B@goh.codelutin.com>
In-Reply-To: <20160406115722.22327.32852@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2367555404998500843=="

--===============2367555404998500843==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New commit to branch feature/8203 in repository tutti.

See https://gitlab.nuiton.org/codelutin/tutti.git

commit 7cec81f6cb60ab9807e50b5a7bf9d0c954600bf6
Author: Kevin Morin <morin@codelutin.com>
Date:   Wed Apr 6 11:34:34 2016 +0200

    on demande au cache le r=C3=A9sum=C3=A9 de pr=C3=A9l=C3=A8vement pour la =
ligne s=C3=A9lectionn=C3=A9e (s'il n'y a qu'une ligne s=C3=A9lectionn=C3=A9e)=
 (fixes #8203)
---
 .../service/sampling/CruiseSamplingCache.java      |  58 +++++++++++-
 .../tutti/service/sampling/SamplingListener.java   |   2 +-
 .../frequency/IndividualObservationUICache.java    | 103 ++++++++++++-------=
--
 .../frequency/SpeciesFrequencyUIHandler.java       |   9 ++
 .../resources/i18n/tutti-ui-swing_en_GB.properties |   2 +
 .../resources/i18n/tutti-ui-swing_fr_FR.properties |   4 +-
 6 files changed, 132 insertions(+), 46 deletions(-)

diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/Cr=
uiseSamplingCache.java b/tutti-service/src/main/java/fr/ifremer/tutti/service=
/sampling/CruiseSamplingCache.java
index 0420d51..121b5f5 100644
--- a/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSam=
plingCache.java
+++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSam=
plingCache.java
@@ -647,6 +647,62 @@ public class CruiseSamplingCache implements Closeable {
=20
     }
=20
+    public Optional<SamplingEvent> getEventForSummary(FishingOperation fishi=
ngOperation,
+                                                      Species species, Boole=
an maturity,
+                                                      CaracteristicQualitati=
veValue gender,
+                                                      int lengthStep) {
+
+        Objects.requireNonNull(fishingOperation);
+        Objects.requireNonNull(species);
+
+        Optional < CalcifiedPiecesSamplingDefinition > cpsDefinitionOpt =3D =
getCalcifiedPiecesSamplingDefinition(species, maturity, lengthStep);
+
+        Optional<SamplingEvent> result;
+        if (cpsDefinitionOpt.isPresent()) {
+
+            CalcifiedPiecesSamplingDefinition cpsDefinition =3D cpsDefinitio=
nOpt.get();
+
+            if (log.isInfoEnabled()) {
+                log.info("Found matching sampling definition: " + cpsDefinit=
ion);
+            }
+
+            if (!cpsDefinition.isSex()) {
+                gender =3D null;
+            }
+            String samplingKey =3D CruiseSamplingInternalCache.createSamplin=
gKey(species, gender, maturity, lengthStep);
+
+            int totalValue =3D totalCruiseCache.incrementObservationNb(sampl=
ingKey);
+            int totalSamplingNb =3D totalCruiseCache.getSamplingNb(samplingK=
ey);
+
+            int zoneValue =3D 0;
+            int zoneSamplingNb =3D 0;
+
+            Optional<Zone> optionalZone =3D tryFindZone(fishingOperation);
+            if (optionalZone.isPresent()) {
+                String zoneKey =3D CruiseSamplingInternalCache.addPrefixKey(=
optionalZone.get().getId(), samplingKey);
+                zoneValue =3D zoneCache.incrementObservationNb(zoneKey);
+                zoneSamplingNb =3D zoneCache.getSamplingNb(zoneKey);
+            }
+
+            String operationKey =3D CruiseSamplingInternalCache.addPrefixKey=
(fishingOperation.getIdAsInt(), samplingKey);
+
+            int operationValue =3D operationCache.incrementObservationNb(ope=
rationKey);
+            int operationSamplingNb =3D operationCache.getSamplingNb(operati=
onKey);
+
+            if (log.isInfoEnabled()) {
+                log.info("add Individual Observation " + samplingKey + " =3D=
> op " + operationValue + " / zone " + zoneValue + " / cruise " + totalValue);
+            }
+
+            SamplingEvent event =3D new SamplingEvent(this, lengthStep, gend=
er, maturity, cpsDefinition, optionalZone, totalSamplingNb, zoneSamplingNb, o=
perationSamplingNb);
+            result =3D Optional.of(event);
+
+        } else {
+            result =3D Optional.empty();
+        }
+
+        return result;
+    }
+
     public Optional<Zone> tryFindZone(FishingOperation operation) {
         Optional<Zone> result;
         if (operation.getSubStrata() !=3D null) {
@@ -694,7 +750,7 @@ public class CruiseSamplingCache implements Closeable {
         if (samplingListeners.length > 0) {
=20
             for (SamplingListener listener : samplingListeners) {
-                listener.resumeUpdated(event);
+                listener.summaryUpdated(event);
             }
         }
     }
diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/Sa=
mplingListener.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/sa=
mpling/SamplingListener.java
index 6aa37e4..f120f10 100644
--- a/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/SamplingL=
istener.java
+++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/SamplingL=
istener.java
@@ -34,6 +34,6 @@ public interface SamplingListener extends EventListener {
=20
     void samplingNeeded(SamplingEvent event);
=20
-    void resumeUpdated(SamplingEvent event);
+    void summaryUpdated(SamplingEvent event);
 }
=20
diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/o=
peration/catches/species/frequency/IndividualObservationUICache.java b/tutti-=
ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/sp=
ecies/frequency/IndividualObservationUICache.java
index 7358b26..218cb9e 100644
--- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operatio=
n/catches/species/frequency/IndividualObservationUICache.java
+++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operatio=
n/catches/species/frequency/IndividualObservationUICache.java
@@ -162,50 +162,10 @@ public class IndividualObservationUICache implements Cl=
oseable {
             }
=20
             @Override
-            public void resumeUpdated(SamplingEvent event) {
-
-                CalcifiedPiecesSamplingDefinition cpsDef =3D event.getCpsDef=
();
-                if (log.isInfoEnabled()) {
-                    log.info("samplingNeeded for " + cpsDef);
-                }
-
-                int nbForOperation =3D event.getNbSamplingForOperation();
-                int nbForZone =3D event.getNbSamplingForZone();
-                int nbForCruise =3D event.getNbSamplingForCruise();
-
-                String nbForOperationLabel =3D getLabelForSamplingNumber(nbF=
orOperation, cpsDef.getOperationLimitation());
-                String nbForZoneLabel =3D getLabelForSamplingNumber(nbForZon=
e, cpsDef.getZoneLimitation());
-                String nbForCruiseLabel =3D getLabelForSamplingNumber(nbForC=
ruise, cpsDef.getMaxByLenghtStep());
-
-                Decorator<Species> speciesDecorator =3D ui.getHandler().getD=
ecorator(Species.class, DecoratorService.WITH_SURVEY_CODE);
-                String key =3D speciesDecorator.toString(species)
-                        + " " + Numbers.convertFromMm(event.getLengthStep(),=
 uiModel.getLengthStepCaracteristicUnit())
-                        + " " + uiModel.getLengthStepCaracteristicUnit();
-                if (event.getGender() !=3D null) {
-                    key +=3D " " + event.getGender().getDescription();
-                }
-                if (event.getMaturity() !=3D null) {
-                    if (event.getMaturity()) {
-                        key +=3D " " + t("tutti.editSpeciesFrequencies.sampl=
ingNeeded.mature");
-                    } else {
-                        key +=3D " " + t("tutti.editSpeciesFrequencies.sampl=
ingNeeded.immature");
-                    }
-                }
-                String resume;
-                if (event.getZone().isPresent()) {
-                    Decorator<Zone> zoneDecorator =3D ui.getHandler().getDec=
orator(Zone.class, null);
-                    String zone =3D zoneDecorator.toString(event.getZone().g=
et());
-                    resume =3D t("tutti.editSpeciesFrequencies.samplingNeede=
d.resume", key, nbForOperationLabel, zone, nbForZoneLabel, nbForCruiseLabel);
-                } else {
-                    resume =3D t("tutti.editSpeciesFrequencies.samplingNeede=
d.resume.noZone", key, nbForOperationLabel, nbForZoneLabel, nbForCruiseLabel);
-                }
-                ui.getSamplingResumeLabel().setText(resume);
+            public void summaryUpdated(SamplingEvent event) {
+                displaySummary(event);
             }
=20
-            String getLabelForSamplingNumber(int value, Integer max) {
-                Decorator<Integer> valueDecorator =3D ui.getHandler().getDec=
orator(Integer.class, DecoratorService.NULL_INFINITE);
-                return valueDecorator.toString(value) + "(" + valueDecorator=
.toString(max) + ")";
-            }
         };
=20
     }
@@ -495,5 +455,64 @@ public class IndividualObservationUICache implements Clo=
seable {
=20
     }
=20
+    public void updateSelectedRow(IndividualObservationBatchRowModel selecte=
dRow) {
+
+        if (samplingCache.isPresent() && selectedRow.withSize()) {
+
+            Boolean maturity =3D samplingCache.get().getMaturity(uiModel.get=
Batch().getSpecies().getReferenceTaxonId(), selectedRow.getMaturityState());
+            int lengthstep =3D uiModel.getLengthStepInMm(selectedRow.getSize=
());
+
+            Optional<SamplingEvent> event =3D samplingCache.get().getEventFo=
rSummary(fishingOperation, species, maturity, selectedRow.getGender(sexCaract=
eristic), lengthstep);
+
+            if (event.isPresent()) {
+                displaySummary(event.get());
+            }
+        }
+    }
+
+    protected void displaySummary(SamplingEvent event) {
+
+        CalcifiedPiecesSamplingDefinition cpsDef =3D event.getCpsDef();
+        if (log.isInfoEnabled()) {
+            log.info("samplingNeeded for " + cpsDef);
+        }
+
+        int nbForOperation =3D event.getNbSamplingForOperation();
+        int nbForZone =3D event.getNbSamplingForZone();
+        int nbForCruise =3D event.getNbSamplingForCruise();
+
+        String nbForOperationLabel =3D getLabelForSamplingNumber(nbForOperat=
ion, cpsDef.getOperationLimitation());
+        String nbForZoneLabel =3D getLabelForSamplingNumber(nbForZone, cpsDe=
f.getZoneLimitation());
+        String nbForCruiseLabel =3D getLabelForSamplingNumber(nbForCruise, c=
psDef.getMaxByLenghtStep());
+
+        Decorator<Species> speciesDecorator =3D ui.getHandler().getDecorator=
(Species.class, DecoratorService.WITH_SURVEY_CODE);
+        String key =3D speciesDecorator.toString(species)
+                     + " " + Numbers.convertFromMm(event.getLengthStep(), ui=
Model.getLengthStepCaracteristicUnit())
+                     + " " + uiModel.getLengthStepCaracteristicUnit();
+        if (event.getGender() !=3D null) {
+            key +=3D " " + event.getGender().getDescription();
+        }
+        if (event.getMaturity() !=3D null) {
+            if (event.getMaturity()) {
+                key +=3D " " + t("tutti.editSpeciesFrequencies.samplingNeede=
d.mature");
+            } else {
+                key +=3D " " + t("tutti.editSpeciesFrequencies.samplingNeede=
d.immature");
+            }
+        }
+        String summary;
+        if (event.getZone().isPresent()) {
+            Decorator<Zone> zoneDecorator =3D ui.getHandler().getDecorator(Z=
one.class, null);
+            String zone =3D zoneDecorator.toString(event.getZone().get());
+            summary =3D t("tutti.editSpeciesFrequencies.samplingNeeded.summa=
ry", key, nbForOperationLabel, zone, nbForZoneLabel, nbForCruiseLabel);
+        } else {
+            summary =3D t("tutti.editSpeciesFrequencies.samplingNeeded.summa=
ry.noZone", key, nbForOperationLabel, nbForZoneLabel, nbForCruiseLabel);
+        }
+        ui.getSamplingResumeLabel().setText(summary);
+    }
+
+    protected String getLabelForSamplingNumber(int value, Integer max) {
+        Decorator<Integer> valueDecorator =3D ui.getHandler().getDecorator(I=
nteger.class, DecoratorService.NULL_INFINITE);
+        return "<strong>" + valueDecorator.toString(value) + "</strong> (" +=
 valueDecorator.toString(max) + ")";
+    }
=20
 }
diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/o=
peration/catches/species/frequency/SpeciesFrequencyUIHandler.java b/tutti-ui-=
swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/speci=
es/frequency/SpeciesFrequencyUIHandler.java
index b0ef3e4..d34f561 100644
--- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operatio=
n/catches/species/frequency/SpeciesFrequencyUIHandler.java
+++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operatio=
n/catches/species/frequency/SpeciesFrequencyUIHandler.java
@@ -1416,6 +1416,15 @@ public class SpeciesFrequencyUIHandler extends Abstrac=
tTuttiTableUIHandler<Speci
=20
             getModel().recomputeCanEditLengthStep();
         });
+
+        obsTable.getSelectionModel().addListSelectionListener(e -> {
+
+            resetSamplingLabels();
+            if (obsTable.getSelectedRowCount() =3D=3D 1) {
+                IndividualObservationBatchRowModel selectedRow =3D getObsTab=
leModel().getRows().get(obsTable.getSelectedRow());
+                individualObservationUICache.updateSelectedRow(selectedRow);
+            }
+        });
     }
=20
     protected void resetSamplingLabels() {
diff --git a/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.prop=
erties b/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properti=
es
index 3d5e6fe..f7e654d 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
@@ -1648,6 +1648,8 @@ tutti.editSpeciesFrequencies.samplingNeeded.mature=3D
 tutti.editSpeciesFrequencies.samplingNeeded.max=3D
 tutti.editSpeciesFrequencies.samplingNeeded.resume=3D
 tutti.editSpeciesFrequencies.samplingNeeded.resume.noZone=3D
+tutti.editSpeciesFrequencies.samplingNeeded.summary=3D
+tutti.editSpeciesFrequencies.samplingNeeded.summary.noZone=3D
 tutti.editSpeciesFrequencies.samplingNeeded.warning=3D
 tutti.editSpeciesFrequencies.simpleCountingAndFrequencies=3D
 tutti.editSpeciesFrequencies.table.header.lengthStep=3D
diff --git a/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.prop=
erties b/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properti=
es
index 56171e9..a99f983 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
@@ -1532,8 +1532,8 @@ tutti.editSpeciesFrequencies.logTable.removeRow.confirm=
.title=3DSuppression d'une
 tutti.editSpeciesFrequencies.samplingNeeded.immature=3DImmature
 tutti.editSpeciesFrequencies.samplingNeeded.mature=3DMature
 tutti.editSpeciesFrequencies.samplingNeeded.max=3Dmax
-tutti.editSpeciesFrequencies.samplingNeeded.resume=3D<html><body><strong>%s<=
/strong> \: Trait \: %s | %s \: %s | Campagne \: %s
-tutti.editSpeciesFrequencies.samplingNeeded.resume.noZone=3D<html><body><str=
ong>%s</strong> \: Trait \: %s | (pas dans une zone) | Campagne \: %s
+tutti.editSpeciesFrequencies.samplingNeeded.summary=3D<html><body><strong>%s=
</strong> \: Trait \: %s | %s \: %s | Campagne \: %s
+tutti.editSpeciesFrequencies.samplingNeeded.summary.noZone=3D<html><body><st=
rong>%s</strong> \: Trait \: %s | (pas dans une zone) | Campagne \: %s
 tutti.editSpeciesFrequencies.samplingNeeded.warning=3D<html><body><strong>Pr=
=C3=A9levez les pi=C3=A8ces calcifi=C3=A9es \!</body></html>
 tutti.editSpeciesFrequencies.simpleCountingAndFrequencies=3DDes mensurations=
 ont =C3=A9t=C3=A9 saisies dans le tableau. Saisir un simple d=C3=A9nombremen=
t les effacera.
 tutti.editSpeciesFrequencies.table.header.lengthStep=3DClasse de taille

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============2367555404998500843==--


From scm@users.codelutin.com Wed Apr  6 13:57:23 2016
From: "codelutin.com scm" <scm@users.codelutin.com>
To: tutti-commits@list.forge.codelutin.com
Subject: [Tutti-commits]  02/02: correction (pas =?utf-8?q?d=27incr=C3=A9men?=
 =?utf-8?q?t=2C_on_r=C3=A9cup=C3=A8re?= juste le nombre d'observations) (fixes
 #8203)
Date: Wed, 06 Apr 2016 13:57:24 +0200
Message-ID: <20160406115722.C08005C47B7@goh.codelutin.com>
In-Reply-To: <20160406115722.22327.32852@bihar.codelutin.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2481528422083914165=="

--===============2481528422083914165==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This is an automated email from the git hooks/post-receive script.

New commit to branch feature/8203 in repository tutti.

See https://gitlab.nuiton.org/codelutin/tutti.git

commit 36f362fc8ae942d69b3f41a8218b1030c57ab0d1
Author: Kevin Morin <morin@codelutin.com>
Date:   Wed Apr 6 11:41:01 2016 +0200

    correction (pas d'incr=C3=A9ment, on r=C3=A9cup=C3=A8re juste le nombre d=
'observations) (fixes #8203)
---
 .../fr/ifremer/tutti/service/sampling/CruiseSamplingCache.java |  6 +++---
 .../tutti/service/sampling/CruiseSamplingInternalCache.java    | 10 ++++++++=
++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/Cr=
uiseSamplingCache.java b/tutti-service/src/main/java/fr/ifremer/tutti/service=
/sampling/CruiseSamplingCache.java
index 121b5f5..8a8de13 100644
--- a/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSam=
plingCache.java
+++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSam=
plingCache.java
@@ -671,7 +671,7 @@ public class CruiseSamplingCache implements Closeable {
             }
             String samplingKey =3D CruiseSamplingInternalCache.createSamplin=
gKey(species, gender, maturity, lengthStep);
=20
-            int totalValue =3D totalCruiseCache.incrementObservationNb(sampl=
ingKey);
+            int totalValue =3D totalCruiseCache.getObservationNb(samplingKey=
);
             int totalSamplingNb =3D totalCruiseCache.getSamplingNb(samplingK=
ey);
=20
             int zoneValue =3D 0;
@@ -680,13 +680,13 @@ public class CruiseSamplingCache implements Closeable {
             Optional<Zone> optionalZone =3D tryFindZone(fishingOperation);
             if (optionalZone.isPresent()) {
                 String zoneKey =3D CruiseSamplingInternalCache.addPrefixKey(=
optionalZone.get().getId(), samplingKey);
-                zoneValue =3D zoneCache.incrementObservationNb(zoneKey);
+                zoneValue =3D zoneCache.getObservationNb(zoneKey);
                 zoneSamplingNb =3D zoneCache.getSamplingNb(zoneKey);
             }
=20
             String operationKey =3D CruiseSamplingInternalCache.addPrefixKey=
(fishingOperation.getIdAsInt(), samplingKey);
=20
-            int operationValue =3D operationCache.incrementObservationNb(ope=
rationKey);
+            int operationValue =3D operationCache.getObservationNb(operation=
Key);
             int operationSamplingNb =3D operationCache.getSamplingNb(operati=
onKey);
=20
             if (log.isInfoEnabled()) {
diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/Cr=
uiseSamplingInternalCache.java b/tutti-service/src/main/java/fr/ifremer/tutti=
/service/sampling/CruiseSamplingInternalCache.java
index 9bd9b1a..611ba84 100644
--- a/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSam=
plingInternalCache.java
+++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/sampling/CruiseSam=
plingInternalCache.java
@@ -103,6 +103,16 @@ class CruiseSamplingInternalCache implements Closeable {
         return result;
     }
=20
+    public int getObservationNb(String samplingKey) {
+        Objects.requireNonNull(samplingKey);
+        SamplingData value =3D data.get(samplingKey);
+        int observationNb =3D value.getObservationNb();
+        if (log.isDebugEnabled()) {
+            log.debug(samplingKey + " =E2=86=92 " + observationNb);
+        }
+        return observationNb;
+    }
+
     public int incrementSamplingNb(String samplingKey) {
         Objects.requireNonNull(samplingKey);
         SamplingData value =3D data.computeIfAbsent(samplingKey, s -> new Sa=
mplingData());

--=20
To stop receiving notification emails like this one, please contact
codelutin.com SCM administrator <admin+scm@codelutin.com>.

--===============2481528422083914165==--


