You can subscribe to this list here.
2003 |
Jan
|
Feb
(89) |
Mar
(219) |
Apr
(82) |
May
(33) |
Jun
(11) |
Jul
(129) |
Aug
(357) |
Sep
(34) |
Oct
(37) |
Nov
(42) |
Dec
(182) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(74) |
Mar
(196) |
Apr
(205) |
May
(109) |
Jun
(268) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Frederic D. <de...@us...> - 2004-03-16 16:56:52
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/probabilite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12810/src/org/fudaa/dodico/probabilite Modified Files: DGenerateurLoiErlang.java Log Message: Maj pour les conditions initiales Index: DGenerateurLoiErlang.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/probabilite/DGenerateurLoiErlang.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DGenerateurLoiErlang.java 25 Nov 2003 10:11:48 -0000 1.4 --- DGenerateurLoiErlang.java 16 Mar 2004 16:47:30 -0000 1.5 *************** *** 9,16 **** package org.fudaa.dodico.probabilite; //java ! import java.lang.Math; ! //dodico ! import org.fudaa.dodico.corba.probabilite.*; ! import org.fudaa.dodico.objet.*; /** * Generation aleatoire de donnees positivesuivant une loi d erlang. La valeur --- 9,14 ---- package org.fudaa.dodico.probabilite; //java ! import org.fudaa.dodico.corba.probabilite.IGenerateurLoiErlangOperations; ! import org.fudaa.dodico.corba.probabilite.SParametresGenerateurLoiErlang; /** * Generation aleatoire de donnees positivesuivant une loi d erlang. La valeur |
From: Frederic D. <de...@us...> - 2004-03-16 16:56:51
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fortran In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12810/src/org/fudaa/dodico/fortran Modified Files: FortranBinaryInputStream.java Log Message: Maj pour les conditions initiales Index: FortranBinaryInputStream.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fortran/FortranBinaryInputStream.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FortranBinaryInputStream.java 25 Nov 2003 10:11:34 -0000 1.8 --- FortranBinaryInputStream.java 16 Mar 2004 16:47:30 -0000 1.9 *************** *** 264,271 **** } /** ! * Renvoie la position courante dans le flux. */ public int getCurrentPosition() { return (int)currentPos_; } } --- 264,285 ---- } /** ! * @return Renvoie la position courante dans le flux. */ public int getCurrentPosition() { return (int)currentPos_; } + + /** + * @return la position de la prochaine sequence + */ + public long getNextPos(){ + return nextPos_; + } + + /** + * @return l'indice du dernier champ de l'enregistrement en cours de lecture + */ + public long getEndOfRecord(){ + return sequential_?nextPos_-8:nextPos_; + } } |
From: Frederic D. <de...@us...> - 2004-03-16 16:56:50
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12810/src/org/fudaa/dodico/test/reflux Modified Files: TestJSolution.java TestJINP.java Added Files: canal_t.siv canal_t.inp Log Message: Maj pour les conditions initiales --- NEW FILE: canal_t.inp --- ==================================================================== G.H.N. === Description : Fichier d'entree de REFLUX Cree par : PREFLUX 5.0 =============================================================================== IMPRESSION: ITERATION BLOC: DATA VIT_NU_CON COOR VIT_NU_CON 3 1791 0.0 0.0 15.0 0.0 1.25 15.0 0.0 2.5 15.0 0.0 3.75 15.0 0.0 5.0 15.0 0.0 6.25 15.0 0.0 7.5 15.0 0.0 8.75 15.0 [...3519 lines suppressed...] IMPRESSION: ITERATION BLOC: FLUT VIT_NU_CON 16 VIT_NU_CON EULER 3600.0 0.5 NEWTON 1.0 0.0010 0.0050 5 COEFFICIENTS 1.0 1.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0 IMPRESSION 1 STOP Index: TestJINP.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestJINP.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestJINP.java 5 Mar 2004 15:18:39 -0000 1.1 --- TestJINP.java 16 Mar 2004 16:47:29 -0000 1.2 *************** *** 196,200 **** H2dRefluxParameters param = H2dRefluxParameters.init( ! inter, new ProgressionTestAdapter(), INPFileFormat.getInstance().getLastINPVersionImpl(), --- 196,200 ---- H2dRefluxParameters param = H2dRefluxParameters.init( ! inter, null, new ProgressionTestAdapter(), INPFileFormat.getInstance().getLastINPVersionImpl(), Index: TestJSolution.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestJSolution.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestJSolution.java 15 Mar 2004 08:28:00 -0000 1.1 --- TestJSolution.java 16 Mar 2004 16:47:29 -0000 1.2 *************** *** 9,15 **** --- 9,27 ---- package org.fudaa.dodico.test.reflux; + import java.io.File; + import java.util.Arrays; + import com.memoire.bu.BuInformationsDocument; + import com.memoire.fu.FuLib; + import com.memoire.xml.XmlReader; + import org.fudaa.dodico.ef.EfGrid; + import org.fudaa.dodico.ef.EfGridSource; import org.fudaa.dodico.fichiers.FileOperationSynthese; + import org.fudaa.dodico.h2d.reflux.H2dRefluxSICourant2D; + import org.fudaa.dodico.h2d.type.H2dVariableType; + import org.fudaa.dodico.reflux.io.INPFileFormat; import org.fudaa.dodico.reflux.io.RefluxSolutionAdapter; import org.fudaa.dodico.reflux.io.RefluxSolutionFileFormat; + import org.fudaa.dodico.reflux.io.RefluxSolutionInitFileFormat; + import org.fudaa.dodico.reflux.io.RefluxSolutionReader; import org.fudaa.dodico.test.TestIO; *************** *** 22,25 **** --- 34,40 ---- public class TestJSolution extends TestIO { + /** + * Ouverture "canal_t.sov" + */ public TestJSolution() { super("canal_t.sov"); *************** *** 30,43 **** */ public void testLecture() { ! FileOperationSynthese op=RefluxSolutionFileFormat.getInstance().getLastVersionInstance().read(super.fic_,null); ! if(op.containsFatalError()) op.getAnalyze().printResume(); assertFalse(op.containsFatalError()); ! RefluxSolutionAdapter ad=(RefluxSolutionAdapter)op.getSource(); ! RefluxSolutionAdapter.SIByTime f=ad.getTimes()[0]; ! assertEquals(1791,f.getNbPt()); ! assertEquals(9,f.getNbValues()); ! assertEquals(0.14818E+02,f.getValues(2,110),eps_); } /** * @see org.fudaa.dodico.test.TestIO#testEcriture() --- 45,157 ---- */ public void testLecture() { ! FileOperationSynthese op = RefluxSolutionFileFormat.getInstance().getLastVersionInstance() ! .read(super.fic_, null); ! if (op.containsFatalError()) op.getAnalyze().printResume(); assertFalse(op.containsFatalError()); ! RefluxSolutionAdapter ad = (RefluxSolutionAdapter) op.getSource(); ! assertNotNull(ad); ! assertNotNull(ad.getTimes()); ! assertEquals(16, ad.getTimes().length); ! RefluxSolutionAdapter.SIByTime f = ad.getTimes()[0]; ! assertEquals(1791, f.getNbPt()); ! assertEquals(9, f.getNbValues()); ! assertEquals(0.14818E+02, f.getValues(2, 110), eps_); ! f = ad.getTimes()[13]; ! assertEquals(1791, f.getNbPt()); ! assertEquals(9, f.getNbValues()); ! int idxPt = 185; ! assertEquals(0.10101E+03, f.getValues(0, idxPt), eps_); ! assertEquals(0.62500E+01, f.getValues(1, idxPt), eps_); ! assertEquals(0.14697E+02, f.getValues(2, idxPt), eps_); ! assertEquals(0.28820E+01, f.getValues(3, idxPt), eps_); ! assertEquals(-0.36504E-04, f.getValues(4, idxPt), eps_); ! assertEquals(0, f.getValues(5, idxPt), eps_); ! assertEquals(0.16024E+02, f.getValues(6, idxPt), eps_); ! assertEquals(0.13266E+01, f.getValues(7, idxPt), eps_); ! assertEquals(0, f.getValues(8, idxPt), eps_); ! assertEquals(0.50400E+05, f.getT(), eps_); ! RefluxSolutionReader reader = new RefluxSolutionReader( ! (RefluxSolutionFileFormat.RefluxSolutionVersion) RefluxSolutionFileFormat.getInstance() ! .getLastVersionInstance()); ! reader.setFile(super.fic_); ! reader.setReadOnlyLastStep(true); ! op = reader.read(); ! assertFalse(op.containsFatalError()); ! ad = (RefluxSolutionAdapter) op.getSource(); ! assertNotNull(ad); ! assertNotNull(ad.getTimes()); ! assertEquals(1, ad.getTimes().length); ! f = ad.getTimes()[0]; ! assertEquals(0.57600E+05, ad.getTimes()[0].getT(), eps_); ! idxPt = 0; ! assertEquals(0, f.getValues(0, idxPt), eps_); ! assertEquals(0, f.getValues(1, idxPt), eps_); ! assertEquals(0.15000E+02, f.getValues(2, idxPt), eps_); ! assertEquals(0.28601E+01, f.getValues(3, idxPt), eps_); ! assertEquals(-0.35025E-15, f.getValues(4, idxPt), eps_); ! assertEquals(0, f.getValues(5, idxPt), eps_); ! assertEquals(0.16325E+02, f.getValues(6, idxPt), eps_); ! assertEquals(0.13250E+01, f.getValues(7, idxPt), eps_); ! assertEquals(0, f.getValues(8, idxPt), eps_); ! H2dRefluxSICourant2D si = RefluxSolutionFileFormat.toSiCourant2D(ad); ! assertEquals(1791, si.getNbPoint()); ! assertEquals(0.28601E+01, si.getSIForU(0), eps_); ! assertEquals(-0.35025E-15, si.getSIForV(0), eps_); ! assertEquals(0.13250E+01, si.getSIForH(0), eps_); ! assertEquals(0.28601E+01, si.getSolutionInitiale(H2dVariableType.VITESSE_U, 0), eps_); ! assertEquals(-0.35025E-15, si.getSolutionInitiale(H2dVariableType.VITESSE_V, 0), eps_); ! assertEquals(0.13250E+01, si.getSolutionInitiale(H2dVariableType.COTE_EAU, 0), eps_); ! assertEquals(0.28821E+01, si.getSolutionInitiale(H2dVariableType.VITESSE_U, 1766), eps_); ! assertEquals(0.24951E-06, si.getSolutionInitiale(H2dVariableType.VITESSE_V, 1766), eps_); ! assertEquals(0.13710E+01, si.getSolutionInitiale(H2dVariableType.COTE_EAU, 1766), eps_); ! } ! ! ! /** ! * Test ecriture/lecture fichier siv ! */ ! public void testSI() { ! double[] testA = new double[100]; ! for (int i = testA.length - 1; i >= 0; i--) { ! testA[i] = Math.random() * 100d; ! } ! File t = createTempFile(); ! FileOperationSynthese op = RefluxSolutionInitFileFormat.getInstance().getLastVersionInstance() ! .write(t, testA, null); ! assertFalse(op.containsFatalError()); ! op = RefluxSolutionInitFileFormat.getInstance().getLastVersionInstance().read(t, null); ! assertFalse(op.containsFatalError()); ! double[] lu = (double[]) op.getSource(); ! assertNotNull(lu); ! assertEquals(testA.length, lu.length); ! assertTrue(Arrays.equals(testA, lu)); ! File inpT = getFile("canal_t.inp"); ! File sivT = getFile("canal_t.siv"); ! assertTrue(inpT.exists()); ! assertTrue(sivT.exists()); ! EfGrid g = ((EfGridSource) INPFileFormat.getInstance().getLastINPVersionImpl().readGrid(inpT, ! null) ! .getSource()).getGrid(); ! assertNotNull(g); ! lu = (double[]) RefluxSolutionInitFileFormat.getInstance().getLastVersionInstance().read(sivT, ! null).getSource(); ! H2dRefluxSICourant2D si2D = (H2dRefluxSICourant2D) H2dRefluxSICourant2D.loadSI(g, sivT, null) ! .getSource(); ! assertNotNull(si2D); ! File temp = createTempFile(); ! op = si2D.writeSI(g, temp, null); ! assertFalse(op.containsFatalError()); ! assertTrue(Arrays.equals(lu, (double[]) op.getSource())); ! H2dRefluxSICourant2D si2Dbis = (H2dRefluxSICourant2D) H2dRefluxSICourant2D ! .loadSI(g, temp, null) ! .getSource(); ! assertTrue(si2Dbis.isEquiv(si2D)); ! temp.delete(); } + + + + /** * @see org.fudaa.dodico.test.TestIO#testEcriture() --- NEW FILE: canal_t.siv --- (This appears to be a binary file; contents omitted.) |
From: Frederic D. <de...@us...> - 2004-03-16 16:56:49
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12810/src/org/fudaa/dodico/h2d/reflux Modified Files: H2dRefluxSICourant2D.java H2dRefluxParameters.java H2dRefluxProjectDispatcherListener.java Log Message: Maj pour les conditions initiales Index: H2dRefluxSICourant2D.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux/H2dRefluxSICourant2D.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** H2dRefluxSICourant2D.java 15 Mar 2004 08:27:58 -0000 1.1 --- H2dRefluxSICourant2D.java 16 Mar 2004 16:47:29 -0000 1.2 *************** *** 9,13 **** --- 9,22 ---- package org.fudaa.dodico.h2d.reflux; + import java.io.File; + import java.util.Arrays; + + import org.fudaa.dodico.commun.ProgressionInterface; + import org.fudaa.dodico.commun.ProgressionUpdater; + import org.fudaa.dodico.ef.EfElement; + import org.fudaa.dodico.ef.EfGrid; + import org.fudaa.dodico.fichiers.FileOperationSynthese; import org.fudaa.dodico.h2d.type.H2dVariableType; + import org.fudaa.dodico.reflux.io.RefluxSolutionInitFileFormat; *************** *** 15,22 **** * @author Fred Deniger * @version $id$ - * */ public class H2dRefluxSICourant2D implements H2dRefluxSolutionInitialeInterface { ! double[] u_; double[] v_; --- 24,30 ---- * @author Fred Deniger * @version $id$ */ public class H2dRefluxSICourant2D implements H2dRefluxSolutionInitialeInterface { ! double[] u_; double[] v_; *************** *** 24,31 **** /** * */ ! public H2dRefluxSICourant2D() { ! super(); } --- 32,51 ---- /** + * les 3 tableaux doivent avoir la meme taille ( nombre de points). * + * @param _u valeurs pour u + * @param _v valeurs pour v + * @param _h valeurs pour h */ ! public H2dRefluxSICourant2D(double[] _u, double[] _v, double[] _h) { ! u_ = _u; ! v_ = _v; ! h_ = _h; ! if (_u.length != _v.length) { ! throw new IllegalArgumentException("u and v with different size"); ! } ! if (_u.length != _h.length) { ! throw new IllegalArgumentException("u and h with different size"); ! } } *************** *** 34,38 **** */ public int getNbPoint() { ! return 0; } --- 54,58 ---- */ public int getNbPoint() { ! return u_.length; } *************** *** 41,85 **** */ public boolean isValideVariable(H2dVariableType _t) { ! return (_t==H2dVariableType.VITESSE_U) || (_t==H2dVariableType.VITESSE_V) || (_t==H2dVariableType.COTE_EAU); } /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#getSolutionInitiale(org.fudaa.dodico.h2d.type.H2dVariableType, int) */ public double getSolutionInitiale(H2dVariableType _t, int _idx) { ! if(_t==H2dVariableType.VITESSE_U) return u_[_idx]; ! else if(_t==H2dVariableType.VITESSE_V){ return v_[_idx]; } ! else if(_t==H2dVariableType.COTE_EAU){ ! return h_[_idx]; } new Throwable().printStackTrace(); return 0d; } ! /** * @param _idx index du point * @return solution initiale pour u */ ! public double getSIForU(int _idx){ return u_[_idx]; } ! /** * @param _idx * @return solution initiale pour v */ ! public double getSIForV(int _idx){ return v_[_idx]; } ! /** * @param _idx * @return solution initiale pour h */ ! public double getSIForH(int _idx){ return h_[_idx]; } } --- 61,212 ---- */ public boolean isValideVariable(H2dVariableType _t) { ! return (_t == H2dVariableType.VITESSE_U) || (_t == H2dVariableType.VITESSE_V) ! || (_t == H2dVariableType.COTE_EAU); } /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#getSolutionInitiale(org.fudaa.dodico.h2d.type.H2dVariableType, ! * int) */ public double getSolutionInitiale(H2dVariableType _t, int _idx) { ! if (_t == H2dVariableType.VITESSE_U) return u_[_idx]; ! else if (_t == H2dVariableType.VITESSE_V) { return v_[_idx]; } ! else if (_t == H2dVariableType.COTE_EAU) { ! return h_[_idx]; } new Throwable().printStackTrace(); return 0d; } ! /** * @param _idx index du point * @return solution initiale pour u */ ! public double getSIForU(int _idx) { return u_[_idx]; } ! /** * @param _idx * @return solution initiale pour v */ ! public double getSIForV(int _idx) { return v_[_idx]; } ! /** * @param _idx * @return solution initiale pour h */ ! public double getSIForH(int _idx) { return h_[_idx]; } + + public boolean isEquiv(H2dRefluxSICourant2D _d){ + return Arrays.equals(u_,_d.u_) && Arrays.equals(v_,_d.v_) && Arrays.equals(h_,_d.h_); + } + + /** + * @param _g le maillage associé + * @param _f le fichier siv a lire + * @param _prog la barre de progression + * @return la synthese contenant une instance de H2dRefluxSICourant2D + */ + public static FileOperationSynthese loadSI(EfGrid _g, File _f, ProgressionInterface _prog) { + FileOperationSynthese init = RefluxSolutionInitFileFormat.getInstance() + .getLastVersionInstance().read(_f, _prog); + if (init.containsFatalError()) { + init.setSource(null); + return init; + } + double[] vals = (double[]) init.getSource(); + double[][] si = new double[3][_g.getPtsNb()]; + int idxDone = 0; + int nbPt = _g.getPtsNb(); + boolean[] done = new boolean[nbPt]; + boolean[] isMiddle = new boolean[nbPt]; + int temp; + boolean isIdxMiddle; + for (int i = _g.getEltNb() - 1; (i >= 0) && (idxDone < nbPt); i--) { + EfElement elt = _g.getElement(i); + isIdxMiddle = true; + for (int j = elt.getPtNb() - 1; j >= 0; j--) { + temp = elt.getPtIndex(j); + if (!done[temp]) { + idxDone++; + done[temp] = true; + isMiddle[temp] = isIdxMiddle; + } + isIdxMiddle = !isIdxMiddle; + } + } + if (_prog != null) _prog.setProgression(30); + int idxInVal = 0; + idxDone = 0; + temp = vals.length; + ProgressionUpdater up = new ProgressionUpdater(_prog); + up.setValue(3, nbPt, 30, 70); + up.majProgessionStateOnly(); + while (idxInVal < temp) { + si[0][idxDone] = vals[idxInVal++]; + si[1][idxDone] = vals[idxInVal++]; + if (!isMiddle[idxDone]) { + si[2][idxDone] = vals[idxInVal++]; + } + up.majAvancement(); + idxDone++; + } + init.setSource(new H2dRefluxSICourant2D(si[0], si[1], si[2])); + return init; + } + + /** + * @param _g le maillage associe + * @param _f le fichier de dest + * @param _prog la progression + * @return la synthese de l'ecriture contenant le tableau de double generee comme source + */ + public FileOperationSynthese writeSI(EfGrid _g, File _f, ProgressionInterface _prog) { + int idxDone = 0; + int nbPt = _g.getPtsNb(); + double[] vals = new double[nbPt * 3]; + boolean[] done = new boolean[nbPt]; + boolean[] isMiddle = new boolean[nbPt]; + int temp; + boolean isIdxMiddle; + for (int i = _g.getEltNb() - 1; (i >= 0) && (idxDone < nbPt); i--) { + EfElement elt = _g.getElement(i); + isIdxMiddle = true; + for (int j = elt.getPtNb() - 1; j >= 0; j--) { + temp = elt.getPtIndex(j); + if (!done[temp]) { + idxDone++; + done[temp] = true; + isMiddle[temp] = isIdxMiddle; + } + isIdxMiddle = !isIdxMiddle; + } + } + if (_prog != null) _prog.setProgression(30); + int idxInVal = 0; + idxDone = 0; + temp = vals.length; + ProgressionUpdater up = new ProgressionUpdater(_prog); + up.setValue(3, nbPt, 30, 70); + up.majProgessionStateOnly(); + for (int i = 0; i < nbPt; i++) { + vals[idxInVal++] = u_[i]; + vals[idxInVal++] = v_[i]; + if (!isMiddle[i]) { + vals[idxInVal++] = h_[i]; + } + } + double[] fvals = new double[idxInVal]; + System.arraycopy(vals, 0, fvals, 0, fvals.length); + return RefluxSolutionInitFileFormat.getInstance().getLastVersionInstance().write(_f, fvals, + _prog); + } } Index: H2dRefluxProjectDispatcherListener.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux/H2dRefluxProjectDispatcherListener.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** H2dRefluxProjectDispatcherListener.java 11 Dec 2003 12:41:27 -0000 1.4 --- H2dRefluxProjectDispatcherListener.java 16 Mar 2004 16:47:29 -0000 1.5 *************** *** 15,20 **** --- 15,33 ---- public interface H2dRefluxProjectDispatcherListener extends H2dProjectDispatcherListener, H2dRefluxBcListener,H2dRefluxElementPropertyMngListener { + /** + * Appele lorsque l'état du projet change :sauvegarde/modification. + */ public void refluxProjectModifiedStateChange(); + /** + * Appele lorsque les pas de temps sont modifies + */ public void timeStepChanged(); + /** + * Appele lorsque le type du projet est modifie + */ public void projectTypeChanged(); + /** + * Appele lorsque les solutions initiales changent + */ + public void InitSolutionsChanged(); } Index: H2dRefluxParameters.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux/H2dRefluxParameters.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** H2dRefluxParameters.java 12 Feb 2004 15:32:45 -0000 1.5 --- H2dRefluxParameters.java 16 Mar 2004 16:47:29 -0000 1.6 *************** *** 8,14 **** */ package org.fudaa.dodico.h2d.reflux; - import gnu.trove.TDoubleArrayList; - - import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; --- 8,11 ---- *************** *** 63,66 **** --- 60,64 ---- H2dRefluxElementPropertyMngAbstract propElem_; private H2dProjetType projetType_; + private H2dRefluxSolutionInitialeInterface solutionInitiales_; public static H2dEvolution MIXTE= new H2dEvolution(H2dResource.getS("Mixte")); *************** *** 93,96 **** --- 91,97 ---- return null; } + /** + * @param _l le nouveau listener + */ public void setListener(H2dRefluxProjectDispatcherListener _l) { if (_l == null) *************** *** 222,226 **** H2dProjetType _type, ProgressionInterface _prog, ! INPFileFormat.INPVersion _ft, DodicoAnalyze _analyze) { DicoParams params= new DicoParams(null, _ft); --- 223,227 ---- H2dProjetType _type, ProgressionInterface _prog, ! DicoCasFileFormatVersionAbstract _ft, DodicoAnalyze _analyze) { DicoParams params= new DicoParams(null, _ft); *************** *** 238,245 **** return r; } public static H2dRefluxParameters init( H2dRefluxSourceInterface _inter, ProgressionInterface _prog, ! INPFileFormat.INPVersion _ft, DodicoAnalyze _analyze) { if (_prog != null) { --- 239,255 ---- return r; } + /** + * @param _inter + * @param _prog + * @param _ft + * @param _analyze + * @param _inpF + * @return + */ public static H2dRefluxParameters init( H2dRefluxSourceInterface _inter, + H2dRefluxSolutionInitialeInterface _si, ProgressionInterface _prog, ! DicoCasFileFormatVersionAbstract _ft, DodicoAnalyze _analyze) { if (_prog != null) { *************** *** 275,279 **** r.gptTemps_= _inter.getGroupePasTemps(); if (_prog != null) { ! _prog.setProgression(100); } HashSet s= r.getUsedEvol(); --- 285,289 ---- r.gptTemps_= _inter.getGroupePasTemps(); if (_prog != null) { ! _prog.setProgression(80); } HashSet s= r.getUsedEvol(); *************** *** 305,309 **** } r.guessBeginTimeForTrans(); ! return r; } --- 315,320 ---- } r.guessBeginTimeForTrans(); ! //solution initiales ! r.setSolutionInitiales(_si); return r; } *************** *** 350,355 **** return projetType_; } /** ! * */ public void setProjetType(H2dProjetType _type) { --- 361,367 ---- return projetType_; } + /** ! * @param _type le nouveau type du projet */ public void setProjetType(H2dProjetType _type) { *************** *** 364,367 **** --- 376,382 ---- } + /** + * @return une map des evolutions utilisees + */ public HashSet getUsedEvol() { HashSet evol= new HashSet(); *************** *** 371,375 **** } /** ! * */ public H2dEvolutionManager getEvolMng() { --- 386,390 ---- } /** ! * @see org.fudaa.dodico.h2d.H2dParameters#getEvolMng() */ public H2dEvolutionManager getEvolMng() { *************** *** 381,383 **** --- 396,429 ---- } + /** + * @return Returns the solutionInitiales. + */ + public H2dRefluxSolutionInitialeInterface getSolutionInitiales() { + return solutionInitiales_; + } + + /** + * @param _solutionInitiales The solutionInitiales to set. + */ + public void setSolutionInitiales(H2dRefluxSolutionInitialeInterface _solutionInitiales) { + if(solutionInitiales_!=_solutionInitiales){ + listener_.InitSolutionsChanged(); + } + solutionInitiales_ = _solutionInitiales; + } + + /** + * @return true si les solutions initiales ont ete initialisee + */ + public boolean isSolutionInitialSet(){ + return solutionInitiales_!=null; + } + + /** + * @return Returns the listener. + */ + public H2dRefluxProjectDispatcherListener getListener() { + return listener_; + } + } |
From: Frederic D. <de...@us...> - 2004-03-16 16:56:49
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12810/src/org/fudaa/dodico/commun Modified Files: ProgressionUpdater.java Log Message: Maj pour les conditions initiales Index: ProgressionUpdater.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/ProgressionUpdater.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProgressionUpdater.java 12 Feb 2004 15:32:43 -0000 1.1 --- ProgressionUpdater.java 16 Mar 2004 16:47:30 -0000 1.2 *************** *** 10,28 **** /** ! * Cette classe permet de mettre a jour automatiquement la progression ! * d'une boucle en donnant le nombre d'iteration attendu et le nombre de ! * mise a jour ( ou etape) voulue.Exemple<br> * <pre> ! * int nbEle=_getNombreElementATraiter(); ! * ProgressionUpdater prog=new ProgressionUpdater(_inter); ! * prog.setValue(4, nbEle); ! * for(int i=nbEle-1;i>=0;i--){ ! * //faire plein de chose ! * ! * prog.majAvancement(); ! * } * </pre> ! * L'updater possede un compteur interne qui est mis a jour ! * a chaque appel de {@link #majAvancement()} * @author deniger * @version $Id$ --- 10,29 ---- /** ! * Cette classe permet de mettre a jour automatiquement la progression d'une boucle en donnant le ! * nombre d'iteration attendu et le nombre de mise a jour ( ou etape) voulue.Exemple <br> ! * * <pre> ! * int nbEle = _getNombreElementATraiter(); ! * ProgressionUpdater prog = new ProgressionUpdater(_inter); ! * prog.setValue(4, nbEle); ! * for (int i = nbEle - 1; i >= 0; i--) { ! * //faire plein de chose ! * prog.majAvancement(); ! * } * </pre> ! * ! * L'updater possede un compteur interne qui est mis a jour a chaque appel de ! * {@link #majAvancement()} ! * * @author deniger * @version $Id$ *************** *** 34,65 **** */ ProgressionInterface progress_; ! int pourcStep_; ! int pas_; ! int nextPas_; ! int avancementEnCours_; ! int iEnCours_; public ProgressionUpdater() {} public ProgressionUpdater(ProgressionInterface _progress) { setProgress(_progress); ! iEnCours_= 0; } public ProgressionInterface getProgress() { return progress_; } public final void setProgress(ProgressionInterface _interface) { ! progress_= _interface; } /** ! * Permet d'initialiser cet updater avec le nombre d'étapes voulues ! * et le nombre d'iteration attendue. ! * Exemple:<br> vous avez une boucle qui contient 200 iteration et vous ! * voulez mettre a jour la progression tous les 50 (soit 4 étapes). ! * Il suffit d'appeler setValue(4,200). ! * Appelle la fonction setValue(int,int,0,100) * @see #setValue(int, int, int, int) */ public void setValue(int _nbStep, int nbIterationMax) { --- 35,82 ---- */ ProgressionInterface progress_; ! int pourcStep_; ! int pas_; ! int nextPas_; ! int avancementEnCours_; ! int iEnCours_; + /** + * Constructeur vide + */ public ProgressionUpdater() {} + + /** + * @param _progress le receveur de l'avancement + */ public ProgressionUpdater(ProgressionInterface _progress) { setProgress(_progress); ! iEnCours_ = 0; } + /** + * @return le receveur + */ public ProgressionInterface getProgress() { return progress_; } + /** + * @param _interface le nouveau receveur + */ public final void setProgress(ProgressionInterface _interface) { ! progress_ = _interface; } + /** ! * Permet d'initialiser cet updater avec le nombre d'étapes voulues et le nombre d'iteration ! * attendue. Exemple: <br> ! * vous avez une boucle qui contient 200 iteration et vous voulez mettre a jour la progression ! * tous les 50 (soit 4 étapes). Il suffit d'appeler setValue(4,200). Appelle la fonction ! * setValue(int,int,0,100) ! * * @see #setValue(int, int, int, int) + * @param _nbStep le nombre total d'iteration + * @param nbIterationMax le nombre de maj voulue */ public void setValue(int _nbStep, int nbIterationMax) { *************** *** 67,97 **** } /** ! * Permet d'initialiser cet updater avec le nombre d'étapes voulues ! * et le nombre d'iteration attendue. De plus, il est possible de ! * preciser le pourcentage initial et l'étendu du pourcentage. ! * Exemple:<br> ! * vous avez une boucle qui contient 300 iteration et vous ! * voulez mettre a jour la progression tous les 100 (soit 3 étapes). ! * Par contre, vous voulez que la progression commence à 20 et ! * qu'elle se finisse a 60 ( soit une étendue de 60) ! * Il suffit d'appeler setValue(3,300,20,60). * - * Attention : si le nombre d'iteration pour chaque etape est trop - * faible (<20) le nombre d'etape sera de 2. C'est pour eviter de - * mettre a jour trop souvent l'interface * @see #getStep(int, int) */ public void setValue( ! int _nbStep, ! int nbIterationMax, ! int _pourcentOffSet, ! int _pourcentRange) { ! int step= (((int) (nbIterationMax / _nbStep)) < 20) ? 2 : _nbStep; ! pourcStep_= (int) (_pourcentRange / step); ! pas_= (int) (nbIterationMax / step); ! nextPas_= pas_; ! avancementEnCours_= _pourcentOffSet; ! iEnCours_= 0; } --- 84,115 ---- } + /** ! * Permet d'initialiser cet updater avec le nombre d'étapes voulues et le nombre d'iteration ! * attendue. De plus, il est possible de preciser le pourcentage initial et l'étendu du ! * pourcentage. Exemple: <br> ! * vous avez une boucle qui contient 300 iteration et vous voulez mettre a jour la progression ! * tous les 100 (soit 3 étapes). Par contre, vous voulez que la progression commence à 20 et ! * qu'elle se finisse a 60 ( soit une étendue de 60) Il suffit d'appeler setValue(3,300,20,60). ! * Attention : si le nombre d'iteration pour chaque etape est trop faible (<20) le nombre ! * d'etape sera de 2. C'est pour eviter de mettre a jour trop souvent l'interface * * @see #getStep(int, int) + * @param _nbStep le nombre de maj voulue + * @param nbIteration le nombre d'iteration + * @param _pourcentOffSet le depart des pourcentages + * @param _pourcentRange l'intervalle des pourcentages */ public void setValue( ! int _nbStep, ! int nbIteration, ! int _pourcentOffSet, ! int _pourcentRange) { ! int step = (((int) (nbIteration / _nbStep)) < 20) ? 2 : _nbStep; ! pourcStep_ = (int) (_pourcentRange / step); ! pas_ = (int) (nbIteration / step); ! nextPas_ = pas_; ! avancementEnCours_ = _pourcentOffSet; ! iEnCours_ = 0; } *************** *** 100,110 **** */ public void majProgessionStateOnly() { ! if (progress_ != null) ! progress_.setProgression(avancementEnCours_); } /** ! * Met a jour l'interface de progression uniquement avec la ! * description <code>_message</code> */ public void majProgessionStateOnly(String _message) { --- 118,130 ---- */ public void majProgessionStateOnly() { ! if (progress_ != null) ! progress_.setProgression(avancementEnCours_); } + /** ! * Met a jour l'interface de progression uniquement avec la description <code>_message</code> ! * ! * @param _message le message a donne au receveur de progression */ public void majProgessionStateOnly(String _message) { *************** *** 116,121 **** /** ! * Calcul si i est superieur au pas attendu, et si oui, la progression ! * est mise a jour. */ public void majAvancement() { --- 136,140 ---- /** ! * Calcul si i est superieur au pas attendu, et si oui, la progression est mise a jour. */ public void majAvancement() { *************** *** 127,143 **** } /** ! * Methode utilisée pour mettre a jour l'avancement. ! * Renvoie le nb d'etapes "acceptables" dans nbIteration. ! * Si le nombre d'iteration dans l'etape ! * est inf a 20, 2 etapes sont renvoyees. ! * Exemple :vous avez 100 iterations que vous voulez parcourir en 4 etapes ! * de 25 (sup a 20). La methode getStep(100,4) renvoie donc 4. ! * Par contre getStep(100,10) renvoie 2 :(étapes de 10 iterations inf a 25). * @deprecated used the ProgressionUpdater */ public final static int getStep(int nbIteration, int _nbStep) { return (((int) (nbIteration / _nbStep)) < 20) ? 2 : _nbStep; } - } --- 146,164 ---- } + /** ! * Methode utilisée pour mettre a jour l'avancement. Renvoie le nb d'etapes "acceptables" dans ! * nbIteration. Si le nombre d'iteration dans l'etape est inf a 20, 2 etapes sont renvoyees. ! * Exemple :vous avez 100 iterations que vous voulez parcourir en 4 etapes de 25 (sup a 20). La ! * methode getStep(100,4) renvoie donc 4. Par contre getStep(100,10) renvoie 2 :(étapes de 10 ! * iterations inf a 25). ! * * @deprecated used the ProgressionUpdater + * @param nbIteration + * @param _nbStep + * @return le nb d'etapes "acceptables" dans nbIteration. */ public final static int getStep(int nbIteration, int _nbStep) { return (((int) (nbIteration / _nbStep)) < 20) ? 2 : _nbStep; } } |
From: Frederic D. <de...@us...> - 2004-03-16 16:56:49
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12810/src/org/fudaa/dodico/telemac/io Modified Files: SerafinWriter.java SerafinReader.java Log Message: Maj pour les conditions initiales Index: SerafinWriter.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SerafinWriter.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** SerafinWriter.java 12 Feb 2004 15:32:49 -0000 1.12 --- SerafinWriter.java 16 Mar 2004 16:47:28 -0000 1.13 *************** *** 8,11 **** --- 8,12 ---- */ package org.fudaa.dodico.telemac.io; + import java.io.File; import java.io.FileNotFoundException; *************** *** 28,143 **** import org.fudaa.dodico.h2d.H2dResource; /** ! * Classe permettant d'ecrire un fichier serafin (utilise un buffer pour ! *l'ecriture). ! * ! * @version $Id$ ! * @author Fred Deniger */ public class SerafinWriter extends FileWriteOperationAbstract { ! /** */ ! OutputStream out_; ! /** */ ! private String machineID_; ! /** */ private SerafinFileFormat.SerafinVersion version_; ! private int tailleTotale_; public SerafinWriter(SerafinFileFormat.SerafinVersion _f) { ! version_= _f; ! machineID_= NativeBinaryInputStream.getLocalMachineId(); } public FileFormat getFileFormat() { return version_.getFileFormat(); } private void setOut(OutputStream _out) { ! out_= _out; } public void setMachineID(String _ID) { ! machineID_= NativeBinaryInputStream.getMachineId(_ID); } public void setMachineSPARC() { ! machineID_= NativeBinaryInputStream.SPARC; } public void setMachineX86() { ! machineID_= NativeBinaryInputStream.X86; } /** * Teste si le double n'appartient pas a la plage des float. * @param _d ! * @return true si le double n'appartient pas a la plage des float */ private boolean isDoubleToFloatError(double _d) { ! double d= _d > 0 ? _d : -_d; ! if (d > Float.MAX_VALUE) ! return true; ! if ((d > 0) && (d < Float.MIN_VALUE)) ! return true; return false; } private void setProgression(int _etat) { progress_.setProgression((100 * _etat) / tailleTotale_); } /** * Ecriture des donnees ( pas de buffer). ! * ! * @return infos et erreurs non bloquantes ( null si aucune erreur). */ public void writeSerafin(SerafinInterface _inter) { ! SerafinInterface donnees_= _inter; try { ! if (out_ == null) ! throw new IOException(H2dResource.getS("Le flux de sortie est nul")); if (donnees_ == null) { analyze_.addFatalError(H2dResource.getS("Les données sont nulles")); return; } ! FortranBinaryOutputStream out= ! new FortranBinaryOutputStream(out_, true, machineID_); ! if (machineID_ == null) ! analyze_.addWarn( ! H2dResource.getS( ! "Le format de sortie a été changé en {0}", ! out.getMachineType()), ! -1); //ArrayList infos=new ArrayList(); ! //Les tailles jusqu'a IDISC inclus ! int nbv1= donnees_.getValueNb(); ! if (nbv1 > 100) ! analyze_.addError( ! H2dResource.getS("Le nombre de variables est supérieur à 100"),0); ! if (nbv1 <= 0) ! analyze_.addFatalError( ! H2dResource.getS("Le nombre de variables est nul ou négatif")); ! EfGrid maillage= donnees_.getGrid(); if (maillage.getEltType() == null) { analyze_.addFatalError( ! H2dResource.getS("Les éléments doivent être du même type")); } ! int nelem= maillage.getEltNb(); ! int npt= maillage.getPtsNb(); ! int nppel= maillage.getElement(0).getPtNb(); ! int[] iparam= donnees_.getIparam(); ! if ((iparam == null) || (iparam.length != version_.IPARAM_NB)) ! analyze_.addError( ! H2dResource.getS("Le tableau des paramètres est invalide"),0); ! boolean isIdateDefini= version_.isIdateDefini(iparam); ! boolean isFormatColonne= version_.isFormatEnColonne(iparam); ! int nbPasTemps= donnees_.getTimeStepNb(); ! if (nbPasTemps <= 0) ! analyze_.addError( ! H2dResource.getS("Le nombre de pas de temps est négatif ou nul"),0); ! int tailleDebut= ! (8 + 80) + (8 + 8) + ((8 + 32) * nbv1) + (8 + 40) + (8 + 16); ! if (isIdateDefini) ! tailleDebut += 8 + 6 * 4; ! int tailleIkle1= 8 + 4 * nelem * nppel; ! int tailleX1= 8 + npt * 4; ! int tailleTemps= 12 + 4 * nbv1 * npt; ! if (isFormatColonne) ! tailleTemps= 12 + 4 * nbv1 * npt + 8 * nbv1; ! tailleTotale_= ! tailleDebut + tailleIkle1 + tailleX1 * 3 + nbPasTemps * tailleTemps; //TITRE //tS chaine temporaire ! String tS= DodicoLib.adjustSize(80, donnees_.getTitre()); out.writeCharacter(tS); out.writeRecord(); --- 29,166 ---- import org.fudaa.dodico.h2d.H2dResource; /** ! * Classe permettant d'ecrire un fichier serafin (utilise un buffer pour l'ecriture). ! * ! * @version $Id$ ! * @author Fred Deniger */ public class SerafinWriter extends FileWriteOperationAbstract { ! ! OutputStream out_; ! private String machineID_; private SerafinFileFormat.SerafinVersion version_; ! private int tailleTotale_; ! ! /** ! * @param _f la version utilisee ! */ public SerafinWriter(SerafinFileFormat.SerafinVersion _f) { ! version_ = _f; ! machineID_ = NativeBinaryInputStream.getLocalMachineId(); } + + /** + * @return le format du lecteur + */ public FileFormat getFileFormat() { return version_.getFileFormat(); } + private void setOut(OutputStream _out) { ! out_ = _out; } + + /** + * @param _ID l'id de la machine + */ public void setMachineID(String _ID) { ! machineID_ = NativeBinaryInputStream.getMachineId(_ID); } + + /** + * Initialise le type de machine pour sparc + */ public void setMachineSPARC() { ! machineID_ = NativeBinaryInputStream.SPARC; } + + /** + * Initialise le type de machine pour X 86 + */ public void setMachineX86() { ! machineID_ = NativeBinaryInputStream.X86; } + /** * Teste si le double n'appartient pas a la plage des float. + * * @param _d ! * @return true si le double n'appartient pas a la plage des float */ private boolean isDoubleToFloatError(double _d) { ! double d = _d > 0 ? _d : -_d; ! if (d > Float.MAX_VALUE) ! return true; ! if ((d > 0) && (d < Float.MIN_VALUE)) ! return true; return false; } + private void setProgression(int _etat) { progress_.setProgression((100 * _etat) / tailleTotale_); } + /** * Ecriture des donnees ( pas de buffer). ! * ! * @param _inter l'interface a ecrire */ public void writeSerafin(SerafinInterface _inter) { ! SerafinInterface donnees_ = _inter; try { ! if (out_ == null) ! throw new IOException(H2dResource.getS("Le flux de sortie est nul")); if (donnees_ == null) { analyze_.addFatalError(H2dResource.getS("Les données sont nulles")); return; } ! FortranBinaryOutputStream out = ! new FortranBinaryOutputStream(out_, true, machineID_); ! if (machineID_ == null) ! analyze_.addWarn( ! H2dResource.getS( ! "Le format de sortie a été changé en {0}", ! out.getMachineType()), ! -1); //ArrayList infos=new ArrayList(); ! //Les tailles jusqu'a IDISC inclus ! int nbv1 = donnees_.getValueNb(); ! if (nbv1 > 100) ! analyze_.addError( ! H2dResource.getS("Le nombre de variables est supérieur à 100"), 0); ! if (nbv1 <= 0) ! analyze_.addFatalError( ! H2dResource.getS("Le nombre de variables est nul ou négatif")); ! EfGrid maillage = donnees_.getGrid(); if (maillage.getEltType() == null) { analyze_.addFatalError( ! H2dResource.getS("Les éléments doivent être du même type")); } ! int nelem = maillage.getEltNb(); ! int npt = maillage.getPtsNb(); ! int nppel = maillage.getElement(0).getPtNb(); ! int[] iparam = donnees_.getIparam(); ! if ((iparam == null) || (iparam.length != SerafinFileFormat.SerafinVersion.IPARAM_NB)) ! analyze_.addError( ! H2dResource.getS("Le tableau des paramètres est invalide"), 0); ! boolean isIdateDefini = version_.isIdateDefini(iparam); ! boolean isFormatColonne = version_.isFormatEnColonne(iparam); ! int nbPasTemps = donnees_.getTimeStepNb(); ! if (nbPasTemps <= 0) ! analyze_.addError( ! H2dResource.getS("Le nombre de pas de temps est négatif ou nul"), 0); ! int tailleDebut = ! (8 + 80) + (8 + 8) + ((8 + 32) * nbv1) + (8 + 40) + (8 + 16); ! if (isIdateDefini) ! tailleDebut += 8 + 6 * 4; ! int tailleIkle1 = 8 + 4 * nelem * nppel; ! int tailleX1 = 8 + npt * 4; ! int tailleTemps = 12 + 4 * nbv1 * npt; ! if (isFormatColonne) ! tailleTemps = 12 + 4 * nbv1 * npt + 8 * nbv1; ! tailleTotale_ = ! tailleDebut + tailleIkle1 + tailleX1 * 3 + nbPasTemps * tailleTemps; //TITRE //tS chaine temporaire ! String tS = DodicoLib.adjustSize(80, donnees_.getTitre()); out.writeCharacter(tS); out.writeRecord(); *************** *** 148,156 **** out.writeRecord(); //TEXTi LUNITi ! boolean afficheAvance= progress_ == null ? false : true; ! for (int i= 0; i < nbv1; i++) { ! tS= DodicoLib.adjustSize(16, donnees_.getValueId(i)); out.writeCharacter(tS); ! tS= DodicoLib.adjustSize(16, donnees_.getUnite(i)); out.writeCharacter(tS); out.writeRecord(); --- 171,179 ---- out.writeRecord(); //TEXTi LUNITi ! boolean afficheAvance = progress_ == null ? false : true; ! for (int i = 0; i < nbv1; i++) { ! tS = DodicoLib.adjustSize(16, donnees_.getValueId(i)); out.writeCharacter(tS); ! tS = DodicoLib.adjustSize(16, donnees_.getUnite(i)); out.writeCharacter(tS); out.writeRecord(); *************** *** 158,168 **** //IPARAM //tIA tableau d'entier tempo ! int tI= iparam.length; ! for (int i= 0; i < tI; i++) { out.writeInteger(iparam[i]); } out.writeRecord(); if (isIdateDefini) { ! Calendar c= Calendar.getInstance(); c.setTime(new Date(donnees_.getIdate())); out.writeInteger(c.get(Calendar.YEAR)); --- 181,191 ---- //IPARAM //tIA tableau d'entier tempo ! int tI = iparam.length; ! for (int i = 0; i < tI; i++) { out.writeInteger(iparam[i]); } out.writeRecord(); if (isIdateDefini) { ! Calendar c = Calendar.getInstance(); c.setTime(new Date(donnees_.getIdate())); out.writeInteger(c.get(Calendar.YEAR)); *************** *** 181,193 **** out.writeInteger(1); out.writeRecord(); ! int lu= tailleDebut; ! if (afficheAvance) ! setProgression(lu); //IKLE1 //H2dElement[] elems= maillage.getElts(); EfElement eltIndex; ! for (int i= 0; i < nelem; i++) { ! eltIndex= maillage.getElement(i); ! for (int j= 0; j < nppel; j++) { out.writeInteger(eltIndex.getPtIndex(j) + 1); } --- 204,216 ---- out.writeInteger(1); out.writeRecord(); ! int lu = tailleDebut; ! if (afficheAvance) ! setProgression(lu); //IKLE1 //H2dElement[] elems= maillage.getElts(); EfElement eltIndex; ! for (int i = 0; i < nelem; i++) { ! eltIndex = maillage.getElement(i); ! for (int j = 0; j < nppel; j++) { out.writeInteger(eltIndex.getPtIndex(j) + 1); } *************** *** 198,210 **** setProgression(lu); } ! int[] ipobo= _inter.getPtsFrontiere(); ! int n= ipobo.length; //ipoboTemp contiend les indices frontiere pour chaque point (en partant de 1). ! int[] ipoboTemp= new int[npt]; ! for (int i= 0; i < n; i++) { ! ipoboTemp[ipobo[i]]= i + 1; } //IPOBO ! for (int i= 0; i < npt; i++) { out.writeInteger(ipoboTemp[i]); } --- 221,233 ---- setProgression(lu); } ! int[] ipobo = _inter.getPtsFrontiere(); ! int n = ipobo.length; //ipoboTemp contiend les indices frontiere pour chaque point (en partant de 1). ! int[] ipoboTemp = new int[npt]; ! for (int i = 0; i < n; i++) { ! ipoboTemp[ipobo[i]] = i + 1; } //IPOBO ! for (int i = 0; i < npt; i++) { out.writeInteger(ipoboTemp[i]); } *************** *** 217,229 **** //X1 double tD; ! for (int i= 0; i < npt; i++) { ! tD= maillage.getPt(i).getX(); if (isDoubleToFloatError(tD)) { analyze_.addError( ! H2dResource.getS("Erreur de conversion lors de l'écriture des X"), ! i); analyze_.addInfo(" Point " + i + " = " + tD, i); } ! out.writeReal((float)tD); } out.writeRecord(); --- 240,252 ---- //X1 double tD; ! for (int i = 0; i < npt; i++) { ! tD = maillage.getPt(i).getX(); if (isDoubleToFloatError(tD)) { analyze_.addError( ! H2dResource.getS("Erreur de conversion lors de l'écriture des X"), ! i); analyze_.addInfo(" Point " + i + " = " + tD, i); } ! out.writeReal((float) tD); } out.writeRecord(); *************** *** 233,245 **** } //Y1 ! for (int i= 0; i < npt; i++) { ! tD= maillage.getPt(i).getY(); if (isDoubleToFloatError(tD)) { analyze_.addError( ! H2dResource.getS("Erreur de conversion lors de l'écriture des Y"), ! i); analyze_.addInfo(" Point " + i + " = " + tD, i); } ! out.writeReal((float)tD); } out.writeRecord(); --- 256,268 ---- } //Y1 ! for (int i = 0; i < npt; i++) { ! tD = maillage.getPt(i).getY(); if (isDoubleToFloatError(tD)) { analyze_.addError( ! H2dResource.getS("Erreur de conversion lors de l'écriture des Y"), ! i); analyze_.addInfo(" Point " + i + " = " + tD, i); } ! out.writeReal((float) tD); } out.writeRecord(); *************** *** 249,278 **** } //double[] tDA = donnees_.getPasDeTemps(); ! for (int t= 0; t < nbPasTemps; t++) { ! tD= donnees_.getTimeStep(t); if (isDoubleToFloatError(tD)) { analyze_.addError( ! H2dResource.getS( ! "Erreur de conversion lors de l'écriture des pas de temps"), ! t); analyze_.addInfo(" temps " + t + " = " + tD, t); } ! out.writeReal((float)tD); ! for (int i= 0; i < nbv1; i++) { ! if (isFormatColonne) ! out.writeRecord(); ! for (int j= 0; j < npt; j++) { ! tD= donnees_.getValue(i, j, t); if (isDoubleToFloatError(tD)) { analyze_.addError( ! "Erreur de conversion lors de l'écriture des Données", ! t); analyze_.addInfo( ! " - t =" + donnees_.getTimeStep(t), ! t); analyze_.addInfo(" - Variable =" + donnees_.getValueId(j), t); analyze_.addInfo(" - Value =" + tD + " ( n°" + j, t); } ! out.writeReal((float)tD); } } --- 272,301 ---- } //double[] tDA = donnees_.getPasDeTemps(); ! for (int t = 0; t < nbPasTemps; t++) { ! tD = donnees_.getTimeStep(t); if (isDoubleToFloatError(tD)) { analyze_.addError( ! H2dResource.getS( ! "Erreur de conversion lors de l'écriture des pas de temps"), ! t); analyze_.addInfo(" temps " + t + " = " + tD, t); } ! out.writeReal((float) tD); ! for (int i = 0; i < nbv1; i++) { ! if (isFormatColonne) ! out.writeRecord(); ! for (int j = 0; j < npt; j++) { ! tD = donnees_.getValue(i, j, t); if (isDoubleToFloatError(tD)) { analyze_.addError( ! "Erreur de conversion lors de l'écriture des Données", ! t); analyze_.addInfo( ! " - t =" + donnees_.getTimeStep(t), ! t); analyze_.addInfo(" - Variable =" + donnees_.getValueId(j), t); analyze_.addInfo(" - Value =" + tD + " ( n°" + j, t); } ! out.writeReal((float) tD); } } *************** *** 288,339 **** } } /** ! * @see org.fudaa.dodico.tr.TrWriterInterface#setOut(File) */ public void setFile(File _f) { ! analyze_= new DodicoAnalyze(); analyze_.setRessource(_f.getAbsolutePath()); ! FileOutputStream out= null; try { ! out= new FileOutputStream(_f); } catch (FileNotFoundException _e) { return; } ! if (out != null) ! setOut(out); } /** ! * @see org.fudaa.dodico.tr.TrWriterInterface#setOut(File[]) */ public void setFile(File[] _f) { setFile(_f[0]); } /** ! * */ protected void _write(Object _o) { if (_o instanceof SerafinInterface) { ! writeSerafin((SerafinInterface)_o); } else { _donneesInvalides(_o); } } public final FileOperationSynthese write(SerafinInterface _o) { writeSerafin(_o); return closeOperation(_o); } /** ! * */ protected FortranInterface getFortranInterface() { return new FortranInterface() { public void close() throws IOException { ! if (out_ != null) ! out_.close(); } }; } /** ! * */ public FileFormatVersion getVersion() { --- 311,374 ---- } } + /** ! * @see org.fudaa.dodico.fichiers.FileOperationAbstract#setFile(java.io.File) */ public void setFile(File _f) { ! analyze_ = new DodicoAnalyze(); analyze_.setRessource(_f.getAbsolutePath()); ! FileOutputStream out = null; try { ! out = new FileOutputStream(_f); } catch (FileNotFoundException _e) { return; } ! if (out != null) ! setOut(out); } + /** ! * @param _f le fichier a ecrire */ public void setFile(File[] _f) { setFile(_f[0]); } + /** ! * * */ protected void _write(Object _o) { if (_o instanceof SerafinInterface) { ! writeSerafin((SerafinInterface) _o); } else { _donneesInvalides(_o); } } + + /** + * @param _o l'interface a ecrire + * @return la synthese de l'ecriture + */ public final FileOperationSynthese write(SerafinInterface _o) { writeSerafin(_o); return closeOperation(_o); } + + /** ! * @see org.fudaa.dodico.fichiers.FileOperationAbstract#getFortranInterface() */ protected FortranInterface getFortranInterface() { return new FortranInterface() { + public void close() throws IOException { ! if (out_ != null) ! out_.close(); } }; } + /** ! * @return la version utilisee */ public FileFormatVersion getVersion() { Index: SerafinReader.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/SerafinReader.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** SerafinReader.java 12 Feb 2004 15:32:49 -0000 1.15 --- SerafinReader.java 16 Mar 2004 16:47:28 -0000 1.16 *************** *** 65,68 **** --- 65,71 ---- setFile(f[0]); } + /** + * @see org.fudaa.dodico.fichiers.FileOperationAbstract#setFile(java.io.File) + */ public void setFile(File _f) { analyze_= new DodicoAnalyze(); |
From: Frederic D. <de...@us...> - 2004-03-16 16:56:49
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12810/src/org/fudaa/dodico/reflux/io Modified Files: INPFileFormat.java RefluxSolutionFileFormat.java RefluxSolutionAdapter.java RefluxSolutionReader.java CLVReader.java Added Files: RefluxSolutionInitFileFormat.java RefluxSolutionInitWriter.java RefluxSolutionInitReader.java Log Message: Maj pour les conditions initiales --- NEW FILE: RefluxSolutionInitWriter.java --- /* * @file RefluxSolutionInitWriter.java * @creation 15 mars 2004 * @modification $Date: 2004/03/16 16:47:28 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.dodico.reflux.io; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import org.fudaa.dodico.commun.DodicoAnalyze; import org.fudaa.dodico.commun.DodicoResource; import org.fudaa.dodico.commun.ProgressionUpdater; import org.fudaa.dodico.fichiers.FileWriteOperationAbstract; import org.fudaa.dodico.fortran.FortranBinaryOutputStream; import org.fudaa.dodico.fortran.FortranInterface; /** * @author Fred Deniger * @version $Id: RefluxSolutionInitWriter.java,v 1.1 2004/03/16 16:47:28 deniger Exp $ */ public class RefluxSolutionInitWriter extends FileWriteOperationAbstract { FortranBinaryOutputStream out_; /** * */ public RefluxSolutionInitWriter() { super(); } /** * @see org.fudaa.dodico.fichiers.FileOperationAbstract#getFortranInterface() */ protected FortranInterface getFortranInterface() { return new FortranInterface() { public void close() throws IOException { if (out_ != null) out_.close(); } }; } /** * @see org.fudaa.dodico.fichiers.FileOperationAbstract#setFile(java.io.File) */ public void setFile(File _f) { analyze_ = new DodicoAnalyze(); analyze_.setRessource(_f.getAbsolutePath()); FileOutputStream out = null; try { out = new FileOutputStream(_f); } catch (FileNotFoundException _e) { return; } if (out != null) setOut(out); } private void setOut(OutputStream _out) { try{ out_ = new FortranBinaryOutputStream(_out,true); } catch(IOException e){ out_=null; } } /** * @see org.fudaa.dodico.fichiers.FileWriteOperationAbstract#_write(java.lang.Object) */ protected void _write(Object _o) { if(!(_o instanceof double[])){ _donneesInvalides(_o); } else _write((double[])_o); } protected void _write(double[] _data) { if(out_==null){ analyze_.addFatalError(DodicoResource.getS("Le flux de sortie est nul")); } try{ ProgressionUpdater up=new ProgressionUpdater(progress_); up.setValue(4,_data.length); for (int i= 0; i < _data.length; i++){ out_.writeDoublePrecision(_data[i]); up.majAvancement(); } out_.writeRecord(); } catch(IOException e){ analyze_.manageException(e); } } } Index: RefluxSolutionReader.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/RefluxSolutionReader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RefluxSolutionReader.java 15 Mar 2004 08:27:59 -0000 1.1 --- RefluxSolutionReader.java 16 Mar 2004 16:47:28 -0000 1.2 *************** *** 23,26 **** --- 23,27 ---- import org.fudaa.dodico.fichiers.FileOpReadCharSimpleAbstract; import org.fudaa.dodico.h2d.H2dResource; + import org.fudaa.dodico.h2d.reflux.H2dRefluxSICourant2D; *************** *** 32,36 **** File f_; ! RefluxSolutionFileFormat.RefluxSIVersion version_; boolean readOnlyLastStep_; --- 33,37 ---- File f_; ! RefluxSolutionFileFormat.RefluxSolutionVersion version_; boolean readOnlyLastStep_; *************** *** 38,42 **** * @param _ft la version utilisee */ ! public RefluxSolutionReader(RefluxSolutionFileFormat.RefluxSIVersion _ft) { version_ = _ft; } --- 39,43 ---- * @param _ft la version utilisee */ ! public RefluxSolutionReader(RefluxSolutionFileFormat.RefluxSolutionVersion _ft) { version_ = _ft; } *************** *** 77,80 **** --- 78,83 ---- r.setTypeProjet(Integer.parseInt(prs.getProperty("tpProbleme", "0"))); } + ArrayList etape=readOnlyLastStep_?null:new ArrayList(500); + RefluxSolutionAdapter.SIByTime first=null; try { in_.setBlankZero(true); *************** *** 87,91 **** int[] fmtEtape = version_.getEtapeFormat(); in_.readFields(fmtEtape); ! RefluxSolutionAdapter.SIByTime first = new RefluxSolutionAdapter.SIByTime(in_.doubleField(5), null); in_.readFields(version_.getNbVariableFormat()); --- 90,94 ---- int[] fmtEtape = version_.getEtapeFormat(); in_.readFields(fmtEtape); ! first = new RefluxSolutionAdapter.SIByTime(in_.doubleField(5), null); in_.readFields(version_.getNbVariableFormat()); *************** *** 105,109 **** TDoubleArrayList[] ls=new TDoubleArrayList[nbVar]; for(int i=nbVar-1;i>=0;i--){ ! ls[i]=new TDoubleArrayList(500); } in_.readFields(dataFmt); --- 108,112 ---- TDoubleArrayList[] ls=new TDoubleArrayList[nbVar]; for(int i=nbVar-1;i>=0;i--){ ! ls[i]=new TDoubleArrayList(nbNds<0?500:(nbNds+1)); } in_.readFields(dataFmt); *************** *** 115,119 **** in_.readFields(dataFmt); } - ArrayList etape=new ArrayList(500); if((nbNds>0) && (nbNodeRead!=nbNds)){ analyze_.addWarn(H2dResource.getS("Le nombre de noeuds annoncé par le fichier dat est incorrect"),-1); --- 118,121 ---- *************** *** 124,135 **** } first.setValues(step); ! etape.add(first); ! RefluxSolutionAdapter.SIByTime[] rf=new RefluxSolutionAdapter.SIByTime[etape.size()]; ! etape.toArray(rf); ! r.setTimes(rf); ! return r; ! ! ! } catch (EOFException e) { --- 126,157 ---- } first.setValues(step); ! if(!readOnlyLastStep_) etape.add(first); ! String line=in_.getLine(); ! //indice pour connaitre le point lu en cours. ! int idxEnCours=0; ! while(line!=null){ ! in_.readFields(fmtEtape); ! first=new RefluxSolutionAdapter.SIByTime(in_.doubleField(5),null); ! step=new double[nbVar][nbNodeRead]; ! idxEnCours=0; ! while(idxEnCours<nbNodeRead){ ! in_.readFields(dataFmt); ! for(int i=nbVar-1;i>=0;i--){ ! step[i][idxEnCours]=in_.doubleField(i+1); ! } ! idxEnCours++; ! } ! if(idxEnCours!=nbNodeRead){ ! analyze_.addFatalError(H2dResource.getS("Le nombre de noeuds lu est incorrect"),in_); ! return null; ! } ! first.setValues(step); ! if(!readOnlyLastStep_) ! etape.add(first); ! line=in_.readLine(); ! if((line!=null) && (Integer.parseInt(line.trim())!=delim)){ ! analyze_.addFatalError(DodicoResource.getS("Format du champ incorrect"), in_); ! } ! } } catch (EOFException e) { *************** *** 143,146 **** --- 165,176 ---- analyze_.manageException(e); } + if(readOnlyLastStep_){ + r.setTimes(new RefluxSolutionAdapter.SIByTime[]{first}); + } + else{ + RefluxSolutionAdapter.SIByTime[] rf=new RefluxSolutionAdapter.SIByTime[etape.size()]; + etape.toArray(rf); + r.setTimes(rf); + } return r; } *************** *** 152,154 **** --- 182,198 ---- f_ = _f; } + /** + * @return Returns the readOnlyLastStep. + */ + public boolean isReadOnlyLastStep() { + return readOnlyLastStep_; + } + + /** + * @param _readOnlyLastStep The readOnlyLastStep to set. + */ + public void setReadOnlyLastStep(boolean _readOnlyLastStep) { + readOnlyLastStep_ = _readOnlyLastStep; + } + } Index: RefluxSolutionFileFormat.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/RefluxSolutionFileFormat.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RefluxSolutionFileFormat.java 15 Mar 2004 08:27:59 -0000 1.1 --- RefluxSolutionFileFormat.java 16 Mar 2004 16:47:28 -0000 1.2 *************** *** 13,16 **** --- 13,17 ---- import org.fudaa.dodico.fichiers.FileReadOperationAbstract; import org.fudaa.dodico.fichiers.FileWriteOperationAbstract; + import org.fudaa.dodico.h2d.reflux.H2dRefluxSICourant2D; *************** *** 21,30 **** public class RefluxSolutionFileFormat extends FileFormat { ! public class RefluxSIVersion extends FileFormatVersion { /** * */ ! public RefluxSIVersion() { super(RefluxSolutionFileFormat.this, "1.0"); } --- 22,34 ---- public class RefluxSolutionFileFormat extends FileFormat { ! /** ! * Version En cours ! */ ! public class RefluxSolutionVersion extends FileFormatVersion { /** * */ ! public RefluxSolutionVersion() { super(RefluxSolutionFileFormat.this, "1.0"); } *************** *** 94,98 **** private RefluxSolutionFileFormat() { super(1); ! extensions_ = new String[] { "siv"}; } --- 98,102 ---- private RefluxSolutionFileFormat() { super(1); ! extensions_ = new String[] { "sov"}; } *************** *** 108,112 **** */ public FileFormatVersion getLastVersionInstance() { ! return new RefluxSIVersion(); } } --- 112,126 ---- */ public FileFormatVersion getLastVersionInstance() { ! return new RefluxSolutionVersion(); ! } ! ! /** ! * @param _a l'adapteur en question ! * @return les solutions initiales en courantologie 2D ! */ ! public static H2dRefluxSICourant2D toSiCourant2D(RefluxSolutionAdapter _a){ ! RefluxSolutionAdapter.SIByTime last=_a.times_[_a.times_.length-1]; ! return new H2dRefluxSICourant2D(last.getValues()[3],last.getValues()[4],last.getValues()[7]); ! } } Index: RefluxSolutionAdapter.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/RefluxSolutionAdapter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RefluxSolutionAdapter.java 15 Mar 2004 08:27:59 -0000 1.1 --- RefluxSolutionAdapter.java 16 Mar 2004 16:47:28 -0000 1.2 *************** *** 9,12 **** --- 9,13 ---- package org.fudaa.dodico.reflux.io; + import org.fudaa.dodico.h2d.reflux.H2dRefluxSICourant2D; import org.fudaa.dodico.h2d.type.H2dProjetType; *************** *** 17,22 **** */ public class RefluxSolutionAdapter { ! SIByTime[] times_; H2dProjetType type_; /** * --- 18,25 ---- */ public class RefluxSolutionAdapter { ! ! SIByTime[] times_; H2dProjetType type_; + /** * *************** *** 25,79 **** super(); } ! /** * @param _projetTypeId l'id du type de projet * @see H2dProjetType */ ! public void setTypeProjet(int _projetTypeId){ ! type_=(H2dProjetType)H2dProjetType.getIdInList(H2dProjetType.LIST,_projetTypeId); } ! /** * @return le type de projet */ ! public H2dProjetType getProjetType(){ return type_; } ! ! ! public static class SIByTime{ ! private double t_; private double[][] values_; /** * @param _t * @param _values */ ! public SIByTime(double _t,double[][] _values){ ! values_=_values; ! t_=_t; } ! /** * @return le nombre de valeurs */ ! public int getNbValues(){ return values_.length; } ! /** * @return le nombre de points */ ! public int getNbPt(){ return values_[0].length; } ! /** * @param _idxValues l'index de la valeur voulu ! * @param _idxPoint l'index du point * @return */ ! public double getValues(int _idxValues,int _idxPoint){ return values_[_idxValues][_idxPoint]; } /** * @return Returns the values. --- 28,91 ---- super(); } ! /** * @param _projetTypeId l'id du type de projet * @see H2dProjetType */ ! public void setTypeProjet(int _projetTypeId) { ! type_ = (H2dProjetType) H2dProjetType.getIdInList(H2dProjetType.LIST, _projetTypeId); } ! /** * @return le type de projet */ ! public H2dProjetType getProjetType() { return type_; } ! ! /** ! * @return le nombre de pas de temps ! */ ! public int getNbEtape() { ! return times_.length; ! } ! ! public static class SIByTime { ! ! private double t_; private double[][] values_; + /** * @param _t * @param _values */ ! public SIByTime(double _t, double[][] _values) { ! values_ = _values; ! t_ = _t; } ! /** * @return le nombre de valeurs */ ! public int getNbValues() { return values_.length; } ! /** * @return le nombre de points */ ! public int getNbPt() { return values_[0].length; } ! /** * @param _idxValues l'index de la valeur voulu ! * @param _idxPoint l'index du point * @return */ ! public double getValues(int _idxValues, int _idxPoint) { return values_[_idxValues][_idxPoint]; } + /** * @return Returns the values. *************** *** 90,94 **** --- 102,113 ---- } + /** + * @return Returns the t. + */ + public double getT() { + return t_; + } } + /** * @return Returns the times. *************** *** 104,107 **** times_ = _times; } - } --- 123,125 ---- --- NEW FILE: RefluxSolutionInitReader.java --- /* * @file RefluxSolutionInitReader.java * @creation 15 mars 2004 * @modification $Date: 2004/03/16 16:47:28 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.dodico.reflux.io; import gnu.trove.TDoubleArrayList; import java.io.EOFException; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import org.fudaa.dodico.commun.DodicoAnalyze; import org.fudaa.dodico.commun.DodicoResource; import org.fudaa.dodico.commun.ProgressionUpdater; import org.fudaa.dodico.fichiers.FileReadOperationAbstract; import org.fudaa.dodico.fortran.FortranBinaryInputStream; import org.fudaa.dodico.fortran.FortranInterface; /** * @author Fred Deniger * @version $Id: RefluxSolutionInitReader.java,v 1.1 2004/03/16 16:47:28 deniger Exp $ */ public class RefluxSolutionInitReader extends FileReadOperationAbstract { FortranBinaryInputStream in_; int nbDouble_; /** * Constructeur par defaut */ public RefluxSolutionInitReader() {} /** * @see org.fudaa.dodico.fichiers.FileReadOperationAbstract#_read() */ protected Object _read() { return readList(); } protected double[] readList() { if (in_ == null) { analyze_.addFatalError(DodicoResource.getS("Input Stream not found")); return null; } TDoubleArrayList r = new TDoubleArrayList(nbDouble_+1); ProgressionUpdater up=new ProgressionUpdater(progress_); up.setValue(4,nbDouble_); try { in_.readRecord(); long n=in_.getEndOfRecord(); while (n>in_.getCurrentPosition()) { r.add(in_.readDoublePrecision()); up.majAvancement(); } } catch(EOFException e){ } catch (IOException e) { analyze_.manageException(e); return null; } return r.toNativeArray(); } /** * @see org.fudaa.dodico.fichiers.FileOperationAbstract#setFile(java.io.File) */ public void setFile(File _f) { analyze_ = new DodicoAnalyze(); analyze_.setRessource(_f.getAbsolutePath()); try { in_ = new FortranBinaryInputStream(new FileInputStream(_f), true); } catch (FileNotFoundException e) { analyze_.manageException(e); } catch (IOException e) { analyze_.manageException(e); } nbDouble_ = (int) (_f.length() - 8) / 8; } /** * @see org.fudaa.dodico.fichiers.FileOperationAbstract#getFortranInterface() */ protected FortranInterface getFortranInterface() { return new FortranInterface() { public void close() throws IOException { if (in_ != null) in_.close(); } }; } } Index: CLVReader.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/CLVReader.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CLVReader.java 12 Feb 2004 15:32:46 -0000 1.4 --- CLVReader.java 16 Mar 2004 16:47:28 -0000 1.5 *************** *** 32,35 **** --- 32,38 ---- FileFormatVersion version_; long nbOctets_; + /** + * @param _version la version utilisee + */ public CLVReader(FileFormatVersion _version) { version_= _version; --- NEW FILE: RefluxSolutionInitFileFormat.java --- /* * @file RefluxSolutionInitFileFormat.java * @creation 15 mars 2004 * @modification $Date: 2004/03/16 16:47:28 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.dodico.reflux.io; import org.fudaa.dodico.fichiers.FileFormat; import org.fudaa.dodico.fichiers.FileFormatVersion; import org.fudaa.dodico.fichiers.FileReadOperationAbstract; import org.fudaa.dodico.fichiers.FileWriteOperationAbstract; /** * @author Fred Deniger * @version $Id: RefluxSolutionInitFileFormat.java,v 1.1 2004/03/16 16:47:28 deniger Exp $ */ public class RefluxSolutionInitFileFormat extends FileFormat { private final static RefluxSolutionInitFileFormat INSTANCE = new RefluxSolutionInitFileFormat(); /** * @return singleton */ public static final RefluxSolutionInitFileFormat getInstance() { return INSTANCE; } /** * Initialise les donnees */ public RefluxSolutionInitFileFormat() { super(1); extensions_ = new String[] { "siv"}; } /** * @see org.fudaa.dodico.fichiers.FileFormat#getLastVersion() */ public String getLastVersion() { return "1.0"; } /** * @see org.fudaa.dodico.fichiers.FileFormat#getLastVersionInstance() */ public FileFormatVersion getLastVersionInstance() { return new RefluxSIVersion(); } /** * La derniere version en cours */ public class RefluxSIVersion extends FileFormatVersion { protected RefluxSIVersion() { super(RefluxSolutionInitFileFormat.getInstance(), "1.0"); } /** * @see org.fudaa.dodico.fichiers.FileFormatVersion#createReader() */ public FileReadOperationAbstract createReader() { return new RefluxSolutionInitReader(); } /** * @see org.fudaa.dodico.fichiers.FileFormatVersion#createWriter() */ public FileWriteOperationAbstract createWriter() { return new RefluxSolutionInitWriter(); } } } Index: INPFileFormat.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/INPFileFormat.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** INPFileFormat.java 15 Mar 2004 08:27:58 -0000 1.16 --- INPFileFormat.java 16 Mar 2004 16:47:28 -0000 1.17 *************** *** 116,119 **** --- 116,129 ---- return DodicoLib.findStringEndWith(_f, getPnTransitoireFileExtension()); } + + /** + * @param _f le tableau de recherche + * @return l'element du tableau contenant la bonne extension + */ + public String getSolutionInitiales(String[] _f) { + return DodicoLib.findStringEndWith(_f, getSolutionInitFileExtension()); + } + + public H2dBcType getClType(int _id) { if (_id == getCodeLibre()) |
From: Frederic D. <de...@us...> - 2004-03-16 16:56:48
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/navigation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12810/src/org/fudaa/dodico/navigation Modified Files: RechercheGenerateur.java Log Message: Maj pour les conditions initiales Index: RechercheGenerateur.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/navigation/RechercheGenerateur.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RechercheGenerateur.java 25 Nov 2003 10:11:45 -0000 1.4 --- RechercheGenerateur.java 16 Mar 2004 16:47:29 -0000 1.5 *************** *** 9,15 **** package org.fudaa.dodico.navigation; //java ! import java.util.*; ! //dodico ! import org.fudaa.dodico.corba.probabilite.*; import org.fudaa.dodico.objet.CDodico; /** --- 9,14 ---- package org.fudaa.dodico.navigation; //java ! import org.fudaa.dodico.corba.probabilite.IGenerateurLoiErlang; ! import org.fudaa.dodico.corba.probabilite.IGenerateurLoiErlangHelper; import org.fudaa.dodico.objet.CDodico; /** |
From: Frederic D. <de...@us...> - 2004-03-16 16:56:48
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12810/src/org/fudaa/dodico/h2d Modified Files: h2d_en.fr_txt Log Message: Maj pour les conditions initiales Index: h2d_en.fr_txt =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/h2d_en.fr_txt,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** h2d_en.fr_txt 15 Mar 2004 08:28:00 -0000 1.12 --- h2d_en.fr_txt 16 Mar 2004 16:47:29 -0000 1.13 *************** *** 227,229 **** Courbes temporelles=Time curves Les courbes suivantes ne contiennent pas les bornes de la simulation=The following curves don't contain the bounds of the simulation ! Le nombre de noeuds annoncé par le fichier dat est incorrect=The "dat" contains a wrong number of nodes \ No newline at end of file --- 227,230 ---- Courbes temporelles=Time curves Les courbes suivantes ne contiennent pas les bornes de la simulation=The following curves don't contain the bounds of the simulation ! Le nombre de noeuds annoncé par le fichier dat est incorrect=The "dat" contains a wrong number of nodes ! Le nombre de noeuds lu est incorrect=The number of nodes is wrong \ No newline at end of file |
From: Frederic D. <de...@us...> - 2004-03-16 16:56:37
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/reflux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12726/src/org/fudaa/fudaa/tr/reflux Modified Files: TrRefluxProjectFactory.java TrRefluxProjet.java TrRefluxImplHelper.java TrRefluxProjectDispatcherListener.java TrRefluxParametres.java Added Files: TrRefluxSiMultiPlan.java TrRefluxXmlProjectReader.java TrRefluxSI.java TrRefluxXmlProjectWriter.java TrRefluxSIPlan.java Log Message: Maj pour les conditions initiales Index: TrRefluxProjectFactory.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxProjectFactory.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TrRefluxProjectFactory.java 12 Mar 2004 10:16:59 -0000 1.8 --- TrRefluxProjectFactory.java 16 Mar 2004 16:47:12 -0000 1.9 *************** *** 11,30 **** import org.fudaa.ctulu.CtuluLib; - import org.fudaa.dodico.commun.DodicoAnalyze; import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.ef.EfGrid; import org.fudaa.dodico.ef.EfGridSource; import org.fudaa.dodico.ef.EfLib; - import org.fudaa.dodico.ef.EfElementType; import org.fudaa.dodico.ef.FileFormatGridVersion; import org.fudaa.dodico.fichiers.FileOperationSynthese; import org.fudaa.dodico.h2d.H2dResource; import org.fudaa.dodico.h2d.reflux.H2dRefluxParameters; import org.fudaa.dodico.h2d.type.H2dProjetType; import org.fudaa.dodico.olb.OLBExec; import org.fudaa.dodico.reflux.io.INPFileFormat; import org.fudaa.dodico.reflux.io.INPInterface; - import org.fudaa.fudaa.tr.TrImplementation; import org.fudaa.fudaa.tr.TrResource; --- 11,29 ---- import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.commun.DodicoAnalyze; import org.fudaa.dodico.commun.ProgressionInterface; + import org.fudaa.dodico.ef.EfElementType; import org.fudaa.dodico.ef.EfGrid; import org.fudaa.dodico.ef.EfGridSource; import org.fudaa.dodico.ef.EfLib; import org.fudaa.dodico.ef.FileFormatGridVersion; import org.fudaa.dodico.fichiers.FileOperationSynthese; import org.fudaa.dodico.h2d.H2dResource; import org.fudaa.dodico.h2d.reflux.H2dRefluxParameters; + import org.fudaa.dodico.h2d.reflux.H2dRefluxSICourant2D; import org.fudaa.dodico.h2d.type.H2dProjetType; import org.fudaa.dodico.olb.OLBExec; import org.fudaa.dodico.reflux.io.INPFileFormat; import org.fudaa.dodico.reflux.io.INPInterface; import org.fudaa.fudaa.tr.TrImplementation; import org.fudaa.fudaa.tr.TrResource; *************** *** 34,44 **** */ public class TrRefluxProjectFactory { /** ! * */ ! private TrRefluxProjectFactory() { ! super(); } ! public static TrRefluxProjet createRefluxProject( File _file, INPFileFormat.INPVersion _fileFormat, --- 33,96 ---- */ public class TrRefluxProjectFactory { + /** ! * Lit un fichier inp et initialise les parametres ! * @param _f le fichier inp ! * @param _ft le format du fichier inp ! * @param _progress barre de progression ! * @param _ui l'interface utilisateur ! * @return les parametres */ ! public final static TrRefluxParametres createRefluxParametresFromINP( ! File _f, ! INPFileFormat.INPVersion _ft, ! ProgressionInterface _progress, ! TrImplementation _ui) { ! FileOperationSynthese synt= _ft.read(_f, _progress); ! INPInterface inter= (INPInterface)synt.getSource(); ! if (_ui != null) ! _ui.manageErrorOperationAndIsFatal(synt); ! if (synt.containsFatalError()) ! return null; ! if (inter == null) ! return null; ! TrRefluxParametres r= new TrRefluxParametres(); ! r.ui_= _ui; ! r.fINP_= _f; ! String s= _f.getName(); ! int i= s.indexOf('.'); ! if (i > 0) ! s= s.substring(0, i); ! r.title_= s; ! DodicoAnalyze analyze= new DodicoAnalyze(); ! File siv=new File(_f.getParentFile(),_ft.getSolutionInitiales(inter.getFichiers())); ! //a modifier par la suite pour prendre en compte des si non 2D ! H2dRefluxSICourant2D si2D=null; ! if(siv.exists()){ ! synt=H2dRefluxSICourant2D.loadSI(inter.getGrid(), siv, _progress); ! if(_ui!=null) _ui.manageErrorOperationAndIsFatal(synt); ! if(!synt.containsFatalError()){ ! si2D = (H2dRefluxSICourant2D)synt.getSource(); ! } ! } ! analyze.setDesc( ! TrResource.getS("Analyse du fichier") ! + CtuluLib.ESPACE ! + _f.getAbsolutePath()); ! r.params_= H2dRefluxParameters.init(inter,si2D, _progress, _ft, analyze); ! if (_ui != null) { ! _ui.manageAnalyzeAndIsFatal(analyze); ! } ! return r; } ! /** ! * Cree un projet reflux a partir d'un fichier inp ! * @param _file le fichier inp ! * @param _fileFormat le format ! * @param _progress la barre de progression ! * @param _ui l'interface utilisateur ! * @return un nouveau projet ! */ ! public static TrRefluxProjet createRefluxProjectFromINP( File _file, INPFileFormat.INPVersion _fileFormat, *************** *** 46,53 **** TrImplementation _ui) { TrRefluxParametres params_= ! createRefluxParametres(_file, _fileFormat, _progress, _ui); _progress.setProgression(100); if (params_ != null) { TrRefluxProjet p= new TrRefluxProjet(params_); params_.getH2dRefluxParametres().setListener( new TrRefluxProjectDispatcherListener(p)); --- 98,113 ---- TrImplementation _ui) { TrRefluxParametres params_= ! createRefluxParametresFromINP(_file, _fileFormat, _progress, _ui); _progress.setProgression(100); if (params_ != null) { TrRefluxProjet p= new TrRefluxProjet(params_); + File prex=new File(_file.getParentFile(),params_.getFicNameSansExt()+".prex"); + if(prex.exists()){ + TrRefluxXmlProjectReader r=TrRefluxXmlProjectReader.readPrex(prex,_progress,_ui); + p.setDocument(r.getDoc()); + /*if(r.getSi()==null){ + params_.s + }*/ + } params_.getH2dRefluxParametres().setListener( new TrRefluxProjectDispatcherListener(p)); *************** *** 57,60 **** --- 117,129 ---- } + /** + * Cree un projet reflux a partir d'un fichier de maillage + * @param _f le fichier de maillage + * @param _ft le format du fichier de maillage + * @param _t le type de projet voulu + * @param _op la barre de progression + * @param _ui l'interface utilisateur + * @return un nouveau projet + */ public static TrRefluxProjet createRefluxProjectFromGrid( File _f, *************** *** 83,86 **** --- 152,162 ---- } + /** + * @param _f le fichier contenant le maillage + * @param _ft le format du maillage + * @param _ui l'interface utilisateur + * @param _op la barre de progression + * @return maillage correctement initialise + */ public static EfGrid getValidGrid( File _f, *************** *** 127,165 **** return gOptimize; } - /** ! * La petite initialisation des parametres. ! */ ! public final static TrRefluxParametres createRefluxParametres( ! File _f, ! INPFileFormat.INPVersion _ft, ! ProgressionInterface _progress, ! TrImplementation _ui) { ! FileOperationSynthese synt= _ft.read(_f, _progress); ! INPInterface inter= (INPInterface)synt.getSource(); ! if (_ui != null) ! _ui.manageErrorOperationAndIsFatal(synt); ! if (synt.containsFatalError()) ! return null; ! if (inter == null) ! return null; ! TrRefluxParametres r= new TrRefluxParametres(); ! r.ui_= _ui; ! r.fINP_= _f; ! String s= _f.getName(); ! int i= s.indexOf('.'); ! if (i > 0) ! s= s.substring(0, i); ! r.title_= s; ! DodicoAnalyze analyze= new DodicoAnalyze(); ! analyze.setDesc( ! TrResource.getS("Analyse du fichier") ! + CtuluLib.ESPACE ! + _f.getAbsolutePath()); ! r.params_= H2dRefluxParameters.init(inter, _progress, _ft, analyze); ! if (_ui != null) { ! _ui.manageAnalyzeAndIsFatal(analyze); ! } ! return r; } } --- 203,211 ---- return gOptimize; } /** ! * ! */ ! private TrRefluxProjectFactory() { ! super(); } } --- NEW FILE: TrRefluxSI.java --- /* * @file TrRefluxSI.java * @creation 15 mars 2004 * @modification $Date: 2004/03/16 16:47:12 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.fudaa.tr.reflux; import java.io.File; import java.io.IOException; import com.memoire.xml.XmlListener; import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.commun.DodicoAnalyze; import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.ef.EfGrid; import org.fudaa.dodico.ef.EfNode; import org.fudaa.dodico.fichiers.FileOperationSynthese; import org.fudaa.dodico.h2d.reflux.H2dRefluxSICourant2D; import org.fudaa.fudaa.tr.TrXmlProjectWriter; /** * @author Fred Deniger * @version $Id: TrRefluxSI.java,v 1.1 2004/03/16 16:47:12 deniger Exp $ */ public abstract class TrRefluxSI { TrRefluxProjet proj_; private boolean reprise_; /** * */ public TrRefluxSI() { super(); } /** * @return le listener xml */ public abstract SiXmlListener createXmlListener(); public void setProjet(TrRefluxProjet _p){ proj_=_p; } /** * @param _p le projet * @return les solutions initiales par defaut */ public static TrRefluxSI createDefaultSI(TrRefluxProjet _p){ EfGrid f=_p.getTrParams().getH2dParametres().getMaillage(); EfNode max=f.getMaxPoint(); EfNode min=f.getMaxPoint(); TrRefluxSIPlan r=new TrRefluxSIPlan(); r.setProjet(_p); double z=max.getZ()+0.2; EfNode n1=new EfNode(min.getX(), min.getY(),z); EfNode n2=new EfNode(max.getX(),min.getY(),z); EfNode n3=new EfNode(max.getX(),max.getY(),z); r.setPt(n1,n2,n3); return r; } /** * @return true si multiplan */ public abstract boolean isMultiPlan(); /** * @return true si solutions initiales definies */ public abstract boolean isDefined(); /** * @param _out le flux de sortie * @param _a l'analyse a modifier en cas d'erreur * @throws IOException */ public abstract void writeXmlSub(TrXmlProjectWriter _out,DodicoAnalyze _a) throws IOException; /** * @param _xml le flux de sortie * @param _a l'analyse a modifier en cas d'erreur * @throws IOException */ public void writeXML(TrXmlProjectWriter _xml,DodicoAnalyze _a) throws IOException{ if(isDefined()){ String s="<SI"; if(isMultiPlan()) s+=" multi=\"true\" >"; if(isReprise()){ s+=" reprise=\"true\" >"; } s+=">"; _xml.writeln(s); writeXmlSub(_xml,_a); _xml.writeln("</SI>"); } } /** * @param n le noeud a ecrire * @param _out le flux de sortie * @throws IOException */ protected void printNode(EfNode n,TrXmlProjectWriter _out) throws IOException{ _out.writeln("<node>"+n.getX()+CtuluLib.ESPACE+n.getY()+CtuluLib.ESPACE+n.getZ()+CtuluLib.ESPACE+"</node>"); } /** * @return Returns the reprise. */ public boolean isReprise() { return reprise_; } /** * @param _reprise The reprise to set. */ public void setReprise(boolean _reprise) { reprise_ = _reprise; } /** * Un listener specifique pour les solutions initiales */ public interface SiXmlListener extends XmlListener{ /** * @param _l le listener parent afin de transferer les appels d'erreur */ public void setParentListener(XmlListener _l); /** * @return null si les donnees sont valides */ public String isValide(); /** * Initialise l'objet Solutions initiales */ public void initSi(); } } --- NEW FILE: TrRefluxXmlProjectWriter.java --- /* * @file TrRefluxXmlProject.java * @creation 15 mars 2004 * @modification $Date: 2004/03/16 16:47:12 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.fudaa.tr.reflux; import java.io.File; import java.io.FileWriter; import java.io.IOException; import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.fudaa.tr.TrProjet; import org.fudaa.fudaa.tr.TrXmlProjectWriter; /** * @author Fred Deniger * @version $Id: TrRefluxXmlProjectWriter.java,v 1.1 2004/03/16 16:47:12 deniger Exp $ */ public class TrRefluxXmlProjectWriter extends TrXmlProjectWriter { TrRefluxProjet p_; /** * @param _p le projet en question */ public TrRefluxXmlProjectWriter(TrRefluxProjet _p) { super(); p_ = _p; try { out_ = new FileWriter(new File(_p.getDirBase(), DodicoLib.getSansExtension(_p.getParamsFile() .getName()) + ".prex")); } catch (IOException e) { e.printStackTrace(); } } /** * @see org.fudaa.fudaa.tr.TrXmlProjectWriter#getProjet() */ public TrProjet getProjet() { return p_; } /** * @see org.fudaa.fudaa.tr.TrXmlProjectWriter#writeData() */ public void writeData() throws IOException { p_.getRefluxParametres().getSI().writeXML(this, a_); } } --- NEW FILE: TrRefluxXmlProjectReader.java --- /* * @file TrRefluxXmlProjectReader.java * @creation 16 mars 2004 * @modification $Date: 2004/03/16 16:47:12 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.fudaa.tr.reflux; import java.io.File; import java.io.IOException; import com.memoire.xml.XmlListener; import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.fudaa.commun.FudaaUI; import org.fudaa.fudaa.tr.TrResource; import org.fudaa.fudaa.tr.TrXmlProjectReader; /** * @author Fred Deniger * @version $Id: TrRefluxXmlProjectReader.java,v 1.1 2004/03/16 16:47:12 deniger Exp $ */ public class TrRefluxXmlProjectReader extends TrXmlProjectReader { /** * Un reader specifique pour les solutions initiales. */ public class SiXmlReader implements XmlListener { private boolean isStarted_; private TrRefluxSI.SiXmlListener siListener_; /** * @see com.memoire.xml.XmlListener#attribute(java.lang.String, java.lang.String) */ public void attribute(String _name, String _value) { if (isStarted_) { if (("multi".equals(_name)) && ("true".equals(_value))) { si_ = new TrRefluxSiMultiPlan(); } if ("reprise".equals(_name)) { si_.setReprise(_value.equals("true")); } } else siListener_.attribute(_name, _value); } /** * @see com.memoire.xml.XmlListener#endElement(java.lang.String) */ public void endElement(String _tag) { if ("si".equals(_tag)) { String err = siListener_.isValide(); if (err == null) { siListener_.initSi(); } else error(TrResource.getS("Le fichier xml des solutions initiales est invalide") + CtuluLib.LINE_SEP + err); } else siListener_.endElement(_tag); } /** * @see com.memoire.xml.XmlListener#error(java.lang.String) */ public void error(String _message) { TrRefluxXmlProjectReader.this.error(_message); } /** * @see com.memoire.xml.XmlListener#location(java.lang.String, int, int) */ public void location(String _origin, int _lineno, int _charno) { } /** * @see com.memoire.xml.XmlListener#startElement(java.lang.String) */ public void startElement(String _tag) { if ("si".equals(_tag)) { isStarted_ = true; si_ = new TrRefluxSIPlan(); } else if (isStarted_) { isStarted_ = false; siListener_ = si_.createXmlListener(); siListener_.setParentListener(this); siListener_.startElement(_tag); } else { siListener_.startElement(_tag); } } /** * @see com.memoire.xml.XmlListener#text(java.lang.String) */ public void text(String _data) { siListener_.text(_data); } } protected TrRefluxSI si_; /** * @param _f */ public TrRefluxXmlProjectReader(File _f) { super(_f); } /** * @param _prex le fichier xml du projet reflux * @param _i la barre de progression * @param _ui l'interface utilisateur * @return null si erreur */ public static TrRefluxXmlProjectReader readPrex(File _prex, ProgressionInterface _i, FudaaUI _ui) { TrRefluxXmlProjectReader r = new TrRefluxXmlProjectReader(_prex); r.ui_ = _ui; _i.setDesc(TrResource.getS("Lecture")+CtuluLib.ESPACE+_prex.getName()); try { r.read(); _i.setProgression(90); } catch (IOException e) { _ui.error(e.getMessage()); return null; } return r; } /** * @see org.fudaa.fudaa.tr.TrXmlProjectReader#initListener() */ protected void initListener() { super.initListener(); super.elementListener_.put("si", new SiXmlReader()); } /** * Lit un fichier xml et ecrit les donnees lues. * * @param args le fichier a lire */ public static void main(String[] args) { File f = new File(args[0]); TrRefluxXmlProjectReader r = new TrRefluxXmlProjectReader(f); try { r.read(); } catch (IOException e) { e.printStackTrace(); } System.out.println("doc author =" + r.doc_.author); System.out.println("doc date =" + r.doc_.date); System.out.println("doc comment =" + r.doc_.comment); System.out.println(r.si_); } /** * @return Returns the si. */ public TrRefluxSI getSi() { return si_; } } Index: TrRefluxProjet.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxProjet.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** TrRefluxProjet.java 12 Mar 2004 10:17:00 -0000 1.20 --- TrRefluxProjet.java 16 Mar 2004 16:47:12 -0000 1.21 *************** *** 8,11 **** --- 8,12 ---- */ package org.fudaa.fudaa.tr.reflux; + import ghm.followgui.FollowApp; *************** *** 34,38 **** import org.fudaa.dodico.h2d.reflux.H2dRefluxParameters; import org.fudaa.dodico.reflux.RefluxExec; [...1136 lines suppressed...] ! TrRefluxProjectDispatcherListener l = (TrRefluxProjectDispatcherListener) params_ ! .getH2dRefluxParametres().getListener(); ! if (l != null) l.majDocumentInfo(); ! } } /** ! * @see org.fudaa.fudaa.tr.TrProjet#showGeneralFille() */ ! public void showGeneralFille() { ! activeGeneral(); ! } /** ! * @see org.fudaa.fudaa.tr.TrProjet#showVisuFille() */ ! public void showVisuFille() { ! activeVisu(); } } Index: TrRefluxProjectDispatcherListener.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxProjectDispatcherListener.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TrRefluxProjectDispatcherListener.java 12 Feb 2004 16:15:21 -0000 1.6 --- TrRefluxProjectDispatcherListener.java 16 Mar 2004 16:47:12 -0000 1.7 *************** *** 8,12 **** */ package org.fudaa.fudaa.tr.reflux; - import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.dico.DicoEntite; --- 8,11 ---- *************** *** 18,22 **** import org.fudaa.dodico.h2d.type.H2dBoundaryType; import org.fudaa.dodico.h2d.type.H2dVariableType; - import org.fudaa.fudaa.commun.FudaaLib; import org.fudaa.fudaa.tr.TrProjectDispatcherListener; --- 17,20 ---- *************** *** 26,40 **** */ public class TrRefluxProjectDispatcherListener ! extends TrProjectDispatcherListener ! implements H2dRefluxProjectDispatcherListener { TrRefluxProjet proj_; /** ! * */ public TrRefluxProjectDispatcherListener(TrRefluxProjet proj) { ! proj_= proj; } - private void changed() { if (proj_.fille_ != null) { --- 24,40 ---- */ public class TrRefluxProjectDispatcherListener ! extends TrProjectDispatcherListener ! implements H2dRefluxProjectDispatcherListener { ! TrRefluxProjet proj_; + + /** ! * @param proj le projet concerne */ public TrRefluxProjectDispatcherListener(TrRefluxProjet proj) { ! proj_ = proj; } private void changed() { if (proj_.fille_ != null) { *************** *** 44,55 **** majInfoSender(proj_); } /** ! * */ public void refluxProjectModifiedStateChange() { changed(); } /** ! * */ public void bcBoundaryTypeChanged(H2dBoundary b, H2dBoundaryType _old) { --- 44,66 ---- majInfoSender(proj_); } + /** ! * Methode appelee lorsque les infos sur le document sont modifiees. ! */ ! public void majDocumentInfo(){ ! FudaaLib.info("CHANGE: DOCUMENT INFORMATION"); ! changed(); ! } ! ! ! /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxProjectDispatcherListener#refluxProjectModifiedStateChange() */ public void refluxProjectModifiedStateChange() { changed(); } + /** ! * @see org.fudaa.dodico.h2d.H2dBcListener#bcBoundaryTypeChanged(org.fudaa.dodico.h2d.H2dBoundary, org.fudaa.dodico.h2d.type.H2dBoundaryType) */ public void bcBoundaryTypeChanged(H2dBoundary b, H2dBoundaryType _old) { *************** *** 57,72 **** changed(); } /** ! * */ public void dicoParamsEntiteRemoved( ! DicoParams _cas, ! DicoEntite _ent, ! String _oldValue) { super.dicoParamsEntiteRemoved(_cas, _ent, _oldValue); changed(); } /** ! * */ public void dicoParamsEntiteAdded(DicoParams _cas, DicoEntite _ent) { --- 68,85 ---- changed(); } + /** ! * @see org.fudaa.dodico.dico.DicoParamsListener#dicoParamsEntiteRemoved(org.fudaa.dodico.dico.DicoParams, org.fudaa.dodico.dico.DicoEntite, java.lang.String) */ public void dicoParamsEntiteRemoved( ! DicoParams _cas, ! DicoEntite _ent, ! String _oldValue) { super.dicoParamsEntiteRemoved(_cas, _ent, _oldValue); changed(); } + /** ! * @see org.fudaa.dodico.dico.DicoParamsListener#dicoParamsEntiteAdded(org.fudaa.dodico.dico.DicoParams, org.fudaa.dodico.dico.DicoEntite) */ public void dicoParamsEntiteAdded(DicoParams _cas, DicoEntite _ent) { *************** *** 74,89 **** changed(); } /** ! * */ public void dicoParamsEntiteUpdated( ! DicoParams _cas, ! DicoEntite _ent, ! String _oldValue) { super.dicoParamsEntiteUpdated(_cas, _ent, _oldValue); changed(); } /** ! * */ public void bcPointsNormalChanged() { --- 87,105 ---- changed(); } + + /** ! * @see org.fudaa.dodico.dico.DicoParamsListener#dicoParamsEntiteUpdated(org.fudaa.dodico.dico.DicoParams, org.fudaa.dodico.dico.DicoEntite, java.lang.String) */ public void dicoParamsEntiteUpdated( ! DicoParams _cas, ! DicoEntite _ent, ! String _oldValue) { super.dicoParamsEntiteUpdated(_cas, _ent, _oldValue); changed(); } + /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxBcListener#bcPointsNormalChanged() */ public void bcPointsNormalChanged() { *************** *** 91,105 **** changed(); } /** ! * */ public void elementPropertyChanged( ! H2dRefluxElementPropertyMngAbstract source, ! H2dVariableType _v) { FudaaLib.info("CHANGE: ELEMENT PROPERTIES FOR " + _v.getNom()); changed(); } /** ! * */ public void timeStepChanged() { --- 107,124 ---- changed(); } + /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxElementPropertyMngListener#elementPropertyChanged(org.fudaa.dodico.h2d.reflux.H2dRefluxElementPropertyMngAbstract, ! * org.fudaa.dodico.h2d.type.H2dVariableType) */ public void elementPropertyChanged( ! H2dRefluxElementPropertyMngAbstract source, ! H2dVariableType _v) { FudaaLib.info("CHANGE: ELEMENT PROPERTIES FOR " + _v.getNom()); changed(); } + /** ! * * */ public void timeStepChanged() { *************** *** 109,113 **** /** ! * */ public void projectTypeChanged() { --- 128,132 ---- /** ! * * */ public void projectTypeChanged() { *************** *** 117,126 **** /** ! * */ public void evolutionUsedChanged(H2dEvolution _e, int _old, int _new) { ! if (CtuluLib.DEBUG) ! super.evolutionUsedChanged(_e, _old, _new); } } --- 136,152 ---- /** ! * @see org.fudaa.dodico.h2d.H2dEvolutionListener#evolutionUsedChanged(org.fudaa.dodico.h2d.H2dEvolution, ! * int, int) */ public void evolutionUsedChanged(H2dEvolution _e, int _old, int _new) { ! super.evolutionUsedChanged(_e, _old, _new); } + /** + * @see org.fudaa.dodico.h2d.reflux.H2dRefluxProjectDispatcherListener#InitSolutionsChanged() + */ + public void InitSolutionsChanged() { + FudaaLib.info("CHANGE: INITIAL SOLUTIONS"); + changed(); + } } Index: TrRefluxImplHelper.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxImplHelper.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TrRefluxImplHelper.java 12 Mar 2004 10:17:00 -0000 1.13 --- TrRefluxImplHelper.java 16 Mar 2004 16:47:12 -0000 1.14 *************** *** 142,146 **** mp.setMessage(TrResource.getS("Ouverture projet")); TrRefluxProjet projet = ! TrRefluxProjectFactory.createRefluxProject( _fic, INPFileFormat.getInstance().getLastINPVersionImpl(), --- 142,146 ---- mp.setMessage(TrResource.getS("Ouverture projet")); TrRefluxProjet projet = ! TrRefluxProjectFactory.createRefluxProjectFromINP( _fic, INPFileFormat.getInstance().getLastINPVersionImpl(), --- NEW FILE: TrRefluxSiMultiPlan.java --- /* * @file TrRefluxSiMultiPlan.java * @creation 16 mars 2004 * @modification $Date: 2004/03/16 16:47:11 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.fudaa.tr.reflux; import java.io.IOException; import org.fudaa.dodico.commun.DodicoAnalyze; import org.fudaa.fudaa.tr.TrXmlProjectWriter; import org.fudaa.fudaa.tr.reflux.TrRefluxSI.SiXmlListener; /** * @author Fred Deniger * @version $Id: TrRefluxSiMultiPlan.java,v 1.1 2004/03/16 16:47:11 deniger Exp $ */ public class TrRefluxSiMultiPlan extends TrRefluxSI { /** * */ public TrRefluxSiMultiPlan() { super(); } /** * @see org.fudaa.fudaa.tr.reflux.TrRefluxSI#isMultiPlan() */ public final boolean isMultiPlan() { return true; } /** * @see org.fudaa.fudaa.tr.reflux.TrRefluxSI#isDefined() */ public boolean isDefined() { return false; } /** * @see org.fudaa.fudaa.tr.reflux.TrRefluxSI#writeXmlSub(org.fudaa.fudaa.tr.TrXmlProjectWriter, org.fudaa.dodico.commun.DodicoAnalyze) */ public void writeXmlSub(TrXmlProjectWriter _out, DodicoAnalyze _a) throws IOException { } /** * @see org.fudaa.fudaa.tr.reflux.TrRefluxSI#createXmlListener() */ public SiXmlListener createXmlListener() { return null; } } --- NEW FILE: TrRefluxSIPlan.java --- /* * @file TrRefluxSIPlan.java * @creation 15 mars 2004 * @modification $Date: 2004/03/16 16:47:12 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.fudaa.tr.reflux; import java.io.IOException; import java.util.StringTokenizer; import com.memoire.xml.XmlListener; import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.commun.DodicoAnalyze; import org.fudaa.dodico.ef.EfNode; import org.fudaa.fudaa.tr.TrResource; import org.fudaa.fudaa.tr.TrXmlProjectWriter; /** * @author Fred Deniger * @version $Id: TrRefluxSIPlan.java,v 1.1 2004/03/16 16:47:12 deniger Exp $ */ public class TrRefluxSIPlan extends TrRefluxSI { private class planXmlListener implements TrRefluxSI.SiXmlListener{ boolean error_; int idxNode_=0; XmlListener l_; EfNode[] nodes_=new EfNode[3]; /** * @see com.memoire.xml.XmlListener#attribute(java.lang.String, java.lang.String) */ public void attribute(String _name, String _value) { } /** * @see com.memoire.xml.XmlListener#endElement(java.lang.String) */ public void endElement(String _tag) { if("node".equals(_tag)) idxNode_++; } /** * @see com.memoire.xml.XmlListener#error(java.lang.String) */ public void error(String _message) { if(l_!=null) l_.error(_message); } /** * @see org.fudaa.fudaa.tr.reflux.TrRefluxSI.SiXmlListener#initSi() */ public void initSi() { if(isValide()==null) TrRefluxSIPlan.this.setPt(nodes_[0],nodes_[1],nodes_[2]); } /** * @see org.fudaa.fudaa.tr.reflux.TrRefluxSI.SiXmlListener#isValide() */ public String isValide() { if( (idxNode_!=3) || (nodes_[0]==null) || (nodes_[1]==null) || (nodes_[2]==null)){ return TrResource.getS("Le nombre de noeuds doit être égal à 3"); } return null; } /** * @see com.memoire.xml.XmlListener#location(java.lang.String, int, int) */ public void location(String _origin, int _lineno, int _charno) { } /** * @see org.fudaa.fudaa.tr.reflux.TrRefluxSI.SiXmlListener#setParentListener(com.memoire.xml.XmlListener) */ public void setParentListener(XmlListener _l) { l_=_l; } /** * @see com.memoire.xml.XmlListener#startElement(java.lang.String) */ public void startElement(String _tag) { if(!"node".equals(_tag)){ error(TrResource.getS("Element inconnu")+CtuluLib.ESPACE+_tag); error_=true; } else error_=false; } /** * @see com.memoire.xml.XmlListener#text(java.lang.String) */ public void text(String _data) { if(error_) return; if(idxNode_>2) return; StringTokenizer tk=new StringTokenizer(_data.trim(),CtuluLib.ESPACE); try{ double x=Double.parseDouble(tk.nextToken()); double y=Double.parseDouble(tk.nextToken()); double z=Double.parseDouble(tk.nextToken()); nodes_[idxNode_]=new EfNode(x,y,z); } catch(NumberFormatException f){ error(f.getMessage()); f.printStackTrace(); } catch(NullPointerException e){ e.printStackTrace(); } } } EfNode n1_; EfNode n2_; EfNode n3_; /** * */ public TrRefluxSIPlan() { super(); } public TrRefluxSI.SiXmlListener createXmlListener(){ return new planXmlListener(); } /** * @see org.fudaa.fudaa.tr.reflux.TrRefluxSI#isDefined() */ public final boolean isDefined() { return n1_ != null; } /** * @see org.fudaa.fudaa.tr.reflux.TrRefluxSI#isMultiPlan() */ public final boolean isMultiPlan() { return false; } /** * @param _n1 * @param _n2 * @param _n3 */ public void setPt(EfNode _n1,EfNode _n2,EfNode _n3){ n1_=_n1; n2_=_n2; n3_=_n3; } /** * @see java.lang.Object#toString() */ public String toString() { return n1_.toString()+CtuluLib.ESPACE+n2_.toString()+CtuluLib.ESPACE+n3_.toString(); } /** * @see org.fudaa.fudaa.tr.reflux.TrRefluxSI#writeXmlSub(org.fudaa.fudaa.tr.TrXmlProjectWriter, * org.fudaa.dodico.commun.DodicoAnalyze) */ public void writeXmlSub(TrXmlProjectWriter _out, DodicoAnalyze _a) throws IOException { printNode(n1_, _out); printNode(n2_, _out); printNode(n3_, _out); } } Index: TrRefluxParametres.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/reflux/TrRefluxParametres.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TrRefluxParametres.java 10 Mar 2004 09:13:30 -0000 1.18 --- TrRefluxParametres.java 16 Mar 2004 16:47:12 -0000 1.19 *************** *** 170,173 **** --- 170,174 ---- File fINP_; H2dRefluxParameters params_; + private TrRefluxSI solutionInit_; String title_; *************** *** 179,182 **** --- 180,197 ---- super(); } + + /** + * @return les solutions initiales + */ + public TrRefluxSI getSI(){ + return solutionInit_; + } + + /** + * @return le nom du fichier sans extension + */ + public String getFicNameSansExt(){ + return DodicoLib.getSansExtension(fINP_.getName()); + } private boolean _save(File _f, ProgressionInterface _prog, boolean _ask) { File dir= _f.getAbsoluteFile().getParentFile(); *************** *** 306,314 **** return params_; } public INPFileFormat.INPVersion getINPVersion() { return (INPFileFormat.INPVersion)params_.getVersion(); } /** ! * */ public EfGrid getMaillage() { --- 321,333 ---- return params_; } + /** + * @return la version utilisee + */ public INPFileFormat.INPVersion getINPVersion() { return (INPFileFormat.INPVersion)params_.getVersion(); } + /** ! * @return le maillage */ public EfGrid getMaillage() { *************** *** 326,338 **** return title_; } public FudaaUI getUI() { return ui_; } /** ! * */ public boolean isGeometrieLoaded() { return true; } public boolean isModified() { return params_.isModified(); --- 345,363 ---- return title_; } + /** + * @return l'ui (TrImplementation) + */ public FudaaUI getUI() { return ui_; } /** ! * @return true */ public boolean isGeometrieLoaded() { return true; } + /** + * @return true si modifie + */ public boolean isModified() { return params_.isModified(); *************** *** 390,395 **** FudaaLib.info("save project in " + fINP_.getAbsolutePath()); params_.clearModified(); ! }; } public void saveCopy(ProgressionInterface _prog) { final File fic= --- 415,423 ---- FudaaLib.info("save project in " + fINP_.getAbsolutePath()); params_.clearModified(); ! } } + /** + * @param _prog la barre de progression + */ public void saveCopy(ProgressionInterface _prog) { final File fic= *************** *** 404,406 **** --- 432,448 ---- } + /** + * @return Returns the solutionInit. + */ + public TrRefluxSI getSolutionInit() { + return solutionInit_; + } + + /** + * @param _solutionInit The solutionInit to set. + */ + public void setSolutionInit(TrRefluxSI _solutionInit) { + solutionInit_ = _solutionInit; + } + } |
From: Frederic D. <de...@us...> - 2004-03-16 16:56:36
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12726/src/org/fudaa/fudaa/tr Modified Files: TrLib.java tr_en.fr_txt Added Files: TrXmlProjectWriter.java TrXmlProjectReader.java Log Message: Maj pour les conditions initiales --- NEW FILE: TrXmlProjectWriter.java --- /* * @file TrXmlProject.java * @creation 15 mars 2004 * @modification $Date: 2004/03/16 16:47:12 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.fudaa.tr; import java.io.IOException; import java.io.Writer; import com.memoire.bu.BuInformationsDocument; import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.commun.DodicoAnalyze; /** * @author Fred Deniger * @version $Id: TrXmlProjectWriter.java,v 1.1 2004/03/16 16:47:12 deniger Exp $ */ public abstract class TrXmlProjectWriter { String enconding_; protected Writer out_; String lineSep_; protected DodicoAnalyze a_; /** * */ public TrXmlProjectWriter() { lineSep_ = CtuluLib.LINE_SEP; enconding_ = System.getProperty("file.encoding"); if (enconding_ == null) { if (CtuluLib.isFrenchLanguageSelected()) enconding_ = "ISO-8859-1"; else enconding_ = "UTF-8"; } } /** * @return le projet en question */ public abstract TrProjet getProjet(); /** * Ecriture du fichier */ public final void write() { a_ = new DodicoAnalyze(); try { out_.write("<project>"); writeDocInfo(getProjet().getInformationsDocument()); writeData(); out_.write("</project>"); } catch (IOException e) { a_.manageException(e); } } /** * Ecrit les donnees specifiques du projet * * @throws IOException */ public void writeData() throws IOException {} /** * @param _doc la doc * @throws IOException */ protected final void writeDocInfo(BuInformationsDocument _doc) throws IOException { out_.write("<doc>"); write("author", _doc.author); write("date", _doc.date); write("version", _doc.version); write("location", _doc.location); write("comment", _doc.comment); out_.write("</doc>"); } protected void write(String _xmlTag, String _n) throws IOException { if ((_n != null) && (_n.length() > 0)) out_.write("<" + _xmlTag + ">" + _n + "</" + _xmlTag + ">" + lineSep_); } /** * @param _l la ligne a ecrire * @throws IOException */ public void writeln(String _l) throws IOException { out_.write(_l + lineSep_); } } Index: tr_en.fr_txt =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/tr_en.fr_txt,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tr_en.fr_txt 12 Mar 2004 10:17:01 -0000 1.15 --- tr_en.fr_txt 16 Mar 2004 16:47:12 -0000 1.16 *************** *** 190,192 **** Importer des courbes depuis fichier csv=Import curves from a csv file Noeuds frontières=Frontier nodes ! Créer projet Telemac=Create a telemac project \ No newline at end of file --- 190,194 ---- Importer des courbes depuis fichier csv=Import curves from a csv file Noeuds frontières=Frontier nodes ! Créer projet Telemac=Create a telemac project ! Le fichier xml des solutions initiales est invalide=The xml file describing the initial solutions is not valid ! Element inconnu=Unknown element \ No newline at end of file Index: TrLib.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/tr/TrLib.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TrLib.java 21 Jan 2004 11:07:28 -0000 1.8 --- TrLib.java 16 Mar 2004 16:47:12 -0000 1.9 *************** *** 12,21 **** import java.awt.Point; import java.beans.PropertyVetoException; import javax.swing.JFrame; import javax.swing.JInternalFrame; - import javax.swing.SwingUtilities; import com.memoire.bu.BuCommonImplementation; import com.memoire.bu.BuInternalFrame; import com.memoire.bu.BuPreferences; --- 12,22 ---- import java.awt.Point; import java.beans.PropertyVetoException; + import java.io.OutputStream; import javax.swing.JFrame; import javax.swing.JInternalFrame; import com.memoire.bu.BuCommonImplementation; + import com.memoire.bu.BuInformationsDocument; import com.memoire.bu.BuInternalFrame; import com.memoire.bu.BuPreferences; *************** *** 102,105 **** --- 103,107 ---- TrPreferences.TR.putIntegerProperty("window.h", _frame.getHeight()); } + } --- NEW FILE: TrXmlProjectReader.java --- /* * @file TrXmlProjectReader.java * @creation 16 mars 2004 * @modification $Date: 2004/03/16 16:47:12 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.fudaa.tr; import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.Map; import com.memoire.bu.BuInformationsDocument; import com.memoire.xml.XmlListener; import com.memoire.xml.XmlParser; import org.fudaa.fudaa.commun.FudaaUI; /** * @author Fred Deniger * @version $Id: TrXmlProjectReader.java,v 1.1 2004/03/16 16:47:12 deniger Exp $ */ public class TrXmlProjectReader implements XmlListener{ /** * Reader pour la documentation */ public class DocXmlReader implements XmlListener{ private final int author_=1; private final int date_=author_+1; private final int comment_=date_+1; int data_; /** * @see com.memoire.xml.XmlListener#attribute(java.lang.String, java.lang.String) */ public void attribute(String _name, String _value) { } /** * @see com.memoire.xml.XmlListener#endElement(java.lang.String) */ public void endElement(String _tag) { data_=-1; } /** * @see com.memoire.xml.XmlListener#error(java.lang.String) */ public void error(String _message) { TrXmlProjectReader.this.error(_message); } /** * @see com.memoire.xml.XmlListener#location(java.lang.String, int, int) */ public void location(String _origin, int _lineno, int _charno) { } /** * @see com.memoire.xml.XmlListener#startElement(java.lang.String) */ public void startElement(String _tag) { if(_tag.equals("doc")){ doc_=new BuInformationsDocument(); } else if("author".equals(_tag)){ this.data_=author_; } else if("date".equals(_tag)){ this.data_=date_; } else if("comment".equals(_tag)){ this.data_=comment_; } } /** * @see com.memoire.xml.XmlListener#text(java.lang.String) */ public void text(String _data) { if(data_>=0){ if(data_==author_){ doc_.author=_data; } else if(data_==date_){ doc_.date=_data; } else if(data_==comment_){ doc_.comment=_data; } } else error(_data); } } protected XmlListener currentListener_; protected String currentNode_; protected BuInformationsDocument doc_; protected Map elementListener_; File f_; protected boolean isProjectStart_; protected FudaaUI ui_; /** * @param _f le fichier a lire */ public TrXmlProjectReader(File _f) { f_=_f; elementListener_=new HashMap(5); } protected void initListener(){ elementListener_.put("doc",new DocXmlReader()); } /** * @see com.memoire.xml.XmlListener#attribute(java.lang.String, java.lang.String) */ public void attribute(String _name, String _value) { if(currentListener_!=null){ currentListener_.attribute(_name,_value); } } /** * @see com.memoire.xml.XmlListener#endElement(java.lang.String) */ public void endElement(String _tag) { if(_tag.equals(currentNode_)){ currentListener_.endElement(_tag); currentListener_=null; } else if(currentListener_!=null){ currentListener_.endElement(_tag); } else if("project".equals(_tag)){ System.out.println("fin"); } else{ error("doc invalide"); } } /** * @see com.memoire.xml.XmlListener#error(java.lang.String) */ public void error(String _message) { ui_.error(_message); } /** * @see com.memoire.xml.XmlListener#location(java.lang.String, int, int) */ public void location(String _origin, int _lineno, int _charno) { if(currentListener_!=null){ currentListener_.location(_origin,_lineno,_charno); } } /** * @throws IOException */ public void read() throws IOException{ XmlParser parser=new XmlParser(f_,XmlParser.XML); initListener(); parser.setXmlListener(this); parser.parse(); } /** * @see com.memoire.xml.XmlListener#startElement(java.lang.String) */ public void startElement(String _tag) { if(!isProjectStart_ && (_tag.equals("project"))){ isProjectStart_=true; } else if(currentListener_!=null){ currentListener_.startElement(_tag); } else{ currentListener_=(XmlListener)elementListener_.get(_tag); currentNode_=_tag; if(currentListener_==null) error("tag non connu"); else currentListener_.startElement(_tag); } } /** * @see com.memoire.xml.XmlListener#text(java.lang.String) */ public void text(String _data) { if(currentListener_!=null) currentListener_.text(_data); } /** * @return Returns the doc. */ public BuInformationsDocument getDoc() { return doc_; } } |
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11661/src/org/fudaa/dodico/h2d/reflux Modified Files: H2dRefluxBcListener.java Added Files: H2dRefluxSolutionInitialeInterface.java H2dRefluxSICourant2D.java Log Message: Support solutions initiales --- NEW FILE: H2dRefluxSolutionInitialeInterface.java --- /* * @file H2dRefluxSolutionInitialeInterface.java * @creation 12 mars 2004 * @modification $Date: 2004/03/15 08:27:58 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.dodico.h2d.reflux; import org.fudaa.dodico.h2d.type.H2dVariableType; /** * @author Fred Deniger * @version $id$ * */ public interface H2dRefluxSolutionInitialeInterface { /** * A utiliser pour verifier la coherence * @return le nombre de points enregistre dans cette interface */ public int getNbPoint(); /** * @param _t la variable a tester * @return true si des solutions initiales existent pour cette variable */ public boolean isValideVariable(H2dVariableType _t); /** * @param _t la variable * @param _idx l'index du point * @return la solution initiale demandee */ public double getSolutionInitiale(H2dVariableType _t,int _idx); } --- NEW FILE: H2dRefluxSICourant2D.java --- /* * @file H2dRefluxSICourant2D.java * @creation 12 mars 2004 * @modification $Date: 2004/03/15 08:27:58 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.dodico.h2d.reflux; import org.fudaa.dodico.h2d.type.H2dVariableType; /** * @author Fred Deniger * @version $id$ * */ public class H2dRefluxSICourant2D implements H2dRefluxSolutionInitialeInterface { double[] u_; double[] v_; double[] h_; /** * */ public H2dRefluxSICourant2D() { super(); } /** * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#getNbPoint() */ public int getNbPoint() { return 0; } /** * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#isValideVariable(org.fudaa.dodico.h2d.type.H2dVariableType) */ public boolean isValideVariable(H2dVariableType _t) { return (_t==H2dVariableType.VITESSE_U) || (_t==H2dVariableType.VITESSE_V) || (_t==H2dVariableType.COTE_EAU); } /** * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#getSolutionInitiale(org.fudaa.dodico.h2d.type.H2dVariableType, int) */ public double getSolutionInitiale(H2dVariableType _t, int _idx) { if(_t==H2dVariableType.VITESSE_U) return u_[_idx]; else if(_t==H2dVariableType.VITESSE_V){ return v_[_idx]; } else if(_t==H2dVariableType.COTE_EAU){ return h_[_idx]; } new Throwable().printStackTrace(); return 0d; } /** * @param _idx index du point * @return solution initiale pour u */ public double getSIForU(int _idx){ return u_[_idx]; } /** * @param _idx * @return solution initiale pour v */ public double getSIForV(int _idx){ return v_[_idx]; } /** * @param _idx * @return solution initiale pour h */ public double getSIForH(int _idx){ return h_[_idx]; } } Index: H2dRefluxBcListener.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux/H2dRefluxBcListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** H2dRefluxBcListener.java 25 Nov 2003 10:11:36 -0000 1.2 --- H2dRefluxBcListener.java 15 Mar 2004 08:27:58 -0000 1.3 *************** *** 9,13 **** package org.fudaa.dodico.h2d.reflux; import org.fudaa.dodico.h2d.H2dBcListener; - import org.fudaa.dodico.h2d.type.H2dVariableType; /** * @author deniger --- 9,12 ---- *************** *** 15,18 **** --- 14,20 ---- */ public interface H2dRefluxBcListener extends H2dBcListener { + /** + * Methode appelee lorsque une normale a ete changee + */ public void bcPointsNormalChanged(); } |
From: <de...@us...> - 2004-03-15 08:37:24
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11661/src/org/fudaa/dodico/h2d Modified Files: h2d_en.fr_txt Log Message: Support solutions initiales Index: h2d_en.fr_txt =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/h2d_en.fr_txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** h2d_en.fr_txt 12 Feb 2004 15:32:45 -0000 1.11 --- h2d_en.fr_txt 15 Mar 2004 08:28:00 -0000 1.12 *************** *** 226,228 **** Vide=Empty Courbes temporelles=Time curves ! Les courbes suivantes ne contiennent pas les bornes de la simulation=The following curves don't contain the bounds of the simulation \ No newline at end of file --- 226,229 ---- Vide=Empty Courbes temporelles=Time curves ! Les courbes suivantes ne contiennent pas les bornes de la simulation=The following curves don't contain the bounds of the simulation ! Le nombre de noeuds annoncé par le fichier dat est incorrect=The "dat" contains a wrong number of nodes \ No newline at end of file |
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11661/src/org/fudaa/dodico/reflux/io Modified Files: INPFileFormat.java Added Files: RefluxSolutionFileFormat.java RefluxSolutionAdapter.java RefluxSolutionReader.java Log Message: Support solutions initiales --- NEW FILE: RefluxSolutionFileFormat.java --- /* * @file RefluxSIFileFormat.java * @creation 12 mars 2004 * @modification $Date: 2004/03/15 08:27:59 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.dodico.reflux.io; import org.fudaa.dodico.fichiers.FileFormat; import org.fudaa.dodico.fichiers.FileFormatVersion; import org.fudaa.dodico.fichiers.FileReadOperationAbstract; import org.fudaa.dodico.fichiers.FileWriteOperationAbstract; /** * @author Fred Deniger * @version $Id: RefluxSolutionFileFormat.java,v 1.1 2004/03/15 08:27:59 deniger Exp $ */ public class RefluxSolutionFileFormat extends FileFormat { public class RefluxSIVersion extends FileFormatVersion { /** * */ public RefluxSIVersion() { super(RefluxSolutionFileFormat.this, "1.0"); } /** * @return le contenu de la premiere ligne */ public int getFirstLine(){ return -999; } /** * @return la largeur de la premier colonne des donnees */ public int getFirstDataColLength(){ return 5; } /** * @return la largeur des colonnes des donnees */ public int getDataColLength(){ return 12; } /** * @return le format pour la ligne donnant le nombre de variable par point */ public int[] getNbVariableFormat(){ return new int[] {5,5}; } /** * @return le format pour la ligne donnant les donnees sur l'etape */ public int[] getEtapeFormat(){ return new int[] {19,5,20,5,18,12}; } /** * @see org.fudaa.dodico.fichiers.FileFormatVersion#createReader() */ public FileReadOperationAbstract createReader() { return new RefluxSolutionReader(this); } /** * @see org.fudaa.dodico.fichiers.FileFormatVersion#createWriter() */ public FileWriteOperationAbstract createWriter() { return null; } } private static RefluxSolutionFileFormat INSTANCE = new RefluxSolutionFileFormat(); /** * @return singleton */ public static RefluxSolutionFileFormat getInstance() { return INSTANCE; } /** * Constructeur prive */ private RefluxSolutionFileFormat() { super(1); extensions_ = new String[] { "siv"}; } /** * @see org.fudaa.dodico.fichiers.FileFormat#getLastVersion() */ public String getLastVersion() { return "1.0"; } /** * @see org.fudaa.dodico.fichiers.FileFormat#getLastVersionInstance() */ public FileFormatVersion getLastVersionInstance() { return new RefluxSIVersion(); } } --- NEW FILE: RefluxSolutionAdapter.java --- /* * @file RefluxSIAdapter.java * @creation 12 mars 2004 * @modification $Date: 2004/03/15 08:27:59 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.dodico.reflux.io; import org.fudaa.dodico.h2d.type.H2dProjetType; /** * @author Fred Deniger * @version $Id: RefluxSolutionAdapter.java,v 1.1 2004/03/15 08:27:59 deniger Exp $ */ public class RefluxSolutionAdapter { SIByTime[] times_; H2dProjetType type_; /** * */ public RefluxSolutionAdapter() { super(); } /** * @param _projetTypeId l'id du type de projet * @see H2dProjetType */ public void setTypeProjet(int _projetTypeId){ type_=(H2dProjetType)H2dProjetType.getIdInList(H2dProjetType.LIST,_projetTypeId); } /** * @return le type de projet */ public H2dProjetType getProjetType(){ return type_; } public static class SIByTime{ private double t_; private double[][] values_; /** * @param _t * @param _values */ public SIByTime(double _t,double[][] _values){ values_=_values; t_=_t; } /** * @return le nombre de valeurs */ public int getNbValues(){ return values_.length; } /** * @return le nombre de points */ public int getNbPt(){ return values_[0].length; } /** * @param _idxValues l'index de la valeur voulu * @param _idxPoint l'index du point * @return */ public double getValues(int _idxValues,int _idxPoint){ return values_[_idxValues][_idxPoint]; } /** * @return Returns the values. */ public double[][] getValues() { return values_; } /** * @param _values The values to set. */ public void setValues(double[][] _values) { values_ = _values; } } /** * @return Returns the times. */ public SIByTime[] getTimes() { return times_; } /** * @param _times The times to set. */ public void setTimes(SIByTime[] _times) { times_ = _times; } } --- NEW FILE: RefluxSolutionReader.java --- /* * @file ReflusSIReader.java * @creation 12 mars 2004 * @modification $Date: 2004/03/15 08:27:59 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.dodico.reflux.io; import gnu.trove.TDoubleArrayList; import java.io.EOFException; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import java.util.Properties; import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.commun.DodicoResource; import org.fudaa.dodico.fichiers.FileOpReadCharSimpleAbstract; import org.fudaa.dodico.h2d.H2dResource; /** * @author Fred Deniger * @version $Id: RefluxSolutionReader.java,v 1.1 2004/03/15 08:27:59 deniger Exp $ */ public class RefluxSolutionReader extends FileOpReadCharSimpleAbstract { File f_; RefluxSolutionFileFormat.RefluxSIVersion version_; boolean readOnlyLastStep_; /** * @param _ft la version utilisee */ public RefluxSolutionReader(RefluxSolutionFileFormat.RefluxSIVersion _ft) { version_ = _ft; } /** * @see org.fudaa.dodico.fichiers.FileReadOperationAbstract#_read() */ protected Object _read() { return readSI(); } protected RefluxSolutionAdapter readSI() { RefluxSolutionAdapter r = null; if ((f_ == null) || (in_ == null)) { analyze_.addFatalError(H2dResource.getS("Le flux est null")); return null; } File parent = f_.getParentFile(); File dat = new File(parent, DodicoLib.getSansExtension(f_.getName()) + ".dat"); int nbNds = -1; r = new RefluxSolutionAdapter(); if (dat.exists()) { Properties prs = new Properties(); try { FileInputStream readDat = new FileInputStream(dat); prs.load(readDat); readDat.close(); } catch (FileNotFoundException e) { analyze_.manageException(e); } catch (IOException e) { analyze_.manageException(e); } nbNds = Integer.parseInt(prs.getProperty("nbNoeuds", "-1")); r.setTypeProjet(Integer.parseInt(prs.getProperty("tpProbleme", "0"))); } try { in_.setBlankZero(true); String s = in_.readLine().trim(); int delim=version_.getFirstLine(); if (Integer.parseInt(s)!=delim) { analyze_.addFatalError(DodicoResource.getS("Format du champ incorrect"), 1); return null; } int[] fmtEtape = version_.getEtapeFormat(); in_.readFields(fmtEtape); RefluxSolutionAdapter.SIByTime first = new RefluxSolutionAdapter.SIByTime(in_.doubleField(5), null); in_.readFields(version_.getNbVariableFormat()); int nbVar = in_.intField(1); if(nbVar<=0){ analyze_.addFatalError(DodicoResource.getS("Format du champ incorrect"), in_); return null; } int[] dataFmt=new int[nbVar+1]; dataFmt[0]=version_.getFirstDataColLength(); int temp=version_.getDataColLength(); for(int i=1;i<dataFmt.length;i++){ dataFmt[i]=temp; } int nbNodeRead=0; //on détermine le nombre de noeuds TDoubleArrayList[] ls=new TDoubleArrayList[nbVar]; for(int i=nbVar-1;i>=0;i--){ ls[i]=new TDoubleArrayList(500); } in_.readFields(dataFmt); while(in_.intField(0)!=delim){ for(int i=nbVar-1;i>=0;i--){ ls[i].add(in_.doubleField(i+1)); } nbNodeRead++; in_.readFields(dataFmt); } ArrayList etape=new ArrayList(500); if((nbNds>0) && (nbNodeRead!=nbNds)){ analyze_.addWarn(H2dResource.getS("Le nombre de noeuds annoncé par le fichier dat est incorrect"),-1); } double[][] step=new double[nbVar][nbNodeRead]; for(int i=nbVar-1;i>=0;i--){ step[i]=ls[i].toNativeArray(); } first.setValues(step); etape.add(first); RefluxSolutionAdapter.SIByTime[] rf=new RefluxSolutionAdapter.SIByTime[etape.size()]; etape.toArray(rf); r.setTimes(rf); return r; } catch (EOFException e) { if (CtuluLib.DEBUG) CtuluLib.debug(f_.getAbsolutePath() + " end of file"); } catch (IllegalArgumentException e) { analyze_.manageException(e); return null; } catch (IOException e) { analyze_.manageException(e); } return r; } /** * @see org.fudaa.dodico.fichiers.FileOpReadCharSimpleAbstract#processFile(java.io.File) */ protected void processFile(File _f) { f_ = _f; } } Index: INPFileFormat.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/INPFileFormat.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** INPFileFormat.java 12 Feb 2004 15:32:47 -0000 1.15 --- INPFileFormat.java 15 Mar 2004 08:27:58 -0000 1.16 *************** *** 22,28 **** import org.fudaa.dodico.dico.DicoEntiteList; import org.fudaa.dodico.dico.DicoLanguage; - import org.fudaa.dodico.ef.EfGrid; import org.fudaa.dodico.ef.EfGridSource; - import org.fudaa.dodico.ef.EfLib; import org.fudaa.dodico.ef.FileFormatGridVersion; import org.fudaa.dodico.fichiers.FileFormatSoftware; --- 22,26 ---- |
From: <de...@us...> - 2004-03-15 08:37:10
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11661/src/org/fudaa/dodico/test/reflux Added Files: TestJSolution.java canal_t.sov Log Message: Support solutions initiales --- NEW FILE: TestJSolution.java --- /* * @file TestJSolution.java * @creation 12 mars 2004 * @modification $Date: 2004/03/15 08:28:00 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.dodico.test.reflux; import org.fudaa.dodico.fichiers.FileOperationSynthese; import org.fudaa.dodico.reflux.io.RefluxSolutionAdapter; import org.fudaa.dodico.reflux.io.RefluxSolutionFileFormat; import org.fudaa.dodico.test.TestIO; /** * @author Fred Deniger * @version $Id: TestJSolution.java,v 1.1 2004/03/15 08:28:00 deniger Exp $ * @see org.fudaa.dodico.reflux.io.RefluxSolutionReader */ public class TestJSolution extends TestIO { public TestJSolution() { super("canal_t.sov"); } /** * @see org.fudaa.dodico.test.TestIO#testLecture() */ public void testLecture() { FileOperationSynthese op=RefluxSolutionFileFormat.getInstance().getLastVersionInstance().read(super.fic_,null); if(op.containsFatalError()) op.getAnalyze().printResume(); assertFalse(op.containsFatalError()); RefluxSolutionAdapter ad=(RefluxSolutionAdapter)op.getSource(); RefluxSolutionAdapter.SIByTime f=ad.getTimes()[0]; assertEquals(1791,f.getNbPt()); assertEquals(9,f.getNbValues()); assertEquals(0.14818E+02,f.getValues(2,110),eps_); } /** * @see org.fudaa.dodico.test.TestIO#testEcriture() */ public void testEcriture() { } } --- NEW FILE: canal_t.sov --- -999 ===== PAS NUMERO : 1 ITERATION 'NUMERO : 3 TEMPS 0.36000E+04 -1 9 1 0.00000E+00 0.00000E+00 0.15000E+02 0.20716E+01-0.25369E-15 0.00000E+00 0.16325E+02 0.13250E+01 0 2 0.00000E+00 0.12500E+01 0.15000E+02 0.20716E+01-0.25369E-15 0.00000E+00 0.16325E+02 0.13250E+01 0 3 0.00000E+00 0.25000E+01 0.15000E+02 0.20716E+01-0.25369E-15 0.00000E+00 0.16325E+02 0.13250E+01 0 4 0.00000E+00 0.37500E+01 0.15000E+02 0.20716E+01-0.25369E-15 0.00000E+00 0.16325E+02 0.13250E+01 0 5 0.00000E+00 0.50000E+01 0.15000E+02 0.20716E+01-0.25369E-15 0.00000E+00 0.16325E+02 0.13250E+01 0 6 0.00000E+00 0.62500E+01 0.15000E+02 0.20716E+01-0.25369E-15 0.00000E+00 0.16325E+02 0.13250E+01 0 7 0.00000E+00 0.75000E+01 0.15000E+02 0.20716E+01-0.25368E-15 0.00000E+00 0.16325E+02 0.13250E+01 0 8 0.00000E+00 0.87500E+01 0.15000E+02 0.20716E+01-0.25369E-15 0.00000E+00 0.16325E+02 0.13250E+01 0 9 0.00000E+00 0.10000E+02 0.15000E+02 0.20716E+01-0.25368E-15 0.00000E+00 0.16325E+02 0.13250E+01 0 10 0.50505E+01 0.00000E+00 0.14985E+02 0.20715E+01-0.38051E-15 0.00000E+00 0.16310E+02 0.13248E+01 0 11 0.50505E+01 0.12500E+01 0.14985E+02 0.20715E+01-0.96867E-06 0.00000E+00 0.16310E+02 0.13248E+01 0 12 0.50505E+01 0.25000E+01 0.14985E+02 0.20715E+01 0.27363E-05 0.00000E+00 0.16310E+02 0.13248E+01 0 13 0.50505E+01 0.37500E+01 0.14985E+02 0.20715E+01-0.15822E-05 0.00000E+00 0.16310E+02 0.13248E+01 0 14 0.50505E+01 0.50000E+01 0.14985E+02 0.20715E+01 0.28530E-05 0.00000E+00 0.16310E+02 0.13248E+01 0 15 0.50505E+01 0.62500E+01 0.14985E+02 0.20715E+01-0.18379E-05 0.00000E+00 0.16310E+02 0.13248E+01 0 16 0.50505E+01 0.75000E+01 0.14985E+02 0.20715E+01 0.23452E-05 0.00000E+00 0.16310E+02 0.13248E+01 0 [...28650 lines suppressed...] 1772 0.98990E+03 0.87500E+01 0.12030E+02 0.28821E+01-0.25381E-06 0.00000E+00 0.13401E+02 0.13710E+01 0 1773 0.98990E+03 0.10000E+02 0.12030E+02 0.28821E+01-0.17647E-15 0.00000E+00 0.13401E+02 0.13710E+01 0 1774 0.99495E+03 0.00000E+00 0.12015E+02 0.28827E+01-0.52952E-15 0.00000E+00 0.13386E+02 0.13710E+01 0 1775 0.99495E+03 0.12500E+01 0.12015E+02 0.28827E+01-0.11810E-05 0.00000E+00 0.13386E+02 0.13710E+01 0 1776 0.99495E+03 0.25000E+01 0.12015E+02 0.28827E+01-0.75648E-06 0.00000E+00 0.13386E+02 0.13710E+01 0 1777 0.99495E+03 0.37500E+01 0.12015E+02 0.28827E+01-0.15543E-05 0.00000E+00 0.13386E+02 0.13710E+01 0 1778 0.99495E+03 0.50000E+01 0.12015E+02 0.28827E+01-0.17004E-07 0.00000E+00 0.13386E+02 0.13710E+01 0 1779 0.99495E+03 0.62500E+01 0.12015E+02 0.28827E+01-0.94727E-07 0.00000E+00 0.13386E+02 0.13710E+01 0 1780 0.99495E+03 0.75000E+01 0.12015E+02 0.28827E+01-0.77629E-06 0.00000E+00 0.13386E+02 0.13710E+01 0 1781 0.99495E+03 0.87500E+01 0.12015E+02 0.28827E+01-0.13642E-05 0.00000E+00 0.13386E+02 0.13710E+01 0 1782 0.99495E+03 0.10000E+02 0.12015E+02 0.28828E+01-0.17651E-15 0.00000E+00 0.13386E+02 0.13710E+01 0 1783 0.10000E+04 0.00000E+00 0.12000E+02 0.28834E+01 0.00000E+00 0.00000E+00 0.13371E+02 0.13710E+01 0 1784 0.10000E+04 0.12500E+01 0.12000E+02 0.28835E+01 0.00000E+00 0.00000E+00 0.13371E+02 0.13710E+01 0 1785 0.10000E+04 0.25000E+01 0.12000E+02 0.28835E+01 0.00000E+00 0.00000E+00 0.13371E+02 0.13710E+01 0 1786 0.10000E+04 0.37500E+01 0.12000E+02 0.28835E+01 0.00000E+00 0.00000E+00 0.13371E+02 0.13710E+01 0 1787 0.10000E+04 0.50000E+01 0.12000E+02 0.28835E+01 0.00000E+00 0.00000E+00 0.13371E+02 0.13710E+01 0 1788 0.10000E+04 0.62500E+01 0.12000E+02 0.28835E+01 0.00000E+00 0.00000E+00 0.13371E+02 0.13710E+01 0 1789 0.10000E+04 0.75000E+01 0.12000E+02 0.28835E+01 0.00000E+00 0.00000E+00 0.13371E+02 0.13710E+01 0 1790 0.10000E+04 0.87500E+01 0.12000E+02 0.28835E+01 0.00000E+00 0.00000E+00 0.13371E+02 0.13710E+01 0 1791 0.10000E+04 0.10000E+02 0.12000E+02 0.28835E+01 0.00000E+00 0.00000E+00 0.13371E+02 0.13710E+01 0 |
From: <de...@us...> - 2004-03-15 08:37:10
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11661/src/org/fudaa/dodico/h2d/type Modified Files: H2dProjetType.java Log Message: Support solutions initiales Index: H2dProjetType.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type/H2dProjetType.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** H2dProjetType.java 12 Feb 2004 15:32:45 -0000 1.6 --- H2dProjetType.java 15 Mar 2004 08:28:01 -0000 1.7 *************** *** 21,28 **** public class H2dProjetType extends DodicoEnumType { public static final H2dProjetType COURANTOLOGIE_2D= ! new H2dProjetType(1, H2dResource.getS("Courantologie 2D"), "VIT_NU_CON"); public static final H2dProjetType COURANTOLOGIE_2D_LMG= new H2dProjetType( ! 2, H2dResource.getS("Courantologie 2D longueur mélange"), "VIT_NU_LMG"); --- 21,28 ---- public class H2dProjetType extends DodicoEnumType { public static final H2dProjetType COURANTOLOGIE_2D= ! new H2dProjetType(0, H2dResource.getS("Courantologie 2D"), "VIT_NU_CON"); public static final H2dProjetType COURANTOLOGIE_2D_LMG= new H2dProjetType( ! 1, H2dResource.getS("Courantologie 2D longueur mélange"), "VIT_NU_LMG"); |
From: <jm_...@us...> - 2004-03-12 20:07:12
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/idl/metier In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2934/metier Modified Files: hydraulique1d.idl Log Message: Index: hydraulique1d.idl =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/idl/metier/hydraulique1d.idl,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** hydraulique1d.idl 5 Mar 2004 15:03:24 -0000 1.13 --- hydraulique1d.idl 12 Mar 2004 19:47:25 -0000 1.14 *************** *** 917,921 **** attribute IParametresTailleMaxFichier paramTailleMaxFichier; attribute booleen postRubens; ! attribute booleen postOptyca; attribute reel decalage; attribute VIDescriptionVariable variables; --- 917,921 ---- attribute IParametresTailleMaxFichier paramTailleMaxFichier; attribute booleen postRubens; ! attribute booleen postOpthyca; attribute reel decalage; attribute VIDescriptionVariable variables; |
From: <jm_...@us...> - 2004-03-12 20:07:09
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/idl/code In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2934/code Modified Files: mascaret.idl Log Message: Index: mascaret.idl =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/idl/code/mascaret.idl,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** mascaret.idl 5 Mar 2004 15:03:24 -0000 1.12 --- mascaret.idl 12 Mar 2004 19:47:25 -0000 1.13 *************** *** 839,843 **** // attribute SResultatsOPT resultatsOPT; ! // Resultats temporel et spatial du calcul mascaret provenant d'un fichier Rubens ou Optyca attribute SResultatsTemporelSpatial resultatsTemporelSpatial; --- 839,843 ---- // attribute SResultatsOPT resultatsOPT; ! // Resultats temporel et spatial du calcul mascaret provenant d'un fichier Rubens ou Opthyca attribute SResultatsTemporelSpatial resultatsTemporelSpatial; |
From: <jm_...@us...> - 2004-03-12 20:01:06
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/mascaret In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1477 Modified Files: MascaretImplementation.java Log Message: Index: MascaretImplementation.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/mascaret/MascaretImplementation.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** MascaretImplementation.java 5 Mar 2004 15:03:25 -0000 1.16 --- MascaretImplementation.java 12 Mar 2004 19:41:23 -0000 1.17 *************** *** 989,994 **** if (arg == null) { BuFileFilter[] fileFilters = new BuFileFilter[3]; ! fileFilters[0] = new BuFileFilter("rub", "Résultat calcul au format rubens"); ! fileFilters[1] = new BuFileFilter("opt", "Résultat calcul au format optyca"); fileFilters[2] = new BuFileFilter("masc", "Etude Fudaa-Mascaret"); fichier = ouvrirFileChooser("Ouvrir", fileFilters, false); --- 989,996 ---- if (arg == null) { BuFileFilter[] fileFilters = new BuFileFilter[3]; ! String[] rubFilters = {"rub","cas_rub","liai_rub"}; ! String[] optFilters = {"opt","cas_opt","liai_opt"}; ! fileFilters[0] = new BuFileFilter(rubFilters, "Résultat calcul au format rubens"); ! fileFilters[1] = new BuFileFilter(optFilters, "Résultat calcul au format optyca"); fileFilters[2] = new BuFileFilter("masc", "Etude Fudaa-Mascaret"); fichier = ouvrirFileChooser("Ouvrir", fileFilters, false); *************** *** 1036,1042 **** } catch (FichierInvalideException ex) { ! System.out.println("Problème lecture Optyca "+ex.getLocalizedMessage()); ex.printStackTrace(); ! String message= "Problème lecture Optyca \n"+ex.getLocalizedMessage(); if (ex.getLigne() != null) { message+="\nA la ligne : "+ex.getLigne(); --- 1038,1044 ---- } catch (FichierInvalideException ex) { ! System.out.println("Problème lecture Opthyca "+ex.getLocalizedMessage()); ex.printStackTrace(); ! String message= "Problème lecture Opthyca \n"+ex.getLocalizedMessage(); if (ex.getLigne() != null) { message+="\nA la ligne : "+ex.getLigne(); *************** *** 1646,1648 **** }*/ } ! } \ No newline at end of file --- 1648,1650 ---- }*/ } ! } |
From: <jm_...@us...> - 2004-03-12 20:00:31
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/hydraulique1d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1325 Modified Files: Hydraulique1dExport.java Hydraulique1dExportPanneau.java Log Message: Index: Hydraulique1dExport.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/hydraulique1d/Hydraulique1dExport.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Hydraulique1dExport.java 5 Mar 2004 13:15:28 -0000 1.7 --- Hydraulique1dExport.java 12 Mar 2004 19:40:48 -0000 1.8 *************** *** 1,183 **** ! /* ! * @file Hydraulique1dExport.java ! * @creation 2001-04-26 ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 EDF/LNHE ! * @mail de...@fu... ! */ ! package org.fudaa.fudaa.hydraulique1d; ! import java.io.File; ! import java.io.IOException; ! import javax.swing.filechooser.FileFilter; ! import org.fudaa.dodico.corba.hydraulique1d.IBief; ! import org.fudaa.dodico.corba.hydraulique1d.ICasier; ! import org.fudaa.dodico.corba.hydraulique1d.IEtude1d; ! import org.fudaa.dodico.corba.hydraulique1d.ILoiHydraulique; ! import org.fudaa.dodico.corba.hydraulique1d.IParametresReprise; ! import org.fudaa.dodico.corba.hydraulique1d.IResultatsTemporelSpatial; ! import org.fudaa.dodico.mascaret.ConvH1D_Masc; ! import org.fudaa.dodico.mascaret.DParametresMascaret; ! import org.fudaa.dodico.mascaret.DResultatsMascaret; ! import com.memoire.bu.BuFileChooser; ! /** ! * @version $Revision$ $Date$ by $Author$ ! * @author Jean-Marc Lacombe ! */ ! public class Hydraulique1dExport { ! public static final void exportProfils_MASCARET( ! File filename, ! IBief[] biefs) { ! DParametresMascaret.ecritParametresGEO( ! filename, ! ConvH1D_Masc.convertirParametresGeo(biefs)); ! } ! public static final void exportGeometrie_CASIER( ! File filename, ! ICasier[] casiers) { ! if (casiers == null) ! return; ! boolean presenceCasier= (casiers.length > 0); ! if (presenceCasier) { ! DParametresMascaret.ecritCasierGEO( ! filename, ! ConvH1D_Masc.convertirParametresGeoCasiers(casiers)); ! } ! } ! public static final void exportReprise_MASCARET( ! File filename, ! IParametresReprise paramReprise) { ! if (paramReprise == null) ! return; ! if (paramReprise.contenu() == null) ! return; ! if (paramReprise.contenu().equals("")) ! return; ! DParametresMascaret.ecritParametresREP( ! filename, ! ConvH1D_Masc.convertirParametresRep(paramReprise)); ! } ! public static final void exportCas_MASCARET(File filename, IEtude1d etude) { ! String nomFichierSansExtension= filename.getAbsolutePath(); ! int indexe; ! if ((indexe= nomFichierSansExtension.lastIndexOf('.')) != -1) ! nomFichierSansExtension= nomFichierSansExtension.substring(0, indexe); ! DParametresMascaret.ecritParametresCAS( ! filename, ! ConvH1D_Masc.convertirParametresCas(etude, nomFichierSansExtension)); ! } ! public static final void exportLois_MASCARET(String nomBase, ILoiHydraulique[] loisPasGeo) { ! DParametresMascaret.ecritLoisHydrauliques( ! nomBase, ! false, ! ConvH1D_Masc.convertirLoisHydrauliques(loisPasGeo)); ! } ! public static final void exportListing_DAMOCLES( ! File filename, ! byte[] contenu) { ! try { ! if (contenu == null) ! return; ! DResultatsMascaret.ecritResultatsDAMOC( ! filename, ! ConvH1D_Masc.convertirResultatsLisDamocles(contenu)); ! } catch (IOException ex) { ! ex.printStackTrace(); ! } ! } ! public static final void exportListing(File filename, byte[] contenu) { ! try { ! if (contenu == null) ! return; ! DResultatsMascaret.ecritResultatsLIS( ! filename, ! ConvH1D_Masc.convertirResultatsLis(contenu)); ! } catch (IOException ex) { ! ex.printStackTrace(); ! } ! } ! public static final void exportRubens(File filename, IResultatsTemporelSpatial ires) { ! try { ! if (ires==null) return; ! DResultatsMascaret.ecritResultats(DResultatsMascaret.RUBENS, ! filename, ! ConvH1D_Masc.convertirResultatsTemporelSpatialH1dToMas(ires)); ! } catch (Exception ex) { ! ex.printStackTrace(); ! } ! } ! public static final void exportOpthyca(File filename, IEtude1d etude) { ! try { ! DResultatsMascaret.ecritResultatsOPT( ! filename, ! ConvH1D_Masc ! .convertirResultatsTemporelSpatial2ResultatsOpt( ! etude.resultatsGeneraux().resultatsTemporelSpatial())); ! } catch (Exception ex) { ! ex.printStackTrace(); ! } ! } ! public static final void exportOpthycaCasier(File filename, IEtude1d etude) { ! try { ! DResultatsMascaret.ecritResultatsOPT( ! filename, ! ConvH1D_Masc ! .convertirResultatsTemporelSpatial2ResultatsOpt( ! etude.resultatsGeneraux().resultatsTemporelCasier())); ! } catch (Exception ex) { ! ex.printStackTrace(); ! } ! } ! public static final void exportOpthycaLiaison( ! File filename, ! IEtude1d etude) { ! try { ! DResultatsMascaret.ecritResultatsOPT( ! filename, ! ConvH1D_Masc ! .convertirResultatsTemporelSpatial2ResultatsOpt( ! etude.resultatsGeneraux().resultatsTemporelLiaison())); ! } catch (Exception ex) { ! ex.printStackTrace(); ! } ! } ! public static final File chooseFile(String _ext) { ! final String ext= _ext; ! File res= null; ! BuFileChooser chooser= new BuFileChooser(); ! chooser.setFileFilter(new javax.swing.filechooser.FileFilter() { ! public boolean accept(java.io.File f) { ! return (ext == null) ! ? true ! : (f.getName().endsWith("." + ext) || f.isDirectory()); ! } ! public String getDescription() { ! return (ext == null) ! ? "*.*" ! : ("Fichiers " + ext.toUpperCase() + " (*." + ext + ")"); ! } ! }); ! chooser.setCurrentDirectory(Hydraulique1dResource.lastExportDir); ! int returnVal= chooser.showSaveDialog(Hydraulique1dBaseApplication.FRAME); ! String filename= null; ! if (returnVal == BuFileChooser.APPROVE_OPTION) { ! filename= chooser.getSelectedFile().getPath(); ! } ! if (filename == null) ! return null; ! int indexSlash= filename.lastIndexOf(java.io.File.separatorChar); ! res= new File(filename); ! if (indexSlash > 0) ! Hydraulique1dResource.lastExportDir= ! new java.io.File(filename.substring(0, indexSlash)); ! else ! Hydraulique1dResource.lastExportDir= chooser.getCurrentDirectory(); ! return res; ! } ! private static void my_perror(String msg) { ! System.err.println(msg); ! } ! private static void my_perror(Exception e) { ! e.printStackTrace(); ! } ! } --- 1,183 ---- ! /* ! * @file Hydraulique1dExport.java ! * @creation 2001-04-26 ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 EDF/LNHE ! * @mail de...@fu... ! */ ! package org.fudaa.fudaa.hydraulique1d; ! import java.io.File; ! import java.io.IOException; ! import javax.swing.filechooser.FileFilter; ! import org.fudaa.dodico.corba.hydraulique1d.IBief; ! import org.fudaa.dodico.corba.hydraulique1d.ICasier; ! import org.fudaa.dodico.corba.hydraulique1d.IEtude1d; ! import org.fudaa.dodico.corba.hydraulique1d.ILoiHydraulique; ! import org.fudaa.dodico.corba.hydraulique1d.IParametresReprise; ! import org.fudaa.dodico.corba.hydraulique1d.IResultatsTemporelSpatial; ! import org.fudaa.dodico.mascaret.ConvH1D_Masc; ! import org.fudaa.dodico.mascaret.DParametresMascaret; ! import org.fudaa.dodico.mascaret.DResultatsMascaret; ! import com.memoire.bu.BuFileChooser; ! /** ! * @version $Revision$ $Date$ by $Author$ ! * @author Jean-Marc Lacombe ! */ ! public class Hydraulique1dExport { ! public static final void exportProfils_MASCARET( ! File filename, ! IBief[] biefs) { ! DParametresMascaret.ecritParametresGEO( ! filename, ! ConvH1D_Masc.convertirParametresGeo(biefs)); ! } ! public static final void exportGeometrie_CASIER( ! File filename, ! ICasier[] casiers) { ! if (casiers == null) ! return; ! boolean presenceCasier= (casiers.length > 0); ! if (presenceCasier) { ! DParametresMascaret.ecritCasierGEO( ! filename, ! ConvH1D_Masc.convertirParametresGeoCasiers(casiers)); ! } ! } ! public static final void exportReprise_MASCARET( ! File filename, ! IParametresReprise paramReprise) { ! if (paramReprise == null) ! return; ! if (paramReprise.contenu() == null) ! return; ! if (paramReprise.contenu().equals("")) ! return; ! DParametresMascaret.ecritParametresREP( ! filename, ! ConvH1D_Masc.convertirParametresRep(paramReprise)); ! } ! public static final void exportCas_MASCARET(File filename, IEtude1d etude) { ! String nomFichierSansExtension= filename.getAbsolutePath(); ! int indexe; ! if ((indexe= nomFichierSansExtension.lastIndexOf('.')) != -1) ! nomFichierSansExtension= nomFichierSansExtension.substring(0, indexe); ! DParametresMascaret.ecritParametresCAS( ! filename, ! ConvH1D_Masc.convertirParametresCas(etude, nomFichierSansExtension)); ! } ! public static final void exportLois_MASCARET(String nomBase, ILoiHydraulique[] loisPasGeo) { ! DParametresMascaret.ecritLoisHydrauliques( ! nomBase, ! false, ! ConvH1D_Masc.convertirLoisHydrauliques(loisPasGeo)); ! } ! public static final void exportListing_DAMOCLES( ! File filename, ! byte[] contenu) { ! try { ! if (contenu == null) ! return; ! DResultatsMascaret.ecritResultatsDAMOC( ! filename, ! ConvH1D_Masc.convertirResultatsLisDamocles(contenu)); ! } catch (IOException ex) { ! ex.printStackTrace(); ! } ! } ! public static final void exportListing(File filename, byte[] contenu) { ! try { ! if (contenu == null) ! return; ! DResultatsMascaret.ecritResultatsLIS( ! filename, ! ConvH1D_Masc.convertirResultatsLis(contenu)); ! } catch (IOException ex) { ! ex.printStackTrace(); ! } ! } ! public static final void exportRubens(File filename, IResultatsTemporelSpatial ires) { ! try { ! if (ires==null) return; ! DResultatsMascaret.ecritResultats(DResultatsMascaret.RUBENS, ! filename, ! ConvH1D_Masc.convertirResultatsTemporelSpatialH1dToMas(ires)); ! } catch (Exception ex) { ! ex.printStackTrace(); ! } ! } ! public static final void exportOpthyca(File filename, IEtude1d etude) { ! try { ! IResultatsTemporelSpatial ires = etude.resultatsGeneraux().resultatsTemporelSpatial(); ! if (ires==null) return; ! DResultatsMascaret.ecritResultats(DResultatsMascaret.OPTYCA, ! filename, ! ConvH1D_Masc.convertirResultatsTemporelSpatialH1dToMas(ires)); ! } catch (Exception ex) { ! ex.printStackTrace(); ! } ! } ! public static final void exportOpthycaCasier(File filename, IEtude1d etude) { ! try { ! IResultatsTemporelSpatial ires = etude.resultatsGeneraux().resultatsTemporelCasier(); ! if (ires==null) return; ! DResultatsMascaret.ecritResultats(DResultatsMascaret.OPTYCA, ! filename, ! ConvH1D_Masc.convertirResultatsTemporelSpatialH1dToMas(ires)); ! } catch (Exception ex) { ! ex.printStackTrace(); ! } ! } ! public static final void exportOpthycaLiaison( ! File filename, ! IEtude1d etude) { ! try { ! IResultatsTemporelSpatial ires = etude.resultatsGeneraux().resultatsTemporelLiaison(); ! if (ires==null) return; ! DResultatsMascaret.ecritResultats(DResultatsMascaret.OPTYCA, ! filename, ! ConvH1D_Masc.convertirResultatsTemporelSpatialH1dToMas(ires)); ! } catch (Exception ex) { ! ex.printStackTrace(); ! } ! } ! public static final File chooseFile(String _ext) { ! final String ext= _ext; ! File res= null; ! BuFileChooser chooser= new BuFileChooser(); ! chooser.setFileFilter(new javax.swing.filechooser.FileFilter() { ! public boolean accept(java.io.File f) { ! return (ext == null) ! ? true ! : (f.getName().endsWith("." + ext) || f.isDirectory()); ! } ! public String getDescription() { ! return (ext == null) ! ? "*.*" ! : ("Fichiers " + ext.toUpperCase() + " (*." + ext + ")"); ! } ! }); ! chooser.setCurrentDirectory(Hydraulique1dResource.lastExportDir); ! int returnVal= chooser.showSaveDialog(Hydraulique1dBaseApplication.FRAME); ! String filename= null; ! if (returnVal == BuFileChooser.APPROVE_OPTION) { ! filename= chooser.getSelectedFile().getPath(); ! } ! if (filename == null) ! return null; ! int indexSlash= filename.lastIndexOf(java.io.File.separatorChar); ! res= new File(filename); ! if (indexSlash > 0) ! Hydraulique1dResource.lastExportDir= ! new java.io.File(filename.substring(0, indexSlash)); ! else ! Hydraulique1dResource.lastExportDir= chooser.getCurrentDirectory(); ! return res; ! } ! private static void my_perror(String msg) { ! System.err.println(msg); ! } ! private static void my_perror(Exception e) { ! e.printStackTrace(); ! } ! } Index: Hydraulique1dExportPanneau.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/hydraulique1d/Hydraulique1dExportPanneau.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Hydraulique1dExportPanneau.java 5 Feb 2004 18:26:37 -0000 1.7 --- Hydraulique1dExportPanneau.java 12 Mar 2004 19:40:48 -0000 1.8 *************** *** 1,256 **** ! /* ! * @file Hydraulique1dExportPanneau.java ! * @creation 2001-04-26 ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 EDF/LNHE ! * @mail de...@fu... ! */ ! package org.fudaa.fudaa.hydraulique1d; ! import com.memoire.bu.*; ! import org.fudaa.fudaa.commun.*; ! import org.fudaa.dodico.hydraulique1d.CGlobal; ! import java.awt.*; ! import java.awt.event.*; ! import javax.swing.*; ! import javax.swing.border.*; ! import java.io.*; ! import java.util.*; ! /** ! * Une boite de selection d'exports pour Hydraulique1d. ! * ! * @version $Revision$ $Date$ by $Author$ ! * @author Jean-Marc Lacombe ! */ ! public class Hydraulique1dExportPanneau ! extends JDialog ! implements ActionListener, WindowListener { ! // Donnees membres publiques ! public final static int CANCEL= 0; ! public final static int OK= 1; ! // Donnees membres privees ! private int status_; ! private File dir_; ! private BuPanel pnChoix_, pnChoixParam_, pnChoixResu_, pnOk_, pnGen_; ! private JCheckBox cbAll_; ! private BuTextField tfDir_; ! private JButton b_ok_, b_cancel_, btDir_; ! private Hashtable cbs_; ! private String[] choix_; ! // Constructeurs ! public Hydraulique1dExportPanneau(Frame _parent) { ! super(_parent, "Exportation", true); ! status_= CANCEL; ! dir_= Hydraulique1dResource.lastExportDir; ! pnChoixParam_= new BuPanel(); ! pnChoixParam_.setLayout(new BuGridLayout(3, 5, 5, true, true)); ! CompoundBorder bdChoixParam= ! new CompoundBorder( ! new EtchedBorder(), ! new EmptyBorder(new Insets(2, 2, 2, 2))); ! TitledBorder tbChoixParam= new TitledBorder(bdChoixParam, "Paramètres"); ! pnChoixParam_.setBorder(tbChoixParam); ! int n= 0; ! cbs_= new Hashtable(); ! JCheckBox cb; ! cb= new JCheckBox("Profils (format Mascaret)"); ! cbs_.put("GEO_MASCA", cb); ! pnChoixParam_.add(cb, n++); ! cb= new JCheckBox("Fichier cas"); ! cbs_.put("CAS_MASCA", cb); ! pnChoixParam_.add(cb, n++); ! cb= new JCheckBox("Fichiers des lois hydrau."); ! cbs_.put("LOIS_MASCA", cb); ! pnChoixParam_.add(cb, n++); ! cb= new JCheckBox("Fichier reprise en lecture"); ! cbs_.put("REP_MASCA", cb); ! pnChoixParam_.add(cb, n++); ! if (CGlobal.autorisationCasier) { ! cb= new JCheckBox("Fichier géométrie des casiers"); ! cbs_.put("GEO_CASIER", cb); ! pnChoixParam_.add(cb, n++); ! } ! pnChoixResu_= new BuPanel(); ! pnChoixResu_.setLayout(new BuGridLayout(3, 5, 5, true, true)); ! CompoundBorder bdChoixResu= ! new CompoundBorder( ! new EtchedBorder(), ! new EmptyBorder(new Insets(2, 2, 2, 2))); ! TitledBorder tbChoixResu= new TitledBorder(bdChoixResu, "Résultats"); ! pnChoixResu_.setBorder(tbChoixResu); ! n= 0; ! cb= new JCheckBox("Fichier listing Damocles"); ! cbs_.put("DAMO_MASCA", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier listing mascaret"); ! cbs_.put("LIST_MASCA", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier reprise en écriture"); ! cbs_.put("REP_ECRI_MASCA", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier résultat mascaret (format Rubens)"); ! cbs_.put("RESU_MASCA", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier résultat mascaret (format Opthyca)"); ! cbs_.put("RESU_OPTYCA", cb); ! pnChoixResu_.add(cb, n++); ! if (CGlobal.autorisationCasier) { ! cb= new JCheckBox("Fichier réesultat casier (format Opthyca)"); ! cbs_.put("RESU_CASIER_OPTYCA", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier résultat casier (format Rubens)"); ! cbs_.put("RESU_CASIER_RUBENS", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier listing casier"); ! cbs_.put("RESU_CASIER_LISTING", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier résultat liaison (format Opthyca)"); ! cbs_.put("RESU_LIAISON_OPTYCA", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier résultat liaison (format Rubens)"); ! cbs_.put("RESU_LIAISON_RUBENS", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier listing liaison"); ! cbs_.put("RESU_LIAISON_LISTING", cb); ! pnChoixResu_.add(cb, n++); ! } ! choix_= new String[cbs_.size()]; ! pnChoix_= new BuPanel(); ! pnChoix_.setLayout(new BuVerticalLayout()); ! pnChoix_.setBorder( ! new CompoundBorder( ! new EtchedBorder(), ! new EmptyBorder(new Insets(5, 5, 5, 5)))); ! n= 0; ! pnChoix_.add(pnChoixParam_, n++); ! pnChoix_.add(pnChoixResu_, n++); ! n= 0; ! pnGen_= new BuPanel(); ! pnGen_.setLayout(new BuVerticalLayout()); ! pnGen_.setBorder(new EmptyBorder(new Insets(5, 5, 5, 5))); ! pnGen_.add(pnChoix_, n++); ! cbAll_= new JCheckBox("Toute l'étude"); ! cbAll_.setSelected(false); ! cbAll_.addActionListener(this); ! pnGen_.add(cbAll_, n++); ! BuPanel pnDir= new BuPanel(); ! tfDir_= new BuTextField(); ! tfDir_.setColumns(8); ! pnDir.add(tfDir_); ! btDir_= new BuButton("Parcourir"); ! btDir_.setActionCommand("PARCOURIR"); ! btDir_.addActionListener(this); ! pnDir.add(btDir_); ! pnGen_.add(new BuLabel("Exporter vers :"), n++); ! pnGen_.add(pnDir, n++); ! pnOk_= new BuPanel(); ! b_ok_= new BuButton("Valider"); ! b_ok_.setActionCommand("VALIDER"); ! b_ok_.addActionListener(this); ! b_cancel_= new BuButton("Annuler"); ! b_cancel_.setActionCommand("ANNULER"); ! b_cancel_.addActionListener(this); ! pnOk_.add(b_ok_); ! pnOk_.add(b_cancel_); ! Container content= getContentPane(); ! content.setLayout(new BorderLayout()); ! content.add(pnGen_, BorderLayout.NORTH); ! content.add(pnOk_, BorderLayout.SOUTH); ! pack(); ! setResizable(false); ! if (_parent instanceof Component) ! setLocationRelativeTo(_parent); ! } ! // Actions ! public void actionPerformed(ActionEvent _evt) { ! String action= _evt.getActionCommand(); ! Object src= _evt.getSource(); ! if (src == cbAll_) { ! Enumeration e= cbs_.elements(); ! if (cbAll_.isSelected()) { ! while (e.hasMoreElements()) { ! JCheckBox cb= (JCheckBox)e.nextElement(); ! if (cb.isEnabled()) ! cb.setSelected(true); ! } ! } else { ! while (e.hasMoreElements()) { ! JCheckBox cb= (JCheckBox)e.nextElement(); ! cb.setSelected(false); ! } ! } ! } else if (action.equals("ANNULER")) { ! dir_= Hydraulique1dResource.lastExportDir; ! for (int i= 0; i < choix_.length; i++) ! choix_[i]= null; ! status_= CANCEL; ! dispose(); ! } else if (action.equals("VALIDER")) { ! Enumeration e= cbs_.keys(); ! String key= null; ! int i= 0; ! while (e.hasMoreElements()) { ! key= (String)e.nextElement(); ! if (((JCheckBox)cbs_.get(key)).isSelected()) ! choix_[i++]= key; ! else ! choix_[i++]= null; ! } ! String txt= tfDir_.getText(); ! if ((txt == null) || ("".equals(txt))) { ! dir_= null; ! new BuDialogError( ! (BuCommonInterface)Hydraulique1dBaseApplication.FRAME, ! ((BuCommonInterface)Hydraulique1dBaseApplication.FRAME) ! .getInformationsSoftware(), ! "Vous devez choisir un nom de fichier!") ! .activate(); ! return; ! } else { ! int indSlash= txt.lastIndexOf(File.separator); ! int ind= txt.lastIndexOf('.'); ! if ((ind > 0) && (ind > indSlash)) ! txt= txt.substring(0, ind); ! dir_= new File(txt); ! } ! File parentf= dir_.getParentFile(); ! if ((parentf != null) && (!parentf.canWrite())) { ! dir_= null; ! new BuDialogError( ! (BuCommonInterface)Hydraulique1dBaseApplication.FRAME, ! ((BuCommonInterface)Hydraulique1dBaseApplication.FRAME) ! .getInformationsSoftware(), ! "Le répertoire " + parentf + "\n" + "n'existe pas!") ! .activate(); ! return; ! } ! status_= OK; ! dispose(); ! } else if (action.equals("PARCOURIR")) { ! File file= Hydraulique1dExport.chooseFile(null); ! tfDir_.setText(file == null ? "" : file.getPath()); ! } ! } ! public String[] getChoix() { ! return choix_; ! } ! public File getFichier() { ! return dir_; ! } ! public int valeurRetour() { ! return status_; ! } ! // Window events ! public void windowActivated(WindowEvent e) {} ! public void windowClosed(WindowEvent e) {} ! public void windowClosing(WindowEvent e) { ! dir_= Hydraulique1dResource.lastExportDir; ! for (int i= 0; i < choix_.length; i++) ! choix_[i]= null; ! dispose(); ! } ! public void windowDeactivated(WindowEvent e) {} ! public void windowDeiconified(WindowEvent e) {} ! public void windowIconified(WindowEvent e) {} ! public void windowOpened(WindowEvent e) {} ! } --- 1,256 ---- ! /* ! * @file Hydraulique1dExportPanneau.java ! * @creation 2001-04-26 ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 EDF/LNHE ! * @mail de...@fu... ! */ ! package org.fudaa.fudaa.hydraulique1d; ! import com.memoire.bu.*; ! import org.fudaa.fudaa.commun.*; ! import org.fudaa.dodico.hydraulique1d.CGlobal; ! import java.awt.*; ! import java.awt.event.*; ! import javax.swing.*; ! import javax.swing.border.*; ! import java.io.*; ! import java.util.*; ! /** ! * Une boite de selection d'exports pour Hydraulique1d. ! * ! * @version $Revision$ $Date$ by $Author$ ! * @author Jean-Marc Lacombe ! */ ! public class Hydraulique1dExportPanneau ! extends JDialog ! implements ActionListener, WindowListener { ! // Donnees membres publiques ! public final static int CANCEL= 0; ! public final static int OK= 1; ! // Donnees membres privees ! private int status_; ! private File dir_; ! private BuPanel pnChoix_, pnChoixParam_, pnChoixResu_, pnOk_, pnGen_; ! private JCheckBox cbAll_; ! private BuTextField tfDir_; ! private JButton b_ok_, b_cancel_, btDir_; ! private Hashtable cbs_; ! private String[] choix_; ! // Constructeurs ! public Hydraulique1dExportPanneau(Frame _parent) { ! super(_parent, "Exportation", true); ! status_= CANCEL; ! dir_= Hydraulique1dResource.lastExportDir; ! pnChoixParam_= new BuPanel(); ! pnChoixParam_.setLayout(new BuGridLayout(3, 5, 5, true, true)); ! CompoundBorder bdChoixParam= ! new CompoundBorder( ! new EtchedBorder(), ! new EmptyBorder(new Insets(2, 2, 2, 2))); ! TitledBorder tbChoixParam= new TitledBorder(bdChoixParam, "Paramètres"); ! pnChoixParam_.setBorder(tbChoixParam); ! int n= 0; ! cbs_= new Hashtable(); ! JCheckBox cb; ! cb= new JCheckBox("Profils (format Mascaret)"); ! cbs_.put("GEO_MASCA", cb); ! pnChoixParam_.add(cb, n++); ! cb= new JCheckBox("Fichier cas"); ! cbs_.put("CAS_MASCA", cb); ! pnChoixParam_.add(cb, n++); ! cb= new JCheckBox("Fichiers des lois hydrau."); ! cbs_.put("LOIS_MASCA", cb); ! pnChoixParam_.add(cb, n++); ! cb= new JCheckBox("Fichier reprise en lecture"); ! cbs_.put("REP_MASCA", cb); ! pnChoixParam_.add(cb, n++); ! if (CGlobal.autorisationCasier) { ! cb= new JCheckBox("Fichier géométrie des casiers"); ! cbs_.put("GEO_CASIER", cb); ! pnChoixParam_.add(cb, n++); ! } ! pnChoixResu_= new BuPanel(); ! pnChoixResu_.setLayout(new BuGridLayout(3, 5, 5, true, true)); ! CompoundBorder bdChoixResu= ! new CompoundBorder( ! new EtchedBorder(), ! new EmptyBorder(new Insets(2, 2, 2, 2))); ! TitledBorder tbChoixResu= new TitledBorder(bdChoixResu, "Résultats"); ! pnChoixResu_.setBorder(tbChoixResu); ! n= 0; ! cb= new JCheckBox("Fichier listing Damocles"); ! cbs_.put("DAMO_MASCA", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier listing mascaret"); ! cbs_.put("LIST_MASCA", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier reprise en écriture"); ! cbs_.put("REP_ECRI_MASCA", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier résultat mascaret (format Rubens)"); ! cbs_.put("RESU_MASCA", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier résultat mascaret (format Opthyca)"); ! cbs_.put("RESU_OPTYCA", cb); ! pnChoixResu_.add(cb, n++); ! if (CGlobal.autorisationCasier) { ! cb= new JCheckBox("Fichier résultat casier (format Opthyca)"); ! cbs_.put("RESU_CASIER_OPTYCA", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier résultat casier (format Rubens)"); ! cbs_.put("RESU_CASIER_RUBENS", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier listing casier"); ! cbs_.put("RESU_CASIER_LISTING", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier résultat liaison (format Opthyca)"); ! cbs_.put("RESU_LIAISON_OPTYCA", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier résultat liaison (format Rubens)"); ! cbs_.put("RESU_LIAISON_RUBENS", cb); ! pnChoixResu_.add(cb, n++); ! cb= new JCheckBox("Fichier listing liaison"); ! cbs_.put("RESU_LIAISON_LISTING", cb); ! pnChoixResu_.add(cb, n++); ! } ! choix_= new String[cbs_.size()]; ! pnChoix_= new BuPanel(); ! pnChoix_.setLayout(new BuVerticalLayout()); ! pnChoix_.setBorder( ! new CompoundBorder( ! new EtchedBorder(), ! new EmptyBorder(new Insets(5, 5, 5, 5)))); ! n= 0; ! pnChoix_.add(pnChoixParam_, n++); ! pnChoix_.add(pnChoixResu_, n++); ! n= 0; ! pnGen_= new BuPanel(); ! pnGen_.setLayout(new BuVerticalLayout()); ! pnGen_.setBorder(new EmptyBorder(new Insets(5, 5, 5, 5))); ! pnGen_.add(pnChoix_, n++); ! cbAll_= new JCheckBox("Toute l'étude"); ! cbAll_.setSelected(false); ! cbAll_.addActionListener(this); ! pnGen_.add(cbAll_, n++); ! BuPanel pnDir= new BuPanel(); ! tfDir_= new BuTextField(); ! tfDir_.setColumns(8); ! pnDir.add(tfDir_); ! btDir_= new BuButton("Parcourir"); ! btDir_.setActionCommand("PARCOURIR"); ! btDir_.addActionListener(this); ! pnDir.add(btDir_); ! pnGen_.add(new BuLabel("Exporter vers :"), n++); ! pnGen_.add(pnDir, n++); ! pnOk_= new BuPanel(); ! b_ok_= new BuButton("Valider"); ! b_ok_.setActionCommand("VALIDER"); ! b_ok_.addActionListener(this); ! b_cancel_= new BuButton("Annuler"); ! b_cancel_.setActionCommand("ANNULER"); ! b_cancel_.addActionListener(this); ! pnOk_.add(b_ok_); ! pnOk_.add(b_cancel_); ! Container content= getContentPane(); ! content.setLayout(new BorderLayout()); ! content.add(pnGen_, BorderLayout.NORTH); ! content.add(pnOk_, BorderLayout.SOUTH); ! pack(); ! setResizable(false); ! if (_parent instanceof Component) ! setLocationRelativeTo(_parent); ! } ! // Actions ! public void actionPerformed(ActionEvent _evt) { ! String action= _evt.getActionCommand(); ! Object src= _evt.getSource(); ! if (src == cbAll_) { ! Enumeration e= cbs_.elements(); ! if (cbAll_.isSelected()) { ! while (e.hasMoreElements()) { ! JCheckBox cb= (JCheckBox)e.nextElement(); ! if (cb.isEnabled()) ! cb.setSelected(true); ! } ! } else { ! while (e.hasMoreElements()) { ! JCheckBox cb= (JCheckBox)e.nextElement(); ! cb.setSelected(false); ! } ! } ! } else if (action.equals("ANNULER")) { ! dir_= Hydraulique1dResource.lastExportDir; ! for (int i= 0; i < choix_.length; i++) ! choix_[i]= null; ! status_= CANCEL; ! dispose(); ! } else if (action.equals("VALIDER")) { ! Enumeration e= cbs_.keys(); ! String key= null; ! int i= 0; ! while (e.hasMoreElements()) { ! key= (String)e.nextElement(); ! if (((JCheckBox)cbs_.get(key)).isSelected()) ! choix_[i++]= key; ! else ! choix_[i++]= null; ! } ! String txt= tfDir_.getText(); ! if ((txt == null) || ("".equals(txt))) { ! dir_= null; ! new BuDialogError( ! (BuCommonInterface)Hydraulique1dBaseApplication.FRAME, ! ((BuCommonInterface)Hydraulique1dBaseApplication.FRAME) ! .getInformationsSoftware(), ! "Vous devez choisir un nom de fichier!") ! .activate(); ! return; ! } else { ! int indSlash= txt.lastIndexOf(File.separator); ! int ind= txt.lastIndexOf('.'); ! if ((ind > 0) && (ind > indSlash)) ! txt= txt.substring(0, ind); ! dir_= new File(txt); ! } ! File parentf= dir_.getParentFile(); ! if ((parentf != null) && (!parentf.canWrite())) { ! dir_= null; ! new BuDialogError( ! (BuCommonInterface)Hydraulique1dBaseApplication.FRAME, ! ((BuCommonInterface)Hydraulique1dBaseApplication.FRAME) ! .getInformationsSoftware(), ! "Le répertoire " + parentf + "\n" + "n'existe pas!") ! .activate(); ! return; ! } ! status_= OK; ! dispose(); ! } else if (action.equals("PARCOURIR")) { ! File file= Hydraulique1dExport.chooseFile(null); ! tfDir_.setText(file == null ? "" : file.getPath()); ! } ! } ! public String[] getChoix() { ! return choix_; ! } ! public File getFichier() { ! return dir_; ! } ! public int valeurRetour() { ! return status_; ! } ! // Window events ! public void windowActivated(WindowEvent e) {} ! public void windowClosed(WindowEvent e) {} ! public void windowClosing(WindowEvent e) { ! dir_= Hydraulique1dResource.lastExportDir; ! for (int i= 0; i < choix_.length; i++) ! choix_[i]= null; ! dispose(); ! } ! public void windowDeactivated(WindowEvent e) {} ! public void windowDeiconified(WindowEvent e) {} ! public void windowIconified(WindowEvent e) {} ! public void windowOpened(WindowEvent e) {} ! } |
From: <jm_...@us...> - 2004-03-12 19:59:04
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/lido/conversion/hydro1d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv944/dodico/lido/conversion/hydro1d Modified Files: CConversionHydraulique1dResultats.java Log Message: Index: CConversionHydraulique1dResultats.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/lido/conversion/hydro1d/CConversionHydraulique1dResultats.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CConversionHydraulique1dResultats.java 25 Nov 2003 10:11:41 -0000 1.5 --- CConversionHydraulique1dResultats.java 12 Mar 2004 19:39:22 -0000 1.6 *************** *** 1,147 **** ! /* ! * @file CConversionHydraulique1dResultats.java ! * @creation 2000-09-05 ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! * @mail de...@fu... ! */ ! package org.fudaa.dodico.lido.conversion.hydro1d; ! import org.fudaa.dodico.corba.objet.*; ! import org.fudaa.dodico.corba.hydraulique1d.*; ! import org.fudaa.dodico.corba.lido.*; ! import org.fudaa.dodico.corba.calcul.*; ! import org.fudaa.dodico.objet.*; ! import org.fudaa.dodico.hydraulique1d.*; ! /** ! * Classe Conversion de calculLido en calculhydraulique1d ! * ! * @version $Revision$ $Date$ by $Author$ ! * @author Axel von Arnim ! */ ! public class CConversionHydraulique1dResultats { ! private ICalculLido calculLido_; ! private ICalculHydraulique1d calculHydraulique1d_; ! private IConnexion connexion_; ! public CConversionHydraulique1dResultats( ! ICalculHydraulique1d calculHydraulique1d, ! IConnexion c) { ! calculHydraulique1d_= calculHydraulique1d; ! connexion_= c; ! calculLido_= (ICalculLido)calculHydraulique1d_.calculCode(); ! } ! public void ecritResultats() { ! SParametresCAL cal= ! ((IParametresLido)calculLido_.parametres(connexion_)).parametresCAL(); ! if (cal == null) ! return; ! IParametresResultats paramResultats= ! calculHydraulique1d_.etude().paramResultats(); ! paramResultats.optionsListing().geometrie("OUI".equals(cal.genCal.impGeo)); ! paramResultats.optionsListing().planimetrage( ! "OUI".equals(cal.genCal.impPlan)); ! paramResultats.optionsListing().reseau("OUI".equals(cal.genCal.impRez)); ! paramResultats.optionsListing().loisHydrauliques( ! "OUI".equals(cal.genCal.impHyd)); ! paramResultats.optionsListing().ligneEauInitiale(false); ! paramResultats.optionsListing().calcul(true); ! paramResultats.paramStockage().option(LOptionStockage.TOUTES_SECTIONS); ! paramResultats.paramStockage().premierPasTempsStocke(0); ! paramResultats.paramStockage().periodeListing(1); ! paramResultats.paramStockage().periodeResultat(1); ! paramResultats.paramStockage().pasTempsImpression(cal.temporel.pas2TImp); ! paramResultats.paramStockage().sites(new ISite[0]); ! paramResultats.postRubens(false); ! paramResultats.postOptyca(false); ! paramResultats.decalage(0.); ! paramResultats.variables(ecritVariables()); ! } ! private IDescriptionVariable[] ecritVariables() { ! IDescriptionVariable[] desc= new IDescriptionVariable[14]; ! desc[0]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[0].nom("Z"); ! desc[0].description("Ligne d'eau"); ! desc[0].unite(LUnite.M); ! desc[0].type(LTypeNombre.REEL); ! desc[0].nbDecimales(3); ! desc[1]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[1].nom("Y"); ! desc[1].description("Hauteur d'eau"); ! desc[1].unite(LUnite.M); ! desc[1].type(LTypeNombre.REEL); ! desc[1].nbDecimales(3); ! desc[2]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[2].nom("S1"); ! desc[2].description("Section mouillée (lit mineur)"); ! desc[2].unite(LUnite.RIEN); ! desc[2].type(LTypeNombre.REEL); ! desc[2].nbDecimales(3); ! desc[3]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[3].nom("S2"); ! desc[3].description("Section mouillée (lit majeur)"); ! desc[3].unite(LUnite.RIEN); ! desc[3].type(LTypeNombre.REEL); ! desc[3].nbDecimales(3); ! desc[4]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[4].nom("R1"); ! desc[4].description("Rayon hydraulique (lit mineur)"); ! desc[4].unite(LUnite.M); ! desc[4].type(LTypeNombre.REEL); ! desc[4].nbDecimales(3); ! desc[5]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[5].nom("R2"); ! desc[5].description("Rayon hydraulique (lit majeur)"); ! desc[5].unite(LUnite.RIEN); ! desc[5].type(LTypeNombre.REEL); ! desc[5].nbDecimales(3); ! desc[6]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[6].nom("B1"); ! desc[6].description("Largeur au miroir"); ! desc[6].unite(LUnite.M); ! desc[6].type(LTypeNombre.REEL); ! desc[6].nbDecimales(3); ! desc[7]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[7].nom("VMIN"); ! desc[7].description("Vitesse (lit mineur)"); ! desc[7].unite(LUnite.M_PAR_S); ! desc[7].type(LTypeNombre.REEL); ! desc[7].nbDecimales(3); ! desc[8]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[8].nom("VMAJ"); ! desc[8].description("Vitesse (lit majeur)"); ! desc[8].unite(LUnite.M_PAR_S); ! desc[8].type(LTypeNombre.REEL); ! desc[8].nbDecimales(3); ! desc[9]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[9].nom("Q"); ! desc[9].description("Débit total"); ! desc[9].unite(LUnite.M3_PAR_S); ! desc[9].type(LTypeNombre.REEL); ! desc[9].nbDecimales(3); ! desc[10]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[10].nom("FROUDE"); ! desc[10].description("Nombre de Froude"); ! desc[10].unite(LUnite.RIEN); ! desc[10].type(LTypeNombre.REEL); ! desc[10].nbDecimales(3); ! desc[11]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[11].nom("QMIN"); ! desc[11].description("Débit (lit mineur)"); ! desc[11].unite(LUnite.M3_PAR_S); ! desc[11].type(LTypeNombre.REEL); ! desc[11].nbDecimales(3); ! desc[12]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[12].nom("QMAJ"); ! desc[12].description("Débit (lit majeur)"); ! desc[12].unite(LUnite.M3_PAR_S); ! desc[12].type(LTypeNombre.REEL); ! desc[12].nbDecimales(3); ! desc[13]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[13].nom("CHARGE"); ! desc[13].description("Charge"); ! desc[13].unite(LUnite.RIEN); ! desc[13].type(LTypeNombre.REEL); ! desc[13].nbDecimales(3); ! return desc; ! } ! } --- 1,147 ---- ! /* ! * @file CConversionHydraulique1dResultats.java ! * @creation 2000-09-05 ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! * @mail de...@fu... ! */ ! package org.fudaa.dodico.lido.conversion.hydro1d; ! import org.fudaa.dodico.corba.objet.*; ! import org.fudaa.dodico.corba.hydraulique1d.*; ! import org.fudaa.dodico.corba.lido.*; ! import org.fudaa.dodico.corba.calcul.*; ! import org.fudaa.dodico.objet.*; ! import org.fudaa.dodico.hydraulique1d.*; ! /** ! * Classe Conversion de calculLido en calculhydraulique1d ! * ! * @version $Revision$ $Date$ by $Author$ ! * @author Axel von Arnim ! */ ! public class CConversionHydraulique1dResultats { ! private ICalculLido calculLido_; ! private ICalculHydraulique1d calculHydraulique1d_; ! private IConnexion connexion_; ! public CConversionHydraulique1dResultats( ! ICalculHydraulique1d calculHydraulique1d, ! IConnexion c) { ! calculHydraulique1d_= calculHydraulique1d; ! connexion_= c; ! calculLido_= (ICalculLido)calculHydraulique1d_.calculCode(); ! } ! public void ecritResultats() { ! SParametresCAL cal= ! ((IParametresLido)calculLido_.parametres(connexion_)).parametresCAL(); ! if (cal == null) ! return; ! IParametresResultats paramResultats= ! calculHydraulique1d_.etude().paramResultats(); ! paramResultats.optionsListing().geometrie("OUI".equals(cal.genCal.impGeo)); ! paramResultats.optionsListing().planimetrage( ! "OUI".equals(cal.genCal.impPlan)); ! paramResultats.optionsListing().reseau("OUI".equals(cal.genCal.impRez)); ! paramResultats.optionsListing().loisHydrauliques( ! "OUI".equals(cal.genCal.impHyd)); ! paramResultats.optionsListing().ligneEauInitiale(false); ! paramResultats.optionsListing().calcul(true); ! paramResultats.paramStockage().option(LOptionStockage.TOUTES_SECTIONS); ! paramResultats.paramStockage().premierPasTempsStocke(0); ! paramResultats.paramStockage().periodeListing(1); ! paramResultats.paramStockage().periodeResultat(1); ! paramResultats.paramStockage().pasTempsImpression(cal.temporel.pas2TImp); ! paramResultats.paramStockage().sites(new ISite[0]); ! paramResultats.postRubens(false); ! paramResultats.postOpthyca(false); ! paramResultats.decalage(0.); ! paramResultats.variables(ecritVariables()); ! } ! private IDescriptionVariable[] ecritVariables() { ! IDescriptionVariable[] desc= new IDescriptionVariable[14]; ! desc[0]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[0].nom("Z"); ! desc[0].description("Ligne d'eau"); ! desc[0].unite(LUnite.M); ! desc[0].type(LTypeNombre.REEL); ! desc[0].nbDecimales(3); ! desc[1]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[1].nom("Y"); ! desc[1].description("Hauteur d'eau"); ! desc[1].unite(LUnite.M); ! desc[1].type(LTypeNombre.REEL); ! desc[1].nbDecimales(3); ! desc[2]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[2].nom("S1"); ! desc[2].description("Section mouillée (lit mineur)"); ! desc[2].unite(LUnite.RIEN); ! desc[2].type(LTypeNombre.REEL); ! desc[2].nbDecimales(3); ! desc[3]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[3].nom("S2"); ! desc[3].description("Section mouillée (lit majeur)"); ! desc[3].unite(LUnite.RIEN); ! desc[3].type(LTypeNombre.REEL); ! desc[3].nbDecimales(3); ! desc[4]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[4].nom("R1"); ! desc[4].description("Rayon hydraulique (lit mineur)"); ! desc[4].unite(LUnite.M); ! desc[4].type(LTypeNombre.REEL); ! desc[4].nbDecimales(3); ! desc[5]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[5].nom("R2"); ! desc[5].description("Rayon hydraulique (lit majeur)"); ! desc[5].unite(LUnite.RIEN); ! desc[5].type(LTypeNombre.REEL); ! desc[5].nbDecimales(3); ! desc[6]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[6].nom("B1"); ! desc[6].description("Largeur au miroir"); ! desc[6].unite(LUnite.M); ! desc[6].type(LTypeNombre.REEL); ! desc[6].nbDecimales(3); ! desc[7]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[7].nom("VMIN"); ! desc[7].description("Vitesse (lit mineur)"); ! desc[7].unite(LUnite.M_PAR_S); ! desc[7].type(LTypeNombre.REEL); ! desc[7].nbDecimales(3); ! desc[8]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[8].nom("VMAJ"); ! desc[8].description("Vitesse (lit majeur)"); ! desc[8].unite(LUnite.M_PAR_S); ! desc[8].type(LTypeNombre.REEL); ! desc[8].nbDecimales(3); ! desc[9]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[9].nom("Q"); ! desc[9].description("Débit total"); ! desc[9].unite(LUnite.M3_PAR_S); ! desc[9].type(LTypeNombre.REEL); ! desc[9].nbDecimales(3); ! desc[10]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[10].nom("FROUDE"); ! desc[10].description("Nombre de Froude"); ! desc[10].unite(LUnite.RIEN); ! desc[10].type(LTypeNombre.REEL); ! desc[10].nbDecimales(3); ! desc[11]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[11].nom("QMIN"); ! desc[11].description("Débit (lit mineur)"); ! desc[11].unite(LUnite.M3_PAR_S); ! desc[11].type(LTypeNombre.REEL); ! desc[11].nbDecimales(3); ! desc[12]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[12].nom("QMAJ"); ! desc[12].description("Débit (lit majeur)"); ! desc[12].unite(LUnite.M3_PAR_S); ! desc[12].type(LTypeNombre.REEL); ! desc[12].nbDecimales(3); ! desc[13]= CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! desc[13].nom("CHARGE"); ! desc[13].description("Charge"); ! desc[13].unite(LUnite.RIEN); ! desc[13].type(LTypeNombre.REEL); ! desc[13].nbDecimales(3); ! return desc; ! } ! } |
From: <jm_...@us...> - 2004-03-12 19:59:04
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/hydraulique1d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv944/dodico/hydraulique1d Modified Files: DParametresResultats.java Log Message: Index: DParametresResultats.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/hydraulique1d/DParametresResultats.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DParametresResultats.java 2 Feb 2004 16:13:02 -0000 1.5 --- DParametresResultats.java 12 Mar 2004 19:39:21 -0000 1.6 *************** *** 1,221 **** ! /* ! * @file DParametresResultats.java ! * @creation 2000-08-10 ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! * @mail de...@fu... ! */ ! package org.fudaa.dodico.hydraulique1d; ! import java.util.ArrayList; ! import java.util.Arrays; ! import java.util.List; ! import java.util.Vector; ! import org.fudaa.dodico.corba.hydraulique1d.IDescriptionVariable; ! import org.fudaa.dodico.corba.hydraulique1d.IOptionsListing; ! import org.fudaa.dodico.corba.hydraulique1d.IParametresResultats; ! import org.fudaa.dodico.corba.hydraulique1d.IParametresResultatsOperations; ! import org.fudaa.dodico.corba.hydraulique1d.IParametresStockage; ! import org.fudaa.dodico.corba.hydraulique1d.IParametresTailleMaxFichier; ! import org.fudaa.dodico.corba.hydraulique1d.LTypeNombre; ! import org.fudaa.dodico.corba.hydraulique1d.LUnite; ! import org.fudaa.dodico.corba.objet.IObjet; ! import org.fudaa.dodico.objet.CDodico; ! /** ! * @version $Revision$ $Date$ by $Author$ ! * @author Axel von Arnim ! */ ! public class DParametresResultats ! extends DHydraulique1d ! implements IParametresResultatsOperations { ! public void initialise(IObjet _o) { ! super.initialise(_o); ! if (_o instanceof IParametresResultats) { ! IParametresResultats q= (IParametresResultats)_o; ! if (q.optionsListing() != null) ! optionsListing((IOptionsListing)q.optionsListing().creeClone()); ! if (q.paramStockage() != null) ! paramStockage((IParametresStockage)q.paramStockage().creeClone()); ! if (q.paramTailleMaxFichier() != null) ! paramTailleMaxFichier( ! (IParametresTailleMaxFichier)q.paramTailleMaxFichier().creeClone()); ! postRubens(q.postRubens()); ! postOptyca(q.postOptyca()); ! decalage(q.decalage()); ! if (q.variables() != null) { ! IDescriptionVariable[] ip= ! new IDescriptionVariable[q.variables().length]; ! for (int i= 0; i < ip.length; i++) ! ip[i]= (IDescriptionVariable)q.variables()[i].creeClone(); ! variables(ip); ! } ! } ! } ! final public IObjet creeClone() { ! IParametresResultats p= ! CDodico.findUsine().creeHydraulique1dParametresResultats(); ! p.initialise(tie()); ! return p; ! } ! final public String toString() { ! String s= "parametresResultats"; ! return s; ! } ! /*** IParametresResultats ***/ ! // constructeurs ! public DParametresResultats() { ! super(); ! optionsListing_= CDodico.findUsine().creeHydraulique1dOptionsListing(); ! paramStockage_= CDodico.findUsine().creeHydraulique1dParametresStockage(); ! paramStockage_= CDodico.findUsine().creeHydraulique1dParametresStockage(); ! paramTailleMaxFichier_= ! CDodico.findUsine().creeHydraulique1dParametresTailleMaxFichier(); ! postRubens_= false; ! postOptyca_= true; ! decalage_= 1.; ! variables_= new IDescriptionVariable[0]; ! ajouteVariable( ! "Y", ! "Hauteur d'eau maximale", ! LUnite.M, ! LTypeNombre.REEL, ! 3); ! ajouteVariable( ! "VMIN", ! "Vitesse mineur", ! LUnite.M_PAR_S, ! LTypeNombre.REEL, ! 4); ! ajouteVariable("ZREF", "Cote du fond", LUnite.M, LTypeNombre.REEL, 4); ! ajouteVariable("Z", "Cote de l'eau", LUnite.M, LTypeNombre.REEL, 3); ! ajouteVariable( ! "QMIN", ! "Débit mineur", ! LUnite.M3_PAR_S, ! LTypeNombre.REEL, ! 3); ! ajouteVariable( ! "QMAJ", ! "Débit majeur", ! LUnite.M3_PAR_S, ! LTypeNombre.REEL, ! 3); ! } ! public void dispose() { ! optionsListing_= null; ! paramStockage_= null; ! postRubens_= false; ! postOptyca_= false; ! decalage_= 0.; ! variables_= null; ! super.dispose(); ! } ! // Attributs ! private IOptionsListing optionsListing_; ! public IOptionsListing optionsListing() { ! return optionsListing_; ! } ! public void optionsListing(IOptionsListing s) { ! if (optionsListing_==s) return; ! optionsListing_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "optionsListing"); ! } ! private IParametresStockage paramStockage_; ! public IParametresStockage paramStockage() { ! return paramStockage_; ! } ! public void paramStockage(IParametresStockage s) { ! if (paramStockage_==s) return; ! paramStockage_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "paramStockage"); ! } ! private IParametresTailleMaxFichier paramTailleMaxFichier_; ! public IParametresTailleMaxFichier paramTailleMaxFichier() { ! return paramTailleMaxFichier_; ! } ! public void paramTailleMaxFichier(IParametresTailleMaxFichier t) { ! if (paramTailleMaxFichier_==t) return; ! paramTailleMaxFichier_= t; ! CDodico.findUsine().fireObjetModifie( ! toString(), ! tie(), ! "paramTailleMaxFichier"); ! } ! private boolean postRubens_; ! public boolean postRubens() { ! return postRubens_; ! } ! public void postRubens(boolean s) { ! if (postRubens_==s) return; ! postRubens_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "postRubens"); ! } ! private boolean postOptyca_; ! public boolean postOptyca() { ! return postOptyca_; ! } ! public void postOptyca(boolean s) { ! if (postOptyca_==s) return; ! postOptyca_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "postOptyca"); ! } ! private double decalage_; ! public double decalage() { ! return decalage_; ! } ! public void decalage(double s) { ! if (decalage_==s) return; ! decalage_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "decalage"); ! } ! private IDescriptionVariable[] variables_; ! public IDescriptionVariable[] variables() { ! return variables_; ! } ! public void variables(IDescriptionVariable[] s) { ! if (egale(variables_,s)) return; ! variables_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "variables"); ! } ! // Méthodes ! public boolean existeVariable(String nomVariable) { ! boolean existe= false; ! for (int i= 0; i < variables_.length; i++) { ! if (variables_[i].nom().equals(nomVariable)) ! return true; ! } ! return existe; ! } ! public void ajouteVariable( ! String nom, ! String description, ! LUnite unite, ! LTypeNombre type, ! int nbDecimal) { ! if (existeVariable(nom)) return; ! IDescriptionVariable descrip= ! CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! descrip.nom(nom); ! descrip.description(description); ! descrip.unite(unite); ! descrip.type(type); ! descrip.nbDecimales(nbDecimal); ! List listVar = new ArrayList(Arrays.asList(variables_)); ! listVar.add(descrip); ! variables_= (IDescriptionVariable[])listVar.toArray(new IDescriptionVariable[0]); ! } ! public void supprimeVariable(String nomVariable) { ! Vector newVars= new Vector(); ! for (int i= 0; i < variables_.length; i++) { ! if (variables_[i].nom().equals(nomVariable)) { ! CDodico.findUsine().supprimeHydraulique1dDescriptionVariable( ! variables_[i]); ! } else ! newVars.add(variables_[i]); ! } ! variables_= new IDescriptionVariable[newVars.size()]; ! for (int i= 0; i < variables_.length; i++) ! variables_[i]= (IDescriptionVariable)newVars.get(i); ! } ! ! } --- 1,221 ---- ! /* ! * @file DParametresResultats.java ! * @creation 2000-08-10 ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! * @mail de...@fu... ! */ ! package org.fudaa.dodico.hydraulique1d; ! import java.util.ArrayList; ! import java.util.Arrays; ! import java.util.List; ! import java.util.Vector; ! import org.fudaa.dodico.corba.hydraulique1d.IDescriptionVariable; ! import org.fudaa.dodico.corba.hydraulique1d.IOptionsListing; ! import org.fudaa.dodico.corba.hydraulique1d.IParametresResultats; ! import org.fudaa.dodico.corba.hydraulique1d.IParametresResultatsOperations; ! import org.fudaa.dodico.corba.hydraulique1d.IParametresStockage; ! import org.fudaa.dodico.corba.hydraulique1d.IParametresTailleMaxFichier; ! import org.fudaa.dodico.corba.hydraulique1d.LTypeNombre; ! import org.fudaa.dodico.corba.hydraulique1d.LUnite; ! import org.fudaa.dodico.corba.objet.IObjet; ! import org.fudaa.dodico.objet.CDodico; ! /** ! * @version $Revision$ $Date$ by $Author$ ! * @author Axel von Arnim ! */ ! public class DParametresResultats ! extends DHydraulique1d ! implements IParametresResultatsOperations { ! public void initialise(IObjet _o) { ! super.initialise(_o); ! if (_o instanceof IParametresResultats) { ! IParametresResultats q= (IParametresResultats)_o; ! if (q.optionsListing() != null) ! optionsListing((IOptionsListing)q.optionsListing().creeClone()); ! if (q.paramStockage() != null) ! paramStockage((IParametresStockage)q.paramStockage().creeClone()); ! if (q.paramTailleMaxFichier() != null) ! paramTailleMaxFichier( ! (IParametresTailleMaxFichier)q.paramTailleMaxFichier().creeClone()); ! postRubens(q.postRubens()); ! postOpthyca(q.postOpthyca()); ! decalage(q.decalage()); ! if (q.variables() != null) { ! IDescriptionVariable[] ip= ! new IDescriptionVariable[q.variables().length]; ! for (int i= 0; i < ip.length; i++) ! ip[i]= (IDescriptionVariable)q.variables()[i].creeClone(); ! variables(ip); ! } ! } ! } ! final public IObjet creeClone() { ! IParametresResultats p= ! CDodico.findUsine().creeHydraulique1dParametresResultats(); ! p.initialise(tie()); ! return p; ! } ! final public String toString() { ! String s= "parametresResultats"; ! return s; ! } ! /*** IParametresResultats ***/ ! // constructeurs ! public DParametresResultats() { ! super(); ! optionsListing_= CDodico.findUsine().creeHydraulique1dOptionsListing(); ! paramStockage_= CDodico.findUsine().creeHydraulique1dParametresStockage(); ! paramStockage_= CDodico.findUsine().creeHydraulique1dParametresStockage(); ! paramTailleMaxFichier_= ! CDodico.findUsine().creeHydraulique1dParametresTailleMaxFichier(); ! postRubens_= false; ! postOptyca_= true; ! decalage_= 1.; ! variables_= new IDescriptionVariable[0]; ! ajouteVariable( ! "Y", ! "Hauteur d'eau maximale", ! LUnite.M, ! LTypeNombre.REEL, ! 3); ! ajouteVariable( ! "VMIN", ! "Vitesse mineur", ! LUnite.M_PAR_S, ! LTypeNombre.REEL, ! 4); ! ajouteVariable("ZREF", "Cote du fond", LUnite.M, LTypeNombre.REEL, 4); ! ajouteVariable("Z", "Cote de l'eau", LUnite.M, LTypeNombre.REEL, 3); ! ajouteVariable( ! "QMIN", ! "Débit mineur", ! LUnite.M3_PAR_S, ! LTypeNombre.REEL, ! 3); ! ajouteVariable( ! "QMAJ", ! "Débit majeur", ! LUnite.M3_PAR_S, ! LTypeNombre.REEL, ! 3); ! } ! public void dispose() { ! optionsListing_= null; ! paramStockage_= null; ! postRubens_= false; ! postOptyca_= false; ! decalage_= 0.; ! variables_= null; ! super.dispose(); ! } ! // Attributs ! private IOptionsListing optionsListing_; ! public IOptionsListing optionsListing() { ! return optionsListing_; ! } ! public void optionsListing(IOptionsListing s) { ! if (optionsListing_==s) return; ! optionsListing_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "optionsListing"); ! } ! private IParametresStockage paramStockage_; ! public IParametresStockage paramStockage() { ! return paramStockage_; ! } ! public void paramStockage(IParametresStockage s) { ! if (paramStockage_==s) return; ! paramStockage_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "paramStockage"); ! } ! private IParametresTailleMaxFichier paramTailleMaxFichier_; ! public IParametresTailleMaxFichier paramTailleMaxFichier() { ! return paramTailleMaxFichier_; ! } ! public void paramTailleMaxFichier(IParametresTailleMaxFichier t) { ! if (paramTailleMaxFichier_==t) return; ! paramTailleMaxFichier_= t; ! CDodico.findUsine().fireObjetModifie( ! toString(), ! tie(), ! "paramTailleMaxFichier"); ! } ! private boolean postRubens_; ! public boolean postRubens() { ! return postRubens_; ! } ! public void postRubens(boolean s) { ! if (postRubens_==s) return; ! postRubens_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "postRubens"); ! } ! private boolean postOptyca_; ! public boolean postOpthyca() { ! return postOptyca_; ! } ! public void postOpthyca(boolean s) { ! if (postOptyca_==s) return; ! postOptyca_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "postOpthyca"); ! } ! private double decalage_; ! public double decalage() { ! return decalage_; ! } ! public void decalage(double s) { ! if (decalage_==s) return; ! decalage_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "decalage"); ! } ! private IDescriptionVariable[] variables_; ! public IDescriptionVariable[] variables() { ! return variables_; ! } ! public void variables(IDescriptionVariable[] s) { ! if (egale(variables_,s)) return; ! variables_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "variables"); ! } ! // Méthodes ! public boolean existeVariable(String nomVariable) { ! boolean existe= false; ! for (int i= 0; i < variables_.length; i++) { ! if (variables_[i].nom().equals(nomVariable)) ! return true; ! } ! return existe; ! } ! public void ajouteVariable( ! String nom, ! String description, ! LUnite unite, ! LTypeNombre type, ! int nbDecimal) { ! if (existeVariable(nom)) return; ! IDescriptionVariable descrip= ! CDodico.findUsine().creeHydraulique1dDescriptionVariable(); ! descrip.nom(nom); ! descrip.description(description); ! descrip.unite(unite); ! descrip.type(type); ! descrip.nbDecimales(nbDecimal); ! List listVar = new ArrayList(Arrays.asList(variables_)); ! listVar.add(descrip); ! variables_= (IDescriptionVariable[])listVar.toArray(new IDescriptionVariable[0]); ! } ! public void supprimeVariable(String nomVariable) { ! Vector newVars= new Vector(); ! for (int i= 0; i < variables_.length; i++) { ! if (variables_[i].nom().equals(nomVariable)) { ! CDodico.findUsine().supprimeHydraulique1dDescriptionVariable( ! variables_[i]); ! } else ! newVars.add(variables_[i]); ! } ! variables_= new IDescriptionVariable[newVars.size()]; ! for (int i= 0; i < variables_.length; i++) ! variables_[i]= (IDescriptionVariable)newVars.get(i); ! } ! ! } |
From: <jm_...@us...> - 2004-03-12 19:59:04
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/hydraulique1d/casier In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv944/dodico/hydraulique1d/casier Modified Files: DPlanimetrageCasier.java DSeuilLiaison.java Log Message: Index: DPlanimetrageCasier.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/hydraulique1d/casier/DPlanimetrageCasier.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DPlanimetrageCasier.java 2 Dec 2003 19:54:40 -0000 1.4 --- DPlanimetrageCasier.java 12 Mar 2004 19:39:22 -0000 1.5 *************** *** 1,96 **** ! /* ! * @file DPlanimetrageCasier.java ! * @creation ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! * @mail de...@fu... ! */ ! package org.fudaa.dodico.hydraulique1d.casier; ! import org.fudaa.dodico.corba.geometrie.SPoint2D; ! import org.fudaa.dodico.corba.hydraulique1d.casier.IPlanimetrageCasier; ! import org.fudaa.dodico.corba.hydraulique1d.casier.IPlanimetrageCasierOperations; ! import org.fudaa.dodico.corba.objet.IObjet; ! import org.fudaa.dodico.objet.CDodico; ! /** ! * @version $Revision$ $Date$ by $Author$ ! * @author Jean-Marc Lacombe ! */ ! public final class DPlanimetrageCasier ! extends DGeometrieCasier ! implements IPlanimetrageCasierOperations { ! public String[] getInfos() { ! String[] res= new String[2]; ! res[0]= "Planimétrie"; ! res[1]= ""; ! return res; ! } ! /*** IPlanimetrageCasier ***/ ! public void initialise(IObjet _o) { ! super.initialise(_o); ! if (_o instanceof IPlanimetrageCasier) { ! IPlanimetrageCasier q= (IPlanimetrageCasier)_o; ! coteInitiale(q.coteInitiale()); ! points((SPoint2D[])q.points().clone()); ! } ! } ! final public IObjet creeClone() { ! IPlanimetrageCasier p= ! CDodico.findUsine().creeHydraulique1dPlanimetrageCasier(); ! p.initialise(tie()); ! return p; ! } ! // constructeurs ! public DPlanimetrageCasier() { ! super(); ! coteInitiale_= 0; ! points_= new SPoint2D[0]; ! } ! public void dispose() { ! coteInitiale_= -1; ! points_= null; ! super.dispose(); ! } ! // attributs ! private double coteInitiale_; ! public double coteInitiale() { ! return coteInitiale_; ! } ! public void coteInitiale(double coteInitiale) { ! if (coteInitiale_==coteInitiale) return; ! coteInitiale_= coteInitiale; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "coteInitiale"); ! } ! private SPoint2D[] points_; ! public SPoint2D[] points() { ! return points_; ! } ! public void points(SPoint2D[] points) { ! if (egale(points_, points)) return; ! points_= points; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "points"); ! } ! private final static boolean egale(SPoint2D[] p, SPoint2D[] p2) { ! if (p==p2) return true; ! if (p==null || p2==null) return false; ! ! int length = p.length; ! if (p2.length != length) return false; ! ! for (int i=0; i<length; i++) ! if (!((p[i].x==p2[i].x)&&(p[i].y==p2[i].y))) ! return false; ! ! return true; ! } ! // les méthodes ! public SPoint2D[] getPointsPlanimetrage() { ! return points_; ! } ! public void setPointsPlanimetrage(SPoint2D[] points) { ! points(points); ! } ! public boolean isPlanimetrage() { ! return true; ! } ! } --- 1,96 ---- ! /* ! * @file DPlanimetrageCasier.java ! * @creation ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! * @mail de...@fu... ! */ ! package org.fudaa.dodico.hydraulique1d.casier; ! import org.fudaa.dodico.corba.geometrie.SPoint2D; ! import org.fudaa.dodico.corba.hydraulique1d.casier.IPlanimetrageCasier; ! import org.fudaa.dodico.corba.hydraulique1d.casier.IPlanimetrageCasierOperations; ! import org.fudaa.dodico.corba.objet.IObjet; ! import org.fudaa.dodico.objet.CDodico; ! /** ! * @version $Revision$ $Date$ by $Author$ ! * @author Jean-Marc Lacombe ! */ ! public final class DPlanimetrageCasier ! extends DGeometrieCasier ! implements IPlanimetrageCasierOperations { ! public String[] getInfos() { ! String[] res= new String[2]; ! res[0]= "Zfond : "+coteInitiale_+" Planimétrie "; ! res[1]= ""; ! return res; ! } ! /*** IPlanimetrageCasier ***/ ! public void initialise(IObjet _o) { ! super.initialise(_o); ! if (_o instanceof IPlanimetrageCasier) { ! IPlanimetrageCasier q= (IPlanimetrageCasier)_o; ! coteInitiale(q.coteInitiale()); ! points((SPoint2D[])q.points().clone()); ! } ! } ! final public IObjet creeClone() { ! IPlanimetrageCasier p= ! CDodico.findUsine().creeHydraulique1dPlanimetrageCasier(); ! p.initialise(tie()); ! return p; ! } ! // constructeurs ! public DPlanimetrageCasier() { ! super(); ! coteInitiale_= 0; ! points_= new SPoint2D[0]; ! } ! public void dispose() { ! coteInitiale_= -1; ! points_= null; ! super.dispose(); ! } ! // attributs ! private double coteInitiale_; ! public double coteInitiale() { ! return coteInitiale_; ! } ! public void coteInitiale(double coteInitiale) { ! if (coteInitiale_==coteInitiale) return; ! coteInitiale_= coteInitiale; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "coteInitiale"); ! } ! private SPoint2D[] points_; ! public SPoint2D[] points() { ! return points_; ! } ! public void points(SPoint2D[] points) { ! if (egale(points_, points)) return; ! points_= points; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "points"); ! } ! private final static boolean egale(SPoint2D[] p, SPoint2D[] p2) { ! if (p==p2) return true; ! if (p==null || p2==null) return false; ! ! int length = p.length; ! if (p2.length != length) return false; ! ! for (int i=0; i<length; i++) ! if (!((p[i].x==p2[i].x)&&(p[i].y==p2[i].y))) ! return false; ! ! return true; ! } ! // les méthodes ! public SPoint2D[] getPointsPlanimetrage() { ! return points_; ! } ! public void setPointsPlanimetrage(SPoint2D[] points) { ! points(points); ! } ! public boolean isPlanimetrage() { ! return true; ! } ! } Index: DSeuilLiaison.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/hydraulique1d/casier/DSeuilLiaison.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DSeuilLiaison.java 23 Jan 2004 16:26:01 -0000 1.6 --- DSeuilLiaison.java 12 Mar 2004 19:39:22 -0000 1.7 *************** *** 1,120 **** ! /* ! * @file DSeuilLiaison.java ! * @creation ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! * @mail de...@fu... ! */ ! package org.fudaa.dodico.hydraulique1d.casier; ! import org.fudaa.dodico.corba.hydraulique1d.casier.ISeuilLiaison; ! import org.fudaa.dodico.corba.hydraulique1d.casier.ISeuilLiaisonOperations; ! import org.fudaa.dodico.corba.objet.IObjet; ! import org.fudaa.dodico.objet.CDodico; ! /** ! * @version $Revision$ $Date$ by $Author$ ! * @author Jean-Marc Lacombe ! */ ! public final class DSeuilLiaison ! extends DCaracteristiqueLiaison ! implements ISeuilLiaisonOperations { ! public void initialise(IObjet _o) { ! super.initialise(_o); ! if (_o instanceof ISeuilLiaison) { ! ISeuilLiaison q= (ISeuilLiaison)_o; ! largeur(q.largeur()); ! coefQ(q.coefQ()); ! coefActivation(q.coefActivation()); ! } ! } ! final public IObjet creeClone() { ! ISeuilLiaison p= CDodico.findUsine().creeHydraulique1dSeuilLiaison(); ! p.initialise(tie()); ! return p; ! } ! public String[] getInfos() { ! String[] res= new String[2]; ! res[0]= "Seuil"; ! res[1]= ! super.getInfos()[1] ! + " larg. : " ! + largeur_ ! + " coef. Q : " ! + coefQ_ ! + " coef. Ennoiment : " ! + coefActivation_; ! return res; ! } ! /*** ILiaison ***/ ! // constructeurs ! public DSeuilLiaison() { ! super(); ! largeur_= 1; ! coefQ_= 0.40; ! coefActivation_= 0.50; ! } ! public void dispose() { ! id_= 0; ! largeur_= 0; ! coefQ_= 0; ! coefActivation_= 0; ! super.dispose(); ! } ! /*** ISeuilLiaison ***/ ! // attributs ! private double largeur_; ! public double largeur() { ! return largeur_; ! } ! public void largeur(double s) { ! if (largeur_==s) return; ! largeur_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "largeur"); ! } ! private double coefQ_; ! public double coefQ() { ! return coefQ_; ! } ! public void coefQ(double s) { ! if (coefQ_==s) return; ! coefQ_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "coefQ"); ! } ! private double coefActivation_; ! public double coefActivation() { ! return coefActivation_; ! } ! public void coefActivation(double s) { ! if (coefActivation_==s) return; ! coefActivation_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "coefActivation"); ! } ! // méthodes ! public boolean isSeuil() { ! return true; ! } ! public double getLargeur() { ! return largeur(); ! } ! public void setLargeur(double largeur) { ! largeur(largeur); ! } ! public double getCoefQ() { ! return coefQ(); ! } ! public void setCoefQ(double coefQ) { ! coefQ(coefQ); ! } ! public double getCoefActivation() { ! return coefActivation(); ! } ! public void setCoefActivation(double coefActivation) { ! coefActivation(coefActivation); ! } ! public double getCoteMoyenneCrete() { ! return cote(); ! } ! public void setCoteMoyenneCrete(double coteMoyenneFond) { ! cote(coteMoyenneFond); ! } ! } --- 1,120 ---- ! /* ! * @file DSeuilLiaison.java ! * @creation ! * @modification $Date$ ! * @license GNU General Public License 2 ! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne ! * @mail de...@fu... ! */ ! package org.fudaa.dodico.hydraulique1d.casier; ! import org.fudaa.dodico.corba.hydraulique1d.casier.ISeuilLiaison; ! import org.fudaa.dodico.corba.hydraulique1d.casier.ISeuilLiaisonOperations; ! import org.fudaa.dodico.corba.objet.IObjet; ! import org.fudaa.dodico.objet.CDodico; ! /** ! * @version $Revision$ $Date$ by $Author$ ! * @author Jean-Marc Lacombe ! */ ! public final class DSeuilLiaison ! extends DCaracteristiqueLiaison ! implements ISeuilLiaisonOperations { ! public void initialise(IObjet _o) { ! super.initialise(_o); ! if (_o instanceof ISeuilLiaison) { ! ISeuilLiaison q= (ISeuilLiaison)_o; ! largeur(q.largeur()); ! coefQ(q.coefQ()); ! coefActivation(q.coefActivation()); ! } ! } ! final public IObjet creeClone() { ! ISeuilLiaison p= CDodico.findUsine().creeHydraulique1dSeuilLiaison(); ! p.initialise(tie()); ! return p; ! } ! public String[] getInfos() { ! String[] res= new String[2]; ! res[0]= "Seuil"; ! res[1]= ! super.getInfos()[1] ! + " larg. : " ! + largeur_ ! + " coef. Q : " ! + coefQ_ ! + " coef. Activation : " ! + coefActivation_; ! return res; ! } ! /*** ILiaison ***/ ! // constructeurs ! public DSeuilLiaison() { ! super(); ! largeur_= 1; ! coefQ_= 0.40; ! coefActivation_= 0.50; ! } ! public void dispose() { ! id_= 0; ! largeur_= 0; ! coefQ_= 0; ! coefActivation_= 0; ! super.dispose(); ! } ! /*** ISeuilLiaison ***/ ! // attributs ! private double largeur_; ! public double largeur() { ! return largeur_; ! } ! public void largeur(double s) { ! if (largeur_==s) return; ! largeur_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "largeur"); ! } ! private double coefQ_; ! public double coefQ() { ! return coefQ_; ! } ! public void coefQ(double s) { ! if (coefQ_==s) return; ! coefQ_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "coefQ"); ! } ! private double coefActivation_; ! public double coefActivation() { ! return coefActivation_; ! } ! public void coefActivation(double s) { ! if (coefActivation_==s) return; ! coefActivation_= s; ! CDodico.findUsine().fireObjetModifie(toString(), tie(), "coefActivation"); ! } ! // méthodes ! public boolean isSeuil() { ! return true; ! } ! public double getLargeur() { ! return largeur(); ! } ! public void setLargeur(double largeur) { ! largeur(largeur); ! } ! public double getCoefQ() { ! return coefQ(); ! } ! public void setCoefQ(double coefQ) { ! coefQ(coefQ); ! } ! public double getCoefActivation() { ! return coefActivation(); ! } ! public void setCoefActivation(double coefActivation) { ! coefActivation(coefActivation); ! } ! public double getCoteMoyenneCrete() { ! return cote(); ! } ! public void setCoteMoyenneCrete(double coteMoyenneFond) { ! cote(coteMoyenneFond); ! } ! } |
From: <de...@us...> - 2004-03-12 16:11:16
|
Update of /cvsroot/fudaa/fudaa_devel/ctulu/src/org/fudaa/ctulu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16275/src/org/fudaa/ctulu Modified Files: CtuluGeometrie.java Log Message: Update ctulu Index: CtuluGeometrie.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/ctulu/src/org/fudaa/ctulu/CtuluGeometrie.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CtuluGeometrie.java 12 Feb 2004 15:23:01 -0000 1.1 --- CtuluGeometrie.java 12 Mar 2004 15:51:38 -0000 1.2 *************** *** 14,56 **** */ public class CtuluGeometrie { private CtuluGeometrie() {} /** ! * Renvoie la distance entre le point p1(_x1,_y1) et le ! * point p2(_x2,_y2) */ public final static double getDistance( ! double _x1, ! double _y1, ! double _x2, ! double _y2) { return Math.sqrt((_x2 - _x1) * (_x2 - _x1) + (_y2 - _y1) * (_y2 - _y1)); } /** ! * Renvoie la norme au carre. */ public final static double getD2( ! double _x1, ! double _y1, ! double _x2, ! double _y2) { return (_x2 - _x1) * (_x2 - _x1) + (_y2 - _y1) * (_y2 - _y1); } /** ! * Renvoie la distance entre le point p(_x,_y) et ! * le segment [P1,P2] P1=_segX1,_segY1. ! * Tester dans ebli */ public final static double distanceFromSegment( ! double _segX1, ! double _segY1, ! double _segX2, ! double _segY2, ! double _x, ! double _y) { ! if ((_segX1 == _segX2) && (_segY1 == _segY2)) { ! return getDistance(_segX1, _segY1, _x, _y); } //P1=(_x1,_y1) --- 14,70 ---- */ public class CtuluGeometrie { + private CtuluGeometrie() {} + /** ! * @param _x1 x du point 1 ! * @param _y1 y du point 1 ! * @param _x2 x du point 2 ! * @param _y2 y du point 2 ! * @return Renvoie la distance entre le point p1(_x1,_y1) et le point p2(_x2,_y2) */ public final static double getDistance( ! double _x1, ! double _y1, ! double _x2, ! double _y2) { return Math.sqrt((_x2 - _x1) * (_x2 - _x1) + (_y2 - _y1) * (_y2 - _y1)); } /** ! * @param _x1 x du point 1 ! * @param _y1 y du point 1 ! * @param _x2 x du point 2 ! * @param _y2 y du point 2 ! * @return Renvoie la norme au carre. */ public final static double getD2( ! double _x1, ! double _y1, ! double _x2, ! double _y2) { return (_x2 - _x1) * (_x2 - _x1) + (_y2 - _y1) * (_y2 - _y1); } /** ! * @param _segX1 x du point 1 du segment ! * @param _segY1 y du point 1 du segment ! * @param _segX2 x du point 2 du segment ! * @param _segY2 y du point 2 du segment ! * @param _x x du point a considerer ! * @param _y y du point a considerer ! * @return Renvoie la distance entre le point p(_x,_y) et le segment [P1,P2] P1=_segX1,_segY1. ! * Tester dans ebli */ public final static double distanceFromSegment( ! double _segX1, ! double _segY1, ! double _segX2, ! double _segY2, ! double _x, ! double _y) { ! if ((_segX1 == _segX2) && (_segY1 == _segY2)) { ! return getDistance(_segX1, _segY1, _x, _y); } //P1=(_x1,_y1) *************** *** 61,85 **** //On calcule la projection de A sur B //le produit scalaire ! double p= ! (_x - _segX1) * (_segX2 - _segX1) + (_y - _segY1) * (_segY2 - _segY1); //si le point est "en dehors" du segment ,on prend la distance X P1 ! if (p < 0) ! return getDistance(_x, _y, _segX1, _segY1); //le produit scalaire/norme de B ! p= ! p ! / ((_segX2 - _segX1) * (_segX2 - _segX1) ! + (_segY2 - _segY1) * (_segY2 - _segY1)); //si p>1 p est en dehors du segment ! if (p > 1) { ! return getDistance(_x, _y, _segX2, _segY2); } //le vecteur projete a pour coordonnees PROJ: ! double projx= p * (_segX2 - _segX1); ! double projy= p * (_segY2 - _segY1); ! //le vecteur de norme (on reutilise le variable projx) ! projx= (_x - _segX1) - projx; ! projy= (_y - _segY1) - projy; return Math.sqrt(projx * projx + projy * projy); } --- 75,99 ---- //On calcule la projection de A sur B //le produit scalaire ! double p = ! (_x - _segX1) * (_segX2 - _segX1) + (_y - _segY1) * (_segY2 - _segY1); //si le point est "en dehors" du segment ,on prend la distance X P1 ! if (p < 0) ! return getDistance(_x, _y, _segX1, _segY1); //le produit scalaire/norme de B ! p = ! p ! / ((_segX2 - _segX1) * (_segX2 - _segX1) ! + (_segY2 - _segY1) * (_segY2 - _segY1)); //si p>1 p est en dehors du segment ! if (p > 1) { ! return getDistance(_x, _y, _segX2, _segY2); } //le vecteur projete a pour coordonnees PROJ: ! double projx = p * (_segX2 - _segX1); ! double projy = p * (_segY2 - _segY1); ! //le vecteur de norme (on reutilise le variable projx) ! projx = (_x - _segX1) - projx; ! projy = (_y - _segY1) - projy; return Math.sqrt(projx * projx + projy * projy); } *************** *** 87,110 **** /** * Tester dans dodico TestMaillage */ public final static double aireTriangle( ! double _x1, ! double _y1, ! double _x2, ! double _y2, ! double _x3, ! double _y3) { ! double p= (_x3 - _x1) * (_x2 - _x1) + (_y3 - _y1) * (_y2 - _y1); ! double d1d2= getDistance(_x1, _y1, _x2, _y2); //le produit scalaire/norme de B ! p= p / (d1d2 * d1d2); //le vecteur projete a pour coordonnees PROJ: ! double projx= p * (_x2 - _x1); ! double projy= p * (_y2 - _y1); ! //le vecteur de norme (on reutilise le variable projx) ! projx= (_x3 - _x1) - projx; ! projy= (_y3 - _y1) - projy; return d1d2 * Math.sqrt(projx * projx + projy * projy) / 2; } - } --- 101,130 ---- /** * Tester dans dodico TestMaillage + * @param _x1 x de P1 + * @param _y1 y de P1 + * @param _x2 x de P2 + * @param _y2 y de P2 + * @param _x3 x de P3 + * @param _y3 y de P3 + * @return l'aire du triangle P1P2P3 */ public final static double aireTriangle( ! double _x1, ! double _y1, ! double _x2, ! double _y2, ! double _x3, ! double _y3) { ! double p = (_x3 - _x1) * (_x2 - _x1) + (_y3 - _y1) * (_y2 - _y1); ! double d1d2 = getDistance(_x1, _y1, _x2, _y2); //le produit scalaire/norme de B ! p = p / (d1d2 * d1d2); //le vecteur projete a pour coordonnees PROJ: ! double projx = p * (_x2 - _x1); ! double projy = p * (_y2 - _y1); ! //le vecteur de norme (on reutilise le variable projx) ! projx = (_x3 - _x1) - projx; ! projy = (_y3 - _y1) - projy; return d1d2 * Math.sqrt(projx * projx + projy * projy) / 2; } } |
From: <de...@us...> - 2004-03-12 16:11:16
|
Update of /cvsroot/fudaa/fudaa_devel/ctulu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16275 Modified Files: build.xml Log Message: Update ctulu Index: build.xml =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/ctulu/build.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** build.xml 12 Feb 2004 16:41:21 -0000 1.7 --- build.xml 12 Mar 2004 15:51:39 -0000 1.8 *************** *** 340,344 **** ---CTULU:suppression de ${ctulu.classes.dir}--- </echo> ! <delete includeEmptyDirs="true"> <fileset dir="${ctulu.classes.dir}"/> </delete> --- 340,344 ---- ---CTULU:suppression de ${ctulu.classes.dir}--- </echo> ! <delete includeEmptyDirs="true" quiet="true"> <fileset dir="${ctulu.classes.dir}"/> </delete> *************** *** 353,357 **** ---CTULU:effacement de ${ctulu.build.dir}--- </echo> ! <delete includeEmptyDirs="true"> <fileset dir="${ctulu.build.dir}"/> </delete> --- 353,357 ---- ---CTULU:effacement de ${ctulu.build.dir}--- </echo> ! <delete includeEmptyDirs="true" quiet="true"> <fileset dir="${ctulu.build.dir}"/> </delete> |