Tutti-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
July 2013
- 4 participants
- 57 discussions
r1144 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency
by tchemit@users.forge.codelutin.com 16 Jul '13
by tchemit@users.forge.codelutin.com 16 Jul '13
16 Jul '13
Author: tchemit
Date: 2013-07-16 19:50:28 +0200 (Tue, 16 Jul 2013)
New Revision: 1144
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1144
Log:
fixes #2880: [MENSURATION] generation des classes avec un pas de 0.1 (fix alos for benthos)
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIHandler.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIHandler.java 2013-07-16 17:48:55 UTC (rev 1143)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/benthos/frequency/BenthosFrequencyUIHandler.java 2013-07-16 17:50:28 UTC (rev 1144)
@@ -398,7 +398,9 @@
Float maxStep = model.getLengthStep(model.getMaxStep());
Caracteristic lengthStepCaracteristic = model.getLengthStepCaracteristic();
- for (float i = minStep, step = model.getStep(); i <= maxStep; i += step) {
+ for (float i = minStep, step = model.getStep(); i <= maxStep;
+ i = model.getLengthStep(i+step)) {
+
if (!rowsByStep.containsKey(i)) {
// add it
1
0
Author: tchemit
Date: 2013-07-16 19:48:55 +0200 (Tue, 16 Jul 2013)
New Revision: 1143
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1143
Log:
remove bad release
Removed:
tags/tutti-2.3.3/
1
0
r1142 - in trunk: . tutti-persistence tutti-service tutti-ui-swing
by maven-release@users.forge.codelutin.com 16 Jul '13
by maven-release@users.forge.codelutin.com 16 Jul '13
16 Jul '13
Author: maven-release
Date: 2013-07-16 19:46:22 +0200 (Tue, 16 Jul 2013)
New Revision: 1142
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1142
Log:
[maven-release-plugin] prepare for next development iteration
Modified:
trunk/pom.xml
trunk/tutti-persistence/pom.xml
trunk/tutti-service/pom.xml
trunk/tutti-ui-swing/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-07-16 17:46:13 UTC (rev 1141)
+++ trunk/pom.xml 2013-07-16 17:46:22 UTC (rev 1142)
@@ -32,7 +32,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.3.3</version>
+ <version>2.4-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Tutti</name>
@@ -86,12 +86,12 @@
</modules>
<scm>
- <url>http://svn.forge.codelutin.com/svn/tutti/tags/tutti-2.3.3</url>
+ <url>http://svn.forge.codelutin.com/svn/tutti/trunk</url>
<connection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-2.3.3
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-2.3.3
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
</developerConnection>
</scm>
<distributionManagement>
Modified: trunk/tutti-persistence/pom.xml
===================================================================
--- trunk/tutti-persistence/pom.xml 2013-07-16 17:46:13 UTC (rev 1141)
+++ trunk/tutti-persistence/pom.xml 2013-07-16 17:46:22 UTC (rev 1142)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.3.3</version>
+ <version>2.4-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-service/pom.xml
===================================================================
--- trunk/tutti-service/pom.xml 2013-07-16 17:46:13 UTC (rev 1141)
+++ trunk/tutti-service/pom.xml 2013-07-16 17:46:22 UTC (rev 1142)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.3.3</version>
+ <version>2.4-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2013-07-16 17:46:13 UTC (rev 1141)
+++ trunk/tutti-ui-swing/pom.xml 2013-07-16 17:46:22 UTC (rev 1142)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.3.3</version>
+ <version>2.4-SNAPSHOT</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
1
0
Author: maven-release
Date: 2013-07-16 19:46:13 +0200 (Tue, 16 Jul 2013)
New Revision: 1141
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1141
Log:
[maven-release-plugin] copy for tag tutti-2.3.3
Added:
tags/tutti-2.3.3/
1
0
r1140 - in trunk: . tutti-persistence tutti-service tutti-ui-swing
by maven-release@users.forge.codelutin.com 16 Jul '13
by maven-release@users.forge.codelutin.com 16 Jul '13
16 Jul '13
Author: maven-release
Date: 2013-07-16 19:46:04 +0200 (Tue, 16 Jul 2013)
New Revision: 1140
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1140
Log:
[maven-release-plugin] prepare release tutti-2.3.3
Modified:
trunk/pom.xml
trunk/tutti-persistence/pom.xml
trunk/tutti-service/pom.xml
trunk/tutti-ui-swing/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-07-16 17:40:26 UTC (rev 1139)
+++ trunk/pom.xml 2013-07-16 17:46:04 UTC (rev 1140)
@@ -32,7 +32,7 @@
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.3.3-SNAPSHOT</version>
+ <version>2.3.3</version>
<packaging>pom</packaging>
<name>Tutti</name>
@@ -86,12 +86,12 @@
</modules>
<scm>
- <url>http://svn.forge.codelutin.com/svn/tutti/trunk</url>
+ <url>http://svn.forge.codelutin.com/svn/tutti/tags/tutti-2.3.3</url>
<connection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-2.3.3
</connection>
<developerConnection>
- scm:svn:http://svn.forge.codelutin.com/svn/tutti/trunk
+ scm:svn:http://svn.forge.codelutin.com/svn/tutti/tags/tutti-2.3.3
</developerConnection>
</scm>
<distributionManagement>
Modified: trunk/tutti-persistence/pom.xml
===================================================================
--- trunk/tutti-persistence/pom.xml 2013-07-16 17:40:26 UTC (rev 1139)
+++ trunk/tutti-persistence/pom.xml 2013-07-16 17:46:04 UTC (rev 1140)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.3.3-SNAPSHOT</version>
+ <version>2.3.3</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-service/pom.xml
===================================================================
--- trunk/tutti-service/pom.xml 2013-07-16 17:40:26 UTC (rev 1139)
+++ trunk/tutti-service/pom.xml 2013-07-16 17:46:04 UTC (rev 1140)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.3.3-SNAPSHOT</version>
+ <version>2.3.3</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
Modified: trunk/tutti-ui-swing/pom.xml
===================================================================
--- trunk/tutti-ui-swing/pom.xml 2013-07-16 17:40:26 UTC (rev 1139)
+++ trunk/tutti-ui-swing/pom.xml 2013-07-16 17:46:04 UTC (rev 1140)
@@ -27,7 +27,7 @@
<parent>
<groupId>fr.ifremer</groupId>
<artifactId>tutti</artifactId>
- <version>2.3.3-SNAPSHOT</version>
+ <version>2.3.3</version>
</parent>
<groupId>fr.ifremer.tutti</groupId>
1
0
Author: tchemit
Date: 2013-07-16 19:40:26 +0200 (Tue, 16 Jul 2013)
New Revision: 1139
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1139
Log:
fixes #2871: [TECH] Erreur dans les logs lors de la mise ?\195?\160 jour
Modified:
trunk/src/update/update-tutti.properties
Modified: trunk/src/update/update-tutti.properties
===================================================================
--- trunk/src/update/update-tutti.properties 2013-07-16 14:56:40 UTC (rev 1138)
+++ trunk/src/update/update-tutti.properties 2013-07-16 17:40:26 UTC (rev 1139)
@@ -29,6 +29,7 @@
jre.version=@jreVersion@
linux.i386.jre.url=zip:http://nexus.nuiton.org/nexus/content/repositories/j…
windows.i386.jre.url=zip:http://nexus.nuiton.org/nexus/content/repositories…
+windows.x86.jre.url=zip:http://nexus.nuiton.org/nexus/content/repositories/jvm/com/oracle/jre/@jreVersion@/jre-@jreVersion@-windows-i586.zip
#linux.amd64.jre.url=zip:http://nexus.nuiton.org/nexus/content/repositories/jvm/com/oracle/jre/@jreVersion@/jre-@jreVersion@-linux-x64.zip
#windows.amd64.jre.url=zip:http://nexus.nuiton.org/nexus/content/repositories/jvm/com/oracle/jre/@jreVersion@/jre-@jreVersion@-windows-x64.zip
1
0
r1138 - trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency
by tchemit@users.forge.codelutin.com 16 Jul '13
by tchemit@users.forge.codelutin.com 16 Jul '13
16 Jul '13
Author: tchemit
Date: 2013-07-16 16:56:40 +0200 (Tue, 16 Jul 2013)
New Revision: 1138
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1138
Log:
fixes #2880: [MENSURATION] generation des classes avec un pas de 0.1
Modified:
trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
Modified: trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java
===================================================================
--- trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-07-16 14:33:14 UTC (rev 1137)
+++ trunk/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/species/frequency/SpeciesFrequencyUIHandler.java 2013-07-16 14:56:40 UTC (rev 1138)
@@ -61,6 +61,9 @@
import java.awt.event.KeyEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.math.BigDecimal;
+import java.math.MathContext;
+import java.math.RoundingMode;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -114,9 +117,9 @@
protected boolean isRowValid(SpeciesFrequencyRowModel row) {
return row.getLengthStepCaracteristic() != null &&
row.getLengthStep() != null &&
- ((row.getNumber() == null && row.getWeight() == null) ||
- (row.getNumber() != null && row.getNumber() > 0 &&
- (withWeightRows.isEmpty() || row.getWeight() != null && row.getWeight() > 0)));
+ ((row.getNumber() == null && row.getWeight() == null) ||
+ (row.getNumber() != null && row.getNumber() > 0 &&
+ (withWeightRows.isEmpty() || row.getWeight() != null && row.getWeight() > 0)));
}
@Override
@@ -398,7 +401,9 @@
Float maxStep = model.getLengthStep(model.getMaxStep());
Caracteristic lengthStepCaracteristic = model.getLengthStepCaracteristic();
- for (float i = minStep, step = model.getStep(); i <= maxStep; i += step) {
+ for (float i = minStep, step = model.getStep(); i <= maxStep;
+ i = model.getLengthStep(i+step)) {
+
if (!rowsByStep.containsKey(i)) {
// add it
1
0
r1137 - in trunk/tutti-service/src: main/java/fr/ifremer/tutti/service/export test/java/fr/ifremer/tutti/service/export
by tchemit@users.forge.codelutin.com 16 Jul '13
by tchemit@users.forge.codelutin.com 16 Jul '13
16 Jul '13
Author: tchemit
Date: 2013-07-16 16:33:14 +0200 (Tue, 16 Jul 2013)
New Revision: 1137
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1137
Log:
fixes #2877: [Export generique] ?\195?\169cart par rapport aux attentes
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportRow.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java 2013-07-16 13:12:23 UTC (rev 1136)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java 2013-07-16 14:33:14 UTC (rev 1137)
@@ -122,11 +122,15 @@
Float speciesCatchRaisingFactor,
Float benthosCatchRaisingFactor) {
+ Caracteristic weightMeasuredCaracteristic = persistenceService.getWeightMeasuredCaracteristic();
+ String batchWeightUnit = weightMeasuredCaracteristic.getUnit();
+
for (SpeciesBatch speciesBatch : rootSpeciesBatch.getChildren()) {
CatchExportRow row = new CatchExportRow();
row.setCruise(cruise);
row.setFishingOperation(operation);
row.setSpecies(speciesBatch.getSpecies());
+ row.setBatchWeightUnit(batchWeightUnit);
if (TuttiEntities.isVracSpeciesBatch(speciesBatch)) {
@@ -154,6 +158,7 @@
row.setCruise(cruise);
row.setFishingOperation(operation);
row.setSpecies(benthosBatch.getSpecies());
+ row.setBatchWeightUnit(batchWeightUnit);
if (TuttiEntities.isVracBenthosBatch(benthosBatch)) {
@@ -463,7 +468,7 @@
newNullableColumnForExport("Tot_" + headerPrefix, categoryName + "." + ExportSampleCategory.PROPERTY_CATEGORY_WEIGHT, TuttiCsvUtil.FLOAT);
newNullableColumnForExport("Ech_" + headerPrefix, categoryName + "." + ExportSampleCategory.PROPERTY_SAMPLE_WEIGHT, TuttiCsvUtil.FLOAT);
newNullableColumnForExport("Type_Volume_Poids_" + headerPrefix, categoryName + "." + ExportSampleCategory.PROPERTY_WEIGHT_OR_VOL_TYPE);
- newNullableColumnForExport("Unite_Volume_Poids_" + headerPrefix, categoryName + "." + ExportSampleCategory.PROPERTY_CATEGORY_CARACTERISTIC + "." + Caracteristic.PROPERTY_UNIT);
+ newNullableColumnForExport("Unite_Volume_Poids_" + headerPrefix, CatchExportRow.BATCH_WEIGHT_UNIT);
}
}
\ No newline at end of file
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportRow.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportRow.java 2013-07-16 13:12:23 UTC (rev 1136)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportRow.java 2013-07-16 14:33:14 UTC (rev 1137)
@@ -85,6 +85,8 @@
public static final String BATCH_NUMBER = "batchNumber";
+ public static final String BATCH_WEIGHT_UNIT = "batchWeightUnit";
+
protected Cruise cruise;
protected FishingOperation fishingOperation;
@@ -105,6 +107,8 @@
protected Integer batchNumber;
+ protected String batchWeightUnit;
+
protected final List<String> comment = Lists.newArrayList();
public void setCruise(Cruise cruise) {
@@ -227,6 +231,14 @@
return batchNumber;
}
+ public String getBatchWeightUnit() {
+ return batchWeightUnit;
+ }
+
+ public void setBatchWeightUnit(String batchWeightUnit) {
+ this.batchWeightUnit = batchWeightUnit;
+ }
+
public CatchExportRow copy() {
CatchExportRow result = new CatchExportRow();
result.setCruise(cruise);
@@ -243,6 +255,7 @@
result.setRaisingFactor(raisingFactor);
result.setReferenceWeight(referenceWeight);
result.setBatchNumber(batchNumber);
+ result.setBatchWeightUnit(batchWeightUnit);
result.comment.addAll(comment);
return result;
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java 2013-07-16 13:12:23 UTC (rev 1136)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java 2013-07-16 14:33:14 UTC (rev 1137)
@@ -75,25 +75,25 @@
public static final String CATCH_CONTENT =
"Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;Taxon;Nom_scientifique;Commentaire;VracHorsVrac;Num_Ordre_VracHorsVrac_H2;Tot_VracHorsVrac;Ech_VracHorsVrac;Type_Volume_Poids_VracHorsVrac;Unite_Volume_Poids_VracHorsVrac;Cat_Tri;Num_Ordre_Cat_Tri_H2;Tot_Cat_Tri;Ech_Cat_Tri;Type_Volume_Poids_Cat_Tri;Unite_Volume_Poids_Cat_Tri;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Maturite;Ech_Maturite;Type_Volume_Poids_Maturite;Unite_Volume_Poids_Maturite;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Final_Elevation\n" +
- "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1938;Agonus cataphractus;AGONCAT-vrac-80;Vrac;1;80.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;80.0;5.4444447;\n" +
- "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;ALOSALO-vrac|ALOSALO-vrac-male 60;Vrac;2;;;Poids;;NA;;;;;;Mâle;1;60.0;;Poids;;NA;;;;;;NA;;;;;;;;;;;;;;60.0;9.074075;\n" +
- "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;ALOSALO-vrac|ALOSALO-vrac-femelle 40;Vrac;2;;;Poids;;NA;;;;;;Femelle;2;40.0;;Poids;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;5.0;1;0.6;cm;1.0;4;0.6;907.4074;\n" +
- "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;ALOSALO-vrac|ALOSALO-vrac-femelle 40;Vrac;2;;;Poids;;NA;;;;;;Femelle;2;40.0;;Poids;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;6.0;2;0.4;cm;1.0;10;0.4;1361.1111;\n" +
- "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1938;Agonus cataphractus;AGONCAT-horsvrac-20;Hors Vrac;1;20.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;20.0;1.0;\n" +
- "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1938;Agonus cataphractus;Trait B-2-1 AGONCAT-vrac 80;Vrac;1;80.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;80.0;3.5;\n" +
- "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1358;Alosa alosa;Trait B-2-1 ALOSALO Vrac|Trait B-2-1 ALOSALO Vrac - Male 60;Vrac;2;;;Poids;;NA;;;;;;Mâle;1;60.0;;Poids;;NA;;;;;;NA;;;;;;;;;;;;;;60.0;5.8333335;\n" +
- "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1358;Alosa alosa;Trait B-2-1 ALOSALO Vrac|Trait B-2-1 ALOSALO Vrac - Femelle 40.0;Vrac;2;;;Poids;;NA;;;;;;Femelle;2;40.0;;Poids;;NA;;;;;;NA;;;;;;;;;;;;;;40.0;8.75;\n" +
- "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1938;Agonus cataphractus;Trait B-2-1 AGONCAT-horsvrac 20;Hors Vrac;1;20.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;20.0;1.0;\n" +
+ "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1938;Agonus cataphractus;AGONCAT-vrac-80;Vrac;1;80.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;80.0;5.4444447;\n" +
+ "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;ALOSALO-vrac|ALOSALO-vrac-male 60;Vrac;2;;;Poids;kg;NA;;;;;kg;Mâle;1;60.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;60.0;9.074075;\n" +
+ "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;ALOSALO-vrac|ALOSALO-vrac-femelle 40;Vrac;2;;;Poids;kg;NA;;;;;kg;Femelle;2;40.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;5.0;1;0.6;cm;1.0;4;0.6;907.4074;\n" +
+ "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;ALOSALO-vrac|ALOSALO-vrac-femelle 40;Vrac;2;;;Poids;kg;NA;;;;;kg;Femelle;2;40.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;6.0;2;0.4;cm;1.0;10;0.4;1361.1111;\n" +
+ "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1938;Agonus cataphractus;AGONCAT-horsvrac-20;Hors Vrac;1;20.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;20.0;1.0;\n" +
+ "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1938;Agonus cataphractus;Trait B-2-1 AGONCAT-vrac 80;Vrac;1;80.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;80.0;3.5;\n" +
+ "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1358;Alosa alosa;Trait B-2-1 ALOSALO Vrac|Trait B-2-1 ALOSALO Vrac - Male 60;Vrac;2;;;Poids;kg;NA;;;;;kg;Mâle;1;60.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;60.0;5.8333335;\n" +
+ "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1358;Alosa alosa;Trait B-2-1 ALOSALO Vrac|Trait B-2-1 ALOSALO Vrac - Femelle 40.0;Vrac;2;;;Poids;kg;NA;;;;;kg;Femelle;2;40.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;40.0;8.75;\n" +
+ "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1938;Agonus cataphractus;Trait B-2-1 AGONCAT-horsvrac 20;Hors Vrac;1;20.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;20.0;1.0;\n" +
"2013;test elevation;1;OTB 20/28.10;B;2;1;278970;4622;Abietinaria abietina;\"Trait B-2-1 Benthos ABIEABI Vrac 30\n" +
"\n" +
"avec \n" +
"\n" +
- "commentaire...\";Vrac;1;30.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;30.0;7.0;\n" +
+ "commentaire...\";Vrac;1;30.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;30.0;7.0;\n" +
"2013;test elevation;1;OTB 20/28.10;B;2;1;278970;380;Acanthocardia echinata;\"Trait B-2-1 Benthos ACANECH Vrac 18\n" +
"\n" +
"avec \n" +
"\n" +
- "commentaire...\";Vrac;2;18.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;18.0;7.0;";
+ "commentaire...\";Vrac;2;18.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;;18.0;7.0;";
protected TuttiExportService service;
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java 2013-07-16 13:12:23 UTC (rev 1136)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java 2013-07-16 14:33:14 UTC (rev 1137)
@@ -109,47 +109,47 @@
public static final String CATCH_CONTENT =
"Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;Taxon;Nom_scientifique;Commentaire;VracHorsVrac;Num_Ordre_VracHorsVrac_H2;Tot_VracHorsVrac;Ech_VracHorsVrac;Type_Volume_Poids_VracHorsVrac;Unite_Volume_Poids_VracHorsVrac;Cat_Tri;Num_Ordre_Cat_Tri_H2;Tot_Cat_Tri;Ech_Cat_Tri;Type_Volume_Poids_Cat_Tri;Unite_Volume_Poids_Cat_Tri;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Maturite;Ech_Maturite;Type_Volume_Poids_Maturite;Unite_Volume_Poids_Maturite;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Final_Elevation\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|||;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Mâle;1;30.0;;Poids;;1 - Stade 1;1;10.0;5.0;Poids;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.0;1;;cm;0.5;5;5.0;20.0;\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|||;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Mâle;1;30.0;;Poids;;1 - Stade 1;1;10.0;5.0;Poids;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;2;;cm;0.5;2;5.0;20.0;\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|||;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Mâle;1;30.0;;Poids;;1 - Stade 1;1;10.0;5.0;Poids;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;11.0;3;;cm;0.5;1;5.0;20.0;\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|||;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Mâle;1;30.0;;Poids;;3 - Stade 3;3;10.0;;Poids;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;11.0;1;;cm;0.5;5;10.0;10.0;\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;||;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Femelle;2;50.0;30.0;Poids;;3 - Stade 3;3;10.0;;Poids;;NA;;;;;;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;10.0;1;;cm;;5;30.0;3.3333333;\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;||;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Femelle;2;50.0;30.0;Poids;;3 - Stade 3;3;10.0;;Poids;;NA;;;;;;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;11.0;2;;cm;;6;30.0;3.3333333;\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;||;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Femelle;2;50.0;30.0;Poids;;3 - Stade 3;3;10.0;;Poids;;NA;;;;;;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;12.0;3;;cm;;7;30.0;3.3333333;\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|;Vrac;1;100.0;;Poids;;M - Moyen;2;20.0;;Poids;;Femelle;2;50.0;30.0;Poids;;3 - Stade 3;3;10.0;;Poids;;NA;;;;;;;;;;;;;;20.0;5.0;\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;;Hors Vrac;1;20.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;2;20.0;1.0;";
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;1 - Stade 1;1;10.0;5.0;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.0;1;;cm;0.5;5;5.0;20.0;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;1 - Stade 1;1;10.0;5.0;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;2;;cm;0.5;2;5.0;20.0;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;1 - Stade 1;1;10.0;5.0;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;11.0;3;;cm;0.5;1;5.0;20.0;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Mâle;1;30.0;;Poids;kg;3 - Stade 3;3;10.0;;Poids;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;11.0;1;;cm;0.5;5;10.0;10.0;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Femelle;2;50.0;30.0;Poids;kg;3 - Stade 3;3;10.0;;Poids;kg;NA;;;;;kg;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;10.0;1;;cm;;5;30.0;3.3333333;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Femelle;2;50.0;30.0;Poids;kg;3 - Stade 3;3;10.0;;Poids;kg;NA;;;;;kg;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;11.0;2;;cm;;6;30.0;3.3333333;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;||;Vrac;1;100.0;;Poids;kg;G - Gros;1;80.0;;Poids;kg;Femelle;2;50.0;30.0;Poids;kg;3 - Stade 3;3;10.0;;Poids;kg;NA;;;;;kg;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;12.0;3;;cm;;7;30.0;3.3333333;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|;Vrac;1;100.0;;Poids;kg;M - Moyen;2;20.0;;Poids;kg;Femelle;2;50.0;30.0;Poids;kg;3 - Stade 3;3;10.0;;Poids;kg;NA;;;;;kg;;;;;;;;;20.0;5.0;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;;Hors Vrac;1;20.0;;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;2;20.0;1.0;";
public static final String CATCH_CONTENT_2 =
"Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;Taxon;Nom_scientifique;Commentaire;VracHorsVrac;Num_Ordre_VracHorsVrac_H2;Tot_VracHorsVrac;Ech_VracHorsVrac;Type_Volume_Poids_VracHorsVrac;Unite_Volume_Poids_VracHorsVrac;Cat_Tri;Num_Ordre_Cat_Tri_H2;Tot_Cat_Tri;Ech_Cat_Tri;Type_Volume_Poids_Cat_Tri;Unite_Volume_Poids_Cat_Tri;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Maturite;Ech_Maturite;Type_Volume_Poids_Maturite;Unite_Volume_Poids_Maturite;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Final_Elevation\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;365;Aequipecten opercularis;taxon;Vrac;1;0.005;0.005;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;1;0.005;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;491;Alloteuthis;taxon;Vrac;2;0.004;0.004;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;1;0.004;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;300;Buccinum undatum;taxon;Vrac;3;0.015;0.015;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;1;0.015;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1811;Callionymus lyra;taxon;Vrac;4;0.07;0.07;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;1;0.07;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1644;Dicentrarchus labrax;taxon;Vrac;5;1.06;1.06;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;36.0;1;;cm;1.0;1;1.06;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1644;Dicentrarchus labrax;taxon;Vrac;5;1.06;1.06;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;38.0;2;;cm;1.0;1;1.06;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1362;Engraulis encrasicolus;taxon;Vrac;6;0.038;0.038;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;1;;cm;0.5;2;0.038;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1362;Engraulis encrasicolus;taxon;Vrac;6;0.038;0.038;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;12.5;2;;cm;0.5;1;0.038;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1362;Engraulis encrasicolus;taxon;Vrac;6;0.038;0.038;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;13.0;3;;cm;0.5;1;0.038;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1986;Limanda limanda;taxon;Vrac;7;0.66;0.66;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;25.0;1;;cm;1.0;1;0.66;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1986;Limanda limanda;taxon;Vrac;7;0.66;0.66;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;28.0;2;;cm;1.0;1;0.66;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1986;Limanda limanda;taxon;Vrac;7;0.66;0.66;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;30.0;3;;cm;1.0;1;0.66;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;489;Loligo vulgaris;taxon;Vrac;8;0.28;0.28;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;302;Longueur du manteau (LM) - individu - manteau - Mesure au cm par un observateur;9.0;1;;cm;1.0;1;0.28;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;489;Loligo vulgaris;taxon;Vrac;8;0.28;0.28;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;302;Longueur du manteau (LM) - individu - manteau - Mesure au cm par un observateur;10.0;2;;cm;1.0;3;0.28;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;489;Loligo vulgaris;taxon;Vrac;8;0.28;0.28;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;302;Longueur du manteau (LM) - individu - manteau - Mesure au cm par un observateur;11.0;3;;cm;1.0;2;0.28;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1988;Microstomus kitt;taxon;Vrac;9;0.152;0.152;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;15.0;1;;cm;1.0;1;0.152;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1988;Microstomus kitt;taxon;Vrac;9;0.152;0.152;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;18.0;2;;cm;1.0;1;0.152;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1690;Mullus surmuletus;taxon;Vrac;10;0.036;0.036;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;11.0;1;;cm;1.0;1;0.036;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1978;Pleuronectes platessa;taxon;Vrac;11;0.852;0.852;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;26.0;1;;cm;1.0;1;0.852;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1978;Pleuronectes platessa;taxon;Vrac;11;0.852;0.852;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;30.0;2;;cm;1.0;1;0.852;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1351;Sardina pilchardus;taxon;Vrac;12;0.022;0.022;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;1;;cm;0.5;1;0.022;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1772;Scomber scombrus;taxon;Vrac;13;0.18;0.18;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;27.0;1;;cm;1.0;1;0.18;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1242;Scyliorhinus canicula;taxon|categorie_individu;Vrac;14;;;Poids;;NA;;;;;;Femelle;1;1.0;1.0;Poids;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;51.0;1;;cm;1.0;1;1.0;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1242;Scyliorhinus canicula;taxon|categorie_individu;Vrac;14;;;Poids;;NA;;;;;;Femelle;1;1.0;1.0;Poids;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;55.0;2;;cm;1.0;1;1.0;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon|categorie_individu;Vrac;15;;;Poids;;P - Petit;1;131.12;0.96;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;8.0;1;;cm;1.0;1;0.96;136.71875;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon|categorie_individu;Vrac;15;;;Poids;;P - Petit;1;131.12;0.96;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;9.0;2;;cm;1.0;20;0.96;136.71875;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon|categorie_individu;Vrac;15;;;Poids;;P - Petit;1;131.12;0.96;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;10.0;3;;cm;1.0;89;0.96;136.71875;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon|categorie_individu;Vrac;15;;;Poids;;P - Petit;1;131.12;0.96;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;11.0;4;;cm;1.0;5;0.96;136.71875;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon|categorie_individu;Vrac;15;;;Poids;;G - Gros;2;0.13;0.13;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;23.0;1;;cm;1.0;1;0.13;1009.6154;";
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;365;Aequipecten opercularis;taxon;Vrac;1;0.005;0.005;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;0.005;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;491;Alloteuthis;taxon;Vrac;2;0.004;0.004;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;0.004;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;300;Buccinum undatum;taxon;Vrac;3;0.015;0.015;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;0.015;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1811;Callionymus lyra;taxon;Vrac;4;0.07;0.07;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;;;;;;;;1;0.07;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1644;Dicentrarchus labrax;taxon;Vrac;5;1.06;1.06;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;36.0;1;;cm;1.0;1;1.06;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1644;Dicentrarchus labrax;taxon;Vrac;5;1.06;1.06;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;38.0;2;;cm;1.0;1;1.06;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1362;Engraulis encrasicolus;taxon;Vrac;6;0.038;0.038;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;1;;cm;0.5;2;0.038;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1362;Engraulis encrasicolus;taxon;Vrac;6;0.038;0.038;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;12.5;2;;cm;0.5;1;0.038;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1362;Engraulis encrasicolus;taxon;Vrac;6;0.038;0.038;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;13.0;3;;cm;0.5;1;0.038;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1986;Limanda limanda;taxon;Vrac;7;0.66;0.66;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;25.0;1;;cm;1.0;1;0.66;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1986;Limanda limanda;taxon;Vrac;7;0.66;0.66;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;28.0;2;;cm;1.0;1;0.66;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1986;Limanda limanda;taxon;Vrac;7;0.66;0.66;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;30.0;3;;cm;1.0;1;0.66;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;489;Loligo vulgaris;taxon;Vrac;8;0.28;0.28;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;302;Longueur du manteau (LM) - individu - manteau - Mesure au cm par un observateur;9.0;1;;cm;1.0;1;0.28;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;489;Loligo vulgaris;taxon;Vrac;8;0.28;0.28;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;302;Longueur du manteau (LM) - individu - manteau - Mesure au cm par un observateur;10.0;2;;cm;1.0;3;0.28;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;489;Loligo vulgaris;taxon;Vrac;8;0.28;0.28;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;302;Longueur du manteau (LM) - individu - manteau - Mesure au cm par un observateur;11.0;3;;cm;1.0;2;0.28;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1988;Microstomus kitt;taxon;Vrac;9;0.152;0.152;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;15.0;1;;cm;1.0;1;0.152;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1988;Microstomus kitt;taxon;Vrac;9;0.152;0.152;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;18.0;2;;cm;1.0;1;0.152;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1690;Mullus surmuletus;taxon;Vrac;10;0.036;0.036;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;11.0;1;;cm;1.0;1;0.036;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1978;Pleuronectes platessa;taxon;Vrac;11;0.852;0.852;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;26.0;1;;cm;1.0;1;0.852;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1978;Pleuronectes platessa;taxon;Vrac;11;0.852;0.852;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;30.0;2;;cm;1.0;1;0.852;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1351;Sardina pilchardus;taxon;Vrac;12;0.022;0.022;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;1;;cm;0.5;1;0.022;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1772;Scomber scombrus;taxon;Vrac;13;0.18;0.18;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;27.0;1;;cm;1.0;1;0.18;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1242;Scyliorhinus canicula;taxon|categorie_individu;Vrac;14;;;Poids;kg;NA;;;;;kg;Femelle;1;1.0;1.0;Poids;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;51.0;1;;cm;1.0;1;1.0;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1242;Scyliorhinus canicula;taxon|categorie_individu;Vrac;14;;;Poids;kg;NA;;;;;kg;Femelle;1;1.0;1.0;Poids;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;55.0;2;;cm;1.0;1;1.0;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon|categorie_individu;Vrac;15;;;Poids;kg;P - Petit;1;131.12;0.96;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;8.0;1;;cm;1.0;1;0.96;136.71875;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon|categorie_individu;Vrac;15;;;Poids;kg;P - Petit;1;131.12;0.96;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;9.0;2;;cm;1.0;20;0.96;136.71875;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon|categorie_individu;Vrac;15;;;Poids;kg;P - Petit;1;131.12;0.96;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;10.0;3;;cm;1.0;89;0.96;136.71875;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon|categorie_individu;Vrac;15;;;Poids;kg;P - Petit;1;131.12;0.96;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;11.0;4;;cm;1.0;5;0.96;136.71875;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon|categorie_individu;Vrac;15;;;Poids;kg;G - Gros;2;0.13;0.13;Poids;kg;NA;;;;;kg;NA;;;;;kg;NA;;;;;kg;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;23.0;1;;cm;1.0;1;0.13;1009.6154;";
public static final String MARINE_LITTER_CONTENT =
"Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;MarineLitterCategory;MarineLitterSizeCategory;Number;Weight;Commentaire\n" +
1
0
r1136 - in trunk/tutti-service/src: main/java/fr/ifremer/tutti/service/export test/java/fr/ifremer/tutti/service/export
by tchemit@users.forge.codelutin.com 16 Jul '13
by tchemit@users.forge.codelutin.com 16 Jul '13
16 Jul '13
Author: tchemit
Date: 2013-07-16 15:12:23 +0200 (Tue, 16 Jul 2013)
New Revision: 1136
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1136
Log:
refs #2877: [Export generique] ?\195?\169cart par rapport aux attentes
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportRow.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportModel.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportRow.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java 2013-07-12 16:07:22 UTC (rev 1135)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java 2013-07-16 13:12:23 UTC (rev 1136)
@@ -41,8 +41,6 @@
import fr.ifremer.tutti.service.PersistenceService;
import fr.ifremer.tutti.service.TuttiCsvUtil;
import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import java.io.Serializable;
import java.util.List;
@@ -56,9 +54,6 @@
*/
public class CatchExportModel extends TuttiCsvUtil.AbstractTuttiExportModel<CatchExportRow> {
- /** Logger. */
- private static final Log log = LogFactory.getLog(CatchExportModel.class);
-
public static final String WEIGHT_OR_VOL_TYPE = "Poids";
Map<SampleCategoryEnum, Caracteristic> sampleCategoryToCaracteristics;
@@ -79,7 +74,7 @@
newColumnForExport("Poche", FishingOperation.PROPERTY_MULTIRIG_AGGREGATION);
newColumnForExport("Navire", Cruise.PROPERTY_VESSEL, TuttiCsvUtil.VESSEL_VALUE_FORMATTER);
newColumnForExport("Taxon", SpeciesBatch.PROPERTY_SPECIES + "." + Species.PROPERTY_REFERENCE_TAXON_ID, TuttiCsvUtil.INTEGER);
- newColumnForExport("Nom scientifique", SpeciesBatch.PROPERTY_SPECIES + "." + Species.PROPERTY_NAME);
+ newColumnForExport("Nom_scientifique", SpeciesBatch.PROPERTY_SPECIES + "." + Species.PROPERTY_NAME);
newColumnForExport("Commentaire", SpeciesBatch.PROPERTY_COMMENT);
for (SampleCategoryEnum sampleCategoryEnum : samplingOrder) {
@@ -132,7 +127,6 @@
row.setCruise(cruise);
row.setFishingOperation(operation);
row.setSpecies(speciesBatch.getSpecies());
- row.addComment(speciesBatch.getComment());
if (TuttiEntities.isVracSpeciesBatch(speciesBatch)) {
@@ -145,10 +139,11 @@
float totalBatchWeight = speciesCatchRaisingFactor *
sortedBatchWeight;
- prepareSortedRows(persistenceService, row, rows,
+ prepareSortedRows(persistenceService,
+ row,
+ rows,
speciesBatch,
- totalBatchWeight
- );
+ totalBatchWeight);
} else {
prepareUnsortedRows(row, rows, speciesBatch);
}
@@ -159,7 +154,7 @@
row.setCruise(cruise);
row.setFishingOperation(operation);
row.setSpecies(benthosBatch.getSpecies());
- row.addComment(benthosBatch.getComment());
+
if (TuttiEntities.isVracBenthosBatch(benthosBatch)) {
// compute species total weight in catch
@@ -171,7 +166,9 @@
float totalBatchWeight = benthosCatchRaisingFactor *
sortedBatchWeight;
- prepareSortedRows(persistenceService, row, rows,
+ prepareSortedRows(persistenceService,
+ row,
+ rows,
benthosBatch,
totalBatchWeight);
} else {
@@ -186,6 +183,8 @@
SpeciesBatch speciesBatch,
final float totalBatchWeight) {
+ currentRow.addComment(speciesBatch.getComment());
+
prepareBatch(currentRow,
speciesBatch.getSampleCategoryType(),
speciesBatch.getSampleCategoryValue(),
@@ -202,30 +201,6 @@
List<SpeciesBatchFrequency> speciesBatchFrequency =
persistenceService.getAllSpeciesBatchFrequency(speciesBatch.getId());
- // check if there is a sub sampling weight
- // if so then adapt raisingFactor
-
-// Float subWeight = TuttiExportService.getValueOrComputedValue(
-// speciesBatch.getWeight(), speciesBatch.getComputedWeight());
-//
-// if (subWeight != null) {
-//
-// float batchWeight = TuttiExportService.getValueOrComputedValue(
-// speciesBatch.getSampleCategoryWeight(),
-// speciesBatch.getSampleCategoryComputedWeight());
-//
-// if (batchWeight - subWeight > 0.0001f) {
-// // sub sample, adapt raising factor
-// raisingFactor *= batchWeight / subWeight;
-//
-// if (log.isDebugEnabled()) {
-// log.debug("Using a sub sample on leaf : " +
-// subWeight + " out of " + batchWeight +
-// ", new raising Factor= " + raisingFactor);
-// }
-// }
-// }
-
if (CollectionUtils.isEmpty(speciesBatchFrequency)) {
// no frequency
@@ -287,38 +262,6 @@
} else {
- // Yet another sample category to walk through
-
- // Compute total child weights (to adapt raising factor if necessary)
-
-// float childTotalWeight = 0f;
-// for (SpeciesBatch childBatch : speciesBatch.getChildBatchs()) {
-// float childWeight = TuttiExportService.getValueOrComputedValue(
-// childBatch.getSampleCategoryWeight(),
-// childBatch.getSampleCategoryComputedWeight());
-// childTotalWeight += childWeight;
-// }
-
-// float currentWeight = TuttiExportService.getValueOrComputedValue(
-// speciesBatch.getSampleCategoryWeight(),
-// speciesBatch.getSampleCategoryComputedWeight());
-
-// if (currentWeight - childTotalWeight > 0.0001f) {
-//
-// // there is a sub sampling
-// // adapt raising factor
-//
-// // sub sample, adapt raising factor
-// raisingFactor *= currentWeight / childTotalWeight;
-//
-// if (log.isDebugEnabled()) {
-// log.debug("Using a sub sample for childs of category " +
-// speciesBatch + ": " + childTotalWeight +
-// " out of " + currentWeight +
-// ", new raising Factor= " + raisingFactor);
-// }
-// }
-
for (SpeciesBatch childBatch : speciesBatch.getChildBatchs()) {
prepareSortedRows(persistenceService,
currentRow,
@@ -328,12 +271,17 @@
);
}
}
+
+ // remove last comment (otherwise next brother will have this one too...)
+ currentRow.popLastComment();
}
protected void prepareUnsortedRows(CatchExportRow currentRow,
List<CatchExportRow> rows,
SpeciesBatch speciesBatch) {
+
+
prepareBatch(currentRow,
speciesBatch.getSampleCategoryType(),
speciesBatch.getSampleCategoryValue(),
@@ -344,14 +292,12 @@
speciesBatch.getRankOrder());
CatchExportRow row = currentRow.copy();
+ row.addComment(speciesBatch.getComment());
float referenceWeight = TuttiExportService.getValueOrComputedValue(
speciesBatch.getSampleCategoryWeight(),
speciesBatch.getSampleCategoryComputedWeight());
setRaisingFactor(row, referenceWeight, referenceWeight);
-
-// row.setReferenceWeight(referenceWeight);
-// row.setRaisingFactor(1.f);
rows.add(row);
}
@@ -361,6 +307,8 @@
BenthosBatch benthosBatch,
final float totalBatchWeight) {
+ currentRow.addComment(benthosBatch.getComment());
+
prepareBatch(currentRow,
benthosBatch.getSampleCategoryType(),
benthosBatch.getSampleCategoryValue(),
@@ -377,31 +325,6 @@
List<BenthosBatchFrequency> benthosBatchFrequency =
persistenceService.getAllBenthosBatchFrequency(benthosBatch.getId());
-// // check if there is a sub sampling weight
-// // if so then adapt raisingFactor
-//
-// Float subWeight = TuttiExportService.getValueOrComputedValue(
-// benthosBatch.getWeight(),
-// benthosBatch.getComputedWeight());
-//
-// if (subWeight != null) {
-//
-// float batchWeight = TuttiExportService.getValueOrComputedValue(
-// benthosBatch.getSampleCategoryWeight(),
-// benthosBatch.getSampleCategoryComputedWeight());
-//
-// if (batchWeight - subWeight > 0.0001f) {
-// // sub sample, adapt raising factor
-// raisingFactor *= batchWeight / subWeight;
-//
-// if (log.isDebugEnabled()) {
-// log.debug("Using a sub sample on leaf : " + subWeight
-// + " out of " + batchWeight +
-// ", new raising Factor= " + raisingFactor);
-// }
-// }
-// }
-
if (CollectionUtils.isEmpty(benthosBatchFrequency)) {
// no frequency
@@ -463,38 +386,6 @@
} else {
- // Yet another sample category to walk through
-
- // Compute total child weights (to adapt raising factor if necessary)
-
-// float childTotalWeight = 0f;
-// for (BenthosBatch childBatch : benthosBatch.getChildBatchs()) {
-// float childWeight = TuttiExportService.getValueOrComputedValue(
-// childBatch.getSampleCategoryWeight(),
-// childBatch.getSampleCategoryComputedWeight());
-// childTotalWeight += childWeight;
-// }
-
-// Float currentWeight = TuttiExportService.getValueOrComputedValue(
-// benthosBatch.getSampleCategoryWeight(),
-// benthosBatch.getSampleCategoryComputedWeight());
-//
-// if (currentWeight - childTotalWeight > 0.0001f) {
-//
-// // there is a sub sampling
-// // adapt raising factor
-//
-// // sub sample, adapt raising factor
-// raisingFactor *= currentWeight / childTotalWeight;
-//
-// if (log.isDebugEnabled()) {
-// log.debug("Using a sub sample for childs of category " +
-// benthosBatch + ": " + childTotalWeight +
-// " out of " + currentWeight +
-// ", new raising Factor= " + raisingFactor);
-// }
-// }
-
for (BenthosBatch childBatch : benthosBatch.getChildBatchs()) {
prepareSortedRows(persistenceService,
currentRow,
@@ -503,6 +394,9 @@
totalBatchWeight);
}
}
+
+ // remove last comment (otherwise next brother will have this one too...)
+ currentRow.popLastComment();
}
protected void prepareUnsortedRows(CatchExportRow currentRow,
@@ -519,6 +413,7 @@
benthosBatch.getRankOrder());
CatchExportRow row = currentRow.copy();
+ row.addComment(benthosBatch.getComment());
float referenceWeight = TuttiExportService.getValueOrComputedValue(
benthosBatch.getSampleCategoryWeight(),
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportRow.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportRow.java 2013-07-12 16:07:22 UTC (rev 1135)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportRow.java 2013-07-16 13:12:23 UTC (rev 1136)
@@ -38,6 +38,8 @@
import fr.ifremer.tutti.persistence.entities.referential.Species;
import fr.ifremer.tutti.persistence.entities.referential.Vessel;
import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import java.io.Serializable;
import java.util.Date;
@@ -54,6 +56,9 @@
private static final long serialVersionUID = 1L;
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(CatchExportRow.class);
+
public static final String FREQUENCY_LENGTH_STEP = "frequency.lengthStep";
public static final String FREQUENCY_NUMBER = "frequency.number";
@@ -100,7 +105,7 @@
protected Integer batchNumber;
- protected List<String> comment;
+ protected final List<String> comment = Lists.newArrayList();
public void setCruise(Cruise cruise) {
this.cruise = cruise;
@@ -238,20 +243,28 @@
result.setRaisingFactor(raisingFactor);
result.setReferenceWeight(referenceWeight);
result.setBatchNumber(batchNumber);
- result.comment = comment;
+ result.comment.addAll(comment);
+
return result;
}
public void addComment(String comment) {
- if (this.comment == null) {
- this.comment = Lists.newArrayList();
+ String safeComment = StringUtils.isEmpty(comment) ? "" : comment;
+ if (log.isDebugEnabled()) {
+ log.debug("Add comment: " + safeComment);
}
- this.comment.add(StringUtils.isEmpty(comment) ? "" : comment);
+ this.comment.add(safeComment);
}
+ public void popLastComment() {
+ if (!comment.isEmpty()) {
+ this.comment.remove(this.comment.size() - 1);
+ }
+ }
+
public String getComment() {
String result;
- if (comment == null) {
+ if (comment.isEmpty()) {
result = "";
} else {
result = Joiner.on('|').join(comment);
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportModel.java 2013-07-12 16:07:22 UTC (rev 1135)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportModel.java 2013-07-16 13:12:23 UTC (rev 1136)
@@ -48,7 +48,8 @@
newColumnForExport("Navire", Cruise.PROPERTY_VESSEL, TuttiCsvUtil.VESSEL_VALUE_FORMATTER);
newColumnForExport("Pays", SurveyExportRow.PROPERTY_COUNTRY);
newColumnForExport("Zone_Etude", Program.PROPERTY_ZONE, TuttiLocation.PROPERTY_NAME);
- newColumnForExport("Id_Sismer", Cruise.PROPERTY_NAME);
+ newColumnForExport("Campagne", Cruise.PROPERTY_NAME);
+ newColumnForExport("Id_Sismer", SurveyExportRow.PROPERTY_ID_SISMER);
// newColumnForExport("Nombre_de_poche", Cruise.PROPERTY_MULTIRIG_NUMBER, TuttiCsvUtil.PRIMITIVE_INTEGER);
newColumnForExport("Date_Deb_Campagne", Cruise.PROPERTY_BEGIN_DATE, TuttiCsvUtil.DAY_TIME_SECOND);
newColumnForExport("Port_Deb_Campagne", Cruise.PROPERTY_DEPARTURE_LOCATION, TuttiLocation.PROPERTY_NAME);
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportRow.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportRow.java 2013-07-12 16:07:22 UTC (rev 1135)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/SurveyExportRow.java 2013-07-16 13:12:23 UTC (rev 1136)
@@ -47,6 +47,8 @@
public static final String PROPERTY_COUNTRY = "country";
+ public static final String PROPERTY_ID_SISMER = "idSismer";
+
protected Cruise cruise;
protected TuttiLocation country;
@@ -118,4 +120,9 @@
public Integer getMultirigNumber() {
return cruise.getMultirigNumber();
}
+
+ // see http://forge.codelutin.com/issues/2877
+ public String getIdSismer() {
+ return "";
+ }
}
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java 2013-07-12 16:07:22 UTC (rev 1135)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java 2013-07-16 13:12:23 UTC (rev 1136)
@@ -154,7 +154,7 @@
String countryId = context.getConfig().getExportCountryId();
country = TuttiEntities.splitById(allCountry).get(countryId);
- List<Caracteristic> allCaracteristic = persistenceService.getAllCaracteristic();
+ List<Caracteristic> allCaracteristic = persistenceService.getAllCaracteristicWithProtected();
Map<String, Caracteristic> allCaracteristicById = TuttiEntities.splitById(allCaracteristic);
samplingToCaracteristic = Maps.newEnumMap(SampleCategoryEnum.class);
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java 2013-07-12 16:07:22 UTC (rev 1135)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java 2013-07-16 13:12:23 UTC (rev 1136)
@@ -74,18 +74,26 @@
public static final String OPERATION_2_ID = "100113";
public static final String CATCH_CONTENT =
- "Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;Taxon;Nom scientifique;Commentaire;VracHorsVrac;Num_Ordre_VracHorsVrac_H2;Tot_VracHorsVrac;Ech_VracHorsVrac;Type_Volume_Poids_VracHorsVrac;Unite_Volume_Poids_VracHorsVrac;Cat_Tri;Num_Ordre_Cat_Tri_H2;Tot_Cat_Tri;Ech_Cat_Tri;Type_Volume_Poids_Cat_Tri;Unite_Volume_Poids_Cat_Tri;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Maturite;Ech_Maturite;Type_Volume_Poids_Maturite;Unite_Volume_Poids_Maturite;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Final_Elevation\n" +
- "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1938;Agonus cataphractus;;Vrac;1;80.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;80.0;5.4444447;\n" +
- "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;;Vrac;2;;;Poids;;NA;;;;;;Mâle;1;60.0;;Poids;;NA;;;;;;NA;;;;;;;;;;;;;;60.0;9.074075;\n" +
- "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;;Vrac;2;;;Poids;;NA;;;;;;Femelle;2;40.0;;Poids;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;5.0;1;0.6;cm;1.0;4;0.6;907.4074;\n" +
- "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;;Vrac;2;;;Poids;;NA;;;;;;Femelle;2;40.0;;Poids;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;6.0;2;0.4;cm;1.0;10;0.4;1361.1111;\n" +
- "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1938;Agonus cataphractus;;Hors Vrac;1;20.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;20.0;1.0;\n" +
- "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1938;Agonus cataphractus;;Vrac;1;80.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;80.0;3.5;\n" +
- "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1358;Alosa alosa;;Vrac;2;;;Poids;;NA;;;;;;Mâle;1;60.0;;Poids;;NA;;;;;;NA;;;;;;;;;;;;;;60.0;5.8333335;\n" +
- "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1358;Alosa alosa;;Vrac;2;;;Poids;;NA;;;;;;Femelle;2;40.0;;Poids;;NA;;;;;;NA;;;;;;;;;;;;;;40.0;8.75;\n" +
- "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1938;Agonus cataphractus;;Hors Vrac;1;20.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;20.0;1.0;\n" +
- "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;4622;Abietinaria abietina;;Vrac;1;30.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;30.0;7.0;\n" +
- "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;380;Acanthocardia echinata;;Vrac;2;18.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;18.0;7.0;";
+ "Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;Taxon;Nom_scientifique;Commentaire;VracHorsVrac;Num_Ordre_VracHorsVrac_H2;Tot_VracHorsVrac;Ech_VracHorsVrac;Type_Volume_Poids_VracHorsVrac;Unite_Volume_Poids_VracHorsVrac;Cat_Tri;Num_Ordre_Cat_Tri_H2;Tot_Cat_Tri;Ech_Cat_Tri;Type_Volume_Poids_Cat_Tri;Unite_Volume_Poids_Cat_Tri;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Maturite;Ech_Maturite;Type_Volume_Poids_Maturite;Unite_Volume_Poids_Maturite;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Final_Elevation\n" +
+ "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1938;Agonus cataphractus;AGONCAT-vrac-80;Vrac;1;80.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;80.0;5.4444447;\n" +
+ "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;ALOSALO-vrac|ALOSALO-vrac-male 60;Vrac;2;;;Poids;;NA;;;;;;Mâle;1;60.0;;Poids;;NA;;;;;;NA;;;;;;;;;;;;;;60.0;9.074075;\n" +
+ "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;ALOSALO-vrac|ALOSALO-vrac-femelle 40;Vrac;2;;;Poids;;NA;;;;;;Femelle;2;40.0;;Poids;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;5.0;1;0.6;cm;1.0;4;0.6;907.4074;\n" +
+ "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;ALOSALO-vrac|ALOSALO-vrac-femelle 40;Vrac;2;;;Poids;;NA;;;;;;Femelle;2;40.0;;Poids;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;6.0;2;0.4;cm;1.0;10;0.4;1361.1111;\n" +
+ "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1938;Agonus cataphractus;AGONCAT-horsvrac-20;Hors Vrac;1;20.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;20.0;1.0;\n" +
+ "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1938;Agonus cataphractus;Trait B-2-1 AGONCAT-vrac 80;Vrac;1;80.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;80.0;3.5;\n" +
+ "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1358;Alosa alosa;Trait B-2-1 ALOSALO Vrac|Trait B-2-1 ALOSALO Vrac - Male 60;Vrac;2;;;Poids;;NA;;;;;;Mâle;1;60.0;;Poids;;NA;;;;;;NA;;;;;;;;;;;;;;60.0;5.8333335;\n" +
+ "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1358;Alosa alosa;Trait B-2-1 ALOSALO Vrac|Trait B-2-1 ALOSALO Vrac - Femelle 40.0;Vrac;2;;;Poids;;NA;;;;;;Femelle;2;40.0;;Poids;;NA;;;;;;NA;;;;;;;;;;;;;;40.0;8.75;\n" +
+ "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1938;Agonus cataphractus;Trait B-2-1 AGONCAT-horsvrac 20;Hors Vrac;1;20.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;20.0;1.0;\n" +
+ "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;4622;Abietinaria abietina;\"Trait B-2-1 Benthos ABIEABI Vrac 30\n" +
+ "\n" +
+ "avec \n" +
+ "\n" +
+ "commentaire...\";Vrac;1;30.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;30.0;7.0;\n" +
+ "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;380;Acanthocardia echinata;\"Trait B-2-1 Benthos ACANECH Vrac 18\n" +
+ "\n" +
+ "avec \n" +
+ "\n" +
+ "commentaire...\";Vrac;2;18.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;18.0;7.0;";
protected TuttiExportService service;
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java 2013-07-12 16:07:22 UTC (rev 1135)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportServiceTest.java 2013-07-16 13:12:23 UTC (rev 1136)
@@ -78,8 +78,8 @@
public static final String OPERATION_2_ID = "100107";
public static final String SURVEY_CONTENT =
- "Annee;Serie;Serie_Partielle;Navire;Pays;Zone_Etude;Id_Sismer;Date_Deb_Campagne;Port_Deb_Campagne;Date_Fin_Campagne;Port_Fin_Campagne;Chef_Mission;Resp_Salle_Tri;Commentaire\n" +
- "2013;Campagne CGFS;;278970;FRA;CGFS - Manche Est / Sud Mer du Nord;Campagne CGFS_2013;01/05/2013 00:00:00;La Barbotière (Gujan-Mestras);31/05/2013 00:00:00;Etang de Palo;Vincent AURECHE;Alain TETARD;;";
+ "Annee;Serie;Serie_Partielle;Navire;Pays;Zone_Etude;Campagne;Id_Sismer;Date_Deb_Campagne;Port_Deb_Campagne;Date_Fin_Campagne;Port_Fin_Campagne;Chef_Mission;Resp_Salle_Tri;Commentaire\n" +
+ "2013;Campagne CGFS;;278970;FRA;CGFS - Manche Est / Sud Mer du Nord;Campagne CGFS_2013;;01/05/2013 00:00:00;La Barbotière (Gujan-Mestras);31/05/2013 00:00:00;Etang de Palo;Vincent AURECHE;Alain TETARD;;";
public static final String GEAR_CARACTERISTICS_CONTENT =
"Annee;Serie;Serie_Partielle;Engin;Code_PMFM;Libelle_PMFM;Valeur\n" +
@@ -108,19 +108,19 @@
"2013;Campagne CGFS;;A;2;1;308;Nombre d'engin - engin - totale - Déclaration d'un professionnel;2.0;";
public static final String CATCH_CONTENT =
- "Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;Taxon;Nom scientifique;Commentaire;VracHorsVrac;Num_Ordre_VracHorsVrac_H2;Tot_VracHorsVrac;Ech_VracHorsVrac;Type_Volume_Poids_VracHorsVrac;Unite_Volume_Poids_VracHorsVrac;Cat_Tri;Num_Ordre_Cat_Tri_H2;Tot_Cat_Tri;Ech_Cat_Tri;Type_Volume_Poids_Cat_Tri;Unite_Volume_Poids_Cat_Tri;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Maturite;Ech_Maturite;Type_Volume_Poids_Maturite;Unite_Volume_Poids_Maturite;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Final_Elevation\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Mâle;1;30.0;;Poids;;1 - Stade 1;1;10.0;5.0;Poids;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.0;1;;cm;0.5;5;5.0;3.0;\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Mâle;1;30.0;;Poids;;1 - Stade 1;1;10.0;5.0;Poids;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;2;;cm;0.5;2;5.0;3.0;\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Mâle;1;30.0;;Poids;;1 - Stade 1;1;10.0;5.0;Poids;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;11.0;3;;cm;0.5;1;5.0;3.0;\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Mâle;1;30.0;;Poids;;3 - Stade 3;3;10.0;;Poids;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;11.0;1;;cm;0.5;5;10.0;1.5;\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Femelle;2;50.0;30.0;Poids;;3 - Stade 3;3;10.0;;Poids;;NA;;;;;;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;10.0;1;;cm;;5;30.0;1.6666666;\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Femelle;2;50.0;30.0;Poids;;3 - Stade 3;3;10.0;;Poids;;NA;;;;;;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;11.0;2;;cm;;6;30.0;1.6666666;\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Femelle;2;50.0;30.0;Poids;;3 - Stade 3;3;10.0;;Poids;;NA;;;;;;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;12.0;3;;cm;;7;30.0;1.6666666;\n" +
- "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;;Vrac;1;100.0;;Poids;;M - Moyen;2;20.0;;Poids;;Femelle;2;50.0;30.0;Poids;;3 - Stade 3;3;10.0;;Poids;;NA;;;;;;;;;;;;;;20.0;1.0;\n" +
+ "Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;Taxon;Nom_scientifique;Commentaire;VracHorsVrac;Num_Ordre_VracHorsVrac_H2;Tot_VracHorsVrac;Ech_VracHorsVrac;Type_Volume_Poids_VracHorsVrac;Unite_Volume_Poids_VracHorsVrac;Cat_Tri;Num_Ordre_Cat_Tri_H2;Tot_Cat_Tri;Ech_Cat_Tri;Type_Volume_Poids_Cat_Tri;Unite_Volume_Poids_Cat_Tri;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Maturite;Ech_Maturite;Type_Volume_Poids_Maturite;Unite_Volume_Poids_Maturite;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Final_Elevation\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|||;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Mâle;1;30.0;;Poids;;1 - Stade 1;1;10.0;5.0;Poids;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.0;1;;cm;0.5;5;5.0;20.0;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|||;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Mâle;1;30.0;;Poids;;1 - Stade 1;1;10.0;5.0;Poids;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;2;;cm;0.5;2;5.0;20.0;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|||;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Mâle;1;30.0;;Poids;;1 - Stade 1;1;10.0;5.0;Poids;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;11.0;3;;cm;0.5;1;5.0;20.0;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|||;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Mâle;1;30.0;;Poids;;3 - Stade 3;3;10.0;;Poids;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;11.0;1;;cm;0.5;5;10.0;10.0;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;||;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Femelle;2;50.0;30.0;Poids;;3 - Stade 3;3;10.0;;Poids;;NA;;;;;;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;10.0;1;;cm;;5;30.0;3.3333333;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;||;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Femelle;2;50.0;30.0;Poids;;3 - Stade 3;3;10.0;;Poids;;NA;;;;;;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;11.0;2;;cm;;6;30.0;3.3333333;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;||;Vrac;1;100.0;;Poids;;G - Gros;1;80.0;;Poids;;Femelle;2;50.0;30.0;Poids;;3 - Stade 3;3;10.0;;Poids;;NA;;;;;;1425;Longueur totale (LT) - individu - queue - Mesure au cm par un observateur;12.0;3;;cm;;7;30.0;3.3333333;\n" +
+ "2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;|;Vrac;1;100.0;;Poids;;M - Moyen;2;20.0;;Poids;;Femelle;2;50.0;30.0;Poids;;3 - Stade 3;3;10.0;;Poids;;NA;;;;;;;;;;;;;;20.0;5.0;\n" +
"2013;Campagne CGFS;;GOV 19.7/25.9;A;1;1;278970;11242;Aaptos;;Hors Vrac;1;20.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;2;20.0;1.0;";
public static final String CATCH_CONTENT_2 =
- "Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;Taxon;Nom scientifique;Commentaire;VracHorsVrac;Num_Ordre_VracHorsVrac_H2;Tot_VracHorsVrac;Ech_VracHorsVrac;Type_Volume_Poids_VracHorsVrac;Unite_Volume_Poids_VracHorsVrac;Cat_Tri;Num_Ordre_Cat_Tri_H2;Tot_Cat_Tri;Ech_Cat_Tri;Type_Volume_Poids_Cat_Tri;Unite_Volume_Poids_Cat_Tri;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Maturite;Ech_Maturite;Type_Volume_Poids_Maturite;Unite_Volume_Poids_Maturite;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Final_Elevation\n" +
+ "Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;Taxon;Nom_scientifique;Commentaire;VracHorsVrac;Num_Ordre_VracHorsVrac_H2;Tot_VracHorsVrac;Ech_VracHorsVrac;Type_Volume_Poids_VracHorsVrac;Unite_Volume_Poids_VracHorsVrac;Cat_Tri;Num_Ordre_Cat_Tri_H2;Tot_Cat_Tri;Ech_Cat_Tri;Type_Volume_Poids_Cat_Tri;Unite_Volume_Poids_Cat_Tri;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Maturite;Ech_Maturite;Type_Volume_Poids_Maturite;Unite_Volume_Poids_Maturite;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Final_Elevation\n" +
"2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;365;Aequipecten opercularis;taxon;Vrac;1;0.005;0.005;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;1;0.005;1.0;\n" +
"2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;491;Alloteuthis;taxon;Vrac;2;0.004;0.004;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;1;0.004;1.0;\n" +
"2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;300;Buccinum undatum;taxon;Vrac;3;0.015;0.015;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;1;0.015;1.0;\n" +
@@ -143,13 +143,13 @@
"2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1978;Pleuronectes platessa;taxon;Vrac;11;0.852;0.852;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;30.0;2;;cm;1.0;1;0.852;1.0;\n" +
"2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1351;Sardina pilchardus;taxon;Vrac;12;0.022;0.022;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;307;Longueur totale (LT) - individu - totale - Mesure au 1/2 cm par un observateur;10.5;1;;cm;0.5;1;0.022;1.0;\n" +
"2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1772;Scomber scombrus;taxon;Vrac;13;0.18;0.18;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;27.0;1;;cm;1.0;1;0.18;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1242;Scyliorhinus canicula;taxon;Vrac;14;;;Poids;;NA;;;;;;Femelle;1;1.0;1.0;Poids;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;51.0;1;;cm;1.0;1;1.0;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1242;Scyliorhinus canicula;taxon;Vrac;14;;;Poids;;NA;;;;;;Femelle;1;1.0;1.0;Poids;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;55.0;2;;cm;1.0;1;1.0;1.0;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon;Vrac;15;;;Poids;;P - Petit;1;131.12;0.96;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;8.0;1;;cm;1.0;1;0.96;136.58333;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon;Vrac;15;;;Poids;;P - Petit;1;131.12;0.96;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;9.0;2;;cm;1.0;20;0.96;136.58333;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon;Vrac;15;;;Poids;;P - Petit;1;131.12;0.96;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;10.0;3;;cm;1.0;89;0.96;136.58333;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon;Vrac;15;;;Poids;;P - Petit;1;131.12;0.96;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;11.0;4;;cm;1.0;5;0.96;136.58333;\n" +
- "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon;Vrac;15;;;Poids;;G - Gros;2;0.13;0.13;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;23.0;1;;cm;1.0;1;0.13;1.0;";
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1242;Scyliorhinus canicula;taxon|categorie_individu;Vrac;14;;;Poids;;NA;;;;;;Femelle;1;1.0;1.0;Poids;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;51.0;1;;cm;1.0;1;1.0;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1242;Scyliorhinus canicula;taxon|categorie_individu;Vrac;14;;;Poids;;NA;;;;;;Femelle;1;1.0;1.0;Poids;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;55.0;2;;cm;1.0;1;1.0;1.0;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon|categorie_individu;Vrac;15;;;Poids;;P - Petit;1;131.12;0.96;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;8.0;1;;cm;1.0;1;0.96;136.71875;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon|categorie_individu;Vrac;15;;;Poids;;P - Petit;1;131.12;0.96;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;9.0;2;;cm;1.0;20;0.96;136.71875;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon|categorie_individu;Vrac;15;;;Poids;;P - Petit;1;131.12;0.96;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;10.0;3;;cm;1.0;89;0.96;136.71875;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon|categorie_individu;Vrac;15;;;Poids;;P - Petit;1;131.12;0.96;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;11.0;4;;cm;1.0;5;0.96;136.71875;\n" +
+ "2010;Campagne CGFS;;GOV 19.7/25.9;20;20;1;278970;1662;Trachurus trachurus;taxon|categorie_individu;Vrac;15;;;Poids;;G - Gros;2;0.13;0.13;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;23.0;1;;cm;1.0;1;0.13;1009.6154;";
public static final String MARINE_LITTER_CONTENT =
"Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;MarineLitterCategory;MarineLitterSizeCategory;Number;Weight;Commentaire\n" +
1
0
r1135 - in trunk/tutti-service/src: main/java/fr/ifremer/tutti/service/export test/java/fr/ifremer/tutti/service/export
by tchemit@users.forge.codelutin.com 12 Jul '13
by tchemit@users.forge.codelutin.com 12 Jul '13
12 Jul '13
Author: tchemit
Date: 2013-07-12 18:07:22 +0200 (Fri, 12 Jul 2013)
New Revision: 1135
Url: http://forge.codelutin.com/projects/tutti/repository/revisions/1135
Log:
refs #2872: [EXPORT GENERIQUE] le calcul du coef ne marche pas : ex. trait 2 Alosa Alosa Vrac on obtient pas le m?\195?\170me poids dans la capture
Modified:
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java
trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java
trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java 2013-07-10 15:47:03 UTC (rev 1134)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/CatchExportModel.java 2013-07-12 16:07:22 UTC (rev 1135)
@@ -135,9 +135,19 @@
row.addComment(speciesBatch.getComment());
if (TuttiEntities.isVracSpeciesBatch(speciesBatch)) {
+
+ // compute species total weight in catch
+
+ float sortedBatchWeight = TuttiExportService.getValueOrComputedValue(
+ speciesBatch.getSampleCategoryWeight(),
+ speciesBatch.getSampleCategoryComputedWeight());
+
+ float totalBatchWeight = speciesCatchRaisingFactor *
+ sortedBatchWeight;
+
prepareSortedRows(persistenceService, row, rows,
speciesBatch,
- speciesCatchRaisingFactor
+ totalBatchWeight
);
} else {
prepareUnsortedRows(row, rows, speciesBatch);
@@ -151,9 +161,19 @@
row.setSpecies(benthosBatch.getSpecies());
row.addComment(benthosBatch.getComment());
if (TuttiEntities.isVracBenthosBatch(benthosBatch)) {
+
+ // compute species total weight in catch
+
+ float sortedBatchWeight = TuttiExportService.getValueOrComputedValue(
+ benthosBatch.getSampleCategoryWeight(),
+ benthosBatch.getSampleCategoryComputedWeight());
+
+ float totalBatchWeight = benthosCatchRaisingFactor *
+ sortedBatchWeight;
+
prepareSortedRows(persistenceService, row, rows,
benthosBatch,
- benthosCatchRaisingFactor);
+ totalBatchWeight);
} else {
prepareUnsortedRows(row, rows, benthosBatch);
}
@@ -164,7 +184,7 @@
CatchExportRow currentRow,
List<CatchExportRow> rows,
SpeciesBatch speciesBatch,
- Float raisingFactor) {
+ final float totalBatchWeight) {
prepareBatch(currentRow,
speciesBatch.getSampleCategoryType(),
@@ -185,27 +205,27 @@
// check if there is a sub sampling weight
// if so then adapt raisingFactor
- Float subWeight = TuttiExportService.getValueOrComputedValue(
- speciesBatch.getWeight(), speciesBatch.getComputedWeight());
+// Float subWeight = TuttiExportService.getValueOrComputedValue(
+// speciesBatch.getWeight(), speciesBatch.getComputedWeight());
+//
+// if (subWeight != null) {
+//
+// float batchWeight = TuttiExportService.getValueOrComputedValue(
+// speciesBatch.getSampleCategoryWeight(),
+// speciesBatch.getSampleCategoryComputedWeight());
+//
+// if (batchWeight - subWeight > 0.0001f) {
+// // sub sample, adapt raising factor
+// raisingFactor *= batchWeight / subWeight;
+//
+// if (log.isDebugEnabled()) {
+// log.debug("Using a sub sample on leaf : " +
+// subWeight + " out of " + batchWeight +
+// ", new raising Factor= " + raisingFactor);
+// }
+// }
+// }
- if (subWeight != null) {
-
- float batchWeight = TuttiExportService.getValueOrComputedValue(
- speciesBatch.getSampleCategoryWeight(),
- speciesBatch.getSampleCategoryComputedWeight());
-
- if (batchWeight - subWeight > 0.0001f) {
- // sub sample, adapt raising factor
- raisingFactor *= batchWeight / subWeight;
-
- if (log.isDebugEnabled()) {
- log.debug("Using a sub sample on leaf : " +
- subWeight + " out of " + batchWeight +
- ", new raising Factor= " + raisingFactor);
- }
- }
- }
-
if (CollectionUtils.isEmpty(speciesBatchFrequency)) {
// no frequency
@@ -224,9 +244,7 @@
speciesBatch.getSampleCategoryWeight(),
speciesBatch.getSampleCategoryComputedWeight());
}
- setRaisingFactor(row,
- raisingFactor,
- referenceWeight);
+ setRaisingFactor(row, totalBatchWeight, referenceWeight);
rows.add(row);
} else {
@@ -263,9 +281,7 @@
referenceWeight = batchFrequency.getWeight();
}
- setRaisingFactor(row,
- raisingFactor,
- referenceWeight);
+ setRaisingFactor(row, totalBatchWeight, referenceWeight);
}
}
@@ -275,40 +291,40 @@
// Compute total child weights (to adapt raising factor if necessary)
- float childTotalWeight = 0f;
- for (SpeciesBatch childBatch : speciesBatch.getChildBatchs()) {
- float childWeight = TuttiExportService.getValueOrComputedValue(
- childBatch.getSampleCategoryWeight(),
- childBatch.getSampleCategoryComputedWeight());
- childTotalWeight += childWeight;
- }
+// float childTotalWeight = 0f;
+// for (SpeciesBatch childBatch : speciesBatch.getChildBatchs()) {
+// float childWeight = TuttiExportService.getValueOrComputedValue(
+// childBatch.getSampleCategoryWeight(),
+// childBatch.getSampleCategoryComputedWeight());
+// childTotalWeight += childWeight;
+// }
- float currentWeight = TuttiExportService.getValueOrComputedValue(
- speciesBatch.getSampleCategoryWeight(),
- speciesBatch.getSampleCategoryComputedWeight());
+// float currentWeight = TuttiExportService.getValueOrComputedValue(
+// speciesBatch.getSampleCategoryWeight(),
+// speciesBatch.getSampleCategoryComputedWeight());
- if (currentWeight - childTotalWeight > 0.0001f) {
+// if (currentWeight - childTotalWeight > 0.0001f) {
+//
+// // there is a sub sampling
+// // adapt raising factor
+//
+// // sub sample, adapt raising factor
+// raisingFactor *= currentWeight / childTotalWeight;
+//
+// if (log.isDebugEnabled()) {
+// log.debug("Using a sub sample for childs of category " +
+// speciesBatch + ": " + childTotalWeight +
+// " out of " + currentWeight +
+// ", new raising Factor= " + raisingFactor);
+// }
+// }
- // there is a sub sampling
- // adapt raising factor
-
- // sub sample, adapt raising factor
- raisingFactor *= currentWeight / childTotalWeight;
-
- if (log.isDebugEnabled()) {
- log.debug("Using a sub sample for childs of category " +
- speciesBatch + ": " + childTotalWeight +
- " out of " + currentWeight +
- ", new raising Factor= " + raisingFactor);
- }
- }
-
for (SpeciesBatch childBatch : speciesBatch.getChildBatchs()) {
prepareSortedRows(persistenceService,
currentRow,
rows,
childBatch,
- raisingFactor
+ totalBatchWeight
);
}
}
@@ -331,8 +347,11 @@
float referenceWeight = TuttiExportService.getValueOrComputedValue(
speciesBatch.getSampleCategoryWeight(),
speciesBatch.getSampleCategoryComputedWeight());
- row.setReferenceWeight(referenceWeight);
- row.setRaisingFactor(1.f);
+
+ setRaisingFactor(row, referenceWeight, referenceWeight);
+
+// row.setReferenceWeight(referenceWeight);
+// row.setRaisingFactor(1.f);
rows.add(row);
}
@@ -340,7 +359,7 @@
CatchExportRow currentRow,
List<CatchExportRow> rows,
BenthosBatch benthosBatch,
- Float raisingFactor) {
+ final float totalBatchWeight) {
prepareBatch(currentRow,
benthosBatch.getSampleCategoryType(),
@@ -358,31 +377,31 @@
List<BenthosBatchFrequency> benthosBatchFrequency =
persistenceService.getAllBenthosBatchFrequency(benthosBatch.getId());
- // check if there is a sub sampling weight
- // if so then adapt raisingFactor
+// // check if there is a sub sampling weight
+// // if so then adapt raisingFactor
+//
+// Float subWeight = TuttiExportService.getValueOrComputedValue(
+// benthosBatch.getWeight(),
+// benthosBatch.getComputedWeight());
+//
+// if (subWeight != null) {
+//
+// float batchWeight = TuttiExportService.getValueOrComputedValue(
+// benthosBatch.getSampleCategoryWeight(),
+// benthosBatch.getSampleCategoryComputedWeight());
+//
+// if (batchWeight - subWeight > 0.0001f) {
+// // sub sample, adapt raising factor
+// raisingFactor *= batchWeight / subWeight;
+//
+// if (log.isDebugEnabled()) {
+// log.debug("Using a sub sample on leaf : " + subWeight
+// + " out of " + batchWeight +
+// ", new raising Factor= " + raisingFactor);
+// }
+// }
+// }
- Float subWeight = TuttiExportService.getValueOrComputedValue(
- benthosBatch.getWeight(),
- benthosBatch.getComputedWeight());
-
- if (subWeight != null) {
-
- float batchWeight = TuttiExportService.getValueOrComputedValue(
- benthosBatch.getSampleCategoryWeight(),
- benthosBatch.getSampleCategoryComputedWeight());
-
- if (batchWeight - subWeight > 0.0001f) {
- // sub sample, adapt raising factor
- raisingFactor *= batchWeight / subWeight;
-
- if (log.isDebugEnabled()) {
- log.debug("Using a sub sample on leaf : " + subWeight
- + " out of " + batchWeight +
- ", new raising Factor= " + raisingFactor);
- }
- }
- }
-
if (CollectionUtils.isEmpty(benthosBatchFrequency)) {
// no frequency
@@ -401,9 +420,7 @@
benthosBatch.getSampleCategoryComputedWeight());
}
- setRaisingFactor(row,
- raisingFactor,
- referenceWeight);
+ setRaisingFactor(row, totalBatchWeight, referenceWeight);
rows.add(row);
} else {
@@ -440,7 +457,7 @@
referenceWeight = batchFrequency.getWeight();
}
- setRaisingFactor(row, raisingFactor, referenceWeight);
+ setRaisingFactor(row, totalBatchWeight, referenceWeight);
}
}
@@ -450,39 +467,40 @@
// Compute total child weights (to adapt raising factor if necessary)
- float childTotalWeight = 0f;
- for (BenthosBatch childBatch : benthosBatch.getChildBatchs()) {
- float childWeight = TuttiExportService.getValueOrComputedValue(
- childBatch.getSampleCategoryWeight(),
- childBatch.getSampleCategoryComputedWeight());
- childTotalWeight += childWeight;
- }
+// float childTotalWeight = 0f;
+// for (BenthosBatch childBatch : benthosBatch.getChildBatchs()) {
+// float childWeight = TuttiExportService.getValueOrComputedValue(
+// childBatch.getSampleCategoryWeight(),
+// childBatch.getSampleCategoryComputedWeight());
+// childTotalWeight += childWeight;
+// }
- Float currentWeight = TuttiExportService.getValueOrComputedValue(
- benthosBatch.getSampleCategoryWeight(),
- benthosBatch.getSampleCategoryComputedWeight());
+// Float currentWeight = TuttiExportService.getValueOrComputedValue(
+// benthosBatch.getSampleCategoryWeight(),
+// benthosBatch.getSampleCategoryComputedWeight());
+//
+// if (currentWeight - childTotalWeight > 0.0001f) {
+//
+// // there is a sub sampling
+// // adapt raising factor
+//
+// // sub sample, adapt raising factor
+// raisingFactor *= currentWeight / childTotalWeight;
+//
+// if (log.isDebugEnabled()) {
+// log.debug("Using a sub sample for childs of category " +
+// benthosBatch + ": " + childTotalWeight +
+// " out of " + currentWeight +
+// ", new raising Factor= " + raisingFactor);
+// }
+// }
- if (currentWeight - childTotalWeight > 0.0001f) {
-
- // there is a sub sampling
- // adapt raising factor
-
- // sub sample, adapt raising factor
- raisingFactor *= currentWeight / childTotalWeight;
-
- if (log.isDebugEnabled()) {
- log.debug("Using a sub sample for childs of category " +
- benthosBatch + ": " + childTotalWeight +
- " out of " + currentWeight +
- ", new raising Factor= " + raisingFactor);
- }
- }
for (BenthosBatch childBatch : benthosBatch.getChildBatchs()) {
prepareSortedRows(persistenceService,
currentRow,
rows,
childBatch,
- raisingFactor);
+ totalBatchWeight);
}
}
}
@@ -505,16 +523,17 @@
float referenceWeight = TuttiExportService.getValueOrComputedValue(
benthosBatch.getSampleCategoryWeight(),
benthosBatch.getSampleCategoryComputedWeight());
- row.setReferenceWeight(referenceWeight);
- row.setRaisingFactor(1.f);
+
+ setRaisingFactor(row, referenceWeight, referenceWeight);
+
rows.add(row);
}
protected void setRaisingFactor(CatchExportRow row,
- float raisingFactor,
+ float totalBatchWeight,
float referenceWeight) {
row.setReferenceWeight(referenceWeight);
- row.setRaisingFactor(raisingFactor);
+ row.setRaisingFactor(totalBatchWeight / referenceWeight);
}
protected void prepareBatch(CatchExportRow currentRow,
Modified: trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java
===================================================================
--- trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java 2013-07-10 15:47:03 UTC (rev 1134)
+++ trunk/tutti-service/src/main/java/fr/ifremer/tutti/service/export/TuttiExportService.java 2013-07-12 16:07:22 UTC (rev 1135)
@@ -402,7 +402,7 @@
List<GearCaracteristicExportRow> rows = Lists.newArrayList();
- for (Gear gear : cruise.getGear() ) {
+ for (Gear gear : cruise.getGear()) {
Gear gearWithCaracteristics = persistenceService.getGearWithCaracteristics(gear, cruise);
exportContext.gearCaracteristicsModel.prepareRows(rows, cruise, gearWithCaracteristics);
@@ -554,7 +554,7 @@
catchBatch.getCatchTotalWeight(),
catchBatch.getCatchTotalComputedWeight());
- Float totalUnsortedWeight =
+ float totalUnsortedWeight =
catchBatch.getCatchTotalUnsortedComputedWeight();
@@ -574,6 +574,7 @@
Float totalSortedWeight = catchBatch.getCatchTotalSortedComputedWeight();
+ //FIXME tchemit 2013-07-12 J'utilise en fait la formule (Poids de la capture totale - poids du HV dans la capture totale) / (poids total capture triée)
// (Poids de la capture totale - poids du HV dans la capture totale) / (poids total capture triée - poids du HV dans la capture totale)
Float catchRaisingFactor = (totalWeight - totalUnsortedWeight) / totalSortedWeight;
@@ -591,7 +592,7 @@
"\nspeciesCatchRaisingFactor : " + speciesCatchRaisingFactor +
"\nbenthosCatchRaisingFactor : " + benthosCatchRaisingFactor;
- log.debug(message);
+ log.info(message);
}
List<CatchExportRow> rows = Lists.newArrayList();
Modified: trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java
===================================================================
--- trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java 2013-07-10 15:47:03 UTC (rev 1134)
+++ trunk/tutti-service/src/test/java/fr/ifremer/tutti/service/export/TuttiExportService2Test.java 2013-07-12 16:07:22 UTC (rev 1135)
@@ -76,13 +76,13 @@
public static final String CATCH_CONTENT =
"Annee;Serie;Serie_Partielle;Engin;Id_Operation;NumOrdre_Station;Poche;Navire;Taxon;Nom scientifique;Commentaire;VracHorsVrac;Num_Ordre_VracHorsVrac_H2;Tot_VracHorsVrac;Ech_VracHorsVrac;Type_Volume_Poids_VracHorsVrac;Unite_Volume_Poids_VracHorsVrac;Cat_Tri;Num_Ordre_Cat_Tri_H2;Tot_Cat_Tri;Ech_Cat_Tri;Type_Volume_Poids_Cat_Tri;Unite_Volume_Poids_Cat_Tri;Sexe;Num_Ordre_Sexe_H2;Tot_Sexe;Ech_Sexe;Type_Volume_Poids_Sexe;Unite_Volume_Poids_Sexe;Maturite;Num_Ordre_Maturite_H2;Tot_Maturite;Ech_Maturite;Type_Volume_Poids_Maturite;Unite_Volume_Poids_Maturite;Age;Num_Ordre_Age_H2;Tot_Age;Ech_Age;Type_Volume_Poids_Age;Unite_Volume_Poids_Age;Code_Longueur;Libelle_Longueur;Taille;NumOrdre_Taille_H2;Poids_Classe_Taille;Unite_Taille;Precision_Mesure;Nbr;Poids_Reference;Coef_Final_Elevation\n" +
"2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1938;Agonus cataphractus;;Vrac;1;80.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;80.0;5.4444447;\n" +
- "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;;Vrac;2;;;Poids;;NA;;;;;;Mâle;1;60.0;;Poids;;NA;;;;;;NA;;;;;;;;;;;;;;60.0;5.4444447;\n" +
- "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;;Vrac;2;;;Poids;;NA;;;;;;Femelle;2;40.0;;Poids;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;5.0;1;0.6;cm;1.0;4;0.6;217.77779;\n" +
- "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;;Vrac;2;;;Poids;;NA;;;;;;Femelle;2;40.0;;Poids;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;6.0;2;0.4;cm;1.0;10;0.4;217.77779;\n" +
+ "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;;Vrac;2;;;Poids;;NA;;;;;;Mâle;1;60.0;;Poids;;NA;;;;;;NA;;;;;;;;;;;;;;60.0;9.074075;\n" +
+ "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;;Vrac;2;;;Poids;;NA;;;;;;Femelle;2;40.0;;Poids;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;5.0;1;0.6;cm;1.0;4;0.6;907.4074;\n" +
+ "2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1358;Alosa alosa;;Vrac;2;;;Poids;;NA;;;;;;Femelle;2;40.0;;Poids;;NA;;;;;;NA;;;;;;306;Longueur totale (LT) - individu - totale - Mesure au cm par un observateur;6.0;2;0.4;cm;1.0;10;0.4;1361.1111;\n" +
"2013;test elevation;1;OTB 20/28.10;A;1;1;278970;1938;Agonus cataphractus;;Hors Vrac;1;20.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;20.0;1.0;\n" +
"2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1938;Agonus cataphractus;;Vrac;1;80.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;80.0;3.5;\n" +
- "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1358;Alosa alosa;;Vrac;2;;;Poids;;NA;;;;;;Mâle;1;60.0;;Poids;;NA;;;;;;NA;;;;;;;;;;;;;;60.0;3.5;\n" +
- "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1358;Alosa alosa;;Vrac;2;;;Poids;;NA;;;;;;Femelle;2;40.0;;Poids;;NA;;;;;;NA;;;;;;;;;;;;;;40.0;3.5;\n" +
+ "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1358;Alosa alosa;;Vrac;2;;;Poids;;NA;;;;;;Mâle;1;60.0;;Poids;;NA;;;;;;NA;;;;;;;;;;;;;;60.0;5.8333335;\n" +
+ "2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1358;Alosa alosa;;Vrac;2;;;Poids;;NA;;;;;;Femelle;2;40.0;;Poids;;NA;;;;;;NA;;;;;;;;;;;;;;40.0;8.75;\n" +
"2013;test elevation;1;OTB 20/28.10;B;2;1;278970;1938;Agonus cataphractus;;Hors Vrac;1;20.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;20.0;1.0;\n" +
"2013;test elevation;1;OTB 20/28.10;B;2;1;278970;4622;Abietinaria abietina;;Vrac;1;30.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;30.0;7.0;\n" +
"2013;test elevation;1;OTB 20/28.10;B;2;1;278970;380;Acanthocardia echinata;;Vrac;2;18.0;;Poids;;NA;;;;;;NA;;;;;;NA;;;;;;NA;;;;;;;;;;;;;;18.0;7.0;";
1
0