|
From: <de...@us...> - 2003-12-11 12:41:32
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io In directory sc8-pr-cvs1:/tmp/cvs-serv23146/telemac/io Modified Files: SerafinFileFormat.java TelemacCLFileFormat.java TelemacCLReader.java TelemacDicoFileFormatVersion.java TelemacLiquideFileFormat.java TelemacLiquideReader.java TelemacLiquideWriter.java Log Message: Ajout de fonctionnalites au modele h2d Index: SerafinFileFormat.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SerafinFileFormat.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SerafinFileFormat.java 25 Nov 2003 10:11:57 -0000 1.10 --- SerafinFileFormat.java 11 Dec 2003 12:41:28 -0000 1.11 *************** *** 9,12 **** --- 9,14 ---- package org.fudaa.dodico.telemac.io; import java.io.File; + import java.util.Arrays; + import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.fichiers.FileFormat; *************** *** 34,37 **** --- 36,40 ---- super(NB_FILE); extensions_= new String[] { "ser", "res" }; + Arrays.sort(extensions_); ID_= "SERAFIN"; nom_= "Serafin"; *************** *** 43,46 **** --- 46,57 ---- type_= H2dFileFormatType.MAILLAGE.getId(); } + + public boolean containsGrid() { + return true; + } + + public FileFormatVersion getLastVersionInstance() { + return getLastVersionImpl(); + } public class SerafinVersion extends FileFormatVersion *************** *** 130,133 **** --- 141,167 ---- return write(_f, inter, _prog); } + /** + * + */ + public FileOperationSynthese readGrid( + File _f, + ProgressionInterface _prog) { + FileOperationSynthese f= read(_f, _prog); + if (f == null) + return f; + SerafinInterface in= (SerafinInterface)f.getSource(); + if (in == null) + return f; + f.setSource(in.getMaillage()); + return f; + } + + /** + * + */ + public boolean canWriteOnlyGrid() { + return true; + } + } /** Index: TelemacCLFileFormat.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/TelemacCLFileFormat.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TelemacCLFileFormat.java 25 Nov 2003 10:11:58 -0000 1.10 --- TelemacCLFileFormat.java 11 Dec 2003 12:41:28 -0000 1.11 *************** *** 43,46 **** --- 43,50 ---- type_= H2dFileFormatType.CL.getId(); } + + public FileFormatVersion getLastVersionInstance(){ + return getLastVersionImpl(); + } public class TelemacCLVersion extends FileFormatVersion { private final int libre_= 4; Index: TelemacCLReader.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/TelemacCLReader.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TelemacCLReader.java 25 Nov 2003 10:11:58 -0000 1.14 --- TelemacCLReader.java 11 Dec 2003 12:41:28 -0000 1.15 *************** *** 153,157 **** } catch (EOFException _oef) { if (DodicoLib.DEBUG) ! System.out.println("read end"); } catch (NumberFormatException _ex) { DodicoAnalyze.manageException(_ex, analyze_, in_); --- 153,157 ---- } catch (EOFException _oef) { if (DodicoLib.DEBUG) ! DodicoLib.debug("Telemac boundary file read end"); } catch (NumberFormatException _ex) { DodicoAnalyze.manageException(_ex, analyze_, in_); Index: TelemacDicoFileFormatVersion.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/TelemacDicoFileFormatVersion.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TelemacDicoFileFormatVersion.java 25 Nov 2003 10:11:58 -0000 1.6 --- TelemacDicoFileFormatVersion.java 11 Dec 2003 12:41:29 -0000 1.7 *************** *** 19,22 **** --- 19,23 ---- import org.fudaa.dodico.h2d.type.H2dFileFormatType; import org.fudaa.dodico.telemac.TelemacDicoManager; + import sun.security.action.GetBooleanAction; /** * @author deniger *************** *** 59,62 **** --- 60,69 ---- return gridEntite_; } + public DicoEntite getCLLiquideEntiteFile() { + return getEntiteFor( + new String[] { + "FICHIER DES FRONTIERES LIQUIDES", + "LIQUID BOUNDARIES FILE" }); + } public DicoEntite getCLEntiteFile() { if (clEntite_ == null) *************** *** 113,117 **** if (ent == null) return null; - DicoEntite test; //entite du fichier cas if (ent.equals(getMaillageEntiteFile())) --- 120,123 ---- *************** *** 120,123 **** --- 126,132 ---- else if (ent.equals(getCLEntiteFile())) return TelemacCLFileFormat.getInstance(); + else if (ent.equals(getCLLiquideEntiteFile())) { + return TelemacLiquideFileFormat.getInstance(); + } return null; } *************** *** 168,173 **** * */ ! public boolean isVelocitiesFixedByVelocityProfils(String _v) { ! return DodicoLib.UN.equals(_v); } } --- 177,194 ---- * */ ! public boolean isFlowrateComputeFromVelocities(String _v) { ! return DodicoLib.DEUX.equals(_v); ! } ! /** ! * ! */ ! public boolean isFlowrateComputeFromElevation(String _v) { ! return DodicoLib.QUATRE.equals(_v); ! } ! /** ! * ! */ ! public boolean isFlowrateComputeFromVelocityU(String _v) { ! return DodicoLib.TROIS.equals(_v); } } Index: TelemacLiquideFileFormat.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/TelemacLiquideFileFormat.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TelemacLiquideFileFormat.java 25 Nov 2003 10:11:59 -0000 1.7 --- TelemacLiquideFileFormat.java 11 Dec 2003 12:41:29 -0000 1.8 *************** *** 41,44 **** --- 41,48 ---- type_= H2dFileFormatType.CL_LIQUIDE.getId(); } + + public FileFormatVersion getLastVersionInstance(){ + return getLastVersionImpl(); + } public class TelemacLiquideVersion extends FileFormatVersion { TelemacLiquideVersion(String _b) { *************** *** 69,73 **** * */ ! public FileOperationSynthese writeMaillage( File _f, TelemacLiquideInterface _source, --- 73,77 ---- * */ ! public FileOperationSynthese writeClLiquid( File _f, TelemacLiquideInterface _source, Index: TelemacLiquideReader.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/TelemacLiquideReader.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TelemacLiquideReader.java 25 Nov 2003 10:11:59 -0000 1.9 --- TelemacLiquideReader.java 11 Dec 2003 12:41:29 -0000 1.10 *************** *** 63,66 **** --- 63,67 ---- for (int i= 0; i < nbValue; i++) { stemp= in_.stringField(i + 1); + int indexPar= stemp.indexOf('('); int indexParFermante= stemp.indexOf(')'); *************** *** 77,81 **** Integer.parseInt( stemp.substring(indexPar + 1, indexParFermante)); ! evols[i]= new H2dEvolutionFrontiereLiquideMutable(var, itemp); } } --- 78,83 ---- Integer.parseInt( stemp.substring(indexPar + 1, indexParFermante)); ! evols[i]= new H2dEvolutionFrontiereLiquideMutable(var, itemp-1); ! evols[i].setNom(stemp); } } *************** *** 139,143 **** } catch (EOFException _e) { if (DodicoLib.DEBUG) ! System.out.println("end of file"); } catch (NumberFormatException _e) { DodicoAnalyze.manageException(_e, analyze_); --- 141,145 ---- } catch (EOFException _e) { if (DodicoLib.DEBUG) ! DodicoLib.debug("end of file for telemac liquid file"); } catch (NumberFormatException _e) { DodicoAnalyze.manageException(_e, analyze_); Index: TelemacLiquideWriter.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/TelemacLiquideWriter.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TelemacLiquideWriter.java 25 Nov 2003 10:11:59 -0000 1.7 --- TelemacLiquideWriter.java 11 Dec 2003 12:41:29 -0000 1.8 *************** *** 9,12 **** --- 9,13 ---- package org.fudaa.dodico.telemac.io; import java.io.IOException; + import java.text.DateFormat; import java.util.Calendar; import org.fudaa.dodico.commun.DodicoAnalyze; *************** *** 82,86 **** + H2dResource.getS("Généré le") + DodicoLib.ESPACE ! + Calendar.getInstance().toString() + lineSep_); write(b); --- 83,87 ---- + H2dResource.getS("Généré le") + DodicoLib.ESPACE ! + DateFormat.getDateInstance().format(Calendar.getInstance().getTime()) + lineSep_); write(b); |