[Git][ultreiaio/ird-t3][develop] Amélioration du log du RF1 (N0.1) (See #2171)
Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3 Commits: 334460db by Tony CHEMIT at 2018-02-19T08:35:48+01:00 Amélioration du log du RF1 (N0.1) (See #2171) - - - - - 5 changed files: - t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeRF1Action.java - t3-actions/src/main/resources/i18n/t3-actions_en_GB.properties - t3-actions/src/main/resources/i18n/t3-actions_fr_FR.properties - t3-domain/src/main/java/fr/ird/t3/entities/data/TripImpl.java - t3-domain/src/main/xmi/t3-persistence.zargo Changes: ===================================== t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeRF1Action.java ===================================== --- a/t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeRF1Action.java +++ b/t3-actions/src/main/java/fr/ird/t3/actions/data/level0/ComputeRF1Action.java @@ -467,13 +467,14 @@ public class ComputeRF1Action extends AbstractLevel0Action<ComputeRF1Configurati // do the computation of rf1 for all trips of the complete trip float sumLanding = 0; float sumCatch = 0; + float sumLocalMarket = 0; + float sumLocalMarketDetailled = 0; for (Trip trip : completeTrip) { String tripStr = decorate(trip, DecoratorService.WITH_ID); if (log.isDebugEnabled()) { - log.debug("Start count for trip " + - tripStr); + log.debug("Start count for trip " + tripStr); } float elementaryLandingTotalWeight = @@ -507,20 +508,24 @@ public class ComputeRF1Action extends AbstractLevel0Action<ComputeRF1Configurati ); } + float localMarketTotalWeight = trip.getFalseFishesWeight(); + float localMarketTotalWeightDetailled = trip.getLocalMarketBatchTotalWeight(speciesList); + addInfoMessage(l(locale, "t3.level0.computeRF1.resume.for.trip", - tripStr, elementaryCatchTotalWeight, - elementaryLandingTotalWeight) - ); + tripStr, elementaryCatchTotalWeight, elementaryLandingTotalWeight, + localMarketTotalWeight, localMarketTotalWeightDetailled)); if (log.isDebugEnabled()) { - log.debug("elementaryLandingTotalWeight = " + - elementaryLandingTotalWeight); - log.debug("elementaryCatchTotalWeight = " + - elementaryCatchTotalWeight); + log.debug("elementaryLandingTotalWeight = " + elementaryLandingTotalWeight); + log.debug("elementaryCatchTotalWeight = " + elementaryCatchTotalWeight); + log.debug("localMarketTotalWeight = " + localMarketTotalWeight); + log.debug("localMarketTotalWeightDetailled = " + localMarketTotalWeightDetailled); } sumLanding += elementaryLandingTotalWeight; sumCatch += elementaryCatchTotalWeight; + sumLocalMarket += localMarketTotalWeight; + sumLocalMarketDetailled += localMarketTotalWeightDetailled; } float rf1 = 1; @@ -533,8 +538,7 @@ public class ComputeRF1Action extends AbstractLevel0Action<ComputeRF1Configurati addInfoMessage( l(locale, "t3.level0.computeRF1.resume.for.complete.trip", - sumCatch, sumLanding, rf1) - ); + sumCatch, sumLanding, sumLocalMarket, sumLocalMarketDetailled, rf1)); return rf1; } ===================================== t3-actions/src/main/resources/i18n/t3-actions_en_GB.properties ===================================== --- a/t3-actions/src/main/resources/i18n/t3-actions_en_GB.properties +++ b/t3-actions/src/main/resources/i18n/t3-actions_en_GB.properties @@ -20,8 +20,8 @@ t3.input.ImportInputSource=Input Data Import t3.level0.action=Level 0 Operation\: %s t3.level0.computeActivitySetDurationAndPositiveSetCount=%s, set duration\: %s, positiveSetCount\: %s t3.level0.computeRF1.complete.trips.to.use.for.vessel=Found %s complete trip(s) for vessel %s -t3.level0.computeRF1.resume.for.complete.trip=Total catches weight %s / Total landing weight %s / RF1 \= %s -t3.level0.computeRF1.resume.for.trip=Trip %s, Total catches weight %s / Total landing weight %s +t3.level0.computeRF1.resume.for.complete.trip=Total catches weight %s / Total landing weight %s / Total local market weight %s / Detailled total local market weight %s / RF1 \= %s +t3.level0.computeRF1.resume.for.trip=Trip %s, Total catches weight %s / Total landing weight %s / Total local market weight %s / Detailled total local market weight %s t3.level0.computeRF1.resume.rf1.for.trip=Trip %s, rf1 to use %s t3.level0.computeRF1.resume.rf2.for.trip=Trip %s, rf2 to use %s t3.level0.computeRF1.species.to.use=Will use %s species \: %s ===================================== t3-actions/src/main/resources/i18n/t3-actions_fr_FR.properties ===================================== --- a/t3-actions/src/main/resources/i18n/t3-actions_fr_FR.properties +++ b/t3-actions/src/main/resources/i18n/t3-actions_fr_FR.properties @@ -20,8 +20,8 @@ t3.input.ImportInputSource=Import de données t3.level0.action=Opération du niveau 0 \: %s t3.level0.computeActivitySetDurationAndPositiveSetCount=%s, durée de calée \: %s, positiveSetCount \: %s t3.level0.computeRF1.complete.trips.to.use.for.vessel=%s marée(s) complète(s) trouvées pour le navire %s -t3.level0.computeRF1.resume.for.complete.trip=Poids total capturé %s / Poids total vendu %s / RF1 \= %s -t3.level0.computeRF1.resume.for.trip=Marée %s, Poids total capturé %s / Poids total vendu %s +t3.level0.computeRF1.resume.for.complete.trip=Poids total capturé %s / Poids total vendu %s / Poids marché local résumé %s / Poids marché local détaillé %s / RF1 \= %s +t3.level0.computeRF1.resume.for.trip=Marée %s, Poids total capturé %s / Poids total vendu %s / Poids marché local résumé %s / Poids marché local détaillé %s t3.level0.computeRF1.resume.rf1.for.trip=Marée %s, rf1 utilisé %s t3.level0.computeRF1.resume.rf2.for.trip=Marée %s, rf2 utilisé %s t3.level0.computeRF1.species.to.use=%s espèces à utiliser \: %s ===================================== t3-domain/src/main/java/fr/ird/t3/entities/data/TripImpl.java ===================================== --- a/t3-domain/src/main/java/fr/ird/t3/entities/data/TripImpl.java +++ b/t3-domain/src/main/java/fr/ird/t3/entities/data/TripImpl.java @@ -30,10 +30,10 @@ import fr.ird.t3.entities.reference.Ocean; import fr.ird.t3.entities.reference.Species; import fr.ird.t3.entities.reference.Vessel; import fr.ird.t3.entities.reference.VesselImpl; + import java.util.Collection; import java.util.Set; - import static org.nuiton.i18n.I18n.n; /** @@ -191,6 +191,19 @@ public class TripImpl extends TripAbstract { } @Override + public float getLocalMarketBatchTotalWeight(Collection<Species> species) { + float result = 0; + if (isLocalMarketBatchNotEmpty()) { + for (LocalMarketBatch localMarketBatch : getLocalMarketBatch()) { + if (species.contains(localMarketBatch.getSpecies()) && localMarketBatch.getWeight() != null) { + result += localMarketBatch.getWeight(); + } + } + } + return result; + } + + @Override public float getElementaryLandingTotalWeight(Collection<Species> species) { float result = 0; if (!isElementaryLandingEmpty()) { ===================================== t3-domain/src/main/xmi/t3-persistence.zargo ===================================== Binary files a/t3-domain/src/main/xmi/t3-persistence.zargo and b/t3-domain/src/main/xmi/t3-persistence.zargo differ View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/334460dbc1efdd9b7d84b493eeeced1c9... --- View it on GitLab: https://gitlab.com/ultreiaio/ird-t3/commit/334460dbc1efdd9b7d84b493eeeced1c9... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT