Author: bpoussin Date: 2008-08-29 17:38:51 +0000 (Fri, 29 Aug 2008) New Revision: 1316 Added: trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java Removed: trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/simulator/Queue.xgl trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/simulator/Queue.xml Modified: trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/StatusBar.xgl trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/StatusBar.xml trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/context.xml trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/simulator/Simul.xml Log: modif pour que la queue s'aaffiche convenablement Deleted: trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java =================================================================== --- trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java 2008-08-29 15:39:43 UTC (rev 1315) +++ trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java 2008-08-29 17:38:51 UTC (rev 1316) @@ -1,365 +0,0 @@ -/* *##% - * Copyright (C) 2006 - * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * 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 General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - *##%*/ - -/* * - * PopulationMonitor.java - * - * Created: 21 août 2006 15:41:18 - * - * @author poussin - * @version $Revision$ - * - * Last update: $Date$ - * by : $Author$ - */ - -package fr.ifremer.isisfish.simulator; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.commons.collections.MapIterator; -import org.apache.commons.collections.keyvalue.MultiKey; -import org.apache.commons.collections.map.MultiKeyMap; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.codelutin.math.matrix.MatrixFactory; -import org.codelutin.math.matrix.MatrixIterator; -import org.codelutin.math.matrix.MatrixND; - -import fr.ifremer.isisfish.entities.Population; -import fr.ifremer.isisfish.entities.PopulationGroup; -import fr.ifremer.isisfish.entities.PopulationSeasonInfo; -import fr.ifremer.isisfish.entities.Species; -import fr.ifremer.isisfish.entities.Zone; -import fr.ifremer.isisfish.types.Date; -import fr.ifremer.isisfish.types.Month; - - -/** - * - * @author poussin - */ -public class PopulationMonitor { - - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(PopulationMonitor.class); - - /** current number of fish by Pop */ - protected Map<Population, MatrixND> Ns = new HashMap<Population, MatrixND>(); - /** reproduction key: <date, pop> value:<MatrixND> */ - protected MultiKeyMap reproductions = new MultiKeyMap(); - /** discard key: <date, pop> value:<MatrixND> */ - protected MultiKeyMap discards = new MultiKeyMap(); - /** catch per population, only last catch is remaining */ - protected Map<Population, MatrixND> catchs = new HashMap<Population, MatrixND>(); - /** catch per population, only last catch is remaining */ - protected Map<Population, MatrixND> holdCatchs = new HashMap<Population, MatrixND>(); - protected double totalHoldCatch = 0; - - /** - * Return all population actualy in PopulationMonitor - * @return new list of Population - */ - public List<Population> getPopulations() { - ArrayList<Population> result = new ArrayList<Population>(Ns.keySet()); - return result; - } - - /** - * Return current biomass for species - * @param species - * @return - */ - public double getBiomass(Species species) { - double result = 0; - - for (Population pop : species.getPopulation()) { - result += getBiomass(pop); - } - - return result; - } - - /** - * Return current biomass for population - * @param pop - * @return - */ - public double getBiomass(Population pop) { - double result = 0; - - MatrixND n = getN(pop); - if (n != null) { - n = n.sumOverDim(1); - for (MatrixIterator i=n.iterator(); i.next();){ - Object [] coord = i.getSemanticsCoordinates(); - PopulationGroup group = (PopulationGroup)coord[0]; - result += i.getValue() * group.getMeanWeight(); - } - } - - return result; - } - - /** - * Return current numbers for population - * @param pop - * @return - */ - public MatrixND getN(Population pop) { - MatrixND result = Ns.get(pop); - - if (result != null) { - // change semantics with list from argument to ensure that - // semantics don't used too old context - result.setSemantics(0, pop.getPopulationGroup()); - result.setSemantics(1, pop.getPopulationZone()); - } - - return result; - } - - public void setN(Population pop, MatrixND mat) { - Ns.put(pop, mat); - } - - /** - * @return Returns the reproduction. - */ - public MatrixND getReproduction(Date date, Population pop) { - return (MatrixND)this.reproductions.get(date, pop); - } - - /** - * @param reproduction The reproduction to set. - */ - public void setReproduction(Date date, Population pop, MatrixND repro) { - this.reproductions.put(date, pop, repro); - } - - /** - * Applique de la mortalite naturelle aux poissons qui sont pas encore - * dans les classes de populations. (Reproduction) - * @param pop - */ - public void applyReproductionMortality(Population pop) { - for (MapIterator i=reproductions.mapIterator(); i.hasNext();) { - i.next(); - MultiKey key = (MultiKey)i.getKey(); - if (pop.equals(key.getKey(1))) { - MatrixND reproduction = (MatrixND)i.getValue(); - if (log.isTraceEnabled()) { - log.trace("Matrix repro before mortality: " + reproduction); - } - for(MatrixIterator mi=reproduction.iterator(); mi.next();){ - Object[] sems = mi.getSemanticsCoordinates(); - Zone z = (Zone)sems[0]; - double coeff = pop.getNaturalDeathBirth(z); - if (log.isTraceEnabled()) { - log.trace("NaturalDeath zone " + z + "=" + coeff); - } - mi.setValue(mi.getValue() * Math.exp(-coeff/Month.NUMBER_OF_MONTH)); - } - if (log.isTraceEnabled()) { - log.trace("Matrix repro after mortality: " + reproduction); - } - } - } - } - - /** - * @todo les reproductions qui sont trop veille pour encore servir - * doivent être supprimées. c-a-d date < currentDate - etalement - gap between repro recru - * Une autre facon de faire est de supprimer les repro == 0 car normalement - * toute la repro doit etre utilisé au bout d'un certain temps - * - * @param date - * @param pop - * @return - */ - public MatrixND getRecruitment(Date date, Population pop) { - MatrixND matEtalement = pop.getRecruitmentDistribution(); - int etalement = matEtalement.getDim(0); - - MatrixND result = MatrixFactory.getInstance().create( - new List[]{pop.getPopulationGroup(), pop.getPopulationZone()}); - - // pour chaque - for(int e=0; e<etalement; e++){ - // recuperation de la reproduction stucture en zone repro - Date d = new Date(date.getDate() - e - - pop.getMonthGapBetweenReproRecrutement()); - MatrixND repro = (MatrixND)reproductions.get(d, pop); - - if(repro != null){ // si une repro existe pour le mois - - // on fait la correspondance entre les zones repro et - // recrutement - - PopulationGroup classe; - int indiceClasse = 0; - // si on a change d'annee le recrutement ne se fait pas en - // classe 0 mais en classe 1, si on a change 2 fois d'annee - // le recrutement se fait en age 2, etc. - classe = pop.getPopulationGroup().get(indiceClasse); - - List<Zone> zoneRepros = pop.getReproductionZone(); - - // on multiplie la repro par le coeff de recrutement - double coeff = matEtalement.getValue(e); - - MatrixND matRepro = repro.copy(); - matRepro = matRepro.mults(coeff); - - matRepro.setSemantics(0, zoneRepros); - - MatrixND mapping = pop.getMappingZoneReproZoneRecru(); - for(Zone zoneRepro : zoneRepros){ - MatrixND submapping = mapping.getSubMatrix(0, new Object[]{zoneRepro}); - for (MatrixIterator i=submapping.iterator(); i.hasNext();) { - i.next(); - Object[] sem = i.getSemanticsCoordinates(); - Zone zoneRecru = (Zone)sem[1]; - double c = i.getValue(); - result.setValue(classe, zoneRecru, c*matRepro.getValue(zoneRepro) - +result.getValue(classe, zoneRecru)); - } - } - } - } - - if(pop.getSpecies().getAgeGroupType()){ - // conversion et retour de la matrice en vecteur - MatrixND N = pop.N2DToN1D(result); - // on applique les migrations et le changement d'age sur le resultat - // on suppose que la reproduction est toujours dans une seul saison - Date dateRepro = new Date(date.getDate() - - pop.getMonthGapBetweenReproRecrutement()); - - // recherche les saisons des differents mois entre les deux dates - List<PopulationSeasonInfo> infos = pop.getPopulationSeasonInfo(); - List<PopulationSeasonInfo> usedSeasons = new ArrayList<PopulationSeasonInfo>(); - - while (date.after(dateRepro)) { - dateRepro = dateRepro.next(); - Month month = dateRepro.getMonth(); - for (PopulationSeasonInfo info : infos) { - if (month.equals(info.getFirstMonth())) { - usedSeasons.add(info); - dateRepro = new Date(dateRepro.getDate() + info.getMonths().size() - 1); // -1 because, for have next() - break; - } - } - } - - for(PopulationSeasonInfo info : usedSeasons){ - Month month = info.getFirstMonth(); - MatrixND CA = info.getGroupChangeMatrix(month); - MatrixND MI = info.getMigrationMatrix(month, result); - MatrixND tmp0 = N.mult(CA); - MatrixND tmp2 = tmp0.mult(MI); - N = tmp2; - } - result = pop.split2D(N); - } - return result; - } - - /** - * @param catchPerStrategyMet - */ - public void holdCatch(Population pop, MatrixND catchPerStrategyMet) { - catchs.put(pop, catchPerStrategyMet); - - MatrixND holdCatch = holdCatchs.get(pop); - if (holdCatch == null) { - holdCatch = MatrixFactory.getInstance().create(catchPerStrategyMet); - holdCatchs.put(pop, holdCatch); - } else { - holdCatch.add(catchPerStrategyMet); - } - - // compute total - for(MatrixIterator i=catchPerStrategyMet.iterator(); i.next();){ - this.totalHoldCatch += i.getValue(); - } - - } - - /** - * @param pop - * @return - */ - public MatrixND getCatch(Population pop) { - MatrixND result = catchs.get(pop); - return result; - } - - /** - * @param pop - * @return - */ - public MatrixND getHoldCatch(Population pop) { - MatrixND result = holdCatchs.get(pop); - return result; - } - - /** - * @param pop - * @return - */ - public double getTotalHoldCatch(Population pop) { - double result = totalHoldCatch; - return result; - } - - /** - * raz capture cumulée de toutes les pops - */ - public void clearCatch() { - catchs.clear(); - holdCatchs.clear(); - totalHoldCatch = 0; - } - - /** - * @param date - * @param pop - * @return - */ - public MatrixND getDiscard(Date date, Population pop) { - MatrixND result = (MatrixND)discards.get(date, pop); - return result; - } - - public void addDiscard(Date date, Population pop, MatrixND discard) { - MatrixND tmp = (MatrixND)discards.get(date, pop); - if (tmp == null) { - tmp = discard.copy(); - discards.put(date, pop, tmp); - } else { - tmp.add(discard); - } - } -} - - Copied: trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java (from rev 1300, branches/isis-fish-3.1.4/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java) =================================================================== --- trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java (rev 0) +++ trunk/isis-fish/src/java/fr/ifremer/isisfish/simulator/PopulationMonitor.java 2008-08-29 17:38:51 UTC (rev 1316) @@ -0,0 +1,399 @@ +/* *##% + * Copyright (C) 2006 + * Ifremer, Code Lutin, Cédric Pineau, Benjamin Poussin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * 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 General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * PopulationMonitor.java + * + * Created: 21 août 2006 15:41:18 + * + * @author poussin + * @version $Revision: 428 $ + * + * Last update: $Date: 2007-10-15 14:56:13 +0200 (lun, 15 oct 2007) $ + * by : $Author: bpoussin $ + */ + +package fr.ifremer.isisfish.simulator; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.codelutin.math.matrix.MatrixFactory; +import org.codelutin.math.matrix.MatrixIterator; +import org.codelutin.math.matrix.MatrixND; + +import fr.ifremer.isisfish.entities.Population; +import fr.ifremer.isisfish.entities.PopulationGroup; +import fr.ifremer.isisfish.entities.PopulationSeasonInfo; +import fr.ifremer.isisfish.entities.Species; +import fr.ifremer.isisfish.entities.Zone; +import fr.ifremer.isisfish.types.Date; +import fr.ifremer.isisfish.types.Month; +import java.util.Collections; + + +/** + * Classe permettant le suivi des populations de la simulation. + * <p> + * Cette classe est normalement multi-thread safe + * <p> + * FIXME: certain calcul sont les memes que ceux implanter dans les scripts + * a cause du groupe des juveniles qui n'est pas un vrai groupe de population. + * Il serait bon que ce groupe deviennent un vrai groupe et que ce code specifique + * puisse etre supprimer. + * + * + * @author poussin + */ +public class PopulationMonitor { + + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Log log = LogFactory.getLog(PopulationMonitor.class); + + /** La liste des pops monitorer par cette instance */ + protected List<Population> pops = null; + /** current number of fish by Pop */ + protected Map<Population, MatrixND> Ns = new HashMap<Population, MatrixND>(); + /** reproduction key: <date, pop> value:<MatrixND> */ + protected Map<Population, Map<Date, MatrixND>> reproductions = new HashMap<Population, Map<Date, MatrixND>>(); + /** discard key: <date, pop> value:<MatrixND> */ + protected Map<Population, Map<Date, MatrixND>> discards = new HashMap<Population, Map<Date, MatrixND>>(); + /** catch per population, only last catch is remaining */ + protected Map<Population, MatrixND> catchs = new HashMap<Population, MatrixND>(); + /** catch per population, only last catch is remaining */ + protected Map<Population, MatrixND> holdCatchs = new HashMap<Population, MatrixND>(); + protected double totalHoldCatch = 0; + + /** + * Initialise le monitor pour l'ensemble de pop passe en parametre. + * Normalement cet init est fait dans le thread principale de la simulation + * et il n'y a pas de besoin de le synchroniser. + * + * Cet init permet d'avoir ensuite le maxime de variable en lecture, et donc + * de permettre le multithreading de facon legere (pas de synchronise) et + * sur (pas de concurent modification exception) + * + * @param pops + */ + public void init(List<Population> pops) { + this.pops = Collections.unmodifiableList(new ArrayList<Population>(pops)); + for (Population pop : this.pops) { + reproductions.put(pop, new HashMap<Date, MatrixND>()); + discards.put(pop, new HashMap<Date, MatrixND>()); + } + } + + /** + * Return all population actualy in PopulationMonitor + * @return new list of Population + */ + public List<Population> getPopulations() { + return pops; + } + + /** + * Return current biomass for species + * @param species + * @return + */ + public double getBiomass(Species species) { + double result = 0; + + for (Population pop : species.getPopulation()) { + result += getBiomass(pop); + } + + return result; + } + + /** + * Return current biomass for population + * @param pop + * @return + */ + public double getBiomass(Population pop) { + double result = 0; + + MatrixND n = getN(pop); + if (n != null) { + n = n.sumOverDim(1); + for (MatrixIterator i=n.iterator(); i.next();){ + Object [] coord = i.getSemanticsCoordinates(); + PopulationGroup group = (PopulationGroup)coord[0]; + result += i.getValue() * group.getMeanWeight(); + } + } + + return result; + } + + /** + * Return current numbers for population + * @param pop + * @return + */ + public MatrixND getN(Population pop) { + MatrixND result = Ns.get(pop); + + if (result != null) { + // change semantics with list from argument to ensure that + // semantics don't used too old context + result.setSemantics(0, pop.getPopulationGroup()); + result.setSemantics(1, pop.getPopulationZone()); + } + + return result; + } + + public void setN(Population pop, MatrixND mat) { + Ns.put(pop, mat); + } + + /** + * @return Returns the reproduction. + */ + public MatrixND getReproduction(Date date, Population pop) { + return this.reproductions.get(pop).get(date); + } + + /** + * @param reproduction The reproduction to set. + */ + public void setReproduction(Date date, Population pop, MatrixND repro) { + reproductions.get(pop).put(date, repro); + } + + /** + * Applique de la mortalite naturelle aux poissons qui sont pas encore + * dans les classes de populations. (Reproduction) + * @param pop + */ + public void applyReproductionMortality(Population pop) { + for (MatrixND reproduction : reproductions.get(pop).values()) { + if (log.isTraceEnabled()) { + log.trace("Matrix repro before mortality: " + reproduction); + } + + for (MatrixIterator mi = reproduction.iterator(); mi.next();) { + Object[] sems = mi.getSemanticsCoordinates(); + Zone z = (Zone) sems[0]; + double coeff = pop.getNaturalDeathBirth(z); + if (log.isTraceEnabled()) { + log.trace("NaturalDeath zone " + z + "=" + coeff); + } + mi.setValue(mi.getValue() * Math.exp(-coeff / Month.NUMBER_OF_MONTH)); + } + if (log.isTraceEnabled()) { + log.trace("Matrix repro after mortality: " + reproduction); + } + } + } + + /** + * @todo les reproductions qui sont trop veille pour encore servir + * doivent être supprimées. c-a-d date < currentDate - etalement - gap between repro recru + * Une autre facon de faire est de supprimer les repro == 0 car normalement + * toute la repro doit etre utilisé au bout d'un certain temps + * + * @param date + * @param pop + * @return + */ + public MatrixND getRecruitment(Date date, Population pop) { + MatrixND matEtalement = pop.getRecruitmentDistribution(); + int etalement = matEtalement.getDim(0); + + MatrixND result = MatrixFactory.getInstance().create( + new List[]{pop.getPopulationGroup(), pop.getPopulationZone()}); + + // pour chaque + for(int e=0; e<etalement; e++){ + // recuperation de la reproduction stucture en zone repro + Date d = new Date(date.getDate() - e - + pop.getMonthGapBetweenReproRecrutement()); + MatrixND repro = (MatrixND)reproductions.get(pop).get(d); + + if(repro != null){ // si une repro existe pour le mois + + // on fait la correspondance entre les zones repro et + // recrutement + + PopulationGroup classe; + int indiceClasse = 0; + // si on a change d'annee le recrutement ne se fait pas en + // classe 0 mais en classe 1, si on a change 2 fois d'annee + // le recrutement se fait en age 2, etc. + classe = pop.getPopulationGroup().get(indiceClasse); + + List<Zone> zoneRepros = pop.getReproductionZone(); + + // on multiplie la repro par le coeff de recrutement + double coeff = matEtalement.getValue(e); + + MatrixND matRepro = repro.copy(); + matRepro = matRepro.mults(coeff); + + matRepro.setSemantics(0, zoneRepros); + + MatrixND mapping = pop.getMappingZoneReproZoneRecru(); + for(Zone zoneRepro : zoneRepros){ + MatrixND submapping = mapping.getSubMatrix(0, new Object[]{zoneRepro}); + for (MatrixIterator i=submapping.iterator(); i.hasNext();) { + i.next(); + Object[] sem = i.getSemanticsCoordinates(); + Zone zoneRecru = (Zone)sem[1]; + double c = i.getValue(); + result.setValue(classe, zoneRecru, c*matRepro.getValue(zoneRepro) + +result.getValue(classe, zoneRecru)); + } + } + } + } + + if(pop.getSpecies().getAgeGroupType()){ + // conversion et retour de la matrice en vecteur + MatrixND N = pop.N2DToN1D(result); + // on applique les migrations et le changement d'age sur le resultat + // on suppose que la reproduction est toujours dans une seul saison + Date dateRepro = new Date(date.getDate() - + pop.getMonthGapBetweenReproRecrutement()); + + // recherche les saisons des differents mois entre les deux dates + List<PopulationSeasonInfo> infos = pop.getPopulationSeasonInfo(); + List<PopulationSeasonInfo> usedSeasons = new ArrayList<PopulationSeasonInfo>(); + + while (date.after(dateRepro)) { + dateRepro = dateRepro.next(); + Month month = dateRepro.getMonth(); + for (PopulationSeasonInfo info : infos) { + if (month.equals(info.getFirstMonth())) { + usedSeasons.add(info); + dateRepro = new Date(dateRepro.getDate() + info.getMonths().size() - 1); // -1 because, for have next() + break; + } + } + } + + for(PopulationSeasonInfo info : usedSeasons){ + Month month = info.getFirstMonth(); + MatrixND CA = info.getGroupChangeMatrix(month); + MatrixND MI = info.getMigrationMatrix(month, result); + MatrixND tmp0 = N.mult(CA); + MatrixND tmp2 = tmp0.mult(MI); + N = tmp2; + } + result = pop.split2D(N); + } + return result; + } + + /** + * @param catchPerStrategyMet + */ + public void holdCatch(Population pop, MatrixND catchPerStrategyMet) { + catchs.put(pop, catchPerStrategyMet); + + MatrixND holdCatch = holdCatchs.get(pop); + if (holdCatch == null) { + holdCatch = MatrixFactory.getInstance().create(catchPerStrategyMet); + holdCatchs.put(pop, holdCatch); + } else { + holdCatch.add(catchPerStrategyMet); + } + + // compute total + for(MatrixIterator i=catchPerStrategyMet.iterator(); i.next();){ + this.totalHoldCatch += i.getValue(); + } + + } + + /** + * @param pop + * @return + */ + public MatrixND getCatch(Population pop) { + MatrixND result = catchs.get(pop); + return result; + } + + /** + * @param pop + * @return + */ + public MatrixND getHoldCatch(Population pop) { + MatrixND result = holdCatchs.get(pop); + return result; + } + + /** + * @param pop + * @return + */ + public double getTotalHoldCatch(Population pop) { + double result = totalHoldCatch; + return result; + } + + /** + * raz capture cumulée de toutes les pops + */ + public void clearCatch() { + catchs.clear(); + holdCatchs.clear(); + totalHoldCatch = 0; + } + + /** + * @param date + * @param pop + * @return + */ + public MatrixND getDiscard(Date date, Population pop) { + MatrixND result = discards.get(pop).get(date); + return result; + } + + /** + * FIXME: discards n'est jamais vider, on le conserve pour toutes les annees + * il serait bon de faire un peu le menage de temps en temps. + * + * @param date + * @param pop + * @param discard + */ + public void addDiscard(Date date, Population pop, MatrixND discard) { + Map<Date, MatrixND> oneDiscard = discards.get(pop); + synchronized(oneDiscard) { + MatrixND tmp = oneDiscard.get(date); + if (tmp == null) { + tmp = discard.copy(); + discards.get(pop).put(date, tmp); + } else { + tmp.add(discard); + } + } + } +} + + Modified: trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/StatusBar.xgl =================================================================== --- trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/StatusBar.xgl 2008-08-29 15:39:43 UTC (rev 1315) +++ trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/StatusBar.xgl 2008-08-29 17:38:51 UTC (rev 1316) @@ -5,6 +5,7 @@ <td fill="Both" width="100%">labelStatus</td> <td fill="Both" width="5%">stopCommand</td> <td fill="Both" width="5%">memoryStatus</td> + <td fill="Both" width="5%">vcs</td> </tr> </table> </layout> Modified: trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/StatusBar.xml =================================================================== --- trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/StatusBar.xml 2008-08-29 15:39:43 UTC (rev 1315) +++ trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/StatusBar.xml 2008-08-29 17:38:51 UTC (rev 1316) @@ -1,4 +1,5 @@ -<panel border="LoweredBevelBorder" layout="XMLGridLayout(fr/ifremer/isisfish/ui/StatusBar.xgl)"> +<panel border="LoweredBevelBorder" + layout="XMLGridLayout(fr/ifremer/isisfish/ui/StatusBar.xgl)"> <ActionMonitor postThreadCommand="xpath:setVisible($stopCommand, 'false')" progressStartTime="5" messageTime="7" @@ -14,4 +15,6 @@ <MemoryStatus constraints="memoryStatus"/> + <VCSConnectionState constraints="vcs"/> + </panel> Modified: trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/context.xml =================================================================== --- trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/context.xml 2008-08-29 15:39:43 UTC (rev 1315) +++ trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/context.xml 2008-08-29 17:38:51 UTC (rev 1316) @@ -66,6 +66,7 @@ <map> <!-- Les composants ajoutés pour isis --> <!-- panel --> + <entry key="VCSConnectionState"><value>fr.ifremer.isisfish.ui.widget.VCSConnectionState</value></entry> <entry key="Queue"><value>fr.ifremer.isisfish.ui.simulator.Queue</value></entry> <entry key="MatrixPanel"><value>org.codelutin.math.matrix.gui.MatrixPanelEditor</value></entry> <entry key="OpenMapToolPanel"><value>fr.ifremer.isisfish.map.OpenMapToolPanel</value></entry> Deleted: trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/simulator/Queue.xgl =================================================================== --- trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/simulator/Queue.xgl 2008-08-29 15:39:43 UTC (rev 1315) +++ trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/simulator/Queue.xgl 2008-08-29 17:38:51 UTC (rev 1316) @@ -1,18 +0,0 @@ -<layout> - <table cellspacing="2"> - <tr> - <td fill="Both" height="40%" width="100%" colspan="3">queueTable</td> - </tr> - <tr> - <td fill="Both" height="40%" width="100%" colspan="3">queueTableDone</td> - </tr> - <tr> - <td height="20%" width="35%">buttonSimulQueueStart</td> - <td height="20%" width="35%">buttonSimulQueueRemove</td> - <td height="20%" width="30%">buttonSimulQueueShowLog</td> - </tr> - </table> -</layout> - - - Deleted: trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/simulator/Queue.xml =================================================================== --- trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/simulator/Queue.xml 2008-08-29 15:39:43 UTC (rev 1315) +++ trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/simulator/Queue.xml 2008-08-29 17:38:51 UTC (rev 1316) @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-15"?> - -<Queue/> -<!-- -<panel id="simulQueue" name="isisfish.queue.title" constraints="simulQueue" layout="XMLGridLayout(fr/ifremer/isisfish/ui/simulator/Queue.xgl)"> - - <scrollPane constraints="queueTable"> - <table id="queueTable"> - <tableModel> - <SimulationQueueModel id="queueModel"/> - </tableModel> - </table> - </scrollPane> - <scrollPane constraints="queueTableDone"> - <table id="queueTableDone"> - <tableModel> - <SimulationDoneQueueModel id="queueModelDone"/> - </tableModel> - </table> - </scrollPane> - - <button constraints="buttonSimulQueueStart" id="buttonSimulQueueStart" text="isisfish.queue.simulationLaunch" - actionCommand="xpath:setAutoLaunch(fr.ifremer.isisfish.simulator.SimulationService.getService(), 'true')"/> - <button constraints="buttonSimulQueueRemove" id="buttonSimulQueueRemove" text="isisfish.queue.stopSimulation" - actionCommand="xpath:stop(getJob($queueModel, $queueTable/selectedRow), 'true')"/> - <button constraints="buttonSimulQueueShowLog" id="buttonSimulQueueShowLog" text="isisfish.queue.showLog" - actionCommand="fr.ifremer.isisfish.ui.simulator.SimulatorAction.showLog($queueTableDone,$queueModelDone,$queueTableDone/selectedRow)"/> -</panel> - ---> \ No newline at end of file Modified: trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/simulator/Simul.xml =================================================================== --- trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/simulator/Simul.xml 2008-08-29 15:39:43 UTC (rev 1315) +++ trunk/isis-fish/src/uimodel/fr/ifremer/isisfish/ui/simulator/Simul.xml 2008-08-29 17:38:51 UTC (rev 1316) @@ -5,8 +5,11 @@ bundle="org.codelutin.i18n.I18nBundleBridge"> <!--onOpened="simulator.SimulatorAction.opened($simulTabs)"--> <WindowEvents id="events" - onOpened="simulator.SimulatorAction.opened($simulTabs,$buttonSimulQueueStart,$buttonSimulQueueRemove,$buttonSimulQueueShowLog,$queueTable,$queueTableDone,$buttonSimulParamsAnalysePlansRemove,$listSimulParamsAnalysePlansList,$buttonSimulParamsMesuresRemove,$listSimulParamsMesuresList)" + onOpened="simulator.SimulatorAction.opened($simulTabs,$buttonSimulParamsAnalysePlansRemove,$listSimulParamsAnalysePlansList,$buttonSimulParamsMesuresRemove,$listSimulParamsMesuresList)" onClosing="UIHelper.closeContext()" /> +<!-- +onOpened="simulator.SimulatorAction.opened($simulTabs,$buttonSimulQueueStart,$buttonSimulQueueRemove,$buttonSimulQueueShowLog,$queueTable,$queueTableDone,$buttonSimulParamsAnalysePlansRemove,$listSimulParamsAnalysePlansList,$buttonSimulParamsMesuresRemove,$listSimulParamsMesuresList)" +--> <ContextDataSource id="OldSimulationName" context="current" source="OldSimulationName"/> <ContextDataSource id="SimulationFilterModel" context="current" source="SimulationFilterModel"/> @@ -39,7 +42,8 @@ <xpanel xml="simulator/Export.xml"/> <xpanel xml="simulator/ResultChoice.xml"/> <xpanel xml="simulator/AdvancedParams.xml"/> - <xpanel xml="simulator/Queue.xml"/> + <Queue id="simulQueue" name="isisfish.queue.title"/> +<!-- <xpanel xml="simulator/Queue.xml"/> --> </tabbedPane> <xpanel constraints="statusBar" xml="StatusBar.xml"/>