From: <de...@us...> - 2009-01-27 20:57:19
|
Revision: 4415 http://fudaa.svn.sourceforge.net/fudaa/?rev=4415&view=rev Author: deniger Date: 2009-01-27 20:57:12 +0000 (Tue, 27 Jan 2009) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliModelInfos.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBuilderSuiteCalcul.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceReaderComposite.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliModelInfos.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliModelInfos.java 2009-01-27 18:04:48 UTC (rev 4414) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/commun/EbliModelInfos.java 2009-01-27 20:57:12 UTC (rev 4415) @@ -134,25 +134,18 @@ @Override public void addTableModelListener(TableModelListener l) { - // TODO Auto-generated method stub - } @Override public Class<?> getColumnClass(int columnIndex) { - // TODO Auto-generated method stub return String.class; } - @Override public int getColumnCount() { - // TODO Auto-generated method stub return colonnes_.size(); } - @Override public void removeTableModelListener(TableModelListener l) { - // TODO Auto-generated method stub } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBuilderSuiteCalcul.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBuilderSuiteCalcul.java 2009-01-27 18:04:48 UTC (rev 4414) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostBuilderSuiteCalcul.java 2009-01-27 20:57:12 UTC (rev 4415) @@ -31,319 +31,318 @@ */ public class TrPostBuilderSuiteCalcul { - /** - * Action qui r\xE9alise la suite de calcul. - * - * @author Adrien Hadoux - */ - public static class ActionBuildSuite extends EbliActionSimple { + /** + * Action qui r\xE9alise la suite de calcul. + * + * @author Adrien Hadoux + */ + public static class ActionBuildSuite extends EbliActionSimple { - TrPostSource src_; - TrPostCommonImplementation impl_; + TrPostSource src_; + TrPostCommonImplementation impl_; - public ActionBuildSuite(TrPostSource src, String _name, Icon _ic, String _ac, TrPostCommonImplementation impl) { - super(_name, _ic, _ac); - // TODO Auto-generated constructor stub - src_ = src; - src_ = src; - impl_ = impl; - } + public ActionBuildSuite(TrPostSource src, String _name, Icon _ic, String _ac, TrPostCommonImplementation impl) { + super(_name, _ic, _ac); + // TODO Auto-generated constructor stub + src_ = src; + src_ = src; + impl_ = impl; + } - public void actionPerformed(ActionEvent _e) { + public void actionPerformed(ActionEvent _e) { - // -- test de comptabilit\xE9 de fichier source --// - if (!isCompatibleSuiteCalcul(src_)) { - impl_.error(TrResource.getS("Le fichier n'est pas valide.")); - return; - } + // -- test de comptabilit\xE9 de fichier source --// + if (!isCompatibleSuiteCalcul(src_)) { + impl_.error(TrResource.getS("Le fichier n'est pas valide.")); + return; + } - // -- on lance la dialog de choix des fichiers sources --// - final TrPostSource srcChoisie = impl_.getCurrentProject().getChooserMultiSources(-1); - if (srcChoisie == null) { - impl_.error(TrResource.getS(TrResource.getS("Aucune source choisie"))); - return; - } + // -- on lance la dialog de choix des fichiers sources --// + final TrPostSource srcChoisie = impl_.getCurrentProject().getChooserMultiSources(-1); + if (srcChoisie == null) { + impl_.error(TrResource.getS(TrResource.getS("Aucune source choisie"))); + return; + } - if (!isCompatibleSuiteCalcul(srcChoisie)) { - impl_.error(TrResource.getS("Le fichier n'est pas valide.")); - return; - } + if (!isCompatibleSuiteCalcul(srcChoisie)) { + impl_.error(TrResource.getS("Le fichier n'est pas valide.")); + return; + } - List<String> error = new ArrayList<String>(); + List<String> error = new ArrayList<String>(); - // -- creation de la suite de calcul --// - TrPostSource suiteCalcul = createSuiteCalcul((TrPostSourceFromReader) src_, impl_, - (TrPostSourceFromReader) srcChoisie, error); + // -- creation de la suite de calcul --// + TrPostSource suiteCalcul = createSuiteCalcul((TrPostSourceFromReader) src_, impl_, + (TrPostSourceFromReader) srcChoisie, error); - if (suiteCalcul == null) { - // -- il se passe des choses \xE9tranges.... --// - String maxiStringLeo = ""; - for (String err : error) - maxiStringLeo += err + "\n"; + if (suiteCalcul == null) { + // -- il se passe des choses \xE9tranges.... --// + String maxiStringLeo = ""; + for (String err : error) + maxiStringLeo += err + "\n"; - impl_.error(maxiStringLeo); - return; - } + impl_.error(maxiStringLeo); + return; + } - // -- on ajoute la nouvelle src r\xE9sultat comme \xE9tant une suite de calcul --// + // -- on ajoute la nouvelle src r\xE9sultat comme \xE9tant une suite de calcul --// - impl_.c_.ajouterSource(suiteCalcul,suiteCalcul.getTitle()); + impl_.c_.ajouterSource(suiteCalcul, suiteCalcul.getTitle()); - // -- on cree la vue 2d correspondante --// + // -- on cree la vue 2d correspondante --// - TrPostProjet projet = impl_.getCurrentProject(); - TrPostLayoutPanelController controller = impl_.getCurrentLayoutFille().controller_; - final CalqueLegendeWidgetAdapter legendeCalque = new CalqueLegendeWidgetAdapter(controller.getSceneCourante(), - null); - final TrPostVisuPanel pnVisu = new TrPostVisuPanel(projet.getImpl(), projet, legendeCalque, suiteCalcul); - final EbliNode node = controller.addCalque(TrResource.getS("Calque") - + (controller.getSceneCourante().getAllVue2d().size() + 1), pnVisu.getLocation(), pnVisu.getPreferredSize(), - pnVisu, legendeCalque); - // -- ajout de l INFO de la source utilis\xE9e --// - node.getWidget().getController().setDescription(suiteCalcul.getTitle()); + TrPostProjet projet = impl_.getCurrentProject(); + TrPostLayoutPanelController controller = impl_.getCurrentLayoutFille().controller_; + final CalqueLegendeWidgetAdapter legendeCalque = new CalqueLegendeWidgetAdapter(controller.getSceneCourante(), + null); + final TrPostVisuPanel pnVisu = new TrPostVisuPanel(projet.getImpl(), projet, legendeCalque, suiteCalcul); + final EbliNode node = controller.addCalque(TrResource.getS("Calque") + + (controller.getSceneCourante().getAllVue2d().size() + 1), pnVisu.getLocation(), pnVisu.getPreferredSize(), + pnVisu, legendeCalque); + // -- ajout de l INFO de la source utilis\xE9e --// + node.getWidget().getController().setDescription(suiteCalcul.getTitle()); - // -- ajout des infos de cr\xE9ation --// + // -- ajout des infos de cr\xE9ation --// - TrPostSourceReaderComposite.fillInfosWithComposite(pnVisu.infosCreation_, - (TrPostSourceReaderComposite) ((TrPostSourceFromReader) suiteCalcul).getReader()); + TrPostSourceReaderComposite.fillInfosWithComposite(pnVisu.infosCreation_, + (TrPostSourceReaderComposite) ((TrPostSourceFromReader) suiteCalcul).getReader()); - } + } - } + } - /** - * R\xE9cup\xE9rer l'interface \xE0 partir du fichier - * - * @param _f - * @param _impl - * @return - */ - public static TrPostSourceFromReader createSourceFromeFile(File _f, TrPostCommonImplementation _impl) { - TrPostSource src = TrPostSourceBuilder.activeSourceAction(_f, _impl, _impl.getMainProgression()); - if (src != null && src instanceof TrPostSourceFromReader) return ((TrPostSourceFromReader) src); - return null; + /** + * R\xE9cup\xE9rer l'interface \xE0 partir du fichier + * + * @param _f + * @param _impl + * @return + */ + public static TrPostSourceFromReader createSourceFromeFile(File _f, TrPostCommonImplementation _impl) { + TrPostSource src = TrPostSourceBuilder.activeSourceAction(_f, _impl, _impl.getMainProgression()); + if (src != null && src instanceof TrPostSourceFromReader) return ((TrPostSourceFromReader) src); + return null; - } + } - public static TrPostSource createSuiteCalcul(File _f, TrPostCommonImplementation _impl, - TrPostSourceFromReader _reader, List<String> error) { - // -- lecture de l'interface \xE0 ajouter --// - TrPostSourceFromReader srcToConcat = createSourceFromeFile(_f, _impl); - return createSuiteCalcul(_reader, _impl, srcToConcat, error); - } + public static TrPostSource createSuiteCalcul(File _f, TrPostCommonImplementation _impl, + TrPostSourceFromReader _reader, List<String> error) { + // -- lecture de l'interface \xE0 ajouter --// + TrPostSourceFromReader srcToConcat = createSourceFromeFile(_f, _impl); + return createSuiteCalcul(_reader, _impl, srcToConcat, error); + } - /** - * Algorithme de construction d'une suite de calcul. - * - * @param srcToConcat - * @param _impl - * @param _reader - * @param error - * @return - */ - public static TrPostSource createSuiteCalcul(TrPostSourceFromReader srcToConcat, TrPostCommonImplementation _impl, - TrPostSourceFromReader _reader, List<String> error) { - TrPostSourceReaderComposite suite = null; - if (srcToConcat == null) { - error.add(TrResource.getS("Le fichier n'est pas valide.")); - return null; - } + /** + * Algorithme de construction d'une suite de calcul. + * + * @param srcToConcat + * @param _impl + * @param _reader + * @param error + * @return + */ + public static TrPostSource createSuiteCalcul(TrPostSourceFromReader srcToConcat, TrPostCommonImplementation _impl, + TrPostSourceFromReader _reader, List<String> error) { - if (_reader.isRubar() || srcToConcat.isRubar()) { - error.add(TrResource.getS("Format Rubar non g\xE9r\xE9")); - return null; - } + if (srcToConcat == null) { + error.add(TrResource.getS("Le fichier n'est pas valide.")); + return null; + } - // -- comparaison des grilles --// - EfGridInterface grille = srcToConcat.getGrid(); - if (!grille.isSameStrict(_reader.getGrid(), _impl.getMainProgression(), 0.01)) { - error.add(TrResource.getS("Les grilles ne sont pas identiques")); - return null; - } + if (_reader.isRubar() || srcToConcat.isRubar()) { + error.add(TrResource.getS("Format Rubar non g\xE9r\xE9")); + return null; + } - // -- comparaison des pas de temps d\xE9but et finaux --// - double[] time1 = TrPostSourceFromReader.getTimes(_reader.getReader()); - double[] time2 = TrPostSourceFromReader.getTimes(srcToConcat.getReader()); + // -- comparaison des grilles --// + EfGridInterface grille = srcToConcat.getGrid(); + if (!grille.isSameStrict(_reader.getGrid(), _impl.getMainProgression(), 0.01)) { + error.add(TrResource.getS("Les grilles ne sont pas identiques")); + return null; + } - if (time1[time1.length - 1] != time2[0] && time2[time2.length - 1] != time1[0]) { - error.add(TrResource - .getS("Le dernier pas de temps de l'un doit \xEAtre \xE9quivalent au premier pas de temps de l'autre.")); - return null; - } + // -- comparaison des pas de temps d\xE9but et finaux --// + double[] time1 = TrPostSourceFromReader.getTimes(_reader.getReader()); + double[] time2 = TrPostSourceFromReader.getTimes(srcToConcat.getReader()); - // -- recuperation des pas de temps et des variables --// - // double[] timeTotal= new double[time1.length+time2.length-1]; - // if(time1[0]>time2[0]){ - // //-- on permute pour garder l'ordre --// - // double[] temp=time1; - // time1=time2; - // time2=temp; - // } - // for(int i=0;i<time1.length;i++) - // timeTotal[i]=time1[i]; - // for(int i=0;i<time2.length-1;i++) - // timeTotal[time1.length+i]=time2[i+1]; + if (time1[time1.length - 1] != time2[0] && time2[time2.length - 1] != time1[0]) { + error.add(TrResource + .getS("Le dernier pas de temps de l'un doit \xEAtre \xE9quivalent au premier pas de temps de l'autre.")); + return null; + } - HashSet<H2dVariableType> listeVar = new HashSet<H2dVariableType>(); - H2dVariableType[] var = null; -// for (int i = 0; i < _reader.getAvailableVar().length; i++) -// listeVar.add(_reader.getVariable(i)); -// for (int i = 0; i < srcToConcat.getAvailableVar().length; i++) -// listeVar.add(srcToConcat.getVariable(i)); - - - //-- intersection des variables des 2 fichiers --// - for (int i = 0; i < _reader.getAvailableVar().length; i++){ - boolean trouve=false; - for (int j = 0; !trouve && j < srcToConcat.getAvailableVar().length; j++) - if(srcToConcat.getVariable(j).equals(_reader.getVariable(i)) || srcToConcat.getVariable(j).getID().equals(_reader.getVariable(i).getID()) ) { - trouve=true; - listeVar.add(_reader.getVariable(i)); - } - } - - var = new H2dVariableType[listeVar.size()]; - int k = 0; - for (H2dVariableType v : listeVar) - var[k++] = v; + // -- recuperation des pas de temps et des variables --// + // double[] timeTotal= new double[time1.length+time2.length-1]; + // if(time1[0]>time2[0]){ + // //-- on permute pour garder l'ordre --// + // double[] temp=time1; + // time1=time2; + // time2=temp; + // } + // for(int i=0;i<time1.length;i++) + // timeTotal[i]=time1[i]; + // for(int i=0;i<time2.length-1;i++) + // timeTotal[time1.length+i]=time2[i+1]; - // var=srcToConcat.variable_; + HashSet<H2dVariableType> listeVar = new HashSet<H2dVariableType>(); + H2dVariableType[] var = null; + // for (int i = 0; i < _reader.getAvailableVar().length; i++) + // listeVar.add(_reader.getVariable(i)); + // for (int i = 0; i < srcToConcat.getAvailableVar().length; i++) + // listeVar.add(srcToConcat.getVariable(i)); - // -- initialisation de la liste de source --// - List<TrPostSourceReaderInterface> listeSourceInterface_ = new ArrayList<TrPostSourceReaderInterface>(); + // -- intersection des variables des 2 fichiers --// + for (int i = 0; i < _reader.getAvailableVar().length; i++) { + boolean trouve = false; + for (int j = 0; !trouve && j < srcToConcat.getAvailableVar().length; j++) + if (srcToConcat.getVariable(j).equals(_reader.getVariable(i)) + || srcToConcat.getVariable(j).getID().equals(_reader.getVariable(i).getID())) { + trouve = true; + listeVar.add(_reader.getVariable(i)); + } + } - // -- on ajoute \xE0 la liste des interfaces l'interface 1 et l'intrface 2 --// - TrPostSourceReaderInterface interface1 = _reader.reader_; - TrPostSourceReaderInterface interface2 = srcToConcat.reader_; + var = new H2dVariableType[listeVar.size()]; + int k = 0; + for (H2dVariableType v : listeVar) + var[k++] = v; - // -- attetion au cas particulier: si une interface1 est deja une suite, il faut ajouter toutes ses interfaces --// - if (interface1 instanceof TrPostSourceReaderComposite) listeSourceInterface_ - .addAll(((TrPostSourceReaderComposite) interface1).listeSourceInterface_); - else listeSourceInterface_.add(interface1); + // var=srcToConcat.variable_; - if (interface2 instanceof TrPostSourceReaderComposite) listeSourceInterface_ - .addAll(((TrPostSourceReaderComposite) interface2).listeSourceInterface_); - else listeSourceInterface_.add(interface2); + // -- initialisation de la liste de source --// + List<TrPostSourceReaderInterface> listeSourceInterface_ = new ArrayList<TrPostSourceReaderInterface>(); - // -- ajout de tous les fichiers dans la collection --// - final Collection<File> file_ = new HashSet<File>(interface1.getFiles());; - file_.addAll(interface2.getFiles()); + // -- on ajoute \xE0 la liste des interfaces l'interface 1 et l'intrface 2 --// + TrPostSourceReaderInterface interface1 = _reader.reader_; + TrPostSourceReaderInterface interface2 = srcToConcat.reader_; - // -- on trie les listes dans l'ordre des timestep --// - Collections.sort(listeSourceInterface_, new ComparateurTrPostSourceReaderInterface()); + // -- attetion au cas particulier: si une interface1 est deja une suite, il faut ajouter toutes ses interfaces --// + if (interface1 instanceof TrPostSourceReaderComposite) listeSourceInterface_ + .addAll(((TrPostSourceReaderComposite) interface1).listeSourceInterface_); + else listeSourceInterface_.add(interface1); - // - ajout des correspondances timestep/source avec nouveau timestep --// - Map<Integer, CoupleTimeStepData> mapTimeStep_ = new HashMap<Integer, CoupleTimeStepData>(); - // TODO utilise TDoubleArrayList - TDoubleArrayList times = new TDoubleArrayList(); - // int cpt = 0; - for (TrPostSourceReaderInterface data : listeSourceInterface_) { - for (int i = 0; i < data.getNbTimeStep(); i++) { - // LOGIquement, il faudrait prendre en compte les erreurs d'arrondi - // -- ICI, pour cet algo, on doit degager tout les doublons et ne conserver que des valeurs uniques --// - if (!times.contains(data.getTimeStep(i))) { - // le cpt vaut la taille des times - mapTimeStep_.put(times.size(), new CoupleTimeStepData(data, i)); - times.add(data.getTimeStep(i)); - // cpt++; - } - } - } + if (interface2 instanceof TrPostSourceReaderComposite) listeSourceInterface_ + .addAll(((TrPostSourceReaderComposite) interface2).listeSourceInterface_); + else listeSourceInterface_.add(interface2); - double[] timeTotal = times.toNativeArray(); - // -- creation de la suite de calcul - suite = new TrPostSourceReaderComposite(timeTotal, var, mapTimeStep_, - listeSourceInterface_, file_); - - TrPostSource resultat=new TrPostSourceFromReader(suite, TrResource.getS("Suite de calcul"), grille, _impl); - _impl.getCurrentProject().deliverSourceSuiteId(resultat); - // -- creation du source Reader --// - return resultat; - } + // -- ajout de tous les fichiers dans la collection --// + final Collection<File> file_ = new HashSet<File>(interface1.getFiles());; + file_.addAll(interface2.getFiles()); + // -- on trie les listes dans l'ordre des timestep --// + Collections.sort(listeSourceInterface_, new ComparateurTrPostSourceReaderInterface()); - /** - * Methode qui se charge de construire la suite de calcul a partir de la liste des id des fichiers. - * - * @param listeIdSrc - * @param projet - * @return - */ - public static TrPostSource createSuiteCalculFromPersistance(List<String> listeIdSrc,TrPostProjet projet,String idSrc){ - TrPostCommonImplementation impl=projet.getImpl(); - //- on met proprement en forme les donn\xE9es --// - List<TrPostSourceFromReader> listeReader=new ArrayList<TrPostSourceFromReader>(); - for(String id:listeIdSrc){ + // - ajout des correspondances timestep/source avec nouveau timestep --// + Map<Integer, CoupleTimeStepData> mapTimeStep_ = new HashMap<Integer, CoupleTimeStepData>(); + // TODO utilise TDoubleArrayList + TDoubleArrayList times = new TDoubleArrayList(); + // int cpt = 0; + for (TrPostSourceReaderInterface data : listeSourceInterface_) { + for (int i = 0; i < data.getNbTimeStep(); i++) { + // LOGIquement, il faudrait prendre en compte les erreurs d'arrondi + // -- ICI, pour cet algo, on doit degager tout les doublons et ne conserver que des valeurs uniques --// + if (!times.contains(data.getTimeStep(i))) { + // le cpt vaut la taille des times + mapTimeStep_.put(times.size(), new CoupleTimeStepData(data, i)); + times.add(data.getTimeStep(i)); + // cpt++; + } + } + } - final TrPostSource srcChoisie = projet.findSourceById(id); - if (srcChoisie == null) { - impl.error(TrResource.getS(TrResource.getS("Le fichier r\xE9sultat d'id "+id+" est introuvable.\n Suite de calcul interrompue"))); - return null; - } - if (!isCompatibleSuiteCalcul(srcChoisie)) { - impl.error(TrResource.getS("Le fichier d'id "+id+" n'est pas valide pour la suite de calcul.")); - return null; - } - listeReader.add((TrPostSourceFromReader) srcChoisie) ; - } + double[] timeTotal = times.toNativeArray(); + // -- creation de la suite de calcul + TrPostSourceReaderComposite suite = new TrPostSourceReaderComposite(timeTotal, var, mapTimeStep_, + listeSourceInterface_, file_); - //-- on demarre la suite de calcul --// - Iterator<TrPostSourceFromReader> it=listeReader.iterator(); - TrPostSourceFromReader suiteProgressive=it.next(); + TrPostSource resultat = new TrPostSourceFromReader(suite, TrResource.getS("Suite de calcul"), grille, _impl); + resultat.buildDefaultVarUpdateLists(); + _impl.getCurrentProject().deliverSourceSuiteId(resultat); + // -- creation du source Reader --// + return resultat; + } - List<String> error=new ArrayList<String>(); - while(it.hasNext()){ - //-- on calcule la suite progressive que l'on stocke dans la suite progressive --// - TrPostSourceFromReader suite =(TrPostSourceFromReader) TrPostBuilderSuiteCalcul.createSuiteCalcul(suiteProgressive, impl, it.next(), error); - if(suite==null){ - String maxiStringLeo = ""; - for (String err : error) - maxiStringLeo += err + "\n"; - if(suiteProgressive!=null){ - maxiStringLeo+="La suite de calcul s'arrete donc avec les fichiers "+suiteProgressive.getTitle(); - suiteProgressive.setId(idSrc); - projet.ajouterSource(suiteProgressive); - } - - impl.error(maxiStringLeo); - return suiteProgressive; - }else - suiteProgressive=suite; + /** + * Methode qui se charge de construire la suite de calcul a partir de la liste des id des fichiers. + * + * @param listeIdSrc + * @param projet + * @return + */ + public static TrPostSource createSuiteCalculFromPersistance(List<String> listeIdSrc, TrPostProjet projet, String idSrc) { + TrPostCommonImplementation impl = projet.getImpl(); + // - on met proprement en forme les donn\xE9es --// + List<TrPostSourceFromReader> listeReader = new ArrayList<TrPostSourceFromReader>(); + for (String id : listeIdSrc) { - } + final TrPostSource srcChoisie = projet.findSourceById(id); + if (srcChoisie == null) { + impl.error(TrResource.getS(TrResource.getS("Le fichier r\xE9sultat d'id " + id + + " est introuvable.\n Suite de calcul interrompue"))); + return null; + } + if (!isCompatibleSuiteCalcul(srcChoisie)) { + impl.error(TrResource.getS("Le fichier d'id " + id + " n'est pas valide pour la suite de calcul.")); + return null; + } + listeReader.add((TrPostSourceFromReader) srcChoisie); + } + // -- on demarre la suite de calcul --// + Iterator<TrPostSourceFromReader> it = listeReader.iterator(); + TrPostSourceFromReader suiteProgressive = it.next(); - //-- trigger signal modif --// - suiteProgressive.setId(idSrc); - projet.ajouterSource(suiteProgressive); - return suiteProgressive; - } + List<String> error = new ArrayList<String>(); + while (it.hasNext()) { + // -- on calcule la suite progressive que l'on stocke dans la suite progressive --// + TrPostSourceFromReader suite = (TrPostSourceFromReader) TrPostBuilderSuiteCalcul.createSuiteCalcul( + suiteProgressive, impl, it.next(), error); + if (suite == null) { + String maxiStringLeo = ""; + for (String err : error) + maxiStringLeo += err + "\n"; + if (suiteProgressive != null) { + maxiStringLeo += "La suite de calcul s'arrete donc avec les fichiers " + suiteProgressive.getTitle(); + suiteProgressive.setId(idSrc); + projet.ajouterSource(suiteProgressive); + } + impl.error(maxiStringLeo); + return suiteProgressive; + } else suiteProgressive = suite; - /** - * Methode appelee pour v\xE9rifier que ceci est bien compatible avec la suite de calcul. - * - * @param src - * @return - */ - public static boolean isCompatibleSuiteCalcul(TrPostSource src) { + } - if (src != null && src instanceof TrPostSourceFromReader) return true; - return false; - } + // -- trigger signal modif --// + suiteProgressive.setId(idSrc); + projet.ajouterSource(suiteProgressive); + return suiteProgressive; + } - public static class ComparateurTrPostSourceReaderInterface implements Comparator<TrPostSourceReaderInterface> { + /** + * Methode appelee pour v\xE9rifier que ceci est bien compatible avec la suite de calcul. + * + * @param src + * @return + */ + public static boolean isCompatibleSuiteCalcul(TrPostSource src) { - public int compare(TrPostSourceReaderInterface o1, TrPostSourceReaderInterface o2) { + if (src != null && src instanceof TrPostSourceFromReader) return true; + return false; + } - // -- on compare selon la valeur des timesteps -- - if (o1.getTimeStep(0) > o2.getTimeStep(0)) return 1; + public static class ComparateurTrPostSourceReaderInterface implements Comparator<TrPostSourceReaderInterface> { - if (o1.getTimeStep(0) < o2.getTimeStep(0)) return -1; + public int compare(TrPostSourceReaderInterface o1, TrPostSourceReaderInterface o2) { - return 0; - } + // -- on compare selon la valeur des timesteps -- + if (o1.getTimeStep(0) > o2.getTimeStep(0)) return 1; - } + if (o1.getTimeStep(0) < o2.getTimeStep(0)) return -1; + return 0; + } + + } + } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceReaderComposite.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceReaderComposite.java 2009-01-27 18:04:48 UTC (rev 4414) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostSourceReaderComposite.java 2009-01-27 20:57:12 UTC (rev 4415) @@ -54,7 +54,6 @@ listeSourceInterface_ = listeSourceInterface; mapTimeStep_ = mapTimeStep; - } public List<TrPostSourceReaderInterface> getListeSourceInterface() { @@ -85,7 +84,6 @@ return data.data_.getInitData(_varIdx, data.timeStep_, _ptIdx); } - /** * Remplissage des informations avec l'ensemble des fichiers qui composent la suite de calcul. * @@ -110,32 +108,28 @@ } - - + public String getTitle() { -public String getTitle() { - - String title=TrResource.getS("Suite de calcul"); - title+=":"; - for(File f:file_) - title+=" "+f.getName(); - - - return title; -} + String title = TrResource.getS("Suite de calcul"); + title += ":"; + for (File f : file_) + title += " " + f.getName(); -/** - * Cas particulier: il gere lui meme ses propres ids. - */ -String id_; -public void SetId(String id) { - id_=id; -} + return title; + } -@Override -public String getId() { - // TODO Auto-generated method stub - return id_; -} + /** + * Cas particulier: il gere lui meme ses propres ids. + */ + String id_; + public void SetId(String id) { + id_ = id; + } + + public String getId() { + // TODO Auto-generated method stub + return id_; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |