branch feature/5923 updated (1322a83 -> b2f3804)
This is an automated email from the git hooks/post-receive script. New change to branch feature/5923 in repository wao. See http://git.codelutin.com/wao.git from 1322a83 Remaniement de la génération du graphique du planifié vs réalisé, on introduit un pattern Template Method et trois implémentations (une par programme) new 49a6592 Factorisation de la déclaration du converter, on applique le même pour toutes les instances de JFreeChart new b54359d Ajout de .chart sur toutes les images correspondantes et mise en place d'une marge new b2f3804 Dans la synthèse ObsMer on, montre le graphique du réalisé en jours de mers The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit b2f3804d10e80a1985dcbcf870197089d0929002 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Feb 20 12:14:05 2015 +0100 Dans la synthèse ObsMer on, montre le graphique du réalisé en jours de mers commit b54359d32027608f105529ced7db2e5446f29888 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Feb 20 12:12:33 2015 +0100 Ajout de .chart sur toutes les images correspondantes et mise en place d'une marge commit 49a6592d6c626b63c25483feb930d9847cd22eb2 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Feb 20 11:20:44 2015 +0100 Factorisation de la déclaration du converter, on applique le même pour toutes les instances de JFreeChart Summary of changes: .../fr/ifremer/wao/services/service/Synthesis.java | 10 ++++ .../wao/services/service/SynthesisService.java | 57 ++++++++++++++++++++++ .../resources/i18n/wao-services_en_GB.properties | 1 + .../resources/i18n/wao-services_fr_FR.properties | 1 + .../web/converter/JFreeChartToImgTagConverter.java | 2 +- .../service/Synthesis-conversion.properties | 22 --------- .../src/main/resources/xwork-conversion.properties | 1 + .../src/main/webapp/WEB-INF/content/synthesis.jsp | 5 ++ wao-web/src/main/webapp/wao.css | 2 +- 9 files changed, 77 insertions(+), 24 deletions(-) delete mode 100644 wao-web/src/main/resources/fr/ifremer/wao/services/service/Synthesis-conversion.properties -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/5923 in repository wao. See http://git.codelutin.com/wao.git commit 49a6592d6c626b63c25483feb930d9847cd22eb2 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Feb 20 11:20:44 2015 +0100 Factorisation de la déclaration du converter, on applique le même pour toutes les instances de JFreeChart --- .../service/Synthesis-conversion.properties | 22 ---------------------- .../src/main/resources/xwork-conversion.properties | 1 + 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/wao-web/src/main/resources/fr/ifremer/wao/services/service/Synthesis-conversion.properties b/wao-web/src/main/resources/fr/ifremer/wao/services/service/Synthesis-conversion.properties deleted file mode 100644 index e60cdb5..0000000 --- a/wao-web/src/main/resources/fr/ifremer/wao/services/service/Synthesis-conversion.properties +++ /dev/null @@ -1,22 +0,0 @@ -### -# #%L -# Wao :: Web -# %% -# Copyright (C) 2009 - 2014 Ifremer -# %% -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# #L% -### -expectedVsActualObservationsByMonthsChart=fr.ifremer.wao.web.converter.JFreeChartToImgTagConverter -boardingBoatsChart=fr.ifremer.wao.web.converter.JFreeChartToImgTagConverter diff --git a/wao-web/src/main/resources/xwork-conversion.properties b/wao-web/src/main/resources/xwork-conversion.properties index e8e382d..517b2a1 100644 --- a/wao-web/src/main/resources/xwork-conversion.properties +++ b/wao-web/src/main/resources/xwork-conversion.properties @@ -20,3 +20,4 @@ ### java.lang.Double=org.nuiton.web.struts2.converters.HundredthLocalNumberConverter java.lang.Integer=org.nuiton.web.struts2.converters.HundredthLocalNumberConverter +org.jfree.chart.JFreeChart=fr.ifremer.wao.web.converter.JFreeChartToImgTagConverter -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/5923 in repository wao. See http://git.codelutin.com/wao.git commit b54359d32027608f105529ced7db2e5446f29888 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Feb 20 12:12:33 2015 +0100 Ajout de .chart sur toutes les images correspondantes et mise en place d'une marge --- .../java/fr/ifremer/wao/web/converter/JFreeChartToImgTagConverter.java | 2 +- wao-web/src/main/webapp/wao.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wao-web/src/main/java/fr/ifremer/wao/web/converter/JFreeChartToImgTagConverter.java b/wao-web/src/main/java/fr/ifremer/wao/web/converter/JFreeChartToImgTagConverter.java index 9fe7f81..ca311b9 100644 --- a/wao-web/src/main/java/fr/ifremer/wao/web/converter/JFreeChartToImgTagConverter.java +++ b/wao-web/src/main/java/fr/ifremer/wao/web/converter/JFreeChartToImgTagConverter.java @@ -66,7 +66,7 @@ public class JFreeChartToImgTagConverter extends StrutsTypeConverter { String base64code = BaseEncoding.base64().encode(bytes); - String html = "<img alt=\"" + chart.getTitle().getText() + "\" src=\"data:image/png;base64," + base64code + "\" />"; + String html = "<img alt=\"" + chart.getTitle().getText() + "\" src=\"data:image/png;base64," + base64code + "\" class=\"chart\" />"; return html; diff --git a/wao-web/src/main/webapp/wao.css b/wao-web/src/main/webapp/wao.css index d3524b9..7148779 100644 --- a/wao-web/src/main/webapp/wao.css +++ b/wao-web/src/main/webapp/wao.css @@ -531,9 +531,9 @@ button.#sampling-plan-filters-form_0:hover { } .chart { - height: 400px; margin-left: auto; margin-right: auto; + margin-bottom: 25px; } /****************************************************************************** -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/5923 in repository wao. See http://git.codelutin.com/wao.git commit b2f3804d10e80a1985dcbcf870197089d0929002 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Feb 20 12:14:05 2015 +0100 Dans la synthèse ObsMer on, montre le graphique du réalisé en jours de mers --- .../fr/ifremer/wao/services/service/Synthesis.java | 10 ++++ .../wao/services/service/SynthesisService.java | 57 ++++++++++++++++++++++ .../resources/i18n/wao-services_en_GB.properties | 1 + .../resources/i18n/wao-services_fr_FR.properties | 1 + .../src/main/webapp/WEB-INF/content/synthesis.jsp | 5 ++ 5 files changed, 74 insertions(+) diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/Synthesis.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/Synthesis.java index f6d774d..e7417ed 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/Synthesis.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/Synthesis.java @@ -35,6 +35,8 @@ public class Synthesis { protected JFreeChart expectedVsActualObservationsByMonthsChart; + protected JFreeChart expectedVsActualDaysByMonthsChart; + protected JFreeChart boardingBoatsChart; protected int maxBoardingValue; @@ -63,6 +65,14 @@ public class Synthesis { this.expectedVsActualObservationsByMonthsChart = expectedVsActualObservationsByMonthsChart; } + public void setExpectedVsActualDaysByMonthsChart(JFreeChart expectedVsActualDaysByMonthsChart) { + this.expectedVsActualDaysByMonthsChart = expectedVsActualDaysByMonthsChart; + } + + public JFreeChart getExpectedVsActualDaysByMonthsChart() { + return expectedVsActualDaysByMonthsChart; + } + public JFreeChart getBoardingBoatsChart() { return boardingBoatsChart; } diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/SynthesisService.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/SynthesisService.java index c37c12b..10010be 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/SynthesisService.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/SynthesisService.java @@ -232,6 +232,7 @@ public class SynthesisService extends WaoServiceSupport { // selon le programme, on applique la ou les bons templates de génération du graphe ExpectedVsActualChartTemplateMethod method; if (obsProgram.isObsMer()) { + // pour obsMer, on a le graphe en observations puis celui en jours de mers method = ExpectedVsActualChartTemplateMethod.forObsMerInObservations( locale, periodFrom, periodTo, @@ -239,6 +240,13 @@ public class SynthesisService extends WaoServiceSupport { contacts, realVsEstimated); synthesis.setExpectedVsActualObservationsByMonthsChart(method.getChart()); + method = ExpectedVsActualChartTemplateMethod.forObsMerInDays( + locale, + periodFrom, periodTo, + sampleRows, + contacts, + realVsEstimated); + synthesis.setExpectedVsActualDaysByMonthsChart(method.getChart()); } else if (obsProgram.isObsVente()) { method = ExpectedVsActualChartTemplateMethod.forObsVenteInObservations( locale, @@ -434,6 +442,11 @@ public class SynthesisService extends WaoServiceSupport { return buildMethod(method, locale, periodFrom, periodTo, sampleRows, contacts, realVsEstimated); } + public static ExpectedVsActualChartTemplateMethod forObsMerInDays(Locale locale, Date periodFrom, Date periodTo, Collection<SampleRow> sampleRows, Collection<Contact> contacts, boolean realVsEstimated) { + ExpectedVsActualChartTemplateMethod method = new ExpectedVsActualObsMerDaysChartMethod(); + return buildMethod(method, locale, periodFrom, periodTo, sampleRows, contacts, realVsEstimated); + } + public static ExpectedVsActualChartTemplateMethod forObsVenteInObservations(Locale locale, Date periodFrom, Date periodTo, Collection<SampleRow> sampleRows, Collection<Contact> contacts, boolean realVsEstimated) { ExpectedVsActualChartTemplateMethod method = new ExpectedVsActualObsVenteObservationsChartMethod(); return buildMethod(method, locale, periodFrom, periodTo, sampleRows, contacts, realVsEstimated); @@ -608,6 +621,50 @@ public class SynthesisService extends WaoServiceSupport { } /** + * Pour ObsMer en nombre d'observation. + */ + protected static class ExpectedVsActualObsMerDaysChartMethod extends ExpectedVsActualChartTemplateMethod { + + /** + * On est sur un découpage mensuel. + */ + @Override + protected String formatPeriod(Date period) { + return WaoUtils.formatMonth(locale, period); + } + + /** + * On est sur un découpage mensuel. + */ + @Override + protected Date truncateToTimePeriodFunction(Date period) { + return WaoUtils.truncateToMonth(period); + } + + /** + * Le planifié est l'effort est nombre de marées × le nombre de jours de chaque marée. + */ + @Override + protected int getExpected(SampleMonth sampleMonth) { + int averageTideTimeInDays = sampleMonth.getSampleRow().getAverageTideTime(); + return sampleMonth.getExpectedTidesValue() * averageTideTimeInDays; + } + + @Override + protected String getValueAxisLabel() { + return I18n.l(locale, "wao.synthesis.daysCount"); + } + + /** + * Le réalisé est le nombre d'observation, on compte 1 observation pour 1 navire donc 1 pour chaque contact. + */ + @Override + protected int getActual(Contact contact) { + return contact.getObservationTimeInDays(); + } + } + + /** * Pour ObsVente en nombre d'observation. */ protected static class ExpectedVsActualObsVenteObservationsChartMethod extends ExpectedVsActualChartTemplateMethod { diff --git a/wao-services/src/main/resources/i18n/wao-services_en_GB.properties b/wao-services/src/main/resources/i18n/wao-services_en_GB.properties index 6d598d1..61e5090 100644 --- a/wao-services/src/main/resources/i18n/wao-services_en_GB.properties +++ b/wao-services/src/main/resources/i18n/wao-services_en_GB.properties @@ -109,6 +109,7 @@ wao.import.sampleRow.failure.unknownSpecies=Unknown species %s wao.import.sampleRow.failure.unknownTargetSpeciesDcfCode=Unknown target species code\: %s wao.import.sampleRow.failure.wrongFishingZone=There is no fishing zone with the code '%s' wao.import.sampleRow.failure.wrongSampleRowCodeFormat=The sample row code '%s' is not compliant with the format "YYYY_PIIII" +wao.synthesis.daysCount=Days count wao.synthesis.estimated=Estimated wao.synthesis.observationsCount=Observations count wao.synthesis.observationsCount.sclerochronology=Samples count diff --git a/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties b/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties index f96e5d8..ebff066 100644 --- a/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties +++ b/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties @@ -107,6 +107,7 @@ wao.import.sampleRow.failure.unknownSpecies=L'espèce %s n'est pas connue wao.import.sampleRow.failure.unknownTargetSpeciesDcfCode=Le code espèce cible %s est inconnu du référentiel wao.import.sampleRow.failure.wrongFishingZone=Le code '%s' ne correspond à aucune zone de pêche connue du référentiel wao.import.sampleRow.failure.wrongSampleRowCodeFormat=Le code '%s' n'est pas un code de ligne valide selon le format "AAAA_PIIII" +wao.synthesis.daysCount=Nombre de jours de mer wao.synthesis.estimated=Estimé wao.synthesis.observationsCount=Nombre d'observations wao.synthesis.observationsCount.sclerochronology=Nombre de prélèvements diff --git a/wao-web/src/main/webapp/WEB-INF/content/synthesis.jsp b/wao-web/src/main/webapp/WEB-INF/content/synthesis.jsp index 2182cd5..f6e23b3 100644 --- a/wao-web/src/main/webapp/WEB-INF/content/synthesis.jsp +++ b/wao-web/src/main/webapp/WEB-INF/content/synthesis.jsp @@ -221,6 +221,11 @@ </h2> <s:property value="synthesis.expectedVsActualObservationsByMonthsChart" escapeHtml="false"/> + + <s:if test="obsMer"> + <s:property value="synthesis.expectedVsActualDaysByMonthsChart" escapeHtml="false"/> + </s:if> + </article> <s:if test="obsMer || obsVente"> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm